You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plexus Archiver is a high-level Java API for creating and extracting archives (ZIP, JAR, TAR, etc.). It provides a simple, unified interface for working with various archive formats, abstracting away the low-level details of archive manipulation.
15
+
16
+
## Comparison to Apache Commons Compress
17
+
18
+
Plexus Archiver builds on top of [Apache Commons Compress](https://commons.apache.org/proper/commons-compress/) (since version 2.5) and provides additional capabilities:
19
+
20
+
### Apache Commons Compress
21
+
22
+
Commons Compress is a low-level library that provides:
23
+
- Direct access to archive formats and compression algorithms
24
+
- Fine-grained control over archive entries and their attributes
25
+
- Support for a wide range of archive formats (ZIP, TAR, AR, CPIO, etc.)
26
+
- Streaming API for memory-efficient processing
27
+
28
+
### Plexus Archiver
29
+
30
+
Plexus Archiver is a higher-level abstraction layer that adds:
31
+
32
+
**Simplified API**: Easy-to-use builder-style interface for common archiving tasks without dealing with low-level stream handling.
33
+
34
+
**Advanced Features**:
35
+
- File selectors and filtering capabilities
36
+
- Automatic handling of file permissions and attributes
37
+
- Built-in support for directory scanning with includes/excludes patterns
38
+
- Reproducible builds support (configurable timestamps and ordering)
39
+
- Duplicate handling strategies
40
+
- File mappers for transforming entry names during archiving/unarchiving
41
+
- Protection against ZIP bombs (configurable output size limits)
42
+
43
+
**Build Tool Integration**: Designed for integration with build tools like Maven, with support for:
44
+
- Modular JAR creation (Java 9+ modules)
45
+
- Manifest generation and customization
46
+
- Archive finalizers for post-processing
47
+
48
+
**Dependency Injection Ready**: Includes JSR-330 annotations for easy integration with dependency injection frameworks.
49
+
50
+
### When to Use Which?
51
+
52
+
**Use Apache Commons Compress when:**
53
+
- You need fine-grained control over archive format details
54
+
- You're working with streaming data or large archives
55
+
- You need to support specialized or uncommon archive formats
56
+
- Memory efficiency is critical
57
+
58
+
**Use Plexus Archiver when:**
59
+
- You want a simple, declarative API for common archiving tasks
60
+
- You're building a Maven plugin or similar build tool
61
+
- You need reproducible builds with consistent archive ordering
62
+
- You want built-in file filtering and selection capabilities
63
+
- You need to create modular JARs or other specialized Java archives
0 commit comments