Adding jdo-query to maven based project causes compile error
After my misguided attempt to get some help on github I'm trying to do it correctly here (:
I'm in the midst of setting up a JavaFX project with Datanucleu + JDO + JDOQL. I've got the first two parts working without issue, I've got a connection to the database, I can read and write no issues. When I go to add the JDOQL step, along with the maven plugin the compile fails with the following error.
|
|
If it fails before generating JDOQLTypedQuery classes (i.e the preCompile step), then where is it failing??
maven --debug tells you way more than we see here. Posting the class is irrelevant if that class is never referenced in the error / exception. Try an earlier JDK? I use v8, what DN is developed on. Cut the case down to something simpler with just a basic JDO class, and no RDBMS, java fx etc, since your problem is compile, not runtime.
|
|
iansaucy@...
It seems to be failing when it goes to search for the type annotation classes to compile resources using them? But my experiance with this type of thing is very little so I am extremely lost as pinning down the errors. My lack of detailed understanding on the Java compile process does not help either. I took the example for JDO type queries from github and adapted it to use JDK 8(It was configured for 1.6 I think). With Java 8 the example was happy to compile and run, so that definitely shows it's a java version issue. https://gist.github.com/IanSaucy/76bd144139f14d50c61ec9dba4b328ce
P.s. I noticed a lot of the examples on GitHub utilize outdated Java version(pre 1.8). Is there a standard for updating those? I'd love to help get them up to date so they're more relevant.
|
|
Compare the "maven --debug clean compile" output between JDK 8 and JDK 13 for a basic case. The real difference between those is "Jigsaw" (java modules) addition to the JDK. I don't use it.
Similarly compare the above output between the basic case with datanucleus-jdo-query (annotation processor present) and without datanucleus-jdo-query (no annotation processors present). About updating ANY code in GitHub, you provide PULL REQUESTS to the relevant GitHub project, since this is open source. Thx
|
|
iansaucy@...
Thanks for giving me the direction to look in, I'll try see if I can remove the use of modules and maybe that will fix it.
I did just try something with Maven, I created a parent and child pom, the parent is the same minus the datanucleus-jdo-query dependency, the parent has a maven toolchain version of Java 13 while the child with only one dependency has a version of Java 8. This compiles, it actually does run without issues except for IntelliJ not being able to find the new compile classes(thus type enforcement does not work). This was more or less the way I went about doing this dual compile mode.
|
|