Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hgschmie/maven-loader
simple artifact downloader for maven central
https://github.com/hgschmie/maven-loader
downloader java maven
Last synced: about 1 month ago
JSON representation
simple artifact downloader for maven central
- Host: GitHub
- URL: https://github.com/hgschmie/maven-loader
- Owner: hgschmie
- License: apache-2.0
- Created: 2021-11-28T05:48:28.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-13T04:28:02.000Z (4 months ago)
- Last Synced: 2024-09-13T15:35:31.153Z (4 months ago)
- Topics: downloader, java, maven
- Language: Java
- Homepage:
- Size: 210 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# maven-loader - a dead simple artifact loader for Maven repository system
This is a repackaged version of a bunch of Apache Maven dependencies, intended to offer a quick way to locate and download artifacts from the Maven central repository. It resolves all maven internal dependencies consistently and hides the existing library dependency problems from code that wants to download artifacts from the Maven repository system.
As most things Maven are simply a mess (and even internally inconsistent), this bundles up
- The Apache Maven resolver to locate artifacts
- File and HTTP transports
- Maven settings to load and interpret the local settings fileAll the functionality is in the `MavenArtifactLoader` class. See the javadoc for the class for more details.
## Find artifacts
Do a partial match:
``` java
MavenArtifactLoader loader = new MavenArtifactLoader();List results = loader.builder(GROUP_ID, ARTIFACT_ID)
.includeSnapshots(false)
.partialMatch("2.1")
.findAll();
```Do an exact match:
``` java
MavenArtifactLoader loader = new MavenArtifactLoader();Optional result = loader.builder(GROUP_ID, ARTIFACT_ID)
.includeSnapshots(false)
.exactMatch("2.1.1")
.findBestMatch();
```Find best semver match for a major version:
``` java
MavenArtifactLoader loader = new MavenArtifactLoader();Optional result = loader.builder(GROUP_ID, ARTIFACT_ID)
.includeSnapshots(false)
.semVerMajor(2)
.findBestMatch();
```Find all matches for semver major and minor:
``` java
MavenArtifactLoader loader = new MavenArtifactLoader();List results = loader.builder(GROUP_ID, ARTIFACT_ID)
.includeSnapshots(false)
.semVerMinor(2, 1)
.findAll();
```## Load an artifact
``` java
MavenArtifactLoader loader = new MavenArtifactLoader();
File artifactFile = loader.getArtifactFile(GROUP_ID, ARTIFACT_ID, "2.1.1");
```----
(C) 2021-2023 Henning P. Schmiedehausen
Licensed under the Apache Software License V2.0