2012-11-26 124 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重定向和浏览器与人类网络浏览器的地方希望自我文件的东西。 –