简体   繁体   中英

Maven-site-plugin could not load generated sources (Jaxb)

I try to build my java Project with the maven:site plugin. For that I use a Jenkins Server and configure the mvn goals: clean install site

My Pom has the following Plugins:

...
 <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.5</version>
                <configuration>
                    <goal>generate-sources</goal>
                    <generateReports>true</generateReports>
                </configuration>
            </plugin>
 <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
                <configuration>
                    <show>private</show>
                </configuration>
            </plugin>
 <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.17</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>checkstyle</report>
                        </reports>
                    </reportSet>
                </reportSets>
                <configuration>
                    <failsOnError>true</failsOnError>
                    <configLocation>checkstyle.xml</configLocation>
                </configuration>
            </plugin>
..

The Programm runs and the generated Classes are available. But if i made a site-build i get the error that the generated package doesn't exist.

Thank you for your help

I used this in pom where jaxb is:

           <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals><goal>add-source</goal></goals>
                        <configuration>
                            <sources>
                                <source>target/generated-sources/jaxb/</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM