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