| Summary: | Build participants receive stale MavenProject(Facade) during incremental build after POM change | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Benjamin Bentmann <bentmann> |
| Component: | m2e | Assignee: | Paul Tatavu <vladt> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | fbricon, vladt |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
This issue is bugging me while I'm trying to trigger web resource filtering when the pom.xml changes. Project property values used during filtering correspond to the previous state of the pom. Fixed indirectly by the fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=340892 (In reply to comment #2) > Fixed indirectly by the fix for > https://bugs.eclipse.org/bugs/show_bug.cgi?id=340892 It appears since this change, build participants now longer observe a resource change delta in which the pom file is indicated as modified. Is this intentional/desired? If so, what is the recommended approach for build participants to tell whether the POM has been edited since the last build? The change was not intentional. Fixed: http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=cc33e91bb09b843f922618db8232af8379e0c9e8 |
During the incremental build that follows a change to the POM, the m2e build participants suffer from a stale MavenProject instance being passed to them which does not reflect the POM change which has just been made. One user-visible effect of this is are error markers which basically reflect the previous POM contents but not the current. At least one piece of the error is the following code from MavenBuilder: if(projectFacade.isStale()) { MavenUpdateRequest updateRequest = new MavenUpdateRequest(project, mavenConfiguration.isOffline() /*offline*/, false /*updateSnapshots*/); projectManager.refresh(updateRequest, monitor); IMavenProjectFacade facade = projectManager.create(project, monitor); if(facade == null) { // error marker should have been created return null; } } While this code properly detects the isStale() state, the newly re-recreated facade object is not used, i.e. doesn't replace the stale projectFacade instance.