Local Repository
쮽큌 Definition
The Local Repository is a folder on your computer where Apache Maven stores downloaded dependencies and built project files.
쮽킹 Key Points
- Located in the .m2/repository directory
- Stores dependencies after first download
- Used for offline builds
- Speeds up build process
쮽킹 Example Path
C:\Users\Username\.m2\repository
쮽킹 Advantages
- Faster access to dependencies
- No need to download repeatedly
- Supports offline development
쮽킹 Central Repository
쮽큌 Definition
The Central Repository is a remote online repository maintained by Maven that contains a large collection of open-source libraries.
쮽킹 Key Points
- Default repository used by Maven
- Accessible via internet
- Contains thousands of artifacts
- No configuration required
쮽킹 Features
- Public and widely used
- Automatically searched by Maven
- Continuously updated
쮽킹 How They Work Together
- Maven checks Local Repository first
- If dependency not found ᔒ checks Central Repository
- Downloads and stores it in Local Repository
쮽킹 Comparison Table
| Feature | Local Repository | Central Repository |
|---|---|---|
| Location | Local system | Online (remote) |
| Speed | Fast | Slower (internet needed) |
| Usage | Cache storage | Source of dependencies |
| Internet | Not required | Required |
᪅ Conclusion
- Local Repository improves speed and efficiency
- Central Repository provides access to required libraries
- Together, they ensure smooth and automated dependency management