-
-
Save PiotrNowicki/2989390 to your computer and use it in GitHub Desktop.
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); |
@ALRubinger - wanted to get started with it and just to be sure about it - those delete Class (Classes) and Package (Packages) methods should be in the ClassContainer API, right?
Just asking because none of the containers (org.jboss.shrinkwrap.api.container.) have any delete methods - just additions are present. The only delete methods are on the Archive level, but this is too general as not every Archive must be capable of holding a Class/Package artifacts, right?
Exactly. For everything that has an "add", we should have a corresponding "delete". Go for it!
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.
@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 :-)
Super - we'll save it for you!
Dev Instructions: https://community.jboss.org/docs/DOC-14304
And please apply here for the CLA? https://cla.jboss.org