My gradle version is 2.2.1.
I am trying to use the artifactory plugin in gradle (apply plugin: 'artifactory'
)
This is my code:
buildscript {
repositories {
maven {
url 'http://172.14.3.93/artifactory/plugins-release'
}
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.9')
}
}
allprojects {
apply plugin: 'artifactory'
}
artifactory {
contextUrl = "${artifactory_contextUrl}" //The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
repoKey = 'libs-release-local'
maven = true
}
}
resolve {
repository {
repoKey = 'libs-release'
maven = true
}
}
}
When i run gradle build, this is what i get:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Workspace\GradleConfiguration\build.gradle' line: 100
* What went wrong:
A problem occurred evaluating root project 'GradleConfiguration'.
> Failed to apply plugin [id 'artifactory']
> Could not find method add() for arguments [artifactoryPublish, class org.jfrog.gradle.plugin.artifactory.extractor.BuildInfoTask] on task set.
* Try:
Run with --info or --debug option to get more log output.
Also, when i delete all the code that is related to the artifactory and leave only apply plugin: 'artifactory'
, i get this error:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\OnRights_Workspace\GradleConfiguration\build.gradle' line: 86
* What went wrong:
A problem occurred evaluating root project 'GradleConfiguration'.
> Failed to apply plugin [id 'artifactory']
> Plugin with id 'artifactory' not found.
* Try:
Run with --info or --debug option to get more log output.