# maven-deploy

> A simple Node.js module to create a war-/jar-package and install/deploy to a local/remote Maven repository

Latest version **1.5.0** (published 2016-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install maven-deploy
pnpm add maven-deploy
yarn add maven-deploy
bun add maven-deploy
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2016-03-31 |
| First published | 2014-04-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 20 |
| Author | FINN.no AS |
| Maintainers | gregersrygg, sslash, leftiefriele, finn-no |
| Keywords | maven, deploy |

## Links

- npm: https://www.npmjs.com/package/maven-deploy
- Repository: https://github.com/finn-no/maven-deploy
- Issues: https://github.com/finn-no/maven-deploy/issues
- npm.io page: https://npm.io/package/maven-deploy

## Dependencies (6)

- [jszip](https://npm.io/package/jszip.md) ^2.5.0
- [semver](https://npm.io/package/semver.md) ^5.1.0
- [fs-walk](https://npm.io/package/fs-walk.md) 0.0.1
- [util-extend](https://npm.io/package/util-extend.md) ^1.0.3
- [isbinaryfile](https://npm.io/package/isbinaryfile.md) ^3.0.0
- [define-options](https://npm.io/package/define-options.md) ^0.1.3

## Recent versions

- 1.5.0 (latest) — 2016-03-31
- 1.5.0-beta (beta) — 2016-03-10
- 1.4.1 — 2016-03-10
- 1.4.0 — 2016-02-27
- 1.3.2 — 2016-02-01
- 1.3.1 — 2016-02-01
- 1.3.0 — 2015-06-21
- 1.2.1 — 2015-06-03
- 1.2.0 — 2015-06-03
- 1.1.0 — 2015-02-12
- 0.0.3 — 2014-08-29
- 0.0.2 — 2014-04-08
- 0.0.1 — 2014-04-07

## README

# maven-deploy

[![Build Status](https://travis-ci.org/finn-no/maven-deploy.svg?branch=master)](https://travis-ci.org/finn-no/maven-deploy)
[![Coverage Status](https://coveralls.io/repos/finn-no/maven-deploy/badge.svg?branch=master)](https://coveralls.io/r/finn-no/maven-deploy?branch=master)
[![Dependencies status](https://david-dm.org/finn-no/maven-deploy.svg)](https://david-dm.org/finn-no/maven-deploy)

A simple Node.js module to create a war-/jar-package and install/deploy to a local/remote Maven repository. It uses
`mvn` to do the actual deployment, so you need maven installed locally.

Project name and version is extracted from package.json and used as artifactId and maven version. Supply an object
litteral with other Maven related config. Values from package.json can be used by adding curly-braces around the key.
Example `{finalName: "{name}-{version}"}`.

The package is created from the `{buildDir}/` folder. So you need to make sure that the files you want in the
package is put there before packaging. The default is `dist/`. The package file will be output in the same folder.

    var config = {
        "groupId"      : "com.example",    // required - the Maven group id.
        "artifactId"   : "{name}",         // the Maven artifact id.
        "buildDir"     : "dist",           // project build directory.
        "finalName"    : "{name}",         // the final name of the file created when the built project is packaged.
        "type"         : "war",            // type of package. "war" or "jar" supported.
        "fileEncoding" : "utf-8"           // file encoding when traversing the file system, default is UTF-8
        "repositories" : [                 // array of repositories, each with id and url to a Maven repository.
          {
            "id": "example-internal-snapshot",
            "url": "http://mavenproxy.example.com/example-internal-snapshot/"
          },
          {
            "id": "example-internal-release",
            "url": "http://mavenproxy.example.com/example-internal-release/"
          }
        ]
    };

It might be useful to store the config as a separate json-file, so you can re-use it in multiple files.

    var config = require('./maven-config.json');

## Package war/jar
It expects output from the project to be in dist/ directory. It zips the content and outputs it to
dist/{finalName}.{type}
Usage: `maven.package( [callback] )`

Example:

    var maven = require('maven-deploy');
    maven.config(config);
    maven.package();

## Install to local repository
Runs package first, then installs the package to your local Maven repository.
Usage: `maven.install( [callback] )`

Example:

    var maven = require('maven-deploy');
    maven.config(config);
    maven.install();

## Deploy
Runs package first, then deploys the package to the specified Maven repository.
Usage: `maven.deploy( repositoryId, [snapshot = false], [callback])`

### Example: deploy to snapshot repo
    var maven = require('maven-deploy');
    maven.config(config);
    maven.deploy('example-internal-snapshot', true);

### Example: deploy to release repo

    var maven = require('maven-deploy');
    maven.config(config);
    maven.deploy('example-internal-release');

### Example: deploy existing archive file

    var maven = require('maven-deploy');
    maven.config(config);
    maven.deploy('example-internal-release', 'file.jar');

## Contributing

We would love your contribution, please consult the [contributing](CONTRIBUTE.md) page for how to make your contributions land into the project as easily as possible.

---
_Source: https://npm.io/package/maven-deploy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
