Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus bypasses Nexus and downloads artefacts directly from maven central #2470

Closed
dwamara opened this issue May 16, 2019 · 20 comments · Fixed by #2617
Closed

Quarkus bypasses Nexus and downloads artefacts directly from maven central #2470

dwamara opened this issue May 16, 2019 · 20 comments · Fixed by #2617
Assignees
Milestone

Comments

@dwamara
Copy link
Contributor

dwamara commented May 16, 2019

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.

@dwamara dwamara changed the title Quarkus bypasses Nexus and downloading artefacts directly from maven central Quarkus bypasses Nexus and downloads artefacts directly from maven central May 16, 2019
@famod
Copy link
Member

famod commented May 17, 2019

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

@dwamara
Copy link
Contributor Author

dwamara commented May 17, 2019

It already is...

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

@polarctos
Copy link
Contributor

polarctos commented May 23, 2019

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?

@jycr
Copy link
Contributor

jycr commented May 28, 2019

I hope that #2617 fix your problem

aloubyansky added a commit that referenced this issue May 29, 2019
fix: #2470 Use mirror to download dependencies if applicable
@gsmet gsmet added this to the 0.16.0 milestone Jun 3, 2019
@mgagliardo91
Copy link

mgagliardo91 commented Jun 4, 2019

@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

@aloubyansky aloubyansky self-assigned this Jun 4, 2019
@aloubyansky
Copy link
Member

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.

@mgagliardo91
Copy link

@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.

@rikcarve
Copy link

rikcarve commented Jun 6, 2019

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

@aloubyansky
Copy link
Member

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

@aloubyansky aloubyansky reopened this Jun 6, 2019
@dwamara
Copy link
Contributor Author

dwamara commented Jun 11, 2019

@rikcarve to set what in the pom?

@mgagliardo91
Copy link

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

@dwamara
Copy link
Contributor Author

dwamara commented Jun 12, 2019

@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.

@aloubyansky
Copy link
Member

If anybody has a chance to try this change #2824 before it gets merged, I would highly appreciate it. Thanks a lot for your patience.

@gsmet gsmet modified the milestones: 0.16.0, 0.17.0 Jun 13, 2019
@mgagliardo91
Copy link

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

@aloubyansky
Copy link
Member

Excellent. Thanks a lot @mgagliardo91

@gsmet
Copy link
Member

gsmet commented Jun 13, 2019

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

@ewcchan
Copy link

ewcchan commented Jun 19, 2019

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

@gsmet
Copy link
Member

gsmet commented Jun 19, 2019

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

@ewcchan
Copy link

ewcchan commented Jun 20, 2019

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

@gsmet
Copy link
Member

gsmet commented Jun 20, 2019

@ewcchan thanks for your confirmation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants