복붙노트

[SPRING] '스프링 - 부트 스타터'항아리는 무엇입니까?

SPRING

'스프링 - 부트 스타터'항아리는 무엇입니까?

Spring Boot에서는 spring-boot-starter 패턴에 몇 개의 항아리가 있습니다. 이 항아리에는 모든 패키지가 들어 있지 않습니다. 그들의 용도는 무엇입니까?

Maven POM에는 다음과 같은 종속성이 추가되었습니다.

어떤 JVM에서 실제로이 jar의 기능을 사용해야합니까? 내 프로젝트에는 종속성 관리가 없습니다. 내 프로젝트는 Spring Security를 ​​사용하는 Spring MVC 애플리케이션이다.

해결법

  1. ==============================

    1.이러한 종속성은 모든 필요한 종속성을 가진 특별 뼈대 프로젝트에 통합 항목을 제공하기위한 것입니다.

    이러한 종속성은 모든 필요한 종속성을 가진 특별 뼈대 프로젝트에 통합 항목을 제공하기위한 것입니다.

    일반적으로 프로젝트 설명자 (pom.xml)에서 상속되어 구성된 버전으로 모든 상위 종속 항목을 가져와야합니다. 개발자 측에서 더 이상 부담하지 않아도됩니다.

    참조, Spring Boot Starter POM.

    이러한 POM은 특정 프로젝트에 사용할 수있는 종속성을 합성하는 데 사용할 수 있습니다 (예 : 간단한 Spring MVC 프로젝트를 위해 다음과 같은 아티팩트가 포함될 것이다 (각각 spring-boot-startter, spring-boot-starter-web, spring-boot-starter-security로부터 읽음).

    아티팩트는 중앙 저장소에서 검색 결과를 완벽하게 탐색 할 수 있습니다.

    일부 구성 요소가 변경 될 수 있으므로이 항목이 업데이트 될 수 있으므로 완전한 참조 목록이 아닐 수도 있습니다.

  2. ==============================

    2.간단히 말해서 개발자는 함께 작동하도록 테스트 된 버전으로 전이 의존성을 나열하는 종속성 설명자입니다. 그러면 라이브러리를 함께 배치하여 응용 프로그램의 일부를 관리하는 데 소요되는 시간을 절약 할 수 있습니다.

    간단히 말해서 개발자는 함께 작동하도록 테스트 된 버전으로 전이 의존성을 나열하는 종속성 설명자입니다. 그러면 라이브러리를 함께 배치하여 응용 프로그램의 일부를 관리하는 데 소요되는 시간을 절약 할 수 있습니다.

  3. ==============================

    3.또한 다음 명령을 사용하여 spring 부트 프로젝트 pom.xml 파일에 정의 된 다양한 spring-boot-startter- *에 필요한 종속성을 maven에보고 할 수 있습니다.

    또한 다음 명령을 사용하여 spring 부트 프로젝트 pom.xml 파일에 정의 된 다양한 spring-boot-startter- *에 필요한 종속성을 maven에보고 할 수 있습니다.

    mvn dependency:resolve
    

    예를 들어 spring 1.5.8.RELEASE의 경우 다음의 jar (및 버전)가 사용됩니다

    노트 형식은 그룹 ID입니다. Artifact ID : Version : Scope

    The following files have been resolved:
        com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
        org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
        aopalliance:aopalliance:jar:1.0:compile
        org.hamcrest:hamcrest-library:jar:1.3:test
        org.mockito:mockito-core:jar:1.10.19:test
        org.assertj:assertj-core:jar:2.6.0:test
        org.springframework:spring-beans:jar:4.3.12.RELEASE:compile
        org.springframework.boot:spring-boot-test:jar:1.5.8.RELEASE:test
        org.springframework.boot:spring-boot-autoconfigure:jar:1.5.8.RELEASE:compile
        org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.8.RELEASE:compile
        org.skyscreamer:jsonassert:jar:1.4.0:test
        org.yaml:snakeyaml:jar:1.17:runtime
        com.fasterxml:classmate:jar:1.3.4:compile
        org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
        org.springframework.boot:spring-boot-starter-test:jar:1.5.8.RELEASE:test
        org.hamcrest:hamcrest-core:jar:1.3:test
        com.jayway.jsonpath:json-path:jar:2.2.0:test
        org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.23:compile
        org.springframework.boot:spring-boot:jar:1.5.8.RELEASE:compile
        org.apache.tomcat:tomcat-annotations-api:jar:8.5.23:compile
        org.springframework:spring-context:jar:4.3.12.RELEASE:compile
        org.hibernate:hibernate-validator:jar:5.3.5.Final:compile
        javax.validation:validation-api:jar:1.1.0.Final:compile
        org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.23:compile
        org.springframework.boot:spring-boot-starter-logging:jar:1.5.8.RELEASE:compile
        com.fasterxml.jackson.core:jackson-core:jar:2.8.10:compile
        org.ow2.asm:asm:jar:5.0.3:test
        org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.23:compile
        org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
        org.springframework:spring-web:jar:4.3.12.RELEASE:compile
        ch.qos.logback:logback-core:jar:1.1.11:compile
        org.springframework.security:spring-security-core:jar:4.2.3.RELEASE:compile
        org.springframework:spring-test:jar:4.3.12.RELEASE:test
        org.springframework.boot:spring-boot-starter:jar:1.5.8.RELEASE:compile
        org.springframework.security:spring-security-test:jar:4.2.3.RELEASE:test
        org.springframework.boot:spring-boot-starter-web:jar:1.5.8.RELEASE:compile
        org.springframework:spring-core:jar:4.3.12.RELEASE:compile
        org.springframework.boot:spring-boot-starter-security:jar:1.5.8.RELEASE:compile
        org.springframework.boot:spring-boot-actuator:jar:1.5.8.RELEASE:compile
        org.objenesis:objenesis:jar:2.1:test
        org.springframework:spring-expression:jar:4.3.12.RELEASE:compile
        org.springframework.boot:spring-boot-starter-actuator:jar:1.5.8.RELEASE:compile
        org.springframework.security:spring-security-config:jar:4.2.3.RELEASE:compile
        org.springframework.security:spring-security-web:jar:4.2.3.RELEASE:compile
        org.springframework:spring-aop:jar:4.3.12.RELEASE:compile
        junit:junit:jar:4.12:test
        org.slf4j:slf4j-api:jar:1.7.25:compile
        net.minidev:json-smart:jar:2.2.1:test
        org.springframework.boot:spring-boot-test-autoconfigure:jar:1.5.8.RELEASE:test
        net.minidev:accessors-smart:jar:1.1:test
        org.springframework:spring-webmvc:jar:4.3.12.RELEASE:compile
        ch.qos.logback:logback-classic:jar:1.1.11:compile
        org.slf4j:jul-to-slf4j:jar:1.7.25:compile
        com.fasterxml.jackson.core:jackson-databind:jar:2.8.10:compile
    

    배포 용 테스트 범위가있는 항아리 만 무시하십시오.

    스프링 부트 프로젝트가 편리하지 않으면, 스프링 이니셜 라이저에서 스프링 부트 스타터를 필요로하는 것으로 만드십시오. 또한 maven 명령을 감싸는 maven wrapper를 사용하기 때문에 maven을 별도로 설치하고 설치하는 시간을 절약 할 수 있습니다.

    Spring Initializr에서 zip 파일을 다운로드하고, 압축을 푼 폴더에서 압축을 풀고 명령 프롬프트를 열고 대신 다음 명령을 사용하십시오

    Linux / Mac OS의 경우

     ./mvnw dependency:resolve
    

    창용

     ./mvnw.cmd dependency:resolve
    
  4. from https://stackoverflow.com/questions/28273543/what-are-spring-boot-starter-jars by cc-by-sa and MIT license