0

I would like to migrate a legacy component test to Arquillian. The test has its classpath contructed via Ivy. After having read the documentation it is not clear to me what to do if I do not want to use Arquillian's

@Deployment
public static JavaArchive createDeployment()
{
    return ShrinkWrap.create(JavaArchive.class).addClass(..);
}

solution but only rely on the actual runtime classpath as a whole.

4

1 回答 1

1

If you have it available as an arbitrary JAR you can simply use such construct

ShrinkWrap.createFromZipFile(archiveType, file);

Or you can also resolve it using ShrinkWrap Maven Resolver:

MavenDependencyResolver resolver = DependencyResolvers.use(MavenDependencyResolver.class)                                                                    
   .loadMetadataFromPom("pom.xml")
   .goOffline();

Archive<?> archive = ShrinkWrap.createFromZipFile(JavaArchive.class, resolver.artifacts("groupId:artifactId:version").resolveAsFiles()[0]);
于 2012-10-05T11:44:04.527 回答