本文介绍了glassfish-embedded-maven-plugin - 如何部署资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为用户通过glassfish-embedded-maven-plugin部署我的Java EE 6应用程序提供了一种快捷方便的方式,因此他们不必安装和配置独立的glassfish。但是,我遇到了资源部署的麻烦。



应用程序需要容器中的JavaMail资源,并且需要具有合适角色的用户的JAAS领域 - >用户/组映射。

部署到独立的glassfish时,可以使用sun-resources.xml文件和/或几个asadmin命令轻松提供。然而,我正在努力弄清楚如何使用glassfish嵌入它。



有没有一种方法可以在我的pom中自动部署glassfish-resources.xml作为glassfish-embedded-maven-plugin调用的一部分?插件的文档几乎不存在,或者指的是严重过时的2.1版本,而且我越来越陷入困境。

解决方案

看起来maven-embedded-glassfish-plugin对于这个用例太有限了。



相反,使用嵌入式glassfish api。这在3.1中已经完全改变了,但是大多数web引用了旧的3.0.1 api,所以你可以找到的大多数例子都是错误的。从这里开始:




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.

解决方案

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

这篇关于glassfish-embedded-maven-plugin - 如何部署资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 09:12