2017-11-21 3 views
0

나는 gradle을 처음 사용합니다. maven 프로젝트를 gradle로 마이그레이션하려고합니다.그레이브에서 메이븐 이에 상응하는 저장소 구성하기

다음은 maven의 코드입니다.

<repositories> 
    <repository> 
     <id>spring-libs-snapshot</id> 
     <url>https://repo.spring.io/libs-snapshot</url> 
    </repository> 
</repositories> 

<pluginRepositories> 
    <pluginRepository> 
     <id>spring-plugins-release</id> 
     <url>https://repo.spring.io/plugins-release</url> 
    </pluginRepository> 
    <pluginRepository> 
     <id>jcenter</id> 
     <url>https://dl.bintray.com/asciidoctor/maven</url> 
    </pluginRepository> 
</pluginRepositories> 

gradle.build 파일에 위의 구성을 어떻게 구성합니까?

+1

문서를 읽었습니까? https://docs.gradle.org/current/userguide/dependency_management.html#sec:repositories –

+0

전체 Maven POM 파일 –

+0

을 게시 할 수 있습니까? maven 파일입니다 (https://github.com/carosys/spring-data). -aerospike-example/blob/master/spring-data-aerospike-example/pom.xml –

답변

1

여기에 전체 .gradle 파일이 필요합니다. gradle init --type pom 명령을 사용하여 기존 Maven 프로젝트를 프로젝트를 그라데이션으로 변환 할 수 있습니다. 이것은 여전히 ​​그라디언트의 잠복 기능입니다. https://docs.gradle.org/current/userguide/feature_lifecycle.html

apply plugin: 'java' 
apply plugin: 'maven' 

group = 'org.springframework.boot' 
version = '0.0.1-SNAPSHOT' 

description = """spring-data-aerospike-example""" 

sourceCompatibility = 1.5 
targetCompatibility = 1.5 
tasks.withType(JavaCompile) { 
    options.encoding = 'UTF-8' 
} 



repositories { 

    maven { url "https://repo.spring.io/libs-snapshot" } 
    maven { url "http://repo.maven.apache.org/maven2" } 
} 
dependencies { 
    compile group: 'org.springframework.data', name: 'spring-data-commons', version:'1.11.0.RELEASE' 
    compile group: 'org.springframework.data', name: 'spring-data-aerospike', version:'1.0.0.BUILD-SNAPSHOT' 
    compile group: 'org.springframework.data', name: 'spring-data-keyvalue', version:'1.0.0.M1' 
    compile group: 'org.springframework', name: 'spring-context', version:'4.1.7.RELEASE' 
    compile group: 'org.springframework', name: 'spring-tx', version:'4.1.7.RELEASE' 
    compile group: 'com.aerospike', name: 'aerospike-client', version:'3.1.3' 
    compile group: 'log4j', name: 'log4j', version:'1.2.17' 
    testCompile group: 'joda-time', name: 'joda-time', version:'2.7' 
}