downloadsha3by / wiquery

Automatically exported from code.google.com/p/wiquery
MIT License
0 stars 0 forks source link

Change scope of log4j-Dependency from compile to test #194

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Same as Issue 175 but for version wiquery-1.2.4:

It should be possible to use other logging frameworks in an application (e.g. 
logback) in conjunction with wiquery. That's the intention of using slf4j. 

Currently wiquery includes a dependency to log4j in the "compile" scope. A 
log4j dependency should only be included in the "test" scope.

pom.xml (wrong):
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>${slf4j.version}</version>
</dependency>
<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>${log4j.version}</version>
</dependency>

pom.xml (correct):
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>${slf4j.version}</version>
    <scope>test</scope>
</dependency>
<!-- log4j will be included by slf4j-log4j12 transatively. -->

What steps will reproduce the problem?
1.  mvn dependency:tree | grep log4j

What is the expected output?
  [INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.1:test
  [INFO] |  \- log4j:log4j:jar:1.2.16:test

What do you see instead?
  [INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
  [INFO] +- log4j:log4j:jar:1.2.16:compile

What version of the product are you using?
  1.2.4

A current workaround is the exclusion of log4j in the application which is 
using wiquery:

        <dependency>
            <groupId>org.odlabs.wiquery</groupId>
            <artifactId>wiquery</artifactId>
            <version>1.2.4</version>
            <exclusions>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

I think the rhino dependency is questionable too.

Original issue reported on code.google.com by c...@divinus-soft.de on 24 Jun 2011 at 9:11

GoogleCodeExporter commented 9 years ago

Original comment by hielke.hoeve on 25 Jun 2011 at 12:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Ah yes a common mistake, will fix it on trunk so it will only include slf4j-api 
in compile mode and slf4j-log12 for test mode. This way our tests will output 
logging and the end user can specify their own logging levels.

The rhino dependency is not questionable as this is used by the YUI Compressor.

Original comment by hielke.hoeve on 25 Jun 2011 at 12:22

GoogleCodeExporter commented 9 years ago

Original comment by hielke.hoeve on 27 Jun 2011 at 6:57