Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus fails when using jgitver #28375

Closed
lmtjalves opened this issue Oct 4, 2022 · 3 comments · Fixed by #28419
Closed

Quarkus fails when using jgitver #28375

lmtjalves opened this issue Oct 4, 2022 · 3 comments · Fixed by #28419
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins kind/bug Something isn't working
Milestone

Comments

@lmtjalves
Copy link

lmtjalves commented Oct 4, 2022

Describe the bug

Hi,

It seems that Quarkus doesn't work properly when the maven project is using the jgitver-maven-plugin - a maven plugin to automatically define the maven project version based on git branches as tags.

Thanks.

Expected behavior

The ./mvnw quarkus:dev should start Quarkus in development mode, instead of failing.

Actual behavior

Running ./mvnw quarkus:dev fails with the following error:

Listening for transport dt_socket at address: 5005
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "io.quarkus.deployment.dev.DevModeContext$ModuleInfo.getMain()" because the return value of "io.quarkus.deployment.dev.DevModeContext.getApplicationRoot()" is null
	at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:90)
	at io.quarkus.deploy
[debug.txt](https://github.com/quarkusio/quarkus/files/9704780/debug.txt)
ment.dev.DevModeMain.main(DevModeMain.java:62)

Output from running ./mvnw quarkus:dev -X: debug.txt

How to Reproduce?

  1. Create a Quarkus project with quarkus create.
  2. Add the jgitver maven extension, by adding a file .mvn/extensions.xml to the project with the following content:
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
  <extension>
    <groupId>fr.brouillard.oss</groupId>
    <artifactId>jgitver-maven-plugin</artifactId>
    <version>1.9.0</version>
  </extension>
</extensions>
  1. Optional: Initialize the git repo and do a commit, just so that jgitver computes the version as 0.0.0-SNAPSHOT instead of 0.0.0-NOT_A_GIT_REPOSITORY:
git init
git add .
git commit -m "test"
  1. Run ./mvnw quarkus:dev.

Output of uname -a or ver

Linux laptop-2220 5.15.0-48-generic #54~20.04.1-Ubuntu SMP Thu Sep 1 16:17:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.4" 2022-07-19 LTS
OpenJDK Runtime Environment Corretto-17.0.4.8.1 (build 17.0.4+8-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.4.8.1 (build 17.0.4+8-LTS, mixed mode, sharing)

GraalVM version (if different from Java)

N/A

Quarkus version or git rev

2.13.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)

Additional information

No response

@lmtjalves lmtjalves added the kind/bug Something isn't working label Oct 4, 2022
@gsmet
Copy link
Member

gsmet commented Oct 4, 2022

@lmtjalves any chance you could point to a reproducer already set up in a Git repo? That will save us some time and we will be sure we can reproduce.

@gsmet gsmet added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins and removed triage/needs-triage labels Oct 4, 2022
@lmtjalves
Copy link
Author

Here you have it: https://github.com/lmtjalves/quarkus-28375
Thanks @gsmet !

@gsmet
Copy link
Member

gsmet commented Oct 4, 2022

/cc @aloubyansky probably something in your ballpark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins kind/bug Something isn't working
Projects
None yet
2 participants