user51
user51

Reputation: 10143

configuring maven equivalent repositories in gradle

I'm new to gradle. I want to migrate a maven project to gradle.

Below is the code in 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>

How can I configure the above maven configuration in the gradle.build file?

Upvotes: 0

Views: 514

Answers (1)

Oguz Ozcan
Oguz Ozcan

Reputation: 1537

Here is the whole .gradle file that you need. You can convert your existing maven projects to gradle projects using gradle init --type pom command. Please note that this is still an incubating feature of the gradle. See 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'
}

Upvotes: 1

Related Questions