草庐IT

java - Maven 2 不运行 Junit 4 测试

coder 2024-03-21 原文

我在确保运行 Junit4 测试时遇到问题。 https://stackoverflow.com/questions/2021771?sort=newest#sort-top 中报告了同样的问题但解决方案是删除有问题的依赖项,其传递依赖项导致包含 junit3。在我的例子中,依赖是必要的。我正在尝试找出如何排除对 junit3 的传递依赖性,以便它不包含在 surefire:test 类路径中。

下面是我的 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 Files\Java\jdk1.5.0_22\jre
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 Settings\swall2633c\.m2\plugin-registry.xml'
[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'
[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:\dev\LocationService\IntegrationTest
[DEBUG]   (f) childDelegation = false
[DEBUG]   (f) classesDirectory = c:\dev\LocationService\IntegrationTest\target\classes
[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]
[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 Settings\swall2633c\.m2\repository]
[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:\dev\LocationService\IntegrationTest\pom.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:\dev\LocationService\IntegrationTest\target\surefire-reports
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@90288e
[DEBUG]   (f) testClassesDirectory = c:\dev\LocationService\IntegrationTest\target\test-classes
[DEBUG]   (f) testNGArtifactName = org.testng:testng
[DEBUG]   (f) testSourceDirectory = c:\dev\LocationService\IntegrationTest\src\test\java
[DEBUG]   (f) trimStackTrace = true
[DEBUG]   (f) useFile = true
[DEBUG]   (f) useManifestOnlyJar = true
[DEBUG]   (f) workingDirectory = c:\dev\LocationService\IntegrationTest
[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 Settings\swall2633c\.m2\repository\org\apache\maven\surefire\surefire-booter\2.4.3\surefire-booter-2.4.3.jar
[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
[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 Settings\swall2633c\.m2\repository\org\testng\testng\5.8\testng-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 Settings\swall2633c\.m2\repository\org\apache\maven\surefire\surefire-testng\2.4.3\surefire-testng-2.4.3.jar
[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
[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
[DEBUG] Adding to surefire test classpath: C:\Documents and Settings\swall2633c\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar
[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
[DEBUG] Test Classpath :
[DEBUG]   c:\dev\LocationService\IntegrationTest\target\test-classes
[DEBUG]   c:\dev\LocationService\IntegrationTest\target\classes
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\junit\junit\4.4\junit-4.4.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\commons-logging\commons-logging\1.1\commons-logging-1.1.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\commons-collections\commons-collections\3.2\commons-collections-3.2.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\ognl\ognl\2.6.9\ognl-2.6.9.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\org\unitils\unitils-core\3.1\unitils-core-3.1.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\org\testng\testng\5.8\testng-5.8-jdk15.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\org\apache\axis2\axis2\1.5.1\axis2-1.5.1.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ws\commons\axiom\axiom-impl\1.2.8\axiom-impl-1.2.8.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ws\commons\axiom\axiom-api\1.2.8\axiom-api-1.2.8.jar
[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
[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
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\jaxen\jaxen\1.1.1\jaxen-1.1.1.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\xml-apis\xml-apis\1.3.04\xml-apis-1.3.04.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\xerces\xercesImpl\2.8.1\xercesImpl-2.8.1.jar
[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
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\org\codehaus\woodstox\wstx-asl\3.2.4\wstx-asl-3.2.4.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\org\apache\ws\commons\axiom\axiom-dom\1.2.8\axiom-dom-1.2.8.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\axis\axis-wsdl4j\1.5.1\axis-wsdl4j-1.5.1.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\org\apache\rampart\rampart-core\1.4\rampart-core-1.4.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\org\apache\rampart\rampart-policy\1.4\rampart-policy-1.4.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\org\apache\axis2\axis2-kernel\1.4\axis2-kernel-1.4.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\javax\servlet\servlet-api\2.3\servlet-api-2.3.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\commons-codec\commons-codec\1.3\commons-codec-1.3.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\commons-fileupload\commons-fileupload\1.2\commons-fileupload-1.2.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\org\apache\httpcomponents\httpcore\4.0-beta1\httpcore-4.0-beta1.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repository\org\apache\httpcomponents\httpcore-nio\4.0-beta1\httpcore-nio-4.0-beta1.jar
[DEBUG]   C:\Documents and Settings\swall2633c\.m2\repo

最佳答案

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

请注意,为了让我的测试正常运行,我必须删除存储库、除编译器和 surefire 之外的插件以及 apache rampart 依赖项。

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

  • 从 surefire 配置中删除 junitArtifactName 元素
  • 将 junit 工件从 dependencyManagement 部分移动到依赖部分
  • 从依赖项中删除 unitils-testng 工件。您将其列为具有一种 pom,这更没有意义。

注意unitils-core也是pom类型,意义不大。

关于java - Maven 2 不运行 Junit 4 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2029043/

有关java - Maven 2 不运行 Junit 4 测试的更多相关文章

  1. ruby - 如何从 ruby​​ 中的字符串运行任意对象方法? - 2

    总的来说,我对ruby​​还比较陌生,我正在为我正在创建的对象编写一些rspec测试用例。许多测试用例都非常基础,我只是想确保正确填充和返回值。我想知道是否有办法使用循环结构来执行此操作。不必为我要测试的每个方法都设置一个assertEquals。例如:describeitem,"TestingtheItem"doit"willhaveanullvaluetostart"doitem=Item.new#HereIcoulddotheitem.name.shouldbe_nil#thenIcoulddoitem.category.shouldbe_nilendend但我想要一些方法来使用

  2. ruby-on-rails - 使用 Ruby on Rails 进行自动化测试 - 最佳实践 - 2

    很好奇,就使用ruby​​onrails自动化单元测试而言,你们正在做什么?您是否创建了一个脚本来在cron中运行rake作业并将结果邮寄给您?git中的预提交Hook?只是手动调用?我完全理解测试,但想知道在错误发生之前捕获错误的最佳实践是什么。让我们理所当然地认为测试本身是完美无缺的,并且可以正常工作。下一步是什么以确保他们在正确的时间将可能有害的结果传达给您? 最佳答案 不确定您到底想听什么,但是有几个级别的自动代码库控制:在处理某项功能时,您可以使用类似autotest的内容获得关于哪些有效,哪些无效的即时反馈。要确保您的提

  3. ruby - 如何每月在 Heroku 运行一次 Scheduler 插件? - 2

    在选择我想要运行操作的频率时,唯一的选项是“每天”、“每小时”和“每10分钟”。谢谢!我想为我的Rails3.1应用程序运行调度程序。 最佳答案 这不是一个优雅的解决方案,但您可以安排它每天运行,并在实际开始工作之前检查日期是否为当月的第一天。 关于ruby-如何每月在Heroku运行一次Scheduler插件?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/8692687/

  4. ruby - 使用 C 扩展开发 ruby​​gem 时,如何使用 Rspec 在本地进行测试? - 2

    我正在编写一个包含C扩展的gem。通常当我写一个gem时,我会遵循TDD的过程,我会写一个失败的规范,然后处理代码直到它通过,等等......在“ext/mygem/mygem.c”中我的C扩展和在gemspec的“扩展”中配置的有效extconf.rb,如何运行我的规范并仍然加载我的C扩展?当我更改C代码时,我需要采取哪些步骤来重新编译代码?这可能是个愚蠢的问题,但是从我的gem的开发源代码树中输入“bundleinstall”不会构建任何native扩展。当我手动运行rubyext/mygem/extconf.rb时,我确实得到了一个Makefile(在整个项目的根目录中),然后当

  5. ruby-on-rails - 如何在 ruby​​ 中使用两个参数异步运行 exe? - 2

    exe应该在我打开页面时运行。异步进程需要运行。有什么方法可以在ruby​​中使用两个参数异步运行exe吗?我已经尝试过ruby​​命令-system()、exec()但它正在等待过程完成。我需要用参数启动exe,无需等待进程完成是否有任何ruby​​gems会支持我的问题? 最佳答案 您可以使用Process.spawn和Process.wait2:pid=Process.spawn'your.exe','--option'#Later...pid,status=Process.wait2pid您的程序将作为解释器的子进程执行。除

  6. ruby - 无法运行 Rails 2.x 应用程序 - 2

    我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby​​:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r

  7. ruby - Ruby 的 Hash 在比较键时使用哪种相等性测试? - 2

    我有一个围绕一些对象的包装类,我想将这些对象用作散列中的键。包装对象和解包装对象应映射到相同的键。一个简单的例子是这样的:classAattr_reader:xdefinitialize(inner)@inner=innerenddefx;@inner.x;enddef==(other)@inner.x==other.xendenda=A.new(o)#oisjustanyobjectthatallowso.xb=A.new(o)h={a=>5}ph[a]#5ph[b]#nil,shouldbe5ph[o]#nil,shouldbe5我试过==、===、eq?并散列所有无济于事。

  8. ruby - RSpec - 使用测试替身作为 block 参数 - 2

    我有一些Ruby代码,如下所示:Something.createdo|x|x.foo=barend我想编写一个测试,它使用double代替block参数x,这样我就可以调用:x_double.should_receive(:foo).with("whatever").这可能吗? 最佳答案 specify'something'dox=doublex.should_receive(:foo=).with("whatever")Something.should_receive(:create).and_yield(x)#callthere

  9. ruby - Sinatra:运行 rspec 测试时记录噪音 - 2

    Sinatra新手;我正在运行一些rspec测试,但在日志中收到了一堆不需要的噪音。如何消除日志中过多的噪音?我仔细检查了环境是否设置为:test,这意味着记录器级别应设置为WARN而不是DEBUG。spec_helper:require"./app"require"sinatra"require"rspec"require"rack/test"require"database_cleaner"require"factory_girl"set:environment,:testFactoryGirl.definition_file_paths=%w{./factories./test/

  10. java - 等价于 Java 中的 Ruby Hash - 2

    我真的很习惯使用Ruby编写以下代码:my_hash={}my_hash['test']=1Java中对应的数据结构是什么? 最佳答案 HashMapmap=newHashMap();map.put("test",1);我假设? 关于java-等价于Java中的RubyHash,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/22737685/

随机推荐