Skip to content

Commit

Permalink
[MSHARED-1078] Update parent POM and drop maven-shared-utils (#27)
Browse files Browse the repository at this point in the history
Update parent POM, project to Java8 and get rid of bad
dependency maven-shared-util.
  • Loading branch information
cstamas authored Jun 8, 2022
1 parent 6ba230d commit 72981e4
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 53 deletions.
54 changes: 9 additions & 45 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>maven-shared-components</artifactId>
<groupId>org.apache.maven.shared</groupId>
<version>34</version>
<version>36</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -55,49 +55,19 @@
</distributionManagement>

<properties>
<maven.version>3.1.1</maven.version>
<javaVersion>7</javaVersion>
<maven.version>3.2.5</maven.version>
<javaVersion>8</javaVersion>
<resolver.version>1.6.3</resolver.version>
<surefire.version>2.22.2</surefire.version>
<checkstyle.violation.ignore>MethodLength</checkstyle.violation.ignore>
<project.build.outputTimestamp>2021-02-14T00:03:59Z</project.build.outputTimestamp>
</properties>

<build>
<pluginManagement>
<plugins>
<!-- remove with parent-pom update -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.9.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.1.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
<version>1.7.36</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -127,7 +97,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
Expand All @@ -142,12 +112,6 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.3.3</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -157,13 +121,13 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.28.2</version>
<version>4.5.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.1.0</version>
<version>3.3.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -175,13 +139,13 @@
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>1.27</version>
<version>1.35</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.27</version>
<version>1.35</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import java.util.Set;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.shared.utils.StringUtils;

import static org.apache.maven.shared.artifact.filter.internal.Utils.isNotEmpty;

/**
* This is the common base class of ClassifierFilter and TypeFilter
Expand Down Expand Up @@ -158,9 +159,9 @@ private Set<Artifact> filterExcludes( Set<Artifact> artifacts, List<String> theE
*/
public void setExcludes( String excludeString )
{
if ( StringUtils.isNotEmpty( excludeString ) )
if ( isNotEmpty( excludeString ) )
{
this.excludes = Arrays.asList( StringUtils.split( excludeString, "," ) );
this.excludes = Arrays.asList( excludeString.split( "," ) );
}
}

Expand All @@ -171,9 +172,9 @@ public void setExcludes( String excludeString )
*/
public void setIncludes( String includeString )
{
if ( StringUtils.isNotEmpty( includeString ) )
if ( isNotEmpty( includeString ) )
{
this.includes = Arrays.asList( StringUtils.split( includeString, "," ) );
this.includes = Arrays.asList( includeString.split( "," ) );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
import org.apache.maven.shared.utils.StringUtils;

import static org.apache.maven.shared.artifact.filter.internal.Utils.isNotEmpty;

/**
* <p>ScopeFilter class.</p>
Expand Down Expand Up @@ -63,7 +64,7 @@ public Set<Artifact> filter( Set<Artifact> artifacts )
{
Set<Artifact> results = artifacts;

if ( StringUtils.isNotEmpty( includeScope ) )
if ( isNotEmpty( includeScope ) )
{
if ( !Artifact.SCOPE_COMPILE.equals( includeScope ) && !Artifact.SCOPE_TEST.equals( includeScope )
&& !Artifact.SCOPE_PROVIDED.equals( includeScope ) && !Artifact.SCOPE_RUNTIME.equals( includeScope )
Expand Down Expand Up @@ -91,7 +92,7 @@ public Set<Artifact> filter( Set<Artifact> artifacts )
}
}
}
else if ( StringUtils.isNotEmpty( excludeScope ) )
else if ( isNotEmpty( excludeScope ) )
{
if ( !Artifact.SCOPE_COMPILE.equals( excludeScope ) && !Artifact.SCOPE_TEST.equals( excludeScope )
&& !Artifact.SCOPE_PROVIDED.equals( excludeScope ) && !Artifact.SCOPE_RUNTIME.equals( excludeScope )
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package org.apache.maven.shared.artifact.filter.internal;

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/**
* Utilities.
*
* @since TBD
*/
public final class Utils
{
private Utils()
{
}

/**
* <p>Checks if a String is non <code>null</code> and is
* not empty (<code>length &gt; 0</code>).</p>
*
* @param str the String to check
* @return true if the String is non-null, and not length zero
*/
public static boolean isNotEmpty( String str )
{
return ( ( str != null ) && ( str.length() > 0 ) );
}
}

0 comments on commit 72981e4

Please sign in to comment.