I have a "jar-a" which has AutoValue generated class files. When I add that jar as external library to another maven project, those autovalue generated classes are not appearing and when I run my project I get java.lang.NoClassDefFoundError
. Is this autovalue related issue or generic issue. Would appreciate any fix or workaround.
Note: I have tried adding jar-a manually to the external libraries in Intellij and also tried adding it as a local dependency in the pom.xml as shown below but getting same error.
<dependency>
<groupId>jar-a</groupId>
<artifactId>jar-a</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}/src/lib/jar-a.jar</systemPath>
</dependency>
Edit:
This jar was developed in my local machine and not available in any repository. It is also present in my m2 repository. I have tried below maven install file and now I could see most all the dependent packages that was used in "jar-a" but still getting java.lang.NoSuchFieldError
for one of the class.
mvn install:install-file \
> -Dfile=path/jar-a.jar \
> -DgroupId=com.abc \
> -DartifactId=abc \
> -Dversion=1.0-SNAPSHOT \
> -Dpackaging=jar \
> -DpomFile=path/pom.xml
I am investigating further but meanwhile want to get confirmation on the approach I followed above.