Arquillian/Shrinkwrap: How to replace jar or class folder from a WAR?

1.2k views Asked by At

I have a prebuild WAR-archive, which contains all my needed structure of the WAR to deploy with Arquillian. So I am creating a WAR-Archive in Arquillian based on this prebuild war file.

ShrinkWrap.createFromZipFile(WebArchive.class, new File(myWarDir, "myWar.war"));

Now I want to update some JAR files and all class files inside the Arquillian WAR-Archive.

How can I replace all classes from WEB-INF/classes with classes from a specific folder?

Same question is to specific jar files in WEB-INF/lib. How can I replace specific jar files?

Same question to any other resource in the WebArchive?

1

There are 1 answers

1
John Ament On

The API is the same here - you'll get back a WebArchive, you simply need to delete the appropriate paths before you add to it again.