6 changed files with 135 additions and 2 deletions
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
# Spring Boot Actuator Sample |
||||
|
||||
You can build this sample using Maven (>3) or Gradle (1.6). |
||||
|
||||
With Maven: |
||||
|
||||
``` |
||||
$ mvn package |
||||
$ java -jar target/*.jar |
||||
``` |
||||
|
||||
Then access the app via a browser (or curl) on http://localhost:8080 (the user name is "user" and look at the INFO log output for the password to login). |
||||
|
||||
With gradle: |
||||
|
||||
``` |
||||
$ gradle build |
||||
$ java -jar build/libs/*.jar |
||||
``` |
||||
|
||||
The gradle build contains an intentionally odd configuration to exclude the security dependencies from the executable JAR. So the app run like this behaves differently than the one run from the Maven-built JAR file. See comments in the `build.gradle` for details. |
||||
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
buildscript { |
||||
repositories { |
||||
mavenLocal() |
||||
maven { url "http://repo.springsource.org/libs-snapshot" } |
||||
} |
||||
dependencies { |
||||
classpath("org.springframework.boot:spring-boot-gradle-plugin:0.5.0.BUILD-SNAPSHOT") |
||||
} |
||||
} |
||||
|
||||
ext { |
||||
springBootVersion = '0.5.0.BUILD-SNAPSHOT' |
||||
} |
||||
|
||||
apply plugin: 'java' |
||||
apply plugin: 'eclipse' |
||||
apply plugin: 'idea' |
||||
apply plugin: 'spring-boot' |
||||
|
||||
jar { |
||||
baseName = 'spring-boot-sample-actuator' |
||||
version = '0.5.0' |
||||
} |
||||
|
||||
repositories { |
||||
mavenCentral() |
||||
maven { url "http://repo.springsource.org/libs-snapshot" } |
||||
} |
||||
|
||||
dependencies { |
||||
configurations { |
||||
insecure.exclude module: 'spring-boot-starter-security' |
||||
} |
||||
compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") |
||||
compile("org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}") |
||||
compile("org.springframework.boot:spring-boot-starter-security:${springBootVersion}") |
||||
testCompile("junit:junit:4.11") |
||||
insecure configurations.runtime |
||||
} |
||||
|
||||
// Slightly odd requirement (package a jar file as an insecure app, exlcuding Spring Security) |
||||
// just to demonstrate the "customConfiguration" feature of the Boot gradle plugin. |
||||
springBoot { |
||||
customConfiguration = "insecure" |
||||
} |
||||
|
||||
task wrapper(type: Wrapper) { |
||||
gradleVersion = '1.6' |
||||
} |
||||
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
# Spring Boot Simple Sample |
||||
|
||||
You can build this sample using Maven (>3) or Gradle (1.6). |
||||
|
||||
With Maven: |
||||
|
||||
``` |
||||
$ mvn package |
||||
$ java -jar target/*.jar |
||||
``` |
||||
|
||||
The app prints a Hello message on the console. |
||||
|
||||
With gradle: |
||||
|
||||
``` |
||||
$ gradle build |
||||
$ java -jar build/libs/*.jar |
||||
``` |
||||
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
buildscript { |
||||
repositories { |
||||
mavenLocal() |
||||
maven { url "http://repo.springsource.org/libs-snapshot" } |
||||
} |
||||
dependencies { |
||||
classpath("org.springframework.boot:spring-boot-gradle-plugin:0.5.0.BUILD-SNAPSHOT") |
||||
} |
||||
} |
||||
|
||||
ext { |
||||
springBootVersion = '0.5.0.BUILD-SNAPSHOT' |
||||
} |
||||
|
||||
apply plugin: 'java' |
||||
apply plugin: 'eclipse' |
||||
apply plugin: 'idea' |
||||
apply plugin: 'spring-boot' |
||||
|
||||
jar { |
||||
baseName = 'spring-boot-sample-simple' |
||||
version = '0.5.0' |
||||
} |
||||
|
||||
repositories { |
||||
mavenCentral() |
||||
maven { url "http://repo.springsource.org/libs-snapshot" } |
||||
} |
||||
|
||||
dependencies { |
||||
compile("org.springframework.boot:spring-boot-starter:${springBootVersion}") |
||||
testCompile("org.springframework.boot:spring-boot-starter-test:${springBootVersion}") |
||||
} |
||||
|
||||
task wrapper(type: Wrapper) { |
||||
gradleVersion = '1.6' |
||||
} |
||||
Loading…
Reference in new issue