I'm using Gitlab and Artifactory for CI/CD.
Access to the internet is restricted and all artifacts are downloaded using/via Artifactory.
I have configured my .gitlab-ci.yml as below to be able to publish build information to 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%
In the conf directory of the maven installation i have a custom settings file. This works, i have tried it on the command line.
Unfortunately the command jfrog rt mvn "package install... fails because jfrog cli is trying to directly connect Bintray to download artifacts.
[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
Is there a way of configuring jfrog cli to use my custom maven settings?
Is there another way to send build data for a maven project to Artifactory without using jfrog cli?