【问题标题】:Failed to collect dependencies/create artifact/read artifact descriptor无法收集依赖项/创建工件/读取工件描述符
【发布时间】:2022-01-24 16:52:55
【问题描述】:

尝试运行我的 Azure Devops 管道,但它在我的 Maven 任务上一直失败。我的错误日志如下

[ERROR] Failed to execute goal on project azure-brief: Could not resolve dependencies for project com.mycompany:azure-brief:mule-application:1.0.0-SNAPSHOT: Failed to collect dependencies at com.mulesoft.munit:munit-runner:jar:mule-plugin:2.3.4: Failed to read artifact descriptor for com.mulesoft.munit:munit-runner:jar:mule-plugin:2.3.4: Could not transfer artifact com.mulesoft.munit:munit-runner:pom:2.3.4 from/to MuleRepository (https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/): authentication failed for https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/com/mulesoft/munit/munit-runner/2.3.4/munit-runner-2.3.4.pom, status: 401 Unauthorized -> [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/DependencyResolutionException

我尝试在我的 pom.xml 中更改我的依赖项的版本,但无济于事。 这是我的 pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.mycompany</groupId>
    <artifactId>azure-brief</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>mule-application</packaging>

    <name>azure-brief</name>

        <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <app.runtime>4.4.0</app.runtime>
        <mule.maven.plugin.version>3.5.2</mule.maven.plugin.version>
        <munit.version>2.3.6</munit.version>
        <sonar.sources>.</sonar.sources>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.0.0</version>
            </plugin>
            <plugin>
            <!--code added-->
                <groupId>com.mulesoft.munit.tools</groupId>
                <artifactId>munit-maven-plugin</artifactId>
                <version>${munit.version}</version>
                <executions>
                    <execution>
                        <id>test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                            <goal>coverage-report</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <coverage>
                        <runCoverage>true</runCoverage>
                        <formats>
                            <format>html</format>
                            <format>json</format>
                        </formats>
                    </coverage>
                    <runtimeProduct>MULE_EE</runtimeProduct>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-maven-plugin</artifactId>
                <version>${mule.maven.plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <cloudHubDeployment>
                        <uri>https://anypoint.mulesoft.com</uri>
                        <server>${server}</server>
                        <muleVersion>${app.runtime}</muleVersion>
                        <username>${anypoint.username}</username>
                        <password>${anypoint.password}</password>

                        <environment>${environment}</environment>
                        <applicationName>${app.name}</applicationName>
                        <businessGroup>${business}</businessGroup>
                        <workerType>${workerType}</workerType>
                        <workers>${workers}</workers>
                        <objectStoreV2>true</objectStoreV2>
                    </cloudHubDeployment>
                <classifier>mule-application</classifier>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-http-connector</artifactId>
            <version>1.5.25</version>
            <classifier>mule-plugin</classifier>
        </dependency>
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-sockets-connector</artifactId>
            <version>1.2.2</version>
            <classifier>mule-plugin</classifier>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.munit</groupId>
            <artifactId>munit-runner</artifactId>
            <version>2.3.4</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.munit</groupId>
            <artifactId>munit-tools</artifactId>
            <version>2.3.6</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.weave</groupId>
            <artifactId>assertions</artifactId>
            <version>1.0.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>anypoint-exchange-v2</id>
            <name>Anypoint Exchange</name>
            <url>https://maven.anypoint.mulesoft.com/api/v2/maven</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>https://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <layout>default</layout>
            <url>https://repository.mulesoft.org/releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

</project>

我的管道有问题还是我的 pom.xml 有问题?有没有办法解决这个问题?

【问题讨论】:

    标签: java maven azure-devops yaml sonarqube


    【解决方案1】:

    我认为 pom.xml 文件没有任何问题。但是从错误中它说 401 Unauthorized

    这意味着它正在尝试连接某些东西并且它无权连接。请检查您是否有权访问该用户。

    【讨论】:

    • 它应该可以访问,因为我是管理员和创建者,但它需要访问什么?会不会和我的 settings.xml 有关?
    猜你喜欢
    • 2019-08-10
    • 1970-01-01
    • 2018-10-20
    • 2021-01-13
    • 2016-05-08
    • 2011-10-02
    • 2017-02-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多