English 中文(简体)
在Maven Dependency
原标题:Add External JAR in Maven Dependency
  • 时间:2013-08-05 10:11:17
  •  标签:
  • maven

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

从上文BUILDSUCCESS的电文中可以推断,JAR的档案是正确的,但在POM的档案中,如果存在依赖性,则会增加。

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

它给我带来了以下错误:Missing artifact tigase-muc。 这一信息清楚表明,它没有获得JAR档案,即指依赖性。

You Contribution will be high 我们赞赏 THANKS

问题回答

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.

现在,我看一下tig虫:tig虫-xmltools:3.3.6,

它没有界定任何依赖性。

因此,即使你没有具体说明这种依赖性,也会发生这种情况。

我建议你管理<代码>mvn Depend:tree/code>,以了解这种依赖来自何处。

希望这一帮助

如果你在母公司中添加了<代码>jar<>>>>/代码,那么就应当自动在Maven Dependencies中添加。

在建设项目时,你是否遇到任何具体错误? 如果是,请分享错误的痕迹。

Also have a look at Maven Dependency Scope

此外,核查贵方的本地马文存放处——M2_HOME iga iga-xmltools3.3.6,如果jar能适当安装,则进行检查。

你可以在地方存放处安装外部轮胎。

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

希望这将有助于你们。

我的解决办法是利用嵌入式的折体:

“entergraph

增加地方平衡:

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




相关问题
JavaFX with Maven [closed]

I recently started a JavaFX project, and I d like to use Maven as my compiler/deployment tool. Is there a good tutorial or plugin to integrate JavaFX and Maven?

How to upload jar to respository?

I have jar files that cannot be found on Maven Central repository. I would like to add the jar so I can just include extra tag in my pom.xml file and other developer can use the jar. What are the ...

Debug Maven project in Eclipse with third party sources

I am currently developing a maven project in eclipse. The m2eclipse plugin works beautifully. It even works out of the box with debugging. But when I am debugging open source third party libarries. ...

Could Free Pascal benefit of something like Apache Maven?

Apache Maven is a very popular build and dependency management tool in the Java open source ecosphere. I did some tests to find out if it can handle compiled Free Pascal / Delphi units and found it ...

Run a single test method with maven

I know you can run all the tests in a certain class using: mvn test -Dtest=classname But I want to run an individual method and -Dtest=classname.methodname doesn t seem to work.

Uploading a directory using sftp with Maven

How can I upload a directory - Eclipse update site - using sftp with public key authentication in Maven? For background information: I m using tycho to build an Eclipse plugin and want to get the ...

What are solid NMaven or build servers for .NET alternatives?

Maven had a long history and is well supported in the Java world. NMaven has received a less successful start and has never become as popular in the C#/.NET world as its larger cousin was in the Java ...

热门标签