Maven 找不到 talend ci builder 的依赖项

问题描述

在我的 Azure DevOps 管道中,我收到以下错误

[ERROR] Plugin org.talend.ci:builder-maven-plugin:7.3.4 or one of its dependencies Could not be resolved: Failed to read artifact descriptor for org.talend.ci:builder-maven-plugin:jar:7.3.4: Could not transfer artifact org.talend.ci:builder-maven-plugin:pom:7.3.4 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [plugins_snapshot (http://XXX.stratoserver.net:XXX/repository/talend-custom-libs-snapshot/,default,releases+snapshots),plugins_release (http://XXX.stratoserver.net:XXX/repository/talend-custom-libs-release/,central (http://XXX.stratoserver.net:XXX/repository/maven-central/,releases+snapshots)] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors,re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions,please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

我尝试使用错误中提供的链接查找错误,但我无法找到它的内容。 有谁知道这里可能有什么问题?很明显它说了一些关于 ci builder 插件内容,但我查了一下,它在我的 POM 中。

我的 POM:

<properties>
    <signer.version>7.3.1</signer.version>
    <talend.project.name>DATAOPS</talend.project.name>
    <encoding>UTF-8</encoding>
    <maven.deploy.skip>true</maven.deploy.skip>
    <talend.docker.tag>${project.version}</talend.docker.tag>
    <talend.docker.name>${talend.project.name.lowercase}/${talend.job.folder}%a</talend.docker.name>
  </properties>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.6.1</version>
          <dependencies>
            <dependency>
              <groupId>org.eclipse.tycho</groupId>
              <artifactId>tycho-compiler-jdt</artifactId>
              <version>1.4.0</version>
            </dependency>
            <dependency>
              <groupId>org.codehaus.plexus</groupId>
              <artifactId>plexus-utils</artifactId>
              <version>3.0.24</version>
            </dependency>
          </dependencies>
          <configuration>
            <source>1.8</source>
            <target>1.8</target>
            <compilerId>jdt</compilerId>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.0.2</version>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.plexus</groupId>
              <artifactId>plexus-utils</artifactId>
              <version>3.0.24</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</version>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.plexus</groupId>
              <artifactId>plexus-utils</artifactId>
              <version>3.0.24</version>
            </dependency>
          </dependencies>
          <configuration>
            <archive>
              <addMavendescriptor>false</addMavendescriptor>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.0.0</version>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.plexus</groupId>
              <artifactId>plexus-utils</artifactId>
              <version>3.0.24</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.20</version>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.plexus</groupId>
              <artifactId>plexus-utils</artifactId>
              <version>3.0.24</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.1</version>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.plexus</groupId>
              <artifactId>plexus-utils</artifactId>
              <version>3.0.24</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.7</version>
          <dependencies>
            <dependency>
              <groupId>org.codehaus.plexus</groupId>
              <artifactId>plexus-utils</artifactId>
              <version>3.0.24</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.talend.ci</groupId>
        <artifactId>builder-maven-plugin</artifactId>
        <version>7.3.4</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>docker</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>io.fabric8</groupId>
              <artifactId>fabric8-maven-plugin</artifactId>
              <version>4.0.0</version>
              <dependencies>
                <dependency>
                  <groupId>io.fabric8</groupId>
                  <artifactId>docker-maven-plugin</artifactId>
                  <version>0.29.0</version>
                </dependency>
                <dependency>
                  <groupId>com.fasterxml.jackson.core</groupId>
                  <artifactId>jackson-annotations</artifactId>
                  <version>2.10.1</version>
                </dependency>
                <dependency>
                  <groupId>com.fasterxml.jackson.core</groupId>
                  <artifactId>jackson-core</artifactId>
                  <version>2.10.1</version>
                </dependency>
                <dependency>
                  <groupId>com.fasterxml.jackson.core</groupId>
                  <artifactId>jackson-databind</artifactId>
                  <version>2.10.1</version>
                </dependency>
                <dependency>
                  <groupId>com.fasterxml.jackson.dataformat</groupId>
                  <artifactId>jackson-dataformat-yaml</artifactId>
                  <version>2.10.1</version>
                </dependency>
                <dependency>
                  <groupId>com.fasterxml.jackson.module</groupId>
                  <artifactId>jackson-module-jaxb-annotations</artifactId>
                  <version>2.10.1</version>
                </dependency>
              </dependencies>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>fabric8-maven-plugin</artifactId>
            <version>4.0.0</version>
            <executions>
              <execution>
                <id>start</id>
                <phase>install</phase>
                <goals>
                  <goal>build</goal>
                </goals>
              </execution>
              <execution>
                <id>push-image</id>
                <phase>deploy</phase>
                <goals>
                  <goal>push</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <skip>${docker.skip}</skip>
              <autopull>once</autopull>
              <images>
                <image>
                  <name>${talend.docker.name}</name>
                  <build>
                    <from>openjdk:8-jre-slim</from>
                    <tags>
                      <tag>${talend.docker.tag}</tag>
                    </tags>
                    <env>
                      <JAVA_OPTS>${talend.job.jvmargs}</JAVA_OPTS>
                    </env>
                    <runcmds>
                      <run>chmod +x /maven/${talend.job.name}/${talend.job.name}_run.sh</run>
                      <run>sed -i 's/ -xms[0-9]*M//g' /maven/${talend.job.name}/${talend.job.name}_run.sh</run>
                      <run>sed -i 's/-Xmx[0-9]*M/$JAVA_OPTS/g' /maven/${talend.job.name}/${talend.job.name}_run.sh</run>
                    </runcmds>
                    <workdir>/maven/${talend.job.name}</workdir>
                    <entryPoint>
                      <exec>
                        <arg>./${talend.job.name}_run.sh</arg>
                      </exec>
                    </entryPoint>
                    <assembly>
                      <descriptor>${basedir}/src/main/assemblies/assembly.xml</descriptor>
                    </assembly>
                  </build>
                </image>
              </images>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>cloud-publisher</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.talend.ci</groupId>
            <artifactId>cloudpublisher-maven-plugin</artifactId>
            <version>7.3.1</version>
            <executions>
              <execution>
                <phase>deploy</phase>
                <goals>
                  <goal>publish</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <skip>${cloud.publisher.skip}</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>nexus</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <maven.deploy.skip>false</maven.deploy.skip>
      </properties>
    </profile>
  </profiles>
</project>

非常感谢任何帮助,如果需要任何额外信息,请告诉我!

解决方法

Azure 最近将 maven 从 3.6.3 升级到 3.8.1。

从这个 Maven 构建开始,默认情况下会阻止 http 存储库。

最好的解决方案是升级到 https。

另一种解决方案是创建一个异常,并允许 http。 有关此的更多信息,您可以在此问题的答案中找到: Maven Build Failure — DependencyResolutionException