jsonschema-generator icon indicating copy to clipboard operation
jsonschema-generator copied to clipboard

JSON Schema Maven plugin triggers Maven Project Builder endless

Open nimo23 opened this issue 5 months ago • 1 comments

Using this plugin has the follwing issue:

Eclipse repeats the Refresh->Rebuild cycle approx. every 10 seconds (by calling Maven Project Builder, triggered by the JSON Schema Maven plugin in the background), even if no files are changed or open—only the project itself is open.

JSON Schema Maven plugin should not poll a Refresh->Rebuild-cycle to the Eclipse project, instead the plugin should be called only at build time.

Reproducer:

eclipse-reproducer.zip

  1. Import the Maven project into Eclipse
  2. go to pom.xml->right click->Maven->Update Project
  3. go to Eclipse Preferences->General->Workspace-> enable Refresh using native hooks or polling
  4. go to Tab Progress
  5. wait approx. 5-15 seconds

then you will see that a refresh and a rebuild happens:

Image
  1. wait another 5-15 seconds, it happens again and again

nimo23 avatar Aug 05 '25 21:08 nimo23

As a hint, using

https://github.com/codehaus-plexus/plexus-build-api

for resources updates has many benefits:

  1. You can detect if a file has actually changed its input (e.g. one obviously only want to rerun the generation if the json schema changes)
  2. You can use https://github.com/codehaus-plexus/plexus-build-api/blob/6a689601dc601da745b47b869ccb80e3d183ed8d/src/main/java/org/codehaus/plexus/build/BuildContext.java#L71-L85 to write the results then it will prevent overwrite the results if nothing has changed.

laeubi avatar Aug 06 '25 06:08 laeubi