我正在使用 Gitlab 和 Artifactory 进行 CI/CD。
访问互联网受到限制,所有工件都使用/通过 Artifactory 下载。
我已将我的配置.gitlab-ci.yml
如下,以便能够将构建信息发布到 Artifactory。
before_script:
- set M2_HOME=C:\Maven\apache-maven-3.3.9
- set JFROG_CLI_LOG_LEVEL=DEBUG
- jfrog rt config --url=%ARTIFACTORY_URL% --user=%ARTIFACTORY_USER% --password=%ARTIFACTORY_PASS%
- jfrog rt c show
stages:
- build
build-project:
stage: build
script:
# Run the MVN command
- jfrog rt mvn "package install -B -U -DskipTests=true" configuration.yml --build-name=my-project --build-number=%CI_JOB_ID%
# Collect the environment variables
- jfrog rt bce my-project %CI_JOB_ID%
# Pass the build information to Artifactory
- jfrog rt bp my-project %CI_JOB_ID%
在conf
Maven 安装目录中,我有一个自定义设置文件。这行得通,我已经在命令行上尝试过。
不幸的是,该命令jfrog rt mvn "package install...
失败,因为 jfrog cli 正在尝试直接连接 Bintray 以下载工件。
[Info] Running Mvn...
[Debug] Checking prerequisites.
[Info] Downloading jfrog/jfrog-jars/org/jfrog/buildinfo/build-info-extractor-maven3/2.11.1/build-info-extractor-maven3-2.11.1-uber.jar
[Error] Bintray Head https://dl.bintray.com/jfrog/jfrog-jars/org/jfrog/buildinfo/build-info-extractor-maven3/2.11.1/build-info-extractor-maven3-2.11.1-uber.jar: dial tcp 5.153.35.248:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
ERROR: Job failed: exit status 1
有没有办法配置 jfrog cli 以使用我的自定义 maven 设置?
是否有另一种方法可以在不使用 jfrog cli 的情况下将 maven 项目的构建数据发送到 Artifactory?