Browse Source

spring-boot-demo-war 初始化

pull/1/head
Yangkai.Shen 5 years ago
parent
commit
47063675b7
6 changed files with 213 additions and 111 deletions
  1. +112
    -111
      pom.xml
  2. +25
    -0
      spring-boot-demo-war/.gitignore
  3. +48
    -0
      spring-boot-demo-war/pom.xml
  4. +12
    -0
      spring-boot-demo-war/src/main/java/com/xkcoding/war/SpringBootDemoWarApplication.java
  5. +0
    -0
      spring-boot-demo-war/src/main/resources/application.yml
  6. +16
    -0
      spring-boot-demo-war/src/test/java/com/xkcoding/war/SpringBootDemoWarApplicationTests.java

+ 112
- 111
pom.xml View File

@@ -2,120 +2,121 @@


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>


<groupId>com.xkcoding</groupId>
<artifactId>spring-boot-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<modules>
<module>spring-boot-demo-helloworld</module>
<module>spring-boot-demo-properties</module>
<module>spring-boot-demo-actuator</module>
<module>spring-boot-demo-admin-client</module>
<module>spring-boot-demo-admin-server</module>
<module>spring-boot-demo-logback</module>
<module>spring-boot-demo-log-aop</module>
<module>spring-boot-demo-exception-handler</module>
<module>spring-boot-demo-template-freemarker</module>
<module>spring-boot-demo-template-thymeleaf</module>
<module>spring-boot-demo-template-beetl</module>
<module>spring-boot-demo-template-enjoy</module>
<module>spring-boot-demo-orm-jdbctemplate</module>
<module>spring-boot-demo-orm-jpa</module>
<module>spring-boot-demo-upload</module>
<module>spring-boot-demo-neo4j</module>
<module>spring-boot-demo-elasticsearch</module>
</modules>
<packaging>pom</packaging>
<groupId>com.xkcoding</groupId>
<artifactId>spring-boot-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<modules>
<module>spring-boot-demo-helloworld</module>
<module>spring-boot-demo-properties</module>
<module>spring-boot-demo-actuator</module>
<module>spring-boot-demo-admin-client</module>
<module>spring-boot-demo-admin-server</module>
<module>spring-boot-demo-logback</module>
<module>spring-boot-demo-log-aop</module>
<module>spring-boot-demo-exception-handler</module>
<module>spring-boot-demo-template-freemarker</module>
<module>spring-boot-demo-template-thymeleaf</module>
<module>spring-boot-demo-template-beetl</module>
<module>spring-boot-demo-template-enjoy</module>
<module>spring-boot-demo-orm-jdbctemplate</module>
<module>spring-boot-demo-orm-jpa</module>
<module>spring-boot-demo-upload</module>
<module>spring-boot-demo-war</module>
<module>spring-boot-demo-elasticsearch</module>
<module>spring-boot-demo-neo4j</module>
</modules>
<packaging>pom</packaging>


<name>spring-boot-demo</name>
<url>http://xkcoding.com</url>
<name>spring-boot-demo</name>
<url>http://xkcoding.com</url>


<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<spring.boot.version>2.0.5.RELEASE</spring.boot.version>
<mysql.version>8.0.12</mysql.version>
<hutool.version>4.1.19</hutool.version>
<user.agent.version>1.20</user.agent.version>
</properties>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<spring.boot.version>2.0.5.RELEASE</spring.boot.version>
<mysql.version>8.0.12</mysql.version>
<hutool.version>4.1.19</hutool.version>
<user.agent.version>1.20</user.agent.version>
</properties>


<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!-- hutool工具类 -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>${hutool.version}</version>
</dependency>
<!-- 解析 UserAgent 信息 -->
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>${user.agent.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!-- hutool工具类 -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>${hutool.version}</version>
</dependency>
<!-- 解析 UserAgent 信息 -->
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>${user.agent.version}</version>
</dependency>
</dependencies>
</dependencyManagement>


<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project> </project>

+ 25
- 0
spring-boot-demo-war/.gitignore View File

@@ -0,0 +1,25 @@
/target/
!.mvn/wrapper/maven-wrapper.jar

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

+ 48
- 0
spring-boot-demo-war/pom.xml View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>spring-boot-demo-war</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>spring-boot-demo-war</name>
<description>Demo project for Spring Boot</description>

<parent>
<groupId>com.xkcoding</groupId>
<artifactId>spring-boot-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<finalName>spring-boot-demo-war</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>

+ 12
- 0
spring-boot-demo-war/src/main/java/com/xkcoding/war/SpringBootDemoWarApplication.java View File

@@ -0,0 +1,12 @@
package com.xkcoding.war;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SpringBootDemoWarApplication {

public static void main(String[] args) {
SpringApplication.run(SpringBootDemoWarApplication.class, args);
}
}

+ 0
- 0
spring-boot-demo-war/src/main/resources/application.yml View File


+ 16
- 0
spring-boot-demo-war/src/test/java/com/xkcoding/war/SpringBootDemoWarApplicationTests.java View File

@@ -0,0 +1,16 @@
package com.xkcoding.war;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest
public class SpringBootDemoWarApplicationTests {

@Test
public void contextLoads() {
}

}

Loading…
Cancel
Save