Application Project Deployment - Maven
Search form
Introduction
Many of today's organizations utilize Apache Maven in their software manufacturing process. iWay provides a maven plugin to both build and deploy artifacts within a maven manufacturing cycle.
The best resource for understanding what this plugin can do is to refer to the documentation as described below.
iWay8 Maven Plugin Documentation
Figure #1 : iWay Maven Plugin Online Documentation
Test Run - Working with Maven
Lets take a look at how we can utilize this plugin in both building and deploying an iWay Application. To get started create a new Application Project and click on the check box "Use Maven" as shown below.
Figure #2 : iWay Application Project Creation
The Application Project wizard will prompt you for information for creating a valid Maven POM file.
Figure #3 : iWay Application Project Creation - Setting Deployment Name
Upon wizard completion a pom file is included in the newly created application project as shown below in Figure #4.
Figure #4 : iWay Application Project Creation - Maven pom file.
Understanding POM.xml - Properties
The gernated pom file is intended to be edited by the user. Most of if not all the values have been abstracted as properties as shown below:
<properties>
<server.url>http://localhost:9000</server.url>
<server.userid>iway</server.userid>
<server.password>ENCR(3253311731043128315432252993185)</server.password>
<targetserver.version>8.0.3-SNAPSHOT</targetserver.version>
<template.name></template.name>
<template.file>${basedir}/../Templates/${template.name}.iwtemplate/${template.name}.ita</template.file>
<deployment.name>mydemo</deployment.name>
<application.name>bundle</application.name>
<application.console.port></application.console.port>
<application.file>${basedir}/${application.name}.iia</application.file>
</properties>
Figure #5 : Maven pom file properties
By default many of these values do not need to be changed. However its best to read the pom.xml file to see how they are used.
Understanding POM.xml - Profiles
There are several maven profiles defined in the pom.xml to make calling it a bit easier.
They are defined in the pom file as shown below:
Maven Profiles
Name | Description |
---|---|
publish-iia | Publish an application archive to a server runtime instance. |
unpublish-iia | Delete an application archive from a server runtime instance. |
publish-template | Publish a deployment template to a server runtime instance. |
unpublish-template | Delete a deployment template from a server runtime instance. |
deploy | Deploy an iWay application as a runtime instance. |
undeploy | Undeploy an iWay application from a server runtime instance |
start | Start a deployed runtime instance. |
stop | Stop a deployed runtmie instance. |
docker-image | Create an iWay Application docker image. |
Lets try and build, publish and deploy an iWay Application using the generated pom file.
Building an iWay Application
To build the iWay Application enter "mvn package" as shown below
D:\IIT\workspace\mydemo\bundle.iab>mvn package
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building bundle 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- iway8-maven-plugin:8.0.3-SNAPSHOT:compile (default) @ mydemo ---
[iway8-plugin:compile] Building Application "bundle" in D:\IIT\workspace\mydemo\bundle.iab/bundle.iab
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.220s
[INFO] Finished at: Wed Nov 28 15:33:53 EST 2018
[INFO] Final Memory: 17M/491M
[INFO] ------------------------------------------------------------------------
D:\IIT\workspace\mydemo\bundle.iab>
iWay Application Publishing
To publish an iWay Application enter "mvn package" and invoke the profile as shown below:
D:\IIT\workspace\mydemo\bundle.iab>mvn package -P publish-iia
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building bundle 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- iway8-maven-plugin:8.0.3-SNAPSHOT:compile (default) @ mydemo ---
[iway8-plugin:compile] Building Application "bundle" in D:\IIT\workspace\mydemo\bundle.iab/bundle.iab
[INFO]
[INFO] --- iway8-maven-plugin:8.0.3-SNAPSHOT:publish-application (default) @ mydemo ---
[iway8-plugin:publish-application] Uploading Application "bundle.iia" at D:\IIT\workspace\mydemo\bundle.iab\bundle.iia to http://localhost:9000
[iway8-plugin:publish-application] Logging in as iway...
[iway8-plugin:publish-application] Done.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.392s
[INFO] Finished at: Wed Nov 28 15:43:49 EST 2018
[INFO] Final Memory: 17M/491M
[INFO] ------------------------------------------------------------------------
D:\IIT\workspace\mydemo\bundle.iab>
Deploying an iWay Application
To deploy an iWay Application enter "mvn package" and invoke the profile as shown below:
D:\IIT\workspace\mydemo\bundle.iab>mvn package -P deploy
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building bundle 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- iway8-maven-plugin:8.0.3-SNAPSHOT:compile (default) @ mydemo ---
[iway8-plugin:compile] Building Application "bundle" in D:\IIT\workspace\mydemo\bundle.iab/bundle.iab
[INFO]
[INFO] --- iway8-maven-plugin:8.0.3-SNAPSHOT:deploy-application (default) @ mydemo ---
[iway8-plugin:deploy-application] Deploying Application "bundle" to http://localhost:9000 as "mydemo" using template "raw".
[iway8-plugin:deploy-application] Logging in as iway...
[iway8-plugin:deploy-application] Done.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.581s
[INFO] Finished at: Wed Nov 28 16:11:21 EST 2018
[INFO] Final Memory: 18M/491M
[INFO] ------------------------------------------------------------------------
D:\IIT\workspace\mydemo\bundle.iab>
Starting the Application
To start an iWay Application enter "mvn package" and invoke the profile as shown below:
D:\IIT\workspace\mydemo\bundle.iab>mvn package -P start
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building bundle 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- iway8-maven-plugin:8.0.3-SNAPSHOT:compile (default) @ mydemo ---
[iway8-plugin:compile] Building Application "bundle" in D:\IIT\workspace\mydemo\bundle.iab/bundle.iab
[INFO]
[INFO] --- iway8-maven-plugin:8.0.3-SNAPSHOT:start-application (default) @ mydemo ---
[iway8-plugin:start-application] Logging in as iway...
[iway8-plugin:start-application] Checking status...
[iway8-plugin:start-application] Deployed application "mydemo" on http://localhost:9000 is down
[iway8-plugin:start-application] Issuing start...
[iway8-plugin:start-application] Checking status...
[iway8-plugin:start-application] Application deployment mydemo is active.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.708s
[INFO] Finished at: Wed Nov 28 16:21:36 EST 2018
[INFO] Final Memory: 18M/491M
[INFO] ------------------------------------------------------------------------
D:\IIT\workspace\mydemo\bundle.iab>
Stopping the Application
To stop an iWay Application enter "mvn package" and invoke the profile as shown below:
D:\IIT\workspace\mydemo\bundle.iab>mvn package -P stop
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building bundle 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- iway8-maven-plugin:8.0.3-SNAPSHOT:compile (default) @ mydemo ---
[iway8-plugin:compile] Building Application "bundle" in D:\IIT\workspace\mydemo\bundle.iab/bundle.iab
[INFO]
[INFO] --- iway8-maven-plugin:8.0.3-SNAPSHOT:stop-application (default) @ mydemo ---
[iway8-plugin:stop-application] Logging in as iway...
[iway8-plugin:stop-application] Checking status...
[iway8-plugin:stop-application] Deployed application "mydemo" on http://localhost:9000 is up
[iway8-plugin:stop-application] Issuing stop...
[iway8-plugin:stop-application] Checking status...
[iway8-plugin:stop-application] Application deployment mydemo is stopped.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.407s
[INFO] Finished at: Wed Nov 28 16:42:43 EST 2018
[INFO] Final Memory: 17M/491M
[INFO] ------------------------------------------------------------------------
D:\IIT\workspace\mydemo\bundle.iab>