Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle download dependency merge into maven local repository?

Tags:

maven

gradle

It's the 1st time to use gradle in our project and we're using the local maven repository. Now I have a question: Is it possible to make gradle download dependency merging into local maven repository automatically? Is there any configuration or plugin to resolve? Thanks a lot!

like image 933
WilliamS Avatar asked Oct 16 '13 06:10

WilliamS


People also ask

Does Gradle use Maven local repository?

Bookmark this question. Show activity on this post.

Can I use Gradle dependency in Maven?

Declaring dependencies. Gradle uses the same dependency identifier components as Maven: group ID, artifact ID and version. It also supports classifiers.

How do I migrate from Gradle to Maven?

Gradle ships with a Maven plugin, which adds support to convert a Gradle file to a Maven POM file. It can also deploy artifacts to Maven repositories. The plugin uses the group and the version present in the Gradle file and adds them to the POM file. Also, it automatically takes the artifactId from the directory name.

Where does Gradle download dependencies from?

Gradle declares dependencies on JAR files inside your project's module_name /libs/ directory (because Gradle reads paths relative to the build.gradle file). This declares a dependency on version 12.3 of the "app-magic" library, inside the "com.example.android" namespace group.


1 Answers

Short answer is: no way!

Gradle has its own cache, although it can read the maven local repo like this:

repositories {
    mavenLocal()
    mavenCentral()
}

If some dependency not found in maven local repo, Gradle will download it from maven central and cache it in ~/.gradle/caches/...

see http://forums.gradle.org/gradle/topics/cache_dependencies_into_local_maven_repository_from_gradle

like image 95
Jim Yin Avatar answered Oct 19 '22 11:10

Jim Yin