[Solved] Maven build failure - first install

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Solved] Maven build failure - first install

kobano
This post was updated on .
Hello, I'm a beginner and follow the course OpenClassroom "Organize and package a Java application with Apache Maven"

On this first part I have to create a Maven project qsuelette from the quickstart archetype.

Following the line :

mvn -X archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.1

I get a build failure and I can not find the source of the problem.

I added -X for more info, and here are the last lines I can get :

at org.apache.maven.archetype.downloader.DefaultDownloader.download (DefaultDownloader.java:79) at org.apache.maven.archetype.common.DefaultArchetypeArtifactManager.exists (DefaultArchetypeArtifactManager.java:279) at org.apache.maven.archetype.ui.generation.DefaultArchetypeGenerationConfigurator.configureArchetype (DefaultArchetypeGenerationConfigurator.java:121) at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute (CreateProjectFromArchetypeMojo.java:200) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:564) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)  Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.apache.maven.archetypes:maven-archetype-quickstart:jar:3.0.1 in central (https://repo.maven.apache.org/maven2)
    at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed (ArtifactTransportListener.java:48)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run (BasicRepositoryConnector.java:365)
    at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run (RunnableErrorForwarder.java:75)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute (BasicRepositoryConnector.java:583)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get (BasicRepositoryConnector.java:259)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads (DefaultArtifactResolver.java:498)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:399)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:224)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:201)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact (DefaultRepositorySystem.java:260)
    at org.apache.maven.shared.artifact.resolve.internal.Maven31ArtifactResolver.resolveArtifact (Maven31ArtifactResolver.java:108)
    at org.apache.maven.shared.artifact.resolve.internal.Maven31ArtifactResolver.resolveArtifact (Maven31ArtifactResolver.java:80)
    at org.apache.maven.shared.artifact.resolve.internal.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:73)
    at org.apache.maven.archetype.downloader.DefaultDownloader.download (DefaultDownloader.java:79)
    at org.apache.maven.archetype.common.DefaultArchetypeArtifactManager.exists (DefaultArchetypeArtifactManager.java:279)
    at org.apache.maven.archetype.ui.generation.DefaultArchetypeGenerationConfigurator.configureArchetype (DefaultArchetypeGenerationConfigurator.java:121)
    at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute (CreateProjectFromArchetypeMojo.java:200)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:54 min
[INFO] Finished at: 2018-03-13T19:11:57+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.apache.maven.archetypes:maven-archetype-quickstart:3.0.1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.apache.maven.archetypes:maven-archetype-quickstart:3.0.1)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: The desired archetype does not exist (org.apache.maven.archetypes:maven-archetype-quickstart:3.0.1)
    at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute (CreateProjectFromArchetypeMojo.java:216)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.archetype.exception.UnknownArchetype: The desired archetype does not exist (org.apache.maven.archetypes:maven-archetype-quickstart:3.0.1)
    at org.apache.maven.archetype.ui.generation.DefaultArchetypeGenerationConfigurator.configureArchetype (DefaultArchetypeGenerationConfigurator.java:125)
    at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute (CreateProjectFromArchetypeMojo.java:200)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
←[0m←[0m
C:\Program Files\apache\repository>

I'm working on windows 8, and have not created a settings.xml file.

For info, here is what mvn -v shows:
C:\Program Files\apache\repository>mvn -v
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
Maven home: C:\Program Files\apache\apache-maven-3.5.3\bin\..
Java version: 9.0.4, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk-9.0.4
Default locale: fr_FR, platform encoding: Cp1252
OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"

A line in what is displayed indicates that "quickstart" is not found:
Could not find artifact org.apache.maven.archetypes:maven-archetype-quickstart:jar:3.0.1 in central (https://repo.maven.apache.org/maven2)

at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.apache.maven.archetypes:maven-archetype-quickstart:jar:3.0.1 in central (https://repo.maven.apache.org/maven2)

Could it be that the OpenClassroom course uses a skeleton that no longer exists?

Or the problem would come from elsewhere?

Thanks in advance for the help !!
Reply | Threaded
Open this post in threaded view
|

Re: Maven build failure - first install

Bernd Eckenfels
Hello,

Looks like the tutorial is wrong, I only see a 1.1 version of that archetype. Since you normally cannot remove artifacts from Maven Central it looks like this never worked. You can see the content here:

https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/

Gruss
Bernd

Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
From: kobano <[hidden email]>
Sent: Wednesday, March 14, 2018 11:12:07 AM
To: [hidden email]
Subject: Maven build failure - first install

Hello, I'm a beginner and follow the course OpenClassroom " Organize and
package a Java application with Apache Maven
<https://openclassrooms.com/courses/organisez-et-packagez-une-application-java-avec-apache-maven/creez-votre-premier-projet-maven>
"On this first part I have to  create a Maven project qsuelette from the
quickstart archetype
<https://openclassrooms.com/courses/organisez-et-packagez-une-application-java-avec-apache-maven/creez-votre-premier-projet-maven#/id/r-4608836>
.Following the line :mvn -X archetype:generate
-DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.1I get
a build failure and I can not find the source of the problem.I added -X for
more info, and here are the last lines I can get :I'm working on windows 8,
and have not created a settings.xml file.For info, here is what mvn -v
shows:A line in what is displayed indicates that "quickstart" is not
found:Could not find artifact
org.apache.maven.archetypes:maven-archetype-quickstart:jar:3.0.1 in central
( https://repo.maven.apache.org/maven2
<https://repo.maven.apache.org/maven2>  )Could it be that the OpenClassroom
course uses a skeleton that no longer exists?Or the problem would come from
elsewhere?Thanks in advance for the help !!



--
Sent from: http://maven.40175.n5.nabble.com/Maven-Users-f40176.html
Reply | Threaded
Open this post in threaded view
|

Re: Maven build failure - first install

Anders Hammar
As " -DarchetypeVersion=1.1" is specified it should get version 1.1 of the
archtype. It's hard to tell why it's not based on the little info provided.

I suggest use
mvn archtype:generate
and you'll get prompted for archetype

/Anders

On Wed, Mar 14, 2018 at 11:17 AM, Bernd Eckenfels <[hidden email]>
wrote:

> Hello,
>
> Looks like the tutorial is wrong, I only see a 1.1 version of that
> archetype. Since you normally cannot remove artifacts from Maven Central it
> looks like this never worked. You can see the content here:
>
> https://repo.maven.apache.org/maven2/org/apache/maven/
> archetypes/maven-archetype-quickstart/
>
> Gruss
> Bernd
>
> Gruss
> Bernd
> --
> http://bernd.eckenfels.net
> ________________________________
> From: kobano <[hidden email]>
> Sent: Wednesday, March 14, 2018 11:12:07 AM
> To: [hidden email]
> Subject: Maven build failure - first install
>
> Hello, I'm a beginner and follow the course OpenClassroom " Organize and
> package a Java application with Apache Maven
> <https://openclassrooms.com/courses/organisez-et-packagez-
> une-application-java-avec-apache-maven/creez-votre-premier-projet-maven>
> "On this first part I have to  create a Maven project qsuelette from the
> quickstart archetype
> <https://openclassrooms.com/courses/organisez-et-packagez-
> une-application-java-avec-apache-maven/creez-votre-
> premier-projet-maven#/id/r-4608836>
> .Following the line :mvn -X archetype:generate
> -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.1I
> get
> a build failure and I can not find the source of the problem.I added -X for
> more info, and here are the last lines I can get :I'm working on windows 8,
> and have not created a settings.xml file.For info, here is what mvn -v
> shows:A line in what is displayed indicates that "quickstart" is not
> found:Could not find artifact
> org.apache.maven.archetypes:maven-archetype-quickstart:jar:3.0.1 in
> central
> ( https://repo.maven.apache.org/maven2
> <https://repo.maven.apache.org/maven2>  )Could it be that the
> OpenClassroom
> course uses a skeleton that no longer exists?Or the problem would come from
> elsewhere?Thanks in advance for the help !!
>
>
>
> --
> Sent from: http://maven.40175.n5.nabble.com/Maven-Users-f40176.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Maven build failure - first install

kobano
I found the origin of the problem:
The apache-maven-3.5.3 files were in a folder created in c:\Program Files.
I changed and created a directory at the root of
c:\apache\apache-maven-3.5.3 and the script now works without problems.
Thanks for your help



--
Sent from: http://maven.40175.n5.nabble.com/Maven-Users-f40176.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]