How to fix deprecation message about "mavenRepo"

The method mavenRepo has been deprecated. How to migrate the example to method maven which should be used instead? Note: This topic was created from a reply on the What is the best practice for managing javascript libraries (such as JQuery)? topic.

But how to provide the pattern for the file to download? I found out you can use ivy instead:

ivy {
        url ""
        layout "pattern", {
            artifact "[module]-[revision](.[classifier]).[ext]"

repositories {

maven {

url = ‘http://…’