Created
June 25, 2012 15:51
-
-
Save PiotrNowicki/2989390 to your computer and use it in GitHub Desktop.
Shrinkwrap delete
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 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?
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 :-)
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
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.