{"id":15009110,"url":"https://github.com/concon121/node-maven-api","last_synced_at":"2026-03-08T17:39:09.000Z","repository":{"id":94143533,"uuid":"71697297","full_name":"concon121/node-maven-api","owner":"concon121","description":"Run maven commands via a node js api","archived":false,"fork":false,"pushed_at":"2017-04-16T10:07:34.000Z","size":40,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T12:03:14.194Z","etag":null,"topics":["apache-maven","javascript","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/node-maven-api","language":"JavaScript","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/concon121.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-10-23T10:59:29.000Z","updated_at":"2023-03-08T07:18:39.000Z","dependencies_parsed_at":"2023-04-07T12:35:09.340Z","dependency_job_id":null,"html_url":"https://github.com/concon121/node-maven-api","commit_stats":{"total_commits":39,"total_committers":2,"mean_commits":19.5,"dds":0.02564102564102566,"last_synced_commit":"5c10a6586b5101e03cf4801b69c4c72cdb1cc103"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concon121%2Fnode-maven-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concon121%2Fnode-maven-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concon121%2Fnode-maven-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concon121%2Fnode-maven-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/concon121","download_url":"https://codeload.github.com/concon121/node-maven-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248068140,"owners_count":21042432,"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":["apache-maven","javascript","nodejs"],"created_at":"2024-09-24T19:23:04.591Z","updated_at":"2026-03-08T17:39:06.970Z","avatar_url":"https://github.com/concon121.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-maven-api\n\n[![Build Status](https://api.travis-ci.org/concon121/node-maven-api.png)](https://api.travis-ci.org/concon121/node-maven-api)\n[![Dependency Status](https://david-dm.org/concon121/node-maven-api.svg)](https://david-dm.org/concon121/node-maven-api)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9b9b60c42152461a9ec4e29d84848b01)](https://www.codacy.com/app/connor-bray/node-maven-api?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=concon121/node-maven-api\u0026amp;utm_campaign=Badge_Grade)\n[![Code Climate](https://codeclimate.com/github/concon121/node-maven-api/badges/gpa.svg)](https://codeclimate.com/github/concon121/node-maven-api)\n[![Issue Count](https://codeclimate.com/github/concon121/node-maven-api/badges/issue_count.svg)](https://codeclimate.com/github/concon121/node-maven-api)\n[![Test Coverage](https://codeclimate.com/github/concon121/node-maven-api/badges/coverage.svg)](https://codeclimate.com/github/concon121/node-maven-api/coverage)\n[![Downloads](https://img.shields.io/npm/dt/node-maven-api.svg?maxAge=2592000)](https://www.npmjs.com/package/node-maven-api)\n\nRun maven commands via a Node JS API!\n\n## Usage\n\nTo create the maven handler, you need to call the create method providing the path to the POM file to be handled.\n\n```\nvar mvn = require('node-maven-api').create('/workspace/project/pom.xml');\n\nmvn.clean();\nmvn.install();\n```\n\n### Clean\n\nInvoke a maven clean on your project.\n\n```\nmvn.clean();\n```\n\n### Install\n\nInvoke a maven install on your project.\n\n```\nmvn.install();\n```\n\n### Test\n\nInvoke a maven test on your project.\n\n```\nmvn.test();\n```\n\n### Effective POM\n\nGet the effective pom for your project.  A promise will be returned which will be resolved to a javascript object which represents the xml effective pom.\n\n```\nvar promise = mvn.effectivePom();\n\npromise.then((result) =\u003e {\n    console.log('Effective POM is: ', result);\n});\n```\n\n### Custom Commands\n\nThe API provided by this module can not possibly cover every maven goal, there is far too many!  You can run any command you need with the execCommand function.\n\nFunction Parameters:\n\n1.  The event name for your command.\n2.  The command to execute.\n\n```\n// mvn clean install -f /path/to/my/pom.xml\nmvn.execCommand('my-custom-event', 'clean install');\n```\n\n### Events\n\nSometimes you might want to perform some action after you have executed a maven command.  Upon completion of a process, the api will trigger an event via the Node JS EventEmitter.\n\nFor the methods which this api exposes, the event names are as you may expect:\n\n*   clean\n*   clean-failed\n*   install\n*   install-failed\n*   test\n*   test-failed\n*   effective-pom\n*   effective-pom-failed\n\nFor custom commands you may provide your own event name, with the assumption that '-failed' will be automatically added in the event of a failure.\n\nYou may use the ```registerEvent``` function to bind a callback to an event.\n\nFunction Parameters:\n\n1.  The event name to bind a callback to.\n2.  The callback to bind to the event.\n\nExample:\n\n```\nmvn.registerEvent('my-custom-event', () =\u003e {\n  console.log('My Custom Maven command was successful! :)')\n});\n\nmvn.registerEvent('my-custom-event-failed', () =\u003e {\n  console.error('My Custom Maven command Failed... :(')\n});\n\nmvn.execCommand('my-custom-event', 'clean install');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcon121%2Fnode-maven-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconcon121%2Fnode-maven-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcon121%2Fnode-maven-api/lists"}