我有一个带有Eclipse插件的Mule 3.6.1项目。使用Junit在Mule中运行单元测试时,测试正在运行。但是,在终端上使用mvn test
执行测试会产生以下错误:
Failed to execute goal on project edus-esb-activity-aggregator: Could not
resolve dependencies for project edu.ucdavis.iet.edus:edus-esb-activity-
aggregator:mule:1.0.0-SNAPSHOT: Failed to collect dependencies at
org.mule.modules:mule-module-apikit:jar:1.5.2 -> org.mule.modules:mule-
module-cors:jar:1.2 -> org.mule.modules:mule-module-spring-config:jar:3.4.0
-> org.mule:mule-core:jar:3.4.0 -> javax.activation:activation:jar:1.1-osgi:
Failed to read artifact descriptor for javax.activation:activation:jar:1.1-
osgi: Could not transfer artifact javax.activation:activation:pom:1.1-osgi
from/to codehaus-releases (http://repository.codehaus.org/):
repository.codehaus.org: nodename nor servname provided, or not known:
Unknown host repository.codehaus.org: nodename nor servname provided, or not
known
我已经确定该项目包含错误消息中列出的所有jar。当maven尝试下载http://repository.codehaus.org/dom4j/dom4j/1.6.1-osgi/dom4j-1.6.1-osgi.pom时,会发生构建失败。引用 http://www.codehaus.org/mechanics/maven/ 我已将Maven的settings.xml文件修改为:
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0
http://maven.apache.org/xsd/settings-1.1.0.xsd">
<profiles>
<profile>
<repositories>
<repository>
<id>codehaus-mule-repo</id>
<name>codehaus-mule-repo</name>
<url>https://repository-master.mulesoft.org/nexus/content/groups/public/dom4j/dom4j/1.6.1-osgi/dom4j-1.6.1-osgi.pom</url>
<layout>default</layout>
</repository>
</repositories>
</profile>
</profiles>
不幸的是,这仍然无法解决问题。最后,这是pom.xml文件中的依赖项:
<dependencies>
<dependency>
<groupId>org.mule.tools</groupId>
<artifactId>mule-artifact-archiver</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.mule</groupId>
<artifactId>mule-core</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>2.0.2-beta</version>
</dependency>
<dependency>
<groupId>org.objenesis</groupId>
<artifactId>objenesis</artifactId>
<version>2.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mnode.ical4j</groupId>
<artifactId>ical4j</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>com.restfb</groupId>
<artifactId>restfb</artifactId>
<version>1.14.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>3.2.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.0.28-beta</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-objectstore</artifactId>
<version>RELEASE</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-spring-config</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-file</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-http</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-jdbc</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-jms</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-vm</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-scripting</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-xml</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.tests</groupId>
<artifactId>mule-tests-functional</artifactId>
<version>${mule.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-mongo</artifactId>
<version>3.6.1</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-http</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-apikit</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-jersey</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-json</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
我不确定如何前进,所以任何帮助都会受到赞赏。
答案 0 :(得分:2)
可能是因为Codehaus is no more :(
幸运的是,他们至少有一些migration help。
答案 1 :(得分:0)
按照migration help中的说明添加存储库并不能解决mule依赖关系中的问题。
一种解决方案是添加以下存储库:
<repository>
<id>ibiblio-mule</id>
<name>ibiblio Mule dependencies</name>
<url>http://mirrors.ibiblio.org/maven/mule/dependencies/maven2</url>
<layout>default</layout>
</repository>