This plugin is the gradle version of was-maven-plugin
Plugin Page on Gradle Plugin Portal
- Introduction
- Installation
- Usage
- Customized Jython Script File
- Continues Deployment with Jenkins
- With Global Security Turned on
- Change Log
Gradle plugin to deploy a single war or ear to one or multi local or remote WebSphere Application Server (WAS) at a single build.
Tested on WAS 8.5
Requires: WebSphere Application Server installation on host box! But no need to be configured, nor running.
Requires: JDK 7 or later
Name | Type | Description |
---|---|---|
wasHome | String | WebSphere Application Server home. Default: ${env.WAS_HOME} , required |
applicationName | String | Application name displayed in admin console. Default: ${project.name} |
applicationNameSuffix | String | Will be appended to applicationName, as applicationName_applicationNameSuffix , property file only |
host | String | Local/Remote WAS IP/domain URL. e.g. 10.95.0.100 , devtrunk01.company.com , default: localhost |
port | String | Default: 8879 (when cluster not empty); 8880 (when cluster empty) |
connectorType | String | Default: SOAP |
cluster | String | Target cluster name, required if target WAS is a cluster |
cell | String | Target cell name |
node | String | Target node name, |
server | String | Target server name, |
webservers | String | Target web server(s) name, comma-separated. |
virtualHost | String | Target virtual host name |
user | String | Account username for target WAS admin console, if global security is turned on |
password | String | Account password for target WAS admin console, if global security is turned on |
contextRoot | String | required for war deployment |
sharedLibs | String | Bind the exist shared libs to ear/war, comma-separated (,) |
parentLast | Boolean | true to set classloader mode of application to PARENT_LAST , default false |
restartAfterDeploy | Boolean | true to restart server after deploy, false to start application directly. Default true |
webModuleParentLast | Boolean | true to set classloader mode of web module to PARENT_LAST , default false |
packageFile | String | The EAR/WAR package that will be deployed to remote RAS, Default value is been calculated. |
failOnError | Boolean | Default: false Whether failed the build when failed to deploy. |
verbose | Boolean | Whether show more detailed info in log |
script | String | Your own jython script for deployment. Double braces for variables, such as: {{cluster}} |
scriptArgs | String | Args that will be passed to the script |
javaoption | String | Sample -Xmx1024m , -Xms512m -Xmx1024m |
deployOptions | String | Sample -precompileJSPs , -precompileJSPs -deployws |
preSteps | Ant tasks | Ant tasks that can be executed before the deployments |
postSteps | Ant tasks | Ant tasks that can be executed after the deployments |
deploymentsPropertyFile | File | Configuring above params (except those in bold) for multi targets. Default: was-gradle-plugin.properties |
Generally, you need to specify at least
cluster
for a clusterserver
andnode
for a non-cluster
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.orctom.gradle.was:was-gradle-plugin:1.1"
}
}
apply plugin: "com.orctom.was"
plugins {
id "com.orctom.was" version "1.1"
}
was {
applicationName = 'my-app-name'
host = 'localhost'
server = 'server01'
node = 'node01'
virtualHost = 'default_host'
verbose = 'true'
}
gradle build was
Please create was-gradle-plugin.properties
at your project root, and put configurations into it.
The section name (inside the spare-brackets, such as dev-trunk
) will be used to identify the target WAS.
And you don't have to have was {...}
section configured in build.gradle in this case.
[DEFAULT]
virtualHost=default_host
[dev-trunk1]
host=devtrunk1.company.com
applicationNameSuffix=trunk1
cluster=cluster01
server=server01
[dev-trunk2]
host=devtrunk2.company.com
applicationNameSuffix=trunk2
cluster=cluster02
server=server02
[dev-trunk3]
host=devtrunk3.company.com
applicationNameSuffix=trunk3
cluster=cluster03
server=server03
virtualHost=devtrunk3_host
Deploy to dev-trunk1
and dev-trunk2
gradle was -Ddeploy_targets=dev-trunk1,dev-trunk2
Deploy to dev-trunk2
and dev-trunk3
gradle was -Ddeploy_targets=dev-trunk2,dev-trunk3
This plugin also supports customized jython script if you need to tween the installation options, such server mappings.
You can copy-create it from the built-in one, or write a totally different one of you own.
Double braces for variables, such as: {{cluster}}
, properties in was-gradle-plugin.properties are all available as variables.
We could move this plugin to a profile, and utilize Extended Choice Parameter plugin to make this parameterized.
Configure
Trigger
When Global Security is enabled on remote WAS (not under a same deployment manager), certificates of remote WAS need to be added to local trust store. We could configure WAS to prompt to add them to local trust store.
- Open ${WAS_HOME}/properties/ssl.client.props
- Change the value of
com.ibm.ssl.enableSignerExchangePrompt
togui
orstdin
gui
: will prompt a Java based window, this requires a X window installed.stdin
: when using ssh, or on client linux without X window installed.
- Added support for IHS webserver mapping for standalone WAS.
- Fixed issue multi shared libs only the last one got bound
- Fixed issue for workspace path includes whitespaces.
- Fixed issue of NullPointerException when some property is not configured.
- Fixed issue of not starting application on standalone WAS (restartAfterDeploy=false)
- Fixed server mapping issue with cluster. Apps will be deployed to all servers that managed by the specified cluster.
- Web servers support, use
webservers
to specify the web server(s) that you want to bind. (but you still have to 'update web server plug-in configuration' by your self.) - Added parameter
deployOptions
, expecting space-separated options such as-precompileJSPs -deployws
, which will be prepended in the deployment options. - Fixed issue about
failOnError
.