David Legg wrote:
Hi Patrick,
Just for getting it clear - is 'myblock' some block, or are you
listing dependencies for the whole web-application, since there could
be a dep on commons-logging wich is not mentioned out of 'myblock'
I realised my message was a bit ambiguous after I sent it.
To be clear, 'myblock', is *exactly* the same as 'myBlock1' in the
tutorial [1]. All I did to get the dependency tree listing was to add
some <exclusion> tags to the myblock/pom.xml file to exclude
commons-logging and log4j jar files from all of the dependencies listed
in the pom. The reason I'm flagellating myself like this is because I
need to effectively replace these two jar files with some slf4j
equivalents that redirect log messages created using legacy
(commons-logging and log4j) code to the slf4j logging framework.
Since that message and thanks to the hint about 'mvn dependency:tree'
from Reinhard I've realized that only cocoon-core has a dependency on
those two jar files. I updated pom.xml to only have the <exclusion>
tags on cocoon-core and now the dependency tree shows no reference to
the two jar files I wanted to be excluded.
This is great!... but my quest to use slf4j as my logging solution is
still not fulfilled. The question now is why when I run 'mvn package'
or 'mvn jetty:run' when in the myblock directory does maven insist on
placing the commons-logging and log4j jar files into WEB-INF/lib even
though I've expressly excluded them? Maybe the answer has something to
do with the cocoon-maven-plugin?
What WEB-INF/lib directory are you referring to? Is it
./target/rcl/webapp/WEB-INF/lib or is it the WEB-INF/lib directory of
the web application Maven module?
If it is the first, the answer is that the wrapper web application (a
minimal web application that wraps a block) uses the reloading
classloader (commons-jci.jar) which has a dependency on commons-logging.
If it is the latter case, I recommend running mvn dependency:tree from
your webapplication module.
Also, since my last message, I came across the Shielded Classloader [2]
which explicitly mentions the problem of using your own logging
framework and how the shielded classloader may help.
I'm hoping that once I have these issues sorted out I'll write it up to
help others travelling this route for the first time.
Regards,
David Legg
[1] http://cocoon.apache.org/2.2/1159_1_1.html
[2]
http://cocoon.apache.org/2.2/maven-plugins/maven-plugin/1.0/1262_1_1.html
--
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 [EMAIL PROTECTED]
________________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]