nexus上传jar到snapshots

nexus上传jar到snapshots,页面无法操作。可以用命令上传。

mvn -X deploy:deploy-file -Dmaven.test.skip=true -DgroupId=aaa.bbb.ccc -DartifactId=ddd -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=C:\ddd-1.0-SNAPSHOT.jar -Durl=http://用户名:密码@地址:端口号/nexus/content/repositories/snapshots

注意:jar包不要放在本地仓库路径下。会报类似错误:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: Cannot deploy artifact from the local repository: C:\仓库路径\包路径\ddd-1.0-SNAPSHOT.jar

Caused by: org.apache.maven.plugin.MojoFailureException: Cannot deploy artifactfrom the local repository: C:\仓库路\包路径\ddd-1.0-SNAPSHOT.jar
        at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.
java:283)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
        ... 20 more

 

参考:https://blog.csdn.net/zhujianlin1990/article/details/79740143

你可能感兴趣的:(nexus)