JPA conflicts a bit with src/main/resources in that I had to do something like this
//ok, this is the deal here. JPA/hibernate made the decision to look for a persistence.xml file
//AND scan for classes with @Entity in the directory OR jar with that xml file only
//maven(and I hate this) a long time ago separated src/main/java and src/main/resources but
//this screws tools in many situations like this one so this puts it back so the output is at
//least put to the same location
sourceSets.main.output.resourcesDir = sourceSets.main.output.classesDir
compileJava.doLast {
tasks.processResources.execute()
//I literally just added this so next time it happens, I can look for this log…
logger.warn(“processed resources=”+sourceSets.main.output.resourcesDir)
}
I am on this gradle version
distributionUrl=http://services.gradle.org/distributions/gradle-2.14.1-all.zip
I am using these parallel gradle properties though (which claim to be in experimental mode)
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true
The speedup is too nice to not have these. I am going to comment out configureondemand and see if I can still reproduce it over the next week though.
My issue however is that there is some sort of race condition though the tasks that I am most interested appear to go in order just fine…
:webserver:webpiecesServerBuilder:templateProject:WEBPIECESxAPPNAME:compileJava
:webserver:webpiecesServerBuilder:templateProject:WEBPIECESxAPPNAME:classes
:webserver:webpiecesServerBuilder:templateProject:WEBPIECESxAPPNAME:compileTestJava
:webserver:webpiecesServerBuilder:templateProject:WEBPIECESxAPPNAME:testClasses
:webserver:webpiecesServerBuilder:templateProject:WEBPIECESxAPPNAME:test
However, the src/main/resources on this project are only copied over 90% of the time to the output directories. The funny thing is the directories are there from src/main/resources. The class files are there as well. Just all the resources are missing but only 1 every 10 runs or so AND my script does a ‘./gradlew clean build’ every time and I just run the .sh script.
It’s very weird and seems to be some sort of race condition.
I will add more info as I find out myself what is going on but I am hoping a little it may be a known issue or something or I am doing something wrong.