kolorobot / spring-mvc-quickstart-archetype

The project is a Maven archetype for Spring MVC web application.
http://blog.codeleak.pl
1.05k stars 477 forks source link

Error fetching Archetype: archetype does not exist #128

Closed ivanskodje closed 5 years ago

ivanskodje commented 7 years ago

Following the "Create a new project in IntelliJ" guide, I get the following error:

/usr/local/java/jdk1.8.0_144/bin/java -Dmaven.multiModuleProjectDirectory=/tmp/archetypetmp -Dmaven.home=/opt/idea-IC-172.3968.16/plugins/maven/lib/maven3 -Dclassworlds.conf=/opt/idea-IC-172.3968.16/plugins/maven/lib/maven3/bin/m2.conf -Dfile.encoding=UTF-8 -classpath /opt/idea-IC-172.3968.16/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2017.2.3 -DinteractiveMode=false -DgroupId=asdadsdasdas -DartifactId=asdasdasdadas -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=pl.codeleak -DarchetypeArtifactId=spring-mvc-quickstart -DarchetypeVersion=5.0.0 -DarchetypeRepository=http://kolorobot.github.io/spring-mvc-quickstart-archetype org.apache.maven.plugins:maven-archetype-plugin:RELEASE:generate [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Stub Project (No POM) 1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) > generate-sources @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) < generate-sources @ standalone-pom <<< [INFO] [INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Batch mode [WARNING] Archetype not found in any catalog. Falling back to central repository. [WARNING] Add a repsoitory with id 'archetype' in your settings.xml if archetype's repository is elsewhere. [WARNING] The POM for pl.codeleak:spring-mvc-quickstart:jar:5.0.0 is missing, no dependency information available [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.425 s [INFO] Finished at: 2017-10-08T21:08:57+02:00 [INFO] Final Memory: 14M/214M [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 (pl.codeleak:spring-mvc-quickstart:5.0.0) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [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 [ERROR] Maven execution terminated abnormally (exit code 1)

Since I am relatively new to Spring and Maven, I hope this is simply a user error. However, if it is not - I hope this will provide helpful.

Regardless, I would appreciate any help solving this. Using IntelliJ Community Edition (2017) on Ubuntu 16.4.


Tested this on another computer (Win10) and got the same results.

[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 (pl.codeleak:spring-mvc-quickstart:5.0.0) -> [Help 1] It does not appear that it can be added by selecting "Add Archetype" in IntelliJ :S


Last additional note:

The IntelliJ guide works if you run the following before attempting to create your project using the Archetype. git clone https://github.com/kolorobot/spring-mvc-quickstart-archetype.git cd spring-mvc-quickstart-archetype mvn clean install

binarywang commented 7 years ago

I tried just like you did and got the same error message.

kolorobot commented 7 years ago

I cleanup up all things locally and rerun and seems like it is all fine:

mvn archetype:generate -DarchetypeGroupId=pl.codeleak -DarchetypeArtifactId=spring-mvc-quickstart -DarchetypeVersion=5.0.0 -DgroupId=pl.codeleak -DartifactId=arch-sdfasdf -Dpackage=pl.codeleak.arch55 -Dversion=1.0.0 -DarchetypeRepository=http://kolorobot.github.io/spring-mvc-quickstart-archetype [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Stub Project (No POM) 1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom <<< [INFO] [INFO] --- maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Interactive mode [INFO] Archetype defined by properties Downloading: http://kolorobot.github.io/spring-mvc-quickstart-archetype/pl/codeleak/spring-mvc-quickstart/5.0.0/spring-mvc-quickstart-5.0.0.jar [WARNING] Checksum validation failed, no checksums available from the repository for http://kolorobot.github.io/spring-mvc-quickstart-archetype/pl/codeleak/spring-mvc-quickstart/5.0.0/spring-mvc-quickstart-5.0.0.jar Downloaded: http://kolorobot.github.io/spring-mvc-quickstart-archetype/pl/codeleak/spring-mvc-quickstart/5.0.0/spring-mvc-quickstart-5.0.0.jar (203 KB at 129.8 KB/sec) Downloading: http://kolorobot.github.io/spring-mvc-quickstart-archetype/pl/codeleak/spring-mvc-quickstart/5.0.0/spring-mvc-quickstart-5.0.0.pom [WARNING] Checksum validation failed, no checksums available from the repository for http://kolorobot.github.io/spring-mvc-quickstart-archetype/pl/codeleak/spring-mvc-quickstart/5.0.0/spring-mvc-quickstart-5.0.0.pom Downloaded: http://kolorobot.github.io/spring-mvc-quickstart-archetype/pl/codeleak/spring-mvc-quickstart/5.0.0/spring-mvc-quickstart-5.0.0.pom (2 KB at 2.4 KB/sec) [INFO] Using property: groupId = pl.codeleak [INFO] Using property: artifactId = arch-sdfasdf [INFO] Using property: version = 1.0.0 [INFO] Using property: package = pl.codeleak.arch55 Confirm properties configuration: groupId: pl.codeleak artifactId: arch-sdfasdf version: 1.0.0 package: pl.codeleak.arch55 Y: :

paulobatista commented 7 years ago

I had the same error and "workarounded" it by intalling the archetype locally. However I have another machine which the remote worked flawless.

There are any configuration mismatch which we can find between the two machines? I can do some tests if necessary.

By the way: thanks for the code!

kolorobot commented 7 years ago

Installing locally is what I always do (or did) with this archetype, but indeed some people are reporting issues with accessing the remote repo. I don't what's what's that - maybe maven version? Should be published to maven central, but this takes time.

paulobatista commented 7 years ago

I'm afraid that the version is not the problem:

In the workarounded machine:

paulo@manjericao:~$ cat /etc/issue
Ubuntu 16.04.2 LTS \n \l

paulo@manjericao:~$ mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T14:41:47-02:00)
Maven home: /home/paulo/apps/apache-maven-3.3.9
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-68-generic", arch: "amd64", family: "unix"

In the working machine:

paulo@madoka:~$ cat /etc/issue
Ubuntu 14.04.5 LTS \n \l

paulo@madoka:~$ mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T14:41:47-02:00)
Maven home: /usr/share/maven3
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-83-generic", arch: "amd64", family: "unix"
chrisn1992 commented 6 years ago

The issue seems to be the repo denying access from the IDE of some people(like me). What I did before realizing this: 1/ Try install archetype from IntelliJ Idea - via both creating new maven project with archetype and simple maven project then run mvn manually. Result: both failed 2/ Try on STS with both methods as same as IntelliJ Idea. Result: failed As information: POM and JAR for archetype cannot be retrieved, hence the error "missing" 3/ Try accessing both "missing" through browser: success, browser manually downloaded both file.

annaskulimowska commented 6 years ago

I've got the same problem, but after installing locally everything works fine

gmlupatelli commented 6 years ago

I had the same problem using Eclipse. I don't know if it has any correlation, but it worked after I logged in github from a web browser and living it open.

kolorobot commented 5 years ago

This is duplicate of #130. See comments there.