Quarkus: Quarkus bypasses Nexus and downloads artefacts directly from maven central

Created on 16 May 2019  路  20Comments  路  Source: quarkusio/quarkus

Good evening,

trying to work with Quarkus 0.15.0 from the office this afternoon, I realised that even though my Maven installation had our Nexus repository configured, Quarkus tried to download artefacts directly from Maven central, which didn't work as such a connection is prohibited at the office.
I thought that it was a misconfiguration of my Maven but working from home, also with Nexus as repository installed, the same behaviour happened and I can see if by taking a look at the output:

Downloading from nexus: http://localhost:8081/repository/maven-public/io/quarkus/quarkus-hibernate-orm-panache-deployment/0.15.0/quarkus-hibernate-orm-panache-deployment-0.15.0.jar
Downloaded from nexus: http://localhost:8081/repository/maven-public/io/quarkus/quarkus-narayana-jta-deployment/0.15.0/quarkus-narayana-jta-deployment-0.15.0.jar (7.7 kB at 3.4 kB/s)
Downloaded from nexus: http://localhost:8081/repository/maven-public/io/quarkus/quarkus-agroal-deployment/0.15.0/quarkus-agroal-deployment-0.15.0.jar (11 kB at 4.8 kB/s)
Downloaded from nexus: http://localhost:8081/repository/maven-public/io/quarkus/quarkus-hibernate-orm-deployment/0.15.0/quarkus-hibernate-orm-deployment-0.15.0.jar (48 kB at 19 kB/s)
Downloaded from nexus: http://localhost:8081/repository/maven-public/io/quarkus/quarkus-hibernate-orm-panache-deployment/0.15.0/quarkus-hibernate-orm-panache-deployment-0.15.0.jar (30 kB at 11 kB/s)
Downloaded from nexus: http://localhost:8081/repository/maven-public/io/quarkus/quarkus-smallrye-opentracing-deployment/0.15.0/quarkus-smallrye-opentracing-deployment-0.15.0.jar (6.2 kB at 1.5 kB/s)
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Beginning quarkus augmentation
[INFO] [org.jboss.threads] JBoss Threads version 3.0.0.Beta3
[WARNING] [io.quarkus.agroal.deployment.AgroalProcessor] Agroal dependency is present but no driver has been defined for the default datasource
[INFO] [org.hibernate.jpa.boot.internal.PersistenceXmlParser] HHH000318: Could not find any META-INF/persistence.xml file in the classpath
[INFO] [org.hibernate.Version] HHH000412: Hibernate Core {5.4.2.Final}
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 4147ms
[INFO] [io.quarkus.creator.phase.runnerjar.RunnerJarPhase] Building jar: /Volumes/Work/projets/immobesichtigung24/ib24-modal/target/ib24-modal-runner.jar
[INFO] 
[INFO] --- quarkus-maven-plugin:0.15.0:dev (default-cli) @ ib24-modal ---
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-resteasy/0.15.0/quarkus-resteasy-0.15.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-health/0.15.0/quarkus-smallrye-health-0.15.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-opentracing/0.15.0/quarkus-smallrye-opentracing-0.15.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-metrics/0.15.0/quarkus-smallrye-metrics-0.15.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-resteasy-jsonb/0.15.0/quarkus-resteasy-jsonb-0.15.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-opentracing/0.15.0/quarkus-smallrye-opentracing-0.15.0.jar (0 B at 0 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-hibernate-orm-panache/0.15.0/quarkus-hibernate-orm-panache-0.15.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-metrics/0.15.0/quarkus-smallrye-metrics-0.15.0.jar (0 B at 0 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-resteasy-jsonb/0.15.0/quarkus-resteasy-jsonb-0.15.0.jar (0 B at 0 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-health/0.15.0/quarkus-smallrye-health-0.15.0.jar (0 B at 0 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-resteasy/0.15.0/quarkus-resteasy-0.15.0.jar (0 B at 0 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-hibernate-orm-panache/0.15.0/quarkus-hibernate-orm-panache-0.15.0.jar (0 B at 0 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-resteasy-deployment/0.15.0/quarkus-resteasy-deployment-0.15.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-health-deployment/0.15.0/quarkus-smallrye-health-deployment-0.15.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-opentracing-deployment/0.15.0/quarkus-smallrye-opentracing-deployment-0.15.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-metrics-deployment/0.15.0/quarkus-smallrye-metrics-deployment-0.15.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-resteasy-jsonb-deployment/0.15.0/quarkus-resteasy-jsonb-deployment-0.15.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-health-deployment/0.15.0/quarkus-smallrye-health-deployment-0.15.0.jar (0 B at 0 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-resteasy-deployment/0.15.0/quarkus-resteasy-deployment-0.15.0.jar (0 B at 0 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-resteasy-jsonb-deployment/0.15.0/quarkus-resteasy-jsonb-deployment-0.15.0.jar (0 B at 0 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-hibernate-orm-panache-deployment/0.15.0/quarkus-hibernate-orm-panache-deployment-0.15.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-metrics-deployment/0.15.0/quarkus-smallrye-metrics-deployment-0.15.0.jar (0 B at 0 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-smallrye-opentracing-deployment/0.15.0/quarkus-smallrye-opentracing-deployment-0.15.0.jar (0 B at 0 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/io/quarkus/quarkus-hibernate-orm-panache-deployment/0.15.0/quarkus-hibernate-orm-panache-deployment-0.15.0.jar (0 B at 0 B/s)
Listening for transport dt_socket at address: 5005

One can see that "quarkus:dev" seems to be the culprit.
Is my analysis of the problem correct? If yes, is there something to do to prevent this?

Regards,
Daniel W.

Most helpful comment

Same issue here with 0.16.1, only workaround is to set the in the project's pom. Issue should probably be re-opened

All 20 comments

You could try defining your Nexus server as the mirror for everything (<mirrorOf>*</mirrorOf>).

It already is...

    <mirror>
       <id>nexus</id>
      <mirrorOf>*</mirrorOf>
       <url>http://localhost:8081/repository/maven-public/</url>
   </mirror>

We are facing the same issue here. The <mirrorOf>*</mirrorOf> from the settings.xml is ignored.

(If we go back to 0.12 it works, probably because of #2203?)

The normal build works fine but @QuarkusTest makes some Maven downloads itself. Why is this even necessary, all dependencies should already be on the classpath when the tests are run via IDE or Maven Surefire?

I hope that #2617 fix your problem

@famod @jycr I am also experiencing the same issue; however, I am on 0.16.0 which should contain the fix as outlined in #2617 . Prior to the quarkus-maven-plugin:0.16.0:dev phase, all dependencies are requested via the mirror defined in my settings.xml, however, once the quarkus-maven-plugin kicks in, central (https://repo.maven.apache.org/maven2) is the resolving repository which ends up resulting in the error:

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:0.16.0:dev (default-cli) on project injector-github: Failed to run: Failed to resolve Quarkus application model: Failed to resolve dependencies for <dependency_name_removed>: Could not find artifact <dependency_name_removed> in central (https://repo.maven.apache.org/maven2) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.quarkus:quarkus-maven-plugin:0.16.0:dev (default-cli) on project<project>: Failed to run

Could somebody of those experiencing the issue please verify whether the following helps?
--- a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenArtifactResolver.java +++ b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/resolver/maven/MavenArtifactResolver.java @@ -183,7 +183,8 @@ public class MavenArtifactResolver { try { return repoSystem.readArtifactDescriptor(repoSession, new ArtifactDescriptorRequest() - .setArtifact(artifact)); + .setArtifact(artifact) + .setRepositories(remoteRepos));
Thanks.

@aloubyansky looks like, even though I have my mirror defined in ~/.m2/settings.xml, I have to explicitly define our internal nexus repository as a <repository> in the quarkus project's pom.xml. I did not notice any affect of the addition of .setRepositories(remoteRepos) on that front. Thanks for looking into this.

Same issue here with 0.16.1, only workaround is to set the in the project's pom. Issue should probably be re-opened

@jycr did fix a related issue but not the one you are reporting here. So, yes, it's worth re-opening it.

@rikcarve to set what in the pom?

@dwamara setting an explicit <repository> entry in the pom, rather than just relying on maven settings ~/.m2/settings.xml to use a mirror

@mgagliardo91 Thanks, just did and it worked. I just hope it will be fixed soon, I don't want to be touching all my poms to put the workaround in them.

If anybody has a chance to try this change https://github.com/quarkusio/quarkus/pull/2824 before it gets merged, I would highly appreciate it. Thanks a lot for your patience.

@aloubyansky I tested #2824 locally and it appears to resolve the issue.

Excellent. Thanks a lot @mgagliardo91

I merged the PR. Thanks everyone for the detailed reports and testing!

The reported problem exists in v0.16.1 and I could workaround it with direct entry in my project pom.xml file.

@ewcchan Yes, the fix is coming in a few hours with 0.17.0.

@gsmet the issue is no longer shown and it is working with 0.17.0 release. Thanks!

@ewcchan thanks for your confirmation!

Was this page helpful?
0 / 5 - 0 ratings