glassfish-embedded-maven-plugin - how to deploy resources

筅森魡賤 提交于 2019-12-12 21:35:54

问题


I'm providing a quick and easy way for users to deploy my Java EE 6 application via glassfish-embedded-maven-plugin, so they don't have to install and configure a standalone glassfish. However, I'm running into trouble with resource deployment.

The app needs a JavaMail resource from the container, and needs a JAAS realm with a suitable role->user/group mapping.

When deploying to a standalone glassfish this is easily provided with a sun-resources.xml file and/or a couple of asadmin commands. However, I'm struggling to figure out how to do it with glassfish embedded.

Is there a way I can auto-deploy a glassfish-resources.xml in my pom as part of the glassfish-embedded-maven-plugin invocation? The documentation for the plugin is nearly nonexistent or refers to the badly out of date 2.1 version, and I'm increasingly stuck.


回答1:


It looks like the maven-embedded-glassfish-plugin is just too limited for this use case.

Instead, use the embedded glassfish api. This has changed completely in 3.1, but most of the web refers to the old 3.0.1 api, so most examples you can find will be wrong. Start here:

http://embedded-glassfish.java.net/nonav/apidocs/org/glassfish/embeddable/GlassFish.html



来源:https://stackoverflow.com/questions/5455268/glassfish-embedded-maven-plugin-how-to-deploy-resources

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!