• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

headcr4sh/node-maven: Maven for Node.js

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

headcr4sh/node-maven

开源软件地址(OpenSource Url):

https://github.com/headcr4sh/node-maven

开源编程语言(OpenSource Language):

JavaScript 100.0%

开源软件介绍(OpenSource Introduction):

Maven for Node.js

Node.js package that wraps Apache Maven.

Installation

npm install maven

Basic usage

    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 the Maven wrapper instance

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

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.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap