You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ryan Moquin <fr...@gmail.com> on 2007/07/09 20:23:41 UTC

How to get a plugin to see my log4j.xml

I'm trying to generate classes for a wsdl using the xfire-maven-plugin but
I'm running into trouble.  I need to get my log4j.xml onto the plugins
classpath so that I can see it's logging output, but it won't pick it up
like I would have expected from the src/main/resources directory.  Is there
a way to get the plugin to see the log4j.xml in the src/main/resources
directory?  Or if it should do this, is there a way to confirm what I'm
doing wrong?  my  other log4j settings appear to work as expected in my
tests so I'm doubting it's a config issue.

Thanks!

Ryan

Re: How to get a plugin to see my log4j.xml

Posted by Ryan Moquin <fr...@gmail.com>.
Interesting, thanks I'll give that a try!

Ryan

On 7/11/07, Kenney Westerhof <ke...@apache.org> wrote:
>
> Hi,
>
> Dennis is abslutely right.
>
> There's one other way that doesn't require modification or building of the
> plugin,
> but I'm not sure it'll work, though it's worth a shot:
>
> create a new maven project that only contains
> src/main/resources/log4j.xml,
> mvn install it, and add a dependency on that project to the
> <plugin><dependencies>
> section for the xfire-maven-plugin.
>
> The only thing that may prevent this from working is the classpath order
> for
> the plugin itself (if it's own dependencies come before the added one this
> will
> not work). This is especially true if the log4j.xml file is in the plugin
> artifact
> itself.
> If you're lucky, the plugin uses log4j.properties; then log4j.xml will
> take precedence.
>
> For testing/debugging this I'd recommend
> 'jar uvf ~/.m2/repository/org/..../xfire-maven-plugin/version/xfire-
> maven-plugin-version.jar log4j.xml'
>
> -- Kenney
>
> Dennis Lundberg wrote:
> > A log4j configuration should be in src/main/resources for the plugin -
> > not your own project. If xfire-maven-plugin uses log4j for logging it
> > should provide some kind of configuration for it. You could build the
> > plugin yourself and add a suitable logging configuration when you build
> it.
> >
> > Ryan Moquin wrote:
> >> I'm trying to generate classes for a wsdl using the xfire-maven-plugin
> >> but
> >> I'm running into trouble.  I need to get my log4j.xml onto the plugins
> >> classpath so that I can see it's logging output, but it won't pick it
> up
> >> like I would have expected from the src/main/resources directory.  Is
> >> there
> >> a way to get the plugin to see the log4j.xml in the src/main/resources
> >> directory?  Or if it should do this, is there a way to confirm what I'm
> >> doing wrong?  my  other log4j settings appear to work as expected in my
> >> tests so I'm doubting it's a config issue.
> >>
> >> Thanks!
> >>
> >> Ryan
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to get a plugin to see my log4j.xml

Posted by Kenney Westerhof <ke...@apache.org>.
Hi,

Dennis is abslutely right.

There's one other way that doesn't require modification or building of the plugin,
but I'm not sure it'll work, though it's worth a shot:

create a new maven project that only contains src/main/resources/log4j.xml,
mvn install it, and add a dependency on that project to the <plugin><dependencies>
section for the xfire-maven-plugin.

The only thing that may prevent this from working is the classpath order for
the plugin itself (if it's own dependencies come before the added one this will
not work). This is especially true if the log4j.xml file is in the plugin artifact
itself.
If you're lucky, the plugin uses log4j.properties; then log4j.xml will take precedence.

For testing/debugging this I'd recommend 
'jar uvf ~/.m2/repository/org/..../xfire-maven-plugin/version/xfire-maven-plugin-version.jar log4j.xml'

-- Kenney

Dennis Lundberg wrote:
> A log4j configuration should be in src/main/resources for the plugin - 
> not your own project. If xfire-maven-plugin uses log4j for logging it 
> should provide some kind of configuration for it. You could build the 
> plugin yourself and add a suitable logging configuration when you build it.
> 
> Ryan Moquin wrote:
>> I'm trying to generate classes for a wsdl using the xfire-maven-plugin 
>> but
>> I'm running into trouble.  I need to get my log4j.xml onto the plugins
>> classpath so that I can see it's logging output, but it won't pick it up
>> like I would have expected from the src/main/resources directory.  Is 
>> there
>> a way to get the plugin to see the log4j.xml in the src/main/resources
>> directory?  Or if it should do this, is there a way to confirm what I'm
>> doing wrong?  my  other log4j settings appear to work as expected in my
>> tests so I'm doubting it's a config issue.
>>
>> Thanks!
>>
>> Ryan
>>
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to get a plugin to see my log4j.xml

Posted by Ryan Moquin <fr...@gmail.com>.
Ok, that's what I was hoping to get confirmed.  I didn't know if it would
happen to pick resources that way at all.  Figured it wouldn't but just in
case.

Thanks!

On 7/10/07, Dennis Lundberg <de...@apache.org> wrote:
>
> A log4j configuration should be in src/main/resources for the plugin -
> not your own project. If xfire-maven-plugin uses log4j for logging it
> should provide some kind of configuration for it. You could build the
> plugin yourself and add a suitable logging configuration when you build
> it.
>
> Ryan Moquin wrote:
> > I'm trying to generate classes for a wsdl using the xfire-maven-plugin
> but
> > I'm running into trouble.  I need to get my log4j.xml onto the plugins
> > classpath so that I can see it's logging output, but it won't pick it up
> > like I would have expected from the src/main/resources directory.  Is
> there
> > a way to get the plugin to see the log4j.xml in the src/main/resources
> > directory?  Or if it should do this, is there a way to confirm what I'm
> > doing wrong?  my  other log4j settings appear to work as expected in my
> > tests so I'm doubting it's a config issue.
> >
> > Thanks!
> >
> > Ryan
> >
>
>
> --
> Dennis Lundberg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to get a plugin to see my log4j.xml

Posted by Dennis Lundberg <de...@apache.org>.
A log4j configuration should be in src/main/resources for the plugin - 
not your own project. If xfire-maven-plugin uses log4j for logging it 
should provide some kind of configuration for it. You could build the 
plugin yourself and add a suitable logging configuration when you build it.

Ryan Moquin wrote:
> I'm trying to generate classes for a wsdl using the xfire-maven-plugin but
> I'm running into trouble.  I need to get my log4j.xml onto the plugins
> classpath so that I can see it's logging output, but it won't pick it up
> like I would have expected from the src/main/resources directory.  Is there
> a way to get the plugin to see the log4j.xml in the src/main/resources
> directory?  Or if it should do this, is there a way to confirm what I'm
> doing wrong?  my  other log4j settings appear to work as expected in my
> tests so I'm doubting it's a config issue.
> 
> Thanks!
> 
> Ryan
> 


-- 
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org