Skip to content

Commit

Permalink
Cut another dependency on commons-lang3
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed Nov 19, 2024
1 parent dd1b5b9 commit f8211c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ under the License.
<artifactId>org.eclipse.sisu.plexus</artifactId>
<scope>provided</scope>
</dependency>
<!-- MNG-6607: needs to be overriden for commons-compress otherwise it will appear earlier in the tree -->
<!-- MNG-6607: needs to be overridden for commons-compress otherwise it will appear earlier in the tree -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down Expand Up @@ -258,12 +258,6 @@ under the License.
<version>3.4.2</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.13.0</version>
</dependency>

<!-- dependencies to annotations -->
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.lang3.StringUtils;
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
import org.apache.maven.artifact.repository.ArtifactRepository;
Expand Down Expand Up @@ -130,7 +129,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
+ "e.g. -Dartifact=org.apache.maven.plugins:maven-downloader-plugin:1.0");
}
if (artifact != null) {
String[] tokens = StringUtils.split(artifact, ":");
String[] tokens = artifact.split(":");
if (tokens.length < 3 || tokens.length > 5) {
throw new MojoFailureException("Invalid artifact, you must specify "
+ "groupId:artifactId:version[:packaging[:classifier]] " + artifact);
Expand All @@ -157,7 +156,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {

if (remoteRepositories != null) {
// Use the same format as in the deploy plugin id::layout::url
String[] repos = StringUtils.split(remoteRepositories, ",");
String[] repos = remoteRepositories.split(",");
for (String repo : repos) {
repoList.add(parseRepository(repo, always));
}
Expand Down Expand Up @@ -214,7 +213,7 @@ ArtifactRepository parseRepository(String repo, ArtifactRepositoryPolicy policy)
}

id = matcher.group(1).trim();
if (!StringUtils.isEmpty(matcher.group(2))) {
if (matcher.group(2) != null && !matcher.group(2).isEmpty()) {
layout = getLayout(matcher.group(2).trim());
}
url = matcher.group(3).trim();
Expand Down

0 comments on commit f8211c1

Please sign in to comment.