In my gradle plugin project, I added a maven repository from jitpack.
// From a gradle plugin project
buildscript {
repositories {
mavenCentral()
maven {
url = uri("https://www.jitpack.io")
}
}
}
And I added some dependencies from GitHub projects which don’t publish to MavenCentral.
Also, I used shadowJar to copy all dependencies into my archive jar, for plugin publishing. By the way, I don’t know whether it’s necessary.
However, when I apply this plugin in another project, it said:
// From a production project
A problem occurred configuring root project 'DST'.
> Could not resolve all files for configuration ':classpath'.
> Could not find com.github.anuken.arc:arc-core:123fbf12b9.
Searched in the following locations:
- https://plugins.gradle.org/m2/com/github/anuken/arc/arc-core/123fbf12b9/arc-core-123fbf12b9.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project : > io.github.liplum.mgpp:io.github.liplum.mgpp.gradle.plugin:1.0.2 > io.github.liplum.mgpp:MindustryGradlePluginPlumy:1.0.2
When I added maven repository from jitpack, it’s solved.
// From a production project
buildscript {
repositories {
maven {
url "https://www.jitpack.io"
}
}
}
So, my question is:
How can I declare what 3rd party maven repository I used in plugin project, in order users don’t have to import it in their buildscript manually.
My plugin’s repo is here: GitHub - PlumyGame/mgpp: A Mindustry gradle plugin, named Plumy., hopefuly it can help you solve this problem.