Maven打包jar生成javadoc文件和source文件代码实例
人气:0这篇文章主要介绍了Maven打包jar生成javadoc文件和source文件代码实例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
官方文章 : https://maven.apache.org/plugin-developers/cookbook/attach-source-javadoc-artifacts.html
生成文件的样本
attach-source-javadoc |-- pom.xml |-- src\ `-- target `-- attach-source-javadoc-1.0-SNAPSHOT.jar `-- attach-source-javadoc-1.0-SNAPSHOT-javadoc.jar `-- attach-source-javadoc-1.0-SNAPSHOT-sources.jar
配置Maven源插件
生成source:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin>
生成javadoc:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin>
运行Maven
mvn clean package -Dmaven.test.skip=true
您可能感兴趣的文章:
加载全部内容