0

我是 Maven 新手,我想在 Maven 中使用 qt-jambi。我按照本教程进行操作,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>

我该如何解决?我正在使用 MS Windows xp 和 Maven 2.0.11

4

3 回答 3

4

[基于@Raymond 提示在旧存储库位置查看 README.txt 的更新]

存储库已移动,因此您必须更改存储库 URL。更改所有存储库网址

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

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。

于 2012-11-26T16:49:14.607 回答
2

如果您浏览自述文件​​,您会在底部找到一个指向存储库的链接。更新你的 pom.xml 然后重新运行 maven:

$ 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"
于 2012-11-26T17:12:49.137 回答
2

尝试将版本添加到插件中,它可能无法自动解析:

<version>4.6.3_04</version>

您可以用于插件的可用版本位于存储库 url:

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

猜测您可能需要与 qtjambi 版本相同的插件版本,因此在这种情况下,您需要找到合适的存储库。

于 2012-11-26T17:36:14.517 回答