{"id":16678834,"url":"https://github.com/creekorful/mvnparser","last_synced_at":"2025-03-21T18:32:15.326Z","repository":{"id":41350186,"uuid":"213632679","full_name":"creekorful/mvnparser","owner":"creekorful","description":"Go parser for maven Project Object Model (POM) file","archived":false,"fork":false,"pushed_at":"2022-09-03T20:39:44.000Z","size":19,"stargazers_count":23,"open_issues_count":1,"forks_count":17,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T03:43:56.757Z","etag":null,"topics":["go-module","golang","golang-library","maven-pom","parser","pom"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/creekorful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-08T12:12:38.000Z","updated_at":"2024-04-12T02:46:18.000Z","dependencies_parsed_at":"2023-01-17T19:47:34.778Z","dependency_job_id":null,"html_url":"https://github.com/creekorful/mvnparser","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creekorful%2Fmvnparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creekorful%2Fmvnparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creekorful%2Fmvnparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creekorful%2Fmvnparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creekorful","download_url":"https://codeload.github.com/creekorful/mvnparser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244848851,"owners_count":20520599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go-module","golang","golang-library","maven-pom","parser","pom"],"created_at":"2024-10-12T13:31:37.378Z","updated_at":"2025-03-21T18:32:14.913Z","avatar_url":"https://github.com/creekorful.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mvnparser\n\n[![Continuous Integration](https://github.com/creekorful/mvnparser/actions/workflows/ci.yml/badge.svg)](https://github.com/creekorful/mvnparser/actions/workflows/ci.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/creekorful/mvnparser)](https://goreportcard.com/report/github.com/creekorful/mvnparser)\n[![Maintainability](https://api.codeclimate.com/v1/badges/ac9fd99e18e6ef2661e3/maintainability)](https://codeclimate.com/github/creekorful/mvnparser/maintainability)\n\nGo parser for maven Project Object Model (POM) file\n\n# how to use it ?\n\nLet's take the following POM file\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n    \u003cproject xmlns=\"http://maven.apache.org/POM/4.0.0\" \n\t         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n\t         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\"\u003e\n        \u003cmodelVersion\u003e4.0.0\u003c/modelVersion\u003e\n    \n        \u003cgroupId\u003ecom.example\u003c/groupId\u003e\n        \u003cartifactId\u003emy-app\u003c/artifactId\u003e\n        \u003cversion\u003e1.0.0-SNAPSHOT\u003c/version\u003e\n    \n        \u003cdependencies\u003e\n            \u003cdependency\u003e\n                \u003cgroupId\u003ejunit\u003c/groupId\u003e\n                \u003cartifactId\u003ejunit\u003c/artifactId\u003e\n                \u003cscope\u003etest\u003c/scope\u003e\n            \u003c/dependency\u003e\n            \u003cdependency\u003e\n                \u003cgroupId\u003ejavax.enterprise\u003c/groupId\u003e\n                \u003cartifactId\u003ecdi-api\u003c/artifactId\u003e\n                \u003cscope\u003eprovided\u003c/scope\u003e\n            \u003c/dependency\u003e\n        \u003c/dependencies\u003e\n    \n        \u003cbuild\u003e\n            \u003cplugins\u003e\n                \u003cplugin\u003e\n                    \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n                    \u003cartifactId\u003emaven-compiler-plugin\u003c/artifactId\u003e\n                    \u003cversion\u003e3.8.0\u003c/version\u003e\n                    \u003cconfiguration\u003e\n                        \u003crelease\u003e11\u003c/release\u003e\n                    \u003c/configuration\u003e\n                \u003c/plugin\u003e\n            \u003c/plugins\u003e\n        \u003c/build\u003e\n    \u003c/project\u003e\n```\n\nYou can read the pom file using \n\n```go\npackage main\n\nimport (\n\t\"github.com/creekorful/mvnparser\"\n\t\"encoding/xml\"\n\t\"log\"\n)\n\nfunc main() { \n    // filled with previously declared xml \n    pomStr := \"...\"\n\t\n    // Load project from string\n    var project mvnparser.MavenProject\n    if err := xml.Unmarshal([]byte(pomStr), \u0026project); err != nil {\n        log.Fatalf(\"unable to unmarshal pom file. Reason: %s\", err)\n    }\n    \n    log.Print(project.GroupId) // -\u003e com.example\n    log.Print(project.ArtifactId) // -\u003e my-app\n    log.Print(project.Version) // -\u003e 1.0.0-SNAPSHOT\n    \n    // iterate over dependencies\n    for _, dep := range project.Dependencies {\n    \tlog.Print(dep.GroupId)\n    \tlog.Print(dep.ArtifactId)\n    \tlog.Print(dep.Version)\n    \t\n    \t// ...\n    }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreekorful%2Fmvnparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreekorful%2Fmvnparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreekorful%2Fmvnparser/lists"}