# node-tomcat-manager

> nodejs tomcat manager

Latest version **3.1.0** (published 2014-04-08) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install node-tomcat-manager
pnpm add node-tomcat-manager
yarn add node-tomcat-manager
bun add node-tomcat-manager
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2014-04-08 |
| First published | 2013-09-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | tborychowski |

## Links

- npm: https://www.npmjs.com/package/node-tomcat-manager
- Repository: https://github.com/tborychowski/node-tomcat-manager
- Issues: https://github.com/tborychowski/node-tomcat-manager/issues
- npm.io page: https://npm.io/package/node-tomcat-manager

## Dependencies (2)

- [node-msg](https://npm.io/package/node-msg.md) latest
- [arg-parser](https://npm.io/package/arg-parser.md) latest

## Recent versions

- 3.1.0 (latest) — 2014-04-08
- 2.1.0 — 2013-11-07
- 2.0.1 — 2013-09-12

## README

node-tomcat-manager
===================
nodejs-based simple command-line tomcat manager


Install
-------

```bash
npm install node-tomcat-manager
```


Usage
-----
Make sure you have a user "tomcat" with password "tomcat" and manager roles assigned, in your `tomcat-users.xml` file, e.g.:

```xml
<tomcat-users>
	<role rolename="manager-gui"/>
	<role rolename="manager-script"/>
	<user username="tomcat" password="tomcat" roles="manager-gui, manager-script"/>
</tomcat-users>
```

If you have different username or password, please change it in the `tomcat.json` [config](#config).

**Usage:**

```bash
tomcat [options] <func> <app>

<func>			One of the below:
                   list         show applications
                   stop         stop an application
                   start        start an application
                   restart      restart an application
                   undeploy     undeploy an application
                   kill         stop -> undeploy

                   deploy       deploy app to the server
                   clean        clean-up the build folders
                   delete       remove the app folder from the server
                   redeploy     stop -> undeploy -> clean -> deploy

<app>			Application name

-V, --verbose   show all output (e.g. "deploy" or "clean" from config)
-a, --all       also show ignored applications (like /docs, /examples, /manager)
-h, --help      display help & usage
-v, --version   display cli name & version
```

Examples
--------
```bash
tomcat list -a        # show all deployed applications
tomcat stop myApp     # stop an application
tomcat myApp kill     # stop and undeploy an app
```



Config
------
You need a config file to manage undeployed apps. Create a `tomcat.json` file in the same folder as script:

```json
{
	"tomcat": {
		"loginpass": "tomcat:tomcat",
		"path": "D:\\apache-tomcat-7.0.32\\bin"
	},

	"apps": [
		{
			"name": "MyTomcatApp",
			"path": "D:\\Projects\\MyTomcatApp",
			"actions" : {
				"deploy" : "mvn tomcat:redeploy",
				"clean" : "mvn clean",
				"delete" : "rm -r D:\\apache-tomcat-7.0.32\\webapps\\MyTomcatApp"
			}
		}
	]
}
```

With the above file `tomcat list` would also show you apps from config. You can then do:

```bash
tomcat deploy MyTomcatApp
tomcat MyTomcatApp redeploy
```



Tips
----

 - App and Func order doesn't matter, e.g. these are equivalent:

```bash
tomcat stop myApp
tomcat myApp stop
```

 - You don't have to put the whole name, partial matches are fine too! If you have app called "MyTomcatApp" you can do:

```bash
tomcat start myapp
tomcat start app    # provided you don't have another similar name containing "app"
```


 - Apps from config are managed using commmand line, so if commands you want to put there work in your console they should work here as well

License
-------

*MIT*

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