Update gradle tooling and readme instructions

This commit is contained in:
Andrew Guibert 2017-12-15 14:35:48 -06:00
parent 8cc531ab90
commit 206776f5c3
4 changed files with 70 additions and 28 deletions

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Liberty 17.3"/>
<fixed facet="wst.jsdt.web"/>
<fixed facet="jst.web"/>
<fixed facet="java"/>

View File

@ -1,21 +1,22 @@
# project-tron
Cloned from https://github.com/aguibert/coms319-project4
Publicly hosted on IBM Cloud here: [http://projecttron.mybluemix.net/](http://projecttron.mybluemix.net/)
Original readme.md:
Bluemix toolchain automatically deploys the current `project-tron/project-tron:master` branch
coms319-project4
================
## Setup Instructions
1. You will need Eclipse for Java EE developers (normal eclipse won't do)
2. Go to wasdev.net, download the latest beta image and eclipse tooling https://developer.ibm.com/wasdev/downloads/liberty-profile-beta/
1. Follow the steps for "Installing with the Eclipse tools beta" to install the tooling
2. Follow the steps for "Installing from the command line" to install the runtime
3. Once you clone the repository, import existing projects into your workspace
4. Create the server runtime:
1. In eclipse, File->Server->Runtime Environments->Add... Websphere Application Server Liberty Profile
2. Next, browse for the location where you extracted your Wepshere runtime, then click Finish
5. In the servers view (select )
6. Name the server "project4-server"
7. Add the coms319.team10.project4 resource to the server, then click finish.
8. In the "server" tab, you should have created a "project4-server" server, you can start it by selecting it and pressing the green play button in the server tab.
## To run locally
Builds the webapp, starts liberty server, and deploys app to server. Once app is running, opens web browser
```
./gradlew libertyStart openBrowser
```
To stop a liberty server, issue the command:
```
./gradlew libertyStop
```
(Note that `libertyRun` and `libertyStart` commands will first invoke `libertyStop`)
Originally cloned from https://github.com/aguibert/coms319-project4

View File

@ -1,21 +1,54 @@
// Apply the java plugin to add support for Java
apply plugin: 'java'
// Apply the war plugin to build a web archive
apply plugin: 'liberty'
apply plugin: 'war'
sourceCompatibility = 1.8
// In this section you declare where to find the dependencies of your project
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'net.wasdev.wlp.gradle.plugins:liberty-gradle-plugin:2.0.1'
}
}
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}
// In this section you declare the dependencies for your production and test code
dependencies {
// Java EE
compile 'javax:javaee-api:7.0'
libertyRuntime 'io.openliberty:openliberty-runtime:17.0.0.3'
}
ext {
httpPort = 8080
httpsPort = 8443
}
liberty {
server {
name = 'tronServer'
dropins = [war]
bootstrapProperties = ['httpPort': httpPort, 'httpsPort': httpsPort]
}
}
libertyStart.dependsOn 'libertyStop'
libertyRun.dependsOn 'libertyStop'
task openBrowser {
description = 'Opens a web browser to http://localhost:${httpPort}/'
doLast {
java.awt.Desktop.desktop.browse "http://localhost:${httpPort}/".toURI()
}
}
gradle.taskGraph.whenReady { graph ->
if (graph.hasTask(":libertyStart")) {
libertyStart.doLast {
println ("Application is running on http://localhost:${httpPort}/")
}
}
}

View File

@ -0,0 +1,9 @@
<server>
<featureManager>
<feature>webProfile-7.0</feature>
</featureManager>
<httpEndpoint id="defaultHttpEndpoint" httpPort="${httpPort}" httpsPort="${httpsPort}" />
<applicationManager autoExpand="true"/>
</server>