无法从本地存储库安装Maven POM文件

时间:2014-12-13 13:51:47

标签: maven pom.xml

我正在尝试使用以下pom文件编译Maven项目(我是Maven的新手):

 <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 个答案:

答案 0 :(得分:1)

您的artifactId&#34; logtool-examples&#34;来自install命令与pom.xml文件(logtool)中的artifactId不匹配。