I am currently facing and issue when using Maven with NetBeans 7.1 - I have included a lib that I can't place into a Maven repository in the System scope. It looks something like the following:
<dependency>
<groupId>org.company</groupId>
<artifactId>FBTM</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/FBTM-1.0-SNAPSHOT.jar</systemPath>
</dependency>
The IDE seems to pick up this dependency fine, as it shows in Dependencies folder (Project view) and I am able to view the jar contents. I can also import classes from the jar without any issues.
However, when I attempt to run my project (and the runtime has any of the classes in use) I get a NoClassDefFoundError
for the class in question. It can be any class.
Stacktrace:
Exception in thread "main" java.lang.NoClassDefFoundError: com/company/otaupdate/sim/commands/Select
at com.company.fbtranslationlibrary.mc.scripts.UserData$1.<init>(UserData.java:30)
at com.company.fbtranslationlibrary.mc.scripts.UserData.<init>(UserData.java:28)
at com.company.fbtranslationlibrary.mc.MS.get_profile_script(MuscadeScript.java:80)
at com.company.fbtranslationlibrary.mc.MS.access$300(MS.java:16)
Any help or pointers would be greatly appreciated!
For system scope:
Maven Doc says:
system
This scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository.
Your IDE provides the jar somehow. But when running you need to provide it.
Try with the default scope (that is no scope tag at all).
edit: If you want maven to keep the system scope, you need to provide the jar runtime via the classpath.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With