前言:打源码包,让别人更容易看懂你写的代码
1.在pom.xml中加入这句话
<build>
<plugins>
<!-- 要将源码放上去,需要加入这个插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
2.用cmd命令到你的项目文件夹(打包第一种办法)
执行:mvn clean deploy
2.在eclipse中输入该语句(打包第二种办法)
.
完成了,快去私库看下你成功了没
本文介绍如何使用Maven插件打包源码包,包括在pom.xml中配置maven-source-plugin,以及通过命令行或Eclipse进行打包的具体步骤。
367

被折叠的 条评论
为什么被折叠?



