## Liberty App Accelerator
This project was generated by the [Liberty app accelerator](http://ibm.biz/appaccelerator)

[![](https://img.shields.io/badge/IBM%20Cloud-powered-blue.svg)](https://cloud.ibm.com)
[![Platform](https://img.shields.io/badge/platform-java-lightgrey.svg?style=flat)](https://www.ibm.com/developerworks/learn/java/)

### Table of Contents
* [Summary](#summary)
* [Requirements](#requirements)
* [Configuration](#configuration)
* [Project contents](#project-contents)
* [Run](#run)
* [Notices](#notices)

### Summary

The Liberty App Accelerator provides a starting point for creating applications running on [WebSphere Liberty](https://developer.ibm.com/wasdev/).

{{#has platforms 'bluemix'}}
To deploy this application to IBM Cloud using a toolchain click the **Create Toolchain** button.
[![Create Toolchain](https://cloud.ibm.com/devops/graphics/create_toolchain_button.png)](https://cloud.ibm.com/devops/setup/deploy/)
{{/has}}

### Requirements
{{#has buildType 'maven'}}
* [Maven](https://maven.apache.org/install.html)
{{/has}}
{{#has buildType 'gradle'}}
* [Gradle](https://gradle.org/install)
{{/has}}
* Java 8: Any compliant JVM should work.
  * [Java 8 JDK from Oracle](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
  * [Java 8 JDK from IBM (AIX, Linux, z/OS, IBM i)](http://www.ibm.com/developerworks/java/jdk/),
    or [Download a Liberty server package](https://developer.ibm.com/assets/wasdev/#filter/assetTypeFilters=PRODUCT)
    that contains the IBM JDK (Windows, Linux)

### Configuration
The application is configured to provide various technologies and features. These capabilities are provided through dependencies in the {{#has buildType 'maven'}}pom.xml{{/has}}{{#has buildType 'gradle'}}build.gradle{{/has}} file and Liberty features enabled in the server config file found in `src/main/liberty/config/server.xml`.

### Project contents
The context root is set in the `src/main/webapp/WEB-INF/ibm-web-ext.xml` file. The ports are set in the {{#has buildType 'maven'}}pom.xml{{/has}}{{#has buildType 'gradle'}}build.gradle{{/has}} file.{{#has technologies 'msbuilder'}}

* **Microservice Builder** : Microservice Builder delivers a turnkey solution incorporating a runtime, tooling, DevOps, fabric, and customer-managed container orchestration. See the [Microservice Builder docs](https://developer.ibm.com/microservice-builder/) for more details.{{/has}} {{#has technologies 'microprofile'}}

* **MicroProfile** : The [MicroProfile project](http://microprofile.io/) is an open community with the aim of optimizing Enterprise Java for a microservices architecture.  MicroProfile will be evolving with guidance from the community. For the complete feature documentation, see the [microProfile-1.2](http://www.ibm.com/support/knowledgecenter/en/SSEQTP_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_feature_microProfile-1.2.html) feature description in IBM Knowledge Center. If you want to share your thoughts you can post straight to the [MicroProfile Google group](https://groups.google.com/forum/#!forum/microprofile).{{/has}} {{#has technologies 'persistence'}}

* **Persistence** : For the complete feature documentation, see the [jpa-2.1](http://www.ibm.com/support/knowledgecenter/en/SSEQTP_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_feature_jpa-2.1.html) feature description in IBM Knowledge Center.{{/has}} {{#has technologies 'rest'}}

* **REST** : Inside the project there is a application.rest package containing the `LibertyRestEndpoint` class. This adds a REST endpoint which you can access at `http://localhost:9080/<context>/rest`. There is also a test class named `it.rest.LibertyRestEndpointTest` that will test the REST endpoint to ensure it is working. For the complete feature documentation, see the [jaxrs-2.0](http://www.ibm.com/support/knowledgecenter/en/SSEQTP_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_feature_jaxrs-2.0.html) feature description in IBM Knowledge Center.{{/has}} {{#has technologies 'web'}}

* **Servlet** : Inside the project there is a application.servlet package containing the `LibertyServlet` class. This adds a servlet with an endpoint which you can access at `http://localhost:9080/<context>/servlet`. There is also a test named `it.servlet.LibertyServletTest` that will test the servlet's endpoint to ensure it is working. For the complete feature documentation, see the [servlet-3.1](http://www.ibm.com/support/knowledgecenter/en/SSEQTP_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_feature_servlet-3.1.html) feature description in IBM Knowledge Center.{{/has}} {{#has technologies 'springbootweb'}}

* **Springboot** : Inside the project there is a application.springboot.web package containing two classes:
    * `SpringBootLibertyApplication`: The entry point for the SpringBoot application.
    * `LibertyHelloController`: A Spring REST endpoint which you can access at `http://localhost:9080/<context>/springbootweb`

There is also a test class named `it.springboot.web.HelloControllerTest` that will test the Spring REST endpoint to ensure it is working.{{/has}} {{#has technologies 'swagger'}}

* **Swagger** : Swagger is a simple yet powerful representation of RESTful APIs. Discover REST APIs that are available on the Liberty server and then invoke the found REST endpoints using the Swagger user interface. (Username and password are specified in the server.xml). You can also easily expose the REST endpoints available from your web modules running on Liberty server by documenting the endpoints using the Swagger 2.0 Specification. It is also possible to follow a design-first approach by creating the Swagger documentation first and then generating the server code from it. For the complete feature documentation, see the [apiDiscovery-1.0](http://www.ibm.com/support/knowledgecenter/en/SSEQTP_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_feature_apiDiscovery-1.0.html) feature description in IBM Knowledge Center. {{/has}} {{#has technologies 'watsonsdk'}}

* **Watson SDK** : The Watson SDK provides an API for accessing Watson Services. For the complete documentation, take a look at [the Watson developer pages](https://developer.ibm.com/watson/) and [the Watson SDK github project](https://github.com/watson-developer-cloud/java-sdk).{{/has}} {{#has technologies 'websocket'}}

* **Websockets** : For the complete feature documentation, see the [websocket-1.1](http://www.ibm.com/support/knowledgecenter/en/SSEQTP_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_feature_websocket-1.1.html) feature description in IBM Knowledge Center.{{/has}} {{#has platforms 'bluemix'}}

The project contains IBM Cloud specific files that are used to deploy the application as part of an IBM Cloud DevOps flow. The `.bluemix` directory contains files used to define the IBM Cloud toolchain and pipeline for your application. The `manifest.yml` file specifies the name of your application in IBM Cloud, the timeout value during deployment and which services to bind to.
{{/has}}

### Run

To build and run the application:
1. {{#has buildType 'maven'}}`mvn install`{{/has}}{{#has buildType 'gradle'}}`gradle build`{{/has}}
1. {{#has buildType 'maven'}}`mvn liberty:run-server`{{/has}}{{#has buildType 'gradle'}}`gradle libertyStart`{{/has}}
{{#has buildType 'gradle'}}1. To stop the application run `gradle libertyStop`{{/has}} {{#has platforms 'bluemix'}}

To deploy the application to IBM Cloud:
1. {{{bxBuildCmd}}}

The application will be deployed to the following url: [http://{{appName}}.mybluemix.net/{{appName}}/]

Alternatively use the Toolchain button above.{{/has}}

### Endpoints

The context root is set in the `src/main/webapp/WEB-INF/ibm-web-ext.xml` file. The ports are set in the {{#has buildType 'maven'}}pom.xml{{/has}}{{#has buildType 'gradle'}}build.gradle{{/has}} file.

### Notices

This project was generated using:
{{#each genVersions}}
* {{@key}} v{{this}}
{{/each}}
