Add external JAR depending on Maven

I am trying to add an external tigase-muc JAR file to a maven tigase-server based project in an eclipse environment.
I tried the following method

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \ -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging> [INFO] Scanning for projects... [INFO] [INFO] Building Tigase XMPP Server 5.1.0 5.2.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-install-plugin:2.3:install-file (default-cli) @ tigase-server --- [INFO] Installing /home/haider/Downloads/tigase-muc-2.2.0.jar to / home/haider/.m2/repository/tigase/tigase-muc/2.2.0/tigase-muc-2.2.0.jar [INFO] -------------- [INFO] BUILD SUCCESS [INFO] ------------- [INFO] Total time: 0.791s [INFO] Finished at: Mon Aug 05 18:06:48 PKT 2013 [INFO] Finished at: Mon Aug 05 18:06:48 PKT 2013 [INFO] ---------------------- 

From the BUILD SUCCESS post above, I assume the JAR file is correctly added, but when I add the following dependency in the POM file

  <dependency> <groupId>tigase</groupId> <artifactId>tigase-xmltools</artifactId> <version>3.3.6</version> <scope>compile</scope> </dependency> 

This gives me the following error The tigase artifact is missing: tigase-muc . This message clearly indicates that he did not receive the JAR file, which I refer to the dependency

Your input will be highly appreciated THANKS.

+4
source share
5 answers

It looks like he installs the Jar as follows: [INFO] Installing / home / haider / Downloads / tigase -muc-2.2.0.jar in / main / Heider / .m2 / storage / tigase / tigase-MUC / 2.2.0 / tigase -MUC-2.2.0.jar

How maven works, its group identifier is resolved as "tigase", artifactId is "tigase-muc", version is "2.2.0" So this is correct.

Now I looked at tigase: tigase-xmltools: 3.3.6 here

He does not define any dependence at all.

So it looks like this will happen even if you don't specify this dependency :)

I suggest you run mvn dependency:tree to find out where this dependency is related to

Hope this helps

+2
source

A more complete error message will help narrow down everything that went wrong. The artifact that you installed must be resolved using the following dependency:

 <dependency> <groupId>tigase</groupId> <artifactId>tigase-muc</artifactId> <version>2.2.0</version> <type>jar</type> <scope>compile</scope> </dependency> 

You are referring to tigase-xmltools, which I assume is tigase-muc dependent.

My guess: tigase-xmltools may have a dependency on the actual pom tigase-muc, which you don't have, despite having a jar. View full error message and pom tigase-xmltools.

Setting the file with -D generatePom = true may help.

+1
source

Well, if you added jar in maven dependencies, then it should be added to Maven Dependencies automatically.

Do you have any mistake while creating the project? if so, can you share the error tracing.

Also see Maven Dependency Scope

In addition, check the local maven repository - M2_HOME\tigase\tigase-xmltools\3.3.6\ and check if the bank is installed correctly.

0
source

You can install external banks in the local repository.

Here is a blog - http://findnerd.com/list/view/External-Dependencies-in-Maven-Project/3501/

Hope this helps you.

0
source

My solution is to use lib lib:

enter image description here

and add the local library:

 <dependencies> <dependency> <groupId>ok</groupId> <artifactId>comet4j-tomcat7</artifactId> <version>1.0.0</version> </dependency> </dependencies> <repositories> <repository> <id>lib</id> <name>lib</name> <url>file://${basedir}/lib</url> </repository> </repositories> 
0
source

Source: https://habr.com/ru/post/1495292/


All Articles