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