Skip to content

Instantly share code, notes, and snippets.

@PiotrNowicki
Created June 25, 2012 15:51
Show Gist options
  • Save PiotrNowicki/2989390 to your computer and use it in GitHub Desktop.
Save PiotrNowicki/2989390 to your computer and use it in GitHub Desktop.
Shrinkwrap delete
WebArchive archive = ShrinkWrap.create(WebArchive.class).addPackages(true, "eu.awaketech.mymodule")
.addAsWebInfResource("beans.xml", "beans.xml")
.addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml");
// To remove some package, I need to do:
archive.delete("/WEB-INF/classes/eu/awaketech/mymodule/config");
// Wish I could do:
// - archive.delete(DataSource.class.getPackage());
// - archive.delete(DataSource.class);
@tommysdk
Copy link

Just stumbled across this one myself in my current use case, where I would like to remove a couple of classes in a jar built by a third party, to stub out that particular functionality. Nice to see that you've taken this issue Piotr, it'll be a nice enhancement to the API.

@PiotrNowicki
Copy link
Author

@tommysdk great that you also find it useful :-)

The pull request is here shrinkwrap/shrinkwrap#58

Don't know if it should be linked with the JIRA right away or after the review and acceptance?

@tommysdk
Copy link

I made a quick review and thought it looked good. I think you can link the pull request to the JIRA issue right away (that's what I usually do). If it needs further adjustments @ALRubinger will let you know :-)

@PiotrNowicki
Copy link
Author

Ok, JIRA updated, CLA signed.

Just waiting for @ALRubinger review :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment