-
Notifications
You must be signed in to change notification settings - Fork 19
Inconsistent results in incremental vs full build #67
Comments
In the case of JDT APT, the bug would most likely be upstream (in JDT). Can you de-mavenize the project, make it a pure Eclipse project and reproduce the issue? If yes, then a bug should be opened upstream. |
Yes, it is also broken without Maven. Some searching uncovered Eclipse bug 447546, which has been open for 4 years with no progress. What about the Experimental delegate mode? I assume that is still a bug in m2e-apt. |
maven_execution mode only works for the maven-processor-plugin (I reckon it's not very clear from the readme)
|
That does not work for me. I end up with an empty target/generated-sources/apt. In tinkering with this, I noticed that changing the configuration away from JDT APT doesn't seem to update the project settings in Java Compiler -> Annotation Processing, so at first I was still seeing the result of that doing its thing. Possibly you may be seeing the same thing. Try deleting the project from the workspace, clearing out all of the Eclipse metadata, then re-importing the project. |
Well actually, the problem is, maven_execution mode doesn't deactivate JDT APT settings automatically, and that's probably a bug. The problem is, when jdt_apt is disabled, we don't want to disable APT if it was set manually by the user. Anyways. Importing the project from a clean slate works for me, with |
mmm actually switching |
I still have not gotten it to work. What version of Eclipse are you testing with? I'm on Photon Release (4.8.0). |
That shouldn't matter, but I'm on 2018-09 (released today) with m2e-apt 1.5.0.201805160042 (installed from http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt/) |
Tried 2018-09. Still doesn't work. The files get generated if I execute a Maven build manually, but that's it. A full build (Project -> Clean) does nothing. An incremental build triggered by changing a file also does nothing. To be clear, "does nothing" means it does not remove files that were previously generated. Are you sure the files you're seeing are actually getting regenerated and are not just leftovers from an earlier build? |
See https://www.youtube.com/watch?v=XgxpjGkNqS4 Eclipse runs with JDK 1.8, if it makes a difference |
I don't expect deleting files will delete generated files in maven_execution mode. We simple ask java to run the annotation processor, without cleaning anything |
Finally figured this out after I happened to open the Error Log and noticed an error complaining that
Basically, delegate mode only works if the JRE that is executing Eclipse is a JDK. I don't suppose there's some way to get delegate mode to use the JDK that Eclipse is configured to build with instead? Trying to get tools.jar on the classpath via a system-scoped Maven dependency didn't help either. |
After digging through the maven-processor-plugin code, it looks like it should be possible to tell it where to find javac by using maven-toolchains-plugin. Unfortunately that doesn't work either because m2e isn't configuring Maven correctly, so maven-toolchains-plugin can't find toolchains.xml. See Eclipse bugs 521280 and 527398. |
Ok, I'm stretched pretty thin already so I don't think I'll be able to fix the m2e part any time soon. If you want to provide a quality patch to fix this, then please do :-) |
m2e-apt's code is now included in https://github.com/eclipse-m2e/m2e-core , please consider reporting issue to https://github.com/eclipse-m2e/m2e-core/issues if it's still relevant. |
I have a project that uses QueryDSL. I'm trying to use QueryDelegate to extend the generated code for OffsetDateTime. m2e-apt produces different results depending on whether Eclipse is executing a full build or an incremental build. A reproducer is attached below.
On a full build (e.g. using Project -> Clean), I get the expected result: QSomeEntity has a field odt with type QOffsetDateTime. But on an incremental build, the field has type DateTimePath, as if my QueryDelegate doesn't exist.
This is true for both JDT APT and Experimental delegate processing modes.
m2e-apt.zip
The text was updated successfully, but these errors were encountered: