You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by AVSUNIL <su...@infosys.com> on 2010/05/12 14:16:05 UTC

Maven is downloading older version of junit

Hi,

In one of project application, I was using junit 3.8.1. Now I want to move
to junit 4.8.1. I have changed the pom dependancy for downloading junit
4.8.1 and it is working fine. But I am noticing that junit 3.8.1 is still
being downloaded by Maven through nexus repository. How do I avoid
downloading junit 3.8.1?

When I did “mvn –X clean”, it showed me the junit 3.8.1 is getting
downloaded may be because it is present as a dependency in the artifact
buildnumber-maven-plugin which is under group org.codehaus.mojo. To try
avoiding this, I went and changed pom of that artifcats and version found in 
/org/apache/maven//maven-xxx.pom

But it is still downloading 3.8.1 when I do mvn clean. Here is the pom:

            
                org.codehaus.mojo            
                buildnumber-maven-plugin                                       
                1.0-beta-3            
                                
                                                    
                                                validate                    
                                                                        
                                                                create                    
                                                                
                                            
                            
                                
                                false                
                                false            
                           
           
                
                org.apache.maven.plugins                                              
                maven-compiler-plugin                               
                                    
                                1.5                    
                                1.5                
                            
            
                
                org.apache.maven.plugins                                              
                maven-surefire-plugin                                 
                2.5                                                           
                                                    
                                                        
                                                test                        
                                                test                        
                                                                            
                                                        test                                                           
                                                                    
                                                                                                    
            


        
            
junit            
junit            
4.8.1           
 test        

---

Thanks
Sunil
        

-- 
View this message in context: http://old.nabble.com/Maven-is-downloading-older-version-of-junit-tp28535146p28535146.html
Sent from the Maven Developers mailing list archive at Nabble.com.

Re: Maven is downloading older version of junit

Posted by AVSUNIL <su...@infosys.com>.
POM reposted:
<plugin>             
	<groupId>org.codehaus.mojo</groupId>             
	<artifactId>buildnumber-maven-plugin</artifactId>             
<version>1.0-beta-3</version>             
	<executions>                 
		<execution>                     
			<phase>validate</phase>                     
			<goals>                         
				<goal>create</goal>                     
			</goals>                 
		</execution>             
	</executions>             
	<configuration>                 
		<doCheck>false</doCheck>                 
		<doUpdate>false</doUpdate>             
	</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.5</version>                                                                         
<executions>                                     
		<execution>                         
			<id>test</id>                         
			<phase>test</phase>                         
			<goals>                             
				<goal>test</goal>                                                     		
</goals>                     
		</execution>                                     	</executions>             
</plugin> 

<dependency>
<groupid>junit</groupid>
<artifact>junit</artifact>
<version>4.8.1</version>
</dependency>
-- 
View this message in context: http://old.nabble.com/Maven-is-downloading-older-version-of-junit-tp28535146p28544395.html
Sent from the Maven Developers mailing list archive at Nabble.com.


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


Re: Maven is downloading older version of junit

Posted by AVSUNIL <su...@infosys.com>.
I checked that junit 4.8.1 jar is proper and is downloaded from my
remote/server repository to my proxy/local repository. It is present in
storage location of nexus file system. I have Java 1.5 on my system. I have
set junit 4.8.1 in my build classpath. Still it is giving compilation issues
as it is not recognizing annotations of junit 4.x. 

When I see in local/proxy repository, it still has junit 3.8.1 as well as
junit 4.8.1. I think from below dependancy tree junit 3.x is downloaded as
some of maven plugins have it as dependnacy while junit 4.x is downloaded as
I have mentioned it as dependency in my project pom. That could have been
fine, but why is it not compiling. Here is pom, dependnacy tree as well as
compilation debugging messages:


mvn dependency:tree gives only this result (I have removed others unrelated
to junit). This seems to be correct


[INFO] com.mycompany:myproject:jar:1.0.0

[INFO] +- junit:junit:jar:4.8.1:test


mvn compile provides this result when in debug mode:


[INFO] Scanning for projects...

[DEBUG] Retrieving parent-POM: org.codehaus.mojo:mojo-parent:pom:20 for
project: org.codehaus.mojo:buildnumber-maven-plugin:maven-plugin:1.0-beta-3
from the repository.

[DEBUG] Adding managed dependencies for
org.codehaus.mojo:buildnumber-maven-plugin

[DEBUG]   org.apache.maven:maven-plugin-api:jar:2.0

[DEBUG]   junit:junit:jar:3.8.2:test


[DEBUG] Retrieving parent-POM: org.codehaus.plexus:plexus:pom:1.0.4 for
project: org.codehaus.plexus:plexus-containers:pom:1.0.3 from the
repository.

[DEBUG]      
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:runtime
(selected for runtime)

[DEBUG]         junit:junit:jar:3.8.1:runtime (applying version: 3.8.2)

[DEBUG]         junit:junit:jar:3.8.2:runtime (applying scope: test)


[DEBUG] Trying repository ist-mycompany-plugin-releases

[DEBUG] Using mirror:
http://localhost:8081/nexus/content/repositories/Myproject_Repos (id:
Myproject_Repos)

[DEBUG] Checking for pre-existing User-Agent configuration.

[DEBUG] Adding User-Agent configuration.

[DEBUG] Connecting to repository: 'Myproject_Repos' with url:
'http://localhost:8081/nexus/content/repositories/Myproject_Repos'.

Downloading:
http://localhost:8081/nexus/content/repositories/Myproject_Repos/junit/junit/3.8.2/junit-3.8.2.pom

[DEBUG]
http://localhost:8081/nexus/content/repositories/Myproject_Repos/junit/junit/3.8.2/junit-3.8.2.pom
- Status code: 200

[DEBUG] last-modified = Mon, 14 May 2007 21:34:53 GMT (1179178493000)

[DEBUG] attempting to create parent directories for destination:
junit-3.8.2.pom.tmp

747b downloaded  (junit-3.8.2.pom)

[DEBUG]   Artifact resolved

[DEBUG]         junit:junit:jar:3.8.2:test (selected for test)

[DEBUG]         org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime (removed
- nearer found: 1.4.1)

[DEBUG]         classworlds:classworlds:jar:1.1-alpha-2:runtime (selected
for runtime)



[DEBUG] Adding managed dependencies for unknown:wagon-provider-api

[DEBUG]   org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2

[DEBUG]   org.apache.maven.wagon:wagon-provider-test:jar:1.0-beta-2

[DEBUG]   org.apache.maven.wagon:wagon-ssh-common-test:jar:1.0-beta-2

[DEBUG]   org.apache.maven.wagon:wagon-ssh-common:jar:1.0-beta-2

[DEBUG]   junit:junit:jar:3.8.1

[DEBUG]   org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4

[DEBUG]   org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8

[DEBUG]   org.codehaus.plexus:plexus-utils:jar:1.0.4

[DEBUG]      
org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:runtime (selected
for runtime)

[DEBUG]         org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime (removed
- nearer found: 1.4.1)



DEBUG] Adding managed dependencies for
org.apache.maven:maven-plugin-registry

[DEBUG]   easymock:easymock:jar:1.2_Java1.3:test

[DEBUG]   classworlds:classworlds:jar:1.1

[DEBUG]     org.apache.maven:maven-plugin-registry:jar:2.0.6:runtime
(selected for runtime)

[DEBUG]     org.codehaus.plexus:plexus-utils:jar:1.4.1:runtime (selected for
runtime)

[DEBUG]     org.apache.maven:maven-artifact:jar:2.0.6:runtime (selected for
runtime)

[DEBUG]    
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:runtime
(selected for runtime)

[DEBUG]       junit:junit:jar:3.8.1:runtime (applying version: 3.8.2)

[DEBUG]       junit:junit:jar:3.8.2:runtime (applying scope: test)

[DEBUG]       junit:junit:jar:3.8.2:test (selected for test)

[DEBUG]       org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime (removed -
nearer found: 1.4.1)

[DEBUG]       classworlds:classworlds:jar:1.1-alpha-2:runtime (selected for
runtime)

[DEBUG]   org.apache.maven:maven-settings:jar:2.0.6:runtime (selected for
runtime)


[DEBUG] Retrieving parent-POM:
org.apache.maven.wagon:wagon-providers:pom:1.0-beta-2 for project:
null:wagon-file:jar:1.0-beta-2 from the repository.

[DEBUG] Adding managed dependencies for unknown:wagon-file

[DEBUG]   org.apache.maven.wagon:wagon-provider-test:jar:1.0-beta-2

[DEBUG]   junit:junit:jar:3.8.1


 POM br>
            
	org.codehaus.mojo
            
	buildnumber-maven-plugin
            	1.0-beta-3
            
	
                
		
                    
			validate
                    
			
                        
				create
                    
			
                
		
            
	
            
	
                
		false
                
		false
            
	
           
           
                
	org.apache.maven.plugins
                	maven-compiler-plugin
                	
                    
		1.5
                    
		1.5
                
	
            
            
                
	org.apache.maven.plugins
                	maven-surefire-plugin
                	2.5
                                                                        	
                                    
		
                        
			test
                        
			test
                        
			
                            
				test
                                                    			
                    
		
                                    	
            



-- 
View this message in context: http://old.nabble.com/Maven-is-downloading-older-version-of-junit-tp28535146p28544378.html
Sent from the Maven Developers mailing list archive at Nabble.com.

Re: Maven is downloading older version of junit

Posted by Jemos Infra <je...@googlemail.com>.
This will happen because Maven is compiling with a version < 1.5. Define
the java compiler plugin with source and target >= 1.5

Regards,

M.

On Wed, 2010-05-12 at 06:59 -0700, AVSUNIL wrote:
> Thanks Kalpak for response. The issue is that compilation fails when I try to
> use anything specific to junit 4.8 in my junit test classes. Here is what is
> happening:
> 
> > When I see the nexus proxy (or local) repository, after I do mvn clean and
> > mvn compile, it is downloading 3.8.1, 3.8.2 and 4.8.1 versions from remote
> > repository
> 
> > I can see these 3 versions in website of my local/procy repository as well
> > in filesystem in //nexus/storage/MyRepository_dir
> 
> > mvn compile fails saying junit annotations is not recognized. I am
> > assuming this is happening as it is not there in junit 3.8 version
> 
> 
> Thanks
> Sunil
> 
> -------------------------------------------------------------------------
> 
> 
> Kalpak Gadre wrote:
> > 
> > Hi Sunil,
> > 
> > Firstly, this is not the right list to post this questions. This 
> > question belongs to Maven Users List 
> > 
> > I don't think plugin dependencies will interfere with your project 
> > dependencies? Is there any side effect of junit 3.8.1 being downloaded 
> > on your packaging?
> > 
> > You can anyway try dependency:tree and make sure that none of your 
> > project dependencies are downloading it. I don't think plugin 
> > downloading a Junit dependency is any problem?
> > 
> > Thanks,
> > 
> > Kalpak
> > 
> >> Hi,
> >>
> >> In one of project application, I was using junit 3.8.1. Now I want to
> >> move
> >> to junit 4.8.1. I have changed the pom dependancy for downloading junit
> >> 4.8.1 and it is working fine. But I am noticing that junit 3.8.1 is still
> >> being downloaded by Maven through nexus repository. How do I avoid
> >> downloading junit 3.8.1?
> >>
> >> When I did “mvn –X clean”, it showed me the junit 3.8.1 is getting
> >> downloaded may be because it is present as a dependency in the artifact
> >> buildnumber-maven-plugin which is under group org.codehaus.mojo. To try
> >> avoiding this, I went and changed pom of that artifcats and version found
> >> in
> >> /org/apache/maven//maven-xxx.pom
> >>
> >> But it is still downloading 3.8.1 when I do mvn clean. Here is the pom:
> >>
> >>
> >>                  org.codehaus.mojo
> >>                  buildnumber-maven-plugin
> >>                  1.0-beta-3
> >>
> >>
> >>                                                  validate
> >>
> >>                                                                  create
> >>
> >>
> >>
> >>
> >>                                  false
> >>                                  false
> >>
> >>
> >>
> >>                  org.apache.maven.plugins
> >>                  maven-compiler-plugin
> >>
> >>                                  1.5
> >>                                  1.5
> >>
> >>
> >>
> >>                  org.apache.maven.plugins
> >>                  maven-surefire-plugin
> >>                  2.5
> >>
> >>
> >>                                                  test
> >>                                                  test
> >>
> >>                                                          test
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> junit
> >> junit
> >> 4.8.1
> >>   test
> >>
> >> ---
> >>
> >> Thanks
> >> Sunil
> >>
> >>
> >>    
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> > 
> > 
> > 
> 



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


Re: Maven is downloading older version of junit

Posted by Nick Stolwijk <ni...@gmail.com>.
Then 3.8.1 is still in your project dependencies. Try mvn
dependency:tree to see where it comes from.

With regards,

Nick Stolwijk
~Java Developer~

IPROFS BV.
Claus Sluterweg 125
2012 WS Haarlem
http://www.iprofs.nl



On Wed, May 12, 2010 at 3:59 PM, AVSUNIL <su...@infosys.com> wrote:
>
> Thanks Kalpak for response. The issue is that compilation fails when I try to
> use anything specific to junit 4.8 in my junit test classes. Here is what is
> happening:
>
>> When I see the nexus proxy (or local) repository, after I do mvn clean and
>> mvn compile, it is downloading 3.8.1, 3.8.2 and 4.8.1 versions from remote
>> repository
>
>> I can see these 3 versions in website of my local/procy repository as well
>> in filesystem in //nexus/storage/MyRepository_dir
>
>> mvn compile fails saying junit annotations is not recognized. I am
>> assuming this is happening as it is not there in junit 3.8 version
>
>
> Thanks
> Sunil
>
> -------------------------------------------------------------------------
>
>
> Kalpak Gadre wrote:
>>
>> Hi Sunil,
>>
>> Firstly, this is not the right list to post this questions. This
>> question belongs to Maven Users List
>>
>> I don't think plugin dependencies will interfere with your project
>> dependencies? Is there any side effect of junit 3.8.1 being downloaded
>> on your packaging?
>>
>> You can anyway try dependency:tree and make sure that none of your
>> project dependencies are downloading it. I don't think plugin
>> downloading a Junit dependency is any problem?
>>
>> Thanks,
>>
>> Kalpak
>>
>>> Hi,
>>>
>>> In one of project application, I was using junit 3.8.1. Now I want to
>>> move
>>> to junit 4.8.1. I have changed the pom dependancy for downloading junit
>>> 4.8.1 and it is working fine. But I am noticing that junit 3.8.1 is still
>>> being downloaded by Maven through nexus repository. How do I avoid
>>> downloading junit 3.8.1?
>>>
>>> When I did “mvn –X clean”, it showed me the junit 3.8.1 is getting
>>> downloaded may be because it is present as a dependency in the artifact
>>> buildnumber-maven-plugin which is under group org.codehaus.mojo. To try
>>> avoiding this, I went and changed pom of that artifcats and version found
>>> in
>>> /org/apache/maven//maven-xxx.pom
>>>
>>> But it is still downloading 3.8.1 when I do mvn clean. Here is the pom:
>>>
>>>
>>>                  org.codehaus.mojo
>>>                  buildnumber-maven-plugin
>>>                  1.0-beta-3
>>>
>>>
>>>                                                  validate
>>>
>>>                                                                  create
>>>
>>>
>>>
>>>
>>>                                  false
>>>                                  false
>>>
>>>
>>>
>>>                  org.apache.maven.plugins
>>>                  maven-compiler-plugin
>>>
>>>                                  1.5
>>>                                  1.5
>>>
>>>
>>>
>>>                  org.apache.maven.plugins
>>>                  maven-surefire-plugin
>>>                  2.5
>>>
>>>
>>>                                                  test
>>>                                                  test
>>>
>>>                                                          test
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> junit
>>> junit
>>> 4.8.1
>>>   test
>>>
>>> ---
>>>
>>> Thanks
>>> Sunil
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Maven-is-downloading-older-version-of-junit-tp28535146p28536325.html
> Sent from the Maven Developers mailing list archive at Nabble.com.
>

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


Re: Maven is downloading older version of junit

Posted by AVSUNIL <su...@infosys.com>.
Thanks Kalpak for response. The issue is that compilation fails when I try to
use anything specific to junit 4.8 in my junit test classes. Here is what is
happening:

> When I see the nexus proxy (or local) repository, after I do mvn clean and
> mvn compile, it is downloading 3.8.1, 3.8.2 and 4.8.1 versions from remote
> repository

> I can see these 3 versions in website of my local/procy repository as well
> in filesystem in //nexus/storage/MyRepository_dir

> mvn compile fails saying junit annotations is not recognized. I am
> assuming this is happening as it is not there in junit 3.8 version


Thanks
Sunil

-------------------------------------------------------------------------


Kalpak Gadre wrote:
> 
> Hi Sunil,
> 
> Firstly, this is not the right list to post this questions. This 
> question belongs to Maven Users List 
> 
> I don't think plugin dependencies will interfere with your project 
> dependencies? Is there any side effect of junit 3.8.1 being downloaded 
> on your packaging?
> 
> You can anyway try dependency:tree and make sure that none of your 
> project dependencies are downloading it. I don't think plugin 
> downloading a Junit dependency is any problem?
> 
> Thanks,
> 
> Kalpak
> 
>> Hi,
>>
>> In one of project application, I was using junit 3.8.1. Now I want to
>> move
>> to junit 4.8.1. I have changed the pom dependancy for downloading junit
>> 4.8.1 and it is working fine. But I am noticing that junit 3.8.1 is still
>> being downloaded by Maven through nexus repository. How do I avoid
>> downloading junit 3.8.1?
>>
>> When I did “mvn –X clean”, it showed me the junit 3.8.1 is getting
>> downloaded may be because it is present as a dependency in the artifact
>> buildnumber-maven-plugin which is under group org.codehaus.mojo. To try
>> avoiding this, I went and changed pom of that artifcats and version found
>> in
>> /org/apache/maven//maven-xxx.pom
>>
>> But it is still downloading 3.8.1 when I do mvn clean. Here is the pom:
>>
>>
>>                  org.codehaus.mojo
>>                  buildnumber-maven-plugin
>>                  1.0-beta-3
>>
>>
>>                                                  validate
>>
>>                                                                  create
>>
>>
>>
>>
>>                                  false
>>                                  false
>>
>>
>>
>>                  org.apache.maven.plugins
>>                  maven-compiler-plugin
>>
>>                                  1.5
>>                                  1.5
>>
>>
>>
>>                  org.apache.maven.plugins
>>                  maven-surefire-plugin
>>                  2.5
>>
>>
>>                                                  test
>>                                                  test
>>
>>                                                          test
>>
>>
>>
>>
>>
>>
>>
>> junit
>> junit
>> 4.8.1
>>   test
>>
>> ---
>>
>> Thanks
>> Sunil
>>
>>
>>    
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Maven-is-downloading-older-version-of-junit-tp28535146p28536325.html
Sent from the Maven Developers mailing list archive at Nabble.com.

Re: Maven is downloading older version of junit

Posted by Kalpak Gadre <ka...@gmail.com>.
Hi Sunil,

Firstly, this is not the right list to post this questions. This 
question belongs to Maven Users List <us...@maven.apache.org>

I don't think plugin dependencies will interfere with your project 
dependencies? Is there any side effect of junit 3.8.1 being downloaded 
on your packaging?

You can anyway try dependency:tree and make sure that none of your 
project dependencies are downloading it. I don't think plugin 
downloading a Junit dependency is any problem?

Thanks,

Kalpak

> Hi,
>
> In one of project application, I was using junit 3.8.1. Now I want to move
> to junit 4.8.1. I have changed the pom dependancy for downloading junit
> 4.8.1 and it is working fine. But I am noticing that junit 3.8.1 is still
> being downloaded by Maven through nexus repository. How do I avoid
> downloading junit 3.8.1?
>
> When I did “mvn –X clean”, it showed me the junit 3.8.1 is getting
> downloaded may be because it is present as a dependency in the artifact
> buildnumber-maven-plugin which is under group org.codehaus.mojo. To try
> avoiding this, I went and changed pom of that artifcats and version found in
> /org/apache/maven//maven-xxx.pom
>
> But it is still downloading 3.8.1 when I do mvn clean. Here is the pom:
>
>
>                  org.codehaus.mojo
>                  buildnumber-maven-plugin
>                  1.0-beta-3
>
>
>                                                  validate
>
>                                                                  create
>
>
>
>
>                                  false
>                                  false
>
>
>
>                  org.apache.maven.plugins
>                  maven-compiler-plugin
>
>                                  1.5
>                                  1.5
>
>
>
>                  org.apache.maven.plugins
>                  maven-surefire-plugin
>                  2.5
>
>
>                                                  test
>                                                  test
>
>                                                          test
>
>
>
>
>
>
>
> junit
> junit
> 4.8.1
>   test
>
> ---
>
> Thanks
> Sunil
>
>
>    


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


Re: Maven is downloading older version of junit

Posted by lukewpatterson <lu...@gmail.com>.
A couple of things to try:

Make sure you don't have the "bad" version of version 4.8.1
http://old.nabble.com/junit-4.8.1---org.junit-cannot-be-resolved-tt28385338.html#a28386276

Run tattletale to see where the junit classes are coming from, maybe you
have a duplicate from a repackaging coordinate:
http://insuchaworld.blogspot.com/2010/03/using-jboss-tattletale-tool-in-maven.html
-- 
View this message in context: http://old.nabble.com/Maven-is-downloading-older-version-of-junit-tp28535146p28536491.html
Sent from the Maven Developers mailing list archive at Nabble.com.


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