quarkus: Test error while building a Quarkus native. Project can't find dependencies on private maven repository
Describe the bug When the project is being build it finds all necessary dependencies to build the project. However, when it wants to run it’s tests it tries to find the dependencies on maven central.
The logs show the following during the tests: Caused by: io.quarkus.bootstrap.resolver.AppModelResolverException: Failed to resolve dependencies for nl..service:********:jar:1.0.9-SNAPSHOT Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact nl..::jar:1.0.8 in central (https://repo.maven.apache.org/maven2) Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact nl..::jar:1.0.8 in central (https://repo.maven.apache.org/maven2) Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact nl..:**:jar:1.0.8 in central
During the build: [INFO] Downloading from gitlab-maven: https://gitlab.…./api/v4/groups/../-/packages/maven/../../../..-..-../1.0.8/..-..-..-1.0.8.pom [INFO] Downloaded from gitlab-maven: https://gitlab……./api/v4/groups/../-/packages/maven/../../../..-..-../1.0.8/..-..-..-1.0.8.pom (4.6 kB at 29 kB/s) [INFO] Downloaded from gitlab-maven: https://gitlab../api/v4/groups//-/packages/maven////--/1.0.8/---1.0.8.jar (25 kB at 82 kB/s)
The settings.xml looks like the following:
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>gitlab-maven</id>
<configuration>
<httpHeaders>
<property>
<name>Job-Token</name>
<value>${env.CI_JOB_TOKEN}</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
</settings>
The pom file has the following dependency management files:
<repositories>
<repository>
<id>gitlab-maven</id>
<url>https://gitlab..*****...*****./api/v4/groups/.*****./-/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>gitlab-maven</id>
<url>https://gitlab.*****..*****./api/v4/projects/${env.CI_PROJECT_ID}/packages/maven</url>
</repository>
<snapshotRepository>
<id>gitlab-maven</id>
<url>https://gitlab..*****...*****./api/v4/projects/${env.CI_PROJECT_ID}/packages/maven</url>
</snapshotRepository>
</distributionManagement>
It seems like that the repos added to the distribution management in the pom.xml aren’t taken into account during the tests.
Expected behavior The dependencies should be downloaded from the private Maven repository and the repos added to the distributed management should be taken into account.
Actual behavior It seems like the repos aren’t taken into account.
To Reproduce Steps to reproduce the behavior: run
-
'mvn package -B -Pnative -Dquarkus.native.container-build=true -s settings.xml'
Configuration
# Add your application.properties here, if applicable.
not applicable
Environment (please complete the following information):
- Output of Maven: Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T19:00:29Z)
- Output of
uname -aorver: Linux runner-vzxynpr1-project-1-concurrent-0px5nz 4.14.138+ #1 SMP Mon Aug 26 22:41:20 PDT 2019 x86_64 GNU/Linux - Output of
java -version: openjdk version “11.0.4” 2019-07-16 OpenJDK Runtime Environment 18.9 (build 11.0.4+11) OpenJDK 64-Bit Server VM 18.9 (build 11.0.4+11, mixed mode) - Quarkus version or git rev:
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 43 (20 by maintainers)
Ok thanks for your answer. I will prepare that.
In case anyone still encounters this issue: make sure that your MAVEN_HOME variable is set. I had the same issue (also on 1.5.0.Final) and it was fixed after setting the variable.
Thanks @simonedavico
Ok, that’s the clue and what’s also common with the original description. Thanks.