首先检查maven deploy plugin版本,有部分属性是高版本才能用,可以查看文档:http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html#sources
高版本发布
1 2 3 4 5 6 7 8 9 10 11 |
mvn deploy:deploy-file \ -DgroupId=com.xxx.slidingmenu \ -DartifactId=library \ -Dversion=1.3 \ -Dpackaging=jar \ -Dfile=library-1.3.aar \ -Dsources=library-1.3-sources.jar \ -DpomFile=library-1.3.pom \ —Djavadoc=library-1.3-javadoc.jar \ -Durl=http://host/nexus/content/repositories/thirdparty/ \ -DrepositoryId=thirdparty |
如果版本正确,还是不能上传,可能提示“The goal you specified requires a project to execute but there is no POM in this directory” ,其实跟POM文件没有关系,可以采用以下分步上传
1.发布源文件包
1 2 3 4 5 6 7 |
mvn deploy:deploy-file -Dfile=whack-1.0.0-sources.jar \ -Dclassifier=sources -DgroupId=org.igniterealtime \ -DartifactId=whack \ -Dversion=1.0.0 \ -Dpackaging=jar \ -Durl=https://myhost.com/nexus/content/repositories/thirdparty/ |
2.发布Javadoc包
1 2 3 4 5 6 7 |
mvn deploy:deploy-file -Dfile=whack-1.0.0-javadoc.jar \ -Dclassifier=javadoc -DgroupId=org.igniterealtime \ -DartifactId=whack \ -Dversion=1.0.0 \ -Dpackaging=jar \ -Durl=https://myhost.com/nexus/content/repositories/thirdparty/ |
其他包类似