
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Node.js package that wraps Apache Maven.
npm install maven
const mvn = require('maven').create({
cwd: '/path/to/your/maven-project'
});
mvn.execute(['clean', 'install'], { 'skipTests': true }).then(() => {
// As mvn.execute(..) returns a promise, you can use this block to continue
// your stuff, once the execution of the command has been finished successfully.
});
Creating a Maven wrapper instance is pretty much straight forward:
const mvn = require('maven').create(options);
The following options can be passed to the create method:
cwd (default: process.cwd())This parameter can be used to define the working directory when invoking the Maven command line.
cmd (default: ./mvnw if present in project root, otherwise mvn (or mvn.bat on Windows))Maven executable relative to cwd. For example, cwd: '/usr/local/bin/mvn
file (default: undefined)Can be used to pass a specific POM file to the Maven command line. If nothing is specified, the Maven process itself will look for a file called pom.xml in the base directory.
profiles (default: [])An array that can be used to enable or disable profiles.
You can either explicitly enable a profile by adding it's name or disable a
profile by pre-pending ! to it's name.
Will be passed to Java/Maven as -PprofileEnabled,!profileDisabled parameter.
settings (default: undefined)Can be used to override the default settings file when invoking Maven.
If nothing is specified, the Maven process itself will load .m2/settings.xml
in the user's home directory.
quiet (default: false)Quiet output - only show errors if set to true.
debug (default: false)Produce execution debug output if set to true.
updateSnapshots (default: false)Forces a check for missing releases and updated snapshots on
remote repositories if set to true.
offline (default: false)Produce execution offline if set to true.
nonRecursive (default: false)Prevents Maven from building submodules if set to true.
threads (default: undefined)Thread count, for instance 2.0C where C is core multiplied
noTransferProgress (default: false)Suppress the transfer progress when downloading/uploading in interactive mode if set to true (requires Maven 3.6.1+).
batchMode (default: false)Run in non-interactive (batch) mode (disables output color) if set to true.
alsoMake (default: false)If project list is specified, also build projects required by the list
logFile (default: undefined)Log file where all build output will go (disables output color).
Executing Maven commands is simple, too:
mvn.execute(commands, defines);
You can optionally specify a list of projects to be build:
mvn.execute(commands, defines, projects)
commands is just a list of lifecycle phases and/or goals, e.g. 'compile', [ 'clean', 'install' ] or [ 'release:prepare', 'release:perform' ].
defines is an object that represents the various definitions that will be passed to Java/Maven via -Dkey=value parameters.
FAQs
Maven wrapper for Node.js
The npm package maven receives a total of 1,785 weekly downloads. As such, maven popularity was classified as popular.
We found that maven demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.