4 Commits

Author SHA1 Message Date
0edac4fc37 v1.3.5 pom 2023-08-21 15:33:12 -04:00
f837e5d1c0 Merge branch 'develop' into stable 2023-08-21 15:32:38 -04:00
78e34d85e9 added logging 2023-08-21 15:32:31 -04:00
6e2a701c0d fixed artifact/version detection 2023-08-21 15:30:51 -04:00
2 changed files with 5 additions and 2 deletions

View File

@@ -7,7 +7,7 @@
<groupId>com.inteligr8</groupId>
<artifactId>ban-maven-plugin</artifactId>
<version>1.3.4</version>
<version>1.3.5</version>
<packaging>maven-plugin</packaging>
<name>Ban Dependencies Maven Plugin</name>

View File

@@ -282,7 +282,7 @@ public class PurgeRepoMojo extends AbstractMojo {
private class DeleteNonMetadataVisitor implements FileVisitor<Path> {
private final Pattern versionPathPattern = Pattern.compile("/([^/]+)/([^/]+)$");
private final Pattern versionPathPattern = Pattern.compile("/([^/]+)/([^/]+)/[^/]+$");
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
@@ -306,9 +306,12 @@ public class PurgeRepoMojo extends AbstractMojo {
String version = matcher.group(2);
String includeName = artifactId + "-" + version;
String excludeName = artifactId + "-" + version + ".pom";
getLog().debug("artifact-version: " + includeName);
if (file.getFileName().toString().startsWith(includeName) &&
!file.getFileName().toString().startsWith(excludeName)) {
try {
getLog().info("Deleting artifact: " + file);
Files.delete(file);
} catch (IOException ie) {
getLog().debug(ie);