Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spring-boot-configuration-processor doesn't work correctly for incremental builds #2313

Closed
kdvolder opened this issue Jan 8, 2015 · 1 comment

Comments

Projects
None yet
5 participants
@kdvolder
Copy link
Member

commented Jan 8, 2015

This is a problem when the processor is used from Eclipse. It manifests when the project has more than one type annoted with @ConfigurationProperties.

The processor rewrites the metadata file with a summary of information from all the types it processed. This produces the correct result on FULL builds but produces incomplete information on incremental builds (as the processor is only presented with some of the types based on what has changed in the workspace since the last build).

The result is that on incremental builds information from non-changed types is deleted from the metadata file.

@kdvolder

This comment has been minimized.

Copy link
Member Author

commented Jan 8, 2015

Sample project: https://github.com/kdvolder/scratches/tree/master/demo-live-metadata-incremental

The project contains Eclipse metadata so it should enable Eclipse JDT APT when imported into STS as a 'Existing Project'.

This is how to reproduce the issue.

  • import project as 'Existing Eclipse Project' (don't use maven import wizard, maven etc already configured in this project's metadata)
  • Run a 'Clean' build (menu "Project >> Clean")
  • Verify the contents the json metadata in target/classes/... it should be correct at this point and contain info about both 'foo' and 'bar' property sources.
  • Edit one of the property sources and save it (e.g comment some accessors to remove a property)
  • Verify the contents of json metadata again. If processor ran (it should have), then the data now contains updated information about the type you edited (good) but no more information about the other type (bad).

Note that in order to test changed snapshot of the processor you have to build a jar (i.e. run 'mvn install' on the processor project. This is because JDT APT can not consume a processor from a project directly, so unless you build the jar, you won't be running your changed version but whatever is in your local mvn repo).

Let me know if you need any help with this (I know JDT APT is finicky as hell).

@philwebb philwebb added this to the 1.2.2 milestone Jan 8, 2015

kdvolder added a commit to kdvolder/spring-boot that referenced this issue Jan 9, 2015

spring-projectsgh-2313: support incremental builds
spring-boot configuration metadata annotation processor
now merges changed data from incremental builds into
the already existing metadata file from previous build.

kdvolder added a commit to kdvolder/spring-boot that referenced this issue Jan 9, 2015

spring-projectsgh-2313: support incremental builds
spring-boot configuration metadata annotation processor
now merges changed data from incremental builds into
the already existing metadata file from previous build.

kdvolder added a commit to kdvolder/spring-boot that referenced this issue Jan 9, 2015

spring-projectsgh-2313: support incremental builds
spring-boot configuration metadata annotation processor
now merges changed data from incremental builds into
the already existing metadata file from previous build.

Cleanup: debug messages, comments etc.

kdvolder added a commit to kdvolder/spring-boot that referenced this issue Jan 9, 2015

spring-projectsgh-2313: support incremental builds
spring-boot configuration metadata annotation processor
now merges changed data from incremental builds into
the already existing metadata file from previous build.

Cleanup: debug messages, comments etc.

Cleanup

kdvolder added a commit to kdvolder/spring-boot that referenced this issue Jan 9, 2015

spring-projectsgh-2313: support incremental builds
spring-boot configuration metadata annotation processor
now merges changed data from incremental builds into
the already existing metadata file from previous build.

@dsyer dsyer added the in progress label Jan 9, 2015

kdvolder added a commit to kdvolder/spring-boot that referenced this issue Jan 9, 2015

spring-projectsgh-2313: support incremental builds
spring-boot configuration metadata annotation processor
now merges changed data from incremental builds into
the already existing metadata file from previous build.

kdvolder added a commit to kdvolder/spring-boot that referenced this issue Jan 9, 2015

kdvolder added a commit to kdvolder/spring-boot that referenced this issue Jan 9, 2015

kdvolder added a commit to kdvolder/spring-boot that referenced this issue Jan 9, 2015

kdvolder added a commit to kdvolder/spring-boot that referenced this issue Jan 9, 2015

spring-projectsgh-2313: regression tests for incremental builds
Cleanup: unused imports

Cleanup comments

Fix copyright header date

kdvolder added a commit to kdvolder/spring-boot that referenced this issue Jan 10, 2015

spring-projectsgh-2313: support incremental builds
spring-boot configuration metadata annotation processor
now merges changed data from incremental builds into
the already existing metadata file from previous build.

spring-projectsgh-2313: regression tests for incremental builds

wilkinsona added a commit that referenced this issue Jan 28, 2015

@wilkinsona wilkinsona removed the in progress label Jan 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.