use*_*943 17 teamcity artifactory maven
我需要向Artifactory部署一个自定义jar以及从我的Java项目生成的jar.目前我能找到的唯一方法是通过命令行目标使用:
mvn deploy:deploy-file -DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion=<version> \
-Dpackaging=<type-of-packaging> \
-Dfile=<path-to-file> \
-Durl=<url-of-the-repository-to-deploy>
Run Code Online (Sandbox Code Playgroud)
有没有办法将其包含在pom文件中?作为一个插件还是什么?
Tun*_*aki 15
当然.只需定义maven-deploy-plugin:deploy-file绑定到deploy阶段的目标的执行,并使用您的值进行配置.部署项目时,将调用此执行并部署JAR.
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<executions>
<execution>
<id>deploy-file</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<file><!-- path-to-file --></file>
<url><!-- url-of-the-repository-to-deploy --></url>
<groupId><!-- group-id --></groupId>
<artifactId><!-- artifact-id --></artifactId>
<version><!-- version --></version>
<packaging><!-- type-of-packaging --></packaging>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
请注意,您可能还需要添加一个repositoryId.这是要映射到<id>的<server>部分下的服务器ID settings.xml.
| 归档时间: |
|
| 查看次数: |
24402 次 |
| 最近记录: |