I am working on a demo of Quarkus.io at work, and I'm facing a problem with connecting to the company Maven repo, as that uses mutual TLS for authentication.
I.e. when I run the test-target the getting-started-testing from the quarkus-quickstarts, I am faced with the following error:
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.acme.quickstart.GreetingResourceTest
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 3.139 s <<< FAILURE! - in org.acme.quickstart.GreetingResourceTest
[ERROR] testHelloEndpoint Time elapsed: 0.012 s <<< ERROR!
org.junit.jupiter.api.extension.TestInstantiationException: TestInstanceFactory [io.quarkus.test.junit.QuarkusTestExtension] failed to instantiate test class [org.acme.quickstart.GreetingResourceTest]: io.quarkus.bootstrap.resolver.AppModelResolverException: Failed to collect dependencies for io.quarkus:quarkus-resteasy-deployment:jar:1.2.0.Final
Caused by: io.quarkus.bootstrap.resolver.maven.DeploymentInjectionException: io.quarkus.bootstrap.resolver.AppModelResolverException: Failed to collect dependencies for io.quarkus:quarkus-resteasy-deployment:jar:1.2.0.Final
Caused by: io.quarkus.bootstrap.resolver.AppModelResolverException: Failed to collect dependencies for io.quarkus:quarkus-resteasy-deployment:jar:1.2.0.Final
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at io.quarkus:quarkus-resteasy-server-common-deployment:jar:1.2.0.Final -> io.quarkus:quarkus-core-deployment:jar:1.2.0.Final -> io.quarkus:quarkus-bootstrap-core:jar:1.2.0.Final -> org.apache.maven.resolver:maven-resolver-transport-wagon:jar:1.1.1 -> org.apache.maven.wagon:wagon-provider-api:jar:3.3.3
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.wagon:wagon-provider-api:jar:3.3.3
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.apache.maven.wagon:wagon-provider-api:pom:3.3.3 from/to corporate-public (https://maven.corporate.net/content/repositories/corporate-public): Received fatal alert: handshake_failure
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven.wagon:wagon-provider-api:pom:3.3.3 from/to corporate-public (https://maven.corporate.net/content/repositories/corporate-public): Received fatal alert: handshake_failure
Caused by: org.apache.maven.wagon.TransferFailedException: Received fatal alert: handshake_failure
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
The -Djavax.net.ssl.keyStore* properties are normally picked up by Maven from ~/.mavenrc or MAVEN_OPTS environment properties, but how do I specify them for running the Quarkus tests?
It should be obvious, but I'll state it anyways - switching to use the public repos, is not an acceptable solution.
In case anybody else has this problem, a workaround is propagating the javax.net.ssl.* system properties to the Maven Surefire plugin, e.g. adding these lines to the Surefire configuration:
<javax.net.ssl.keyStoreType>${javax.net.ssl.keyStoreType}</javax.net.ssl.keyStoreType>
<javax.net.ssl.keyStore>${javax.net.ssl.keyStore}</javax.net.ssl.keyStore>
<javax.net.ssl.keyStorePassword>${javax.net.ssl.keyStorePassword}</javax.net.ssl.keyStorePassword>
(This answer is totally ninja'ing the information in #tveon's Quarkus tests fails mTLS authentication against internal Maven repository issue in Quarkus' GitHub repo).
Related
Someone, could you help me?
I'm trying to use Quarkus in a project of the company that I'm working on.
That's my scenario:
The company that I'm working on has an on-premises environment with a CI server and an Artifactory that provides the all required artifacts. The CI has no grant access to reach out to the internet then the Artifactory server is responsible for bringing all external artifacts. We've got a lot of spring-boot applications that are built with the same CI... so I'm assuming that both, our CI and Artifactory, they're configured properly.
Here's my issue:
Our CI server has executed "mvn package" command and it's showing this following error, but this error is happening during the test phase:
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO] Running myproject.resources.HelloResourceTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 127.996 s <<< FAILURE! - in myproject.resources.HelloResourceTest
[ERROR] myproject.resources.HelloResourceTest.testHelloEndpoint Time elapsed: 0.016 s <<< ERROR!
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] HelloResourceTest.testHelloEndpoint » Runtime io.quarkus.bootstrap.BootstrapEx...
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] myproject.............. ............................ FAILURE [02:29 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:41 min
[INFO] Finished at: 2020-08-17T18:38:56Z
[INFO] ------------------------------------------------------------------------
But there's no special thing happening the target class of the test:
package myproject.resources;
import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
#QuarkusTest
public class HelloResourceTest {
#Test
public void testHelloEndpoint() {
given()
.when().get("/hello")
.then()
.statusCode(200)
.body(is("Ops!"));
}
}
Here's the implementation of the target Resource:
package myproject.resources;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.jboss.logging.Logger;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
#Path("/hello")
public class HelloResource {
private static final Logger LOG = Logger.getLogger(HelloResource.class);
#GET
#Produces(MediaType.TEXT_PLAIN)
public String hello() {
return "Ops!";
}
}
Then I've executed 'mvn package -e -X' and I caught this exception message:
java.lang.RuntimeException
java.lang.RuntimeException: io.quarkus.bootstrap.BootstrapException: Failed to create the application model for null
Cased by: io.quarkus.bootstrap.BootstrapException: Failed to create the application model for null
Caused by: java.lang.RuntimeException: Failed to create application model resolver for /home/dearrudam/myproject
Caused by: io.quarkus.bootstrap.resolver.maven.BootstrapMavenException: Failed to read artifact descriptor for myproject:myproject:pom:1.0-SNAPSHOT
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for myproject:myproject:pom:1.0-SNAPSHOT
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Could not transfer artifact io.quarkus:quarkus-universe-bom:pom:1.7.0.Final from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/io/quarkus/quarkus-universe-bom/1.7.0.Final/quarkus-universe-bom-1.7.0.Final.pom
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact io.quarkus:quarkus-universe-bom:pom:1.7.0.Final from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/io/quarkus/quarkus-universe-bom/1.7.0.Final/quarkus-universe-bom-1.7.0.Final.pom
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact io.quarkus:quarkus-universe-bom:pom:1.7.0.Final from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/io/quarkus/quarkus-universe-bom/1.7.0.Final/quarkus-universe-bom-1.7.0.Final.pom
Caused by: org.apache.maven.wagon.TransferFailedException: Transfer failed for https://repo.maven.apache.org/maven2/io/quarkus/quarkus-universe-bom/1.7.0.Final/quarkus-universe-bom-1.7.0.Final.pom
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/199.232.64.215] failed: Connection timed out (Connection timed out)
Caused by: java.net.ConnectException: Connection timed out (Connection timed out)
Why it's trying to reach out to the repo.maven.apache.org instead of my local Artifactory?
Thanks!
I'd like to credit Falko Modler and Quarkus team for the help!
Solution details: https://github.com/quarkusio/quarkus/issues/11433
In summary, I've followed Falko's instruction that was to add the following configuration into the maven-surefire-plugin system properties:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
<maven.settings>${session.request.userSettingsFile.path}</maven.settings>
</systemPropertyVariables>
</configuration>
</plugin>
And then it worked propertly!
Our Jenkins has a Maven/Tycho build using Java8 that worked perfectly in February, but stopped working now in April. (Since it was not run during this interval, I'm not sure when it stopped working exactly.)
The exception that gets thrown right after downloading the p2 repositories (or maybe right in the middle) is:
[WARNING] Error initializing: org.eclipse.tycho.p2.resolver.P2DependencyResolver#18bef28
java.lang.RuntimeException: java.lang.IllegalStateException: Service is not registered class='interface org.eclipse.tycho.core.shared.ProxyServiceFacade'
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.checkStarted (DefaultEquinoxEmbedder.java:312)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.getService (DefaultEquinoxEmbedder.java:286)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.getService (DefaultEquinoxEmbedder.java:281)
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.initialize (P2DependencyResolver.java:429)
Caused by: java.lang.IllegalStateException: Service is not registered class='interface org.eclipse.tycho.core.shared.ProxyServiceFacade'
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.getService (DefaultEquinoxEmbedder.java:302)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.getService (DefaultEquinoxEmbedder.java:281)
at org.eclipse.tycho.osgi.configuration.OSGiProxyConfigurator.afterFrameworkStarted (OSGiProxyConfigurator.java:41)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.doStart (DefaultEquinoxEmbedder.java:185)
...and...
[WARNING] Error injecting: org.eclipse.tycho.p2.resolver.P2DependencyResolver
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error notifying InjectionListener org.eclipse.sisu.plexus.PlexusBeanBinder#1b6fe69 of org.eclipse.tycho.p2.resolver.P2DependencyResolver.
Reason: java.lang.RuntimeException: java.lang.IllegalStateException: Service is not registered class='interface org.eclipse.tycho.core.shared.ProxyServiceFacade'
while locating org.eclipse.tycho.p2.resolver.P2DependencyResolver
1 error
at com.google.inject.internal.InternalProvisionException.toProvisionException (InternalProvisionException.java:226)
at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1053)
at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1086)
at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
...and of course...
[ERROR] Internal error: java.lang.RuntimeException: Could not instantiate required component: com.google.inject.ProvisionException: Unable to provision, see the following errors:
[ERROR]
[ERROR] 1) Error notifying InjectionListener org.eclipse.sisu.plexus.PlexusBeanBinder#1b6fe69 of org.eclipse.tycho.p2.resolver.P2DependencyResolver.
[ERROR] Reason: java.lang.RuntimeException: java.lang.IllegalStateException: Service is not registered class='interface org.eclipse.tycho.core.shared.ProxyServiceFacade'
[ERROR] while locating org.eclipse.tycho.p2.resolver.P2DependencyResolver
[ERROR] at ClassRealm[extension>org.eclipse.tycho:tycho-maven-plugin:1.3.0, parent: sun.misc.Launcher$AppClassLoader#647e05] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule)
[ERROR] while locating org.eclipse.tycho.core.DependencyResolver annotated with #com.google.inject.name.Named(value=p2)
[ERROR]
[ERROR] 1 error
[ERROR] role: org.eclipse.tycho.core.DependencyResolver
[ERROR] roleHint: p2
[ERROR] -> [Help 1]
My first thought was that Maven takes new releases of it's plug-ins, but there are no versions missing in the pom.xml and Maven does not warn about it either.
I tried updating from Tycho 0.22 to 0.26 to 1.3, but neither version worked.
I tried running the build with Maven 3.0 and 3.6, but neither worked.
I tried Java 8 with 32bit and 64bit, and Java 11.
Now I have no idea where to even start to search for the source of the problem. Can anyone shed some light on this?
(If you need some more information, just ask. The files are pretty long, so I'd rather not copy all of them into this question before narrowing down where the problem might be.)
It helped for me to clean local maven repository.
Normally its located in <User-home>/.m2
HTH
I think I have similar setup as yours: An Eclipse RCP project which should be build on Jenkins in a Docker container by Maven/Tycho.
The following issue gave me a hint in the right direction: https://bugs.eclipse.org/bugs/show_bug.cgi?id=552877
When I ran Maven with -X I got the following debug-output:
[DEBUG] Using local repository at ?/.m2/repository
This led me to the following question: Why does maven use "?" as my home directory
But additionally to the -s argument I also needed to set the user.home parameter explicitly. (But that is probably only needed because I have not set the local repository location in the settings.xml)
This finally results in this Maven call: mvn -B clean verify --fail-at-end -s /some/folder/settings.xml -Duser.home=/another/folder
This error is driving me crazy. Can someone please help me?
I do have gpg installed and it is also in PATH. What is causing this error!!!
Am running this job on jenkins 1.5 , maven 3.0.3 on linux and windows ( both show same error)
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (default) on project sample: Exit code: 2 -> [Help 1]
[INFO] [ERROR]
[INFO] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[INFO] [ERROR]
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4:53.571s
[INFO] Finished at: Fri Aug 14 14:00:36 PDT 2015
[INFO] Final Memory: 21M/620M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /var/lib/jenkins/jobs/sample/workspace/pom.xml to /var/lib/jenkins/jobs/sample/modules/com.sample$sample/builds/2015-08-14_13-55-35/archive/com.sample/sample/1.0.0-SNAPSHOT/sample-1.0.0-SNAPSHOT.pom
Waiting for Jenkins to finish collecting data
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:prepare (default-cli) on project sample: Maven execution failed, exit code: '1'
cause : Maven execution failed, exit code: '1'
Stack trace :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:prepare (default-cli) on project sample: Maven execution failed, exit code: '1'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.MojoExecutionException: Maven execution failed, exit code: '1'
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:281)
at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:232)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 26 more
Caused by: org.apache.maven.shared.release.ReleaseExecutionException: Maven execution failed, exit code: '1'
at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:89)
at org.apache.maven.shared.release.phase.RunPrepareGoalsPhase.execute(RunPrepareGoalsPhase.java:44)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:234)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:169)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:146)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:107)
at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:277)
... 29 more
Caused by: org.apache.maven.shared.release.exec.MavenExecutorException: Maven execution failed, exit code: '1'
at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals(InvokerMavenExecutor.java:394)
at org.apache.maven.shared.release.exec.AbstractMavenExecutor.executeGoals(AbstractMavenExecutor.java:110)
at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:81)
... 35 more
channel stopped
Archiving artifacts
An attempt to send an e-mail to empty list of recipients, ignored.
Finished: FAILURE
If you don't need your artifacts to be signed, you may disable or skip the execution of the gpg plugin defined in the parent pom
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
or run the build with gpg.skip=true (see Maven GPG Plugin)
If you need your artifacts to be signed, you should either check the configuration of the gpg-plugin in the parent pom or override the configuration in your pom. Maybe some settings in the parent pom do not match your system's environment, but thats difficult to say from the error message.
The issue happened to me after upgrading from Ubuntu 16 to Ubuntu 18.04 LTS in nightly jenkins build.
gpg --version
gpg (GnuPG) 2.2.4
First i checked the same project in a non jenkins environment with
mvn install
and I got the message
gpg: signing failed: Inappropriate ioctl for device
which pointed me to
https://github.com/keybase/keybase-issues/issues/2798
and
https://tutorials.technology/solved_errors/21-gpg-signing-failed-Inappropriate-ioctl-for-device.html
export GPG_TTY=$(tty)
is the recommended remedy there. I have added this to my .profile and restarted the
mvn install
test. This time i was asked to enter the passphrase for OpenPGP secret key via the terminal. A second run via the command line was successful without entering the key.
I then stopped and restarted jenkins and tried the failing job again. This time it worked.
Unfortunately it still does not work in jenkins jobx where an xsession is started.
http://maven.apache.org/plugins/maven-gpg-plugin/usage.html
explictly states that you can put the gpg.passphrase in a settings.xml which I have been using effectively for a long time. Know i do not know how do get this behavior back I only can offer the workaround above.
See also
Avoid gpg signing prompt when using Maven release plugin
This means that you need to have a key to sign the jars. Just follow this process until the last step (you dont need to copy it to github oviously)
Here a summary:
Open Git Bash
gpg --gen-key #use defaults with 4096 as key size
gpg --list-secret-keys --keyid-format LONG
(optional) gpg --armor --export %the key from above%
When I try running a maven job in Jenkins, the build is not successful.
The error message in the console displays the following :
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- resources-plugin/2.5/maven-resources-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.640s
[INFO] Finished at: Tue Aug 20 11:21:36 EST 2013
[INFO] Final Memory: 6M/16M
[INFO] ------------------------------------------------------------------------
mavenExecutionResult exceptions not empty
message : Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
cause : Failed to read artifact descriptor for org.apache.maven.plugins:maven- resources-plugin:jar:2.5
Stack trace :
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:129)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:142)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:261)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:185)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:152)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:139)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:116)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:129)
at org.apache.maven.lifecycle.internal.BuilderCommon.resolveBuildPlan(BuilderCommon.java:92)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:296)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:279)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:115)
... 33 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): peer not authenticated
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:281)
... 36 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): peer not authenticated
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:951)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:941)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
... 3 more
Caused by: org.apache.maven.wagon.TransferFailedException: peer not authenticated
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:892)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:601)
... 4 more
Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:397)
at org.apache.maven.wagon.providers.http.httpclient.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:126)
at org.apache.maven.wagon.providers.http.httpclient.conn.ssl.SSLSocketFactory.createLayeredSocket(SSLSocketFactory.java:628)
at org.apache.maven.wagon.shared.http4.ConfigurableSSLSocketFactoryDecorator.createLayeredSocket(ConfigurableSSLSocketFactoryDecorator.java:57)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultClientConnectionOperator.updateSecureConnection(DefaultClientConnectionOperator.java:232)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.ManagedClientConnectionImpl.layerProtocol(ManagedClientConnectionImpl.java:401)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector.establishRoute(DefaultRequestDirector.java:842)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:649)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:480)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.execute(AbstractHttpClientWagon.java:746)
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:886)
... 8 more
channel stopped
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook - Xbootclasspath/a:C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes;C:\PROGRA~1\HP\QUICKT~1\bin\J AVA_S~1\classes\jasmine.jar
Finished: FAILURE
I'm able to get to know the root cause of the error is some authentication issue("peer not authenticated"). But not able to get it resolved as I am not aware what authetication I need to key in and where to key in.
Additional details : I am using Maven 3.0.3 and JDK 1.7
Thanks in advance for your time in helping me resolving the issue. Let me know if you need any additional info.
Thanks
When using SSL to connect to maven repositories you'll need to make sure that the certificates for the repository are trusted by the JVM running maven. Refer to the Guide to Remote repository access through authenticated HTTPS.
Also, as mentioned by rec in an answer to maven release -> peer not authenticated, with newer versions of maven you can disable the certificate validation of the maven http wagon temporarily to confirm if the certificate is indeed the source of the problem:
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
Solution 4 “Peer Not Authenticated” while adding maven "jitpack.io" in app's gradle.build.
Simple solution is install java 8 if you have lower version.
We tried with Oracle java8 and it works. :)
Note : Tried a lot of solutions those are on stackoverflow.com but none of them work for me.
Assuming you have set Java Home - JAVA_HOME env variable and using it to run maven;
Pre-req is that you have exported the .cer certificate (via browser ex)
cd %JAVA_HOME%\jre\lib\security
%JAVA_HOME%\jre\bin\keytool -v -alias mavensrvNewCer -import -file d:\pathtoexportedcertificate.cer -keystore trust.jks
set MAVEN_OPTS=-Xmx512m -Djavax.net.ssl.trustStore=%JAVA_HOME%/jre/lib/security/trust.jks -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.keyStore=%JAVA_HOME%/jre/lib/security/trust.jks -Djavax.net.ssl.keyStoreType=jks -Djavax.net.ssl.keyStorePassword=changeit
mvn install
I have a flex application that builds fine with JDK6. Maven debug logs show the following message for a missing POM file:
[WARNING] Missing POM for com.adobe.flex.framework:halo:swc:theme:4.5.1.21328: Error resolving project artifact: Failure to find com.adobe.flex.framework:halo:pom:4.5.1.21328 in http://:9999/nexus/content/groups/repositories was cached in the local repository, resolution will not be reattempted until the update interval of has elapsed or updates are forced for project com.adobe.flex.framework:halo:pom:4.5.1.21328
[DEBUG] com.adobe.flex.framework:halo:swc:theme:4.5.1.21328:compile (selected for compile)
With JDK7, however, the missing POM file seems to be a problem. I get the following 'connection timedout' errors:
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact com.adobe.flex.framework:halo:pom:4.5.1.21328 from/to flexmojos (http://repository.sonatype.org/content/groups/flexgroup/): Error transferring file: Connection timed out: connect
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:949)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:940)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:695)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:689)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.get(WagonRepositoryConnector.java:445)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:460)
... 33 more
Caused by: org.apache.maven.wagon.TransferFailedException: Error transferring file: Connection timed out: connect
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:143)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:608)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.net.ConnectException: Connection timed out: connect
Am I missing some configuration that's required for using Maven with JDK7? I searched, but couldn't find anything. I'd appreciate any help with this. I'm using Maven 3.0.3. and JDK1.7.0_01.
This error cannot be due to JDK version. From the outputs it looks like different repositories are in involved in each case...
jdk 6
http://:9999/nexus/content/groups/repositories
jdk 7
http://repository.sonatype.org/content/groups/flexgroup
You may want to delete the concerned folder (../com/adobe/flex/framework/halo/4.5.1.21328) from your local repository and try rebuilding.