mirror of
https://github.com/drtrang/druid-spring-boot.git
synced 2026-10-25 17:53:41 +00:00
optimize structure.
This commit is contained in:
@@ -25,19 +25,23 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<optional>true</optional>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
+4
@@ -4,6 +4,7 @@ import com.alibaba.druid.support.http.StatViewServlet;
|
||||
import com.github.trang.druid.properties.DruidServletProperties.DruidStatViewServletProperties;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
@@ -11,6 +12,8 @@ import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.servlet.Servlet;
|
||||
|
||||
import static com.github.trang.druid.properties.DruidServletProperties.DRUID_STAT_VIEW_SERVLET_PREFIX;
|
||||
|
||||
/**
|
||||
@@ -19,6 +22,7 @@ import static com.github.trang.druid.properties.DruidServletProperties.DRUID_STA
|
||||
* @author trang
|
||||
*/
|
||||
@ConditionalOnWebApplication
|
||||
@ConditionalOnClass(Servlet.class)
|
||||
@ConditionalOnProperty(prefix = DRUID_STAT_VIEW_SERVLET_PREFIX, name = "enabled", havingValue = "true")
|
||||
@EnableConfigurationProperties(DruidStatViewServletProperties.class)
|
||||
public class DruidServletConfiguration {
|
||||
|
||||
+3
@@ -19,6 +19,8 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
|
||||
import static com.github.trang.druid.properties.DruidStatProperties.DRUID_AOP_STAT_PREFIX;
|
||||
import static com.github.trang.druid.properties.DruidStatProperties.DRUID_WEB_STAT_PREFIX;
|
||||
|
||||
@@ -69,6 +71,7 @@ public class DruidStatConfiguration {
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnWebApplication
|
||||
@ConditionalOnClass(Filter.class)
|
||||
@ConditionalOnProperty(prefix = DRUID_WEB_STAT_PREFIX, name = "enabled", havingValue = "true")
|
||||
public static class DruidWebStatConfiguration {
|
||||
|
||||
|
||||
@@ -30,22 +30,11 @@
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>RELEASE</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.tomcat</groupId>
|
||||
<artifactId>tomcat-jdbc</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.drtrang</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.drtrang</groupId>
|
||||
<artifactId>druid-spring-boot-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
|
||||
@@ -17,6 +17,18 @@
|
||||
<groupId>com.github.drtrang</groupId>
|
||||
<artifactId>druid-spring-boot-autoconfigure</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -1 +1 @@
|
||||
provides: spring-boot-autoconfigure,spring-jdbc,druid,druid-spring-boot-autoconfigure
|
||||
provides: spring-boot-autoconfigure,spring-jdbc,druid,druid-spring-boot-autoconfigure,slf4j-api
|
||||
@@ -36,8 +36,8 @@
|
||||
<modules>
|
||||
<module>druid-spring-boot-starter</module>
|
||||
<module>druid-spring-boot-autoconfigure</module>
|
||||
<module>druid-spring-boot-samples</module>
|
||||
<module>druid-spring-boot-actuator</module>
|
||||
<module>druid-spring-boot-samples</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
@@ -46,8 +46,9 @@
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<!-- 基础依赖 -->
|
||||
<spring-boot.version>1.5.7.RELEASE</spring-boot.version>
|
||||
<druid.version>1.1.3</druid.version>
|
||||
<mybatis-spring-boot-starter.version>1.3.1</mybatis-spring-boot-starter.version>
|
||||
<spring-boot.version>1.5.7.RELEASE</spring-boot.version>
|
||||
<!-- Maven 插件 -->
|
||||
<maven-dependency-plugin.version>3.0.1</maven-dependency-plugin.version>
|
||||
<maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
|
||||
@@ -90,6 +91,17 @@
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>${mybatis-spring-boot-starter.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.tomcat</groupId>
|
||||
<artifactId>tomcat-jdbc</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user