java 在Maven中安装插件时出错

jdzmm42g  于 2023-01-15  发布在  Java
关注(0)|答案(3)|浏览(134)

我是Maven的新手,我想在Maven中使用qt-jambi。我按照这个**tutorial**操作,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

wlzqhblo

wlzqhblo1#

[根据@Raymond提示进行更新,以查看旧存储库位置的README.txt]
存储库已移动,因此您必须更改存储库URL。更改以下位置的所有存储库URL

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

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

另外,请查看http://qt-jambi.org的新主页以了解更多信息。在这个新仓库中,maven插件可以使用4.6.3_04。qtjambi本身可以使用4.5.2_01、4.6.2和4.6.3。

wnavrhmk

wnavrhmk2#

如果你浏览到README,你会在底部找到一个repository的链接,更新你的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"
igsr9ssn

igsr9ssn3#

尝试将版本添加到插件,它可能不会自动解析:

<version>4.6.3_04</version>

可用于插件的可用版本位于存储库URL:
http://old.qt-jambi.org/maven2/net/sf/qtjambi/qtjambi-maven-plugin/
我猜你可能需要和qtjambi版本相同的插件版本,所以在这种情况下,你需要找到合适的存储库。

相关问题