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.

jabal
  • 11,987
  • 12
  • 51
  • 99

1 Answers1

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]);
bartosz.majsak
  • 1,054
  • 9
  • 13