There is a build gradle file in the service part, and when i generete, the target dir is src/generated-sources/jaxb, under Services, but i want it to output in Persistence, what is the correct syntax for this ?
I have tried:
def jaxbTargetDir = file("Persistance/src/generated-sources/jaxb")
def jaxbTargetDir = file("*/Persistance")
- def jaxbTargetDir = file("**/Persistance")
def jaxbTargetDir = file("persistance/src/main/java/com/jysk/customermasterdata/persistence/model")
As a general rule, I don't recommend that you output generated files of any type to reside under your source directory tree. There are a number of reasons for this and, alas, I learned them the hard way.
I can't speak specifically for gradle, since I'm an infrequent user, but in Maven, the preferable destination for a source code generator mojo would be somewhere under the target directory where working (and final) files are built.
In Maven, the "clean" goal deletes target and all files and directories undeneath it. Further, you wouldn't normally put the target directory under source control, since it and everything in it should be regeneratable when doing a full build.
Some people, when well-known sources tell them that fire will burn them, don't put their hands in the fire.
Some people, being skeptical, will put their hands in the fire, get burned, and learn not to put their hands in the fire.
And some people, believing that they know better than well-known sources, will claim it's a lie, put their hands in the fire, and continue to scream it's a lie even as their hands burn down to charred stumps.