Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

maven 2 - Gradle alternate to mvn install

I have 2 different project build on mvn. I am trying to replace to Gradle.

Project 1 is an SDK, and project 2 is using that sdk (example).

In the time of maven it creates artifact using mvn install which adds the whole project into local repository.

I like to work in gradle like that. I like project 1 build.gradle need to post it as a gradle local repository and then example project need to use it.

In maven we do mvn install which adds a project artifact into .m2 folder but how to do in gradle so what i can add a project artefact's into the local repository.

Any way that I can do so?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

sdk/build.gradle:

apply plugin: "maven"

group = "foo"
version = "1.0"

example/build.gradle:

repositories {
    mavenLocal()
}

dependencies {
    compile "foo:sdk:1.0"
}

$sdk> gradle install

$example> gradle build

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...