<?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>com.example</groupId>
    <artifactId>myproject</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.2.0.BUILD-SNAPSHOT</version>
    </parent>

    <!-- Additional lines to be added here... -->
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    </dependencies>

    <!-- (you don't need this if you are using a .RELEASE version) -->
    <repositories>
        <repository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/snapshot</url>
            <snapshots><enabled>true</enabled></snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <url>http://repo.spring.io/milestone</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/snapshot</url>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestones</id>
            <url>http://repo.spring.io/milestone</url>
        </pluginRepository>
    </pluginRepositories>
</project>

위의 pom.xml을 만들고나서

$ mvn dependency:tree

를 실행하면,

honeymon@test $ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building myproject 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.9:tree (default-cli) @ myproject ---
[INFO] com.example:myproject:jar:0.0.1-SNAPSHOT
[INFO] \- org.springframework.boot:spring-boot-starter-web:jar:1.2.0.BUILD-SNAPSHOT:compile
[INFO]    +- org.springframework.boot:spring-boot-starter:jar:1.2.0.BUILD-SNAPSHOT:compile
[INFO]    |  +- org.springframework.boot:spring-boot:jar:1.2.0.BUILD-SNAPSHOT:compile
[INFO]    |  +- org.springframework.boot:spring-boot-autoconfigure:jar:1.2.0.BUILD-SNAPSHOT:compile
[INFO]    |  +- org.springframework.boot:spring-boot-starter-logging:jar:1.2.0.BUILD-SNAPSHOT:compile
[INFO]    |  |  +- org.slf4j:jcl-over-slf4j:jar:1.7.7:compile
[INFO]    |  |  |  \- org.slf4j:slf4j-api:jar:1.7.7:compile
[INFO]    |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.7:compile
[INFO]    |  |  +- org.slf4j:log4j-over-slf4j:jar:1.7.7:compile
[INFO]    |  |  \- ch.qos.logback:logback-classic:jar:1.1.2:compile
[INFO]    |  |     \- ch.qos.logback:logback-core:jar:1.1.2:compile
[INFO]    |  \- org.yaml:snakeyaml:jar:1.14:runtime
[INFO]    +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.0.BUILD-SNAPSHOT:compile
[INFO]    |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.15:compile
[INFO]    |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.15:compile
[INFO]    |  +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.15:compile
[INFO]    |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.15:compile
[INFO]    +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.4:compile
[INFO]    |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.4:compile
[INFO]    |  \- com.fasterxml.jackson.core:jackson-core:jar:2.4.4:compile
[INFO]    +- org.hibernate:hibernate-validator:jar:5.1.3.Final:compile
[INFO]    |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO]    |  +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO]    |  \- com.fasterxml:classmate:jar:1.0.0:compile
[INFO]    +- org.springframework:spring-core:jar:4.1.3.RELEASE:compile
[INFO]    +- org.springframework:spring-web:jar:4.1.3.RELEASE:compile
[INFO]    |  +- org.springframework:spring-aop:jar:4.1.3.RELEASE:compile
[INFO]    |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO]    |  +- org.springframework:spring-beans:jar:4.1.3.RELEASE:compile
[INFO]    |  \- org.springframework:spring-context:jar:4.1.3.RELEASE:compile
[INFO]    \- org.springframework:spring-webmvc:jar:4.1.3.RELEASE:compile
[INFO]       \- org.springframework:spring-expression:jar:4.1.3.RELEASE:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.397s
[INFO] Finished at: Mon Jan 05 23:11:55 KST 2015
[INFO] Final Memory: 12M/152M
[INFO] ------------------------------------------------------------------------
honeymon@test $

의 형태로 추가된 의존성을 확인할 수 있다. WEB MVC를 사용하여 웹 애플리케이션을 만드는데 필요한 스프링부트의 기본적인 요소들을 살펴볼 수 있다. 스프링부트 web 에서는 내장형 컨테이너로 톰캣을 기본탑재하고 있다.

요런식으로 스프링부트에 추가되는 'Starter POMs'들이 가지고 있는 의존성을 엿볼 수 있다.

+ Recent posts