Yang Zhang wrote:
> For some reason, Maven is pulling in classes from the jar of a
> dependency and putting them into my target/test-classes/ directory,
> causing mvn test to fail (since extra Test* classes from that package
> are getting picked up).  Why are these classes being copied?  Thanks in
> advance for any answers.
> 
> $ find . -name 'TestableZooKeeper.java'
> $ find . -name 'TestableZooKeeper.class'
> ./target/test-classes/org/apache/zookeeper/TestableZooKeeper.class
> $ fgrep -B2 -A3 zookeeper-test pom.xml
>     <dependency>
>       <groupId>org.apache.zookeeper</groupId>
>       <artifactId>zookeeper-test</artifactId>
>       <version>3.2.0</version>
>       <scope>compile</scope>
>     </dependency>
> $ jar tf
> ~/.m2/repository/org/apache/zookeeper/zookeeper-test/3.2.0/zookeeper-test-3.2.0.jar
> | fgrep TestableZooKeeper
> org/apache/zookeeper/TestableZooKeeper$1.class
> org/apache/zookeeper/TestableZooKeeper.class
> org/apache/zookeeper/TestableZooKeeper.java
> $ mvn -version
> Apache Maven 2.1.0 (r755702; 2009-03-18 12:10:27-0700)
> Java version: 1.6.0_03
> Java home: /usr/java/jdk1.6.0_03/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux" version: "2.6.9-34.elsmp" arch: "i386" Family: "unix"


This is some as yet unexplained misfeature with the compiler plugin
and/or underlying javac, wherein it compiles .java source found in
dependency jars - sometimes.

Max.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to