我正在尝试推送到Gradle任务中的远程git代码库。我找到的最好的方法是使用在这里找到的插件Gradle-Git:https://github.com/ajoberstar/gradle-git
我基本上只是尝试运行推送任务,然后从那里开始配置它,以便在我的项目中使用它。
下面是我的build.gradle脚本的样子。
apply plugin: 'eclipse'
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'base'
import org.ajoberstar.gradle.git.tasks.*
repositories {
mavenCentral()
maven {
url "[my custom repository repo]"
}
}
dependencies {
compile 'org.ajoberstar:gradle-git:0.4.0'
}
task push(type: GitPush) {
println "Test"
}我的错误是
FAILURE: Build failed with an exception.
* Where:
Build file '[my_path]\build.gradle' line: 19
* What went wrong:
A problem occurred evaluating root project 'Name'.
> Could not find property 'GitPush' on root project 'Name'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED运行--stacktrace会在下面生成异常日志:http://pastebin.com/uqjf5U5k
发布于 2013-05-09 01:38:46
您没有按照插件站点上的说明进行操作
要向构建本身添加一些内容,您需要有一个buildscript块
buildscript {
repositories { mavenCentral() }
dependencies { classpath 'org.ajoberstar:gradle-git:0.4.0' }
}https://stackoverflow.com/questions/16446725
复制相似问题