Skip to content

Commit

Permalink
[MSHARED-1080] Parent POM 36, Java8, drop legacy.
Browse files Browse the repository at this point in the history
  • Loading branch information
cstamas committed Jun 8, 2022
1 parent 36012dd commit dedca2a
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 124 deletions.
59 changes: 28 additions & 31 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<parent>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-components</artifactId>
<version>34</version>
<version>36</version>
<relativePath/>
</parent>

<artifactId>maven-filtering</artifactId>
Expand Down Expand Up @@ -55,7 +56,8 @@

<properties>
<mavenVersion>3.2.5</mavenVersion>
<javaVersion>7</javaVersion>
<slf4jVersion>1.7.36</slf4jVersion>
<javaVersion>8</javaVersion>
<project.build.outputTimestamp>2020-08-05T15:18:01Z</project.build.outputTimestamp>
</properties>

Expand All @@ -66,20 +68,33 @@
</contributors>

<dependencies>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4jVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.sisu</groupId>
Expand All @@ -90,15 +105,10 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.3.4</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.3.0</version><!-- Java 7 -->
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Expand All @@ -108,25 +118,13 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version><!-- Java 7 -->
</dependency>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-build-api</artifactId>
<version>0.0.7</version>
</dependency>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-build-api</artifactId>
<version>0.0.7</version>
<scope>test</scope>
<classifier>tests</classifier>
<version>2.11.0</version>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.28.2</version><!-- Java 7 -->
<version>4.5.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -141,21 +139,20 @@
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4jVersion}</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
<executions>
<execution>
<goals>
<goal>generate-metadata</goal>
</goals>
</execution>
</executions>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.apache.maven.execution.MavenSession;
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Settings;
import org.apache.maven.shared.utils.StringUtils;
import org.apache.maven.shared.utils.io.FileUtils;
import org.codehaus.plexus.interpolation.InterpolationPostProcessor;
import org.codehaus.plexus.interpolation.Interpolator;
Expand Down Expand Up @@ -195,7 +194,7 @@ void loadProperties( Properties filterProperties, File basedir, List<String> pro

for ( String filterFile : propertiesFilePaths )
{
if ( StringUtils.isEmpty( filterFile ) )
if ( filterFile == null || filterFile.trim().isEmpty() )
{
// skip empty file name
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
* under the License.
*/

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;

import java.io.File;
import java.io.IOException;
import java.util.List;
Expand All @@ -27,24 +31,25 @@
import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.utils.io.FileUtils;
import org.apache.maven.shared.utils.io.FileUtils.FilterWrapper;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.sonatype.plexus.build.incremental.BuildContext;

import static java.util.Objects.requireNonNull;

/**
* @author Olivier Lamy
*/
@Component( role = org.apache.maven.shared.filtering.MavenFileFilter.class, hint = "default" )
@Singleton
@Named
public class DefaultMavenFileFilter
extends BaseFilter
implements MavenFileFilter
{
private final MavenReaderFilter readerFilter;

@Requirement
private MavenReaderFilter readerFilter;

@Requirement
private BuildContext buildContext;
@Inject
public DefaultMavenFileFilter( MavenReaderFilter readerFilter )
{
this.readerFilter = requireNonNull( readerFilter );
}

@Override
public void copyFile( File from, File to, boolean filtering, MavenProject mavenProject, List<String> filters,
Expand Down Expand Up @@ -105,8 +110,6 @@ public void copyFile( File from, File to, boolean filtering, List<FileUtils.Filt
}
FileUtils.copyFile( from, to, encoding, new FileUtils.FilterWrapper[0], overwrite );
}

buildContext.refresh( to );
}
catch ( IOException e )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,22 @@
* under the License.
*/

import javax.inject.Named;
import javax.inject.Singleton;

import java.io.Reader;
import java.util.Collections;
import java.util.List;

import org.apache.maven.execution.MavenSession;
import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.utils.io.FileUtils.FilterWrapper;
import org.codehaus.plexus.component.annotations.Component;

/**
* @author Kristian Rosenvold
*/
@Component( role = org.apache.maven.shared.filtering.MavenReaderFilter.class, hint = "default" )
@Singleton
@Named
public class DefaultMavenReaderFilter
extends BaseFilter
implements MavenReaderFilter
Expand Down
Loading

0 comments on commit dedca2a

Please sign in to comment.