You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Thinkboy <ma...@gmail.com> on 2007/04/04 08:02:30 UTC

ver number conflict in transitive dependency

hi,

my servlet-api version is conflict due to transitive dep

e.g.

i)  commons-logging-1.0.3.jar  -> servlet-api-2.2.jar
ii) jetty-6.1.1.jar -> servlet-api-2.2.jar


after I packaged all to /lib directory, in which both 
servlet-api-2.2.jar and servlet-api-2.2.jar are located.
 when I try to run application which is built with Jetty. it throws 
Exception bcos, jetty app loaded servlet-api-2.2.jar API instead of 
servlet-api-2.2.jar

my question: what is the correct way to handle ver conflict?
1) possible to exclue this servlet-api-2.2.jar in dependency-maven-plugin ?
2) or the worse case, a maven plugin that I can specify in pom.xml  to 
remove jar  in /lib ?

I am using depency-maven-plugin to generate a set of  all necessary jar in /lib
<!-- PLUGIN: dependency, copy all depended jars to lib -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>dependency-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<phase>package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>
								${project.build.directory}/lib
							</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>

pls advise
~manchi



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


Re: ver number conflict in transitive dependency

Posted by Maria Odea Ching <oc...@exist.com>.
Hi,

You can use the dependency <exclusions> tag in your pom to explicitly 
exclude the
specific jar you don't want to be downloaded.

See 
http://maven.apache.org/ref/current/maven-model/maven.html#class_dependency 
for
more info about it.

This might also be useful 
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

Thanks,
Deng

Thinkboy wrote:
> hi,
>
> my servlet-api version is conflict due to transitive dep
>
> e.g.
>
> i)  commons-logging-1.0.3.jar  -> servlet-api-2.2.jar
> ii) jetty-6.1.1.jar -> servlet-api-2.2.jar
>
>
> after I packaged all to /lib directory, in which both 
> servlet-api-2.2.jar and servlet-api-2.2.jar are located.
> when I try to run application which is built with Jetty. it throws 
> Exception bcos, jetty app loaded servlet-api-2.2.jar API instead of 
> servlet-api-2.2.jar
>
> my question: what is the correct way to handle ver conflict?
> 1) possible to exclue this servlet-api-2.2.jar in 
> dependency-maven-plugin ?
> 2) or the worse case, a maven plugin that I can specify in pom.xml  to 
> remove jar  in /lib ?
>
> I am using depency-maven-plugin to generate a set of  all necessary 
> jar in /lib
> <!-- PLUGIN: dependency, copy all depended jars to lib -->
>             <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>dependency-maven-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <id>copy-dependencies</id>
>                         <phase>package</phase>
>                         <goals>
>                             <goal>copy-dependencies</goal>
>                         </goals>
>                         <configuration>
>                             <outputDirectory>
>                                 ${project.build.directory}/lib
>                             </outputDirectory>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
>
> pls advise
> ~manchi
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> !DSPAM:602,46133fa1153191147216240!
>


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


Re: ver number conflict in transitive dependency

Posted by franz see <fr...@gmail.com>.
Good day,

There seems to be a typo in your message :) It seems to me you're saying
that you have servlet-2.2.jar in WEB-INF/lib...I am not sure how that is
possible ( one should have overwritten the other ).

What are those two binaries you were referring to?

Cheers,
Franz


thinkboy wrote:
> 
> hi,
> 
> my servlet-api version is conflict due to transitive dep
> 
> e.g.
> 
> i)  commons-logging-1.0.3.jar  -> servlet-api-2.2.jar
> ii) jetty-6.1.1.jar -> servlet-api-2.2.jar
> 
> 
> after I packaged all to /lib directory, in which both 
> servlet-api-2.2.jar and servlet-api-2.2.jar are located.
>  when I try to run application which is built with Jetty. it throws 
> Exception bcos, jetty app loaded servlet-api-2.2.jar API instead of 
> servlet-api-2.2.jar
> 
> my question: what is the correct way to handle ver conflict?
> 1) possible to exclue this servlet-api-2.2.jar in dependency-maven-plugin
> ?
> 2) or the worse case, a maven plugin that I can specify in pom.xml  to 
> remove jar  in /lib ?
> 
> I am using depency-maven-plugin to generate a set of  all necessary jar in
> /lib
> <!-- PLUGIN: dependency, copy all depended jars to lib -->
> 			<plugin>
> 				<groupId>org.codehaus.mojo</groupId>
> 				<artifactId>dependency-maven-plugin</artifactId>
> 				<executions>
> 					<execution>
> 						<id>copy-dependencies</id>
> 						<phase>package</phase>
> 						<goals>
> 							<goal>copy-dependencies</goal>
> 						</goals>
> 						<configuration>
> 							<outputDirectory>
> 								${project.build.directory}/lib
> 							</outputDirectory>
> 						</configuration>
> 					</execution>
> 				</executions>
> 			</plugin>
> 
> pls advise
> ~manchi
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ver-number-conflict-in-transitive-dependency-tf3524067s177.html#a9832410
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: ver number conflict in transitive dependency

Posted by Maria Odea Ching <oc...@exist.com>.
I agree with the "provided" scope.
I think its in the dependency-mechanism link I sent earlier.

- Deng

Jerome Lacoste wrote:
> On 4/4/07, Thinkboy <ma...@gmail.com> wrote:
>> hi,
>>
>> my servlet-api version is conflict due to transitive dep
>>
>> e.g.
>>
>> i)  commons-logging-1.0.3.jar  -> servlet-api-2.2.jar
>> ii) jetty-6.1.1.jar -> servlet-api-2.2.jar
>
> same version in both cases ?
> Commons-logging depends on servlet-api ?
>
>> after I packaged all to /lib directory, in which both
>> servlet-api-2.2.jar and servlet-api-2.2.jar are located.
>>  when I try to run application which is built with Jetty. it throws
>> Exception bcos, jetty app loaded servlet-api-2.2.jar API instead of
>> servlet-api-2.2.jar
>
> You mean you deployed your application under the jetty lib directory ?
> Don't do that, use a war file.
>
> Or you put the servlet API jars inside WEB-INF/lib ? What about using
> <scope>provided</scope> ?
>
> Jerome
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> !DSPAM:602,46136089297121685850248!
>


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


Re: ver number conflict in transitive dependency

Posted by Jerome Lacoste <je...@gmail.com>.
On 4/4/07, Thinkboy <ma...@gmail.com> wrote:
> hi,
>
> my servlet-api version is conflict due to transitive dep
>
> e.g.
>
> i)  commons-logging-1.0.3.jar  -> servlet-api-2.2.jar
> ii) jetty-6.1.1.jar -> servlet-api-2.2.jar

same version in both cases ?
Commons-logging depends on servlet-api ?

> after I packaged all to /lib directory, in which both
> servlet-api-2.2.jar and servlet-api-2.2.jar are located.
>  when I try to run application which is built with Jetty. it throws
> Exception bcos, jetty app loaded servlet-api-2.2.jar API instead of
> servlet-api-2.2.jar

You mean you deployed your application under the jetty lib directory ?
Don't do that, use a war file.

Or you put the servlet API jars inside WEB-INF/lib ? What about using
<scope>provided</scope> ?

Jerome

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


RE: ver number conflict in transitive dependency

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
You probably should look into using maven-dependency-plugin now, since
the old dependency-maven-plugin moved over to apache and has lost of new
features, but also supports everything in the old 1.0.

-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Thinkboy
Sent: Wednesday, April 04, 2007 2:03 AM
To: users@maven.apache.org
Subject: ver number conflict in transitive dependency

hi,

my servlet-api version is conflict due to transitive dep

e.g.

i)  commons-logging-1.0.3.jar  -> servlet-api-2.2.jar
ii) jetty-6.1.1.jar -> servlet-api-2.2.jar


after I packaged all to /lib directory, in which both 
servlet-api-2.2.jar and servlet-api-2.2.jar are located.
 when I try to run application which is built with Jetty. it throws 
Exception bcos, jetty app loaded servlet-api-2.2.jar API instead of 
servlet-api-2.2.jar

my question: what is the correct way to handle ver conflict?
1) possible to exclue this servlet-api-2.2.jar in
dependency-maven-plugin ?
2) or the worse case, a maven plugin that I can specify in pom.xml  to 
remove jar  in /lib ?

I am using depency-maven-plugin to generate a set of  all necessary jar
in /lib
<!-- PLUGIN: dependency, copy all depended jars to lib -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
	
<artifactId>dependency-maven-plugin</artifactId>
				<executions>
					<execution>
	
<id>copy-dependencies</id>
						<phase>package</phase>
						<goals>
	
<goal>copy-dependencies</goal>
						</goals>
						<configuration>
	
<outputDirectory>
	
${project.build.directory}/lib
	
</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>

pls advise
~manchi



---------------------------------------------------------------------
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