Create Java+Tomcat language pack to run Java web applications
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Solum |
Fix Committed
|
High
|
Unassigned |
Bug Description
We want Solum to run Java web applications on Tomcat application container. This bug is regarding creating a Java+Tomcat language pack which would allow Solum to do this.
High-level Details:
-------
Given a repository containing Java code, we want Solum to:
- create a war file
- deploy the war file to Tomcat
- start the application
One approach to achieve this is to build a Java+Tomcat language pack which application developers can specify in their plan files while working with Java applications. The language pack would contain latest versions of JDK, JRE, Maven and Tomcat. As documented in the custom-
Once this language pack is available in Glance, application developers would use it as follows:
1) Specify this language pack in their plan file
2) As part of build-app execute the following steps/commands within the context of the language pack (i.e. by spinning up the language pack container)
2.1) Git clone the repository (git clone <java-repo>)
2.2) Spin-up container and inject the application source code into it
2.3) Build the war file (mvn clean compile)
2.4) Copy the war file to appropriate location (cp <path to app.war> to <path to Tomcat webapps directory>)
2.5) Snapshot the container image
2.6) Upload it to glance
Steps 2.1, 2.2, 2.5, 2.6 are already being done by Solum (see build-app script).
For steps 2.3 and 2.4 we propose to modify the plan file to contain a new attribute (build_cmd) whose value would be a script that the application developer would need to provide in their application repository. Solum would then execute this script as part of the 'build-app'. For example here is a plan file for a Java
version: 1
name: chef
description: sample java application
artifacts:
- name: Java test application
artifact_type: Java
content:
href: <git path to sample Java web application>
language_pack: java_maven_tomcat
build_cmd: ./build.sh
Here we propose that 'build.sh' be provided by the application developer. This script may contain following commands:
- mvn clean compile (build the war file)
- cp ./WEB-INF/
Other aspects to consider:
-------
Q) Can we use Cloudfoundry's Java buildpack (https:/
A) Need more investigation.
Changed in solum: | |
assignee: | nobody → Gilbert Pilz (gilbert.pilz) |
Changed in solum: | |
milestone: | none → 2015.1.1 |
Are existing Java Buildpacks not suitable?
For example, what about: http:// blog.cloudfound ry.org/ 2013/09/ 06/introducing- the-cloud- foundry- java-buildpack/