• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

steinarb / maven-repository-snapshot-pruner / #28

01 May 2024 06:36AM UTC coverage: 98.649% (+0.02%) from 98.63%
#28

push

steinarb
Use assertJ to assert the size of collections

73 of 74 relevant lines covered (98.65%)

0.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/src/main/java/no/priv/bang/maven/repository/snapshotpruner/MavenRepositorySnapshotPruner.java
1
package no.priv.bang.maven.repository.snapshotpruner;
2

3
import java.io.IOException;
4
import java.nio.file.Paths;
5

6
import org.jdom2.JDOMException;
7

8
public class MavenRepositorySnapshotPruner {
×
9

10
    public static void main(String[] args) throws IOException, JDOMException {
11
        var currentDirectory = Paths.get(System.getProperty("user.dir"));
1✔
12
        var repository = new MavenRepository(currentDirectory);
1✔
13
        System.out.println("Starting snapshot pruning in maven repository under \"" + currentDirectory + "\""); // NOSONAR This is feedback to the user from a command line program, so not using a log is quite OK
1✔
14
        var numberOfDeletedFiles = repository.pruneSnapshots();
1✔
15
        var numberOfDirectoriesWithSnapshotVersions = repository.findMavenMetadataFilesWithSnapshotVersion().size();
1✔
16
        System.out.println("Deleted " + numberOfDeletedFiles + " snapshot files in " + numberOfDirectoriesWithSnapshotVersions + " directories with snapshots"); // NOSONAR This is feedback to the user from a command line program, so not using a log is quite OK
1✔
17
    }
1✔
18

19
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc