我正在尝试自动化 Gitlab CI/CD 管道,以构建多模块 Maven 项目并将其部署到 Artifactory。我遇到了 JFrog CLI 工具,但我遇到了一个问题,因为我的项目中有一些 jar 必须从部署中排除。
我执行的命令是这样的:
./jfrog rt mvn "clean install pom.xml" configuration.yml --build-name="something" --build-number="something"
在文档中我看不到任何可以配置的“--exclusions”参数。
如何像使用 Jenkins Artifactory 插件一样配置排除模式? Jenkins Artifactory plugin - exclude patterns
最佳答案
JFrog CLI 尚未正式支持此功能。
但是,作为解决方法,您可以为 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*"
您可能会在日志中看到以下打印内容:
[main] INFO org.jfrog.build.extractor.maven.BuildInfoRecorder - 'your-excluded-artifact-name' will not be deployed due to the defined include-exclude patterns.
关于java - 使用 JFrog CLI 部署到 Artifactory 时,有什么方法可以排除某些 Maven Artifact 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68213585/