Thursday, April 3, 2014

"<useUniqueVersions>" for pom.xml

If your RPM is building successfully, but when you try to run that component after installing, you get java.lang.NoClassDefFoundError for some class which you know exists in the classpath, then probably the component version (or name) in your Manifest.MF file doesn't match the JAR file included in the classpath (for example MANIFEST.MF expects released version, but classpath contains SNAPSHOT version). In this situation, we can specify in the maven-jar-plugin inside pom.xml not to look for the Unique version of JAR with this tag:


Complete example:

Now build your rpm and try again, hopefully it fixes it.
For more info: