Skip to content

Commit

Permalink
Merge pull request #5 from puncha/develop
Browse files Browse the repository at this point in the history
Release v1.0.0
  • Loading branch information
PunChaFeng authored Aug 16, 2016
2 parents a1f6e52 + 66ad3a3 commit caf4039
Show file tree
Hide file tree
Showing 762 changed files with 285,333 additions and 558 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
bower_components/
node_modules/
out/
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
language: java
jdk:
- oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
deploy:
provider: heroku
api_key: 8fe44b71-bef1-4fc7-87f3-f6825f19952f
on:
all_branches: true
branch: master
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Pet Clinic by Spring Boot in Java v0.3.0
# Pet Clinic by Spring Boot in Java v1.0.0

------

Expand All @@ -8,16 +8,25 @@ Implement the Spring 4 Sample Pet Clinic project for practice.
## Source
1. GitHub: https://github.com/puncha/java-petclinic
2. Travis CI: [![Build Status](https://travis-ci.org/puncha/java-petclinic.svg)](https://travis-ci.org/puncha/java-petclinic)
3. Heroku Demo: https://java-petclinic.herokuapp.com/
3. CodeShip CI: [![Build Status](https://codeship.com/projects/4b274a90-45f7-0134-2d77-0aad117e5610/status)](https://codeship.com/projects/168779)
4. Heroku Demo: https://java-petclinic.herokuapp.com/

## Run
```bash
gradle bootRun
./gradlew bootRun
```

## Test
```bash
gradle check
./gradlew check
```

## Cross platform desktop app
Install nodejs 6.x first and run:
```bash
cd src/main/electron_app/
npm i
node_modules/.bin/electron .
```

## References
Expand All @@ -27,6 +36,12 @@ gradle check
- Official Site: http://projects.spring.io/spring-roo/

## Change Logs
- v1.0.0:
- CSS is changed to Bootstrap 4 alpha3.
- Form validation is added.
- Site of JSP version is implemented.
- Site of AngularJs1 + Restful Controller is implemented.
- Prototype of Electron App is ready for try.
- v0.4.0:
- Pet page is implemented. Users can list, create, edit and delete pets.
- Known issue: pet with visit events fail to be deleted.
Expand All @@ -35,4 +50,4 @@ gradle check
- v0.2.0:
- Error page is implemented. User can see how the site handles exceptions.
- v0.1.0:
- Index page is implemented. User can see the home page of the site.
- Index page is implemented. User can see the home page of the site.
40 changes: 30 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext {
springBootVersion = '1.3.3.RELEASE'
springBootVersion = '1.4.0.RELEASE'
}
repositories {
mavenCentral()
Expand All @@ -22,19 +22,39 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
jcenter()
}


configurations {
compile.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}

dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-jdbc'
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
providedRuntime 'org.apache.tomcat.embed:tomcat-embed-jasper'
providedRuntime 'javax.servlet:jstl'
providedRuntime 'org.hsqldb:hsqldb'
testCompile 'org.springframework.boot:spring-boot-starter-test'
compile "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
compile "org.springframework.boot:spring-boot-starter-web-services:${springBootVersion}"
compile "org.springframework.boot:spring-boot-starter-log4j2:${springBootVersion}"
compile "org.springframework.boot:spring-boot-starter-jdbc:${springBootVersion}"
compile "org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}"
compile "org.mybatis.spring.boot:mybatis-spring-boot-starter:1.1.1"
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.6.3"
compile "org.apache.poi:poi:3.14"
compile "com.lowagie:itext:4.2.1"
compile "com.rometools:rome:1.7.0"
providedRuntime "org.springframework.boot:spring-boot-starter-tomcat:${springBootVersion}"
providedRuntime "org.springframework.boot:spring-boot-devtools:${springBootVersion}"
providedRuntime "org.apache.tomcat.embed:tomcat-embed-jasper:8.5.3"
providedRuntime "javax.servlet:jstl"
providedRuntime "org.hsqldb:hsqldb:2.3.3"
providedRuntime "mysql:mysql-connector-java:5.1.39"
testCompile "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
testCompile "org.apache.httpcomponents:httpclient:4.5.2"
testCompile "net.sourceforge.htmlunit:htmlunit:2.23"
}

bootRun {
String activeProfile = System.properties['spring.profiles.active']
systemProperty "spring.profiles.active", activeProfile
}


Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Sat Mar 26 00:46:15 CST 2016
#Tue Aug 16 01:47:38 CST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
46 changes: 25 additions & 21 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,30 @@
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

Expand All @@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -40,26 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
Expand All @@ -85,7 +89,7 @@ location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
Expand Down
8 changes: 4 additions & 4 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

Expand Down Expand Up @@ -46,7 +46,7 @@ echo location of your Java installation.
goto fail

:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
Expand Down
10 changes: 10 additions & 0 deletions src/main/electron_app/electron_app.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Nodejs Project Dependencies" level="project" />
</component>
</module>
25 changes: 25 additions & 0 deletions src/main/electron_app/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"use strict";

const {app, BrowserWindow} = require('electron');


let window = null;

function createWindow() {
window = new BrowserWindow({width: 1024, height: 768});
window.loadURL("http://localhost:8080/ng1/index.html");
}

app.commandLine.appendSwitch('--disable-http-cache');

app.on("ready", createWindow);

app.on('window-all-closed', ()=> {
if(process.platform !== 'darwin') {
app.quit();
}
});

app.on('activate', ()=> {
if(win === null) createWindow();
});
27 changes: 27 additions & 0 deletions src/main/electron_app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "PetClinictron",
"productName": "Pet Clinic Electron Application",
"version": "0.1.0",
"description": "Electron Application for PetClinic",
"main": "main.js",
"scripts": {
"start": "node_modules/.bin/electron .",
"dev": "node_modules/.bin/electron . --debug",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "PunCha Feng",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/puncha/java-petclinic.git"
},
"homepage": "https://java-petclinic.herokuapp.com",
"keywords": [
"Electron",
"PetClinic",
"study"
],
"dependencies": {
"electron-prebuilt": "latest"
}
}
2 changes: 1 addition & 1 deletion src/main/java/tk/puncha/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;

@SpringBootApplication
@SpringBootApplication //includes @EnableAutoConfiguration
public class Application extends SpringBootServletInitializer {

@Override
Expand Down
Loading

0 comments on commit caf4039

Please sign in to comment.