mickaelistria commented on issue #274: [MNG-6716] Test and fix erroneous 
compileRoots
URL: https://github.com/apache/maven/pull/274#issuecomment-517465533
 
 
   The comment in the code tries to explain it, but probably not that well.
   I'll try again here and once we found the right words, or a better fix, I'll 
update the PR to makes things clearer.
   
   So the point is that there are 2 passes done to build a MavenProject. It was 
the case before the changes I made first. Before my change, the project built 
on 1st pass was build with "raw" values (no resolution as parent wasn't set) 
was discarded and a new project was then build on 2nd pass (with some resolved 
values) using the result of the 1st pass, but really creating new objects.
   That had some flows identified in other tickets, so I changed it so the 
project of 1st pass is reused in 2nd pass.
   However, the issue it caused for MNG-6716 is that for some "fields" of the 
MavenProject -like the testCompileSourceRoots-, the 2nd pass wasn't replacing 
the values of the 1st one but was instead appending its values to the result of 
1st pass. However, for most of the fields, the result of 1st pass are 
irrelevant because values are not resolved (read in this case path are not 
resolved to absolute ones) and shouldn't be set on the project because they're 
useless at that time.
   That's what the patch does: when the value seem incomplete, we don't set 
them and they will be set on the 2nd pass.
   
   Now I'm writing that, I think the fix is a bit weak. In general, we should 
instead identify what needs to be set on 1st pass and only set that, nothing 
more; and then on 2nd pass, set the other things.
   However, changing that seems like a huge and risky work compared to the 
current patch.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to