[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[tycho-dev] Error when using AbstractTychoMojoTestCase
|
Hi,
within a tycho-plugin I tried to add a Unit test. This plugin (p2-repository-plugin) did not had any test till now, so I added the 2 dependencies:
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-testing-harness</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<scope>test</scope>
</dependency>
When I run the test which does
File basedir = getBasedir("additionalFiles");
getSortedProjects(basedir, null);
("additionalFiles" is a directory containing a pom.xml file within the "src/test/resources/" directory), the test fails complaining that the "tycho-bundles-external" is missing (see attachment).
I tried to look at other plugins but could not find any difference in the dependencies or in the settings.
Any suggestions?
Thanks
Martin
-------------------------------------------------------------------------------
Test set: org.eclipse.tycho.plugins.p2.repository.AssembleRepositoryMojoTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 5.208 sec <<< FAILURE!
testCopyAdditionalFiles(org.eclipse.tycho.plugins.p2.repository.AssembleRepositoryMojoTest) Time elapsed: 5.002 sec <<< ERROR!
org.eclipse.tycho.testing.CompoundRuntimeException: Internal error: java.lang.RuntimeException: Could not instantiate required component
at org.eclipse.tycho.testing.AbstractTychoMojoTestCase.getSortedProjects(AbstractTychoMojoTestCase.java:128)
at org.eclipse.tycho.testing.AbstractTychoMojoTestCase.getSortedProjects(AbstractTychoMojoTestCase.java:111)
at org.eclipse.tycho.plugins.p2.repository.AssembleRepositoryMojoTest.testCopyAdditionalFiles(AssembleRepositoryMojoTest.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
Caused by: org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not instantiate required component
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:163)
at org.eclipse.tycho.testing.AbstractTychoMojoTestCase.getSortedProjects(AbstractTychoMojoTestCase.java:126)
... 27 more
Caused by: java.lang.RuntimeException: Could not instantiate required component
at org.eclipse.tycho.core.resolver.DefaultDependencyResolverFactory.lookupDependencyResolver(DefaultDependencyResolverFactory.java:76)
at org.eclipse.tycho.core.resolver.DefaultTychoResolver.setupProject(DefaultTychoResolver.java:88)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:72)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:268)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:151)
... 28 more
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting: org.eclipse.tycho.p2.resolver.P2DependencyResolver
at ClassRealm[plexus.core, parent: null]
while locating org.eclipse.tycho.core.DependencyResolver annotated with @com.google.inject.name.Named(value=p2)
1 error
role: org.eclipse.tycho.core.DependencyResolver
roleHint: p2
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:241)
at org.eclipse.tycho.core.resolver.DefaultDependencyResolverFactory.lookupDependencyResolver(DefaultDependencyResolverFactory.java:74)
... 32 more
Caused by: com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting: org.eclipse.tycho.p2.resolver.P2DependencyResolver
at ClassRealm[plexus.core, parent: null]
while locating org.eclipse.tycho.core.DependencyResolver annotated with @com.google.inject.name.Named(value=p2)
1 error
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:957)
at com.google.inject.Scopes$1$1.get(Scopes.java:63)
at org.sonatype.guice.bean.locators.LazyQualifiedBean.getValue(LazyQualifiedBean.java:66)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:54)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:249)
... 34 more
Caused by: com.google.inject.ProvisionException: Guice provision errors:
1) Error notifying InjectionListener org.sonatype.guice.plexus.binders.PlexusBeanBinder@ee7a10e of org.eclipse.tycho.p2.resolver.P2DependencyResolver.
Reason: java.lang.RuntimeException: org.apache.maven.MavenExecutionException: Could not resolve artifact for Tycho's OSGi runtime
while locating org.eclipse.tycho.p2.resolver.P2DependencyResolver
1 error
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:957)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:983)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:948)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:994)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:944)
... 38 more
Caused by: java.lang.RuntimeException: org.apache.maven.MavenExecutionException: Could not resolve artifact for Tycho's OSGi runtime
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.checkStarted(DefaultEquinoxEmbedder.java:301)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.getService(DefaultEquinoxEmbedder.java:275)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.getService(DefaultEquinoxEmbedder.java:270)
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.initialize(P2DependencyResolver.java:412)
at org.codehaus.plexus.PlexusLifecycleManager.initialize(PlexusLifecycleManager.java:227)
at org.codehaus.plexus.PlexusLifecycleManager.manage(PlexusLifecycleManager.java:151)
at org.sonatype.guice.plexus.binders.PlexusBeanBinder.afterInjection(PlexusBeanBinder.java:79)
at com.google.inject.internal.MembersInjectorImpl.notifyListeners(MembersInjectorImpl.java:97)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:95)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:253)
at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:948)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1001)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:944)
... 44 more
Caused by: org.apache.maven.MavenExecutionException: Could not resolve artifact for Tycho's OSGi runtime
at org.eclipse.tycho.osgi.runtime.TychoOsgiRuntimeLocator.resolveDependency(TychoOsgiRuntimeLocator.java:219)
at org.eclipse.tycho.osgi.runtime.TychoOsgiRuntimeLocator.addRuntimeArtifact(TychoOsgiRuntimeLocator.java:159)
at org.eclipse.tycho.osgi.runtime.TychoOsgiRuntimeLocator.addRuntimeArtifacts(TychoOsgiRuntimeLocator.java:153)
at org.eclipse.tycho.osgi.runtime.TychoOsgiRuntimeLocator.addRuntimeArtifacts(TychoOsgiRuntimeLocator.java:118)
at org.eclipse.tycho.osgi.runtime.TychoOsgiRuntimeLocator.locateRuntime(TychoOsgiRuntimeLocator.java:103)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.doStart(DefaultEquinoxEmbedder.java:79)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.start(DefaultEquinoxEmbedder.java:67)
at org.eclipse.sisu.equinox.embedder.internal.DefaultEquinoxEmbedder.checkStarted(DefaultEquinoxEmbedder.java:299)
... 56 more
Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:
----------
1) org.eclipse.tycho:tycho-bundles-external:zip:0.22.0-SNAPSHOT
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.eclipse.tycho -DartifactId=tycho-bundles-external -Dversion=0.22.0-SNAPSHOT -Dpackaging=zip -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.eclipse.tycho -DartifactId=tycho-bundles-external -Dversion=0.22.0-SNAPSHOT -Dpackaging=zip -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
----------
1 required artifact is missing.
for artifact:
org.eclipse.tycho:tycho-bundles-external:zip:0.22.0-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2, releases=true, snapshots=false)
at org.apache.maven.artifact.resolver.DefaultResolutionErrorHandler.throwErrors(DefaultResolutionErrorHandler.java:71)
at org.eclipse.tycho.osgi.runtime.TychoOsgiRuntimeLocator.resolveDependency(TychoOsgiRuntimeLocator.java:217)
... 63 more