[jira] [Updated] (MSHARED-1285) DefaultMavenResourcesFiltering uses BuildContext in a way that fails sometimes

2023-12-19 Thread Elliotte Rusty Harold (Jira)


 [ 
https://issues.apache.org/jira/browse/MSHARED-1285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Elliotte Rusty Harold updated MSHARED-1285:
---
Fix Version/s: maven-filtering-3.3.2

> 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
>  Components: maven-filtering
>Reporter: Christoph Läubrich
>Priority: Major
> Fix For: maven-filtering-3.3.2
>
>
> 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)


[jira] [Updated] (MSHARED-1285) DefaultMavenResourcesFiltering uses BuildContext in a way that fails sometimes

2023-12-07 Thread Sylwester Lachiewicz (Jira)


 [ 
https://issues.apache.org/jira/browse/MSHARED-1285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sylwester Lachiewicz updated MSHARED-1285:
--
Component/s: maven-filtering

> 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
>  Components: maven-filtering
>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)