2012-11-26 83 views
0

我是Maven中的新成員,我想在maven中使用qt-jambi。我跟着這個tutorial和Maven給了我以下錯誤:在Maven中安裝插件時出錯

[INFO] Scanning for projects... 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building iycTest 
[INFO] task-segment: [test] 
[INFO] ------------------------------------------------------------------------ 
[INFO] ------------------------------------------------------------------------ 
[ERROR] BUILD ERROR 
[INFO] ------------------------------------------------------------------------ 
[INFO] The plugin 'net.sf.qtjambi:qtjambi-maven-plugin' does not exist or no val 
id version could be found 
[INFO] ------------------------------------------------------------------------ 
[INFO] For more information, run Maven with the -e switch 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 1 second 
[INFO] Finished at: Mon Nov 26 02:25:57 PST 2012 
[INFO] Final Memory: 3M/15M 
[INFO] ------------------------------------------------------------------------ 

我的pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>mypacakage</groupId> 
    <artifactId>iycTest</artifactId> 
    <version>2.0</version> 
    <packaging>jar</packaging> 

    <name>iycTest</name> 
    <url>http://maven.apache.org</url> 

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

    <dependencies> 
    <dependency> 
     <groupId>net.sf.qtjambi</groupId> 
     <artifactId>qtjambi</artifactId> 
     <version>4.5.2_01</version> 
    </dependency> 
</dependencies> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>net.sf.qtjambi</groupId> 
      <artifactId>qtjambi-maven-plugin</artifactId> 
      <executions> 
       <execution> 
        <id>qtjambi</id> 
        <goals> 
         <goal>generate</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <sourcesDir>src/main/java</sourcesDir> 
       <noObsoleteTranslations>true</noObsoleteTranslations> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 

<repositories> 
     <repository> 
      <id>qtjambi</id> 
      <name>qtjambi</name> 
      <url>http://qtjambi.sourceforge.net/maven2/</url> 
     </repository> 
    </repositories> 

    <pluginRepositories> 
     <pluginRepository> 
      <id>qtjambi</id> 
      <name>qtjambi</name> 
      <url>http://qtjambi.sourceforge.net/maven2/</url> 
     </pluginRepository> 
    </pluginRepositories> 

</project> 

如何解決這個問題呢?我使用微軟Windows XP和Maven 2.0.11

回答

2

如果您瀏覽到README,您會在底部找到repository的鏈接。然後更新您的pom.xml重新運行行家:

$ mvn --update-plugins clean install 

$ mvn --version 
Apache Maven 3.0.4 (r1232337; 2012-01-17 00:44:56-0800) 
Maven home: /home/user/apache-maven-3.0.4 
Java version: 1.7.0_09, vendor: Oracle Corporation 
Java home: /home/user/jdk1.7.0_09/jre 
Default locale: en_CA, platform encoding: UTF-8 
OS name: "linux", version: "3.5.0-18-generic", arch: "amd64", family: "unix" 
+0

tnx,我的問題解決了...我讀自述文件 – mehdi

4

[基於@Raymond提示更新尋找到的README.txt在舊倉庫位置]

的倉庫已經移動,所以你必須改變倉庫URL。從

http://qtjambi.sourceforge.net/maven2/ 

更改所有存儲庫的URL

http://repository.qt-jambi.org/nexus/content/repositories/releases-before-2011/ 

http://qt-jambi.org另外,還要檢查新的主頁,瞭解更多信息。在這個新的倉庫4.6.3_04可用於maven插件。 qtjambi本身可以使用4.5.2_01,4.6.2和4.6.3。

+0

tnx for answer我更改了存儲庫URL,我的問題仍然存在。 – mehdi

+0

你改變了他們的權利?存儲庫和pluginRespository?只是檢查:) –

+0

嘗試添加版本的插件,它可能不會自動解析: 4.6.3_04

2

嘗試添加版本插件它可能不會被自動解析:

<version>4.6.3_04</version> 

您可以使用該插件的可用版本是在庫網址:

http://old.qt-jambi.org/maven2/net/sf/qtjambi/qtjambi-maven-plugin/

在你可能會需要相同的插件版本qtjambi的版本,所以在這種情況下,你NE的猜測編輯找到適當的存儲庫。

+0

只是作爲主機名建議'old.qt-jambi.org'只在退役期間存在和主機和網站更改評論。以前的回答有一個新的URL:http://repository.qt-jambi.org/nexus/content/repositories/release-after- 2011-',只需替換'http://old.qt-jambi。 org/maven2 /'部分與新的URL(或任何替換任何以前的URL有/ maven2 /部分),我們有HTTP重定向和瀏覽器與人類網絡瀏覽器的地方希望自我文件的東西。 –