Because of the slow site where the documentation is hosted of the Maven Glassfish Plugin i decided to make a copy of the most important documentation for using the plugin.
Goals Overview
- glassfish:create-domain Create a new Glassfish domain. (Creating an existing domain will cause it to be deleted and recreated.)
- glassfish:start-domain Start an existing Glassfish domain. (Starting a non-existent domain will cause it to be created.)
- glassfish:create-virtual-server Create a new virtual server in a local or remote Glassfish instance
- glassfish:delete-domain Delete an existing domain in a local or remote Glassfish instance
- glassfish:deploy Deploy JavaEE artifacts to a running domain. (Deploying to an inactive domain will cause it to be started and created if necessary.)
- glassfish:redeploy Redeploy JavaEE artifacts to a running domain. (Cold redeployment by first calling undeploy and then deploy . Use deploy to effect a hot deployment.)
- glassfish:undeploy Undeploy JavaEE components from a running domain.
- glassfish:stop-domain Stop a running Glassfish domain.
- glassfish:delete-domain Delete an existing Glassfish domain.
create-domain
Required Parameters
domain Domain Container for domain configuration parameters.
glassfishDirectory File The root directory of the Glassfish installation to be used
Optional Parameters
domainDirectory File The directory into which domains are deployed. Default value is ${glassfishDirectory}/domains.
debug boolean Debug Glassfish output Default value is: false.
echo boolean Echo Glassfish asadmin commandsDefault value is: false.
terse boolean Terse Glassfish outputDefault value is: true.
skip boolean Skip executionDefault value is: false.
autoCreate boolean Automatically create the domain if it does not already existDefault value is: true.
user String The asadmin user to create for domain administration.Default value is: ${user.name}.
passwordFile String Location of the asadmin style password file (if you do not want to provide the password in your POM)
adminPassword String The admin password to use for this domain (if you would rather not use an asadmin style password file)
start-domain
Required Parameters
domain Domain Container for domain configuration parameters.
glassfishDirectory File The root directory of the Glassfish installation to be used
Optional Parameters
domainDirectory File The directory into which domains are deployed. Default value is ${glassfishDirectory}/domains.
debug boolean Debug Glassfish outputDefault value is: false.
echo boolean Echo Glassfish asadmin commandsDefault value is: false.
terse boolean Terse Glassfish outputDefault value is: true.
skip boolean Skip executionDefault value is: false.
autoCreate boolean Automatically create the domain if it does not already existDefault value is: true.
user String - The asadmin user to create for domain administration.Default value is: ${user.name}.
passwordFile String Location of the asadmin style password file (if you do not want to provide the password in your POM)
adminPassword String The admin password to use for this domain (if you would rather not use an asadmin style password file)
create-virtual-server
Required Parameters
domain Domain Container for domain configuration parameters.
glassfishDirectory File The root directory of the Glassfish installation to be used
Optional Parameters
domainDirectory File The directory into which domains are deployed. Default value is ${glassfishDirectory}/domains.
debug boolean Debug Glassfish outputDefault value is: false.
echo boolean Echo Glassfish asadmin commandsDefault value is: false.
terse boolean Terse Glassfish outputDefault value is: true.
skip boolean Skip executionDefault value is: false.
autoCreate boolean Automatically create the domain if it does not already existDefault value is: true.
user String - The asadmin user to create for domain administration.Default value is: ${user.name}.
passwordFile String Location of the asadmin style password file (if you do not want to provide the password in your POM)
adminPassword String The admin password to use for this domain (if you would rather not use an asadmin style password file)
deploy
Required Parameters
domain Domain Container for domain configuration parameters.
glassfishDirectory File The root directory of the Glassfish installation to be used
Optional Parameters
domainDirectory File The directory into which domains are deployed. Default value is ${glassfishDirectory}/domains.
debug boolean Debug Glassfish output Default value is: false.
echo boolean Echo Glassfish asadmin commands Default value is: false.
terse boolean Terse Glassfish outputDefault value is: true.
skip boolean Skip executionDefault value is: false.
autoCreate boolean Automatically create the domain if it does not already existDefault value is: true.
user String The asadmin user to create for domain administration. Default value is: ${user.name}.
passwordFile String Location of the asadmin style password file (if you do not want to provide the password in your POM)
adminPassword String The admin password to use for this domain (if you would rather not use an asadmin style password file)
redeploy
Required Parameters
components List The set of components we are publishing.
domain Domain Container for domain configuration parameters.
glassfishDirectory File The root directory of the Glassfish installation to be used
Optional Parameters
domainDirectory File - The directory into which domains are deployed. Default value is ${glassfishDirectory}/domains.
debug boolean - Debug Glassfish outputDefault value is: false.
echo boolean - Echo Glassfish asadmin commandsDefault value is: false.
terse boolean - Terse Glassfish outputDefault value is: true.
skip boolean - Skip executionDefault value is: false.
autoCreate boolean - Automatically create the domain if it does not already existDefault value is: true.
user String - The asadmin user to create for domain administration.Default value is: ${user.name}.
passwordFile String - Location of the asadmin style password file (if you do not want to provide the password in your POM)
adminPassword String - The admin password to use for this domain (if you would rather not use an asadmin style password file)
undeploy
Required Parameters
domain Domain Container for domain configuration parameters.
glassfishDirectory File The root directory of the Glassfish installation to be used
Optional Parameters
domainDirectory File The directory into which domains are deployed. Default value is ${glassfishDirectory}/domains.
debug boolean Debug Glassfish outputDefault value is: false.
echo boolean Echo Glassfish asadmin commandsDefault value is: false.
terse boolean Terse Glassfish outputDefault value is: true.
skip boolean Skip executionDefault value is: false.
autoCreate boolean Automatically create the domain if it does not already existDefault value is: true.
user String The asadmin user to create for domain administration.Default value is: ${user.name}.
passwordFile String Location of the asadmin style password file (if you do not want to provide the password in your POM)
adminPassword String The admin password to use for this domain (if you would rather not use an asadmin style password file)
stop-domain
Required Parameters
domain Domain Container for domain configuration parameters.
glassfishDirectory File The root directory of the Glassfish installation to be used
Optional Parameters
domainDirectory File The directory into which domains are deployed. Default value is ${glassfishDirectory}/domains.
debug boolean Debug Glassfish outputDefault value is: false.
echo boolean Echo Glassfish asadmin commandsDefault value is: false.
terse boolean Terse Glassfish outputDefault value is: true.
skip boolean Skip executionDefault value is: false.
autoCreate boolean Automatically create the domain if it does not already existDefault value is: true.
user String The asadmin user to create for domain administration.Default value is: ${user.name}.
passwordFile String Location of the asadmin style password file (if you do not want to provide the password in your POM)
adminPassword String The admin password to use for this domain (if you would rather not use an asadmin style password file)
delete-domain
Required Parameters
domain Domain Container for domain configuration parameters.
glassfishDirectory File The root directory of the Glassfish installation to be used
Optional Parameters
domainDirectory File The directory into which domains are deployed. Default value is ${glassfishDirectory}/domains.
debug boolean Debug Glassfish outputDefault value is: false.
echo boolean Echo Glassfish asadmin commandsDefault value is: false.
terse boolean Terse Glassfish outputDefault value is: true.
skip boolean Skip executionDefault value is: false.
autoCreate boolean Automatically create the domain if it does not already existDefault value is: true.
user String The asadmin user to create for domain administration.Default value is: ${user.name}.
passwordFile String Location of the asadmin style password file (if you do not want to provide the password in your POM)
adminPassword String The admin password to use for this domain (if you would rather not use an asadmin style password file)
Fairly Complete Configuration Example
<project>
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<version>2.1</version>
<configuration>
<glassfishDirectory>${glassfish.home}</glassfishDirectory>
<user>${domain.username}</user>
<adminPassword>${domain.password}</adminPassword>
<!-- <passFile>path/to/asadmin/passfile</passFile> -->
<autoCreate>true</autoCreate>
<debug>true</debug>
<echo>false</echo>
<terse>true</terse>
<skip>${test.int.skip}</skip>
<domain>
<name>${project.artifactId}</name>
<adminPort>4848</adminPort>
<httpPort>8080</httpPort>
<httpsPort>8443</httpsPort>
<iiopPort>3700</iiopPort>
<jmsPort>7676</jmsPort>
<reuse>false</reuse>
<jvmOptions>
<option>-Djava.security.auth.login.config=${project.build.testOutputDirectory}/login.conf</option>
</jvmOptions>
<properties>
<property>
<name>server.log-service.file</name>
<value>${domain.log.dir}/server.log</value>
</property>
</properties>
<auth>
<realm>
<name>testRealm</name>
<className>com.sun.enterprise.security.auth.realm.file.FileRealm</className>
<properties>
<property>
<name>jaas-context</name>
<value>test</value>
</property>
<property>
<name>file</name>
<value>${project.build.outputDirectory}/keyfile</value>
</property>
</properties>
</realm>
</auth>
<!-- <resourceDescriptor>path/to/resources.xml</resourceDescriptor> -->
<resources>
<connectionFactory>
<jndiName>jms/testQueueConnectionFactory</jndiName>
<type>queueConnectionFactory</type>
<properties>
<property>
<name>UserName</name>
<value>guest</value>
</property>
<property>
<name>Password</name>
<value>guest</value>
</property>
<property>
<name>AddressList</name>
<value>localhost:7676</value>
</property>
</properties>
</connectionFactory>
<jmsTopic>
<jndiName>jms/testTopic</jndiName>
<destinationName>TestTopic</destinationName>
<connectionFactory>
<jndiName>jms/testTopicConnectionFactory</jndiName>
<properties>
<property>
<name>UserName</name>
<value>guest</value>
</property>
<property>
<name>Password</name>
<value>guest</value>
</property>
<property>
<name>AddressList</name>
<value>localhost:7676</value>
</property>
</properties>
</connectionFactory>
</jmsTopic>
<jdbcDataSource>
<name>SomeDS</name>
<type>connectionPoolDataSource</type>
<poolName>SomePool</poolName>
<className>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</className>
<description>Some JDBC Connection Pool</description>
<allowNonComponentCallers>false</allowNonComponentCallers>
<validateConnections>true</validateConnections>
<validationMethod>metaData</validationMethod>
<properties>
<property>
<name>portNumber</name>
<value>3306</value>
</property>
<property>
<name>password</name>
<value>somePassword</value>
</property>
<property>
<name>user</name>
<value>someUser</value>
</property>
<property>
<name>serverName</name>
<value>some.host.somewhere</value>
</property>
<property>
<name>databaseName</name>
<value>SomeDB</value>
</property>
</properties>
</jdbcDataSource>
</resources>
</domain>
<components>
<component>
<name>${project.artifactId}</name>
<artifact>${project.build.directory}/artifacts/${project.build.finalName}.war</artifact>
</component>
</components>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>
Popularity: 25% [?]
Theo van Arem is a Integration specialist working at 

