å ±æã©ã¤ãã©ãªã管çããããã« Sonatype ã® Nexus Repository Manager OSS ã使ç¨ãã ( ãã®ï¼ï¼ )( å©ç¨ããã©ã¤ãã©ãªãä¾åãã¦ããã©ã¤ãã©ãªã®å¥ãã¼ã¸ã§ã³ã build.gradle ã§æå®ãããã©ããªãã®ãï¼ )
æ¦è¦
- ä»åã®æé ã§ç¢ºèªã§ããã®ã¯ä»¥ä¸ã®å
容ã§ãã
- å©ç¨ãã¦ããã©ã¤ãã©ãªãä¾åããã©ã¤ãã©ãªã®å¥ã®ãã¼ã¸ã§ã³ããã©ã¤ãã©ãªãå©ç¨ããããã¸ã§ã¯ãã® build.gradle ã§æå®ããå ´åã©ããªãã®ã確èªãã¾ãã
- å©ç¨ãã¦ããã©ã¤ãã©ãªãä¾åããã©ã¤ãã©ãªã®ãã¼ã¸ã§ã³ãç¹å®ã§ããã®ãï¼ ( ã©ã¤ãã©ãªãå©ç¨ããããã¸ã§ã¯ãã§ä¸ä½ãã¼ã¸ã§ã³ãæå®ã§ããªãããã«ã§ããã®ãï¼ )ãã確èªãã¾ãã
åç §ãããµã¤ãã»æ¸ç±
-
POM Reference - Dependency Version Requirement Specification
https://maven.apache.org/pom.html#Dependency_Version_Requirement_Specification -
Gradle å¾¹åºå ¥é
Gradleå¾¹åºå ¥é 次ä¸ä»£ãã«ããã¼ã«ã«ããèªåååºç¤ã®æ§ç¯
- ä½è : 綿å¼ç¢ç£¨,é æ±ä¿¡æ´,ææ¿å©,ä»äºåä¿¡
- åºç社/ã¡ã¼ã«ã¼: ç¿æ³³ç¤¾
- çºå£²æ¥: 2014/11/05
- ã¡ãã£ã¢: 大åæ¬
- ãã®ååãå«ãããã° (5件) ãè¦ã
- ãChapter 7 ä¾åé¢ä¿ã®ç®¡çããèªã¿ç´ãã¾ããã
- ãã£ã¨æè¿ã«ãªã£ã¦ããã«æ¸ãã¦ãããã¨ãç解ã§ããããã«ãªã£ã¦ããã¨æãã¾ãã
ç®æ¬¡
- ã©ã¤ãã©ãªã®ä¾åé¢ä¿ã確èªããã«ã¯ï¼
- ksbysample-webapp-demo ããã¸ã§ã¯ã㧠org.apache.commons:commons-lang3 ã®ä¸ä½ãã¼ã¸ã§ã³ãæå®ãã¦ã¿ã
- ksbysample-library-depend-nospring ã©ã¤ãã©ãªãå©ç¨ããããã¸ã§ã¯ã㧠org.apache.commons:commons-lang3:3.4 以å¤ã®ãã¼ã¸ã§ã³ãæå®ããæã«ã¨ã©ã¼ã«ãªãããã«ã§ããã®ãï¼
æé
ã©ã¤ãã©ãªã®ä¾åé¢ä¿ã確èªããã«ã¯ï¼
ããã¸ã§ã¯ãã§ä½¿ç¨ããã©ã¤ãã©ãªã®ä¾åé¢ä¿ã調ã¹ãã«ã¯ãã³ãã³ãã©ã¤ã³ãã gradlew dependencies
ã³ãã³ããå®è¡ãã¾ãã
ksbysample-webapp-demo ããã¸ã§ã¯ãã§ä¾åé¢ä¿ãåºåãã¦ã¿ã¾ãã以ä¸ã®ã³ãã³ããå®è¡ãã¾ãã
> cd /d C:\project-springboot\ksbysample-nexus-repomng\ksbysample-webapp-demo > gradlew dependencies
以ä¸ã®å 容ãåºåããã¾ããããªãé·ãã®ã§éä¸ã¯çç¥ãã¦ãã¾ãã
:dependencies ------------------------------------------------------------ Root project ------------------------------------------------------------ archives - Configuration for archive artifacts. No dependencies compile - Dependencies for source set 'main'. +--- org.springframework.boot:spring-boot-starter-web: -> 1.3.6.RELEASE | +--- org.springframework.boot:spring-boot-starter:1.3.6.RELEASE | | +--- org.springframework.boot:spring-boot:1.3.6.RELEASE | | | +--- org.springframework:spring-core:4.2.7.RELEASE | | | \--- org.springframework:spring-context:4.2.7.RELEASE | | | +--- org.springframework:spring-aop:4.2.7.RELEASE | | | | +--- aopalliance:aopalliance:1.0 | | | | +--- org.springframework:spring-beans:4.2.7.RELEASE | | | | | \--- org.springframework:spring-core:4.2.7.RELEASE | | | | \--- org.springframework:spring-core:4.2.7.RELEASE | | | +--- org.springframework:spring-beans:4.2.7.RELEASE (*) | | | +--- org.springframework:spring-core:4.2.7.RELEASE | | | \--- org.springframework:spring-expression:4.2.7.RELEASE | | | \--- org.springframework:spring-core:4.2.7.RELEASE | | +--- org.springframework.boot:spring-boot-autoconfigure:1.3.6.RELEASE | | | \--- org.springframework.boot:spring-boot:1.3.6.RELEASE (*) | | +--- org.springframework.boot:spring-boot-starter-logging:1.3.6.RELEASE | | | +--- ch.qos.logback:logback-classic:1.1.7 | | | | +--- ch.qos.logback:logback-core:1.1.7 | | | | \--- org.slf4j:slf4j-api:1.7.20 -> 1.7.21 | | | +--- org.slf4j:jcl-over-slf4j:1.7.21 | | | | \--- org.slf4j:slf4j-api:1.7.21 | | | +--- org.slf4j:jul-to-slf4j:1.7.21 | | | | \--- org.slf4j:slf4j-api:1.7.21 | | | \--- org.slf4j:log4j-over-slf4j:1.7.21 | | | \--- org.slf4j:slf4j-api:1.7.21 | | +--- org.springframework:spring-core:4.2.7.RELEASE | | \--- org.yaml:snakeyaml:1.16 | +--- org.springframework.boot:spring-boot-starter-tomcat:1.3.6.RELEASE | | +--- org.apache.tomcat.embed:tomcat-embed-core:8.0.36 | | +--- org.apache.tomcat.embed:tomcat-embed-el:8.0.36 | | +--- org.apache.tomcat.embed:tomcat-embed-logging-juli:8.0.36 | | \--- org.apache.tomcat.embed:tomcat-embed-websocket:8.0.36 | | \--- org.apache.tomcat.embed:tomcat-embed-core:8.0.36 | +--- org.springframework.boot:spring-boot-starter-validation:1.3.6.RELEASE | | +--- org.springframework.boot:spring-boot-starter:1.3.6.RELEASE (*) | | +--- org.apache.tomcat.embed:tomcat-embed-el:8.0.36 | | \--- org.hibernate:hibernate-validator:5.2.4.Final | | +--- javax.validation:validation-api:1.1.0.Final | | +--- org.jboss.logging:jboss-logging:3.2.1.Final -> 3.3.0.Final | | \--- com.fasterxml:classmate:1.1.0 | +--- com.fasterxml.jackson.core:jackson-databind:2.6.7 | | +--- com.fasterxml.jackson.core:jackson-annotations:2.6.0 -> 2.6.7 | | \--- com.fasterxml.jackson.core:jackson-core:2.6.7 | +--- org.springframework:spring-web:4.2.7.RELEASE | | +--- org.springframework:spring-aop:4.2.7.RELEASE (*) | | +--- org.springframework:spring-beans:4.2.7.RELEASE (*) | | +--- org.springframework:spring-context:4.2.7.RELEASE (*) | | \--- org.springframework:spring-core:4.2.7.RELEASE | \--- org.springframework:spring-webmvc:4.2.7.RELEASE | +--- org.springframework:spring-beans:4.2.7.RELEASE (*) | +--- org.springframework:spring-context:4.2.7.RELEASE (*) | +--- org.springframework:spring-core:4.2.7.RELEASE | +--- org.springframework:spring-expression:4.2.7.RELEASE (*) | \--- org.springframework:spring-web:4.2.7.RELEASE (*) +--- ksbysample.library:ksbysample-library-simpleutils:1.0-RELEASE \--- ksbysample.library:ksbysample-library-depend-nospring:1.0-RELEASE \--- org.apache.commons:commons-lang3:3.4 compileClasspath - Compile classpath for source set 'main'. .....(çç¥)..... compileOnly - Compile dependencies for source set 'main'. .....(çç¥)..... default - Configuration for default artifacts. .....(çç¥)..... runtime - Runtime dependencies for source set 'main'. .....(çç¥)..... testCompile - Dependencies for source set 'test'. .....(çç¥)..... testCompileClasspath - Compile classpath for source set 'test'. .....(çç¥)..... testCompileOnly - Compile dependencies for source set 'test'. .....(çç¥)..... testRuntime - Runtime dependencies for source set 'test'. .....(çç¥)..... (*) - dependencies omitted (listed previously) BUILD SUCCESSFUL Total time: 10.541 secs
ãã¤ã³ãã¨ãã¦ã¯ã
- build.gradle ã§ãã¼ã¸ã§ã³ãæå®ãã¦ããªããã®ã¯
org.springframework.boot:spring-boot-starter-web: -> 1.3.6.RELEASE
ã®ããã«ä½¿ç¨ããããã¼ã¸ã§ã³ãåºåããã¾ãã - ã©ã¤ãã©ãªã® pom ã«è¨è¼ããããã¼ã¸ã§ã³ã¨ã¯å¥ã®ãã¼ã¸ã§ã³ã使ç¨ãããå ´åã«ã¯
org.slf4j:slf4j-api:1.7.20 -> 1.7.21
ã®ããã«ä½¿ç¨ããããã¼ã¸ã§ã³ãåºåããã¾ãã
ãã®åºåçµæãè¦ããã¨ã§ãksbysample.library:ksbysample-library-depend-nospring:1.0-RELEASE
ã§ã¯ org.apache.commons:commons-lang3:3.4
ã使ç¨ããã¦ãããã¨ãåããã¾ãã
ksbysample-webapp-demo ããã¸ã§ã¯ã㧠org.apache.commons:commons-lang3 ã®ä¸ä½ãã¼ã¸ã§ã³ãæå®ãã¦ã¿ã
build.gradle ã® dependencies ã以ä¸ã®ããã«å¤æ´ããå¾ãGradle projects View ã®å·¦ä¸ã«ãããRefresh all Gradle projectsããã¿ã³ãã¯ãªãã¯ã㦠build.gradle ãåæ ãã¾ãã
dependencies { compile('org.springframework.boot:spring-boot-starter-web') testCompile('org.springframework.boot:spring-boot-starter-test') compile('org.apache.commons:commons-lang3:3.3') compile('ksbysample.library:ksbysample-library-simpleutils:1.0-RELEASE') compile('ksbysample.library:ksbysample-library-depend-nospring:1.0-RELEASE') }
compile('ksbysample.library:ksbysample-library-simpleutils:1.0-RELEASE')
ã®ä¸ã«compile('org.apache.commons:commons-lang3:3.3')
ã追å ãã¾ãã
ã³ãã³ãã©ã¤ã³ãã gradlew dependencies
ã³ãã³ããå®è¡ãã¦ä¾åé¢ä¿ã確èªãã¾ãã
\--- ksbysample.library:ksbysample-library-depend-nospring:1.0-RELEASE \--- org.apache.commons:commons-lang3:3.4 -> 3.3
org.apache.commons:commons-lang3
㯠ksbysample-library-depend-nospring
ã® pom ã«è¨è¿°ããã 3.4 ã§ã¯ãªã build.gradle ã«è¨è¿°ãã 3.3 ã使ç¨ããã¾ããã
ä»åº¦ã¯ build.gradle ã® dependencies 㧠compile('ksbysample.library:ksbysample-library-simpleutils:1.0-RELEASE')
ã®ä¸ã« compile('org.apache.commons:commons-lang3:3.3')
ãè¨è¿°ãã¦ã¿ã¾ãã
dependencies { compile('org.springframework.boot:spring-boot-starter-web') testCompile('org.springframework.boot:spring-boot-starter-test') compile('ksbysample.library:ksbysample-library-simpleutils:1.0-RELEASE') compile('ksbysample.library:ksbysample-library-depend-nospring:1.0-RELEASE') compile('org.apache.commons:commons-lang3:3.3') }
ãRefresh all Gradle projectsããã¿ã³ãã¯ãªãã¯ã㦠build.gradle ãåæ ããå¾ãgradlew dependencies
ã³ãã³ããå®è¡ãã¦ä¾åé¢ä¿ã確èªãã¾ãã
+--- ksbysample.library:ksbysample-library-depend-nospring:1.0-RELEASE | \--- org.apache.commons:commons-lang3:3.4 -> 3.3
å
ç¨ã¨åæ§ã« org.apache.commons:commons-lang3
㯠3.4 ã§ã¯ãªã 3.3 ã使ç¨ããã¾ãããè¨è¿°ã®ä½ç½®ã«ã¯é¢ä¿ãªã build.gradle ã«æ¸ããããã¼ã¸ã§ã³ã®æ¹ãåªå
ãããããã§ãã
ksbysample-library-depend-nospring ã©ã¤ãã©ãªãå©ç¨ããããã¸ã§ã¯ã㧠org.apache.commons:commons-lang3:3.4 以å¤ã®ãã¼ã¸ã§ã³ãæå®ããæã«ã¨ã©ã¼ã«ãªãããã«ã§ããã®ãï¼
POM Reference ã® Dependency Version Requirement Specification ãè¦ãã¨ä¾åããã©ã¤ãã©ãªã®ãã¼ã¸ã§ã³ãå®ç¾©ã§ããããã§ãã試ãã¦ã¿ã¾ãã
ksbysample-webapp-demo ããã¸ã§ã¯ããéã㦠ksbysample-library-depend-nospring ããã¸ã§ã¯ããéããå¾ãbuild.gradle ã以ä¸ã®å 容ã«å¤æ´ãã¾ãã
group 'ksbysample.library' version '1.1-RELEASE' .......... dependencies { compile("org.apache.commons:commons-lang3:[3.4]") testCompile("org.spockframework:spock-core:1.0-groovy-2.4") }
- version ã®æååã
1.0-RELEASE
â1.1-RELEASE
ã«å¤æ´ãã¾ãã org.apache.commons:commons-lang3
ã®ãã¼ã¸ã§ã³çªå·ã®æå®æ¹æ³ã3.4
â[3.4]
ã«å¤æ´ãã¾ãã
Gradle projects View ã®å·¦ä¸ã«ãããRefresh all Gradle projectsããã¿ã³ãã¯ãªãã¯ã㦠build.gradle ãåæ ããå¾ãuploadArchives ã¿ã¹ã¯ãå®è¡ã㦠Nexus ã«ç»é²ãã¾ãã
Nexus ã«ç»é²ããã 1.1-RELEASE ã® pom ãã¡ã¤ã«ãè¦ã¦ã¿ãã¨ã<version>[3.4]</version>
ã§ç»é²ããã¦ãããã¨ã確èªã§ãã¾ãã
ksbysample-library-depend-nospring ããã¸ã§ã¯ããéã㦠ksbysample-webapp-demo ããã¸ã§ã¯ããéããå¾ãbuild.gradle ã以ä¸ã®å 容ã«å¤æ´ãã¾ãã
dependencies { compile('org.springframework.boot:spring-boot-starter-web') testCompile('org.springframework.boot:spring-boot-starter-test') compile('ksbysample.library:ksbysample-library-simpleutils:1.0-RELEASE') compile('ksbysample.library:ksbysample-library-depend-nospring:1.1-RELEASE') compile('org.apache.commons:commons-lang3:3.3') }
ksbysample.library:ksbysample-library-depend-nospring
ã®ãã¼ã¸ã§ã³ã1.0-RELEASE
â1.1-RELEASE
ã«å¤æ´ãã¾ãã
Gradle projects View ã®å·¦ä¸ã«ãããRefresh all Gradle projectsããã¿ã³ãã¯ãªãã¯ã㦠build.gradle ãåæ ãã¾ãããç¹ã«ã¨ã©ã¼ã¯åºã¾ããã§ãããããï¼
gradlew dependencies
ã³ãã³ããå®è¡ãã¦ã¿ã㨠org.apache.commons:commons-lang3
ã®ãã¼ã¸ã§ã³ã¯ 3.3 ã«ãªã£ã¦ãã¾ããããã
ã©ã¤ãã©ãªãæ³å®ãã¦ããªããã¼ã¸ã§ã³ã使ç¨ããªãããå¶éãããããã¨ã¯åºæ¥ãªãããã§ããDependency Version Requirement Specification ã¯åã«æ¸ãã¦ãããã ãã¨ãããã¨ãªã®ã§ããããï¼
Nexus ã«ç»é²ãã ksbysample-library-depend-nospring ã® 1.1-RELEASE ã¯åé¤ããããã¾ã§å¤æ´ããå 容ãå ¨ã¦ç ´æ£ãã¦å ã«æ»ãã¾ããä»åã¯ä½ã commit ãã¾ããã
ã½ã¼ã¹ã³ã¼ã
å±¥æ´
2016/08/20
åççºè¡ã