AI ์ด์ „์‹œ๋Œ€ (↓์„๊ธฐ์‹œ๋Œ€ IT)/01. Java

๋ฉ€ํ‹ฐํ”„๋กœ์ ํŠธ ์ƒ์„ฑ Eclipse STS + Multi Gradle

๐Ÿ“ฆ DonzBox 2017. 10. 18. 13:31

Eclipse STS + MultiGradle +  Subproject Spring Boot(1.5.8)


์‚ฌ์ „์„ค์ •
์ดํด๋ฆฝ์Šค ๋งˆ์ผ“์—์„œ ๋“ฑ๋กํ•ด ์ฐธ์กฐ : http://donzbox.tistory.com/593

์ „์ฒด๊ตฌ์กฐ


๋ถ€๋ชจํ”„๋กœ์ ํŠธ ์ƒ์„ฑ


์ฒซ๋ฒˆ์งธ ์ž์‹ ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ (ํ”„๋กœ์ ํŠธ Location ์„ค์ • : ๋ถ€๋ชจํ”„๋กœ์ ํŠธ ๋ฐ‘์œผ๋กœ ๋ณ€๊ฒฝํ•ด์•ผ ํ•จ)


๋‘๋ฒˆ์งธ ์ž์‹ ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ (ํ”„๋กœ์ ํŠธ Location ์„ค์ • : ๋ถ€๋ชจํ”„๋กœ์ ํŠธ ๋ฐ‘์œผ๋กœ ๋ณ€๊ฒฝํ•ด์•ผ ํ•จ)


๋ถ€๋ชจํ”„๋กœ์ ํŠธ์—์„œ ์ž์‹ํ”„๋กœ์ ํŠธ ์—ฐ๊ฒฐ ์„ค์ •


/*

 * This build file was generated by the Gradle 'init' task.

 *

 * This generated file contains a sample Java Library project to get you started.

 * For more details take a look at the Java Libraries chapter in the Gradle

 * user guide available at https://docs.gradle.org/3.5/userguide/java_library_plugin.html

 */

subprojects {


// Apply the java-library plugin to add support for Java Library

apply plugin: 'java-library'

ext {

buildVersion = '0.0.1-SNAPSHOT'

springBootVersion = '1.5.6.RELEASE'

checkGradleVersion = '2.1.0'

}

// In this section you declare where to find the dependencies of your project

repositories {

    // Use jcenter for resolving your dependencies.

    // You can declare any Maven/Ivy/file repository here.

    jcenter()

}


dependencies {

    // This dependency is exported to consumers, that is to say found on their compile classpath.

    api 'org.apache.commons:commons-math3:3.6.1'


    // This dependency is used internally, and not exposed to consumers on their own compile classpath.

    implementation 'com.google.guava:guava:21.0'

    // Use JUnit test framework

    testImplementation 'junit:junit:4.12'

    runtime("org.springframework.boot:spring-boot-devtools:${springBootVersion}")

}

}


๋ถ€๋ชจํ”„๋กœ์ ํŠธ์—์„œ ์ปดํŒŒ์ผ ํ•˜์—ฌ subprojects ์— ์„ ์–ธํ•œ dependencies ๊ฐ€ ์ถ”๊ฐ€ ์‹œํ‚ด


์ž์‹ํ”„๋กœ์ ํŠธ homepage-api, homepage-batch ์–‘์ชฝ์— Referenced Libraries ์†์—

spring-boot-debtools1.5.6RELEASE.jar ๊ฐ€ ์ถ”๊ฐ€๋จ์„ ํ™•์ธ


์šฐ์˜ค์•—! ์ž˜๋˜๋„ค! ๋!


20190327

์ถ”๊ฐ€๋ฐฑ์—… (์•„, ์™œ ์ดํด๋ฆฝ์Šค์„œ git์— ์˜ฌ๋ ธ๋‹ค ์ƒˆ๋กœ ์ƒ์„ฑํ•˜๋ฉฐ ๋‚ด๋ ค๋ฐ›์œผ๋ฉด multi ๊ตฌ์กฐ๊ฐ€ ๊นจ์ง€๋Š” ๊ฑธ๊นŒ.... ์–ด๋–ป๊ฒŒ ํ•˜๋Š”๊ฑฐ์ง€...)


๋ถ€๋ชจ build.gradle

 /*

 * This build file was generated by the Gradle 'init' task.

 *

 * This generated file contains a sample Java Library project to get you started.

 * For more details take a look at the Java Libraries chapter in the Gradle

 * user guide available at https://docs.gradle.org/3.5/userguide/java_library_plugin.html

 */


subprojects {


task -> println "I'm $task.project.name."

println "-----------------------------------------------------"

    version = '1.0'


    apply plugin: 'java'

apply plugin: 'java-library'

    apply plugin: 'eclipse'

apply plugin: 'eclipse-wtp'

apply plugin: 'war'

    group 'com.donzbox'


ext {

buildVersion = '0.0.1-SNAPSHOT'

springBootVersion = '1.5.8.RELEASE'

checkGradleVersion = '2.1.0'

}

    

    repositories {

mavenCentral()

jcenter()

maven {

url 'https://maven.atlassian.com/3rdparty'

}

    }


configurations {

    providedRuntime

}


    war {

    version = "${buildVersion}"

        manifest.attributes provider: 'DonzBox.com'

    }

    

dependencies {

/*+---------------------------------------------------------------------------------------

*| multi gradle set

*+--------------------------------------------------------------------------------------*/

compile("com.googlecode.json-simple:json-simple:1.1.1")

/*+---------------------------------------------------------------------------------------

*| spring-boot

*+--------------------------------------------------------------------------------------*/

/*+---------------------------------------------------------------------------------------

*| web

*+--------------------------------------------------------------------------------------*/

/*+---------------------------------------------------------------------------------------

*| social / cloud / 3rd

*+--------------------------------------------------------------------------------------*/

/*+---------------------------------------------------------------------------------------

*| api

*+--------------------------------------------------------------------------------------*/

/*+---------------------------------------------------------------------------------------

*| i18n

*+--------------------------------------------------------------------------------------*/

/*+---------------------------------------------------------------------------------------

*| securitydatabase

*+--------------------------------------------------------------------------------------*/

compile("com.github.ulisesbocchio:jasypt-spring-boot-starter:1.17")

/*+---------------------------------------------------------------------------------------

*| database

*+--------------------------------------------------------------------------------------*/

compile("com.oracle:ojdbc6:11.2.0.4.0-atlassian-hosted")

compile("mysql:mysql-connector-java:8.0.8-dmr")

compile("org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.1")

compile("org.apache.commons:commons-dbcp2:2.1.1")


/*+---------------------------------------------------------------------------------------

*| log

*+--------------------------------------------------------------------------------------*/

compile("org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16")

compile("org.logback-extensions:logback-ext-spring:0.1.2")

    /*+---------------------------------------------------------------------------------------

     *| Development (auto set/get)

     *+--------------------------------------------------------------------------------------*/

compile("org.projectlombok:lombok:1.16.18")

    testCompile("junit:junit:4.12")

    compile("junit:junit:4.12")

}


}



์ž์‹ build.gradle

buildscript {

ext {

buildVersion = "0.0.1-SNAPSHOT"

springBootVersion = '1.5.8.RELEASE'

}

repositories {

mavenCentral()

}

dependencies {

classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")

}

}


apply plugin: 'java'

apply plugin: 'eclipse-wtp'

apply plugin: 'org.springframework.boot'

apply plugin: 'war'


war {

    baseName = "homepage-front"

//  version = "${buildVersion}"

}


group = 'com.donzbox'

version = '0.0.1-SNAPSHOT'

sourceCompatibility = 1.8


repositories {

mavenCentral()

}


configurations {

providedRuntime

}


dependencies {

/*+---------------------------------------------------------------------------------------

*| multi gradle set

*+--------------------------------------------------------------------------------------*/

/*+---------------------------------------------------------------------------------------

*| spring-boot

*+--------------------------------------------------------------------------------------*/

compile("org.springframework.boot:spring-boot-starter-security:${springBootVersion}")


/*+---------------------------------------------------------------------------------------

*| web

*+--------------------------------------------------------------------------------------*/

compile("net.sourceforge.nekohtml:nekohtml")

compile("org.springframework.boot:spring-boot-starter-thymeleaf:${springBootVersion}")

compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}")

runtime("org.springframework.boot:spring-boot-devtools:${springBootVersion}")

compile("org.thymeleaf.extras:thymeleaf-extras-springsecurity4:2.1.2.RELEASE")


/*+---------------------------------------------------------------------------------------

*| social

*+--------------------------------------------------------------------------------------*/


/*+---------------------------------------------------------------------------------------

*| was

*+--------------------------------------------------------------------------------------*/

providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")


/*+---------------------------------------------------------------------------------------

*| api

*+--------------------------------------------------------------------------------------*/


/*+---------------------------------------------------------------------------------------

*| i18n

*+--------------------------------------------------------------------------------------*/

compile("org.ehcache:ehcache:3.4.0")


/*+---------------------------------------------------------------------------------------

*| database

*+--------------------------------------------------------------------------------------*/


/*+---------------------------------------------------------------------------------------

*| reCapture

*+--------------------------------------------------------------------------------------*/

compile("org.apache.httpcomponents:httpclient:4.5.4")


/*+---------------------------------------------------------------------------------------

*| log

*+--------------------------------------------------------------------------------------*/

/*+---------------------------------------------------------------------------------------

*| bitcoin bithumb

*+--------------------------------------------------------------------------------------*/

compile("commons-codec:commons-codec:1.11")

compile("com.google.guava:guava:23.6-jre")

compile("org.codehaus.jackson:jackson-mapper-asl:1.9.13")

    /*+---------------------------------------------------------------------------------------

     *| Development (auto set/get)

     *+--------------------------------------------------------------------------------------*/

testCompile('org.springframework.boot:spring-boot-starter-test')

}