简体   繁体   English

使用Maven部署到Artifactory时排除文件

[英]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.

相关问题 使用 maven 部署到工件时出错 - Error on deploying to artifactory using maven 使用jenkins将文件部署为Artifactory作为Maven artefact而不使用maven - Deploying file with jenkins to Artifactory as Maven artefact without using maven 使用 Jenkins 将二进制文件与 JAR 文件一起发布到 maven artifactory - Publish binary file to maven artifactory along with JAR files using Jenkins MojoExecutionException:使用Maven部署到APIGEE时出现NullPointerException - MojoExecutionException: NullPointerException while deploying to APIGEE using Maven 如何使用Artifactory插件和Credentials插件将Jenven的Maven工件部署到Artifactory时解决401失败? - How can I resolve a 401 failure when deploying a Maven artifact from Jenkins to Artifactory using the Artifactory Plugin and the Credentials Plugin? Jenkins:从artifactory部署war文件 - Jenkins: deploying war files from artifactory 在Maven中打包时不包括资源 - Excluding Resource while packaging in maven Maven:在编译中排除java文件 - Maven: excluding java files in compilation Spring Cloud Contract没有部署到Maven多模块项目中的Artifactory - Spring Cloud Contract not deploying to Artifactory in Maven multi module projects 将Maven工件从Artifactory部署到WebLogic12c - Deploying Maven artifacts from Artifactory to WebLogic12c
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM