Hi,
I am new to Gradle and trying to create a new plugin. I am using Gradle 2.6 I am applying from similar solution to here:
Error message I am getting is quite generic. I really appreciate if you suggest any troubleshooting steps. I don’t really know what is wrong?
Error:
- What went wrong:
A problem occurred evaluating root project ‘java’.
Failed to apply plugin [id ‘org.tts’]
Could not create plugin of type ‘UploadGradlePlugin’.
My build.gradle script from consumer project:
buildscript {
repositories {
maven {
url uri('../../../../repo')
}
mavenLocal()
}
dependencies {
//Custom plugin class path. Group=com.testdependencies, artifactId=ttsclient, version=0.0.1-BUILD-SNAPSHOT
classpath 'com.testdependencies:ttsclient:0.0.1-BUILD-SNAPSHOT'
}
}
apply plugin: 'org.tts'
task uploadJacocoDump(type: org.ttsgradle.UploadGradleTask) {
println("running consumer task!")
}
build.gradle file from publisher script:
apply plugin: 'maven'
repositories {
maven {
url uri('../repo')
}
mavenLocal()
}
group = 'com.testdependencies'
version = '0.0.1-BUILD-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
configurations {
json
compile.extendsFrom json
}
dependencies {
json group: 'org.glassfish', name: 'javax.json', version: '1.0.4'
compile group: 'org.jacoco', name: 'org.jacoco.core', version: '0.7.4.201502262128'
compile group: 'org.testng', name: 'testng', version: '6.8.7'
testCompile group: 'org.powermock', name: 'powermock-module-testng', version: '1.6.2'
testCompile group: 'org.powermock', name: 'powermock-api-easymock', version: '1.6.2'
testCompile group: 'org.easymock', name: 'easymock', version: '3.3.1'
testCompile group: 'com.google.inject', name: 'guice', version: '4.0'
compile files(gradleApi().source.findAll { it.name.startsWith("gradle") })
compile files(gradleApi().source.findAll { it.name.startsWith("groovy") })
}
jar {
manifest {
attributes "Main-Class": "org.tts.client.TestIQ",
"Class-Path": "javax.json-1.0.4.jar"
}
}
task fatJar(type: Jar, dependsOn: ['createPom']) {
group = 'build'
description = 'Assembles a jar archive containing the main classes and all dependent classes.'
jar.dependsOn << fatJar
manifest {
attributes "Main-Class": "org.tts.client.TestIQ"
}
baseName = project.name + '-all'
from (sourceSets.main.output.classesDir)
from (configurations.json.collect {zipTree(it)})
}
test {
useTestNG()
jacoco {
// Exclude all testlogic.jar packages
excludes = [
'com.sleepycat.*',
'org.apache.*',
'org.testlogic.*',
]
}
}
jacocoTestReport {
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'**/testlogic.jar',
])
})
}
}
task createPom << {
pom {
project {
groupId 'com.testdependencies'
artifactId 'ttsclient'
version "$version"
}
}.writeTo("build/pom.xml")
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: uri('../repo'))
}
mavenLocal()
}
}