Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
4c1c4d412d | |||
fc5e0c6bd1 | |||
2a1523012b |
2
pom.xml
2
pom.xml
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<groupId>com.inteligr8</groupId>
|
<groupId>com.inteligr8</groupId>
|
||||||
<artifactId>ban-maven-plugin</artifactId>
|
<artifactId>ban-maven-plugin</artifactId>
|
||||||
<version>1.3.1</version>
|
<version>1.3.2</version>
|
||||||
<packaging>maven-plugin</packaging>
|
<packaging>maven-plugin</packaging>
|
||||||
|
|
||||||
<name>Ban Dependencies Maven Plugin</name>
|
<name>Ban Dependencies Maven Plugin</name>
|
||||||
|
@@ -219,14 +219,27 @@ public class PurgeRepoMojo extends AbstractMojo {
|
|||||||
|
|
||||||
Files.list(repoPath.resolve(groupPath)).forEach(new Consumer<Path>() {
|
Files.list(repoPath.resolve(groupPath)).forEach(new Consumer<Path>() {
|
||||||
@Override
|
@Override
|
||||||
public void accept(Path t) {
|
public void accept(Path fullArtifactPath) {
|
||||||
if (artifactPattern == null) {
|
if (artifactPattern == null) {
|
||||||
paths.add(repoPath.relativize(t));
|
// these may include sub-groups and not just artifacts
|
||||||
|
// which will lead to paths with artifacts as versions
|
||||||
|
// so we are looping through versions to see if it is indeed an artifact
|
||||||
|
try {
|
||||||
|
Files.list(fullArtifactPath).findFirst().ifPresent(new Consumer<Path>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Path fullVersionPath) {
|
||||||
|
if (Files.exists(fullVersionPath.resolve("_remote.repositories")))
|
||||||
|
paths.add(repoPath.relativize(fullArtifactPath));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (IOException ie) {
|
||||||
|
getLog().error(ie.getMessage(), ie);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Matcher matcher = artifactPattern.matcher(t.getFileName().toString());
|
Matcher matcher = artifactPattern.matcher(fullArtifactPath.getFileName().toString());
|
||||||
if (matcher.matches()) {
|
if (matcher.matches()) {
|
||||||
getLog().debug("The artifact directory '" + t.getFileName() + "' qualifies as included");
|
getLog().debug("The artifact directory '" + fullArtifactPath.getFileName() + "' qualifies as included");
|
||||||
paths.add(repoPath.relativize(t));
|
paths.add(repoPath.relativize(fullArtifactPath));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user