16

I’m trying to create a custom Artifactory repository to resolve dependencies in my gradle project, but I’m confused between gradle and maven repo: what repository key should I choose? And what is the real difference between a gradle repository and a maven repository?

3 Answers 3

16

There is no such thing as a Gradle repository.

While Maven is the name for both a build tool and a repository type, Gradle ist just a build tool. It supports both Maven and Ivy repositories.

7
  • 2
    Ok, but in artifactory to create a repository I need to choose its package type (maven, Ivy or gradle); so what is th real signification of repository package type
    – khouloud
    Apr 2, 2018 at 10:01
  • 1
    Thank you very much that was really helpful.
    – khouloud
    Apr 2, 2018 at 14:33
  • 6
    Looks like what Artifact calls a "Gradle repository" is the Wharf cache default layout which was introduced back in Gradle 1.0. So maybe it's an ancient way to make the (local) cache a shared one by pointing to an Artifactory repository. Anyway, it does not look like Wharf is still actively maintained or in use.
    – sschuberth
    Apr 2, 2018 at 20:31
  • 1
    In jFrog, it seems picking "Gradle" as type will offer you code snippets for Gradle when you use "Set me up" option from repository page.
    – Wand Maker
    Nov 20, 2019 at 15:31
  • 2
    The comments come closer to answering the question than the answer itself does.
    – opticyclic
    Aug 25, 2020 at 18:46
-2

Gradle is a Java development tool, but not the only one. An alternative is Maven, which is older and commonly used. Spring Framework let developers to choose between these two tools.

Gradle is an open source build automation system that's built on Apache Maven and Apache Ant concepts. It uses a domain-specific language based on the programming language Groovy. This is a very interesting difference between Gradle and older Apache Maven, which uses XML. Gradle was developed in 2007 and in 2013 it was adopted by Google for Android system (this must say a lot about how powerful is Gradle).

Maven Repository is a directory where all the project jars, library jar and plugins can be used by Maven/Gradle easily. Maven Repository are of three types: local, central or remote. Gradle can and use the Maven Repositories, as I've said before, Gradle is build on top of Maven concepts.

1
  • 1
    The question is asking specifically about the difference in Artifactory repo layouts and not about generic differences between the build tools.
    – opticyclic
    Aug 25, 2020 at 18:48
-3

You can think of Gradle as goodness of Ant and Maven put together minus the noise of XML. And scriptability with groovy is very big plus.

  • Gradle gives you conventions but still gives you power to override them easily.
  • Gradle build files are less verbose as they are written in groovy.
  • It provides very nice DSL for writing build tasks.
  • Has lot of good plugins and vibrant ecosystem

When to use Gradle and When to use Maven ?

Almost everywhere for creating java/groovy project. The build files are much terse.

With Google choosing Gradle as the new build system for Android SDK and mature libraries like Spring, Hibernate, Grails, Groovy etc. already using it to power their builds, there is no doubt that Gradle is becoming de-facto build system for the Java ecosystem.

4
  • Thank y very much for your answer, but my confusion is not about the difference between gradle and maven but the difference about gradle repository and maven repository; in fact as i said i'm trying to create an artifactory repository: should I choose gradle or maven for the repository type, I still can't see the difference between the two repository types
    – khouloud
    Apr 2, 2018 at 9:25
  • It depends upon your need. artifactory repo for android or j2ee.? Apr 2, 2018 at 9:28
  • Artifactory Repository for j2ee
    – khouloud
    Apr 2, 2018 at 9:36
  • U can choose both types. But maven is better. because lot of web apps use maven pom. Apr 2, 2018 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.