Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,12 @@

<properties>
<javaVersion>17</javaVersion>
<mavenVersion>4.0.0-rc-5</mavenVersion>
<mavenVersion>4.1.0-SNAPSHOT</mavenVersion>

<hamcrestVersion>3.0</hamcrestVersion>
<junitVersion>5.14.4</junitVersion>
<mockitoVersion>5.23.0</mockitoVersion>
<mavenPluginTestingVersion>4.0.0-beta-4</mavenPluginTestingVersion>
<plexusBuildApiVersion>0.0.7</plexusBuildApiVersion>
<plexusInterpolationVersion>1.29</plexusInterpolationVersion>
<slf4jVersion>2.0.13</slf4jVersion>

Expand Down Expand Up @@ -109,11 +108,6 @@
<artifactId>slf4j-api</artifactId>
<version>${slf4jVersion}</version>
</dependency>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-build-api</artifactId>
<version>${plexusBuildApiVersion}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,15 @@

import org.apache.maven.api.Project;
import org.apache.maven.api.Session;
import org.apache.maven.api.di.Inject;
import org.apache.maven.api.di.Named;
import org.apache.maven.api.di.Singleton;
import org.sonatype.plexus.build.incremental.BuildContext;

import static java.util.Objects.requireNonNull;

/**
* @author Olivier Lamy
*/
@Singleton
@Named
public class DefaultMavenFileFilter extends BaseFilter implements MavenFileFilter {
private final BuildContext buildContext;

@Inject
public DefaultMavenFileFilter(BuildContext buildContext) {
this.buildContext = requireNonNull(buildContext);
}

@Override
public void copyFile(
Expand Down Expand Up @@ -90,8 +80,7 @@ public void copyFile(Path from, Path to, boolean filtering, List<FilterWrapper>
getLogger().debug("copy {} to {}", from, to);
FilteringUtils.copyFile(from, to, encoding, new FilterWrapper[0], false);
}

buildContext.refresh(to.toFile());
// Output refresh is handled by the BuildContext output association in the mojo
} catch (IOException e) {
throw new MavenFilteringException(
(filtering ? "filtering " : "copying ") + from + " to " + to + " failed with "
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@
import org.codehaus.plexus.interpolation.AbstractValueSource;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.sonatype.plexus.build.incremental.BuildContext;

import static org.apache.maven.api.di.testing.MavenDIExtension.getBasedir;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.mock;

/**
* @author Olivier Lamy
Expand Down Expand Up @@ -95,7 +93,7 @@ void nullSafeDefaultFilterWrappers() throws Exception {

@Test
void multiFilterFileInheritance() throws Exception {
DefaultMavenFileFilter mavenFileFilter = new DefaultMavenFileFilter(mock(BuildContext.class));
DefaultMavenFileFilter mavenFileFilter = new DefaultMavenFileFilter();

File testDir = new File(getBasedir(), "src/test/units-files/MSHARED-177");

Expand Down
Loading
Loading