Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Gradle Deprecations

DZone's Guide to

Gradle Deprecations

· Java Zone
Free Resource

Try Okta to add social login, MFA, and OpenID Connect support to your Java app in minutes. Create a free developer account today and never build auth again.

Gradle Deprecations – Common Mistakes

Maven Repository

OLD

mavenCentral()

NEW

repositories {
 maven {
 url “http://repo1.maven.org/maven2/”
 }
}


Intellij Idea Plugin

OLD

apply plugin:’idea’

NEW

Do not use, IntelliJ will import Maven, Gradle and Eclipse projects (unless you are using a dinosaur version of Idea).

The plugin generates a very very old IntelliJ IDEA project, which is exactly
the same out-of-date plugin provided by Maven (hmm… curious?).

Dependencies

OLD

groovy localGroovy()

or

groovy “org.codehaus.groovy:…”

NEW

compile “org.codehaus.groovy:groovy-all:2.1.6″

Example

        apply plugin:'groovy'
        apply plugin:'eclipse'

        repositories {
         maven {
         url "http://repo1.maven.org/maven2/"
         }

        task wrapper(type:Wrapper) { gradleVersion = '1.6' }

        dependencies {
         compile "org.codehaus.groovy:groovy-all:2.1.6"
         testCompile "org.spockframework:spock-core:0.7-groovy-2.0"
        }
    

Build and launch faster with Okta’s user management API. Register today for the free forever developer edition!

Topics:

Published at DZone with permission of Gordon Dickens, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}