Browse Source

gradle+lib-boot

mgr-gxzc 7 years ago
parent
commit
5e64ae404a

+ 54 - 51
build.gradle

@@ -46,6 +46,8 @@ allprojects {}
 subprojects {
     apply plugin: 'java'
     apply plugin: 'kotlin'
+    apply plugin: 'kotlin-spring'
+    apply plugin: 'org.springframework.boot'
     sourceCompatibility = 1.8
     targetCompatibility = 1.8
 
@@ -56,58 +58,59 @@ subprojects {
     dependencies {
         compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
         compile("org.jetbrains.kotlin:kotlin-reflect")
-        compile("org.springframework.boot:spring-boot-starter-web")
+        compile('org.springframework.boot:spring-boot-starter')
+        compile('org.springframework.boot:spring-boot-starter-web')
+        testCompile('org.springframework.boot:spring-boot-starter-test')
         testCompile("junit:junit:4.12")
-        testCompile("org.springframework.boot:spring-boot-starter-test")
 
-        compile ("commons-io:commons-io:$commons_io_version")
-        compile ("commons-logging:commons-logging:$commons_logging_version")
-        compile ("org.apache.commons:commons-lang3:$commons_lang3_version")
-        compile group: 'commons-codec', name: 'commons-codec', version: '1.10'
-        compile group: 'commons-fileupload', name: 'commons-fileupload', version: '1.3.2'
-        compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.3'
-        compile group: 'log4j', name: 'log4j', version: '1.2.17'
-        compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
-        compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25'
-
-        // https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api
-        compile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
-        compile group: 'javax.servlet', name: 'servlet-api', version: '2.5'
-//        compile group: 'javax.servlet', name: 'jstl', version: '1.2'
-//        compile group: 'javax.servlet.jsp', name: 'jsp-api', version: '2.1'
-
-        compile ("org.springframework.amqp:spring-rabbit:$spring_rabbitmq_version")
-        compile ("org.springframework.data:spring-data-commons-core:1.4.1.RELEASE")
-        compile ("org.springframework.data:spring-data-commons:$spring_data_version")
-        compile ("org.springframework.data:spring-data-redis:$spring_data_version")
-        compile ("org.springframework.data:spring-data-jpa:$spring_data_version")
-        compile ("org.springframework.data:spring-data-elasticsearch:$spring_data_elasticsearch_version")
-
-        compile ("com.alibaba:druid:$alidruid_version")
-        compile ("org.ehcache:ehcache:$ehcache_version")
-        compile ("org.activiti:activiti-engine:$activiti_version")
-        compile ("org.activiti:activiti-spring:$activiti_version")
-        compile ("net.sf.ehcache:ehcache-core:$ehcache_core_version")
-        compile ("mysql:mysql-connector-java:$mysql_connector_version")
-//        compile ("org.mybatis:mybatis:$mybatis_version")
-//        compile ("org.mybatis:mybatis-spring:$mybatiss_version")
-        compile ("com.baomidou:mybatis-plus:$mybatis_plus_version")
-        compile ("com.baomidou:mybatisplus-spring-boot-starter:$mybatis_plus_boot_version")
-        compile ("com.rabbitmq:amqp-client:$rabbitmq_version")
-        compile ("com.xuxueli:xxl-job-core:$xxljob_version")
-        compile ("io.springfox:springfox-swagger2:$swagger_version")
-        compile ("io.springfox:springfox-swagger2-ui:$swagger_version")
-
-        compile ("com.google.guava:guava:23.6-jre")
-        compile ("com.github.penggle:kaptcha:2.3.2")
-        compile ("com.alibaba:fastjson:$fastjson_version")
-        compile ("com.fasterxml.jackson.core:jackson-core:2.9.3")
-        compile ("com.fasterxml.jackson.core:jackson-databind:2.9.3")
-        compile ("com.fasterxml.jackson.core:jackson-annotations:2.9.3")
-
-
-        compile ("com.baomidou:kisso:3.6.11")
-        compile ("io.jsonwebtoken:jjwt:0.7.0")
-        compile ("org.projectlombok:lombok:1.16.18")
+//        compile ("commons-io:commons-io:$commons_io_version")
+//        compile ("commons-logging:commons-logging:$commons_logging_version")
+//        compile ("org.apache.commons:commons-lang3:$commons_lang3_version")
+//        compile group: 'commons-codec', name: 'commons-codec', version: '1.10'
+//        compile group: 'commons-fileupload', name: 'commons-fileupload', version: '1.3.2'
+//        compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.3'
+//        compile group: 'log4j', name: 'log4j', version: '1.2.17'
+//        compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
+//        // compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25'
+//
+//        // https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api
+//        compile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
+//        compile group: 'javax.servlet', name: 'servlet-api', version: '2.5'
+////        compile group: 'javax.servlet', name: 'jstl', version: '1.2'
+////        compile group: 'javax.servlet.jsp', name: 'jsp-api', version: '2.1'
+//
+//        compile ("org.springframework.amqp:spring-rabbit:$spring_rabbitmq_version")
+//        compile ("org.springframework.data:spring-data-commons-core:1.4.1.RELEASE")
+//        compile ("org.springframework.data:spring-data-commons:$spring_data_version")
+//        compile ("org.springframework.data:spring-data-redis:$spring_data_version")
+//        compile ("org.springframework.data:spring-data-jpa:$spring_data_version")
+//        compile ("org.springframework.data:spring-data-elasticsearch:$spring_data_elasticsearch_version")
+//
+//        compile ("com.alibaba:druid:$alidruid_version")
+//        compile ("org.ehcache:ehcache:$ehcache_version")
+//        compile ("org.activiti:activiti-engine:$activiti_version")
+//        compile ("org.activiti:activiti-spring:$activiti_version")
+//        compile ("net.sf.ehcache:ehcache-core:$ehcache_core_version")
+//        compile ("mysql:mysql-connector-java:$mysql_connector_version")
+////        compile ("org.mybatis:mybatis:$mybatis_version")
+////        compile ("org.mybatis:mybatis-spring:$mybatiss_version")
+//        compile ("com.baomidou:mybatis-plus:$mybatis_plus_version")
+//        compile ("com.baomidou:mybatisplus-spring-boot-starter:$mybatis_plus_boot_version")
+//        compile ("com.rabbitmq:amqp-client:$rabbitmq_version")
+//        compile ("com.xuxueli:xxl-job-core:$xxljob_version")
+//        compile ("io.springfox:springfox-swagger2:$swagger_version")
+//        compile ("io.springfox:springfox-swagger-ui:$swagger_version")
+//
+//        compile ("com.google.guava:guava:23.6-jre")
+//        compile ("com.github.penggle:kaptcha:2.3.2")
+//        compile ("com.alibaba:fastjson:$fastjson_version")
+//        compile ("com.fasterxml.jackson.core:jackson-core:2.9.3")
+//        compile ("com.fasterxml.jackson.core:jackson-databind:2.9.3")
+//        compile ("com.fasterxml.jackson.core:jackson-annotations:2.9.3")
+//
+//
+//        compile ("com.baomidou:kisso:3.6.11")
+//        compile ("io.jsonwebtoken:jjwt:0.7.0")
+//        compile ("org.projectlombok:lombok:1.16.18")
     }
 }

+ 1 - 5
zen-admin/src/main/kotlin/com/gxzc/zen/ExampleController.kt

@@ -1,15 +1,11 @@
 package com.gxzc.zen
 
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration
-import org.springframework.web.bind.annotation.RestController
 import org.springframework.web.bind.annotation.PathVariable
 import org.springframework.web.bind.annotation.RequestMapping
-
-
+import org.springframework.web.bind.annotation.RestController
 
 
 @RestController
-@EnableAutoConfiguration
 class ExampleController {
 
     @RequestMapping("/")

+ 3 - 5
zen-admin/src/main/kotlin/com/gxzc/zen/MainApplication.kt

@@ -1,14 +1,12 @@
 package com.gxzc.zen
 
-import org.springframework.boot.autoconfigure.SpringBootApplication
 import org.springframework.boot.SpringApplication
-
-
+import org.springframework.boot.autoconfigure.SpringBootApplication
 
 
 @SpringBootApplication
-class MainApplication {
-}
+class MainApplication
+
 fun main(args:Array<String>){
     SpringApplication.run(MainApplication::class.java, *args)
 }

+ 41 - 0
zen-admin/src/main/kotlin/com/gxzc/zen/config/ZenProperties.java

@@ -0,0 +1,41 @@
+package com.gxzc.zen.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 项目相关配置
+ *
+ * @author NorthLan
+ */
+//@Configuration
+//@ConfigurationProperties(prefix = "zen")
+public class ZenProperties {
+    private boolean authOpen = true;
+    private boolean signOpen = true;
+    private boolean swaggerOpen = true;
+
+    public boolean isAuthOpen() {
+        return authOpen;
+    }
+
+    public void setAuthOpen(boolean authOpen) {
+        this.authOpen = authOpen;
+    }
+
+    public boolean isSignOpen() {
+        return signOpen;
+    }
+
+    public void setSignOpen(boolean signOpen) {
+        this.signOpen = signOpen;
+    }
+
+    public boolean isSwaggerOpen() {
+        return swaggerOpen;
+    }
+
+    public void setSwaggerOpen(boolean swaggerOpen) {
+        this.swaggerOpen = swaggerOpen;
+    }
+}

+ 0 - 1
zen-ui/build.gradle

@@ -1,5 +1,4 @@
 apply plugin: 'war'
 
 dependencies {
-
 }