The following configuration works fine with 2.2.4, but will not work with the (default) 2.2.5 version.
The error is
A required class was missing while executing pl.project13.maven:git-commit-id-plugin:2.2.5:revision: com/fasterxml/jackson/core/type/TypeReference
The project has the spring-boot-starter-parent (2.10-Release) as parent.
It fails with:
[ERROR] Failed to execute goal pl.project13.maven:git-commit-id-plugin:2.2.5:revision (default) on project erm-onlinereporting-backend: Execution default of goal pl.project13.maven:git-commit-id-plugin:2.2.5:revision failed: A required class was missing while executing pl.project13.maven:git-commit-id-plugin:2.2.5:revision: com/fasterxml/jackson/core/type/TypeReference
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>pl.project13.maven:git-commit-id-plugin:2.2.5
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/stephane/.m2/repository/pl/project13/maven/git-commit-id-plugin/2.2.5/git-commit-id-plugin-2.2.5.jar
[ERROR] urls[1] = file:/Users/stephane/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[2] = file:/Users/stephane/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[3] = file:/Users/stephane/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
[ERROR] urls[4] = file:/Users/stephane/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[5] = file:/Users/stephane/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.jar
[ERROR] urls[6] = file:/Users/stephane/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[7] = file:/Users/stephane/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[8] = file:/Users/stephane/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[9] = file:/Users/stephane/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.6/jackson-databind-2.9.6.jar
[ERROR] urls[10] = file:/Users/stephane/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar
[ERROR] urls[11] = file:/Users/stephane/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.6/jackson-core-2.9.6.jar
[ERROR] urls[12] = file:/Users/stephane/.m2/repository/joda-time/joda-time/2.10/joda-time-2.10.jar
[ERROR] urls[13] = file:/Users/stephane/.m2/repository/com/google/guava/guava/19.0/guava-19.0.jar
[ERROR] urls[14] = file:/Users/stephane/.m2/repository/com/intellij/annotations/12.0/annotations-12.0.jar
[ERROR] urls[15] = file:/Users/stephane/.m2/repository/org/eclipse/jgit/org.eclipse.jgit/4.5.4.201711221230-r/org.eclipse.jgit-4.5.4.201711221230-r.jar
[ERROR] urls[16] = file:/Users/stephane/.m2/repository/com/jcraft/jsch/0.1.53/jsch-0.1.53.jar
[ERROR] urls[17] = file:/Users/stephane/.m2/repository/com/googlecode/javaewah/JavaEWAH/0.7.9/JavaEWAH-0.7.9.jar
[ERROR] urls[18] = file:/Users/stephane/.m2/repository/org/apache/httpcomponents/httpclient/4.3.6/httpclient-4.3.6.jar
[ERROR] urls[19] = file:/Users/stephane/.m2/repository/org/apache/httpcomponents/httpcore/4.3.3/httpcore-4.3.3.jar
[ERROR] urls[20] = file:/Users/stephane/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar
[ERROR] urls[21] = file:/Users/stephane/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : com.fasterxml.jackson.core.type.TypeReference
[ERROR] -> [Help 1]
The full configuration of the plugin is
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<useNativeGit>true</useNativeGit>
</configuration>
</plugin>
plugin version: 2.2.5 (works with 2.2.4)
java-Version: java version "11.0.1" 2018-10-16 LTS
Maven-Version: Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Used in bash
Maven command: mvn clean install
Hi,
thanks for reporting your issue here.
I try to reproduce this case when I'm home....in the meantime the internet tells me that this could also be a problem with the JAVA_HOME pointing to the wrong directory (possibly a different installation?). Also is the problem persistent with different maven versions as well (e.g. 3.5.4)?
Mhhh this seems to work fine on my end, I don't really know what the problem could be.
Do you have a public link to the project?
For now please verify your $JAVA_HOME, and include the output of mvn -version (is this a mac?)
With java-11-oracle
$ java -version
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
$ echo $JAVA_HOME
/usr/lib/jvm/java-11-oracle
md5-66badb950201aba05861a98df85ebd09
$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00)
Maven home: /usr/share/maven-3.3.9
Java version: 11.0.1, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-11-oracle
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-36-generic", arch: "amd64", family: "unix"
md5-83c9558134de01fded275e59856778dd
$ java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.3)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.3, mixed mode)
md5-66badb950201aba05861a98df85ebd09
$ echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64
md5-66badb950201aba05861a98df85ebd09
$ mvn -version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T14:41:47-04:00)
Maven home: /usr/share/maven-3.6.0
Java version: 10.0.2, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-36-generic", arch: "amd64", family: "unix"
I tried to downgrade to jdk8, but it did not help. (My maven build still works with 2.2.4, 2.2.5 seems to be the problem.)
$ java -version
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home
$ mvn -version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: /Users/stephane/Devel/maven/apache-maven-3.6.0
Java version: 1.8.0_192, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre
Default locale: en_CH, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.6", arch: "x86_64", family: "mac"
Update: I just dropped my .m2 directory and let maven reload everything form scratch, and it now builds without problem. (Only removing the pl/project13/maven directory had not helped.)
Thanks for the attention and the responsiveness, I really appreciated it!
Oh wow thanks for the update!
My wild guess would be that there was a corrupted jar inside your m2-folder, but that makes me wonder why maven would not validate the checksums of the artifacts....well I guess that would be a different question (e.g. https://issues.apache.org/jira/browse/MNG-5728).
I'm glad you solved the problem and thus I think I can close this issue now. Feel free to reopen it, if you encounter this again. If you encounter any other issues or problems, do not hesitate to open a new one ;-)
I encountered a similar issue with a slightly different message: A required class was missing while executing pl.project13.maven:git-commit-id-plugin:2.2.5:revision:org/eclipse/jgit/api/errors/GitAPIException. Just dropped my entire local maven repo as well and it fixed the issue. Only removing the pl/project13/maven directory had not helped either.
Most helpful comment
Update: I just dropped my .m2 directory and let maven reload everything form scratch, and it now builds without problem. (Only removing the pl/project13/maven directory had not helped.)
Thanks for the attention and the responsiveness, I really appreciated it!