pm2j

Control a pm2 process

License

License

Categories

Categories

Ant Build Tools Net
GroupId

GroupId

net.savantly
ArtifactId

ArtifactId

pm2j
Last Version

Last Version

1.0.0-RELEASE
Release Date

Release Date

Type

Type

jar
Description

Description

pm2j
Control a pm2 process
Project Organization

Project Organization

savantly.net
Source Code Management

Source Code Management

https://github.com/savantly-net/pm2j

Download pm2j

How to add to project

<!-- https://jarcasting.com/artifacts/net.savantly/pm2j/ -->
<dependency>
    <groupId>net.savantly</groupId>
    <artifactId>pm2j</artifactId>
    <version>1.0.0-RELEASE</version>
</dependency>
// https://jarcasting.com/artifacts/net.savantly/pm2j/
implementation 'net.savantly:pm2j:1.0.0-RELEASE'
// https://jarcasting.com/artifacts/net.savantly/pm2j/
implementation ("net.savantly:pm2j:1.0.0-RELEASE")
'net.savantly:pm2j:jar:1.0.0-RELEASE'
<dependency org="net.savantly" name="pm2j" rev="1.0.0-RELEASE">
  <artifact name="pm2j" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.savantly', module='pm2j', version='1.0.0-RELEASE')
)
libraryDependencies += "net.savantly" % "pm2j" % "1.0.0-RELEASE"
[net.savantly/pm2j "1.0.0-RELEASE"]

Dependencies

compile (3)

Group / Artifact Type Version
org.apache.logging.log4j : log4j-api jar 2.9.0
joda-time : joda-time jar 2.9.9
com.fasterxml.jackson.core : jackson-databind jar 2.9.0

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.apache.logging.log4j : log4j-core jar 2.9.0

Project Modules

There are no modules declared in this project.

pm2j

Control PM2 process from Java

Example Usage

public class Pm2jConnectorTest {
	
	Logger log = LogManager.getLogger(Pm2jConnectorTest.class);

	private static Pm2Connector connector = new Pm2Connector();
	private String configFile = "./src/test/resources/ecosystem.json";
	
	@AfterClass
	public static void after(){
		connector.killPm2();
	}
	
	@Test
	public void getPm2VersionTest(){
		connector.getPm2Version();
	}
	
	@Test
	public void getPm2ProcessesTest(){
		List<Pm2ProcessInfo> pm2Processes = connector.getPm2Processes();
		Assert.assertNotNull(pm2Processes);
	}
	
	@Test
	public void startAndStopPm2Test() throws IOException{
		connector.startPm2(configFile);
		connector.stopPm2();
	}

}
net.savantly

Savantly

Savantly custom software solutions for your business

Versions

Version
1.0.0-RELEASE