In build scripts for Gradle 1.7, it's common to see
mavenRepo url: 'https://artifactory.example.com/repo'
However, after upgrading to Gradle 1.9, running gradle
yields the following warning:
The RepositoryHandler.mavenRepo() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the maven() method instead.
A quick look in the Gradle docs confirms that mavenRepo
has been deprecated. How should I migrate from mavenRepo
to maven
.
Short answer: yes. There's no conflict between having two independent build scripts for the same project, one in Maven and one in Gradle.
It uses a declarative XML file for its POM file and has a host of plugins that you can use. Gradle uses the directory structure you see on Maven, but this can be customized.
The biggest differences are Gradle's mechanisms for work avoidance and incrementality. The top 3 features that make Gradle much faster than Maven are: Incrementality — Gradle avoids work by tracking input and output of tasks and only running what is necessary, and only processing files that changed when possible.
The documentation for the Gradle DSL indicates that maven
accepts a closure or an action. After some minutes of digging, I found an example that works as follows.
maven {
url 'https://artifactory.example.com/repo'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With