How to port mavenRepo in Gradle 1.7 to maven in Gradle 1.9?

In build scripts for Gradle 1.7, usually see

mavenRepo url: 'https://artifactory.example.com/repo' 

However, after upgrading to Gradle 1.9, starting gradle gives 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 at the Gradle docs confirms that mavenRepo out of date. How do I upgrade from mavenRepo to maven .

+6
source share
1 answer

The documentation for DSL Gradle indicates that maven accepts a closure or action. After a few minutes of work, I found an example that works as follows.

 maven { url 'https://artifactory.example.com/repo' } 
+11
source

All Articles