You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Holt, Jack C." <JA...@saic.com> on 2008/01/24 19:03:22 UTC

Conditionally including a jar file

I would like to not include the jar file for log4j when producing a WAR
file but allow it to be used when running my web app in Jetty.

You see, JBoss includes a jar for log4j (a different version than I have
set up a dependency for in my POM file) and it causes errors when the
WAR file is deployed in JBoss.  I have been manually removing the log4j
file after the WAR file is generated.

I have the following dependency in my POM file which I believe is the
reason the log4j jar file is showing:

<dependency>
	<groupId>commons-logging</groupId>
	<artifactId>commons-logging</artifactId>
	<version>1.1</version>
</dependency>

Do I need to somehow configure this as a dependency of the Jetty plugin
and remove it as a dependency of the project?

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


Re: Conditionally including a jar file

Posted by Dennis Lundberg <de...@apache.org>.
Hi Jack

Please upgrade your dependency on commons-logging to version 1.1.1. The 
1.1 version has errors in its dependencies, pulling in more than is 
actually needed. This was fixed in 1.1.1.

Holt, Jack C. wrote:
> I would like to not include the jar file for log4j when producing a WAR
> file but allow it to be used when running my web app in Jetty.
> 
> You see, JBoss includes a jar for log4j (a different version than I have
> set up a dependency for in my POM file) and it causes errors when the
> WAR file is deployed in JBoss.  I have been manually removing the log4j
> file after the WAR file is generated.
> 
> I have the following dependency in my POM file which I believe is the
> reason the log4j jar file is showing:
> 
> <dependency>
> 	<groupId>commons-logging</groupId>
> 	<artifactId>commons-logging</artifactId>
> 	<version>1.1</version>
> </dependency>
> 
> Do I need to somehow configure this as a dependency of the Jetty plugin
> and remove it as a dependency of the project?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


-- 
Dennis Lundberg

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


Re: Conditionally including a jar file

Posted by Wayne Fay <wa...@gmail.com>.
Commons-logging is a completely different artifact from log4j. But
there is a possibility that c-l is pulling in log4j as a transitive
dependency.

Try adding <scope>provided</scope> to the c-l dep, see what happens,
and report back.

Wayne

On 1/24/08, Holt, Jack C. <JA...@saic.com> wrote:
>
> I would like to not include the jar file for log4j when producing a WAR
> file but allow it to be used when running my web app in Jetty.
>
> You see, JBoss includes a jar for log4j (a different version than I have
> set up a dependency for in my POM file) and it causes errors when the
> WAR file is deployed in JBoss.  I have been manually removing the log4j
> file after the WAR file is generated.
>
> I have the following dependency in my POM file which I believe is the
> reason the log4j jar file is showing:
>
> <dependency>
> 	<groupId>commons-logging</groupId>
> 	<artifactId>commons-logging</artifactId>
> 	<version>1.1</version>
> </dependency>
>
> Do I need to somehow configure this as a dependency of the Jetty plugin
> and remove it as a dependency of the project?
>
> ---------------------------------------------------------------------
> 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