我尝试使用maven:site插件构建我的java项目。 为此,我使用Jenkins服务器并配置mvn目标:clean install site
我的Pom有以下插件:
...
<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>
..
程序运行,生成的类可用。但是,如果我进行了网站构建,我会得到生成的包不存在的错误。
感谢您的帮助
答案 0 :(得分:0)
我在pom中使用了这个,其中jaxb是:
<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>