You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Yang Zhang <ya...@gmail.com> on 2009/07/13 21:27:53 UTC

Unexpected copying of classes from dependencies

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"

-- 
Yang Zhang
http://www.mit.edu/~y_z/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unexpected copying of classes from dependencies

Posted by Anders Hammar <an...@hammar.net>.
Ok. Maybe there is something in your parent pom? Are other test
classes copied as well, or just this?

This is what I would try: remove all plugin confguration, so that
you're running defaultMaven plugin mappings. Try to get something
running, and then add the extra stuff.

/Anders

On Tue, Jul 14, 2009 at 00:14, Yang Zhang<ya...@gmail.com> wrote:
> Also tried removing that entire plugin - same results.
>
> Yang Zhang wrote:
>>
>> I just tried this out (removed that line), to no avail.
>>
>> Anders Hammar wrote:
>>>
>>> I suspect the use of descriptor ref jar-with-dependencies of
>>> maven-assembly-plugin. Try removing that one an see what happens.
>>>
>>> /Anders
>>>
>>> On Mon, Jul 13, 2009 at 23:51, Yang Zhang<ya...@gmail.com> wrote:
>>>>
>>>> pom.xml is attached.  I ran with -X but I wasn't sure what I'm looking
>>>> for -
>>>> it didn't seem to trace anything about specific class files being
>>>> produced.
>>>>
>>>>
>>>> Anders Hammar wrote:
>>>>>
>>>>> Ok, I was thinking that maybe your were using some IDE that interfered
>>>>> (i.e. copied the classes).
>>>>>
>>>>> Posting your pom.xml is probably necessary to figure this one out. You
>>>>> should also execute Maven in debug mode (mvn -X test) and do a grep on
>>>>> the output for test class. If nothing found, I would go through it
>>>>> manually step by step and try to find anything that would suggest this
>>>>> happening.
>>>>>
>>>>> /Anders
>>>>>
>>>>> On Mon, Jul 13, 2009 at 23:23, Yang Zhang<ya...@gmail.com>
>>>>> wrote:
>>>>>>
>>>>>> I had tried cleaning already; I get the same thing.
>>>>>>
>>>>>> Anders Hammar wrote:
>>>>>>>
>>>>>>> What happens if you execute
>>>>>>> $ mvn clean test
>>>>>>>
>>>>>>> /Anders
>>>>>>>
>>>>>>> On Mon, Jul 13, 2009 at 21:27, Yang Zhang<ya...@gmail.com>
>>>>>>> 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"
>>>>>>>>
>>>>>>>> --
>>>>>>>> Yang Zhang
>>>>>>>> http://www.mit.edu/~y_z/
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>
>>>>>> --
>>>>>> Yang Zhang
>>>>>> http://www.mit.edu/~y_z/
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>
>>>> --
>>>> Yang Zhang
>>>> http://www.mit.edu/~y_z/
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>
>>
>
>
> --
> Yang Zhang
> http://www.mit.edu/~y_z/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unexpected copying of classes from dependencies

Posted by Yang Zhang <ya...@gmail.com>.
Also tried removing that entire plugin - same results.

Yang Zhang wrote:
> I just tried this out (removed that line), to no avail.
> 
> Anders Hammar wrote:
>> I suspect the use of descriptor ref jar-with-dependencies of
>> maven-assembly-plugin. Try removing that one an see what happens.
>>
>> /Anders
>>
>> On Mon, Jul 13, 2009 at 23:51, Yang Zhang<ya...@gmail.com> wrote:
>>> pom.xml is attached.  I ran with -X but I wasn't sure what I'm 
>>> looking for -
>>> it didn't seem to trace anything about specific class files being 
>>> produced.
>>>
>>>
>>> Anders Hammar wrote:
>>>> Ok, I was thinking that maybe your were using some IDE that interfered
>>>> (i.e. copied the classes).
>>>>
>>>> Posting your pom.xml is probably necessary to figure this one out. You
>>>> should also execute Maven in debug mode (mvn -X test) and do a grep on
>>>> the output for test class. If nothing found, I would go through it
>>>> manually step by step and try to find anything that would suggest this
>>>> happening.
>>>>
>>>> /Anders
>>>>
>>>> On Mon, Jul 13, 2009 at 23:23, Yang Zhang<ya...@gmail.com> 
>>>> wrote:
>>>>> I had tried cleaning already; I get the same thing.
>>>>>
>>>>> Anders Hammar wrote:
>>>>>> What happens if you execute
>>>>>> $ mvn clean test
>>>>>>
>>>>>> /Anders
>>>>>>
>>>>>> On Mon, Jul 13, 2009 at 21:27, Yang Zhang<ya...@gmail.com> 
>>>>>> 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"
>>>>>>>
>>>>>>> -- 
>>>>>>> Yang Zhang
>>>>>>> http://www.mit.edu/~y_z/
>>>>>>>
>>>>>>> --------------------------------------------------------------------- 
>>>>>>>
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>
>>>>> -- 
>>>>> Yang Zhang
>>>>> http://www.mit.edu/~y_z/
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>
>>> -- 
>>> Yang Zhang
>>> http://www.mit.edu/~y_z/
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
> 
> 


-- 
Yang Zhang
http://www.mit.edu/~y_z/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unexpected copying of classes from dependencies

Posted by Yang Zhang <ya...@gmail.com>.
I just tried this out (removed that line), to no avail.

Anders Hammar wrote:
> I suspect the use of descriptor ref jar-with-dependencies of
> maven-assembly-plugin. Try removing that one an see what happens.
> 
> /Anders
> 
> On Mon, Jul 13, 2009 at 23:51, Yang Zhang<ya...@gmail.com> wrote:
>> pom.xml is attached.  I ran with -X but I wasn't sure what I'm looking for -
>> it didn't seem to trace anything about specific class files being produced.
>>
>>
>> Anders Hammar wrote:
>>> Ok, I was thinking that maybe your were using some IDE that interfered
>>> (i.e. copied the classes).
>>>
>>> Posting your pom.xml is probably necessary to figure this one out. You
>>> should also execute Maven in debug mode (mvn -X test) and do a grep on
>>> the output for test class. If nothing found, I would go through it
>>> manually step by step and try to find anything that would suggest this
>>> happening.
>>>
>>> /Anders
>>>
>>> On Mon, Jul 13, 2009 at 23:23, Yang Zhang<ya...@gmail.com> wrote:
>>>> I had tried cleaning already; I get the same thing.
>>>>
>>>> Anders Hammar wrote:
>>>>> What happens if you execute
>>>>> $ mvn clean test
>>>>>
>>>>> /Anders
>>>>>
>>>>> On Mon, Jul 13, 2009 at 21:27, Yang Zhang<ya...@gmail.com> 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"
>>>>>>
>>>>>> --
>>>>>> Yang Zhang
>>>>>> http://www.mit.edu/~y_z/
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>> --
>>>> Yang Zhang
>>>> http://www.mit.edu/~y_z/
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>
>> --
>> Yang Zhang
>> http://www.mit.edu/~y_z/
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


-- 
Yang Zhang
http://www.mit.edu/~y_z/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unexpected copying of classes from dependencies

Posted by Anders Hammar <an...@hammar.net>.
I suspect the use of descriptor ref jar-with-dependencies of
maven-assembly-plugin. Try removing that one an see what happens.

/Anders

On Mon, Jul 13, 2009 at 23:51, Yang Zhang<ya...@gmail.com> wrote:
> pom.xml is attached.  I ran with -X but I wasn't sure what I'm looking for -
> it didn't seem to trace anything about specific class files being produced.
>
>
> Anders Hammar wrote:
>>
>> Ok, I was thinking that maybe your were using some IDE that interfered
>> (i.e. copied the classes).
>>
>> Posting your pom.xml is probably necessary to figure this one out. You
>> should also execute Maven in debug mode (mvn -X test) and do a grep on
>> the output for test class. If nothing found, I would go through it
>> manually step by step and try to find anything that would suggest this
>> happening.
>>
>> /Anders
>>
>> On Mon, Jul 13, 2009 at 23:23, Yang Zhang<ya...@gmail.com> wrote:
>>>
>>> I had tried cleaning already; I get the same thing.
>>>
>>> Anders Hammar wrote:
>>>>
>>>> What happens if you execute
>>>> $ mvn clean test
>>>>
>>>> /Anders
>>>>
>>>> On Mon, Jul 13, 2009 at 21:27, Yang Zhang<ya...@gmail.com> 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"
>>>>>
>>>>> --
>>>>> Yang Zhang
>>>>> http://www.mit.edu/~y_z/
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>
>>> --
>>> Yang Zhang
>>> http://www.mit.edu/~y_z/
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
>
> --
> Yang Zhang
> http://www.mit.edu/~y_z/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unexpected copying of classes from dependencies

Posted by Yang Zhang <ya...@gmail.com>.
pom.xml is attached.  I ran with -X but I wasn't sure what I'm looking 
for - it didn't seem to trace anything about specific class files being 
produced.


Anders Hammar wrote:
> Ok, I was thinking that maybe your were using some IDE that interfered
> (i.e. copied the classes).
> 
> Posting your pom.xml is probably necessary to figure this one out. You
> should also execute Maven in debug mode (mvn -X test) and do a grep on
> the output for test class. If nothing found, I would go through it
> manually step by step and try to find anything that would suggest this
> happening.
> 
> /Anders
> 
> On Mon, Jul 13, 2009 at 23:23, Yang Zhang<ya...@gmail.com> wrote:
>> I had tried cleaning already; I get the same thing.
>>
>> Anders Hammar wrote:
>>> What happens if you execute
>>> $ mvn clean test
>>>
>>> /Anders
>>>
>>> On Mon, Jul 13, 2009 at 21:27, Yang Zhang<ya...@gmail.com> 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"
>>>>
>>>> --
>>>> Yang Zhang
>>>> http://www.mit.edu/~y_z/
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>
>> --
>> Yang Zhang
>> http://www.mit.edu/~y_z/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


-- 
Yang Zhang
http://www.mit.edu/~y_z/

Re: Unexpected copying of classes from dependencies

Posted by Anders Hammar <an...@hammar.net>.
Ok, I was thinking that maybe your were using some IDE that interfered
(i.e. copied the classes).

Posting your pom.xml is probably necessary to figure this one out. You
should also execute Maven in debug mode (mvn -X test) and do a grep on
the output for test class. If nothing found, I would go through it
manually step by step and try to find anything that would suggest this
happening.

/Anders

On Mon, Jul 13, 2009 at 23:23, Yang Zhang<ya...@gmail.com> wrote:
> I had tried cleaning already; I get the same thing.
>
> Anders Hammar wrote:
>>
>> What happens if you execute
>> $ mvn clean test
>>
>> /Anders
>>
>> On Mon, Jul 13, 2009 at 21:27, Yang Zhang<ya...@gmail.com> 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"
>>>
>>> --
>>> Yang Zhang
>>> http://www.mit.edu/~y_z/
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
>
> --
> Yang Zhang
> http://www.mit.edu/~y_z/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unexpected copying of classes from dependencies

Posted by Yang Zhang <ya...@gmail.com>.
I had tried cleaning already; I get the same thing.

Anders Hammar wrote:
> What happens if you execute
> $ mvn clean test
> 
> /Anders
> 
> On Mon, Jul 13, 2009 at 21:27, Yang Zhang<ya...@gmail.com> 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"
>>
>> --
>> Yang Zhang
>> http://www.mit.edu/~y_z/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


-- 
Yang Zhang
http://www.mit.edu/~y_z/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unexpected copying of classes from dependencies

Posted by Anders Hammar <an...@hammar.net>.
What happens if you execute
$ mvn clean test

/Anders

On Mon, Jul 13, 2009 at 21:27, Yang Zhang<ya...@gmail.com> 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"
>
> --
> Yang Zhang
> http://www.mit.edu/~y_z/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unexpected copying of classes from dependencies

Posted by Wayne Fay <wa...@gmail.com>.
> 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.

This is a bug in javac -- not the compiler plugin. This has popped up
on the list previously once or twice before.

File a bug with Sun, or find the one that has already been filed (I
assume it has been by now).

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unexpected copying of classes from dependencies

Posted by Yang Zhang <ya...@gmail.com>.
Max Bowsher wrote:
> 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.

Yeah, I was just about to follow up on this issue with a note that this 
is actually only happening on one machine, and not another, so it might 
not be due directly to my pom.xml.  Is there an open bug for this that I 
should subscribe to?
-- 
Yang Zhang
http://www.mit.edu/~y_z/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unexpected copying of classes from dependencies

Posted by Max Bowsher <ma...@f2s.com>.
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org