Registry / devops / maven-artifact

maven-artifact

JSON →
library0.3.5pypypi✓ verified 80d ago

A Python library for downloading and resolving Maven artifacts from Maven repositories (e.g., Maven Central). It provides a client for fetching POM files, artifacts, and their transitive dependencies, with caching support. Current version is 0.3.5, released periodically.

pip install maven-artifact
INSTALL
IMPORT
SIG · MAVEN-ARTIFACT
M
maven-artifact
devopspythonv0.3.5
Install
2.6s avg
Import
Disk
31MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 33MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.6s · import 0.000s · 33MB
31MB installed
● package 31MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Artifact
from maven_artifact import Artifact
from maven_artifact import MavenArtifact
Resolver
from maven_artifact import Resolver
Downloader
from maven_artifact import Downloader

Basic usage: instantiate a GAV, create MavenArtifact, download the JAR, and resolve dependencies.

from maven_artifact import MavenArtifact, GAV # Define a Maven artifact coordinate (group:artifact:version) gav = GAV('com.google.guava', 'guava', '31.0.1-jre') # Create a MavenArtifact instance with default Maven Central artifact = MavenArtifact(gav) # Download the artifact JAR file (returns path to local file) jar_path = artifact.download() print(f'Downloaded JAR to: {jar_path}') # Resolve transitive dependencies (returns list of GAV) deps = artifact.resolve_dependencies() for dep in deps: print(dep)
Debug
Known issues
gotchaThe GAV class expects all three components (group, artifact, version). Do not include colon separators — pass them as separate arguments.
fix
Use GAV('com.example', 'my-lib', '1.0.0') instead of GAV('com.example:my-lib:1.0.0')
affects: all
gotchaResolving dependencies can be slow for large projects with many transitive dependencies because it downloads and parses POM files. Consider using caching or limiting depth.
fix
Set cache_dir parameter in MavenArtifact: artifact = MavenArtifact(gav, cache_dir='/tmp/maven-cache')
affects: all
deprecatedThe method 'download_artifact' is deprecated in favor of 'download' since version 0.3.0.
fix
Use artifact.download() instead of artifact.download_artifact()
affects: >=0.3.0
Upgrade
Version history
0.3.5latest on PyPI · released Apr 23, 2025
Audit
Dependencies
requestsrequiredHTTP client for downloading artifacts and metadata from Maven repositories
lxmlrequiredXML parsing for POM files
Agent activity
14 hits · last 30 days
node
14
Resources
maven-artifact — pip install maven-artifact · libregistry