You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Allison, Bob" <ro...@qwest.com> on 2005/08/18 02:43:11 UTC

[m2] Transitive Dependency Question

I am working on a multi-project which looks like this:

Project log4jext is an extension for log4j for our environment.  Because
of the nature of extending log4j, I was unable to completely remove all
log4j classes from this project's API.  Its dependencies look like:
<dependencies>
  <dependency>
    <groupId>log4j</groupId> 
    <artifactId>log4j</artifactId> 
  </dependency>
</dependencies>

Project logging is a front-end for logging which has no reference to
log4j in its API (the intent is to be able to change to another logging
framework in the future and not have to change every bit of our code).
Its dependencies look like:
<dependencies>
  <dependency>
    <groupId>qaccess</groupId> 
    <artifactId>log4jext</artifactId> 
  </dependency>
</dependencies>

Project war is a servlet I am going to build which will use the logging
environment.  It should depend only on the logging project's artifact.

The top-level project has the following in its POM:
<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>qaccess</groupId> 
      <artifactId>log4jext</artifactId> 
      <version>3.0-SNAPSHOT</version> 
      <type>jar</type> 
      <scope>provided</scope> 
    </dependency>
    <dependency>
      <groupId>log4j</groupId> 
      <artifactId>log4j</artifactId> 
      <version>1.2.6</version> 
      <type>jar</type> 
      <scope>provided</scope> 
    </dependency>
  </dependencies>
</dependencyManagement>


Since there are going to be several servlets which use this logging
environment, I am going to place the log4j, log4jext, and logging jars
in the app server's system classpath so that they are available to all
servlets without requiring them to be packaged into the war file.

With things as they are configured now, the logging project compiles
successfully, even though it does not list a dependency for the required
log4j library (I assume that is because the compile-time scope is
inherited from the log4jext project).  When I try to build the JavaDocs,
though, I get a large number of errors since the log4j library is not
made available at that time.  What is the correct scope to make this
work (or do I need to explicitly state the dependency on log4j in the
logging project)?

Is this configured properly so that the log4j and log4jext jars won't
get packaged into the war file?

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


Re: [m2] Transitive Dependency Question

Posted by Brett Porter <br...@gmail.com>.
On 8/18/05, Allison, Bob <ro...@qwest.com> wrote:
> What is the correct scope to make this
> work (or do I need to explicitly state the dependency on log4j in the
> logging project)?

Sounds more like a bug in the javadoc plugin. Redeclaring will work as
a workaround, but please file a JIRA issue.

> 
> Is this configured properly so that the log4j and log4jext jars won't
> get packaged into the war file?

You'd need to redeclare the ext jar in the WAR's POM with scope
"provided". But also, you should read the docs on the log4j site about
why putting log4j into the container is a bad idea (and even better,
read the info Jason sent here).

Cheers,
Brett

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


Re: [m2] Transitive Dependency Question

Posted by Jason van Zyl <ja...@maven.org>.
On Wed, 2005-08-17 at 19:43 -0500, Allison, Bob wrote:
> I am working on a multi-project which looks like this:
> 
> Project log4jext is an extension for log4j for our environment.  Because
> of the nature of extending log4j, I was unable to completely remove all
> log4j classes from this project's API.  Its dependencies look like:
> <dependencies>
>   <dependency>
>     <groupId>log4j</groupId> 
>     <artifactId>log4j</artifactId> 
>   </dependency>
> </dependencies>

Just thought I would point you at Paul Hammant's blog entry on using
Monitors instead of things like log4j or clogging:

http://paulhammant.com/blog/000241.html

-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org

A party which is not afraid of letting culture,
business, and welfare go to ruin completely can
be omnipotent for a while.

  -- Jakob Burckhardt


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