简体   繁体   English

使用 JFrog CLI 部署到 Artifactory 时,有没有办法排除某些 Maven 工件?

[英]Is there any way to exclude certain Maven artifacts when deploying to Artifactory with JFrog CLI?

I'm trying to automate a Gitlab CI/CD pipeline for building and deploying a multi-module Maven project to Artifactory.我正在尝试自动化 Gitlab CI/CD 管道,用于构建多模块 Maven 项目并将其部署到 Artifactory。 I came across the JFrog CLI tool, but I have an issue due to the fact that there are some jars in my projects that have to be excluded from deployment.我遇到了 JFrog CLI 工具,但我遇到了一个问题,因为我的项目中有一些 jar 必须从部署中排除。

The command I execute is something like this:我执行的命令是这样的:

./jfrog rt mvn "clean install pom.xml" configuration.yml --build-name="something" --build-number="something"

In the documentation I cannot see any "--exclusions" parameter that I can configure.在文档中,我看不到任何可以配置的“--exclusions”参数。

How can I can configure an exclude pattern the same way I can with Jenkins Artifactory Plugin?如何像使用 Jenkins Artifactory 插件一样配置排除模式? Jenkins Artifactory plugin - exclude patterns Jenkins Artifactory 插件 - 排除模式

This feature is not yet officially supported in the JFrog CLI. JFrog CLI 尚未正式支持此功能。

However, as a workaround, you can provide the artifactory.publish.excludePatterns Java property with a comma-separated list of excluded paths:但是,作为一种解决方法,您可以为artifactory.publish.excludePatterns Java 属性提供一个以逗号分隔的排除路径列表:

jfrog rt mvn clean install -Dartifactory.publish.excludePatterns="exclude-pattern-1,exclude-pattern-2"

# Example:
jfrog rt mvn clean install -Dartifactory.publish.excludePatterns="*artifact1*,*artifact2*"

You may expect to see the following prints in the logs:您可能希望在日志中看到以下打印内容:

[main] INFO org.jfrog.build.extractor.maven.BuildInfoRecorder - 'your-excluded-artifact-name' will not be deployed due to the defined include-exclude patterns. [main] INFO org.jfrog.build.extractor.maven.BuildInfoRecorder - 由于定义了包含-排除模式,将不会部署“your-excluded-artifact-name”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将Maven工件从Artifactory部署到WebLogic12c - Deploying Maven artifacts from Artifactory to WebLogic12c 在多模块构建中向 JFROG 发布/部署工件 - Publishing/deploying artifacts to JFROG in multi module builds 如何在maven项目中消费jfrog神器 - How to consume a jfrog artifactory in a maven project 如何在 Spring 引导应用程序中从 JFrog Artifactory 连接和下载工件 - How to connect and download artifacts from JFrog Artifactory in a Spring boot application 将 maven 构建的工件部署到存储库 - Deploying artifacts built by maven to repository IntelliJ / Maven不会更新Artifactory中的工件 - IntelliJ/Maven not updating artifacts from Artifactory 从 Maven Artifactory 中提取所有工件,而不仅仅是 JAR 工件 - Pull all artifacts from Maven Artifactory instead of just JAR artifacts 为什么在验证阶段调用 jfrog maven artifactory 插件? - Why does jfrog maven artifactory plugin is invoked at validation phase? 将工件从本地Gradle工件存储库部署到JCenter / MavenCentral - Deploying artifacts from a local Gradle artifactory repository to JCenter/MavenCentral 如何使用jenkins发布构建动作将工件从工件组部署到jfrog工件 - How to deploy an artifact from group of artifacts to jfrog artifactory using jenkins post build action
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM