1.Javadoc打包部署
1.1 javadoc插件配置如下
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>install</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<encoding>UTF-8</encoding>
<charset>UTF-8</charset>
</configuration>
<show>private</show>
</plugin>
1.2 jdk1.7和jdk1.8
1.2.1 jdk1.7一下使用maven的javadoc插件执行 javadoc:jar deploy 即可。
1.2.2 jdk1.8对javadoc的要求比较严格,注释必须是按照一定要求编写,不符合规则会报错和警告,可能导致生成javadoc失败,解决思路如下:
- 【推荐】根据提示更改注释,到符合jdk8的要求
- 更改插件配置,使其忽略jdk8对javadoc的标准要求,配置如下
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>install</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<encoding>UTF-8</encoding>
<charset>UTF-8</charset>
<additionalOptions>
<additionalOption>-Xdoclint:none</additionalOption>
</additionalOptions>
<show>private</show>
</configuration>
</plugin>
网友评论