{"id":21344126,"url":"https://github.com/codeclou/java-xml-grepper","last_synced_at":"2025-03-16T03:20:51.889Z","repository":{"id":83101108,"uuid":"129385437","full_name":"codeclou/java-xml-grepper","owner":"codeclou","description":"You want to get a value from your xml file? Then this is for you","archived":false,"fork":false,"pushed_at":"2019-07-23T08:47:37.000Z","size":116,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T16:09:24.911Z","etag":null,"topics":["grep","java","xpath"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"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/codeclou.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-13T10:12:43.000Z","updated_at":"2019-07-23T08:47:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"442ecd29-bd0a-4881-a61d-bd89cdecc41c","html_url":"https://github.com/codeclou/java-xml-grepper","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclou%2Fjava-xml-grepper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclou%2Fjava-xml-grepper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclou%2Fjava-xml-grepper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclou%2Fjava-xml-grepper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeclou","download_url":"https://codeload.github.com/codeclou/java-xml-grepper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243819235,"owners_count":20352846,"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":["grep","java","xpath"],"created_at":"2024-11-22T01:17:18.383Z","updated_at":"2025-03-16T03:20:51.875Z","avatar_url":"https://github.com/codeclou.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java XML Grepper\n\n\u003e You want to get a value from your xml file using XPath? Then this is for you. Easily grep the version from your POM.\n\n[![](https://codeclou.github.io/java-xml-grepper/img/github-product-logo-java-grepper.png)](https://github.com/codeclou/java-xml-grepper)\n\n----\n\u0026nbsp;\n\n### Is this for me?\n\nIf you want to grep e.g. the version of a `pom.xml` file to commandline then this is for you.\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cproject xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\"\u003e\n  \u003cmodelVersion\u003e4.0.0\u003c/modelVersion\u003e\n  \u003cgroupId\u003eio.codeclou\u003c/groupId\u003e\n  \u003cartifactId\u003ejava-xml-grepper\u003c/artifactId\u003e\n  \u003cversion\u003e1.4.5\u003c/version\u003e\n\u003c/project\u003e\n```\n\n\n----\n\u0026nbsp;\n\n### Usage\n\nWith current folder containing a `pom.xml` file and you want to print out the version on commandline.\nThe `-x` parameter accepts XPath expressions that can be cast to String.\n\n```\n# INSTALL\ncurl -L -o java-xml-grepper.jar \\\n     https://github.com/codeclou/java-xml-grepper/releases/download/1.0.0/java-xml-grepper.jar\n\n# RUN\njava -jar java-xml-grepper.jar \\\n     -f pom.xml \\\n     -x /project/version\n     \n# PRINTS (example)\n1.0.1\n```\n\nIf something happens like parsing errors, file not found a.s.o the **exit code will be 1**.\nOtherwise the exit code will be 0 and it will only print the grepped output.\n\n-----\n\u0026nbsp;\n\n### Demo\n\n```\ngit clone https://github.com/codeclou/java-xml-grepper.git src\ncd src\n\ncurl -L -o java-xml-grepper.jar \\\n     https://github.com/codeclou/java-xml-grepper/releases/download/1.0.0/java-xml-grepper.jar\n\njava -jar java-xml-grepper.jar \\\n     -f pom.xml \\\n     -x /project/version\n\n# Should print the version\n```\n\n\n----\n\u0026nbsp;\n\n### License\n\n[MIT](https://github.com/codeclou/java-xml-grepper/blob/master/LICENSE) © [Bernhard Grünewaldt](https://github.com/clouless)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeclou%2Fjava-xml-grepper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeclou%2Fjava-xml-grepper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeclou%2Fjava-xml-grepper/lists"}