2013-07-01 44 views
0

現在,這是我的聚甲醛(.XML)配置:
Maven的錯誤消息 「1個神器需要缺少」

<build> 

    <resources> 
     <resource> 
      <directory>src/resources/development</directory> 
      <filtering>true</filtering> 
     </resource> 
    </resources> 

    <plugins> 

     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-eclipse-plugin</artifactId> 
      <version>2.9</version> 
     </plugin> 

     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-javadoc-plugin</artifactId> 
      <version>2.8</version> 
      <executions> 
       <execution> 
        <id>attach-javadocs</id> 
        <goals> 
         <goal>jar</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 

     <plugin> 
      <inherited>true</inherited> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-source-plugin</artifactId> 
      <version>2.2.1</version> 
      <executions> 
       <execution> 
        <id>attach-sources</id> 
        <phase>verify</phase> 
        <goals> 
         <goal>jar</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <attach>true</attach> 
      </configuration> 
     </plugin> 

     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-install-plugin</artifactId> 
      <version>2.3.1</version> 
      <configuration> 
       <createChecksum>true</createChecksum> 
      </configuration> 
     </plugin> 
     <plugin> 
     <artifactId>maven-assembly-plugin</artifactId> 
     <configuration> 
     <archive> 
      <manifest> 
      <mainClass>mypackage.MyMainClass</mainClass> 
     </manifest> 
    </archive> 
    <descriptorRefs> 
     <descriptorRef>jar-with-dependencies</descriptorRef> 
    </descriptorRefs> 
    </configuration> 
</plugin> 
<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-dependency-plugin</artifactId> 
    <version>2.8</version> 
    <executions> 
     <execution> 
     <id>copy-dependencies</id> 
     <phase>package</phase> 
     <goals> 
      <goal>copy-dependencies</goal> 
     </goals> 
     <configuration> 
      <!-- configure the plugin here --> 
     </configuration> 
     </execution> 
    </executions> 
    </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-jar-plugin</artifactId> 
      <version>2.3.1</version> 
      <executions> 
       <execution> 
        <goals> 
         <goal>jar</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration></configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.0</version> 
      <configuration> 
       <source>1.6</source> 
       <target>1.6</target> 
      </configuration> 
     </plugin> 

     <!-- 
     Plugin that can be configured to prevent deployment of artifact to the 
     maven2 repository. 
     --> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-deploy-plugin</artifactId> 
      <version>2.5</version> 
     </plugin> 

    </plugins> 

</build> 

<dependencies> 
    <dependency> 
     <groupId>com.vantage.iseek.content</groupId> 
     <artifactId>iseek-content-publisher-ds</artifactId> 
     <version>1.0.1-SNAPSHOT</version> 
    </dependency> 
    <dependency> 
     <groupId>com.vantage.iseek.content</groupId> 
     <artifactId>iseek-content-api</artifactId> 
     <version>1.0.1-SNAPSHOT</version> 
    </dependency> 

    <dependency> 
     <groupId>com.restfb</groupId> 
     <artifactId>restfb</artifactId> 
     <version>1.6.11</version> 
    </dependency> 

    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.5</version> 
     <scope>testing</scope> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.commons</groupId> 
     <artifactId>commons-lang3</artifactId> 
     <version>3.1</version> 
    </dependency> 

    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-api</artifactId> 
     <version>1.7.2</version> 
    </dependency> 

    <dependency> 
     <groupId>postgresql</groupId> 
     <artifactId>postgresql</artifactId> 
     <version>9.1-901-1.jdbc4</version> 
    </dependency> 

    <!-- Route commons over slf --> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>jcl-over-slf4j</artifactId> 
     <version>1.7.2</version> 
     <scope>runtime</scope> 
    </dependency> 

    <!-- Use log4j as binding --> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-log4j12</artifactId> 
     <version>1.7.2</version> 
    </dependency> 

</dependencies> 

<repositories> 

    <repository> 
     <id>nexus</id> 
     <snapshots> 
      <enabled>false</enabled> 
     </snapshots> 
     <url>http://maven2.vantage.com:8080/repo/content/groups/public</url> 
    </repository> 

    <repository> 
     <id>nexus-snapshots</id> 
     <releases> 
      <enabled>false</enabled> 
     </releases> 
     <url>http://maven2.vantage.com:8080/repo/content/groups/public</url> 
    </repository> 

</repositories> 

<pluginRepositories> 

    <pluginRepository> 
     <id>nexus</id> 
     <snapshots> 
      <enabled>false</enabled> 
     </snapshots> 
     <url>http://maven2.vantage.com:8080/repo/content/groups/public</url> 
    </pluginRepository> 

    <pluginRepository> 
     <id>nexus-snapshots</id> 
     <releases> 
      <enabled>false</enabled> 
     </releases> 
     <url>http://maven2.vantage.com:8080/repo/content/groups/public</url> 
    </pluginRepository> 

</pluginRepositories> 

<distributionManagement> 

    <!-- use the following if you ARE NOT deploying a snapshot version. --> 
    <repository> 
     <id>nexus</id> 
     <name>Vantage Nexus Release Repository</name> 
     <url> 
      http://maven2.vantage.com:8080/repo/content/repositories/vantage-release 
     </url> 
    </repository> 

    <!-- use the following if you ARE deploying a snapshot version. --> 
    <snapshotRepository> 
     <id>nexus-snapshot</id> 
     <name>Vantage Nexus Snapshot Repository</name> 
     <url> 
      http://maven2.vantage.com:8080/repo/content/repositories/vantage-snapshot 
     </url> 
     <uniqueVersion>false</uniqueVersion> 
    </snapshotRepository> 

</distributionManagement> 

<profiles> 

    <profile> 
     <id>env-development</id> 
     <properties> 
      <downloadSources>true</downloadSources> 
      <downloadJavadocs>true</downloadJavadocs> 
     </properties> 
     <activation> 
      <activeByDefault>true</activeByDefault> 
      <property> 
       <name>env</name> 
       <value>development</value> 
      </property> 
     </activation> 
    </profile> 

</profiles> 

`

當我運行:mvn clean assembly:single它提供了以下錯誤信息:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (default-cli) on project iseek-content-fetcher-fb: Failed to create assembly: Failed to resolve dependencies for project: com.vantage.iseek.content:iseek-content-fetcher-fb:jar:1.0.1-SNAPSHOT: Missing:
[ERROR] ----------
[ERROR] 1) com.vantage.iseek.content:iseek-content-publisher-ds:jar:1.0.1-SNAPSHOT
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=com.vantage.iseek.content -DartifactId=iseek-content-publisher-ds -Dversion=1.0.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=com.vantage.iseek.content -DartifactId=iseek-content-publisher-ds -Dversion=1.0.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) com.vantage.iseek.content:iseek-content-fetcher-fb:jar:1.0.1-SNAPSHOT
[ERROR] 2) com.vantage.iseek.content:iseek-content-publisher-ds:jar:1.0.1-SNAPSHOT
[ERROR]
[ERROR] ----------
[ERROR] 1 required artifact is missing.
[ERROR]
[ERROR] for artifact:
[ERROR] com.vantage.iseek.content:iseek-content-fetcher-fb:jar:1.0.1-SNAPSHOT
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] nexus (http://maven2.vantage.com:8080/repo/content/groups/public, releases=true, snapshots=false),
[ERROR] central (http://repo.maven.apache.org/maven2, releases=true, snapshots=false)

但在目標目錄中我總能找到iseek內容取功能-FB-1.0.1-SNAPSHOT.jar當我運行mvn install
可能有人請點什麼,我缺少什麼?

+0

的Maven無法找到這件神器在你的本地倉庫,這是'〜/ .m2目錄/'。 –

+0

看來庫不在您的倉庫(遠程和本地)中,您可以按照錯誤日誌中的說明手動安裝它。 – maqjav

+0

@AndrewLogvinov:謝謝。但是我怎麼能指向那個目錄呢? – user2537987

回答

0

好像你有一個Maven的Projekt的「iseek內容取功能-FB」你是在另一個地方項目通過依賴工作和你的參考。

Maven不會在eclipse目標文件夾中掃描您的項目。它只知道本地存儲庫「〜/ .m2」或遠程存儲庫中的maven-artifacts,如http://mvnrepository.com/

你必須編譯和安裝你的Maven項目,以本地資源庫:MVN安裝

install - install the package into the local repository, for use as a dependency in other projects locally