Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 100275 - Java libraries using commons-logging must not rdepend on log4j
Summary: Java libraries using commons-logging must not rdepend on log4j
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: Tracker
Depends on:
Blocks:
 
Reported: 2005-07-25 12:33 UTC by Ortwin Glueck
Modified: 2005-12-16 06:00 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
commons-httpclient-3.0_rc1.ebuild (commons-httpclient-3.0_rc1.ebuild,1.36 KB, text/plain)
2005-07-25 12:34 UTC, Ortwin Glueck
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ortwin Glueck 2005-07-25 12:33:06 UTC
Take the commons-httpclient-3.0_rc1 ebuild for instance. It rdepends on
commons-logging and log4j. This is wrong. commons-logging is chosen so that
applications using commons-httpclient can decide which logging framework to use.
This decision must not be made on the library level!

Reproducible: Always
Steps to Reproduce:
Comment 1 Ortwin Glueck 2005-07-25 12:34:21 UTC
Created attachment 64292 [details]
commons-httpclient-3.0_rc1.ebuild

Fixed ebuild
Comment 2 Petteri Räty (RETIRED) gentoo-dev 2005-07-25 22:38:15 UTC
It is better to provide patches against the latest ebuild in the future, but
thank you for the report. 
Comment 3 Josh Nichols (RETIRED) gentoo-dev 2005-12-14 21:32:27 UTC
I did a little shell magic to get a list of packages that depend on both:

In PORTDIR:
grep -l --include=*.ebuild -r dev-java/commons-logging * | xargs grep -l
dev-java/log4j

dev-java/mx4j/mx4j-2.1.0-r1.ebuild
dev-java/commons-logging/commons-logging-1.0.4-r1.ebuild
dev-java/castor/castor-0.9.5.3-r1.ebuild
dev-java/castor/castor-0.9.7.ebuild
dev-java/castor/castor-0.9.9.ebuild
dev-java/exolabcore/exolabcore-0.3.7_p20050205.ebuild
dev-java/commons-httpclient/commons-httpclient-2.0.2.ebuild
dev-java/commons-httpclient/commons-httpclient-2.0.1.ebuild
dev-java/ant-tasks/ant-tasks-1.6.5.ebuild
dev-java/ant-tasks/ant-tasks-1.6.2-r10.ebuild
dev-java/ant-tasks/ant-tasks-1.6.2-r9.ebuild
dev-java/openjms/openjms-0.7.6.1-r1.ebuild
dev-java/xdoclet/xdoclet-1.2.2.ebuild
dev-java/jgroups/jgroups-2.2.7-r1.ebuild
dev-java/jgroups/jgroups-2.2.7.ebuild
net-nds/jxplorer/jxplorer-3.1_rc4.ebuild
net-nds/jxplorer/jxplorer-3.1.ebuild
www-servers/axis/axis-1.2_rc2.ebuild
www-servers/tomcat/tomcat-5.0.28-r10.ebuild
www-servers/tomcat/tomcat-5.0.28-r9.ebuild
www-servers/tomcat/tomcat-5.0.28-r11.ebuild
Comment 4 Ortwin Glueck 2005-12-15 01:11:38 UTC
Keep in mind that this bug *only* affects libraries and *not* standalone
products. So for Tomcat, Axis and Jxplorer for example it is totally correct to
depend on both.
Comment 5 Josh Nichols (RETIRED) gentoo-dev 2005-12-15 18:04:30 UTC
(In reply to comment #4)
> Keep in mind that this bug *only* affects libraries and *not* standalone
> products. So for Tomcat, Axis and Jxplorer for example it is totally correct to
> depend on both.
Of course. I had meant to mention that, but it was a bit late when I commented.

Fixed the rest of commons-httpclient, mx4j, exolabcore, jgroups, and axis.

In addition to tomcat and jxplorer, xdoclet, ant-tasks, and openjms actually
need log4j. Also, obviously commons-logging should depend on log4j ;)

Thanks for reporting!
Comment 6 Petteri Räty (RETIRED) gentoo-dev 2005-12-16 06:00:11 UTC
Take for example dev-java/poi. You can't just go removing dependencies:
compile-contrib:
    [javac] Compiling 21 source files to
/var/tmp/portage/poi-2.5.1/work/build/contrib-classes
    [javac]
/var/tmp/portage/poi-2.5.1/work/src/contrib/src/org/apache/poi/hssf/usermodel/contrib/HSSFRegionUtil.java:19:
package org.apache.log4j does not exist
    [javac] import org.apache.log4j.Category;

It does compile because of the LOCALCLASSPATH in /usr/bin/ant. Please turn that
off while removing log4j dependencies.