我有被打包成一个耳朵的项目。 在过去的一个月左右的系统测试已被禁用。 我们把他们回来,并已固定失败的测试和构建脚本问题。 我一直无法破解的最新问题:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.14.1:test (default-test) on project systemTest: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.14.1:test failed: A required class was missing while executing org.apache.maven.plugins:maven-surefire-plugin:2.14.1:test: org/junit/runner/notification/RunListener
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-surefire-plugin:2.14.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/tomcat/.m2/repository/org/apache/maven/plugins/maven-surefire-plugin/2.14.1/maven-surefire-plugin-2.14.1.jar
[ERROR] urls[1] = file:/home/tomcat/.m2/repository/org/apache/maven/surefire/surefire-junit47/2.14.1/surefire-junit47-2.14.1.jar
[ERROR] urls[2] = file:/home/tomcat/.m2/repository/org/apache/maven/surefire/common-junit48/2.14.1/common-junit48-2.14.1.jar
[ERROR] urls[3] = file:/home/tomcat/.m2/repository/org/apache/maven/surefire/common-junit4/2.14.1/common-junit4-2.14.1.jar
[ERROR] urls[4] = file:/home/tomcat/.m2/repository/org/apache/maven/surefire/common-junit3/2.14.1/common-junit3-2.14.1.jar
[ERROR] urls[5] = file:/home/tomcat/.m2/repository/org/apache/maven/surefire/surefire-grouper/2.14.1/surefire-grouper-2.14.1.jar
[ERROR] urls[6] = file:/home/tomcat/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.4/maven-shared-utils-0.4.jar
[ERROR] urls[7] = file:/home/tomcat/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
[ERROR] urls[8] = file:/home/tomcat/.m2/repository/org/apache/maven/surefire/common-java5/2.14.1/common-java5-2.14.1.jar
[ERROR] urls[9] = file:/home/tomcat/.m2/repository/org/apache/maven/surefire/maven-surefire-common/2.14.1/maven-surefire-common-2.14.1.jar
[ERROR] urls[10] = file:/home/tomcat/.m2/repository/org/apache/maven/surefire/surefire-booter/2.14.1/surefire-booter-2.14.1.jar
[ERROR] urls[11] = file:/home/tomcat/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar
[ERROR] urls[12] = file:/home/tomcat/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.jar
[ERROR] urls[13] = file:/home/tomcat/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar
[ERROR] urls[14] = file:/home/tomcat/.m2/repository/org/apache/maven/surefire/surefire-api/2.14.1/surefire-api-2.14.1.jar
[ERROR] urls[15] = file:/home/tomcat/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-annotations/3.2/maven-plugin-annotations-3.2.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.junit.runner.notification.RunListener
[ERROR] -> [Help 1]
我无法弄清楚如何组织/ JUnit的/跑步/通知/ RunListener无法找到。 整个工程使用Maven构建和junit
是作为一个测试依赖。
据我们所知,做一个完整的建筑工作,除了随处可见的生成服务器上。 第二个有趣的点,在构建服务器,时不包括系统测试,并在自己经营的系统测试,做工精细一切建立精细。 当整个项目建成包括系统测试的问题只发生。
这是相关部分pom.xml
的系统测试
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>com/crowncastle/test/*Test.class</include>
<include>com/crowncastle/test/suite/*TestSuite.class</include>
</includes>
<additionalClasspathElements>
<additionalClasspathElement>${basedir}${file.separator}..${file.separator}ear${file.separator}src${file.separator}main${file.separator}application${file.separator}APP-INF${file.separator}classes</additionalClasspathElement>
<additionalClasspathElement>${basedir}${file.separator}..${file.separator}ff${file.separator}src${file.separator}main${file.separator}resources</additionalClasspathElement>
<additionalClasspathElement>${basedir}${file.separator}..${file.separator}ff${file.separator}target${file.separator}classes</additionalClasspathElement>
<additionalClasspathElement>${basedir}${file.separator}..${file.separator}ff${file.separator}target${file.separator}test-classes</additionalClasspathElement>
</additionalClasspathElements>
<forkMode>always</forkMode>
<argLine>-Xmx1024m -XX:MaxPermSize=512m</argLine>
<runOrder>alphabetical</runOrder>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<forkedProcessTimeoutInSeconds>900</forkedProcessTimeoutInSeconds>
</configuration>
</plugin>
更新我想也许有一个旧版本junit
游逛可能会造成问题,所以我跑mvn dependency:analyze
和mvn dependency:tree
但是,只有提起junit
是junit 4.10
,这是适当的版本。
更新我们能够复制我们的测试版本服务器上的问题。 我没有提到之前,开发商的工作站上运行Windows 8和构建服务器是Linux。 因此,它可能是一个Windows VS Linux的问题,但我看不出什么。