John Mazzitelli [
https://community.jboss.org/people/mazz] commented on the document
"Extending AS 7"
To view all comments on this document, visit:
https://community.jboss.org/docs/DOC-25627#comment-11173
--------------------------------------------------
For the record, here's some code that answers my question I had with the Mixed
Approach supporing exploded deployments (I tested this and it works) - thanks to Brian
for pointing me to the correct way to build the contentItem ModelNode. I put this if-stmt
in there just to show you how you can do both exploded and unexploded deployment via this
Mixed Approach (this is code that can go in Brian's prototype):
URL url = module.getExportedResource("fibo.ear");
ModelNode contentItem = new ModelNode();
boolean explodedDeployment = true; // this is here just to keep the code
around that deploys if we are unexploded
if (explodedDeployment) {
String urlString = new File(url.toURI()).getAbsolutePath();
contentItem.get(PATH).set(urlString);
contentItem.get(ARCHIVE).set(false);
} else {
String urlString = url.toExternalForm();
contentItem.get(URL).set(urlString);
}
op.get(CONTENT).add(contentItem);
So the idea is that you don't have to package fibo.ear as an unexploded deployment
file in your module - you can actually package your module with fibo.ear exploded and this
will enable it to be deployed properly
--------------------------------------------------