[ 
https://issues.apache.org/jira/browse/MSHARED-1285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17792376#comment-17792376
 ] 

ASF GitHub Bot commented on MSHARED-1285:
-----------------------------------------

lalmeras opened a new pull request, #83:
URL: https://github.com/apache/maven-filtering/pull/83

   (this is a follow-up to #77)
   
   Current incremental build does not honor isUptodate(), so changed or removed 
target resources are not refreshed until sources are modified or a full build 
is performed.
   
   2 new testcases exhibits this issue (one for missing target resource, one 
for modified target resource). As stub BuildContext provides appropriate 
isUptodate results, build should refresh this resources.
   
   Current implementation prevents BuildContext implementors to trigger 
appropriate resource refresh by tweaking isUptodate implementation.
   
   See javadoc in BuildContext#newScanner javadoc that advices that incremental 
build may be performed with a full resource scanning and a isUptodate call to 
refresh only needed resources.
   
   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
    - [x] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MSHARED) filed 
          for the change (usually before you start working on it).  Trivial 
changes like typos do not 
          require a JIRA issue.  Your pull request should address just this 
issue, without 
          pulling in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line 
and body.
    - [x] Format the pull request title like `[MSHARED-XXX] - Fixes bug in 
ApproximateQuantiles`,
          where you replace `MSHARED-XXX` with the appropriate JIRA issue. Best 
practice
          is to use the JIRA issue title in the pull request title and in the 
first line of the 
          commit message.
    - [x] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
    - [x] Run `mvn clean verify -Prun-its` to make sure basic checks pass. A 
more thorough check will 
          be performed on your pull request automatically.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under 
   the [Apache License Version 2.0, January 
2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x] I hereby declare this contribution to be licensed under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [ ] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   




> DefaultMavenResourcesFiltering uses BuildContext in a way that fails sometimes
> ------------------------------------------------------------------------------
>
>                 Key: MSHARED-1285
>                 URL: https://issues.apache.org/jira/browse/MSHARED-1285
>             Project: Maven Shared Components
>          Issue Type: Bug
>            Reporter: Christoph Läubrich
>            Priority: Major
>
> The maven resources plugin uses 
> [https://github.com/apache/maven-filtering/blob/master/src/main/java/org/apache/maven/shared/filtering/DefaultMavenResourcesFiltering.java]
>  to copy resources, but that component has some subtile flaws reported here:
> [https://github.com/eclipse-m2e/m2e-core/discussions/1468]
> The problematic part is the usage of BuildContext#newScanner that already 
> mentions in the javadoc that passing ignoreDelta to neScanner might not 
> reveal all required items +*for copy-resources*+ form A -> B and instead 
> BuildContext#isUpTodate should be used.
> Just from a quick look I assume that part of code actually wants to use 
> something like this:
> {code:java}
> DirectoryScanner ds = new DirectoryScanner() {
>   @Override
>   protected boolean isSelected(String name, File file) {
>     if (file.isFile() && buildContext.isUptodate(getTargetFile(file), file)) 
> { 
>      return false;
>     }
>     return true;
>   }
> };
> ds.setBasedir(basedir); {code}
> That way all the code that currently checks for if output directory existed 
> before can also be removed what is another issue because it leads to a full 
> resources copy even if source+target are already even if a single class file 
> is changed while the idea seems more that if the output was not there it 
> should not try to be incremental!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to