quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.82k stars 2.69k forks source link

Enforce (or warn/error) maven version before creating project #6341

Closed Foredoomed closed 2 years ago

Foredoomed commented 4 years ago

After I execute the command which is

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

then an error occurs:

Listening for transport dt_socket at address: 8088
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- quarkus-maven-plugin:1.1.0.Final:create (default-cli) @ standalone-pom ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.215 s
[INFO] Finished at: 2019-12-26T17:35:10+08:00
[INFO] Final Memory: 18M/213M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.1.0.Final:create (default-cli) on project standalone-pom: Execution default-cli of goal io.quarkus:quarkus-maven-plugin:1.1.0.Final:create fa
iled: An API incompatibility was encountered while executing io.quarkus:quarkus-maven-plugin:1.1.0.Final:create: java.lang.NoSuchMethodError: org.eclipse.aether.transfer.TransferResource.<init>(Ljava/lang/S
tring;Ljava/lang/String;Ljava/lang/String;Ljava/io/File;Lorg/eclipse/aether/RequestTrace;)V
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>io.quarkus:quarkus-maven-plugin:1.1.0.Final
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/lakala/.m2/repository/io/quarkus/quarkus-maven-plugin/1.1.0.Final/quarkus-maven-plugin-1.1.0.Final.jar
[ERROR] urls[1] = file:/C:/Users/lakala/.m2/repository/io/quarkus/quarkus-bootstrap-core/1.1.0.Final/quarkus-bootstrap-core-1.1.0.Final.jar
[ERROR] urls[2] = file:/C:/Users/lakala/.m2/repository/com/google/guava/guava/27.0.1-jre/guava-27.0.1-jre.jar
[ERROR] urls[3] = file:/C:/Users/lakala/.m2/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar
[ERROR] urls[4] = file:/C:/Users/lakala/.m2/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
[ERROR] urls[5] = file:/C:/Users/lakala/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar
[ERROR] urls[6] = file:/C:/Users/lakala/.m2/repository/org/checkerframework/checker-qual/2.5.2/checker-qual-2.5.2.jar
[ERROR] urls[7] = file:/C:/Users/lakala/.m2/repository/com/google/errorprone/error_prone_annotations/2.2.0/error_prone_annotations-2.2.0.jar
[ERROR] urls[8] = file:/C:/Users/lakala/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar
[ERROR] urls[9] = file:/C:/Users/lakala/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.17/animal-sniffer-annotations-1.17.jar
[ERROR] urls[10] = file:/C:/Users/lakala/.m2/repository/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar
[ERROR] urls[11] = file:/C:/Users/lakala/.m2/repository/org/apache/maven/maven-embedder/3.5.4/maven-embedder-3.5.4.jar
[ERROR] urls[12] = file:/C:/Users/lakala/.m2/repository/commons-cli/commons-cli/1.4/commons-cli-1.4.jar
[ERROR] urls[13] = file:/C:/Users/lakala/.m2/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar
[ERROR] urls[14] = file:/C:/Users/lakala/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.24/plexus-interpolation-1.24.jar
[ERROR] urls[15] = file:/C:/Users/lakala/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[16] = file:/C:/Users/lakala/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[17] = file:/C:/Users/lakala/.m2/repository/org/apache/maven/resolver/maven-resolver-connector-basic/1.1.1/maven-resolver-connector-basic-1.1.1.jar
[ERROR] urls[18] = file:/C:/Users/lakala/.m2/repository/org/apache/maven/resolver/maven-resolver-transport-wagon/1.1.1/maven-resolver-transport-wagon-1.1.1.jar
[ERROR] urls[19] = file:/C:/Users/lakala/.m2/repository/org/apache/maven/wagon/wagon-http/3.0.0/wagon-http-3.0.0.jar
[ERROR] urls[20] = file:/C:/Users/lakala/.m2/repository/org/apache/maven/wagon/wagon-http-shared/3.0.0/wagon-http-shared-3.0.0.jar
[ERROR] urls[21] = file:/C:/Users/lakala/.m2/repository/org/jsoup/jsoup/1.11.3/jsoup-1.11.3.jar
[ERROR] urls[22] = file:/C:/Users/lakala/.m2/repository/org/apache/httpcomponents/httpclient/4.5.10/httpclient-4.5.10.jar
[ERROR] urls[23] = file:/C:/Users/lakala/.m2/repository/commons-codec/commons-codec/1.13/commons-codec-1.13.jar
[ERROR] urls[24] = file:/C:/Users/lakala/.m2/repository/org/apache/httpcomponents/httpcore/4.4.12/httpcore-4.4.12.jar
[ERROR] urls[25] = file:/C:/Users/lakala/.m2/repository/org/apache/maven/wagon/wagon-file/3.0.0/wagon-file-3.0.0.jar
[ERROR] urls[26] = file:/C:/Users/lakala/.m2/repository/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.jar
[ERROR] urls[27] = file:/C:/Users/lakala/.m2/repository/org/jboss/logging/commons-logging-jboss-logging/1.0.0.Final/commons-logging-jboss-logging-1.0.0.Final.jar
[ERROR] urls[28] = file:/C:/Users/lakala/.m2/repository/io/quarkus/quarkus-platform-descriptor-json/1.1.0.Final/quarkus-platform-descriptor-json-1.1.0.Final.jar
[ERROR] urls[29] = file:/C:/Users/lakala/.m2/repository/io/quarkus/quarkus-devtools-common/1.1.0.Final/quarkus-devtools-common-1.1.0.Final.jar
[ERROR] urls[30] = file:/C:/Users/lakala/.m2/repository/io/quarkus/quarkus-platform-descriptor-api/1.1.0.Final/quarkus-platform-descriptor-api-1.1.0.Final.jar
[ERROR] urls[31] = file:/C:/Users/lakala/.m2/repository/io/quarkus/http/quarkus-http-websockets-jsr/3.0.1.Final/quarkus-http-websockets-jsr-3.0.1.Final.jar
[ERROR] urls[32] = file:/C:/Users/lakala/.m2/repository/io/quarkus/http/quarkus-http-core/3.0.1.Final/quarkus-http-core-3.0.1.Final.jar
[ERROR] urls[33] = file:/C:/Users/lakala/.m2/repository/io/quarkus/http/quarkus-http-http-core/3.0.1.Final/quarkus-http-http-core-3.0.1.Final.jar
[ERROR] urls[34] = file:/C:/Users/lakala/.m2/repository/io/netty/netty-buffer/4.1.42.Final/netty-buffer-4.1.42.Final.jar
[ERROR] urls[35] = file:/C:/Users/lakala/.m2/repository/io/netty/netty-codec-http/4.1.42.Final/netty-codec-http-4.1.42.Final.jar
[ERROR] urls[36] = file:/C:/Users/lakala/.m2/repository/io/netty/netty-common/4.1.42.Final/netty-common-4.1.42.Final.jar
[ERROR] urls[37] = file:/C:/Users/lakala/.m2/repository/io/netty/netty-transport/4.1.42.Final/netty-transport-4.1.42.Final.jar
[ERROR] urls[38] = file:/C:/Users/lakala/.m2/repository/io/netty/netty-resolver/4.1.42.Final/netty-resolver-4.1.42.Final.jar
[ERROR] urls[39] = file:/C:/Users/lakala/.m2/repository/io/netty/netty-codec/4.1.42.Final/netty-codec-4.1.42.Final.jar
[ERROR] urls[40] = file:/C:/Users/lakala/.m2/repository/io/netty/netty-handler/4.1.42.Final/netty-handler-4.1.42.Final.jar
[ERROR] urls[41] = file:/C:/Users/lakala/.m2/repository/io/quarkus/http/quarkus-http-servlet/3.0.1.Final/quarkus-http-servlet-3.0.1.Final.jar
[ERROR] urls[42] = file:/C:/Users/lakala/.m2/repository/jakarta/servlet/jakarta.servlet-api/4.0.3/jakarta.servlet-api-4.0.3.jar
[ERROR] urls[43] = file:/C:/Users/lakala/.m2/repository/jakarta/websocket/jakarta.websocket-api/1.1.2/jakarta.websocket-api-1.1.2.jar
[ERROR] urls[44] = file:/C:/Users/lakala/.m2/repository/io/quarkus/quarkus-bom-descriptor-json/1.1.0.Final/quarkus-bom-descriptor-json-1.1.0.Final.json
[ERROR] urls[45] = file:/C:/Users/lakala/.m2/repository/io/quarkus/quarkus-platform-descriptor-resolver-json/1.1.0.Final/quarkus-platform-descriptor-resolver-json-1.1.0.Final.jar
[ERROR] urls[46] = file:/C:/Users/lakala/.m2/repository/com/eclipsesource/minimal-json/minimal-json/0.9.5/minimal-json-0.9.5.jar
[ERROR] urls[47] = file:/C:/Users/lakala/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar
[ERROR] urls[48] = file:/C:/Users/lakala/.m2/repository/jakarta/inject/jakarta.inject-api/1.0/jakarta.inject-api-1.0.jar
[ERROR] urls[49] = file:/C:/Users/lakala/.m2/repository/jakarta/enterprise/jakarta.enterprise.cdi-api/2.0.2/jakarta.enterprise.cdi-api-2.0.2.jar
[ERROR] urls[50] = file:/C:/Users/lakala/.m2/repository/jakarta/el/jakarta.el-api/3.0.3/jakarta.el-api-3.0.3.jar
[ERROR] urls[51] = file:/C:/Users/lakala/.m2/repository/jakarta/interceptor/jakarta.interceptor-api/1.2.5/jakarta.interceptor-api-1.2.5.jar
[ERROR] urls[52] = file:/C:/Users/lakala/.m2/repository/org/apache/maven/shared/maven-invoker/3.0.1/maven-invoker-3.0.1.jar
[ERROR] urls[53] = file:/C:/Users/lakala/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.2.1/maven-shared-utils-3.2.1.jar
[ERROR] urls[54] = file:/C:/Users/lakala/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar
[ERROR] urls[55] = file:/C:/Users/lakala/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.7.1/plexus-component-annotations-1.7.1.jar
[ERROR] urls[56] = file:/C:/Users/lakala/.m2/repository/org/apache/maven/maven-builder-support/3.5.4/maven-builder-support-3.5.4.jar
[ERROR] urls[57] = file:/C:/Users/lakala/.m2/repository/org/apache/maven/resolver/maven-resolver-util/1.1.1/maven-resolver-util-1.1.1.jar
[ERROR] urls[58] = file:/C:/Users/lakala/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.3/org.eclipse.sisu.inject-0.3.3.jar
[ERROR] urls[59] = file:/C:/Users/lakala/.m2/repository/com/google/inject/guice/4.2.0/guice-4.2.0-no_aop.jar
[ERROR] urls[60] = file:/C:/Users/lakala/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
[ERROR] urls[61] = file:/C:/Users/lakala/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
[ERROR] urls[62] = file:/C:/Users/lakala/.m2/repository/com/google/code/google-collections/google-collect/snapshot-20080530/google-collect-snapshot-20080530.jar
[ERROR] urls[63] = file:/C:/Users/lakala/.m2/repository/junit/junit/4.12/junit-4.12.jar
[ERROR] urls[64] = file:/C:/Users/lakala/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
[ERROR] urls[65] = file:/C:/Users/lakala/.m2/repository/io/quarkus/quarkus-creator/1.1.0.Final/quarkus-creator-1.1.0.Final.jar
[ERROR] urls[66] = file:/C:/Users/lakala/.m2/repository/io/quarkus/quarkus-core-deployment/1.1.0.Final/quarkus-core-deployment-1.1.0.Final.jar
[ERROR] urls[67] = file:/C:/Users/lakala/.m2/repository/org/wildfly/common/wildfly-common/1.5.0.Final-format-001/wildfly-common-1.5.0.Final-format-001.jar
[ERROR] urls[68] = file:/C:/Users/lakala/.m2/repository/io/quarkus/gizmo/gizmo/1.0.0.Final/gizmo-1.0.0.Final.jar
[ERROR] urls[69] = file:/C:/Users/lakala/.m2/repository/org/ow2/asm/asm-util/7.1/asm-util-7.1.jar
[ERROR] urls[70] = file:/C:/Users/lakala/.m2/repository/org/ow2/asm/asm-tree/7.1/asm-tree-7.1.jar
[ERROR] urls[71] = file:/C:/Users/lakala/.m2/repository/org/ow2/asm/asm-analysis/7.1/asm-analysis-7.1.jar
[ERROR] urls[72] = file:/C:/Users/lakala/.m2/repository/org/jboss/jandex/2.1.2.Final/jandex-2.1.2.Final.jar
[ERROR] urls[73] = file:/C:/Users/lakala/.m2/repository/org/ow2/asm/asm/7.1/asm-7.1.jar
[ERROR] urls[74] = file:/C:/Users/lakala/.m2/repository/io/quarkus/quarkus-core/1.1.0.Final/quarkus-core-1.1.0.Final.jar
[ERROR] urls[75] = file:/C:/Users/lakala/.m2/repository/io/smallrye/config/smallrye-config/1.5.1/smallrye-config-1.5.1.jar
[ERROR] urls[76] = file:/C:/Users/lakala/.m2/repository/io/smallrye/config/smallrye-config-common/1.5.1/smallrye-config-common-1.5.1.jar
[ERROR] urls[77] = file:/C:/Users/lakala/.m2/repository/org/eclipse/microprofile/config/microprofile-config-api/1.3/microprofile-config-api-1.3.jar
[ERROR] urls[78] = file:/C:/Users/lakala/.m2/repository/org/jboss/logging/jboss-logging-annotations/2.1.0.Final/jboss-logging-annotations-2.1.0.Final.jar
[ERROR] urls[79] = file:/C:/Users/lakala/.m2/repository/org/jboss/threads/jboss-threads/3.0.0.Final/jboss-threads-3.0.0.Final.jar
[ERROR] urls[80] = file:/C:/Users/lakala/.m2/repository/io/quarkus/quarkus-builder/1.1.0.Final/quarkus-builder-1.1.0.Final.jar
[ERROR] urls[81] = file:/C:/Users/lakala/.m2/repository/org/graalvm/sdk/graal-sdk/19.2.1/graal-sdk-19.2.1.jar
[ERROR] urls[82] = file:/C:/Users/lakala/.m2/repository/io/quarkus/quarkus-development-mode/1.1.0.Final/quarkus-development-mode-1.1.0.Final.jar
[ERROR] urls[83] = file:/C:/Users/lakala/.m2/repository/org/jboss/logmanager/jboss-logmanager-embedded/1.0.4/jboss-logmanager-embedded-1.0.4.jar
[ERROR] urls[84] = file:/C:/Users/lakala/.m2/repository/org/apache/maven/shared/maven-artifact-transfer/0.10.0/maven-artifact-transfer-0.10.0.jar
[ERROR] urls[85] = file:/C:/Users/lakala/.m2/repository/org/apache/maven/shared/maven-common-artifact-filters/3.0.1/maven-common-artifact-filters-3.0.1.jar
[ERROR] urls[86] = file:/C:/Users/lakala/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[87] = file:/C:/Users/lakala/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[88] = file:/C:/Users/lakala/.m2/repository/jline/jline/2.14.6/jline-2.14.6.jar
[ERROR] urls[89] = file:/C:/Users/lakala/.m2/repository/org/freemarker/freemarker/2.3.29/freemarker-2.3.29.jar
[ERROR] urls[90] = file:/C:/Users/lakala/.m2/repository/org/glassfish/jakarta.json/1.1.6/jakarta.json-1.1.6.jar
[ERROR] urls[91] = file:/C:/Users/lakala/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.10.1/jackson-databind-2.9.10.1.jar
[ERROR] urls[92] = file:/C:/Users/lakala/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.10/jackson-annotations-2.9.10.jar
[ERROR] urls[93] = file:/C:/Users/lakala/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.10/jackson-core-2.9.10.jar
[ERROR] urls[94] = file:/C:/Users/lakala/.m2/repository/org/twdata/maven/mojo-executor/2.3.0/mojo-executor-2.3.0.jar
[ERROR] urls[95] = file:/C:/Users/lakala/.m2/repository/org/jboss/slf4j/slf4j-jboss-logging/1.2.0.Final/slf4j-jboss-logging-1.2.0.Final.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR]
[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/PluginContainerException
rquinio commented 4 years ago

@Foredoomed What is your Maven version ?

geoand commented 4 years ago

It indeed looks like a Maven versioning issue. Quarkus required Maven 3.5.3+

gastaldi commented 4 years ago

It would be nice if the plugin could enforce the maven version before executing it

debae commented 4 years ago

Maybe it's possible to trigger the configured enforcer plugin when running the quarkus plugin. This should be possible via https://github.com/TimMoore/mojo-executor

aloubyansky commented 2 years ago

This issue appears to be fixed now.

[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.8.0.Final:create (default-cli) on project standalone-pom: Detected Maven Version (3.5.4)  is not supported, it must be in [3.6.2,). -> [Help 1]

Thanks reporting the issue.