标签:maven release central repository 中央库 gpg
步骤一:注册账号,申请ticket。1).m2\settings.xml文件中要加入:
<servers> <server> <id>sonatype-nexus-snapshots</id> <username>your-jira-username</username> <password>your-jira-password</password> </server> <server> <id>sonatype-nexus-staging</id> <username>your-jira-username</username> <password>your-jira-password</password> </server> </servers>2) pom.xml文件中要加入(project标签下):
<parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>7</version> </parent>
3)如果出现javadoc编译不通过的可以在javadoc插件下加入:
<configuration> <additionalparam>-Xdoclint:none</additionalparam> </configuration>
4) 注意如过时release要加入:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <version>${maven-gpg-plugin.version}</version> <executions> <execution> <phase>verify</phase> <goals> <goal>sign</goal> </goals> </execution> </executions> </plugin>
5) 如果是java web项目,javadoc可能会报错:找不到类javax.servlet.ServletContext,可以添加依赖:
<dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency>
6) POM编写可参考https://github.com/ACC-GIT/ACCWeb/blob/master/pom.xml
步骤四:release和提示同步。maven发布jar、aar、war等到中央库(Central Repository)的步骤
标签:maven release central repository 中央库 gpg
原文地址:http://blog.csdn.net/afirsraftgarrier/article/details/46452935