You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Martin Burger <m...@rtin-burger.de> on 2005/07/15 17:05:11 UTC

Problems with dependencies (Digester) of self written plugin

Hello,

I'm developing a plugin for Maven (1.0.2) and run into trouble. The 
plugin has - among other - the following dependencies:

        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.7.0</version>
            <url>http://jakarta.apache.org/commons/beanutils/</url>
        </dependency>
        <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
            <version>1.7</version>
            <url>http://jakarta.apache.org/commons/digester/</url>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.0</version>
            <url>http://jakarta.apache.org/commons/io/</url>
            <properties>
                <classloader>root</classloader>
            </properties>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.0.4</version>
            <url>http://jakarta.apache.org/commons/logging/</url>Missing 
DTD definition for BeanPropertySetterRule
        </dependency>
        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.0.b2</version>
        </dependency>

If I run my unit tests in the IDE (Eclipse) or via the goal test, 
everything runs fine. But if I want to use my plugin after "maven 
plugin:install", it does not work.

The plugin parses the Junit test reports using commons-digester, my code 
has test coverage of 100%! Running the plugin there are some strange 
errors, parts of the XML report are not parsed (ignored). If I add that 
XML report to my test suite, everything works as expected. So, I think 
my code is "correct".

The parts ignored while the plugin run should be collected via a 
"bean-property-setter-rule". I searched issues.apache.org for bugs and 
found that one: http://issues.apache.org/bugzilla/show_bug.cgi?id=16785

According to that bug, the rule "bean-property-setter-rule" was added 
after Digester 1.4.1 release. My code uses 1.7...

So, I looked into the lib folder of my Maven installation, and there is 
a commons-digester-1.4.1.jar.

I think while running the plugin Digester 1.7 is not used, "Maven's" 
1.4.1 is used instead. Therefore some parts of the XML report are ignored.

While running a plugin that has a dependency to a jar that Maven depends 
on, which version is used for the plugin? How can I force that the right 
version is used for my plugin?

Thanks,
    Martin



Re: Problems with dependencies (Digester) of self written plugin

Posted by Brett Porter <br...@gmail.com>.
Yes, they are separated from each other and only inherit minimal Maven
and Plexus specific classes form Maven itself.

On 7/18/05, Martin Burger <m...@rtin-burger.de> wrote:
> Brett Porter schrieb am 16.07.2005 06:51:
> 
> >Unfortunately you are stuck here. The version in MAVEN_HOME/lib is
> >used above the others due to the classloader hierachy in use and the
> >fact that plugins are not separated.
> >
> 
> What about upcoming 2.0? Will the plugins be separated (with respect to
> the classloader)?
> 
> Regards,
>     Martin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

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


Re: Problems with dependencies (Digester) of self written plugin

Posted by Martin Burger <m...@rtin-burger.de>.
Brett Porter schrieb am 16.07.2005 06:51:

>Unfortunately you are stuck here. The version in MAVEN_HOME/lib is
>used above the others due to the classloader hierachy in use and the
>fact that plugins are not separated.
>

What about upcoming 2.0? Will the plugins be separated (with respect to 
the classloader)?

Regards,
    Martin

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


Re: Problems with dependencies (Digester) of self written plugin

Posted by Brett Porter <br...@gmail.com>.
Unfortunately you are stuck here. The version in MAVEN_HOME/lib is
used above the others due to the classloader hierachy in use and the
fact that plugins are not separated.

Plugins will need to use 1.4.1 to remain compat with Maven 1.0.2.

- Brett

On 7/16/05, Martin Burger <m...@rtin-burger.de> wrote:
> Martin Burger schrieb am 15.07.2005 17:05:
> 
> > I think while running the plugin Digester 1.7 is not used, "Maven's"
> > 1.4.1 is used instead. Therefore some parts of the XML report are
> > ignored.
> 
> 
> Switching to Maven 1.1-beta-1 helped. But how to provide backward
> compatibility?
> 
> Regards,
>     Martin
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

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


Re: Problems with dependencies (Digester) of self written plugin

Posted by Martin Burger <m...@rtin-burger.de>.
Martin Burger schrieb am 15.07.2005 17:05:

> I think while running the plugin Digester 1.7 is not used, "Maven's" 
> 1.4.1 is used instead. Therefore some parts of the XML report are 
> ignored.


Switching to Maven 1.1-beta-1 helped. But how to provide backward 
compatibility?

Regards,
    Martin


Re: Problems with dependencies (Digester) of self written plugin

Posted by Martin Burger <m...@rtin-burger.de>.
Martin Burger schrieb am 15.07.2005 17:05:

> I think while running the plugin Digester 1.7 is not used, "Maven's" 
> 1.4.1 is used instead. Therefore some parts of the XML report are 
> ignored.


In my code, I added a call of the method Digester.getSAXLogger(). That 
method was added in Digester 1.6. Running the test that method gets called,
running the plugin there's a NoSuchMethodError:

    java.lang.NoSuchMethodError: 
org.apache.commons.digester.Digester.getSAXLogger()Lorg/apache/commons/logging/Log;

So, I'm pretty sure that Digester 1.4.1 is used.

Is it possible to use another version of the Digester than 1.4.1?

Regards,
    Martin