简体   繁体   中英

quarcus maven plugin fails to create a project

Trying to create a quarkus project from scratch with the command:

mvn io.quarkus:quarkus-maven-plugin:1.13.7.Final:create -DprojectGroupId=org.acme -DprojectArtifactId=getting-started -DclassName="org.acme.getting.started.GreetingResource" -Dpath="/hello"

as described in the Bootstrapping a quarkus project page fails with the below error:

[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:1.13.7.Final:create (default-cli) @ standalone-pom ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.692 s
[INFO] Finished at: 2021-06-16T14:23:09+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.13.7.Final:create (default-cli) on project standalone-pom: Execution default-cli of goal io.quarkus:quarkus-maven-plugin:1.13.7.Final:create failed: Failed to deserialize extension catalog ~/.m2/repository/io/quarkus/quarkus-universe-bom-quarkus-platform-descriptor/1.13.7.Final/quarkus-universe-bom-quarkus-platform-descriptor-1.13.7.Final-1.13.7.Final.json: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
[ERROR]  at [Source: (BufferedReader); line: 1, column: 2]
[ERROR] -> [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/PluginExecutionException

Running the maven debug option (-X) reveals a probably erroneous .m2 repository resource:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.028 s
[INFO] Finished at: 2021-06-16T14:10:23+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.13.7.Final:create (default-cli) on project standalone-pom: Execution default-cli of goal io.quarkus:quarkus-maven-plugin:1.13.7.Final:create failed: Failed to deserialize extension catalog ~/.m2/repository/io/quarkus/quarkus-universe-bom-quarkus-platform-descriptor/1.13.7.Final/quarkus-universe-bom-quarkus-platform-descriptor-1.13.7.Final-1.13.7.Final.json: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
[ERROR]  at [Source: (BufferedReader); line: 1, column: 2]
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.quarkus:quarkus-maven-plugin:1.13.7.Final:create (default-cli) on project standalone-pom: Execution default-cli of goal io.quarkus:quarkus-maven-plugin:1.13.7.Final:create failed: Failed to deserialize extension catalog ~/.m2/repository/io/quarkus/quarkus-universe-bom-quarkus-platform-descriptor/1.13.7.Final/quarkus-universe-bom-quarkus-platform-descriptor-1.13.7.Final-1.13.7.Final.json
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    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:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    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:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal io.quarkus:quarkus-maven-plugin:1.13.7.Final:create failed: Failed to deserialize extension catalog ~/.m2/repository/io/quarkus/quarkus-universe-bom-quarkus-platform-descriptor/1.13.7.Final/quarkus-universe-bom-quarkus-platform-descriptor-1.13.7.Final-1.13.7.Final.json
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)

Looking further at the faulty resource ~/.m2/repository/io/quarkus/quarkus-universe-bom-quarkus-platform-descriptor/1.13.7.Final/quarkus-universe-bom-quarkus-platform-descriptor-1.13.7.Final-1.13.7.Final.json , it appears that the expected .json file is html formatted...

Also, my maven version is compatible with the quarkus requirements:

User@-bash - createProject - 14:23:09 $ mvn --version
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /usr/local/Cellar/maven/3.8.1/libexec
Java version: 11.0.11, vendor: GraalVM Community, runtime: /Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.1.0/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "11.4", arch: "x86_64", family: "mac"

and my local .m2 repository contains all the necessary quarkus dependencies.

  • did someone already experienced such an issue ?
  • any hint on how to solve this ? (cannot believe that the maven central repository contains an erroneous resource)

Cheers !

Changing my ~/.m2/repository/io/quarkus/quarkus-universe-bom-quarkus-platform-descriptor/quarkus-universe-bom-quarkus-platform-descriptor-1.13.7.Final-1.13.7.Final.json with the content of The expected json descriptor from here solved the issue.

Here is the expected result:

User@-bash - createProject - 15:46:04 $ mvn io.quarkus:quarkus-maven-plugin:1.13.7.Final:create -DprojectGroupId=org.acme -DprojectArtifactId=getting-started -DclassName="org.acme.getting.started.GreetingResource" -Dpath="/hello"
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- quarkus-maven-plugin:1.13.7.Final:create (default-cli) @ standalone-pom ---
-----------

applying codestarts...
🔠 java
🧰 maven
🗃 quarkus
📜 config-properties
🛠 dockerfiles
🛠 maven-wrapper
🐒 resteasy-example

-----------
[SUCCESS] ✅ quarkus project has been successfully generated in:
--> /Users/User/work/quarkus/test/createProject/getting-started
-----------
[INFO] 
[INFO] ========================================================================================
[INFO] Your new application has been created in /Users/User/work/quarkus/test/createProject/getting-started
[INFO] Navigate into this directory and launch your application with mvn quarkus:dev
[INFO] Your application will be accessible on http://localhost:8080
[INFO] ========================================================================================
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.060 s
[INFO] Finished at: 2021-06-16T17:16:26+02:00
[INFO] ------------------------------------------------------------------------

I do not know BTW where to report the maven central invalid download checksum for this file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM