Gradle: Build file should not contain a package statement - gradle

I have a gradle build project that consists of a buildSrc/build.gradle and a project-level build.gradle. The buildSrc/build.gradle compiles a jar dependency that contains a class the project-level build.gradle needs. However, when the project-level build.gradle tries to instantiate an instance of the class pulled in by buildSrc/build.gradle, the build fails. The error is:
Could not open no_buildscript class cache for build file ~/git/project/build.gradle - Build file ~/git/project/build.gradle should not contain a package statement.
In particular, the project-level build needs the DIGSauceLabsUpdater class that is in the bacon-test-utilities pulled in by buildSrc/build.gradle.
I have tried importing the bacon-test-utilities package into the project-level build and removing the package name from the class in the "def dashUpdater" line. This gave me the same build error.
Can anyone help me understand what else I need to do in order to access a class pulled in by the buildSrc/gradle.build in the the project-level build?
Thank you,
-erzsebet
Here is my buildSrc/build.gradle file:
// vim:ft=groovy
apply plugin: 'base'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'groovy'
// automated test dependencies
// ---------------------------
dependencies {
def saucerestVersion = "1.0"
compile gradleApi()
// sauce lab's REST client
compile "com.saucelabs.saucerest:saucelabs-saucerest:$saucerestVersion"
// test utilities
// Note: Needed here for DIGSauceLabsUpdater use in main build.gradle
compile "com.drillinginfo.global:bacon-test-utilities:0.+"
}
// artifacts and maven stuff
// -------------------------
repositories {
maven {
url "${project.mavenPublicUrl}/"
}
}
Here are the relevant bits of my project-level build.gradle:
// vim:ft=groovy
apply plugin: 'base'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'groovy'
// browser driver extensions for acceptance test tasks
ext.drivers = ["firefox", "chrome", "ie"]
// automated test dependencies
// ---------------------------
dependencies {
groovy "org.codehaus.groovy:groovy-all:1.8.6"
def gebVersion = "0.7.2"
def seleniumVersion = "2.31.0"
def lazerycodeVersion = "1.1"
def saucerestVersion = "1.0"
// spock
testCompile "org.codehaus.geb:geb-spock:$gebVersion"
testCompile "org.spockframework:spock-core:0.6-groovy-1.8"
// gradle plugin for test listener code
compile files('buildSrc/src/main/lib/gradle-plugins-1.2.jar')
// test utilities
testCompile "com.drillinginfo.global:bacon-test-utilities:0.+"
// Drivers
drivers.each { driver ->
testCompile "org.seleniumhq.selenium:selenium-$driver-driver:$seleniumVersion"
}
}
// automated acceptance tasks
// --------------------------
// define a TestListener implementation to report test results to Sauce Labs
// THE NEXT LINE IS WHERE THE BUILD CHOKES
def dashUpdater = new com.drillinginfo.global.test.utils.DIGSauceLabsUpdater()
// ensure the tests have access to properties passed in on the command line (-D)
tasks.withType(Test) {
gradle.addListener(dashUpdater)
}
Here is the stack trace output of my ./gradlew run task:
FAILURE: Build failed with an exception.
* What went wrong:
Could not open no_buildscript class cache for build file '/home/account/git/project/build.gradle' (/home/account/.gradle/caches/1.2/scripts/build_7hf4r97619snd7in1srbtn16n6/ProjectScript/no_buildscript).
Build file '/home/account/git/project/build.gradle' should not contain a package statement.
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.cache.CacheOpenException: Could not open no_buildscript class cache for build file '/home/ecarmean/git/bacon/build.gradle' (/home/account/.gradle/caches/1.2/scripts/build_7hf4r97619snd7in1srbtn16n6/ProjectScript/no_buildscript).
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:54)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:26)
at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.doOpenDir(DefaultCacheFactory.java:71)
at org.gradle.cache.internal.DefaultCacheFactory$CacheFactoryImpl.open(DefaultCacheFactory.java:110)
at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:183)
at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:133)
at org.gradle.cache.internal.DefaultCacheRepository$AbstractCacheBuilder.open(DefaultCacheRepository.java:120)
at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler.compile(FileCacheBackedScriptClassCompiler.java:51)
at org.gradle.groovy.scripts.internal.ShortCircuitEmptyScriptCompiler.compile(ShortCircuitEmptyScriptCompiler.java:35)
at org.gradle.groovy.scripts.internal.CachingScriptClassCompiler.compile(CachingScriptClassCompiler.java:36)
at org.gradle.groovy.scripts.DefaultScriptCompilerFactory$ScriptCompilerImpl.compile(DefaultScriptCompilerFactory.java:60)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:121)
at org.gradle.configuration.BuildScriptProcessor.evaluate(BuildScriptProcessor.java:38)
at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:43)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:463)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:75)
at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:23)
at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:21)
at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:38)
at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:35)
at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:439)
at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:434)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:38)
at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:39)
at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:25)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
at org.gradle.launcher.cli.ActionAdapter.execute(ActionAdapter.java:30)
at org.gradle.launcher.cli.ActionAdapter.execute(ActionAdapter.java:22)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:200)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:173)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:138)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:48)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:39)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)
Caused by: java.lang.UnsupportedOperationException: Build file '/home/account/git/project/build.gradle' should not contain a package statement.
at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileScript(DefaultScriptCompilationHandler.java:126)
at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler.compileToDir(DefaultScriptCompilationHandler.java:67)
at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$CacheInitializer.execute(FileCacheBackedScriptClassCompiler.java:80)
at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler$CacheInitializer.execute(FileCacheBackedScriptClassCompiler.java:65)
at org.gradle.cache.internal.DefaultPersistentDirectoryCache.buildCacheDir(DefaultPersistentDirectoryCache.java:100)
at org.gradle.cache.internal.DefaultPersistentDirectoryCache.access$100(DefaultPersistentDirectoryCache.java:36)
at org.gradle.cache.internal.DefaultPersistentDirectoryCache$1$1.run(DefaultPersistentDirectoryCache.java:82)
at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.doWriteAction(DefaultFileLockManager.java:162)
at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.writeFile(DefaultFileLockManager.java:151)
at org.gradle.cache.internal.DefaultPersistentDirectoryCache$1.execute(DefaultPersistentDirectoryCache.java:80)
at org.gradle.cache.internal.DefaultPersistentDirectoryCache$1.execute(DefaultPersistentDirectoryCache.java:70)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.withExclusiveLock(DefaultPersistentDirectoryStore.java:73)
at org.gradle.cache.internal.DefaultPersistentDirectoryCache.init(DefaultPersistentDirectoryCache.java:70)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:46)
... 46 more

If you encounter this error:
Build file '...\build.gradle' should not contain a package statement.
you should check above path that mentioned and remove package statement in first line of build.gradle file.Hope helpfull.

A co-worker and I isolated the problem that caused my gradle build to fail with the "build.gradle should not contain a package statement" error. The jar file containing the dependency had both .class and .groovy files. When we recompiled the jar to include only .class files, the gradle build ran without error and was able to instantiate a class from the (troublesome!) dependency.
I also simplified my build structure by removing the buildSrc/build.gradle. It was no longer needed because there was no source being built in that directory. To pull in the (troublesome!) dependency needed in the project-level build.gradle, I used a buildScript block.
Thank you, Peter Niederwieser, for reading and responding to the question!
Here are the relevant bits of the final build script:
// vim:ft=groovy
import com.drillinginfo.global.test.utils.DIGSauceLabsUpdater
apply plugin: 'base'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'groovy'
// automated test dependencies
// ---------------------------
dependencies {
groovy "org.codehaus.groovy:groovy-all:1.8.6"
def gebVersion = "0.7.2"
def seleniumVersion = "2.31.0"
def lazerycodeVersion = "1.1"
def saucerestVersion = "1.0"
// spock
testCompile "org.codehaus.geb:geb-spock:$gebVersion"
testCompile "org.spockframework:spock-core:0.6-groovy-1.8"
// test utilities
testCompile "com.drillinginfo.global:bacon-test-utilities:0.+"
// Drivers
drivers.each { driver ->
testCompile "org.seleniumhq.selenium:selenium-$driver-driver:$seleniumVersion"
}
}
buildscript {
repositories {
maven {
url "${project.mavenPublicUrl}/"
}
}
dependencies {
classpath group: 'com.drillinginfo.global', name: 'bacon-test-utilities', version: '0.0.1+17'
}
}
/ automated acceptance tasks
// --------------------------
// define a TestListener implementation to report test results to Sauce Labs
def dashUpdater = new DIGSauceLabsUpdater()
// ensure the tests have access to properties passed in on the command line (-D)
tasks.withType(Test) {
gradle.addListener(dashUpdater)
}

I was running into this issue with the following in build.gradle:
buildscript {
dependencies {
classpath fileTree(
dir: "some/directory",
include: '**/*.jar')
}
}
some/directory had source jars so the fix was:
buildscript {
dependencies {
classpath fileTree(
dir: "some/directory",
include: '**/*.jar',
exclude: '**/-sources.jar')
}
}

Related

Could not find method compile() for a multi module project

dependencies {
compile project('client')
compile project('-cache
')
Now when I comment out compile project('product-cache-client') it moves to the next one and compains about that.
I tried to add it to gradle.settings in that module like so:
include('client')
include('cache')
But I still get the same error. I even tried adding this to the gradle.settings
project('lib/cache').projectDir = "$rootDir/lib/cache" as File
And still get the same result.
Gradle 4.4
main gradle.build file:
subprojects {
dependencies {
compile project('client')
compile project('cache')
}
repositories{
jcenter()
mavenCentral()
}
}
configure(subprojects){
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
}
repositories {
}
buildscript {
ext {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
jcenter()
mavenCentral()
}
Add the java plugin on top of your parent build, for me this works:
apply plugin:'java'
It is recommended here - the second answer Could not find method compile() for arguments Gradle
And also switch the 'dependencies' with 'repositories' - at least in the sample of build.gradle you wrote here they are switched.
when you define dependency as compile then it can not be accessible at the runtime. If you run the project through IDE then it works but when you run with gradle bootRun or mvn spring-boot:run command then above error will throw. So have to just replace compile with implementation.
dependencies {
implementation project('client')
implementation project('cache')
}

Could not find method cargo() for arguments

I am trying to deploy war to tomcat with gradle cargo,i am getting error could not found method cargo()
C:\Users\naresh.vatsal\workspace_spring_jan14\SpringMvcUsingGradle>gradle build
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\naresh.vatsal\workspace_spring_jan14\SpringMvcUsingGradle\build.gradle' line: 45
What went wrong:
A problem occurred evaluating root project 'SpringMvcUsingGradle'.
Could not find method cargo() for arguments [build_3gitu3al50b7kv8zi1ebj3qsr$runclosure3#302aa00f] on root project 'SpringMvcUsingGradle'.
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'war'
apply plugin: 'com.bmuschko.tomcat-base'
apply plugin: 'com.bmuschko.cargo-base'
ext.tomcatVersion = '7.0.67'
sourceCompatibility = 1.7
buildscript {
repositories {
maven {
url "https://plugins.grdev.net/m2/"
}
}
dependencies {
classpath "com.bmuschko:gradle-tomcat-plugin:2.2.4"
classpath 'com.bmuschko:gradle-cargo-plugin:2.2'
}
}
repositories {
mavenCentral()
}
dependencies {
def cargoVersion = '1.4.5'
cargo "org.codehaus.cargo:cargo-core-uberjar:$cargoVersion",
"org.codehaus.cargo:cargo-ant:$cargoVersion"
compile 'org.springframework:spring-context:4.0.0.RELEASE'
compile 'org.springframework:spring-webmvc:4.0.0.RELEASE'
compile 'org.aspectj:aspectjrt:1.7.4'
compile 'javax.inject:javax.inject:1'
compile 'javax.servlet:jstl:1.2'
compile 'org.slf4j:slf4j-api:1.7.5'
compile 'org.slf4j:jcl-over-slf4j:1.7.5'
compile 'org.slf4j:slf4j-log4j12:1.7.5'
compile 'log4j:log4j:1.2.15'
testCompile 'junit:junit:4.7'
}
cargo {
containerId = 'tomcat7x'
port = 8080
local {
homeDir = file('C:/mdi/soft/apache-tomcat-7.0.67')
output = file('C:/mdi/soft/apache-tomcat-7.0.67/output.log')
}
}
war {
version = ''
}
It seems, that you've applied the wrong plugin at the moment. Just change:
apply plugin: 'com.bmuschko.cargo-base'
to
apply plugin: 'com.bmuschko.cargo'
Because, when you apply the com.bmuschko.cargo-base plugin, you have to configure each task individually, according to the plugin description.
And one more, there is no property output, which could be defined within the local closure, but there is an outputFile property, so, your local closure should look like:
local {
homeDir = file('C:/mdi/soft/apache-tomcat-7.0.67')
outputFile = file('C:/mdi/soft/apache-tomcat-7.0.67/output.log')
}

Gradle build for Java project is failing

Below build.gradle file for java project is failing
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = 1.5
version = '1.0'
repositories {
mavenCentral()
}
dependencies {
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '2.+'
testCompile "log4j:log4j:1.2.9"
testCompile 'org.testng:testng:6.8'
}
test {
// enable TestNG support
task testNGTests(type: Test) {
useTestNG() {
suites 'src/test/resources/testng.xml'
useDefaultListeners = true
}
}
}
Error:
Couldnot find property 'projectDir' on org.gradle.api.tasks.testing.testng.TestNGOptions_Decorated#1595f1bb.
Then I tried in using setting.gradle file with below code:
rootProject.name = 'AutoTest_Gradle'
project(':AutoTest_Gradle').projectDir = 'C:/workspace/AutoTest_Gradle'
Here AutoTest_Gradle is the project name.Then it is failed with below error:
Where:
Settings file 'C:\workspace\AutoTest_Gradle\settings.gradle
What went wrong:`enter code here
A problem occurred evaluating settings 'AutoTest_Gradle'.
Project with path ':AutoTest_Gradle' could not be found.
Can anyone help on this?

Gradle fails to create Eclipse project files

I am trying to start a new Java EE project with Gradle. I have everything close to the way I want it, and im trying to build the eclipse files. The problem is when i run the command gradle eclipse the eclipse plugin creates the eclipse files for the bottom level project, but not the subprojects.
my folders look like this
foobar
--ear
--ejb
--spring
--web
build.gradle
settings.gradle
even if i do gradle ejb:eclipse everything appears to run correctly, i get the notices that the eclipse tasks ran in the console, but no files in the ejb project.
here is my build.gradle. What am i doing wrong?
configure(allprojects){ project ->
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = 1.6
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: "C:/IBM/WebSphere/AppServer/8.5/plugins/", include: [
'com.ibm.ws.runtime.jar',
'com.ibm.ws.wsadie/marshall.jar'
])
compile fileTree(dir: "C:/IBM/WebSphere/AppServer/8.5/runtimes/", include: [
'com.ibm.jaxrs.thinclient_8.5.0.jar',
'com.ibm.jaxws.thinclient_8.5.0.jar',
'com.ibm.ws.ejb.embeddableContainer_8.5.0.jar',
'com.ibm.ws.ejb.thinclient_8.5.0.jar',
'com.ibm.ws.jpa.thinclient_8.5.0.jar',
'com.ibm.ws.orb_8.5.0.jar'
])
}
ext {
easymockVersion = '3.3.1'
jeeVersion = '6.0'
junitVersion = '4.12'
springVersion = '4.1.5.RELEASE'
swaggerVersion = '1.3.12'
}
}
project('ear'){
description = "The EAR Project"
apply plugin: 'ear'
dependencies {
deploy project(':ejb')
deploy project(':spring')
deploy project(path: ':web', configuration: 'archives')
}
}
project('ejb'){
description = "The EJB Project"
dependencies {
compile project(':spring')
}
}
project('spring'){
description = "The Spring BL Logic"
dependencies {
runtime "org.springframework:spring-jdbc:$springVersion"
testCompile "junit:junit:$junitVersion"
testCompile "org.easymock:easymock:$easymockVersion"
testCompile "org.springframework:spring-test:$springVersion"
}
}
project('web'){
description = "The REST layer"
apply plugin: 'war'
dependencies {
compile project(':ejb')
runtime "com.wordnik:swagger-annotations:$swaggerVersion"
runtime "com.wordnik:swagger-core_2.10:$swaggerVersion"
runtime "com.wordnik:swagger-jaxrs_2.10:$swaggerVersion"
}
}
This is the output i get. It tells me the plugin fired for the subprojects but i can't figure out why it doesn't create any files
$ gradle eclipse
:eclipseClasspath
:eclipseJdt
:eclipseProject
:eclipse
:ear:eclipseClasspath
:ear:eclipseJdt
:ear:eclipseProject
:ear:eclipse
:ejb:eclipseClasspath
:ejb:eclipseJdt
:ejb:eclipseProject
:ejb:eclipse
:spring:eclipseClasspath
:spring:eclipseJdt
:spring:eclipseProject
:spring:eclipse
:web:eclipseClasspath
:web:eclipseJdt
:web:eclipseProject
:web:eclipse

No persistent classes found when integration test in Gradle

My project bases on Spring+JPA+Hibernate, and use Ant to manage build process before, now I am intending to use Gradle. While when run 'gradle clean test', I got a exception as below:
[2013-02-07 11:01:36,703][Test worker][WARN ][QuerySplitter] no persistent classes found for query class: from com.mpos.lottery.te.workingkey.domain.WorkingKey w where w.createDateStr=:createDateStr and w.gpeId=:gpeId
[2013-02-07 11:01:36,718][Test worker][ERROR][TEPortServlet] org.hibernate.QueryParameterException: could not locate named parameter [gpeId]; nested exception is java.lang.IllegalArgumentException: org.hibernate.QueryParameterException: could not locate named parameter [gpeId]
I have ran that test case(doesn't need jetty) in both eclipse and Ant, it passed, So i suspect that some incorrect configuration in gradle cause this exception.
Below is my gradle script:
apply plugin: 'war'
// 'war' plugin will apply 'java' plugin automatically
apply plugin: 'java'
apply plugin: 'eclipse'
// run web application, refer to http://gradle.org/docs/current/userguide/jetty_plugin.html
apply plugin: 'jetty'
compileJava.options.encoding = _sourcecode_encoding
compileTestJava.options.encoding = _sourcecode_encoding
// Properties added by the java plugin
sourceCompatibility="${_source_compatibility}"
targetCompatibility="${_target_compatibility}"
//Properties added by the 'war' plugin
webAppDirName="src/main/WWW"
configurations {
provided {
description = 'Non-exported comiple-time dependencies, it will be provided by container.'
}
}
dependencies {
provided files('lib/DEV/j2ee/servlet-api.jar')
compile fileTree(dir: 'lib', include: '**/*.jar', exclude: 'DEV/**/*.jar')
//compile sourceSets.main.output
testCompile fileTree(dir:"lib", include:"DEV/**/*.jar")
}
sourceSets {
main {
compileClasspath = compileClasspath + configurations.provided
//compileClasspath.collect().each({println it})
resources {
srcDir 'src/main/resource'
}
}
test {
resources {
srcDir 'src/test/resource'
}
}
}
test {
scanForTestClasses = false
classpath = configurations.provided + configurations.compile + configurations.testCompile + sourceSets.main.output + sourceSets.test.output
classpath.each({println it})
// customize test process
include 'com/mpos/lottery/te/gameimpl/smsraffle/**/*Test.class'
}
I am new learner of Gradle and groovy, pls help me. Thanks in advance.
By default, Gradle uses separate output directories for classes and resources, which can cause problems with Hibernate/JPA. Try:
sourceSets.main.output.resourcesDir = sourceSets.main.output.classesDir
sourceSets.test.output.resourcesDir = sourceSets.test.output.classesDir
You might not need the latter.

Resources