mvn部署特定网址

时间:2017-07-20 08:13:58

标签: maven nexus

尝试将工件部署到nexus,但它必须位于忽略groupId的特定位置。有没有办法做到这一点?

<groupId>com.company.team</groupId>
<artifactId>project</artifactId>
<version>0.0.3-SNAPSHOT</version>

我们内部存储库的网址是:

http://repo.com/teamRepo/somedir/artifact/version/

但maven部署(按预期)上传到:

http://repo.com/teamRepo/com/company/team/artifact/version/

1 个答案:

答案 0 :(得分:0)

能够通过使用mvn deploy:deploy-file命令执行此操作:

 mvn deploy:deploy-file -Durl=https://repo.com/teamRepo -DgroupId=team -DartifactId=artifact -Dversion=0.0.3 -Dpackaging=tar.gz -DskipTests -Dmaven.install.skip=true -DrepositoryId=repoId -Dfile=target/artifact.tar.gz

使用-DrepositoryId允许使用根据此答案存储的凭据Maven: Trying to Deploy with credentials in settings.xml file