Skip to content

Commit bfa1fe6

Browse files
the-james-burtonJohannes Stelzer
authored andcommitted
add sample for war-file deployment
1 parent db769e2 commit bfa1fe6

File tree

10 files changed

+220
-137
lines changed

10 files changed

+220
-137
lines changed

pom.xml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,56 +8,46 @@
88
<version>1.2.5.RELEASE</version>
99
<relativePath /> <!-- lookup parent from repository -->
1010
</parent>
11-
1211
<groupId>de.codecentric</groupId>
1312
<artifactId>spring-boot-admin</artifactId>
1413
<version>1.3.0-SNAPSHOT</version>
1514
<packaging>pom</packaging>
16-
1715
<name>Spring Boot Admin</name>
1816
<description>Spring Boot Admin</description>
1917
<url>https://github.com/codecentric/spring-boot-admin/</url>
20-
2118
<properties>
2219
<java.version>1.7</java.version>
2320
<main.basedir>${basedir}</main.basedir>
2421
<passphrase>${gpg.passphrase}</passphrase>
25-
2622
<spring-boot.version>1.2.5.RELEASE</spring-boot.version>
2723
<hazelcast.version>3.3.3</hazelcast.version>
2824
<commons-lang3.version>3.3.2</commons-lang3.version>
2925
<spring-cloud.version>Angel.SR3</spring-cloud.version>
30-
3126
<build-plugin.jacoco.version>0.7.3.201502191951</build-plugin.jacoco.version>
3227
<build-plugin.coveralls.version>3.0.1</build-plugin.coveralls.version>
3328
<build-plugin.gpg.version>1.5</build-plugin.gpg.version>
3429
</properties>
35-
3630
<modules>
3731
<module>spring-boot-admin-server</module>
3832
<module>spring-boot-admin-server-ui</module>
3933
<module>spring-boot-admin-samples</module>
4034
<module>spring-boot-admin-starter-client</module>
4135
</modules>
42-
4336
<organization>
4437
<name>codecentric AG</name>
4538
<url>http://www.codecentric.de</url>
4639
</organization>
47-
4840
<licenses>
4941
<license>
5042
<name>Apache License, Version 2.0</name>
5143
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
5244
</license>
5345
</licenses>
54-
5546
<scm>
5647
<connection>scm:git:git://github.com/codecentric/spring-boot-admin.git</connection>
5748
<developerConnection>scm:git:ssh://[email protected]/codecentric/spring-boot-admin.git</developerConnection>
5849
<url>https://github.com/codecentric/spring-boot-admin</url>
5950
</scm>
60-
6151
<developers>
6252
<developer>
6353
<name>Thomas Bosch</name>
@@ -70,7 +60,6 @@
7060
<organization>codecentric AG</organization>
7161
</developer>
7262
</developers>
73-
7463
<build>
7564
<plugins>
7665
<plugin>
@@ -180,7 +169,6 @@
180169
</build>
181170
</profile>
182171
</profiles>
183-
184172
<distributionManagement>
185173
<snapshotRepository>
186174
<id>sonatype-nexus-snapshots</id>
@@ -193,7 +181,6 @@
193181
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
194182
</repository>
195183
</distributionManagement>
196-
197184
<dependencyManagement>
198185
<dependencies>
199186
<dependency>
@@ -216,21 +203,18 @@
216203
<artifactId>spring-boot-admin-example</artifactId>
217204
<version>${project.version}</version>
218205
</dependency>
219-
220206
<dependency>
221207
<groupId>org.springframework.boot</groupId>
222208
<artifactId>spring-boot-starter-web</artifactId>
223209
<version>${spring-boot.version}</version>
224210
</dependency>
225-
226211
<dependency>
227212
<groupId>org.springframework.cloud</groupId>
228213
<artifactId>spring-cloud-starter-parent</artifactId>
229214
<version>${spring-cloud.version}</version>
230215
<type>pom</type>
231216
<scope>import</scope>
232217
</dependency>
233-
234218
<dependency>
235219
<groupId>com.hazelcast</groupId>
236220
<artifactId>hazelcast</artifactId>
@@ -241,7 +225,6 @@
241225
<artifactId>hazelcast-spring</artifactId>
242226
<version>${hazelcast.version}</version>
243227
</dependency>
244-
245228
<!-- Test -->
246229
<dependency>
247230
<groupId>org.springframework</groupId>
@@ -251,7 +234,6 @@
251234
</dependency>
252235
</dependencies>
253236
</dependencyManagement>
254-
255237
<repositories>
256238
<repository>
257239
<id>spring-release</id>

spring-boot-admin-samples/pom.xml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
5-
<parent>
6-
<groupId>de.codecentric</groupId>
7-
<artifactId>spring-boot-admin</artifactId>
8-
<version>1.3.0-SNAPSHOT</version>
9-
<relativePath>..</relativePath>
10-
</parent>
11-
<groupId>de.codecentric</groupId>
12-
<artifactId>spring-boot-admin-samples</artifactId>
13-
<packaging>pom</packaging>
14-
<name>Spring Boot Admin Samples</name>
15-
<description>Spring Boot Admin Samples</description>
16-
<url>https://github.com/codecentric/spring-boot-admin/</url>
17-
18-
<properties>
19-
<main.basedir>${basedir}/..</main.basedir>
20-
</properties>
21-
<modules>
22-
<module>spring-boot-admin-sample</module>
23-
<module>spring-boot-admin-sample-discovery</module>
24-
<module>spring-boot-admin-sample-hazelcast</module>
25-
</modules>
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>de.codecentric</groupId>
7+
<artifactId>spring-boot-admin</artifactId>
8+
<version>1.3.0-SNAPSHOT</version>
9+
<relativePath>..</relativePath>
10+
</parent>
11+
<groupId>de.codecentric</groupId>
12+
<artifactId>spring-boot-admin-samples</artifactId>
13+
<packaging>pom</packaging>
14+
<name>Spring Boot Admin Samples</name>
15+
<description>Spring Boot Admin Samples</description>
16+
<url>https://github.com/codecentric/spring-boot-admin/</url>
17+
<properties>
18+
<main.basedir>${basedir}/..</main.basedir>
19+
</properties>
20+
<modules>
21+
<module>spring-boot-admin-sample</module>
22+
<module>spring-boot-admin-sample-war</module>
23+
<module>spring-boot-admin-sample-discovery</module>
24+
<module>spring-boot-admin-sample-hazelcast</module>
25+
</modules>
2626
</project>

spring-boot-admin-samples/spring-boot-admin-sample-discovery/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
<build>
2626
<finalName>${project.artifactId}</finalName>
2727
<plugins>
28-
<plugin>
29-
<groupId>org.apache.maven.plugins</groupId>
30-
<artifactId>maven-compiler-plugin</artifactId>
31-
</plugin>
3228
<plugin>
3329
<groupId>org.springframework.boot</groupId>
3430
<artifactId>spring-boot-maven-plugin</artifactId>
Lines changed: 46 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,49 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
4-
<parent>
5-
<groupId>de.codecentric</groupId>
6-
<artifactId>spring-boot-admin-samples</artifactId>
7-
<version>1.3.0-SNAPSHOT</version>
8-
<relativePath>..</relativePath>
9-
</parent>
10-
<artifactId>spring-boot-admin-sample-hazelcast</artifactId>
11-
<dependencies>
12-
<dependency>
13-
<groupId>de.codecentric</groupId>
14-
<artifactId>spring-boot-admin-server</artifactId>
15-
</dependency>
16-
<dependency>
17-
<groupId>de.codecentric</groupId>
18-
<artifactId>spring-boot-admin-server-ui</artifactId>
19-
</dependency>
20-
<dependency>
21-
<groupId>com.hazelcast</groupId>
22-
<artifactId>hazelcast</artifactId>
23-
</dependency>
24-
<dependency>
25-
<groupId>com.hazelcast</groupId>
26-
<artifactId>hazelcast-spring</artifactId>
27-
</dependency>
28-
</dependencies>
29-
<build>
30-
<finalName>${project.artifactId}</finalName>
31-
<plugins>
32-
<plugin>
33-
<groupId>org.apache.maven.plugins</groupId>
34-
<artifactId>maven-compiler-plugin</artifactId>
35-
</plugin>
36-
<plugin>
37-
<groupId>org.springframework.boot</groupId>
38-
<artifactId>spring-boot-maven-plugin</artifactId>
39-
<executions>
40-
<execution>
41-
<goals>
42-
<goal>repackage</goal>
43-
</goals>
44-
</execution>
45-
</executions>
46-
<configuration>
47-
<mainClass>de.codecentric.boot.admin.SpringBootAdminApplication</mainClass>
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>de.codecentric</groupId>
6+
<artifactId>spring-boot-admin-samples</artifactId>
7+
<version>1.3.0-SNAPSHOT</version>
8+
<relativePath>..</relativePath>
9+
</parent>
10+
<artifactId>spring-boot-admin-sample-hazelcast</artifactId>
11+
<dependencies>
12+
<dependency>
13+
<groupId>de.codecentric</groupId>
14+
<artifactId>spring-boot-admin-server</artifactId>
15+
</dependency>
16+
<dependency>
17+
<groupId>de.codecentric</groupId>
18+
<artifactId>spring-boot-admin-server-ui</artifactId>
19+
</dependency>
20+
<dependency>
21+
<groupId>com.hazelcast</groupId>
22+
<artifactId>hazelcast</artifactId>
23+
</dependency>
24+
<dependency>
25+
<groupId>com.hazelcast</groupId>
26+
<artifactId>hazelcast-spring</artifactId>
27+
</dependency>
28+
</dependencies>
29+
<build>
30+
<finalName>${project.artifactId}</finalName>
31+
<plugins>
32+
<plugin>
33+
<groupId>org.springframework.boot</groupId>
34+
<artifactId>spring-boot-maven-plugin</artifactId>
35+
<executions>
36+
<execution>
37+
<goals>
38+
<goal>repackage</goal>
39+
</goals>
40+
</execution>
41+
</executions>
42+
<configuration>
43+
<mainClass>de.codecentric.boot.admin.SpringBootAdminApplication</mainClass>
4844
<addResources>false</addResources>
49-
</configuration>
50-
</plugin>
51-
</plugins>
52-
</build>
45+
</configuration>
46+
</plugin>
47+
</plugins>
48+
</build>
5349
</project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.springBeans
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>de.codecentric</groupId>
5+
<artifactId>spring-boot-admin-sample-war</artifactId>
6+
<version>1.3.0-SNAPSHOT</version>
7+
<packaging>war</packaging>
8+
<parent>
9+
<groupId>de.codecentric</groupId>
10+
<artifactId>spring-boot-admin-samples</artifactId>
11+
<version>1.3.0-SNAPSHOT</version>
12+
<relativePath>..</relativePath>
13+
</parent>
14+
<dependencies>
15+
<dependency>
16+
<groupId>org.springframework.boot</groupId>
17+
<artifactId>spring-boot-starter-tomcat</artifactId>
18+
<scope>provided</scope>
19+
</dependency>
20+
<dependency>
21+
<groupId>de.codecentric</groupId>
22+
<artifactId>spring-boot-admin-server</artifactId>
23+
</dependency>
24+
<dependency>
25+
<groupId>de.codecentric</groupId>
26+
<artifactId>spring-boot-admin-server-ui</artifactId>
27+
</dependency>
28+
<!-- FIX for missing dependency -->
29+
<dependency>
30+
<groupId>com.googlecode.json-simple</groupId>
31+
<artifactId>json-simple</artifactId>
32+
<version>1.1.1</version>
33+
</dependency>
34+
</dependencies>
35+
<build>
36+
<finalName>${project.artifactId}</finalName>
37+
<plugins>
38+
<plugin>
39+
<groupId>org.springframework.boot</groupId>
40+
<artifactId>spring-boot-maven-plugin</artifactId>
41+
<executions>
42+
<execution>
43+
<goals>
44+
<goal>repackage</goal>
45+
</goals>
46+
</execution>
47+
</executions>
48+
<configuration>
49+
<addResources>false</addResources>
50+
</configuration>
51+
</plugin>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-eclipse-plugin</artifactId>
55+
<configuration>
56+
<wtpversion>2.0</wtpversion>
57+
<jeeversion>6.0</jeeversion>
58+
</configuration>
59+
</plugin>
60+
</plugins>
61+
</build>
62+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package de.codecentric.boot.admin;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
5+
import org.springframework.boot.builder.SpringApplicationBuilder;
6+
import org.springframework.boot.context.web.SpringBootServletInitializer;
7+
import org.springframework.context.annotation.Configuration;
8+
9+
import de.codecentric.boot.admin.config.EnableAdminServer;
10+
11+
@Configuration
12+
@EnableAutoConfiguration
13+
@EnableAdminServer
14+
public class SpringBootAdminApplication extends SpringBootServletInitializer {
15+
16+
@Override
17+
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
18+
return application;
19+
}
20+
21+
public static void main(String[] args) throws Exception {
22+
SpringApplication.run(SpringBootAdminApplication.class, args);
23+
}
24+
25+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
info:
2+
version: @pom.version@
3+
stage: test
4+
5+
spring:
6+
application:
7+
name: @pom.artifactId@
8+
boot:
9+
admin:
10+
url: http://localhost:8080
11+
cloud:
12+
config:
13+
enabled: false
14+
jackson:
15+
serialization:
16+
indent_output: true
17+
18+
endpoints:
19+
health:
20+
sensitive: false
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration>
3+
<include resource="org/springframework/boot/logging/logback/base.xml"/>
4+
<jmxConfigurator/>
5+
</configuration>

0 commit comments

Comments
 (0)