1

让 Maven 构建如下:

<plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-antrun-plugin</artifactId>
      <version>1.7</version>
      <dependencies>
            <dependency>
                  <groupId>com.oopsconsultancy</groupId>
                  <artifactId>xmltask</artifactId>
                  <version>1.14</version>
            </dependency> 
      </dependencies> 
</plugin>

对于我的项目groupel-orchestrate ::

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>concat-hosts-and-install-uninstall</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                 </execution>
            </executions>
        </plugin>

导致构建失败:

[错误] 无法在项目 groupel-orchestrate 上执行目标 org.apache.maven.plugins:maven-antrun-plugin:1.7:run (concat-hosts-and-install-uninstall):执行 concat-hosts-and-install-卸载目标 org.apache.maven.plugins:maven-antrun-plugin:1.7:run failed: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.7 或其依赖项之一无法解决:不能在中央找到工件 com.oopsconsultancy:xmltask:jar:1.14 ( https://repo.maven.apache.org/maven2 ) -> [帮助 1]

我应该怎么做才能克服这个错误?

4

1 回答 1

0

您尝试使用的插件不在 Maven 中央存储库中,而仅在 Atlassian 3rd party repo中。为了能够使用,您需要将该存储库添加到您的构建中,如下所示:

<pluginRepositories>
    <pluginRepository>
        <id>atlassian-third-party-repo</id>
        <name>atlassian-third-party-repo</name>
        <url>https://maven.atlassian.com/3rdparty/</url>
    </pluginRepository>
</pluginRepositories>
于 2019-12-23T09:19:18.050 回答