[英]Excluding files while deploying to Artifactory using Maven
We are working with Maven 3.3.9 version, and deploying to v using Maven. 我们正在使用Maven 3.3.9版本,并使用Maven部署到v。 where we added distribution management within pom.xml and running Maven goal "mvn clean deploy". 我们在pom.xml中添加了分发管理,并运行了Maven目标“ mvn clean deploy”。 Till now everything is working fine and all the files like .pom,.jar,.xml etc are deploying to Artifactory. 到现在为止,一切正常,并且.pom,.jar,.xml等所有文件都已部署到Artifactory。
Now, we got a scenario where we want to deploy only jar file and exclude all other files while deploying using Maven. 现在,我们有了一个场景,我们希望只部署jar文件,而在使用Maven进行部署时排除所有其他文件。
I have tried as mentioned here http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploying-with-classifiers.html by using 我已经尝试过使用http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploying-with-classifiers.html此处提到的方法
mvn deploy -Dtypes=jar
but no luck. mvn deploy -Dtypes=jar
但没有运气。
How to exclude files while deploying to artifactory using Maven? 使用Maven部署到工件时如何排除文件?
I'm using maven-artifactory-plugin to deploy Maven projects to Artifactory. 我正在使用maven-artifactory-plugin将Maven项目部署到Artifactory。 And it has <excludePatterns>
configuration which allows to suppress deployment of files. 它具有<excludePatterns>
配置,该配置允许禁止文件部署。 The following config will deploy only .war file and not .pom 以下配置将仅部署.war文件,而不部署.pom
<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<version>2.6.1</version>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>publish</goal>
</goals>
<configuration>
<publisher>
<contextUrl>https://artifactory.your.company.com/artifactory</contextUrl>
<username>${artifactory.user}</username>
<excludePatterns>*.pom</excludePatterns>
<password>${artifactory.key}</password>
<repoKey>release-repo</repoKey>
<snapshotRepoKey>snapshot-repo</snapshotRepoKey>
</publisher>
</configuration>
</execution>
</executions>
</plugin>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.