加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – Maven 2未运行Junit 4测试

发布时间:2020-12-15 02:58:34 所属栏目:Java 来源:网络整理
导读:我遇到了运行Junit4测试的问题.在 https://stackoverflow.com/questions/2021771?sort=newest#sort-top中报告了同样的问题,但解决方案是去除了违规依赖,其传递依赖性导致包含junit3.在我的情况下,依赖是必要的.我试图弄清楚如何将传递依赖性排除在junit3之外
我遇到了运行Junit4测试的问题.在 https://stackoverflow.com/questions/2021771?sort=newest#sort-top中报告了同样的问题,但解决方案是去除了违规依赖,其传递依赖性导致包含junit3.在我的情况下,依赖是必要的.我试图弄清楚如何将传递依赖性排除在junit3之外,因此它不包含在surefire:test classpath中.

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

<?xml version="1.0"?>
<project>
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.comcast.service</groupId>
 <artifactId>LocationServiceIntTest</artifactId>
 <version>10.01</version>
 <packaging>jar</packaging>
 <name>Location Service Integration Test</name>
 <repositories>
  <repository>
   <id>central</id>
   <url>http://pacdcntdp01.cable.comcast.com:8081/artifactory/repo</url>
   <snapshots>
    <enabled>false</enabled>
   </snapshots>
  </repository>
  <repository>
   <id>3rdp-releases</id>
   <url>http://pacdcntdp01.cable.comcast.com:8081/artifactory/3rdp-releases
   </url>
   <snapshots>
    <enabled>false</enabled>
   </snapshots>
  </repository>
  <repository>
   <id>snapshots</id>
   <url>http://pacdcntdp01.cable.comcast.com:8081/artifactory/repo</url>
   <releases>
    <enabled>true</enabled>
   </releases>
  </repository>
 </repositories>
 <pluginRepositories>
  <pluginRepository>
   <id>central</id>
   <url>http://pacdcntdp01.cable.comcast.com:8081/artifactory/repo</url>
   <snapshots>
    <enabled>false</enabled>
   </snapshots>
  </pluginRepository>
  <pluginRepository>
   <id>snapshots</id>
   <url>http://pacdcntdp01.cable.comcast.com:8081/artifactory/repo</url>
   <releases>
    <enabled>false</enabled>
   </releases>
  </pluginRepository>
 </pluginRepositories>
 <build>
  <plugins>
   <plugin>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
    <version>1.5.1</version>
    <executions>
     <execution>
      <goals>
       <goal>wsdl2code</goal>
      </goals>
     </execution>
    </executions>
    <configuration>
     <packageName>com.comcast.service</packageName>
     <wsdlFile>${basedir}/../ServiceClient/src/main/resources/LocationService.wsdl
     </wsdlFile>
     <databindingName>adb</databindingName>
     <unpackClasses>true</unpackClasses>
    </configuration>
   </plugin>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
     <source>1.5</source>
     <target>1.5</target>
    </configuration>
   </plugin>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.4.3</version>
    <configuration>
     <includes>
      <include>**/*Test.java</include>
     </includes>
     <junitArtifactName>junit:junit:jar:4.4</junitArtifactName>
    </configuration>
   </plugin>
  </plugins>
 </build>
 <dependencyManagement>
  <dependencies>
   <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.4</version>
   </dependency>
  </dependencies>
 </dependencyManagement>
 <dependencies>
  <dependency>
   <groupId>org.unitils</groupId>
   <artifactId>unitils-core</artifactId>
   <version>3.1</version>
   <type>pom</type>
   <exclusions>
    <exclusion>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
    </exclusion>
   </exclusions>
  </dependency>
  <dependency>
   <groupId>org.unitils</groupId>
   <artifactId>unitils-testng</artifactId>
   <version>3.1</version>
   <type>pom</type>
   <exclusions>
    <exclusion>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
    </exclusion>
   </exclusions>
  </dependency>
  <dependency>
   <groupId>org.apache.axis2</groupId>
   <artifactId>axis2</artifactId>
   <version>1.5.1</version>
   <exclusions>
    <exclusion>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
    </exclusion>
   </exclusions>
  </dependency>
  <dependency>
   <groupId>org.apache.ws.commons.axiom</groupId>
   <artifactId>axiom-impl</artifactId>
   <version>1.2.8</version>
   <exclusions>
    <exclusion>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
    </exclusion>
   </exclusions>
  </dependency>
  <dependency>
   <groupId>org.apache.ws.commons.axiom</groupId>
   <artifactId>axiom-dom</artifactId>
   <version>1.2.8</version>
   <exclusions>
    <exclusion>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
    </exclusion>
   </exclusions>
  </dependency>
  <dependency>
   <groupId>axis</groupId>
   <artifactId>axis-wsdl4j</artifactId>
   <version>1.5.1</version>
   <exclusions>
    <exclusion>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
    </exclusion>
   </exclusions>
  </dependency>
  <dependency>
   <groupId>org.apache.rampart</groupId>
   <artifactId>rampart-core</artifactId>
   <version>1.4</version>
   <exclusions>
    <exclusion>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
    </exclusion>
   </exclusions>
  </dependency>
  <dependency>
   <groupId>org.apache.rampart</groupId>
   <artifactId>rampart</artifactId>
   <version>1.4</version>
   <exclusions>
    <exclusion>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
    </exclusion>
   </exclusions>
  </dependency>
  <dependency>
   <groupId>org.apache.rampart</groupId>
   <artifactId>rahas</artifactId>
   <version>1.4</version>
   <exclusions>
    <exclusion>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
    </exclusion>
   </exclusions>
  </dependency>
  <dependency>
   <groupId>org.apache.geronimo.specs</groupId>
   <artifactId>geronimo-jaxws_2.1_spec</artifactId>
   <version>1.0</version>
   <exclusions>
    <exclusion>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
    </exclusion>
   </exclusions>
  </dependency>
  <dependency>
   <groupId>commons-lang</groupId>
   <artifactId>commons-lang</artifactId>
   <version>2.4</version>
   <exclusions>
    <exclusion>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
    </exclusion>
   </exclusions>
  </dependency>
 </dependencies>
 <reporting>
  <plugins>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.4</version>
   </plugin>
  </plugins>
 </reporting>
</project>
+ Error stacktraces are turned on.
Apache Maven 2.2.1 (r801777; 2009-08-06 13:16:01-0600)
Java version: 1.5.0_22
Java home: c:Program FilesJavajdk1.5.0_22jre
Default locale: en_US,platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
[DEBUG] Building Maven user-level plugin registry from: 'C:Documents and Settingsswall2633c.m2plugin-registry.xml'
[DEBUG] Building Maven global-level plugin registry from: 'c:optapache-maven-2.2.1-binapache-maven-2.2.1confplugin-registry.xml'
[INFO] Scanning for projects...

 ..... intentionally excluded minimizing size of post ......



[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-surefire-plugin:2.4.3:test' -->
[DEBUG]   (f) basedir = c:devLocationServiceIntegrationTest
[DEBUG]   (f) childDelegation = false
[DEBUG]   (f) classesDirectory = c:devLocationServiceIntegrationTesttargetclasses
[DEBUG]   (f) classpathElements = [c:devLocationServiceIntegrationTesttargettest-classes,c:devLocationServiceIntegrationTesttargetclasses,C:Documents and Settingsswall2633c.m2repositoryjunitjunit4.4junit-4.4.jar,C:Documents and Settingsswall2633c.m2repositorycommons-loggingcommons-logging1.1commons-logging-1.1.jar,C:Documents and Settingsswall2633c.m2repositorycommons-langcommons-lang2.4commons-lang-2.4.jar,C:Documents and Settingsswall2633c.m2repositorycommons-collectionscommons-collections3.2commons-collections-3.2.jar,C:Documents and Settingsswall2633c.m2repositoryognlognl2.6.9ognl-2.6.9.jar,C:Documents and Settingsswall2633c.m2repositoryorgunitilsunitils-core3.1unitils-core-3.1.jar,C:Documents and Settingsswall2633c.m2repositoryorgtestngtestng5.8testng-5.8-jdk15.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacheaxis2axis21.5.1axis2-1.5.1.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachewscommonsaxiomaxiom-impl1.2.8axiom-impl-1.2.8.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachewscommonsaxiomaxiom-api1.2.8axiom-api-1.2.8.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachegeronimospecsgeronimo-activation_1.1_spec1.0.1geronimo-activation_1.1_spec-1.0.1.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachegeronimospecsgeronimo-javamail_1.4_spec1.2geronimo-javamail_1.4_spec-1.2.jar,C:Documents and Settingsswall2633c.m2repositoryjaxenjaxen1.1.1jaxen-1.1.1.jar,C:Documents and Settingsswall2633c.m2repositoryxml-apisxml-apis1.3.04xml-apis-1.3.04.jar,C:Documents and Settingsswall2633c.m2repositoryxercesxercesImpl2.8.1xercesImpl-2.8.1.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachegeronimospecsgeronimo-stax-api_1.0_spec1.0.1geronimo-stax-api_1.0_spec-1.0.1.jar,C:Documents and Settingsswall2633c.m2repositoryorgcodehauswoodstoxwstx-asl3.2.4wstx-asl-3.2.4.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachewscommonsaxiomaxiom-dom1.2.8axiom-dom-1.2.8.jar,C:Documents and Settingsswall2633c.m2repositoryaxisaxis-wsdl4j1.5.1axis-wsdl4j-1.5.1.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacherampartrampart-core1.4rampart-core-1.4.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacherampartrampart-policy1.4rampart-policy-1.4.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacheaxis2axis2-kernel1.4axis2-kernel-1.4.jar,C:Documents and Settingsswall2633c.m2repositoryjavaxservletservlet-api2.3servlet-api-2.3.jar,C:Documents and Settingsswall2633c.m2repositorycommons-httpclientcommons-httpclient3.1commons-httpclient-3.1.jar,C:Documents and Settingsswall2633c.m2repositorycommons-codeccommons-codec1.3commons-codec-1.3.jar,C:Documents and Settingsswall2633c.m2repositorycommons-fileuploadcommons-fileupload1.2commons-fileupload-1.2.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachehttpcomponentshttpcore4.0-beta1httpcore-4.0-beta1.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachehttpcomponentshttpcore-nio4.0-beta1httpcore-nio-4.0-beta1.jar,C:Documents and Settingsswall2633c.m2repositorywsdl4jwsdl4j1.6.2wsdl4j-1.6.2.jar,C:Documents and Settingsswall2633c.m2repositorybackport-util-concurrentbackport-util-concurrent3.1backport-util-concurrent-3.1.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachewscommonsschemaXmlSchema1.4.2XmlSchema-1.4.2.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacheneethineethi2.0.4neethi-2.0.4.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachewodenwoden-api1.0M8woden-api-1.0M8.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacheantant1.7.0ant-1.7.0.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacheantant-launcher1.7.0ant-launcher-1.7.0.jar,C:Documents and Settingsswall2633c.m2repositoryxercesxmlParserAPIs2.6.0xmlParserAPIs-2.6.0.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachewodenwoden-impl-dom1.0M8woden-impl-dom-1.0M8.jar,C:Documents and Settingsswall2633c.m2repositoryannogenannogen.1.0annogen-0.1.0.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachegeronimospecsgeronimo-jms_1.1_spec1.1geronimo-jms_1.1_spec-1.1.jar,C:Documents and Settingsswall2633c.m2repositoryjavaxmailmail1.4mail-1.4.jar,C:Documents and Settingsswall2633c.m2repositoryjavaxactivationactivation1.1activation-1.1.jar,C:Documents and Settingsswall2633c.m2repositoryxalanxalan2.7.0xalan-2.7.0.jar,C:Documents and Settingsswall2633c.m2repositorycommons-iocommons-io1.4commons-io-1.4.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacheaxis2axis2-codegen1.4axis2-codegen-1.4.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacheaxis2axis2-adb1.4axis2-adb-1.4.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacheaxis2axis2-xmlbeans1.4axis2-xmlbeans-1.4.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachexmlbeansxmlbeans2.3.0xmlbeans-2.3.0.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacheaxis2axis2-adb-codegen1.4axis2-adb-codegen-1.4.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacheaxis2mex1.4mex-1.4-impl.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacheaxis2axis2-mtompolicy1.4axis2-mtompolicy-1.4.jar,C:Documents and Settingsswall2633c.m2repositorycommons-discoverycommons-discovery.2commons-discovery-0.2.jar,C:Documents and Settingsswall2633c.m2repositorylog4jlog4j1.2.15log4j-1.2.15.jar,C:Documents and Settingsswall2633c.m2repositorystaxstax-api1.0.1stax-api-1.0.1.jar,C:Documents and Settingsswall2633c.m2repositoryxmlbeansxbean2.1.0xbean-2.1.0.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachewssecuritywss4j1.5.4wss4j-1.5.4.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachesantuarioxmlsec1.4.1xmlsec-1.4.1.jar,C:Documents and Settingsswall2633c.m2repositoryopensamlopensaml1.1opensaml-1.1.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacheaxisaxis-ant1.4axis-ant-1.4.jar,C:Documents and Settingsswall2633c.m2repositorybouncycastlebcprov-jdk15132bcprov-jdk15-132.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacheantant-nodeps1.7.0ant-nodeps-1.7.0.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacherampartrampart-trust1.4rampart-trust-1.4.jar,C:Documents and Settingsswall2633c.m2repositorydom4jdom4j1.6.1dom4j-1.6.1.jar,C:Documents and Settingsswall2633c.m2repositoryjdomjdom1.0jdom-1.0.jar,C:Documents and Settingsswall2633c.m2repositoryxomxom1.0xom-1.0.jar,C:Documents and Settingsswall2633c.m2repositorycomibmicuicu4j2.6.1icu4j-2.6.1.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacherampartrampart1.4rampart-1.4.jar,C:Documents and Settingsswall2633c.m2repositoryorgapacherampartrahas1.4rahas-1.4.jar,C:Documents and Settingsswall2633c.m2repositoryorgapachegeronimospecsgeronimo-jaxws_2.1_spec1.0geronimo-jaxws_2.1_spec-1.0.jar]
[DEBUG]   (f) disableXmlReport = false
[DEBUG]   (f) enableAssertions = true
[DEBUG]   (f) forkMode = once
[DEBUG]   (f) includes = [**/*Test.java]
[DEBUG]   (f) junitArtifactName = junit:junit
[DEBUG]   (f) localRepository = Repository[local|file://C:Documents and Settingsswall2633c.m2repository]
[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}
[DEBUG]   (f) printSummary = true
[DEBUG]   (f) project = MavenProject: com.mycompany.service:LocationServiceIntTest:10.01 @ c:devLocationServiceIntegrationTestpom.xml
[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}
[DEBUG]   (f) redirectTestOutputToFile = false
[DEBUG]   (f) remoteRepositories = [Repository[central|http://pacdcntdp01.cable.mycompany.com:8081/artifactory/repo],Repository[snapshots|http://pacdcntdp01.cable.mycompany.com:8081/artifactory/repo]]
[DEBUG]   (f) reportFormat = brief
[DEBUG]   (f) reportsDirectory = c:devLocationServiceIntegrationTesttargetsurefire-reports
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@90288e
[DEBUG]   (f) testClassesDirectory = c:devLocationServiceIntegrationTesttargettest-classes
[DEBUG]   (f) testNGArtifactName = org.testng:testng
[DEBUG]   (f) testSourceDirectory = c:devLocationServiceIntegrationTestsrctestjava
[DEBUG]   (f) trimStackTrace = true
[DEBUG]   (f) useFile = true
[DEBUG]   (f) useManifestOnlyJar = true
[DEBUG]   (f) workingDirectory = c:devLocationServiceIntegrationTest
[DEBUG] -- end configuration --
[INFO] [surefire:test {execution: default-test}]
[DEBUG] dummy:dummy:jar:1.0 (selected for null)
[DEBUG]   org.apache.maven.surefire:surefire-booter:jar:2.4.3:runtime (selected for runtime)
[DEBUG]     org.apache.maven.surefire:surefire-api:jar:2.4.3:runtime (selected for runtime)
[DEBUG] Adding to surefire booter test classpath: C:Documents and Settingsswall2633c.m2repositoryorgapachemavensurefiresurefire-booter2.4.3surefire-booter-2.4.3.jar
[DEBUG] Adding to surefire booter test classpath: C:Documents and Settingsswall2633c.m2repositoryorgapachemavensurefiresurefire-api2.4.3surefire-api-2.4.3.jar
[DEBUG] dummy:dummy:jar:1.0 (selected for null)
[DEBUG]   org.testng:testng:jar:jdk15:5.8:compile (selected for compile)
[DEBUG] Adding to surefire booter test classpath: C:Documents and Settingsswall2633c.m2repositoryorgtestngtestng5.8testng-5.8-jdk15.jar
[DEBUG] dummy:dummy:jar:1.0 (selected for null)
[DEBUG] Retrieving parent-POM: org.apache.maven.surefire:surefire-providers:pom:2.4.3 for project: null:surefire-testng:jar:null from the repository.
[DEBUG] Adding managed dependencies for unknown:surefire-testng
[DEBUG]   org.apache.maven.surefire:surefire-api:jar:2.4.3
[DEBUG]   org.apache.maven.surefire:surefire-booter:jar:2.4.3
[DEBUG]   org.codehaus.plexus:plexus-utils:jar:1.5.1
[DEBUG]   org.apache.maven.surefire:surefire-testng:jar:2.4.3:test (selected for test)
[DEBUG]     org.apache.maven:maven-artifact:jar:2.0:test (selected for test)
[DEBUG]       org.codehaus.plexus:plexus-utils:jar:1.0.4:test (selected for test)
[DEBUG]     junit:junit:jar:3.8.1:test (selected for test)
[DEBUG]     org.testng:testng:jar:jdk15:5.7:test (selected for test)
[DEBUG]     org.apache.maven.surefire:surefire-api:jar:2.4.3:test (selected for test)
[DEBUG] Adding to surefire test classpath: C:Documents and Settingsswall2633c.m2repositoryorgapachemavensurefiresurefire-testng2.4.3surefire-testng-2.4.3.jar
[DEBUG] Adding to surefire test classpath: C:Documents and Settingsswall2633c.m2repositoryorgapachemavenmaven-artifact2.0maven-artifact-2.0.jar
[DEBUG] Adding to surefire test classpath: C:Documents and Settingsswall2633c.m2repositoryorgcodehausplexusplexus-utils1.0.4plexus-utils-1.0.4.jar
[DEBUG] Adding to surefire test classpath: C:Documents and Settingsswall2633c.m2repositoryjunitjunit3.8.1junit-3.8.1.jar
[DEBUG] Adding to surefire test classpath: C:Documents and Settingsswall2633c.m2repositoryorgapachemavensurefiresurefire-api2.4.3surefire-api-2.4.3.jar
[DEBUG] Test Classpath :
[DEBUG]   c:devLocationServiceIntegrationTesttargettest-classes
[DEBUG]   c:devLocationServiceIntegrationTesttargetclasses
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryjunitjunit4.4junit-4.4.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositorycommons-loggingcommons-logging1.1commons-logging-1.1.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositorycommons-langcommons-lang2.4commons-lang-2.4.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositorycommons-collectionscommons-collections3.2commons-collections-3.2.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryognlognl2.6.9ognl-2.6.9.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgunitilsunitils-core3.1unitils-core-3.1.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgtestngtestng5.8testng-5.8-jdk15.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgapacheaxis2axis21.5.1axis2-1.5.1.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgapachewscommonsaxiomaxiom-impl1.2.8axiom-impl-1.2.8.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgapachewscommonsaxiomaxiom-api1.2.8axiom-api-1.2.8.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgapachegeronimospecsgeronimo-activation_1.1_spec1.0.1geronimo-activation_1.1_spec-1.0.1.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgapachegeronimospecsgeronimo-javamail_1.4_spec1.2geronimo-javamail_1.4_spec-1.2.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryjaxenjaxen1.1.1jaxen-1.1.1.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryxml-apisxml-apis1.3.04xml-apis-1.3.04.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryxercesxercesImpl2.8.1xercesImpl-2.8.1.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgapachegeronimospecsgeronimo-stax-api_1.0_spec1.0.1geronimo-stax-api_1.0_spec-1.0.1.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgcodehauswoodstoxwstx-asl3.2.4wstx-asl-3.2.4.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgapachewscommonsaxiomaxiom-dom1.2.8axiom-dom-1.2.8.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryaxisaxis-wsdl4j1.5.1axis-wsdl4j-1.5.1.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgapacherampartrampart-core1.4rampart-core-1.4.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgapacherampartrampart-policy1.4rampart-policy-1.4.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgapacheaxis2axis2-kernel1.4axis2-kernel-1.4.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryjavaxservletservlet-api2.3servlet-api-2.3.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositorycommons-httpclientcommons-httpclient3.1commons-httpclient-3.1.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositorycommons-codeccommons-codec1.3commons-codec-1.3.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositorycommons-fileuploadcommons-fileupload1.2commons-fileupload-1.2.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgapachehttpcomponentshttpcore4.0-beta1httpcore-4.0-beta1.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repositoryorgapachehttpcomponentshttpcore-nio4.0-beta1httpcore-nio-4.0-beta1.jar
[DEBUG]   C:Documents and Settingsswall2633c.m2repo

解决方法

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

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

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

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读