Commit f837e5d1 authored by Brian Long's avatar Brian Long
Browse files

Merge branch 'develop' into stable

parents 08498d42 78e34d85
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);