{"id":24356,"library":"pymaven-patch","title":"PyMaven Patch","description":"Python library for accessing and working with Maven artifacts using Maven coordinates and dependency resolution. Version 0.3.2 is the current release, maintained by nexB as a fork/advanced patch of the original pymaven library. Release cadence is low.","status":"active","version":"0.3.2","language":"python","source_language":"en","source_url":"https://github.com/nexB/pymaven","tags":["maven","java","dependency resolution","artifact","nexb"],"install":[{"cmd":"pip install pymaven-patch","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"HTTP requests to Maven repositories","package":"requests","optional":false},{"reason":"XML parsing for Maven POM files","package":"lxml","optional":false}],"imports":[{"note":"","wrong":null,"symbol":"mvn","correct":"from pymaven import mvn"},{"note":"","wrong":null,"symbol":"artifact","correct":"from pymaven import artifact"}],"quickstart":{"code":"from pymaven import artifact, mvn\n\n# Create an artifact coordinate\ncoord = artifact.Artifact(group_id='com.example', artifact_id='my-lib', version='1.0.0')\nprint(f\"Coordinate: {coord}\")\n\n# Resolve dependencies (requires internet access to Maven Central)\n# This will fetch the POM and resolve transitive dependencies\ntry:\n    deps = mvn.resolve(coord)\n    print(f\"Number of dependencies: {len(deps)}\")\nexcept Exception as e:\n    print(f\"Resolution failed: {e}\")\n","lang":"python","description":"Create a Maven artifact coordinate and resolve its dependencies."},"warnings":[{"fix":"Use 'pip install pymaven-patch' but import as 'pymaven'.","message":"The library is a fork ('pymaven-patch') with slight API differences from the original 'pymaven' package. Import 'pymaven', not 'pymaven_patch'.","severity":"gotcha","affected_versions":"all"},{"fix":"Wrap resolution in try/except and check the returned list length for sanity.","message":"Dependency resolution may fail silently or return incomplete results if the Maven repository is unavailable or the POM is malformed.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Use a separate HTTP client to fetch from custom repos and manually construct artifacts if needed.","message":"The 'mvn.resolve' function does not support custom repository URLs easily; it defaults to Maven Central only.","severity":"deprecated","affected_versions":"0.3.x"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Import the library as 'pymaven' (the internal package name).","cause":"Trying to import the package name as it appears on PyPI.","error":"ModuleNotFoundError: No module named 'pymaven_patch'"},{"fix":"Upgrade to latest version: pip install --upgrade pymaven-patch","cause":"Using an older version (pre-0.3.0) where the API was different, or only installing a subset of the package.","error":"AttributeError: module 'pymaven' has no attribute 'artifact'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}