[jboss-dev-forums] [JBoss AS 7 Development] - Extending AS 7

John Mazzitelli do-not-reply at jboss.com
Mon Nov 26 13:36:17 EST 2012


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
--------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20121126/8ab2efa1/attachment.html 


More information about the jboss-dev-forums mailing list