Here is a sample pom.xml configuration :
<build> <plugins> <plugin> <groupId>com.worldline.maven</groupId> <artifactId>openshift-maven-plugin</artifactId> <version>0.1-SNAPSHOT</version> <configuration> <password>${openshift.password}</password> <domain>myDomain</domain> <application>myApplication</application> </configuration> </plugin> </plugins> </build>
then to deploy on OpenShift simply execute:
mvn clean package openshift:update-application
Target | Description |
---|---|
openshift:add-cartridge |
Add an embedded cartridge to an existing application. |
openshift:cartridges |
List available cartridges. |
openshift:create-application |
Create an application. If the domain doesn’t exist it will be created. This target don’t send the project source code. |
openshift:create-domain |
Create a new domain. |
openshift:delete-application |
Delete an application. |
openshift:domains |
List all defined domains and applications. |
openshift:refresh |
Force an application to refresh. |
openshift:remove-cartridge |
Remove an embedded cartridge to an existing application. |
openshift:restart |
Force an application to restart. |
openshift:scale-down |
Force an application to scale down. |
openshift:scale-up |
Force an application to scale up. |
openshift:sshkeyadd |
Add an ssh key. |
openshift:sshkeycheck |
Check an ssh keys by name and add it if she’s missing. |
openshift:sshkeylist |
List all available ssh keys. |
openshift:start |
Force an application to start. |
openshift:stop |
Force an application to stop. |
openshift:update-application |
Update an existing application. |
To deploy your war as an exploded one add in the plugin configuration:
<binary>${project.build.directory}/${project.build.finalName}</binary>