vancetang / reflections

Automatically exported from code.google.com/p/reflections
Do What The F*ck You Want To Public License
0 stars 0 forks source link

dependency problems in pom.xml #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I noticed that reflections pulls some dependencies that should be optional (for 
example logback, dom4j etc).

The pom found at 
http://reflections.googlecode.com/svn/repo/org/reflections/reflections/0.9.5-RC2
/reflections-0.9.5-RC2.pom uses "<optional/>" to mark dependencies as optional.
It looked weird to me because I normaly use "<optional>true</optional>". I made 
some tests and came to the conclusion that "<optional/>" does not work!

For servlet-api it's quite common to use scope=provided, because the web-app 
container provides it. But optional should work, too.

You can reproduce the problem if you use reflections as dependency in another 
pom.xml and type "mvn dependency:tree" in the shell.

Original issue reported on code.google.com by d.pet...@gmail.com on 18 Jun 2010 at 10:26

GoogleCodeExporter commented 9 years ago
Another problem is just found: dom4j is not optional!
The pom says:
     <!-- effectively needed when XmlSerilizer is used -->
        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>1.6</version>
            <!--<scope>runtime</scope>-->
            <optional/>
        </dependency>

I manually excluded it and got an exeption when i called it like this:
Reflections refl = new Reflections("my.package");
=>
java.lang.NoClassDefFoundError: org/dom4j/DocumentException
    at org.reflections.util.ConfigurationBuilder.<init>(ConfigurationBuilder.java:48) 
    at org.reflections.Reflections$1.<init>(Reflections.java:99) 

Original comment by d.pet...@gmail.com on 18 Jun 2010 at 10:57

GoogleCodeExporter commented 9 years ago
IMO library should depend only on sfl4j-api. Otherwise user of such library is 
forced to exclude default logger implementations in pom. I propose to mark 
logback dependencies with scope test, and use them only for unit testing.

Original comment by hsh...@gmail.com on 5 Aug 2010 at 9:49

GoogleCodeExporter commented 9 years ago
fixed on trunk

Original comment by ronm...@gmail.com on 12 May 2011 at 8:28