quarkus: Cannot find 'jvmArgs' in class io.quarkus.maven.GenerateCodeMojo

Hi,

After upgrading to 1.10.2 (including maven plugin) from 1.9.2, I’m geting the following error when I run mvn quarkus:dev alone:

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.10.2.Final:dev (default-cli) on project btrdkr: Unable to execute mojo: Unable to parse configuration of mojo io.quarkus:quarkus-maven-plugin:1.10.2.Final:generate-code for parameter jvmArgs: Cannot find 'jvmArgs' in class io.quarkus.maven.GenerateCodeMojo -> [Help 1]

…this is after I first run mvn compile. If I run them together with mvn compile quarkus:dev, I get the exception when starting up:

2020-12-03 16:11:56,003 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): java.security.cert.CertificateException: No X509TrustManager implementation available
        at java.base/sun.security.ssl.DummyX509TrustManager.checkServerTrusted(SSLContextImpl.java:1652)
        at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:632)
        at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473)
        at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369)
        at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
        at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480)
        at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1267)
        at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1254)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
        at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1199)
        at io.netty.handler.ssl.SslHandler.runAllDelegatedTasks(SslHandler.java:1542)
...

This is because I use OIDC module and it tries to contact the OIDC server during startup using SSL. I have the following configuration for maven plugin:

            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <version>${quarkus.platform.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                            <goal>generate-code</goal>
                            <goal>generate-code-tests</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <jvmArgs>-Djavax.net.ssl.trustStoreType=JKS -Djavax.net.ssl.trustStore=${project.build.outputDirectory}/META-INF/security/cacerts -Djavax.net.ssl.trustStorePassword=changeit</jvmArgs>
                </configuration>
            </plugin>

It looks like the quarkus:dev mojo is not passing the jvmArgs to the JVM when starting it up. This used to work with 1.9.2 plugin.

To Reproduce

Use <jvmArgs>...</jvmArgs> in configuration of quarkus-maven-plugin and see that they are either not applied or executing mvn quarkus:dev alone bails out with error.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23 (22 by maintainers)

Most upvoted comments

I checked if there is any difference when running with 1.10.2 vs 1.9.2:

1.10.2:

[DEBUG] Launching JVM with command line: /usr/lib/jvm/java-11-openjdk-11.0.9.11-4.fc32.x86_64/bin/java -Xverify:none -Djavax.net.ssl.trustStoreType=JKS -Djavax.net.ssl.trustStore=/home/peter/work/git/btrdkr/target/classes/META-INF/security/cacerts -Djavax.net.ssl.trustStorePassword=changeit -XX:TieredStopAtLevel=1 -Xdebug -Xrunjdwp:transport=dt_socket,address=localhost:5005,server=y,suspend=n -Djava.util.logging.manager=org.jboss.logmanager.LogManager -jar /home/peter/work/git/btrdkr/target/btrdkr-dev.jar

1.9.2:

[DEBUG] Launching JVM with command line: /usr/lib/jvm/java-11-openjdk-11.0.9.11-4.fc32.x86_64/bin/java -Djavax.net.ssl.trustStoreType=JKS -Djavax.net.ssl.trustStore=/home/peter/work/git/btrdkr/target/classes/META-INF/security/cacerts -Djavax.net.ssl.trustStorePassword=changeit -XX:TieredStopAtLevel=1 -Xverify:none -Xdebug -Xrunjdwp:transport=dt_socket,address=0.0.0.0:5005,server=y,suspend=n -Djava.util.logging.manager=org.jboss.logmanager.LogManager -jar /home/peter/work/git/btrdkr/target/btrdkr-dev.jar

The same args are applied although in a slightly different order. I thing this should not matter. These are system properties that should only affect the JDK internal SSL implementation. I wonder what Quarkus 1.10.2 does in that regard.

You probably want the following section:

[DEBUG] Configuring mojo 'io.quarkus:quarkus-maven-plugin:1.10.2.Final:dev' with basic configurator -->
[DEBUG]   (f) buildDir = /home/peter/work/git/btrdkr/target
[DEBUG]   (f) debugHost = localhost
[DEBUG]   (f) deleteDevJar = true
[DEBUG]   (f) jvmArgs = -Djavax.net.ssl.trustStoreType=JKS -Djavax.net.ssl.trustStore=/home/peter/work/git/btrdkr/target/classes/META-INF/security/cacerts -Djavax.net.ssl.trustStorePassword=changeit
[DEBUG]   (f) outputDirectory = /home/peter/work/git/btrdkr/target/classes
[DEBUG]   (f) project = MavenProject: si.pele:btrdkr:1.0.0-SNAPSHOT @ /home/peter/work/git/btrdkr/pom.xml
[DEBUG]   (f) repoSession = org.eclipse.aether.DefaultRepositorySystemSession@3d763ae5
[DEBUG]   (f) repos = [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@61c42416
[DEBUG]   (f) sourceDir = /home/peter/work/git/btrdkr/src/main/java
[DEBUG]   (f) workingDir = /home/peter/work/git/btrdkr/target
[DEBUG] -- end configuration --
[DEBUG] Detected Maven Version: 3.6.3
[DEBUG] Detected Maven Version (3.6.3)  is allowed in [3.6.2,).
[ERROR] Using javaTool: /usr/lib/jvm/java-11-openjdk-11.0.9.11-4.fc32.x86_64/bin/java
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=103170, ConflictMarker.markTime=85200, ConflictMarker.nodeCount=228, ConflictIdSorter.graphTime=53980, ConflictIdSorter.topsortTime=42370, ConflictIdSorter.conflictIdCount=85, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=934680, ConflictResolver.conflictItemCount=181, DefaultDependencyCollector.collectTime=8876654, DefaultDependencyCollector.transformTime=1257460}
[ERROR] Executable jar: /home/peter/work/git/btrdkr/target/btrdkr-dev.jar
[DEBUG] Launching JVM with command line: /usr/lib/jvm/java-11-openjdk-11.0.9.11-4.fc32.x86_64/bin/java -Xverify:none -Djavax.net.ssl.trustStoreType=JKS -Djavax.net.ssl.trustStore=/home/peter/work/git/btrdkr/target/classes/META-INF/security/cacerts -Djavax.net.ssl.trustStorePassword=changeit -XX:TieredStopAtLevel=1 -Xdebug -Xrunjdwp:transport=dt_socket,address=localhost:5005,server=y,suspend=n -Djava.util.logging.manager=org.jboss.logmanager.LogManager -jar /home/peter/work/git/btrdkr/target/btrdkr-dev.jar