I want to use an artifact which i published it in mavenLocal repository , how can i get that artifact ??
I think you add mavenLocal()
to repositories
and then implementation
with the string defining your group id, package name and version number under dependencies
.
Thank you.
i done this. but i still have compilation error, i dnt understand what you mean about āimplementationā , have you an example??
like that ???
example:
implementation āorg.gradle.sample:monJar:1.1ā
implementation
refers to a dependency configuration, as you guessed.
For information on adding Maven Local to your buildās dependency repositories, see this chapter of the user manual. I recommend putting mavenLocal()
after the main repository. For example:
repositories {
mavenCentral()
mavenLocal()
}
Then you just declare your dependencies as normal, like this:
dependencies {
implementation 'org.gradle.sample:monJar:1.1'
}
ok thank you so much
This will always go Maven central. Only artifacts not available in central will be taken from maven local repo.
Correct, and thanks for clarifying the situation. My assumption was that anything you wanted to pick up from Maven local would not be in Maven Central.
In my view, Maven Central should be prioritised as the definitive source of published artifacts. Maven Local is too prone to corruption. And you generally want the main source of artifacts to be first in the list to reduce the number of HTTP requests the dependency management system sends.
I recommend that you put mavenLocal() last in the repos list. Otherwise you will have issues.