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

Errors running MavenCLI #365

Open
javydreamercsw opened this issue Apr 20, 2023 · 11 comments
Open

Errors running MavenCLI #365

javydreamercsw opened this issue Apr 20, 2023 · 11 comments

Comments

@javydreamercsw
Copy link

Running MavenCLI throws this error on maven:3.9.1-eclipse-temurin-11:

[debug] Running command mvn install -DskipTests=true -X in /home/jenkins/agent/workspace/_TestNG_Maven_Mojo_release_1.0.0/target/project-to-test/TestChangesMojoChangesInParentClassTest1682024612217

Apache Maven 3.9.1 (2e178502fcdbffc201671fb2537d0cb4b4cc58f8)

Maven home: <unknown Maven home>

Java version: 11.0.18, vendor: Eclipse Adoptium, runtime: /opt/java/openjdk

Default locale: en_US, platform encoding: UTF-8

OS name: "linux", version: "5.15.0-1017-aws", arch: "amd64", family: "unix"

[2023-04-20 21:03:32.779] [DEBUG]   Included /home/jenkins/agent/workspace/_TestNG_Maven_Mojo_release_1.0.0@tmp/withMaven7cd31a9e/pipeline-maven-spy.jar

[2023-04-20 21:03:32.783] [DEBUG] Populating class realm maven.ext

[2023-04-20 21:03:32.784] [DEBUG]   Included /home/jenkins/agent/workspace/_TestNG_Maven_Mojo_release_1.0.0@tmp/withMaven7cd31a9e/pipeline-maven-spy.jar

[2023-04-20 21:03:32.995] [INFO] [jenkins-event-spy] Generate /home/jenkins/agent/workspace/_TestNG_Maven_Mojo_release_1.0.0@tmp/withMaven7cd31a9e/maven-spy-20230420-210332-99111292096989679202327.log.tmp ...

[2023-04-20 21:03:33.008] [DEBUG] Created new class realm maven.api

[2023-04-20 21:03:33.008] [DEBUG] Importing foreign packages into class realm maven.api

[2023-04-20 21:03:33.009] [DEBUG]   Imported: javax.annotation.* < maven.ext

[2023-04-20 21:03:33.009] [DEBUG]   Imported: javax.annotation.security.* < maven.ext

[2023-04-20 21:03:33.009] [DEBUG]   Imported: javax.inject.* < maven.ext

[2023-04-20 21:03:33.009] [DEBUG]   Imported: org.apache.maven.* < maven.ext

[2023-04-20 21:03:33.009] [DEBUG]   Imported: org.apache.maven.artifact < maven.ext

[2023-04-20 21:03:33.009] [DEBUG]   Imported: org.apache.maven.classrealm < maven.ext

[2023-04-20 21:03:33.009] [DEBUG]   Imported: org.apache.maven.cli < maven.ext

[2023-04-20 21:03:33.010] [DEBUG]   Imported: org.apache.maven.configuration < maven.ext

[2023-04-20 21:03:33.010] [DEBUG]   Imported: org.apache.maven.exception < maven.ext

[2023-04-20 21:03:33.010] [DEBUG]   Imported: org.apache.maven.execution < maven.ext

[2023-04-20 21:03:33.010] [DEBUG]   Imported: org.apache.maven.execution.scope < maven.ext

[2023-04-20 21:03:33.010] [DEBUG]   Imported: org.apache.maven.graph < maven.ext

[2023-04-20 21:03:33.011] [DEBUG]   Imported: org.apache.maven.lifecycle < maven.ext

[2023-04-20 21:03:33.011] [DEBUG]   Imported: org.apache.maven.model < maven.ext

[2023-04-20 21:03:33.011] [DEBUG]   Imported: org.apache.maven.monitor < maven.ext

[2023-04-20 21:03:33.011] [DEBUG]   Imported: org.apache.maven.plugin < maven.ext

[2023-04-20 21:03:33.011] [DEBUG]   Imported: org.apache.maven.profiles < maven.ext

[2023-04-20 21:03:33.012] [DEBUG]   Imported: org.apache.maven.project < maven.ext

[2023-04-20 21:03:33.012] [DEBUG]   Imported: org.apache.maven.reporting < maven.ext

[2023-04-20 21:03:33.012] [DEBUG]   Imported: org.apache.maven.repository < maven.ext

[2023-04-20 21:03:33.012] [DEBUG]   Imported: org.apache.maven.rtinfo < maven.ext

[2023-04-20 21:03:33.013] [DEBUG]   Imported: org.apache.maven.settings < maven.ext

[2023-04-20 21:03:33.013] [DEBUG]   Imported: org.apache.maven.toolchain < maven.ext

[2023-04-20 21:03:33.013] [DEBUG]   Imported: org.apache.maven.usability < maven.ext

[2023-04-20 21:03:33.013] [DEBUG]   Imported: org.apache.maven.wagon.* < maven.ext

[2023-04-20 21:03:33.013] [DEBUG]   Imported: org.apache.maven.wagon.authentication < maven.ext

[2023-04-20 21:03:33.014] [DEBUG]   Imported: org.apache.maven.wagon.authorization < maven.ext

[2023-04-20 21:03:33.014] [DEBUG]   Imported: org.apache.maven.wagon.events < maven.ext

[2023-04-20 21:03:33.014] [DEBUG]   Imported: org.apache.maven.wagon.observers < maven.ext

[2023-04-20 21:03:33.015] [DEBUG]   Imported: org.apache.maven.wagon.proxy < maven.ext

[2023-04-20 21:03:33.015] [DEBUG]   Imported: org.apache.maven.wagon.repository < maven.ext

[2023-04-20 21:03:33.015] [DEBUG]   Imported: org.apache.maven.wagon.resource < maven.ext

[2023-04-20 21:03:33.015] [DEBUG]   Imported: org.codehaus.classworlds < maven.ext

[2023-04-20 21:03:33.015] [DEBUG]   Imported: org.codehaus.plexus.* < maven.ext

[2023-04-20 21:03:33.016] [DEBUG]   Imported: org.codehaus.plexus.classworlds < maven.ext

[2023-04-20 21:03:33.016] [DEBUG]   Imported: org.codehaus.plexus.component < maven.ext

[2023-04-20 21:03:33.016] [DEBUG]   Imported: org.codehaus.plexus.configuration < maven.ext

[2023-04-20 21:03:33.017] [DEBUG]   Imported: org.codehaus.plexus.container < maven.ext

[2023-04-20 21:03:33.017] [DEBUG]   Imported: org.codehaus.plexus.context < maven.ext

[2023-04-20 21:03:33.017] [DEBUG]   Imported: org.codehaus.plexus.lifecycle < maven.ext

[2023-04-20 21:03:33.017] [DEBUG]   Imported: org.codehaus.plexus.logging < maven.ext

[2023-04-20 21:03:33.017] [DEBUG]   Imported: org.codehaus.plexus.personality < maven.ext

[2023-04-20 21:03:33.018] [DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < maven.ext

[2023-04-20 21:03:33.018] [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < maven.ext

[2023-04-20 21:03:33.018] [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < maven.ext

[2023-04-20 21:03:33.019] [DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < maven.ext

[2023-04-20 21:03:33.019] [DEBUG]   Imported: org.eclipse.aether.* < maven.ext

[2023-04-20 21:03:33.019] [DEBUG]   Imported: org.eclipse.aether.artifact < maven.ext

[2023-04-20 21:03:33.019] [DEBUG]   Imported: org.eclipse.aether.collection < maven.ext

[2023-04-20 21:03:33.020] [DEBUG]   Imported: org.eclipse.aether.deployment < maven.ext

[2023-04-20 21:03:33.020] [DEBUG]   Imported: org.eclipse.aether.graph < maven.ext

[2023-04-20 21:03:33.020] [DEBUG]   Imported: org.eclipse.aether.impl < maven.ext

[2023-04-20 21:03:33.020] [DEBUG]   Imported: org.eclipse.aether.installation < maven.ext

[2023-04-20 21:03:33.021] [DEBUG]   Imported: org.eclipse.aether.internal.impl < maven.ext

[2023-04-20 21:03:33.021] [DEBUG]   Imported: org.eclipse.aether.metadata < maven.ext

[2023-04-20 21:03:33.021] [DEBUG]   Imported: org.eclipse.aether.repository < maven.ext

[2023-04-20 21:03:33.021] [DEBUG]   Imported: org.eclipse.aether.resolution < maven.ext

[2023-04-20 21:03:33.021] [DEBUG]   Imported: org.eclipse.aether.spi < maven.ext

[2023-04-20 21:03:33.022] [DEBUG]   Imported: org.eclipse.aether.transfer < maven.ext

[2023-04-20 21:03:33.022] [DEBUG]   Imported: org.eclipse.aether.util < maven.ext

[2023-04-20 21:03:33.022] [DEBUG]   Imported: org.eclipse.aether.version < maven.ext

[2023-04-20 21:03:33.022] [DEBUG]   Imported: org.fusesource.jansi.* < maven.ext

[2023-04-20 21:03:33.023] [DEBUG]   Imported: org.slf4j.* < maven.ext

[2023-04-20 21:03:33.023] [DEBUG]   Imported: org.slf4j.event.* < maven.ext

[2023-04-20 21:03:33.023] [DEBUG]   Imported: org.slf4j.helpers.* < maven.ext

[2023-04-20 21:03:33.023] [DEBUG]   Imported: org.slf4j.spi.* < maven.ext

[2023-04-20 21:03:33.023] [DEBUG] Populating class realm maven.api

[2023-04-20 21:03:33.038] [DEBUG] Created adapter factory; available factories [file-lock, rwlock-local, semaphore-local, noop]; available name mappers [discriminating, file-gav, file-hgav, file-static, gav, static]

[2023-04-20 21:03:33.055] [INFO] Error stacktraces are turned on.

[2023-04-20 21:03:33.056] [DEBUG] Message scheme: plain

[2023-04-20 21:03:33.057] [DEBUG] Reading global settings from settings.xml

[2023-04-20 21:03:33.057] [DEBUG] Reading user settings from /root/.m2/settings.xml

[2023-04-20 21:03:33.059] [DEBUG] Reading global toolchains from toolchains.xml

[2023-04-20 21:03:33.059] [DEBUG] Reading user toolchains from /root/.m2/toolchains.xml

[2023-04-20 21:03:33.065] [DEBUG] Using local repository at /root/.m2/repository

[2023-04-20 21:03:33.068] [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /root/.m2/repository

[2023-04-20 21:03:33.071] [INFO] Scanning for projects...

[2023-04-20 21:03:33.078] [DEBUG] Extension realms for project org.apache.maven.plugin.my.unit:project-to-test:jar:1.0.0-SNAPSHOT: (none)

[2023-04-20 21:03:33.079] [DEBUG] Looking up lifecycle mappings for packaging jar from ClassRealm[maven.ext, parent: ClassRealm[maven, parent: null]]

[2023-04-20 21:03:33.096] [DEBUG] === REACTOR BUILD PLAN ================================================

[2023-04-20 21:03:33.097] [DEBUG] Project: org.apache.maven.plugin.my.unit:project-to-test:jar:1.0.0-SNAPSHOT

[2023-04-20 21:03:33.097] [DEBUG] Tasks:   [install]

[2023-04-20 21:03:33.097] [DEBUG] Style:   Regular

[2023-04-20 21:03:33.097] [DEBUG] =======================================================================

[2023-04-20 21:03:33.107] [INFO] 

[2023-04-20 21:03:33.107] [INFO] ----------< org.apache.maven.plugin.my.unit:project-to-test >-----------

[2023-04-20 21:03:33.107] [INFO] Building Test MyMojo 1.0.0-SNAPSHOT

[2023-04-20 21:03:33.107] [INFO]   from pom.xml

[2023-04-20 21:03:33.107] [INFO] --------------------------------[ jar ]---------------------------------

[2023-04-20 21:03:33.108] [DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]

[2023-04-20 21:03:33.108] [DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]

[2023-04-20 21:03:33.109] [DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]

[2023-04-20 21:03:33.111] [DEBUG] Creating adapter using nameMapper 'gav' and factory 'rwlock-local'

[2023-04-20 21:03:33.113] [INFO] Artifact org.apache.maven.plugins:maven-resources-plugin:pom:3.3.0 is present in the local repository, but cached from a remote repository ID that is unavailable in current build context, verifying that is downloadable from [central (https://repo.maven.apache.org/maven2, default, releases)]

[2023-04-20 21:03:33.113] [DEBUG] Resolving artifact org.apache.maven.plugins:maven-resources-plugin:pom:3.3.0 from [central (https://repo.maven.apache.org/maven2, default, releases)]

[2023-04-20 21:03:33.117] [DEBUG] Writing tracking file '/root/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/3.3.0/maven-resources-plugin-3.3.0.pom.lastUpdated'

[2023-04-20 21:03:33.130] [INFO] ------------------------------------------------------------------------

[2023-04-20 21:03:33.131] [INFO] BUILD FAILURE

[2023-04-20 21:03:33.132] [INFO] ------------------------------------------------------------------------

[2023-04-20 21:03:33.132] [INFO] Total time:  0.067 s

[2023-04-20 21:03:33.133] [INFO] Finished at: 2023-04-20T21:03:33Z

[2023-04-20 21:03:33.134] [INFO] ------------------------------------------------------------------------

[2023-04-20 21:03:33.135] [INFO] [jenkins-event-spy] Generated /home/jenkins/agent/workspace/_TestNG_Maven_Mojo_release_1.0.0@tmp/withMaven7cd31a9e/maven-spy-20230420-210332-99111292096989679202327.log

[2023-04-20 21:03:33.136] [ERROR] [main] o.a.m.c.MavenCli [MavenCli.java:963] Plugin org.apache.maven.plugins:maven-resources-plugin:3.3.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:3.3.0: The following artifacts could not be resolved: org.apache.maven.plugins:maven-resources-plugin:pom:3.3.0 (present, but unavailable): Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:3.3.0 from/to central (https://repo.maven.apache.org/maven2): No connector factories available -> [Help 1]

org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-resources-plugin:3.3.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:3.3.0

	at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:125)

	at org.apache.maven.plugin.internal.DefaultMavenPluginManager.lambda$getPluginDescriptor$0(DefaultMavenPluginManager.java:178)

	at org.apache.maven.plugin.DefaultPluginDescriptorCache.lambda$get$0(DefaultPluginDescriptorCache.java:72)

	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)

	at org.apache.maven.plugin.DefaultPluginDescriptorCache.get(DefaultPluginDescriptorCache.java:70)

	at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:176)

	at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:266)

	at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:214)

	at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:155)

	at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:143)

	at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:122)

	at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:135)

	at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan(BuilderCommon.java:93)

	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:100)

	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)

	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)

	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)

	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)

	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)

	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)

	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:827)

	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:272)

	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:237)

	at com.pingidentity.testng.ci.AbstractGitMojo.executeMavenCommandExitCode(AbstractGitMojo.java:231)

	at com.pingidentity.testng.ci.TestChangesMojo.execute(TestChangesMojo.java:62)

	at com.pingidentity.testng.ci.TestChangesMojoChangesInParentClassTest.testTestChangesGoal(TestChangesMojoChangesInParentClassTest.java:43)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

	at java.base/java.lang.reflect.Method.invoke(Method.java:566)

	at junit.framework.TestCase.runTest(TestCase.java:177)

	at junit.framework.TestCase.runBare(TestCase.java:142)

	at junit.framework.TestResult$1.protect(TestResult.java:122)

	at junit.framework.TestResult.runProtected(TestResult.java:142)

	at junit.framework.TestResult.run(TestResult.java:125)

	at junit.framework.TestCase.run(TestCase.java:130)

	at junit.framework.TestSuite.runTest(TestSuite.java:241)

	at junit.framework.TestSuite.run(TestSuite.java:236)

	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)

	at org.junit.runners.Suite.runChild(Suite.java:128)

	at org.junit.runners.Suite.runChild(Suite.java:27)

	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)

	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)

	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)

	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)

	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)

	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)

	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)

	at org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:49)

	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:120)

	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:95)

	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75)

	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:69)

	at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:146)

	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)

	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)

	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)

	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)

Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:3.3.0

	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:242)

	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:172)

	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:268)

	at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:104)

	... 57 common frames omitted

Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: The following artifacts could not be resolved: org.apache.maven.plugins:maven-resources-plugin:pom:3.3.0 (present, but unavailable): Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:3.3.0 from/to central (https://repo.maven.apache.org/maven2): No connector factories available

	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:456)

	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:261)

	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:242)

	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:231)

	... 60 common frames omitted

Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:3.3.0 from/to central (https://repo.maven.apache.org/maven2): No connector factories available

	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)

	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:433)

	... 63 common frames omitted

Caused by: org.eclipse.aether.transfer.NoRepositoryConnectorException: No connector factories available

	at org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider.newRepositoryConnector(DefaultRepositoryConnectorProvider.java:179)

	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:515)

	... 64 common frames omitted

[2023-04-20 21:03:33.166] [ERROR] [main] o.a.m.c.MavenCli [MavenCli.java:850] 

[2023-04-20 21:03:33.167] [ERROR] [main] o.a.m.c.MavenCli [MavenCli.java:863] 

[2023-04-20 21:03:33.167] [ERROR] [main] o.a.m.c.MavenCli [MavenCli.java:864] For more information about the errors and possible solutions, please read the following articles:

[2023-04-20 21:03:33.168] [ERROR] [main] o.a.m.c.MavenCli [MavenCli.java:868] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

[2023-04-20 21:03:33.168] [DEBUG] Shutting down adapter factory; available factories [file-lock, rwlock-local, semaphore-local, noop]; available name mappers [discriminating, file-gav, file-hgav, file-static, gav, static]

[2023-04-20 21:03:33.169] [DEBUG] Shutting down 'file-lock' factory

[2023-04-20 21:03:33.169] [DEBUG] Shutting down 'rwlock-local' factory

[2023-04-20 21:03:33.170] [DEBUG] Shutting down 'semaphore-local' factory

[2023-04-20 21:03:33.170] [DEBUG] Shutting down 'noop' factory
@charleech
Copy link

charleech commented Apr 21, 2023

It seems like it cannot access to the internet, especially to the https://repo.maven.apache.org/maven2.

We are able to verify by executing the following command at the host machine.

docker run -it --rm  maven:3.9.1-eclipse-temurin-11 \
  bash -c \
  'wget https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/3.3.0/maven-resources-plugin-3.3.0.pom \
  -O /tmp/pom.xml \
  && ls -la /tmp/pom.xml'

Moreover, If I'm not wrong, you're using Jekins. We may add something like pre-build step to ensure that connectivity as well.

# Pre-Build Step

- wget https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/3.3.0/maven-resources-plugin-3.3.0.pom -O /tmp/pom.xml
- ls -la /tmp/pom.xml

Furthermore If the internet connection requires the Proxy, please visit the Apache Maven: Configuring a proxy for setting up the ~/.m2/settings.xml as the following example.

    <settings>
      .
      .
      <proxies>
       <proxy>
          <id>example-proxy</id>
          <active>true</active>
          <protocol>http</protocol>
          <host>proxy.example.com</host>
          <port>8080</port>
          <username>proxyuser</username>
          <password>somepassword</password>
          <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
        </proxy>
      </proxies>
      .
      .
    </settings>

Regarding to the following, Apart from modifying the settings.xml, we're also able to pass the proxy configuration as a command line argument, too.

@cstamas
Copy link

cstamas commented Apr 21, 2023

I disagree, something else is very wrong here:

  • org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:3.3.0 from/to central (https://repo.maven.apache.org/maven2): No connector factories available

This means that Maven cannot "speak" HTTP at all, as there are NO connectors for HTTP. Maven 3.9.x by default includes two connectors for HTTP (old resolver-transport-wagon and new resolver-transport-http).

This looks more like broken/incomplete deployment, or something else that made Maven not have connectors available.

@charleech
Copy link

Here is the list jar files inside the lib directory. I'm not sure if this may be any clue or not.

docker run -it --rm  maven:3.9.1-eclipse-temurin-11 bash

# Inside the bash for this container
mvn -v

# Apache Maven 3.9.1 (2e178502fcdbffc201671fb2537d0cb4b4cc58f8)
# Maven home: /usr/share/maven
# Java version: 11.0.18, vendor: Eclipse Adoptium, runtime: /opt/java/openjdk
# Default locale: en_US, platform encoding: UTF-8
# OS name: "linux", version: "3.10.0-1062.el7.x86_64", arch: "amd64", family: "unix"

ls -la /usr/share/maven/lib | grep transport

# -rw-r--r--. 1 root root   16230 Mar 15 09:39 maven-resolver-transport-file-1.9.7.jar
# -rw-r--r--. 1 root root   50468 Mar 15 09:39 maven-resolver-transport-http-1.9.7.jar
# -rw-r--r--. 1 root root   32439 Mar 15 09:39 maven-resolver-transport-wagon-1.9.7.jar

ls -la /usr/share/maven/lib | grep wagon

# -rw-r--r--. 1 root root   32439 Mar 15 09:39 maven-resolver-transport-wagon-1.9.7.jar
# -rw-r--r--. 1 root root   11350 Mar 15 09:39 wagon-file-3.5.3.jar
# -rw-r--r--. 1 root root    9405 Mar 15 09:39 wagon-http-3.5.3.jar
# -rw-r--r--. 1 root root   40832 Mar 15 09:39 wagon-http-shared-3.5.3.jar
# -rw-r--r--. 1 root root   55101 Mar 15 09:39 wagon-provider-api-3.5.3.jar

@cstamas
Copy link

cstamas commented Apr 21, 2023

I guess that image is ok, but am more interested in reporter's (same as @charleech) output, as nobody else reported such a problem, while 3.9.1 image is out for quite while. Inability of maven to download anything (due lack of connectors) would most probably trigger a swarm of issues.... 😄

@carlossg
Copy link
Owner

Do you have an example project where it is broken? There are tests in this repo and they are passing

@javydreamercsw
Copy link
Author

Added the connectivity check to my pipeline and seems to have worked fine:

[Pipeline] sh
+ wget https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/3.3.0/maven-resources-plugin-3.3.0.pom -O /tmp/pom.xml
--2023-04-21 13:04:47--  https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/3.3.0/maven-resources-plugin-3.3.0.pom
Resolving repo.maven.apache.org (repo.maven.apache.org)... 151.101.144.215
Connecting to repo.maven.apache.org (repo.maven.apache.org)|151.101.144.215|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8499 (8.3K) [text/xml]
Saving to: ‘/tmp/pom.xml’

     0K ........                                              100% 76.9M=0s

2023-04-21 13:04:47 (76.9 MB/s) - ‘/tmp/pom.xml’ saved [8499/8499]

[Pipeline] sh
+ ls -la /tmp/pom.xml
-rw-r--r-- 1 root root 8499 Jul 23  2022 /tmp/pom.xml

I could try to make the project available if needed or a version of it.

@javydreamercsw
Copy link
Author

Any updates?

@carlossg
Copy link
Owner

Do you have an example project where it is broken? There are tests in this repo and they are passing

@javydreamercsw
Copy link
Author

Project is private. Nothing I can share. I could try to create a version to share

@charleech
Copy link

charleech commented Apr 26, 2023

[debug] Running command mvn install -DskipTests=true -X in /home/jenkins/agent/workspace/_TestNG_Maven_Mojo_release_1.0.0/target/project-to-test/TestChangesMojoChangesInParentClassTest1682024612217

Apache Maven 3.9.1 (2e178502fcdbffc201671fb2537d0cb4b4cc58f8)

Maven home: <unknown Maven home> <------------------------------------------- Here is the suspected.

Java version: 11.0.18, vendor: Eclipse Adoptium, runtime: /opt/java/openjdk

Default locale: en_US, platform encoding: UTF-8

OS name: "linux", version: "5.15.0-1017-aws", arch: "amd64", family: "unix"

It looks like there will be something wrong with the ${maven.home} so that it prints as Maven home: <unknown Maven home>.

Regarding my previous comment (#365 (comment)) in my environment it prints as Maven home: /usr/share/maven

As far as I understand, if the Maven is not able to locate the ${maven.home} it also cannot load the required jar files at ${maven.home}/lib as well.

@javydreamercsw
Copy link
Author

This is the YAML file I'm using for this in case it helps:

"""
  apiVersion: v1
  kind: Pod
  metadata:
    labels:
      jenkins: runners
  spec:
    containers:
    - command:
      - cat
      image: maven:3.9.1-eclipse-temurin-11
      imagePullPolicy: Always
      name: maven
      tty: true
      volumeMounts:
      - mountPath: /root/.m2/repository
        name: maven-repo
    volumes:
    - hostPath:
        path: /root/maven_shared_repo/.m2
        type: DirectoryOrCreate
      name: maven-repo"""

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

No branches or pull requests

4 participants