You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Tibor Digana <ti...@googlemail.com> on 2016/01/07 13:40:36 UTC

NoSuchMethodError maven-plugin-testing-harness:3.0.0

I am migrating plugin to 3.0.0 and I have a problem with a test
because it fails due to maven-plugin-testing-harness:3.0.0 cannot call a
method:
setClassPathScanning(Ljava/lang/String;)Lorg/codehaus/plexus/ContainerConfiguration;

In maven-plugin-testing-harness' code the method setClassPathScanning() is
called with String parameter but boolean is expected.

protected ContainerConfiguration setupContainerConfiguration()
{
    ClassWorld classWorld = new ClassWorld( "plexus.core",
Thread.currentThread().getContextClassLoader() );

    ContainerConfiguration cc = new DefaultContainerConfiguration()
      .setClassWorld( classWorld )
      .setClassPathScanning( PlexusConstants.SCANNING_INDEX )
      .setAutoWiring( true )
      .setName( "maven" );

    return cc;
}

The versions are chaotic now because
maven-plugin-testing-harness:3.0.0
is dependent on
maven-core:3.1.1
with sisu-inject-plexus other than 1.4.2.

But maven-core:3.0.0 needs to have sisu-inject-plexus:1.4.2

How should I solve this?
I tried to upgrade to maven-core:3.1.0 but got another problem.

Should we use Takari IT framework? It will cost me more time to rework all
tests.

-- 
Cheers
Tibor

Re: NoSuchMethodError maven-plugin-testing-harness:3.0.0

Posted by Tibor Digana <ti...@googlemail.com>.
This is the branch 3.0-rc1 in surefire project
https://github.com/apache/maven-surefire/tree/3.0-rc1

The problematic project is maven-surefire-report-plugin.
https://github.com/apache/maven-surefire/blob/3.0-rc1/maven-surefire-report-plugin/pom.xml

As we can see maven-surefire-report-plugin/pom.xml
in the history
https://github.com/apache/maven-surefire/commit/781312a3b2b54b5ef886ed6387f192ca6f4ca3f9

I made several tries which is written in my comments.



On Thu, Jan 7, 2016 at 3:00 PM, Stuart McCulloch <mc...@gmail.com> wrote:

> FWIW, Sisu tries to maintain compatibility across different versions where
> possible - if you find that you can’t use a newer release in place of an
> older one then you can always report this (
> http://www.eclipse.org/sisu/support/) with the details and any test
> projects/logs. Also note that sisu-inject-bean/plexus artifacts from 2.4.x
> onwards are thin runtime wrappers around the org.eclipse.sisu.inject/plexus
> artifacts, mapping the old org.sonatype.guice API onto the new
> org.eclipse.sisu API for any clients that used that API directly instead of
> via Plexus/JSR330.
>
> For example, if I take a Maven 3.0.5 distribution remove the
> sisu-inject-bean/plexus jars and replace them with the latest
> org.eclipse.sisu.inject/plexus jars plus javax.inject-1.jar then it still
> works. You might be able to do the same with the test classpath to exclude
> the old artifacts in favour of the new ones.
>
> That said I would have assumed the maven-plugin-testing-harness would
> fully isolate the runtime being tested from the harness so you wouldn’t
> need to do this.
>
> PS. which plugin are you migrating?
>
> On Thursday, 7 January 2016 at 12:40, Tibor Digana wrote:
> > I am migrating plugin to 3.0.0 and I have a problem with a test
> > because it fails due to maven-plugin-testing-harness:3.0.0 cannot call a
> > method:
> >
> setClassPathScanning(Ljava/lang/String;)Lorg/codehaus/plexus/ContainerConfiguration;
> >
> > In maven-plugin-testing-harness' code the method setClassPathScanning()
> is
> > called with String parameter but boolean is expected.
> >
> > protected ContainerConfiguration setupContainerConfiguration()
> > {
> > ClassWorld classWorld = new ClassWorld( "plexus.core",
> > Thread.currentThread().getContextClassLoader() );
> >
> > ContainerConfiguration cc = new DefaultContainerConfiguration()
> > .setClassWorld( classWorld )
> > .setClassPathScanning( PlexusConstants.SCANNING_INDEX )
> > .setAutoWiring( true )
> > .setName( "maven" );
> >
> > return cc;
> > }
> >
> > The versions are chaotic now because
> > maven-plugin-testing-harness:3.0.0
> > is dependent on
> > maven-core:3.1.1
> > with sisu-inject-plexus other than 1.4.2.
> >
> > But maven-core:3.0.0 needs to have sisu-inject-plexus:1.4.2
> >
> > How should I solve this?
> > I tried to upgrade to maven-core:3.1.0 but got another problem.
> >
> > Should we use Takari IT framework? It will cost me more time to rework
> all
> > tests.
> >
> > --
> > Cheers
> > Tibor
> >
> >
>
>
>


-- 
Cheers
Tibor

Re: NoSuchMethodError maven-plugin-testing-harness:3.0.0

Posted by Stuart McCulloch <mc...@gmail.com>.
FWIW, Sisu tries to maintain compatibility across different versions where possible - if you find that you can’t use a newer release in place of an older one then you can always report this (http://www.eclipse.org/sisu/support/) with the details and any test projects/logs. Also note that sisu-inject-bean/plexus artifacts from 2.4.x onwards are thin runtime wrappers around the org.eclipse.sisu.inject/plexus artifacts, mapping the old org.sonatype.guice API onto the new org.eclipse.sisu API for any clients that used that API directly instead of via Plexus/JSR330.

For example, if I take a Maven 3.0.5 distribution remove the sisu-inject-bean/plexus jars and replace them with the latest org.eclipse.sisu.inject/plexus jars plus javax.inject-1.jar then it still works. You might be able to do the same with the test classpath to exclude the old artifacts in favour of the new ones.

That said I would have assumed the maven-plugin-testing-harness would fully isolate the runtime being tested from the harness so you wouldn’t need to do this.

PS. which plugin are you migrating?

On Thursday, 7 January 2016 at 12:40, Tibor Digana wrote:  
> I am migrating plugin to 3.0.0 and I have a problem with a test
> because it fails due to maven-plugin-testing-harness:3.0.0 cannot call a
> method:
> setClassPathScanning(Ljava/lang/String;)Lorg/codehaus/plexus/ContainerConfiguration;
>  
> In maven-plugin-testing-harness' code the method setClassPathScanning() is
> called with String parameter but boolean is expected.
>  
> protected ContainerConfiguration setupContainerConfiguration()
> {
> ClassWorld classWorld = new ClassWorld( "plexus.core",
> Thread.currentThread().getContextClassLoader() );
>  
> ContainerConfiguration cc = new DefaultContainerConfiguration()
> .setClassWorld( classWorld )
> .setClassPathScanning( PlexusConstants.SCANNING_INDEX )
> .setAutoWiring( true )
> .setName( "maven" );
>  
> return cc;
> }
>  
> The versions are chaotic now because
> maven-plugin-testing-harness:3.0.0
> is dependent on
> maven-core:3.1.1
> with sisu-inject-plexus other than 1.4.2.
>  
> But maven-core:3.0.0 needs to have sisu-inject-plexus:1.4.2
>  
> How should I solve this?
> I tried to upgrade to maven-core:3.1.0 but got another problem.
>  
> Should we use Takari IT framework? It will cost me more time to rework all
> tests.
>  
> --  
> Cheers
> Tibor
>  
>  



Re: NoSuchMethodError maven-plugin-testing-harness:3.0.0

Posted by Igor Fedorenko <ig...@ifedorenko.com>.
You should really try Takari plugin testing harness. It's good, works
for all 3.x maven versions too. 

-- 
Regards,
Igor

On Thu, Jan 7, 2016, at 08:04 AM, Stephen Connolly wrote:
> Ha! I'm knee deep in trying to switch maven-release over to Maven 3 and
> fighting the AbstractReleaseTestCase is proving too much for my allocated
> morning of project time... to say this whole thing is a mess would be an
> understatement ;-)
> 
> On 7 January 2016 at 12:40, Tibor Digana <ti...@googlemail.com>
> wrote:
> 
> > I am migrating plugin to 3.0.0 and I have a problem with a test
> > because it fails due to maven-plugin-testing-harness:3.0.0 cannot call a
> > method:
> >
> > setClassPathScanning(Ljava/lang/String;)Lorg/codehaus/plexus/ContainerConfiguration;
> >
> > In maven-plugin-testing-harness' code the method setClassPathScanning() is
> > called with String parameter but boolean is expected.
> >
> > protected ContainerConfiguration setupContainerConfiguration()
> > {
> >     ClassWorld classWorld = new ClassWorld( "plexus.core",
> > Thread.currentThread().getContextClassLoader() );
> >
> >     ContainerConfiguration cc = new DefaultContainerConfiguration()
> >       .setClassWorld( classWorld )
> >       .setClassPathScanning( PlexusConstants.SCANNING_INDEX )
> >       .setAutoWiring( true )
> >       .setName( "maven" );
> >
> >     return cc;
> > }
> >
> > The versions are chaotic now because
> > maven-plugin-testing-harness:3.0.0
> > is dependent on
> > maven-core:3.1.1
> > with sisu-inject-plexus other than 1.4.2.
> >
> > But maven-core:3.0.0 needs to have sisu-inject-plexus:1.4.2
> >
> > How should I solve this?
> > I tried to upgrade to maven-core:3.1.0 but got another problem.
> >
> > Should we use Takari IT framework? It will cost me more time to rework all
> > tests.
> >
> > --
> > Cheers
> > Tibor
> >

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


Re: NoSuchMethodError maven-plugin-testing-harness:3.0.0

Posted by Tibor Digana <ti...@apache.org>.
JBoss has nice solutions with BOM file.
In Maven 4.0 migration we should not forget to provide several
dependencyManagements POM with version 4.0.0 of individual dependencies.
There I can see that e.g. IT testing has recommended set of artifacts with
certain versions.

On Thu, Jan 7, 2016 at 2:05 PM, stephenconnolly [via Maven] <
ml-node+s40175n5858236h56@n5.nabble.com> wrote:

> Ha! I'm knee deep in trying to switch maven-release over to Maven 3 and
> fighting the AbstractReleaseTestCase is proving too much for my allocated
> morning of project time... to say this whole thing is a mess would be an
> understatement ;-)
>
> On 7 January 2016 at 12:40, Tibor Digana <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5858236&i=0>>
> wrote:
>
> > I am migrating plugin to 3.0.0 and I have a problem with a test
> > because it fails due to maven-plugin-testing-harness:3.0.0 cannot call a
> > method:
> >
> >
> setClassPathScanning(Ljava/lang/String;)Lorg/codehaus/plexus/ContainerConfiguration;
>
> >
> > In maven-plugin-testing-harness' code the method setClassPathScanning()
> is
> > called with String parameter but boolean is expected.
> >
> > protected ContainerConfiguration setupContainerConfiguration()
> > {
> >     ClassWorld classWorld = new ClassWorld( "plexus.core",
> > Thread.currentThread().getContextClassLoader() );
> >
> >     ContainerConfiguration cc = new DefaultContainerConfiguration()
> >       .setClassWorld( classWorld )
> >       .setClassPathScanning( PlexusConstants.SCANNING_INDEX )
> >       .setAutoWiring( true )
> >       .setName( "maven" );
> >
> >     return cc;
> > }
> >
> > The versions are chaotic now because
> > maven-plugin-testing-harness:3.0.0
> > is dependent on
> > maven-core:3.1.1
> > with sisu-inject-plexus other than 1.4.2.
> >
> > But maven-core:3.0.0 needs to have sisu-inject-plexus:1.4.2
> >
> > How should I solve this?
> > I tried to upgrade to maven-core:3.1.0 but got another problem.
> >
> > Should we use Takari IT framework? It will cost me more time to rework
> all
> > tests.
> >
> > --
> > Cheers
> > Tibor
> >
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://maven.40175.n5.nabble.com/NoSuchMethodError-maven-plugin-testing-harness-3-0-0-tp5858225p5858236.html
> To start a new topic under Maven Developers, email
> ml-node+s40175n142166h86@n5.nabble.com
> To unsubscribe from Maven Developers, click here
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=142166&code=dGlib3JkaWdhbmFAYXBhY2hlLm9yZ3wxNDIxNjZ8LTI4OTQ5MjEwMg==>
> .
> NAML
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://maven.40175.n5.nabble.com/NoSuchMethodError-maven-plugin-testing-harness-3-0-0-tp5858225p5858238.html
Sent from the Maven Developers mailing list archive at Nabble.com.

Re: NoSuchMethodError maven-plugin-testing-harness:3.0.0

Posted by Stephen Connolly <st...@gmail.com>.
Ha! I'm knee deep in trying to switch maven-release over to Maven 3 and
fighting the AbstractReleaseTestCase is proving too much for my allocated
morning of project time... to say this whole thing is a mess would be an
understatement ;-)

On 7 January 2016 at 12:40, Tibor Digana <ti...@googlemail.com>
wrote:

> I am migrating plugin to 3.0.0 and I have a problem with a test
> because it fails due to maven-plugin-testing-harness:3.0.0 cannot call a
> method:
>
> setClassPathScanning(Ljava/lang/String;)Lorg/codehaus/plexus/ContainerConfiguration;
>
> In maven-plugin-testing-harness' code the method setClassPathScanning() is
> called with String parameter but boolean is expected.
>
> protected ContainerConfiguration setupContainerConfiguration()
> {
>     ClassWorld classWorld = new ClassWorld( "plexus.core",
> Thread.currentThread().getContextClassLoader() );
>
>     ContainerConfiguration cc = new DefaultContainerConfiguration()
>       .setClassWorld( classWorld )
>       .setClassPathScanning( PlexusConstants.SCANNING_INDEX )
>       .setAutoWiring( true )
>       .setName( "maven" );
>
>     return cc;
> }
>
> The versions are chaotic now because
> maven-plugin-testing-harness:3.0.0
> is dependent on
> maven-core:3.1.1
> with sisu-inject-plexus other than 1.4.2.
>
> But maven-core:3.0.0 needs to have sisu-inject-plexus:1.4.2
>
> How should I solve this?
> I tried to upgrade to maven-core:3.1.0 but got another problem.
>
> Should we use Takari IT framework? It will cost me more time to rework all
> tests.
>
> --
> Cheers
> Tibor
>