My application runs tests very well on my local system. However if I want to execute mvn test on my Jenkins pipeline I encounter problems that might be related to the proxy. I set my proxy for all mvn commands and I see that the dependencies are fetched. During the test phase it breaks with the following error. Is there any dependency loading outside the maven context? Is
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running backend.FeedbackControllerTest
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 4.164 s <<< FAILURE! - in backend.FeedbackControllerTest
[ERROR] testEmptyProjectList Time elapsed: 0.022 s <<< ERROR!
org.junit.jupiter.api.extension.TestInstantiationException: TestInstanceFactory [io.quarkus.test.junit.QuarkusTestExtension] failed to instantiate test class [backend.FeedbackControllerTest]: Failed to create the boostrap class loader
Caused by: java.lang.IllegalStateException: Failed to create the boostrap class loader
Caused by: io.quarkus.bootstrap.BootstrapException: Failed to create the deployment classloader for backend::jar:1.0-SNAPSHOT
Caused by: io.quarkus.bootstrap.resolver.AppModelResolverException: Failed to inject extension deployment dependencies for backend:jar:1.0-SNAPSHOT
Caused by: io.quarkus.bootstrap.resolver.maven.DeploymentInjectionException: io.quarkus.bootstrap.resolver.AppModelResolverException: Failed to collect dependencies for io.quarkus:quarkus-resteasy-deployment:jar:0.19.1
Caused by: io.quarkus.bootstrap.resolver.AppModelResolverException: Failed to collect dependencies for io.quarkus:quarkus-resteasy-deployment:jar:0.19.1
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to read artifact descriptor for io.quarkus:quarkus-resteasy-deployment:jar:0.19.1
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for io.quarkus:quarkus-resteasy-deployment:jar:0.19.1
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact io.quarkus:quarkus-resteasy-deployment:pom:0.19.1 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name or service not known
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact io.quarkus:quarkus-resteasy-deployment:pom:0.19.1 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name or service not known
Caused by: java.net.UnknownHostException: repo.maven.apache.org: Name or service not known
In short, yes, Quarkus does perform some dependency related operations.
Not sure what the problem is in your case, @aloubyansky is the expert on this kind of thing :)
Where do you configure the proxy?
I'm simply using mvn command like this:
mvn test -Dhttp.proxyHost=URL -Dhttp.proxyPort=PORT -Dhttps.proxyHost=URL -Dhttps.proxyPort=PORT
Ok, thanks. I can reproduce the issue. I won't be able to fix it in the next release though (which is scheduled for the next week).
BTW, this is not a Maven-recommended way of configuring proxies. The Maven way would be https://maven.apache.org/guides/mini/guide-proxies.html
It looks like our bootstrap is using different impl of transporters that don't check these props.
I'm still having this problem. Tests run locally, however, when the jenkins pipeline runs the tests, they fail. Printing this to the console:
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Could not transfer artifact io.quarkus:quarkus-universe-bom:pom:1.1.1.Final from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name does not resolve
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact io.quarkus:quarkus-universe-bom:pom:1.1.1.Final from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name does not resolve
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact io.quarkus:quarkus-universe-bom:pom:1.1.1.Final from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name does not resolve
Caused by: org.apache.maven.wagon.TransferFailedException: repo.maven.apache.org: Name does not resolve
Caused by: java.net.UnknownHostException: repo.maven.apache.org: Name does not resolve
If I remove that dependency from the project, it just founds another dependency to complain about:
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.projectlombok:lombok:jar:1.16.20
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.projectlombok:lombok:pom:1.16.20 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name does not resolve
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.projectlombok:lombok:pom:1.16.20 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name does not resolve
Caused by: org.apache.maven.wagon.TransferFailedException: repo.maven.apache.org: Name does not resolve
Caused by: java.net.UnknownHostException: repo.maven.apache.org: Name does not resolve
And again, everything runs smoothly locally... Any suggestions? @aloubyansky
How is Maven launched in your case? Does it fail if you configure the proxy using https://maven.apache.org/guides/mini/guide-proxies.html?
Most helpful comment
Ok, thanks. I can reproduce the issue. I won't be able to fix it in the next release though (which is scheduled for the next week).
BTW, this is not a Maven-recommended way of configuring proxies. The Maven way would be https://maven.apache.org/guides/mini/guide-proxies.html
It looks like our bootstrap is using different impl of transporters that don't check these props.