2014-12-13 109 views
0

我嘗試編譯Maven項目(我很新的Maven)具有以下POM文件:未能從安裝到本地倉庫的Maven POM文件

<artifactId>logtool-examples</artifactId> 
<description>Tools for analyzing state logs produced by the Power TAC 
    simulation server</description> 
    <groupId>org.powertac</groupId> 
    <version>1.1.0</version> 
    <packaging>jar</packaging> 

    <properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <exec.args></exec.args> 
    </properties> 

    <!-- Sonatype OSS repo for resolving snapshot modules --> 
    <repositories> 
    <repository> 
     <id>sonatype</id> 
     <url>https://oss.sonatype.org/content/repositories/snapshots/</url> 
    </repository> 
    </repositories> 

    <dependencies> 
    <dependency> 
     <groupId>org.powertac</groupId> 
     <artifactId>logtool</artifactId> 
     <version>1.1.0</version> 
    </dependency> 

正如你看到的,項目(logtool-examples)依賴於應該在線的.jar(logtool),但目前不是,因此我使用以下命令將.jar編譯到本地目錄並安裝它:

mvn install:install-file -Dfile=../logtool/target/logtool.jar -DpomFile=../logtool/pom.xml 
-DgroupId=org.powertac -DartifactId=logtool-examples -Dversion=1.1.0 -Dpackaging=jar 

但是,當我嘗試編譯該文件時,仍然收到警告:

[WARNING] The POM for org.powertac:logtool:jar:1.1.0 is missing, no dependency information available 

即使我安裝了POM文件並且收到了一條消息說它已安裝。然後,Maven繼續在聯機存儲庫中查找.jar。

我在這裏做錯了什麼?

回答

1

安裝命令中的artifactId「logtool-examples」與您的pom.xml文件(logtool)中的artifactId不匹配。

+0

哦,我認爲artifactId應該是目標的,不是已安裝文件的...謝謝! – Venomouse 2014-12-13 14:24:58

相關問題