[英]is is possible to install the source and javadoc jar to maven repository along with a single command `mvn clean all`
As we all know that using mvn clean install
will install the built package,eg jar, zip, pom, to local repo , but source and javadoc jar . 众所周知,使用
mvn clean install
将安装的软件包(例如jar,zip,pom)安装到本地repo,但将源和javadoc jar安装到本地。 Can I make some changes on pom.xml
so that source and jardoc jar would be installed to local repo with mvn clean install
我可以对
pom.xml
进行一些更改,以便使用mvn clean install
将源和jardoc jar安装到本地存储库中
Yes, what you want to do is to add the maven-source-plugin and maven-javadoc-plugin to your pom. 是的,您要做的是将maven-source-plugin和maven-javadoc-plugin添加到pom中。 This will cause the jar goal to execute automatically during the package phase without needing to specify it on the command line.
这将导致jar目标在打包阶段自动执行,而无需在命令行上指定它。
<plugins>
<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>
<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>
...
<plugins>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.