Using npm with a java project?

Viewed 405

I wanted to use npm scripts to automate some things with a java application I am working on.

I've made a start script that runs ant changes to the dist/ folder and runs three instances of the app with the concurrently

my script looks as follows:

"scripts": {
  "start": "ant && cd dist/ && concurrently \"java -jar ChatApplication-Server.jar Mode=Client\" \"java -jar ChatApplication-Server.jar Mode=Client\" \"java -jar ChatApplication-Server.jar Mode=Server\"", 
},

It somehow seems wrong to use npm to work with a java application? Can I achieve what I am trying to do with just using ant alone somehow?

1 Answers

NPM is a javascript package manager, so it is a tool built with javascript in mind.

Instead of using NPM, you should use a java specialised tool like maven or gradle.

Each tool has it's use. You don't hammer a nail with a screwdriver.

Related