Now, if I comment that out, well, this line stops working which is critical to get html files that co-reside with their controllers over to the output directories
run ./runAllTesting.sh (which runs gradle) and you will see 100% of things pass.
THEN, modify webpieces/gradle/wrapper/gradle-wrapper.properties to point to 4.8.1 and
again run ./runAllTesting.sh and now the project fails due to the issue in webpieces/webserver/build.gradle (the code above)
I just tested this process myself and 4.8 fails me :(. I am hoping for a workaround or new method of moving files from src/main/java/**/. while excluding *.java files over to the output/classes directories.
Calling task.execute() is not allowed. Please remove that line. Also, you shouldn’t move resources to the same directory as classes, that’ll break caching. What kind of tool requires them to be in the same folder? Java can look up resources across multiple folders on the classpath.
navigating between the controller and html has become the ultimate pain if they are divided. Therefore, and I think ‘rightly so’ as I don’t have to keep flipping between folders, the html file is along side the *.java file as in
uh, hibernate broke doing that :(. I forgot to paste you the original comment on why that was done(someone from gradle told me to do that to fix hibernate).
Unless I modified it wrong. Here is my file changes on my upgradeGradleTo4-8 branch
Notice the comment is
//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
soooo, somehow, the persistence.xml file is required to end up in the classes directory.
All works now, thanks!!! Actually, the reason they do this makes a bit of sense. They don’t want to scan 100 jars for entities (or 100 folders) so they scan ONLY the jar containing persistence.xml and ONLY the folder containing persistence.xml so that file had to live in the folder and in production, in the jar file.
if I can figure out how to scan all entities in a ‘certain’ package and subpackages to limit the scanning of jars. The real issue is 1000’s of projects are on JPA or hibernate so it’s not likely to change I would think and I am not sure how well supported the interface in that link is since it is not that standard.