读书人

自动封装发布源代码

发布时间: 2012-10-05 15:34:34 作者: rapoo

自动打包,发布源代码
maven-source-plugin提供项目自动将源码打包并发布的功能:

<plugin><artifactId>maven-source-plugin</artifactId><version>2.1.2</version><executions><execution><goals><goal>jar</goal></goals></execution></executions></plugin>


mvn install,maven会自动将source install到repository
mvn deploy,maven会自动将source deploy到remote-repository

注意:在多项目构建中,将source-plugin置于顶层或parent的pom中并不会发挥作用,必须置于具体项目的pom中

资料:http://www.avajava.com/tutorials/lessons/how-do-i-generate-and-deploy-a-source-jar-file-for-my-project.html?page=1

读书人网 >软件开发

热点推荐