e.g. you try changing the log4j levels and nothing happens. Much scratching of head occurs. Normally through frustration you shove a load of System.out.println() calls in your app :)
So the idea is how about being able to do something like
mvn classpath:find -Dresource=log4j.properties
and the plugin would search all the test scoped jars on the classpath, including transitive dependencies letting you know all the jars (and the dependency path to them) which included the resource you specified.
It'd be handy right? Any volunteers... :)
I'd suggest filing a request under the MDEP (maven-dependency-plugin) project - this is pretty closely related to code already in there and could probably be added pretty easily
You mean you want a reimplementation of Ant's <whichesource> task?
Brett - will do thanks
Steve - not so much re-implementation, just a way to invoke it easily from any mvn build without having to mess with the pom.xml. i.e. having a standard mvn plugin we can use on any maven project to invoke the <whichsource> task
Brett : Done!
I was a tad surprised to see maven using codehaus for its JIRA :)
whichresource task and the James's proposal are a bit different. whichresource search in the classpath but James want to search in jars filtered by a scope so it isn't a reimplementation but a new implementation of the search
I have used a line like this to find multiple log4j.properties files. One "gotcha" here is that there can be code supplying the log4j configuration or loading it from either properties or xml files of any name.
Enumeration logConfigEnum = this.getClass().getClassLoader().getResources("log4j.properties");
(I know this code has to run in the application and the request was for Maven to look around in the dependency jars. I'm just ignoring that.)
Post a Comment