mvn deploy到nexus的snapshots Repository出现Return code is: 400

现象:
settings.xml已经配置好server和mirror,并且ID都为nexus-snapshots
运行:mvn deploy:deploy-file -DgroupId=pentaho-kettle -DartifactId=engine -Dversion=5.4 -Dpackaging=jar -Dfile=C:\git\transformer-core\mcetl\engine\dist\kettle-engine-5.4-SNAPSHOT.jar -Durl=http://url:8081/nexus/content/repositories/snapshots/ -DrepositoryId=nexus-snapshots
报错:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact pentaho-kettle:engine:jar:5.4 from/to nexus-snapshots (http://url:8081/nexus/content/repositories/snapshots/): Failed to transfer file: http://url:8081/nexus/content/repositories/snapshots/pentaho-kettle/engine/5.4/engine-5.4.jar. Return code is: 400, ReasonPhrase: Bad Request. -> [Help 1]

解决:
mvn deploy:deploy-file -DgroupId=pentaho-kettle -DartifactId=engine -Dversion=5.4-SNAPSHOT -Dpackaging=jar -Dfile=C:\git\transformer-core\mcetl\engine\dist\kettle-engine-5.4-SNAPSHOT.jar -Durl=http://url:8081/nexus/content/repositories/snapshots/ -DrepositoryId=nexus-snapshots

即上传到snapshots时需要在Dversion上添加-SNAPSHOT

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据