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