Skip to content

Commit

Permalink
+
Browse files Browse the repository at this point in the history
  • Loading branch information
Relucent committed Nov 4, 2019
1 parent 15c8deb commit ba3397a
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 0 deletions.
51 changes: 51 additions & 0 deletions spring-boot-example-autoconfigure-exclude/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Compile files
*.class

# Package Files
*.jar
*.war
*.ear
*.nar
*.zip
*.tar
*.tar.gz
*.rar

# Maven
target/
*.ser
*.ec

# J2ME
.mtj.tmp/

# Eclipse
.classpath
.project
.settings/
.metadata/
.factorypath
.springBeans

# IntelliJ Idea
.idea/
out/
*.ipr
*.iws
*.iml

# BlueJ Files
*.ctxt

# OS X
.DS_Store

# Window
Thumbs.db

# Virtual Machine Crash Logs
hs_err_pid*

# Log File
*.log
*.log.*
58 changes: 58 additions & 0 deletions spring-boot-example-autoconfigure-exclude/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?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>

<groupId>yyl</groupId>
<artifactId>spring-boot-example-autoconfigure-exclude</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<name>spring-boot-example-autoconfigure-exclude</name>
<description>Demo project for Spring Boot</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.7.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</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>

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

<!-- _spring-boot-data-jdbc -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency>

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

<!--<([mvn clean package])> -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package yyl.springboot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
public class AutoconfigureExcludeApplication {
public static void main(String[] args) {
SpringApplication.run(AutoconfigureExcludeApplication.class, args);
System.out.println("startup success");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spring.autoconfigure.exclude[0]=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>hello</title>
</head>
<body>
<h1>hello</h1>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package yyl.springboot;

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 AutoconfigureExcludeApplicationTests {
@Test
public void contextLoads() {
System.out.println("Hello Spring Boot 2.0!");
}
}

0 comments on commit ba3397a

Please sign in to comment.