В свой проект я хочу включить задачу gradle, которая использует пользовательские зависимости. Для этого я собираюсь написать собственный плагин Gradle.
Но когда я запускаю gradle, отображается следующая ошибка:
A problem occurred configuring root project 'moduleUpdater'.
Could not resolve all dependencies for configuration ':classpath'.
Could not find org.example.plugin:MyJavaPlugin:1.0-SNAPSHOT.
Searched in the following locations:
.../moduleUpdater/repo/org/example/plugin/MyJavaPlugin/1.0-SNAPSHOT/maven-metadata.xml
.../moduleUpdater/repo/org/example/plugin/MyJavaPlugin/1.0-SNAPSHOT/MyJavaPlugin-1.0-SNAPSHOT.pom
.../moduleUpdater/repo/org/example/plugin/MyJavaPlugin/1.0-SNAPSHOT/MyJavaPlugin-1.0-SNAPSHOT.jar
Required by:
:moduleUpdater:unspecified
Проблема в том, что зависимость пользовательского плагина Gradle от maven не добавляется в основной rootProject.
Я использовал учебник, например:
Создание пользовательского подключаемого модуля Gradle с помощью Java и http://www.javacodegeeks.com/2012/08/gradle-custom-plugin.html
В следующем руководстве создается проект точно так же, как в этом git-репозитории: https://github.com/rakeshcusat/Code4Reference/tree/master/GradleExample/custom-plugin-1
Но если я попытаюсь запустить «задачу gradle» в папке «user» данного репозитория, я все равно получу то же сообщение:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'user'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.code4reference:code4ReferencePlugin:1.1-SNAPSHOT.
Searched in the following locations:
.../Code4Reference-master/GradleExample/custom-plugin-1/repo/com/code4reference/code4ReferencePlugin/1.1-SNAPSHOT/maven-metadata.xml
.../Code4Reference-master/GradleExample/custom-plugin-1/repo/com/code4reference/code4ReferencePlugin/1.1-SNAPSHOT/code4ReferencePlugin-1.1-20120816.164441-5.pom
.../Code4Reference-master/GradleExample/custom-plugin-1/repo/com/code4reference/code4ReferencePlugin/1.1-SNAPSHOT/code4ReferencePlugin-1.1-20120816.164441-5.jar
Required by:
:user:unspecified
Как он может сказать gradle автоматически создать репозиторий плагина maven (используя ту же задачу)?
build.gradle
. - person JBirdVegas   schedule 23.01.2016