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

ClassNotFoundException: org.eclipse.jgit.internal.JGitText with jdk21 and spring boot 3.2.x #62

Open
ilopezv opened this issue Feb 24, 2024 · 5 comments

Comments

@ilopezv
Copy link

ilopezv commented Feb 24, 2024

Building a project with maven 3.9.6, git-changelog-maven-plugin 2.1.0, spring-boot 3.2.x and jdk21 or graalvm21, build execution works as normal but at the end maven output the following error

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  23.178 s (Wall Clock)
[INFO] Finished at: 2024-02-24T12:31:28+01:00
[INFO] ------------------------------------------------------------------------
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: org/eclipse/jgit/internal/JGitText
        at org.eclipse.jgit.internal.util.ShutdownHook.cleanup(ShutdownHook.java:85)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jgit.internal.JGitText
        ... 2 more

plugin configuration is the default provided by spring boot parent

        <plugin>
          <groupId>se.bjurr.gitchangelog</groupId>
          <artifactId>git-changelog-maven-plugin</artifactId>
          <version>2.1.0</version>
          <dependencies>
          <executions>
            <execution>
              <id>git-changelog-compile</id>
              <goals>
                <goal>git-changelog</goal>
              </goals>
              <phase>generate-sources</phase>
              <configuration>
                <dateFormat>dd-MM-yyyy HH:mm:ss</dateFormat>
                <timeZone>UTC</timeZone>
                <ignoreCommitsIfMessageMatches>^chore:\[maven-release-plugin\].*</ignoreCommitsIfMessageMatches>
                <file>CHANGELOG.md</file>
                <templateFile>changelog.mustache</templateFile>
                <untaggedName>Current SNAPSHOT</untaggedName>
                <skip>${git-changelog.skip}</skip>
              </configuration>
            </execution>
          </executions>
        </plugin>
@tomasbjerre
Copy link
Owner

I tried it with java 21:

12:49 $ ./mvnw --version
Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Maven home: /home/bjerre/.m2/wrapper/dists/apache-maven-3.9.6-bin/439sdfsg2nbdob9ciift5h5nse/apache-maven-3.9.6
Java version: 21.0.1, vendor: Private Build, runtime: /usr/lib/jvm/java-21-openjdk-amd64
Default locale: sv_SE, platform encoding: UTF-8
OS name: "linux", version: "5.15.0-94-generic", arch: "amd64", family: "unix"

Running the ./build.sh in this repo. Works for me.

Is it just an exception or does it also not work as expected?

@ilopezv
Copy link
Author

ilopezv commented Feb 25, 2024

is it just an exception, it works well.

mvn --version
Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Maven home: C:\apache-maven-3.9.6
Java version: 21.0.2, vendor: GraalVM Community, runtime: C:\Users\nakku\.jenv\versions\21
Default locale: es_ES, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Here you have and output from mvn generate-resources -X

debug-output.txt

@ilopezv
Copy link
Author

ilopezv commented Mar 8, 2024

Same problem happens in plugin git-commit-id-maven-plugin, the problem is a change in the library eclipse-jgit, and the solution is posted below

git-commit-id/git-commit-id-maven-plugin#712

So I guess there are two options:

1. Go with the 6.9.0 release and "risk" that there is something else broken.
See https://projects.eclipse.org/projects/technology.jgit/releases/6.9.0 or https://github.com/eclipse-jgit/jgit/compare/v6.8.0.202311291450-r...v6.9.0.202403050737-r

2. revert to 6.7.0.202309050840-r

@ilopezv
Copy link
Author

ilopezv commented Mar 8, 2024

I confirm that the following snippet fix the issue:

        <plugin>
          <groupId>se.bjurr.gitchangelog</groupId>
          <artifactId>git-changelog-maven-plugin</artifactId>
          <dependencies>
            <dependency>
              <groupId>org.eclipse.jgit</groupId>
              <artifactId>org.eclipse.jgit</artifactId>
              <version>6.7.0.202309050840-r</version>
            </dependency>
          </dependencies>
        </plugin>

Version 6.9.0 y not in maven central yet

@TheSnoozer
Copy link

the 6.9.0 is now published to maven central, but it doesn't fix the problem with ClassNotFoundException: org.eclipse.jgit.internal.JGitText

See eclipse-jgit/jgit#36 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants