You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the project with mvn quarkus-dev (or in my case form intellij with the quarkus plugin), I get a NullPointerException on parsing properties and the application does not start.
Expected behavior
When building the project with mvn clean package -DskipTests=true, I expect to find in the quarkus-run.jar MANIFEST.MF file
Implementation-Build: [my.git.commit.id]
When running the project with mvn quarkus-dev (or in my case form intellij with the quarkus plugin), I expect the application to start
Actual behavior
When building the project with mvn clean package -DskipTests=true, I find in the quarkus-run.jar MANIFEST.MF file
Implementation-Build: [my.git.commit.id]
When running the project with mvn quarkus-dev (or in my case form intellij with the quarkus plugin), I get:
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< org.acme:code-with-quarkus >---------------------
[INFO] Building code-with-quarkus 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- quarkus-maven-plugin:2.16.6.Final:dev (default-cli) @ code-with-quarkus ---
[INFO] Invoking org.apache.maven.plugins:maven-resources-plugin:2.6:resources @ code-with-quarkus
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] Invoking io.quarkus.platform:quarkus-maven-plugin:2.16.6.Final:generate-code @ code-with-quarkus
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.904 s
[INFO] Finished at: 2023-04-21T12:04:38+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.16.6.Final:dev (default-cli) on project code-with-quarkus: Quarkus code generation phase has failed: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.16.6.Final:dev (default-cli) on project code-with-quarkus: Quarkus code generation phase has failed
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:375)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
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:294)
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:960)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
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.MojoExecutionException: Quarkus code generation phase has failed
at io.quarkus.maven.GenerateCodeMojo.generateCode (GenerateCodeMojo.java:85)
at io.quarkus.maven.GenerateCodeMojo.doExecute (GenerateCodeMojo.java:53)
at io.quarkus.maven.QuarkusBootstrapMojo.execute (QuarkusBootstrapMojo.java:154)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo (MojoExecutor.java:120)
at io.quarkus.maven.DevMojo.executeIfConfigured (DevMojo.java:655)
at io.quarkus.maven.DevMojo.triggerPrepare (DevMojo.java:602)
at io.quarkus.maven.DevMojo.triggerCompile (DevMojo.java:623)
at io.quarkus.maven.DevMojo.handleAutoCompile (DevMojo.java:582)
at io.quarkus.maven.DevMojo.execute (DevMojo.java:412)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
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:294)
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:960)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
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: java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.putVal (ConcurrentHashMap.java:1011)
at java.util.concurrent.ConcurrentHashMap.put (ConcurrentHashMap.java:1006)
at java.util.Properties.put (Properties.java:1301)
at io.quarkus.maven.QuarkusBootstrapProvider$QuarkusMavenAppBootstrap.doBootstrap (QuarkusBootstrapProvider.java:193)
at io.quarkus.maven.QuarkusBootstrapProvider$QuarkusMavenAppBootstrap.bootstrapApplication (QuarkusBootstrapProvider.java:292)
at io.quarkus.maven.QuarkusBootstrapProvider.bootstrapApplication (QuarkusBootstrapProvider.java:103)
at io.quarkus.maven.QuarkusBootstrapMojo.bootstrapApplication (QuarkusBootstrapMojo.java:272)
at io.quarkus.maven.GenerateCodeMojo.generateCode (GenerateCodeMojo.java:70)
at io.quarkus.maven.GenerateCodeMojo.doExecute (GenerateCodeMojo.java:53)
at io.quarkus.maven.QuarkusBootstrapMojo.execute (QuarkusBootstrapMojo.java:154)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo (MojoExecutor.java:120)
at io.quarkus.maven.DevMojo.executeIfConfigured (DevMojo.java:655)
at io.quarkus.maven.DevMojo.triggerPrepare (DevMojo.java:602)
at io.quarkus.maven.DevMojo.triggerCompile (DevMojo.java:623)
at io.quarkus.maven.DevMojo.handleAutoCompile (DevMojo.java:582)
at io.quarkus.maven.DevMojo.execute (DevMojo.java:412)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
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:294)
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:960)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
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)
[ERROR]
[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/MojoExecutionException
How to Reproduce?
Steps to reproduce the behavior:
Create a project on code.quarkus.io, maven, Java 17, with resteasy reactive (although that might not be necessary.
When removing the ${git.commit.id.describe} from the manifestEntries the application works with quarkus:dev, but I do not get the Implementation-Build entry in the manifest.
When adding ${git.commit.id.describe} to the maven <properties>, the application works with quarkus:dev, but then the value is static and it is not overwritten by the git-commit-id-maven-plugin during build.
When running mvn compile quarkus:dev, the application works, but the intellij plugin does not use this. It likely works as the compile phase triggers the git-commit-id-maven-plugin to set its properties in the reactor.
The ${git.commit.id.describe} is set dynamically by the git-commit-id-maven-plugin.
It seems as if the git-commit-id-maven-plugin is not run when running quarkus:dev, or the properties are not copied the reactor. It is as if the quarkus:dev goal does not use the rest of maven at all (seeing how the maven-jar-plugin also is not used).
I am stuck on how to make both these scenarios work at the same time. I am happy to solve this problem in another way, with a different plugin or setting in maven.
The text was updated successfully, but these errors were encountered:
It depends where the git-commit-id plugin is defined in de pom.
If git-commit-id-maven-plugin is before quarkus-maven-plugin, then mvn compile works.
If git-commit-id-maven-plugin is after quarkus-maven-plugin, then mvn compile fails with the same error.
This is because quarkus-maven-plugin is also using the process-resources phase, and goals of the same phase are executed in the order they are defined in the pom.
mvn help:describe -DartifactId=quarkus-maven-plugin -DgroupId=io.quarkus.platform -Dgoal=generate-code -Ddetail
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< org.acme:code-with-quarkus >---------------------
[INFO] Building code-with-quarkus 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-help-plugin:3.4.0:describe (default-cli) @ code-with-quarkus ---
[INFO] Mojo: 'quarkus:generate-code'
quarkus:generate-code
Description: (no description available)
Implementation: io.quarkus.maven.GenerateCodeMojo
Language: java
Bound to phase: process-resources
...
Using generate-resources phase removes the order requirements of the plugins, as the generate-resources phase runs before the process-resources phase.
My initial issue still stands though.
Running mvn quarkus:dev still causes the same error. Likely because it does not call any of the maven lifecycle phases.
Describe the bug
Hello,
I am trying to add the current git commit id to the MANIFEST.MF of the quarkus build artifact.
In the past I have used
git-commit-id-maven-plugin
to extract this value into a maven property:and add the property
git.commit.id.describe
to the jar file using themaven-jar-plugin
with:Now from what I understand, with Quarkus I can no longer use the
maven-jar-plugin
but have to use thequarkus-maven-plugin
to set manifest values:When running the project with
mvn quarkus-dev
(or in my case form intellij with the quarkus plugin), I get a NullPointerException on parsing properties and the application does not start.Expected behavior
When building the project with
mvn clean package -DskipTests=true
, I expect to find in the quarkus-run.jar MANIFEST.MF fileImplementation-Build: [my.git.commit.id]
When running the project with
mvn quarkus-dev
(or in my case form intellij with the quarkus plugin), I expect the application to startActual behavior
When building the project with
mvn clean package -DskipTests=true
, I find in the quarkus-run.jar MANIFEST.MF fileImplementation-Build: [my.git.commit.id]
When running the project with
mvn quarkus-dev
(or in my case form intellij with the quarkus plugin), I get:How to Reproduce?
Steps to reproduce the behavior:
git-commit-id-maven-plugin
to the pomquarkus-maven-plugin
mvn quarkus:dev
Output of
uname -a
orver
Microsoft Windows [Version 10.0.22621.1555]
Output of
java -version
openjdk version "17.0.5" 2022-10-18 OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8) OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.16.6
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63) Maven home: C:\dev\tools\maven\apache-maven-3.8.6 Java version: 17.0.5, vendor: Eclipse Adoptium, runtime: C:\dev\tools\jdk\adoptium\jdk-17.0.5+8 Default locale: en_US, platform encoding: Cp1252 OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
Additional information
${git.commit.id.describe}
from themanifestEntries
the application works with quarkus:dev, but I do not get the Implementation-Build entry in the manifest.${git.commit.id.describe}
to the maven<properties>
, the application works with quarkus:dev, but then the value is static and it is not overwritten by thegit-commit-id-maven-plugin
during build.mvn compile quarkus:dev
, the application works, but the intellij plugin does not use this. It likely works as thecompile
phase triggers thegit-commit-id-maven-plugin
to set its properties in the reactor.${git.commit.id.describe}
is set dynamically by thegit-commit-id-maven-plugin
.It seems as if the
git-commit-id-maven-plugin
is not run when runningquarkus:dev
, or the properties are not copied the reactor. It is as if thequarkus:dev
goal does not use the rest of maven at all (seeing how the maven-jar-plugin also is not used).I am stuck on how to make both these scenarios work at the same time. I am happy to solve this problem in another way, with a different plugin or setting in maven.
The text was updated successfully, but these errors were encountered: