1 Reply Latest reply on Jul 6, 2013 10:24 AM by William Miranda de Jesus

    (Resolved) NoSuchMethodError: org.apache.maven.artifact.repository.metadata.Versioning.getSnapshotVersions()Ljava/util/List

    William Miranda de Jesus Newbie

      Hi there,

      I have been trying to solve the dependencies of maven using ShrinkWrap on my JUnit test but I got a problem that I couldn't fix.

      Follow my test:

       

       

      PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile("pom.xml")

                .importDependencies(ScopeType.PROVIDED, ScopeType.RUNTIME, ScopeType.COMPILE, ScopeType.TEST);


      //This error ocurred when I tried to execute the using method

      pom.resolve().using(TransitiveStrategy.INSTANCE).asFile()

       

      And this is the problem I got:

       

       

      java.lang.RuntimeException: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec.WebArchive br.com.sulamerica.susis.autorizador.ws.resource.BeneficiarioResourceTest.createDeployment()           at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:177)           at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generateDeployment(AnnotationDeploymentScenarioGenerator.java:99)           at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generate(AnnotationDeploymentScenarioGenerator.java:62)           at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:79)           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)           at java.lang.reflect.Method.invoke(Method.java:597)           at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)           at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)           at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)           at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)           at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)           at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)           at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:100)           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)           at java.lang.reflect.Method.invoke(Method.java:597)           at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)           at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)           at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)           at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)           at java.lang.reflect.Method.invoke(Method.java:597)           at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)           at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)           at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)           at java.lang.reflect.Method.invoke(Method.java:597)           at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)           at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)           at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)           at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)           at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)           at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)           at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)           at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)           at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)           at org.junit.runners.ParentRunner.run(ParentRunner.java:309)           at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)           at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)           at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.reflect.InvocationTargetException           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)           at java.lang.reflect.Method.invoke(Method.java:597)           at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:173)           ... 50 more Caused by: java.lang.NoSuchMethodError: org.apache.maven.artifact.repository.metadata.Versioning.getSnapshotVersions()Ljava/util/List;           at org.apache.maven.repository.internal.DefaultVersionResolver.merge(DefaultVersionResolver.java:399)           at org.apache.maven.repository.internal.DefaultVersionResolver.resolveVersion(DefaultVersionResolver.java:240)           at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:250)           at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)           at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(DefaultDependencyCollector.java:412)           at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:240)           at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:333)           at org.jboss.shrinkwrap.resolver.impl.maven.bootstrap.MavenRepositorySystem.resolveDependencies(MavenRepositorySystem.java:122)           at org.jboss.shrinkwrap.resolver.impl.maven.MavenWorkingSessionImpl.resolveDependencies(MavenWorkingSessionImpl.java:251)           at org.jboss.shrinkwrap.resolver.impl.maven.MavenStrategyStageBaseImpl.using(MavenStrategyStageBaseImpl.java:67)           at org.jboss.shrinkwrap.resolver.impl.maven.MavenStrategyStageBaseImpl.withoutTransitivity(MavenStrategyStageBaseImpl.java:54)           at org.jboss.shrinkwrap.resolver.impl.maven.MavenStrategyStageBaseImpl.withoutTransitivity(MavenStrategyStageBaseImpl.java:38)           at br.com.sulamerica.susis.autorizador.ws.resource.BeneficiarioResourceTest.createDeployment(BeneficiarioResourceTest.java:102)           ... 55 more

       

       

      Does anyone knows what can I do to solve this problem?