Gradle dependency issue

Hi,I developed one utility using gradle.That utility’s test cases are working fine.I want to use this utility as dependency in my custom gradle java plugin.My custom java plugin is also building properly but whenever I tried to use this custom plugin in my main gradle project the task associated with plugin is failing by throwing following dependency issue:

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:hivetest’.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    Caused by: java.lang.NoSuchMethodError: org.apache.hive.service.cli.operation.LogDivertAppender.setWriter(Ljava/io/Writer;)V
    at org.apache.hive.service.cli.operation.LogDivertAppender.(LogDivertAppender.java:166)
    at org.apache.hive.service.cli.operation.OperationManager.initOperationLogCapture(OperationManager.java:85)
    at org.apache.hive.service.cli.operation.OperationManager.init(OperationManager.java:63)
    at org.apache.hive.service.CompositeService.init(CompositeService.java:59)
    at org.apache.hive.service.cli.session.SessionManager.init(SessionManager.java:85)
    at org.apache.hive.service.CompositeService.init(CompositeService.java:59)
    at org.apache.hive.service.cli.CLIService.init(CLIService.java:118)
    at org.apache.hive.service.CompositeService.init(CompositeService.java:59)
    at org.apache.hive.service.server.HiveServer2.init(HiveServer2.java:100)
    at com.datametica.hiveunit.core.MiniCluster.(MiniCluster.java:126)
    at com.datametica.hiveunit.HiveUnit.(HiveUnit.java:58)
    at com.datametica.hiveUnitPlugin.gradle.HiveUnitTask.sendHuFilesPathToHive(HiveUnitTask.java:50)
    at com.datametica.hiveUnitPlugin.gradle.HiveUnitTask.hiveUnitTask(HiveUnitTask.java:40)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    … 57 more

BUILD FAILED

surprisingly main gradle project clean build tasks are working properly also test cases of utlity and plugin project are working properly.I know its some dependecy conflict but unable to get why its not getting in utlity project itself and which dependency is causing this issue?please let me know as I am struggling with this issue since long time.

please find below build.gradle file of my gradle utlity project:

apply plugin: 'java’
apply plugin: 'application’
apply plugin: 'maven-publish’
apply plugin: 'eclipse’
mainClassName = ‘com.datametica.hiveunit.HiveUnit’

buildscript {
repositories {
maven {
url “https://plugins.gradle.org/m2/
}
}
dependencies {
classpath “com.github.jengelman.gradle.plugins:shadow:1.2.2”
}
}

apply plugin: "com.github.johnrengelman.shadow"
repositories {
maven {
url “http://conjars.org/repo/
}
mavenCentral()
mavenLocal()
}

sourceCompatibility = 1.7
targetCompatibility = 1.7

dependencies {
compile 'junit:junit:4.10’
compile 'org.apache.hadoop:hadoop-minicluster:2.2.0’
compile 'xerces:xercesImpl:2.9.1’
compile (‘org.apache.hive:hive-service:1.2.1’){
exclude group:‘commons-cli’,module:'commons-cli’
exclude group:‘org.slf4j’,module:'slf4j-api’
exclude group:‘log4j’,module:'apache-log4j-extras’
exclude group:‘commons-logging’,module:‘commons-logging’
}
compile (‘org.apache.hive:hive-jdbc:1.2.1’){
exclude group:‘org.apache.hive’,module:'hive-service’
exclude group:‘org.apache.hive’,module:'hive-metastore’
exclude group:‘org.slf4j’,module:'slf4j-api’
exclude group:‘log4j’,module:'apache-log4j-extras’
exclude group:‘commons-logging’,module:'commons-logging’
exclude group:‘org.apache.hive’,module:‘hive-common’
}
}
group = 'com.datametica.hiveunit’
version = '1.1’
publishing {
publications {
//mavenJava(MavenPublication) {
// groupId “$group”
// artifactId ‘hiveunit_gradle’
// version “$version”
// from components.java
//}
shadow(MavenPublication) {
artifactId 'hiveUnitPlugin’
from components.java
artifact shadowJar
}
}
}
uploadArchives {
repositories {
mavenLocal()
}
}

below is the build.gradle file of my gradle custom plugin :
apply plugin: 'java’
dependencies {
compile gradleApi()
}
apply plugin: 'maven-publish’
repositories {
mavenLocal()
mavenCentral()
maven {
url “http://conjars.org/repo/
}
}
dependencies {
//compile ‘com.datametica.hiveunit:hive_unit:1.0’
// compile 'org.slf4j:slf4j-simple:1.6.1’
compile 'com.datametica.hiveunit:hiveunit_gradle:1.1’
testCompile ‘junit:junit:4.11’
}
group = 'com.datametica.hiveUnitPlugin.gradle’
version = '1.1’
publishing {
publications {
maven(MavenPublication) {
groupId "$group"
artifactId 'hiveUnitPlugin’
version "$version"
from components.java
}

}

}
uploadArchives {
repositories {
mavenLocal()
}
}

below is build.gradle file of my main gradle project:
apply plugin: ‘java’

buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
url “http://conjars.org/repo/
}
}
dependencies {
classpath ‘com.datametica.hiveUnitPlugin.gradle:hiveUnitPlugin:1.1’
}
}
apply plugin: 'hiveunit-test’
task hivetest(type: com.datametica.hiveUnitPlugin.gradle.HiveUnitTask) {
//hiveUnitPlugin.huFolderPath = file("${projectDir}/huFiles")
}