I'm trying to install and use 3rd Party Jars in my Maven project.
The first Jar is:
anthill3-client.jar
And this is his structure:
├───com
│ └───urbancode
│ ├───anthill3
│ │ ├───command
│ │ ├───custom
│ │ ├───dashboard
│ │ ├───domain
│ │ └───wsviewer
│ ├───codestation2
│ │ ├───domain
│ │ └───server
│ ├───commons
│ │ ├───db
│ │ ├───logfile
│ │ └───util
│ ├───license
│ ├───persistence
│ │ └───collections
│ └───scripting
└───META-INF
I installed it by running this command:
call mvn install:install-file -Dfile=anthill3-client.jar -DgroupId=com.urbancode -DartifactId=anthill3-client -Dversion=1.0 -Dpackaging=jar
Configured it in the pom.xml:
<dependency>
<groupId>com.urbancode</groupId>
<artifactId>anthill3-client</artifactId>
<version>1.0</version>
</dependency>
And was able to use it in my code by importing some classes:
import com.urbancode.anthill3.domain.persistent.PersistenceException;
import com.urbancode.anthill3.domain.security.AuthorizationException;
import com.urbancode.anthill3.main.client.AnthillClient;
import com.urbancode.anthill3.persistence.UnitOfWork;
import com.urbancode.anthill3.domain.project.*;
It didn't quite work though, cause I get .ClassNotFoundException
:
Exception in thread "main" java.lang.NoClassDefFoundError: com/urbancode/devilfish/services/method/MethodCall
at Valor.CM.Tools.App.main(App.java:26)
Caused by: java.lang.ClassNotFoundException: com.urbancode.devilfish.services.method.MethodCall
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
I tried to fix it by installing the missing Jar:
devilfish.jar
His structure:
├───com
│ └───urbancode
│ ├───command
│ │ ├───shell
│ │ └───var
│ ├───commons
│ │ └───util
│ ├───devilfish
│ │ ├───client
│ │ ├───common
│ │ ├───server
│ │ └───services
│ └───plugin
└───META-INF
Installed it by running this command:
call mvn install:install-file -Dfile=devilfish.jar -DgroupId=com.urbancode -DartifactId=devilfish -Dversion=1.0 -Dpackaging=jar
And added to my pom:
<dependency>
<groupId>com.urbancode</groupId>
<artifactId>devilfish</artifactId>
<version>1.0</version>
</dependency>
But importing classes from the Package simply doesn't work, and I keep getting the same exception.
I guess it happens cause I didn't properly install the Jars.
I filled the -DgroupId
& -DartifactId
based on what made sense to me, but I'm not sure I filled the right values.