测试中出现子maven错误,无法解析依赖项

时间:2018-10-11 06:38:18

标签: maven mule mule-esb munit

我可以在Bamboo作业中使用maven build来构建代码。相同的工作在测试步骤中失败了!错误如下,我正在独立运行我的应用程序,并使用许可证的凭据访问mule esb ee jars。还是工作失败,出现以下错误!

PaymentID = int.Parse(item["p_ID"].ToString()),

在我的settings.xml下面!

 Failed to execute goal on project mycontacts-mule-api: 
 Could not resolve dependencies for project com.adc.mule:mycontacts-mule-api:mule:0.0.1-SNAPSHOT: 
 The following artifacts could not be resolved: 
 com.mulesoft.muleesb:mule-core-ee:jar:3.9.0, 
 com.mulesoft.muleesb.modules:mule-module-spring-config-ee:jar:3.9.0, 
 com.mulesoft.muleesb.transports:mule-transport-jdbc-ee:jar:3.9.0, 
 com.mulesoft.muleesb.transports:mule-transport-jms-ee:jar:3.9.0, 
 com.mulesoft.anypoint:mule-module-proxy:jar:3.9.0, 
 com.mulesoft.anypoint:mule-module-raml-el-gw:jar:3.9.0, 
 com.mulesoft.anypoint:mule-module-spring-config-gw:jar:3.9.0, 
 com.mulesoft.anypoint:api-gateway-client:jar:3.9.0, 
 com.mulesoft.anypoint:gateway-core:jar:3.9.0, 
 com.mulesoft.weave:mule-plugin-weave:jar:3.9.0: 
 Failure to find com.mulesoft.muleesb:mule-core-ee:jar:3.9.0 in
 http://repository.mulesoft.org/releases/ was cached in the local repository, 
 resolution will not be reattempted until the update interval of mulesoft-releases has elapsed or updates are forced -> [Help 1]

和pom.xml!

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <pluginGroups>
        <pluginGroup>org.mule.tools</pluginGroup>
    </pluginGroups>
    <servers>
        <server>
          <id>nexus-ee</id>
          <username>cust.nexus</username>
          <password>************</password>
        </server>
    </servers>
    <mirrors></mirrors>
    <profiles>
        <profile>
            <id>mule-profile</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <mule-maven-plugin-version>2.2.1</mule-maven-plugin-version>
                <mule-username>John123</mule-username>
                <mule-password>********</mule-password>
                <mule-client-id>*******************</mule-client-id>
                <mule-client-secret>*****************</mule-client-secret>
                <deployment-type>cloudhub</deployment-type>
                <business-group>PARADIGM</business-group>
                <target-name>null</target-name>
                <target-type>null</target-type>
                <worker-size>Micro</worker-size>
                <worker-count>1</worker-count>
                <env-name>SIT</env-name>
            </properties>
            <repositories>
                  <repository>
                      <id>mulesoft-public</id>
                      <name>MuleSoft Public</name>
                      <url>https://repository.mulesoft.org/nexus/content/repositories/public</url>
                  </repository>
                  <repository> 
                    <id>nexus-ee</id> 
                    <name>nexus-ee</name> 
                    <url>https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/</url> 
                    <layout>default</layout> 
                    <releases> 
                       <enabled>true</enabled> 
                    </releases> 
                    <snapshots> 
                       <enabled>false</enabled> 
                    </snapshots> 
                  </repository>
                  <repository>
                      <id>mulesoft-releases</id>
                      <name>MuleSoft Releases</name>
                      <url>https://repository-master.mulesoft.org/nexus/content/repositories/releases</url>
                  </repository>
                  <repository>
                      <id>mulesoft-releases-common</id>
                      <name>MuleSoft Releases Repository</name>
                      <url>http://repository.mulesoft.org/releases/</url>
                      <layout>default</layout>
                </repository>
                <repository>
                      <id>mule-ee-releases</id>
                      <name>MuleEE Releases Repository</name>
                      <url>https://repository-master.mulesoft.org/nexus/content/repositories/releases-ee/</url>
                </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>mule-public-plugin</id>
          <name>MuleSoft Public Plugin</name>
          <url>https://repository.mulesoft.org/nexus/content/repositories/public</url>
        </pluginRepository>
      </pluginRepositories>
      </profile>
    </profiles>
    <activeProfiles>
  <activeProfile>mule-profile</activeProfile>
    </activeProfiles>
</settings>

2 个答案:

答案 0 :(得分:0)

以'-ee'结尾的M子依赖项不是公开的。似乎您尚未配置Mule Enterprise存储库,该存储库只能由MuleSoft的客户访问。 有关说明,请参见https://docs.mulesoft.com/mule-runtime/3.9/configuring-maven-to-work-with-mule-esb#referencing-mulesoft-s-enterprise-repositories。 您可能需要使用mvn -U ...以避免Maven在解决这些依赖关系时缓存错误。

答案 1 :(得分:0)

我自己想出了解决方法,我还必须将nexus-ee repo添加到我的pom.xml中!这解决了无法找到依赖项的问题!

<repository> 
    <id>nexus-ee</id> 
    <name>nexus-ee</name> 
    <url>https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/</url> 
    <layout>default</layout> 
    <releases> 
       <enabled>true</enabled> 
    </releases> 
    <snapshots> 
       <enabled>false</enabled> 
    </snapshots> 
</repository>