java – Maven 2未运行Junit 4测试

前端之家收集整理的这篇文章主要介绍了java – Maven 2未运行Junit 4测试前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我遇到了运行Junit4测试的问题.在 https://stackoverflow.com/questions/2021771?sort=newest#sort-top中报告了同样的问题,但解决方案是去除了违规依赖,其传递依赖性导致包含junit3.在我的情况下,依赖是必要的.我试图弄清楚如何将传递依赖性排除在junit3之外,因此它不包含在surefire:test classpath中.

下面是我的pom.xml和“mvn -X test”的输出. pom.xml尝试使用“排除”元素,但这似乎没有帮助.注意底部附近maven将junit3添加到测试类路径.

  1. <?xml version="1.0"?>
  2. <project>
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>com.comcast.service</groupId>
  5. <artifactId>LocationServiceIntTest</artifactId>
  6. <version>10.01</version>
  7. <packaging>jar</packaging>
  8. <name>Location Service Integration Test</name>
  9. <repositories>
  10. <repository>
  11. <id>central</id>
  12. <url>http://pacdcntdp01.cable.comcast.com:8081/artifactory/repo</url>
  13. <snapshots>
  14. <enabled>false</enabled>
  15. </snapshots>
  16. </repository>
  17. <repository>
  18. <id>3rdp-releases</id>
  19. <url>http://pacdcntdp01.cable.comcast.com:8081/artifactory/3rdp-releases
  20. </url>
  21. <snapshots>
  22. <enabled>false</enabled>
  23. </snapshots>
  24. </repository>
  25. <repository>
  26. <id>snapshots</id>
  27. <url>http://pacdcntdp01.cable.comcast.com:8081/artifactory/repo</url>
  28. <releases>
  29. <enabled>true</enabled>
  30. </releases>
  31. </repository>
  32. </repositories>
  33. <pluginRepositories>
  34. <pluginRepository>
  35. <id>central</id>
  36. <url>http://pacdcntdp01.cable.comcast.com:8081/artifactory/repo</url>
  37. <snapshots>
  38. <enabled>false</enabled>
  39. </snapshots>
  40. </pluginRepository>
  41. <pluginRepository>
  42. <id>snapshots</id>
  43. <url>http://pacdcntdp01.cable.comcast.com:8081/artifactory/repo</url>
  44. <releases>
  45. <enabled>false</enabled>
  46. </releases>
  47. </pluginRepository>
  48. </pluginRepositories>
  49. <build>
  50. <plugins>
  51. <plugin>
  52. <groupId>org.apache.axis2</groupId>
  53. <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
  54. <version>1.5.1</version>
  55. <executions>
  56. <execution>
  57. <goals>
  58. <goal>wsdl2code</goal>
  59. </goals>
  60. </execution>
  61. </executions>
  62. <configuration>
  63. <packageName>com.comcast.service</packageName>
  64. <wsdlFile>${basedir}/../ServiceClient/src/main/resources/LocationService.wsdl
  65. </wsdlFile>
  66. <databindingName>adb</databindingName>
  67. <unpackClasses>true</unpackClasses>
  68. </configuration>
  69. </plugin>
  70. <plugin>
  71. <groupId>org.apache.maven.plugins</groupId>
  72. <artifactId>maven-compiler-plugin</artifactId>
  73. <configuration>
  74. <source>1.5</source>
  75. <target>1.5</target>
  76. </configuration>
  77. </plugin>
  78. <plugin>
  79. <groupId>org.apache.maven.plugins</groupId>
  80. <artifactId>maven-surefire-plugin</artifactId>
  81. <version>2.4.3</version>
  82. <configuration>
  83. <includes>
  84. <include>**/*Test.java</include>
  85. </includes>
  86. <junitArtifactName>junit:junit:jar:4.4</junitArtifactName>
  87. </configuration>
  88. </plugin>
  89. </plugins>
  90. </build>
  91. <dependencyManagement>
  92. <dependencies>
  93. <dependency>
  94. <groupId>junit</groupId>
  95. <artifactId>junit</artifactId>
  96. <version>4.4</version>
  97. </dependency>
  98. </dependencies>
  99. </dependencyManagement>
  100. <dependencies>
  101. <dependency>
  102. <groupId>org.unitils</groupId>
  103. <artifactId>unitils-core</artifactId>
  104. <version>3.1</version>
  105. <type>pom</type>
  106. <exclusions>
  107. <exclusion>
  108. <groupId>junit</groupId>
  109. <artifactId>junit</artifactId>
  110. </exclusion>
  111. </exclusions>
  112. </dependency>
  113. <dependency>
  114. <groupId>org.unitils</groupId>
  115. <artifactId>unitils-testng</artifactId>
  116. <version>3.1</version>
  117. <type>pom</type>
  118. <exclusions>
  119. <exclusion>
  120. <groupId>junit</groupId>
  121. <artifactId>junit</artifactId>
  122. </exclusion>
  123. </exclusions>
  124. </dependency>
  125. <dependency>
  126. <groupId>org.apache.axis2</groupId>
  127. <artifactId>axis2</artifactId>
  128. <version>1.5.1</version>
  129. <exclusions>
  130. <exclusion>
  131. <groupId>junit</groupId>
  132. <artifactId>junit</artifactId>
  133. </exclusion>
  134. </exclusions>
  135. </dependency>
  136. <dependency>
  137. <groupId>org.apache.ws.commons.axiom</groupId>
  138. <artifactId>axiom-impl</artifactId>
  139. <version>1.2.8</version>
  140. <exclusions>
  141. <exclusion>
  142. <groupId>junit</groupId>
  143. <artifactId>junit</artifactId>
  144. </exclusion>
  145. </exclusions>
  146. </dependency>
  147. <dependency>
  148. <groupId>org.apache.ws.commons.axiom</groupId>
  149. <artifactId>axiom-dom</artifactId>
  150. <version>1.2.8</version>
  151. <exclusions>
  152. <exclusion>
  153. <groupId>junit</groupId>
  154. <artifactId>junit</artifactId>
  155. </exclusion>
  156. </exclusions>
  157. </dependency>
  158. <dependency>
  159. <groupId>axis</groupId>
  160. <artifactId>axis-wsdl4j</artifactId>
  161. <version>1.5.1</version>
  162. <exclusions>
  163. <exclusion>
  164. <groupId>junit</groupId>
  165. <artifactId>junit</artifactId>
  166. </exclusion>
  167. </exclusions>
  168. </dependency>
  169. <dependency>
  170. <groupId>org.apache.rampart</groupId>
  171. <artifactId>rampart-core</artifactId>
  172. <version>1.4</version>
  173. <exclusions>
  174. <exclusion>
  175. <groupId>junit</groupId>
  176. <artifactId>junit</artifactId>
  177. </exclusion>
  178. </exclusions>
  179. </dependency>
  180. <dependency>
  181. <groupId>org.apache.rampart</groupId>
  182. <artifactId>rampart</artifactId>
  183. <version>1.4</version>
  184. <exclusions>
  185. <exclusion>
  186. <groupId>junit</groupId>
  187. <artifactId>junit</artifactId>
  188. </exclusion>
  189. </exclusions>
  190. </dependency>
  191. <dependency>
  192. <groupId>org.apache.rampart</groupId>
  193. <artifactId>rahas</artifactId>
  194. <version>1.4</version>
  195. <exclusions>
  196. <exclusion>
  197. <groupId>junit</groupId>
  198. <artifactId>junit</artifactId>
  199. </exclusion>
  200. </exclusions>
  201. </dependency>
  202. <dependency>
  203. <groupId>org.apache.geronimo.specs</groupId>
  204. <artifactId>geronimo-jaxws_2.1_spec</artifactId>
  205. <version>1.0</version>
  206. <exclusions>
  207. <exclusion>
  208. <groupId>junit</groupId>
  209. <artifactId>junit</artifactId>
  210. </exclusion>
  211. </exclusions>
  212. </dependency>
  213. <dependency>
  214. <groupId>commons-lang</groupId>
  215. <artifactId>commons-lang</artifactId>
  216. <version>2.4</version>
  217. <exclusions>
  218. <exclusion>
  219. <groupId>junit</groupId>
  220. <artifactId>junit</artifactId>
  221. </exclusion>
  222. </exclusions>
  223. </dependency>
  224. </dependencies>
  225. <reporting>
  226. <plugins>
  227. <plugin>
  228. <groupId>org.apache.maven.plugins</groupId>
  229. <artifactId>maven-surefire-plugin</artifactId>
  230. <version>2.4</version>
  231. </plugin>
  232. </plugins>
  233. </reporting>
  234. </project>
  1. + Error stacktraces are turned on.
  2. Apache Maven 2.2.1 (r801777; 2009-08-06 13:16:01-0600)
  3. Java version: 1.5.0_22
  4. Java home: c:\Program Files\Java\jdk1.5.0_22\jre
  5. Default locale: en_US,platform encoding: Cp1252
  6. OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
  7. [DEBUG] Building Maven user-level plugin registry from: 'C:\Documents and Settings\swall2633c\.m2\plugin-registry.xml'
  8. [DEBUG] Building Maven global-level plugin registry from: 'c:\opt\apache-maven-2.2.1-bin\apache-maven-2.2.1\conf\plugin-registry.xml'
  9. [INFO] Scanning for projects...
  10.  
  11. ..... intentionally excluded minimizing size of post ......
  12.  
  13.  
  14.  
  15. [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-surefire-plugin:2.4.3:test' -->
  16. [DEBUG] (f) basedir = c:\dev\LocationService\IntegrationTest
  17. [DEBUG] (f) childDelegation = false
  18. [DEBUG] (f) classesDirectory = c:\dev\LocationService\IntegrationTest\target\classes
  19. [DEBUG] (f) classpathElements = [c:\dev\LocationService\IntegrationTest\target\test-classes,c:\dev\LocationService\IntegrationTest\target\classes,C:\Documents and Settings\swall2633c\.m2\repository\junit\junit\4.4\junit-4.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\commons-logging\commons-logging\1.1\commons-logging-1.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\commons-collections\commons-collections\3.2\commons-collections-3.2.jar,C:\Documents and Settings\swall2633c\.m2\repository\ognl\ognl\2.6.9\ognl-2.6.9.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\unitils\unitils-core\3.1\unitils-core-3.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\testng\testng\5.8\testng-5.8-jdk15.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\axis2\axis2\1.5.1\axis2-1.5.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ws\commons\axiom\axiom-impl\1.2.8\axiom-impl-1.2.8.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ws\commons\axiom\axiom-api\1.2.8\axiom-api-1.2.8.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\geronimo\specs\geronimo-activation_1.1_spec\1.0.1\geronimo-activation_1.1_spec-1.0.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\geronimo\specs\geronimo-javamail_1.4_spec\1.2\geronimo-javamail_1.4_spec-1.2.jar,C:\Documents and Settings\swall2633c\.m2\repository\jaxen\jaxen\1.1.1\jaxen-1.1.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\xml-apis\xml-apis\1.3.04\xml-apis-1.3.04.jar,C:\Documents and Settings\swall2633c\.m2\repository\xerces\xercesImpl\2.8.1\xercesImpl-2.8.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\geronimo\specs\geronimo-stax-api_1.0_spec\1.0.1\geronimo-stax-api_1.0_spec-1.0.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\codehaus\woodstox\wstx-asl\3.2.4\wstx-asl-3.2.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ws\commons\axiom\axiom-dom\1.2.8\axiom-dom-1.2.8.jar,C:\Documents and Settings\swall2633c\.m2\repository\axis\axis-wsdl4j\1.5.1\axis-wsdl4j-1.5.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\rampart\rampart-core\1.4\rampart-core-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\rampart\rampart-policy\1.4\rampart-policy-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\axis2\axis2-kernel\1.4\axis2-kernel-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\javax\servlet\servlet-api\2.3\servlet-api-2.3.jar,C:\Documents and Settings\swall2633c\.m2\repository\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\commons-codec\commons-codec\1.3\commons-codec-1.3.jar,C:\Documents and Settings\swall2633c\.m2\repository\commons-fileupload\commons-fileupload\1.2\commons-fileupload-1.2.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\httpcomponents\httpcore\4.0-beta1\httpcore-4.0-beta1.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\httpcomponents\httpcore-nio\4.0-beta1\httpcore-nio-4.0-beta1.jar,C:\Documents and Settings\swall2633c\.m2\repository\wsdl4j\wsdl4j\1.6.2\wsdl4j-1.6.2.jar,C:\Documents and Settings\swall2633c\.m2\repository\backport-util-concurrent\backport-util-concurrent\3.1\backport-util-concurrent-3.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ws\commons\schema\XmlSchema\1.4.2\XmlSchema-1.4.2.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\neethi\neethi\2.0.4\neethi-2.0.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\woden\woden-api\1.0M8\woden-api-1.0M8.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ant\ant\1.7.0\ant-1.7.0.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ant\ant-launcher\1.7.0\ant-launcher-1.7.0.jar,C:\Documents and Settings\swall2633c\.m2\repository\xerces\xmlParserAPIs\2.6.0\xmlParserAPIs-2.6.0.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\woden\woden-impl-dom\1.0M8\woden-impl-dom-1.0M8.jar,C:\Documents and Settings\swall2633c\.m2\repository\annogen\annogen\0.1.0\annogen-0.1.0.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\geronimo\specs\geronimo-jms_1.1_spec\1.1\geronimo-jms_1.1_spec-1.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\javax\mail\mail\1.4\mail-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\xalan\xalan\2.7.0\xalan-2.7.0.jar,C:\Documents and Settings\swall2633c\.m2\repository\commons-io\commons-io\1.4\commons-io-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\axis2\axis2-codegen\1.4\axis2-codegen-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\axis2\axis2-adb\1.4\axis2-adb-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\axis2\axis2-xmlbeans\1.4\axis2-xmlbeans-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\xmlbeans\xmlbeans\2.3.0\xmlbeans-2.3.0.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\axis2\axis2-adb-codegen\1.4\axis2-adb-codegen-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\axis2\mex\1.4\mex-1.4-impl.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\axis2\axis2-mtompolicy\1.4\axis2-mtompolicy-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\commons-discovery\commons-discovery\0.2\commons-discovery-0.2.jar,C:\Documents and Settings\swall2633c\.m2\repository\log4j\log4j\1.2.15\log4j-1.2.15.jar,C:\Documents and Settings\swall2633c\.m2\repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\xmlbeans\xbean\2.1.0\xbean-2.1.0.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ws\security\wss4j\1.5.4\wss4j-1.5.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\santuario\xmlsec\1.4.1\xmlsec-1.4.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\opensaml\opensaml\1.1\opensaml-1.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\axis\axis-ant\1.4\axis-ant-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\bouncycastle\bcprov-jdk15\132\bcprov-jdk15-132.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ant\ant-nodeps\1.7.0\ant-nodeps-1.7.0.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\rampart\rampart-trust\1.4\rampart-trust-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\jdom\jdom\1.0\jdom-1.0.jar,C:\Documents and Settings\swall2633c\.m2\repository\xom\xom\1.0\xom-1.0.jar,C:\Documents and Settings\swall2633c\.m2\repository\com\ibm\icu\icu4j\2.6.1\icu4j-2.6.1.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\rampart\rampart\1.4\rampart-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\rampart\rahas\1.4\rahas-1.4.jar,C:\Documents and Settings\swall2633c\.m2\repository\org\apache\geronimo\specs\geronimo-jaxws_2.1_spec\1.0\geronimo-jaxws_2.1_spec-1.0.jar]
  20. [DEBUG] (f) disableXmlReport = false
  21. [DEBUG] (f) enableAssertions = true
  22. [DEBUG] (f) forkMode = once
  23. [DEBUG] (f) includes = [**/*Test.java]
  24. [DEBUG] (f) junitArtifactName = junit:junit
  25. [DEBUG] (f) localRepository = Repository[local|file://C:\Documents and Settings\swall2633c\.m2\repository]
  26. [DEBUG] (f) pluginArtifactMap = {org.apache.maven.surefire:surefire-booter=org.apache.maven.surefire:surefire-booter:jar:2.4.3:runtime,org.apache.maven.surefire:surefire-api=org.apache.maven.surefire:surefire-api:jar:2.4.3:runtime,org.codehaus.plexus:plexus-utils=org.codehaus.plexus:plexus-utils:jar:1.5.1:runtime,org.apache.maven:maven-plugin-api=org.apache.maven:maven-plugin-api:jar:2.0.6:runtime,org.apache.maven:maven-artifact=org.apache.maven:maven-artifact:jar:2.0.6:runtime,org.apache.maven:maven-project=org.apache.maven:maven-project:jar:2.0.6:runtime,org.apache.maven:maven-core=org.apache.maven:maven-core:jar:2.0.6:runtime,org.apache.maven:maven-toolchain=org.apache.maven:maven-toolchain:jar:1.0:runtime}
  27. [DEBUG] (f) printSummary = true
  28. [DEBUG] (f) project = MavenProject: com.mycompany.service:LocationServiceIntTest:10.01 @ c:\dev\LocationService\IntegrationTest\pom.xml
  29. [DEBUG] (f) projectArtifactMap = {junit:junit=junit:junit:jar:4.4:test,org.unitils:unitils-core=org.unitils:unitils-core:jar:3.1:compile,commons-logging:commons-logging=commons-logging:commons-logging:jar:1.1:compile,commons-lang:commons-lang=commons-lang:commons-lang:jar:2.4:compile,commons-collections:commons-collections=commons-collections:commons-collections:jar:3.2:compile,ognl:ognl=ognl:ognl:jar:2.6.9:compile,org.unitils:unitils-testng=org.unitils:unitils-testng:pom:3.1:compile,org.testng:testng=org.testng:testng:jar:jdk15:5.8:compile,org.apache.axis2:axis2=org.apache.axis2:axis2:jar:1.5.1:compile,org.apache.ws.commons.axiom:axiom-impl=org.apache.ws.commons.axiom:axiom-impl:jar:1.2.8:compile,org.apache.ws.commons.axiom:axiom-api=org.apache.ws.commons.axiom:axiom-api:jar:1.2.8:compile,org.apache.geronimo.specs:geronimo-activation_1.1_spec=org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0.1:compile,org.apache.geronimo.specs:geronimo-javamail_1.4_spec=org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.2:compile,jaxen:jaxen=jaxen:jaxen:jar:1.1.1:compile,xml-apis:xml-apis=xml-apis:xml-apis:jar:1.3.04:compile,xerces:xercesImpl=xerces:xercesImpl:jar:2.8.1:compile,org.apache.geronimo.specs:geronimo-stax-api_1.0_spec=org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile,org.codehaus.woodstox:wstx-asl=org.codehaus.woodstox:wstx-asl:jar:3.2.4:compile,org.apache.ws.commons.axiom:axiom-dom=org.apache.ws.commons.axiom:axiom-dom:jar:1.2.8:compile,axis:axis-wsdl4j=axis:axis-wsdl4j:jar:1.5.1:compile,org.apache.rampart:rampart-core=org.apache.rampart:rampart-core:jar:1.4:compile,org.apache.rampart:rampart-policy=org.apache.rampart:rampart-policy:jar:1.4:compile,org.apache.axis2:axis2-kernel=org.apache.axis2:axis2-kernel:jar:1.4:compile,javax.servlet:servlet-api=javax.servlet:servlet-api:jar:2.3:compile,commons-httpclient:commons-httpclient=commons-httpclient:commons-httpclient:jar:3.1:compile,commons-codec:commons-codec=commons-codec:commons-codec:jar:1.3:compile,commons-fileupload:commons-fileupload=commons-fileupload:commons-fileupload:jar:1.2:compile,org.apache.httpcomponents:httpcore=org.apache.httpcomponents:httpcore:jar:4.0-beta1:compile,org.apache.httpcomponents:httpcore-nio=org.apache.httpcomponents:httpcore-nio:jar:4.0-beta1:compile,wsdl4j:wsdl4j=wsdl4j:wsdl4j:jar:1.6.2:compile,backport-util-concurrent:backport-util-concurrent=backport-util-concurrent:backport-util-concurrent:jar:3.1:compile,org.apache.ws.commons.schema:XmlSchema=org.apache.ws.commons.schema:XmlSchema:jar:1.4.2:compile,org.apache.neethi:neethi=org.apache.neethi:neethi:jar:2.0.4:compile,org.apache.woden:woden-api=org.apache.woden:woden-api:jar:1.0M8:compile,org.apache.ant:ant=org.apache.ant:ant:jar:1.7.0:compile,org.apache.ant:ant-launcher=org.apache.ant:ant-launcher:jar:1.7.0:compile,xerces:xmlParserAPIs=xerces:xmlParserAPIs:jar:2.6.0:compile,org.apache.woden:woden-impl-dom=org.apache.woden:woden-impl-dom:jar:1.0M8:compile,annogen:annogen=annogen:annogen:jar:0.1.0:compile,org.apache.geronimo.specs:geronimo-jms_1.1_spec=org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1:compile,javax.mail:mail=javax.mail:mail:jar:1.4:compile,javax.activation:activation=javax.activation:activation:jar:1.1:compile,xalan:xalan=xalan:xalan:jar:2.7.0:compile,commons-io:commons-io=commons-io:commons-io:jar:1.4:compile,org.apache.axis2:axis2-codegen=org.apache.axis2:axis2-codegen:jar:1.4:compile,org.apache.axis2:axis2-adb=org.apache.axis2:axis2-adb:jar:1.4:compile,org.apache.axis2:axis2-xmlbeans=org.apache.axis2:axis2-xmlbeans:jar:1.4:compile,org.apache.xmlbeans:xmlbeans=org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile,org.apache.axis2:axis2-adb-codegen=org.apache.axis2:axis2-adb-codegen:jar:1.4:compile,org.apache.axis2:mex=org.apache.axis2:mex:jar:impl:1.4:compile,org.apache.axis2:axis2-mtompolicy=org.apache.axis2:axis2-mtompolicy:jar:1.4:compile,commons-discovery:commons-discovery=commons-discovery:commons-discovery:jar:0.2:compile,log4j:log4j=log4j:log4j:jar:1.2.15:compile,stax:stax-api=stax:stax-api:jar:1.0.1:compile,xmlbeans:xbean=xmlbeans:xbean:jar:2.1.0:compile,org.apache.ws.security:wss4j=org.apache.ws.security:wss4j:jar:1.5.4:compile,org.apache.santuario:xmlsec=org.apache.santuario:xmlsec:jar:1.4.1:compile,opensaml:opensaml=opensaml:opensaml:jar:1.1:compile,org.apache.axis:axis-ant=org.apache.axis:axis-ant:jar:1.4:compile,bouncycastle:bcprov-jdk15=bouncycastle:bcprov-jdk15:jar:132:compile,org.apache.ant:ant-nodeps=org.apache.ant:ant-nodeps:jar:1.7.0:compile,org.apache.axis2:addressing=org.apache.axis2:addressing:mar:1.4:compile,org.apache.rampart:rampart-trust=org.apache.rampart:rampart-trust:jar:1.4:compile,dom4j:dom4j=dom4j:dom4j:jar:1.6.1:compile,jdom:jdom=jdom:jdom:jar:1.0:compile,xom:xom=xom:xom:jar:1.0:compile,com.ibm.icu:icu4j=com.ibm.icu:icu4j:jar:2.6.1:compile,org.apache.rampart:rampart=org.apache.rampart:rampart:jar:1.4:compile,org.apache.rampart:rahas=org.apache.rampart:rahas:jar:1.4:compile,org.apache.geronimo.specs:geronimo-jaxws_2.1_spec=org.apache.geronimo.specs:geronimo-jaxws_2.1_spec:jar:1.0:compile}
  30. [DEBUG] (f) redirectTestOutputToFile = false
  31. [DEBUG] (f) remoteRepositories = [Repository[central|http://pacdcntdp01.cable.mycompany.com:8081/artifactory/repo],Repository[snapshots|http://pacdcntdp01.cable.mycompany.com:8081/artifactory/repo]]
  32. [DEBUG] (f) reportFormat = brief
  33. [DEBUG] (f) reportsDirectory = c:\dev\LocationService\IntegrationTest\target\surefire-reports
  34. [DEBUG] (f) session = org.apache.maven.execution.MavenSession@90288e
  35. [DEBUG] (f) testClassesDirectory = c:\dev\LocationService\IntegrationTest\target\test-classes
  36. [DEBUG] (f) testNGArtifactName = org.testng:testng
  37. [DEBUG] (f) testSourceDirectory = c:\dev\LocationService\IntegrationTest\src\test\java
  38. [DEBUG] (f) trimStackTrace = true
  39. [DEBUG] (f) useFile = true
  40. [DEBUG] (f) useManifestOnlyJar = true
  41. [DEBUG] (f) workingDirectory = c:\dev\LocationService\IntegrationTest
  42. [DEBUG] -- end configuration --
  43. [INFO] [surefire:test {execution: default-test}]
  44. [DEBUG] dummy:dummy:jar:1.0 (selected for null)
  45. [DEBUG] org.apache.maven.surefire:surefire-booter:jar:2.4.3:runtime (selected for runtime)
  46. [DEBUG] org.apache.maven.surefire:surefire-api:jar:2.4.3:runtime (selected for runtime)
  47. [DEBUG] Adding to surefire booter test classpath: C:\Documents and Settings\swall2633c\.m2\repository\org\apache\maven\surefire\surefire-booter\2.4.3\surefire-booter-2.4.3.jar
  48. [DEBUG] Adding to surefire booter test classpath: C:\Documents and Settings\swall2633c\.m2\repository\org\apache\maven\surefire\surefire-api\2.4.3\surefire-api-2.4.3.jar
  49. [DEBUG] dummy:dummy:jar:1.0 (selected for null)
  50. [DEBUG] org.testng:testng:jar:jdk15:5.8:compile (selected for compile)
  51. [DEBUG] Adding to surefire booter test classpath: C:\Documents and Settings\swall2633c\.m2\repository\org\testng\testng\5.8\testng-5.8-jdk15.jar
  52. [DEBUG] dummy:dummy:jar:1.0 (selected for null)
  53. [DEBUG] Retrieving parent-POM: org.apache.maven.surefire:surefire-providers:pom:2.4.3 for project: null:surefire-testng:jar:null from the repository.
  54. [DEBUG] Adding managed dependencies for unknown:surefire-testng
  55. [DEBUG] org.apache.maven.surefire:surefire-api:jar:2.4.3
  56. [DEBUG] org.apache.maven.surefire:surefire-booter:jar:2.4.3
  57. [DEBUG] org.codehaus.plexus:plexus-utils:jar:1.5.1
  58. [DEBUG] org.apache.maven.surefire:surefire-testng:jar:2.4.3:test (selected for test)
  59. [DEBUG] org.apache.maven:maven-artifact:jar:2.0:test (selected for test)
  60. [DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:test (selected for test)
  61. [DEBUG] junit:junit:jar:3.8.1:test (selected for test)
  62. [DEBUG] org.testng:testng:jar:jdk15:5.7:test (selected for test)
  63. [DEBUG] org.apache.maven.surefire:surefire-api:jar:2.4.3:test (selected for test)
  64. [DEBUG] Adding to surefire test classpath: C:\Documents and Settings\swall2633c\.m2\repository\org\apache\maven\surefire\surefire-testng\2.4.3\surefire-testng-2.4.3.jar
  65. [DEBUG] Adding to surefire test classpath: C:\Documents and Settings\swall2633c\.m2\repository\org\apache\maven\maven-artifact\2.0\maven-artifact-2.0.jar
  66. [DEBUG] Adding to surefire test classpath: C:\Documents and Settings\swall2633c\.m2\repository\org\codehaus\plexus\plexus-utils\1.0.4\plexus-utils-1.0.4.jar
  67. [DEBUG] Adding to surefire test classpath: C:\Documents and Settings\swall2633c\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar
  68. [DEBUG] Adding to surefire test classpath: C:\Documents and Settings\swall2633c\.m2\repository\org\apache\maven\surefire\surefire-api\2.4.3\surefire-api-2.4.3.jar
  69. [DEBUG] Test Classpath :
  70. [DEBUG] c:\dev\LocationService\IntegrationTest\target\test-classes
  71. [DEBUG] c:\dev\LocationService\IntegrationTest\target\classes
  72. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\junit\junit\4.4\junit-4.4.jar
  73. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\commons-logging\commons-logging\1.1\commons-logging-1.1.jar
  74. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar
  75. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\commons-collections\commons-collections\3.2\commons-collections-3.2.jar
  76. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\ognl\ognl\2.6.9\ognl-2.6.9.jar
  77. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\unitils\unitils-core\3.1\unitils-core-3.1.jar
  78. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\testng\testng\5.8\testng-5.8-jdk15.jar
  79. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\apache\axis2\axis2\1.5.1\axis2-1.5.1.jar
  80. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ws\commons\axiom\axiom-impl\1.2.8\axiom-impl-1.2.8.jar
  81. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ws\commons\axiom\axiom-api\1.2.8\axiom-api-1.2.8.jar
  82. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\apache\geronimo\specs\geronimo-activation_1.1_spec\1.0.1\geronimo-activation_1.1_spec-1.0.1.jar
  83. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\apache\geronimo\specs\geronimo-javamail_1.4_spec\1.2\geronimo-javamail_1.4_spec-1.2.jar
  84. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\jaxen\jaxen\1.1.1\jaxen-1.1.1.jar
  85. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\xml-apis\xml-apis\1.3.04\xml-apis-1.3.04.jar
  86. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\xerces\xercesImpl\2.8.1\xercesImpl-2.8.1.jar
  87. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\apache\geronimo\specs\geronimo-stax-api_1.0_spec\1.0.1\geronimo-stax-api_1.0_spec-1.0.1.jar
  88. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\codehaus\woodstox\wstx-asl\3.2.4\wstx-asl-3.2.4.jar
  89. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ws\commons\axiom\axiom-dom\1.2.8\axiom-dom-1.2.8.jar
  90. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\axis\axis-wsdl4j\1.5.1\axis-wsdl4j-1.5.1.jar
  91. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\apache\rampart\rampart-core\1.4\rampart-core-1.4.jar
  92. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\apache\rampart\rampart-policy\1.4\rampart-policy-1.4.jar
  93. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\apache\axis2\axis2-kernel\1.4\axis2-kernel-1.4.jar
  94. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\javax\servlet\servlet-api\2.3\servlet-api-2.3.jar
  95. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar
  96. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\commons-codec\commons-codec\1.3\commons-codec-1.3.jar
  97. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\commons-fileupload\commons-fileupload\1.2\commons-fileupload-1.2.jar
  98. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\apache\httpcomponents\httpcore\4.0-beta1\httpcore-4.0-beta1.jar
  99. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repository\org\apache\httpcomponents\httpcore-nio\4.0-beta1\httpcore-nio-4.0-beta1.jar
  100. [DEBUG] C:\Documents and Settings\swall2633c\.m2\repo

解决方法

我无法弄清楚你是如何让JUnit 4与所有依赖项一起运行的,但我确实注意到你对TestNG Unitils工件的依赖是导致问题的原因.

请注意,为了让我的测试工作,我不得不删除存储库,除了编译器和surefire以及apache wallart依赖项之外的插件.

为了获得运行示例JUnit 4测试用例,我所做的三个更改是:

>从surefire配置中删除junitArtifactName元素
>将junit工件从dependencyManagement部分移动到依赖关系部分
>从依赖项中删除unitils-testng工件.你把它列为有一种pom的东西,这更没意义.

请注意,unitils-core也是pom类型,这没什么意义.

猜你在找的Java相关文章