5

I am trying to add external JAR file tigase-muc in a maven based project tigase-server in eclipse IDE.
I have tried 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 above BUILD SUCCESS message i assume that JAR file is correctly added , but when i add following dependency in POM file

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

It give me following error Missing artifact tigase:tigase-muc. This message clearly indicate that it didn't get the JAR file that i am referring in dependency

You Contribution will be highly appreciated THANKS

2
  • Are you aware of the maven.tigase.org maven repository? Commented Aug 5, 2013 at 10:23
  • @tbsalling I just have checked it has same stuff as i have. Can u tell me whether my i am installing it in a right way or not any other suggestion will be highly appreciated thanks Commented Aug 5, 2013 at 10:57

5 Answers 5

2

It looks like it installs the Jar like this: [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

As maven works, its group id is resolved to be ''tigase'', artifactId is ''tigase-muc'', version is ''2.2.0'' So this is right.

Now, I've took a look on tigase:tigase-xmltools:3.3.6 available here

It doesn't define any dependency at all.

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

I would suggest you to run mvn dependency:tree to see where does this dependency comes from

Hope this helps

Sign up to request clarification or add additional context in comments.

Comments

1

A more complete error message would help narrow down what's gone wrong. The artifact you installed should be resolvable via the following dependency:

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

You're reference tigase-xmltools which I'm assuming has a dependency on tigase-muc.

My guess is tigase-xmltools might have dependency on the actual pom of tigase-muc, which you don't have despite having the jar. Seeing the full error message and the pom of tigase-xmltools.

Installing the file with -DgeneratePom=true might help.

1 Comment

There is no error message at the time of adding JAR file with maven install command. Instead it give me BUILD SUCCESS message. But when i add dependency in POM file it give me error issing artifact tigase:tigase-muc
0

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

Do you get any specific error while building the project? if yes then can you please share the error trace.

Also have a look at Maven Dependency Scope

Also, verify your local maven repository - M2_HOME\tigase\tigase-xmltools\3.3.6\ and check if the jar is installed here properly.

2 Comments

THANKS for replay Please look at my question i have edited and showed some more detail of my problem
have you verified that the dependency definition in the pom.xml is correct, I can see the definition for tigase-xmltools in your question and not for tigase-muc
0

You can install external jars in local repository.

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

Hope this would help you.

Comments

0

My solution is use the embed lib repo:

enter image description here

and add local lib:

    <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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.