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

I have a prebuild WAR archive that contains all of my required WAR structure to deploy with Arquillian. Therefore, I create 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?

The same question goes for specific jar files in WEB-INF / lib. How can I replace certain jar files?

Same question for any other resource in WebArchive?

+3


source to share


1 answer


The API is here - you come back to WebArchive

, you just need to remove the corresponding paths before adding to it again.



0


source







All Articles