The Deploy GlassFish plugin adds the capability to manage deployments and resources on the GlassFish application server. It can manage application artifacts, datasource and JMS resources via the GlassFish CLI, and can be extended to support more deployment options or management of new artifacts and resources on GlassFish.
For more information, see the Oracle GlassFish Server Plugin Reference.
- Deploy to domains, standalone servers, or clusters.
Deploy application artifacts:
- Enterprise applications (EAR)
- Web applications (WAR)
- Enterprise Java beans (EJB)
- Artifact references
- JDBC Connection Pools
- JDBC Resources
- JMS Connection Factories
- JMS Queues
- JMS Topics
- Resource references
- Use control tasks to create, destroy, start, and stop domains and standalone servers.
- Discover domains, standalone servers, and clusters.
The plugin works with the standard deployment package (DAR) format. The following is a sample
deployit-manifest.xml file that can be used to create a GlassFish specific deployment package. It contains declarations for a
glassfish.War, a connection pool (
glassfish.JdbcConnectionPoolSpec), and a JDBC resource (
glassfish.JdbcResourceSpec). It also contains references to target deployables to specific containers.
<?xml version="1.0" encoding="UTF-8"?> <udm.DeploymentPackage version="1.0" application="MyApp"> <deployables> <glassfish.War name="myWarFile" file="myWarFile/PetClinic-1.0.war"> <scanPlaceholders>false</scanPlaceholders> </glassfish.War> <glassfish.ApplicationRefSpec name="myWarRef"> <applicationName>myWarFile</applicationName> </glassfish.ApplicationRefSpec> <glassfish.JdbcConnectionPoolSpec name="connPool"> <datasourceclassname>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</datasourceclassname> <restype>javax.sql.DataSource</restype> </glassfish.JdbcConnectionPoolSpec> <glassfish.JdbcResourceSpec name="myJDBCResource"> <jndiName>myJDBCResource</jndiName> <poolName>connPool</poolName> </glassfish.JdbcResourceSpec> <glassfish.ResourceRefSpec name="MyJDBCResourceRef"> <resourceName>myJDBCResource</resourceName> </glassfish.ResourceRefSpec> </deployables> </udm.DeploymentPackage>
The plugin uses the GlassFish CLI to install and uninstall artifacts and resources. The plugin assumes that the GlassFish Domain has already been started. The plugin does not support the starting of the domain prior to a deployment.
GlassFish manages all the artifacts and resources in the domain. All artifacts and resources must be deployed directly to the domain. To target an application or resource to a specific container, you can use references. There are two types of deployables that can be used to deploy references:
ApplicationRefSpeccan be used to target applications to containers.
ResourceRefSpeccan be used to target resources to containers.
The CI name for all deployables will be used as identifier for the application or resource in GlassFish. The applications and resources are referenced by name.
An application can only be undeployed when there are no references to it.
Important: You must undeploy all references to the application when undeploying an application. The plugin checks if there are references, if references are found it will give an error.
The plugin supports discovery of Domains, Clusters, and Standalone Servers.
The Domain can be discovered through the Host that runs the Domain. The name of the CI should match the name of the Domain, Cluster or Standalone Server. The name of the container CI is used for the
--target parameter of the GlassFish CLI.
- Deploy will never discover cluster members. You can deploy any kind of deployable directly to the cluster, Deploy does not need to know about the instances of a cluster.
- Deploy will always discover the default Standalone Server of the domain called server.
- Deploy will only discover infrastructure CIs. No deployed CIs will be discovered.