I have a jar included under src/libs. This is necessary because when I run my application on the intended server it will not be able to download external dependencies. I am receiving the following error when building from the command line: NoClassDefFoundError. The dependency in my pom:
<dependency>
<groupId>jFuzzyLogic_core</groupId>
<artifactId>jFuzzyLogic_core</artifactId>
<scope>system</scope>
<version>2.0.7</version>
<systemPath>${basedir}\src\libs\jFuzzyLogic_core.jar</systemPath>
</dependency>
I have read conflicting posts on whether or not this is correct and I can not figure out what to do.
The command line as requested:
Exception in thread "main" java.lang.NoClassDefFoundError: net/sourceforge/jFuzz
yLogic/FIS
at noobbot.Main.<init>(Main.java:41)
at noobbot.Main.main(Main.java:30)
Caused by: java.lang.ClassNotFoundException: net.sourceforge.jFuzzyLogic.FIS
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 2 more
Also relevant,
[WARNING] 'dependencies.dependency.systemPath' for jFuzzyLogic_core:jFuzzyLogic_
core:jar should not point at files within the project directory, ${basedir}\src\
libs\jFuzzyLogic_core.jar will be unresolvable by dependent projects @ line 24,
column 22
can anyone else suggest how to do this if this is in fact not the correct way?
Try specifying your lib directory as a repository in your pom.xml
:
<repository>
<id>project_lib</id>
<name>Repository in project's lib dir</name>
<layout>default</layout>
<url>file:///${project.basedir}/lib</url>
</repository>
Then in dependency I don't think you'll need to add <systemPath>
for that Jar.
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