Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 53030 invoked from network); 20 Jul 2008 15:03:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jul 2008 15:03:26 -0000 Received: (qmail 95532 invoked by uid 500); 20 Jul 2008 15:03:24 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 95475 invoked by uid 500); 20 Jul 2008 15:03:24 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 95464 invoked by uid 99); 20 Jul 2008 15:03:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Jul 2008 08:03:24 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [88.198.46.98] (HELO indoqa.com) (88.198.46.98) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Jul 2008 15:02:29 +0000 Received: from [192.168.0.193] (chello062178239020.5.15.vie.surfer.at [62.178.239.20]) by indoqa.com (Postfix) with ESMTP id 88C8B254658 for ; Sun, 20 Jul 2008 17:02:22 +0200 (CEST) Message-ID: <4883536F.5030103@apache.org> Date: Sun, 20 Jul 2008 17:02:07 +0200 From: =?ISO-8859-1?Q?Reinhard_P=F6tz?= User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: C2.2 - Cannot remove jar files from classpath using Maven References: <48833BBC.90107@searchevent.co.uk> In-Reply-To: <48833BBC.90107@searchevent.co.uk> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org David Legg wrote: > In order to use another logging package I need to ensure commons-logging > and log4j jar files are not in the class path. I cannot get Maven to > exclude them. I'm using Maven 2.0.9. > > Here's the scenario: - > > Following the Cocoon tutorial [1] I created a Cocoon block called > 'myblock' (number 2 on the list of archetypes) > > If I change into the 'myblock' folder and run 'mvn package' I notice the > following lines in the output: - > > ... > [INFO] [cocoon:prepare {execution: prepare}] > [INFO] Preparing a Cocoon web application. > [INFO] Deploying string-template to WEB-INF/log4j.xml > [INFO] Adding lib to WEB-INF/lib: commons-logging:commons-logging:1.1:jar > [INFO] Adding lib to WEB-INF/lib: > org.apache.commons:commons-jci-core:1.0:jar > [INFO] Adding lib to WEB-INF/lib: commons-io:commons-io:1.3.1:jar > [INFO] Adding lib to WEB-INF/lib: log4j:log4j:1.2.14:jar > ... > > That means those jar files will be in the classpath when the web app is > run. > > So, then I edit the myblock/pom.xml file and add '' tags to > all the dependencies I can see like this: - > > > ... > > > org.apache.cocoon > cocoon-core > 2.2.0 > > > commons-logging > commons-logging > > > > ... > > ... > > > When I run 'mvn clean package' I get exactly the same results! > > When I use the mvn -X parameter to see the debug output as maven runs I > get the impression that the maven plugins seem to be adding dependencies > to the dependency tree: - > > ... > [DEBUG] Retrieving parent-POM: org.apache.cocoon:cocoon::6 for project: > null:cocoon-tools-modules:pom:6 from the repository. > [DEBUG] Adding managed dependencies for unknown:cocoon-maven-plugin > ... > [DEBUG] commons-logging:commons-logging:jar:1.1 > ... > > I suppose I could start fiddling with plugin exclusions but this is > getting silly. Do I really have to work this hard to try to make sure a > jar file isn't included in the classpath? Use the Maven dependency plugin (the 'tree' goal) to find out what dependencies have a dependency on the libraries that you want to remove. Then you have to remove them from ALL occurrences by adding sections. -- Reinhard P�tz Managing Director, {Indoqa} GmbH http://www.indoqa.com/en/people/reinhard.poetz/ Member of the Apache Software Foundation Apache Cocoon Committer, PMC member reinhard@apache.org ________________________________________________________________________ --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org