Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
Push JHipster 6.0.1 to Gitlab repository

After having everything ready to deploy, I realized JHipster doesn't have a Dockerfile anymore and the packaging is done with jib. The generated gitlab-ci.yml has a docker-push stage with a command like this:

./mvnw jib:build -Djib.to.image=$IMAGE_TAG -Djib.to.auth.username=gitlab-ci-token  -Djib.to.auth.password=$CI_BUILD_TOKEN

but it fails with

[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.11:build (default-cli) on project test-project: Obtaining project build output files failed; make sure you have compiled your project before trying to build the image. (Did you accidentally run "mvn clean jib:build" instead of "mvn clean compile jib:build"?): /builds/amatos/test-project/target/classes -> [Help 1]

As that failed, I tried to run the command locally like this:

./mvnw jib:build -Djib.to.image=registry.gitlab.com/amatos/test-project:v6.0.1 -Djib.to.auth.username=amatos -Djib.to.auth.password=password

but instead of trying to connect to Gitlab's registry, it tries to connect to registry.hub.docker.com:

[INFO] Retrieving registry credentials for registry.hub.docker.com...

What I would like to know is: how do I set it to connect to Gitlab instead of Docker Hub?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

In order to connect to a custom repository, I changed -Djib.to.image to -Dimage and it worked

over 4 years ago · Santiago Trujillo Report

0

This is followed by jhipster/generator-jhipster issue 9761 which states:

as the docker-push is done in another stage, there is a missing - target/classes in the previous stage.
It is needed by jib. It should look like:

maven-package:
  stage: package
  script:
    - ./mvnw verify -Pprod -DskipTests -Dmaven.repo.local=$MAVEN_USER_HOME
  artifacts:
    paths:
      - target/*.jar
      - target/classes
    expire_in: 1 day

Possibly addressed by PR (merged) 9762, commit 50cc009, which is only in master, not yet referenced by any tag.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!