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

finn-no/maven-deploy: A simple NodeJS module to create a war/jar package and ins ...

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

开源软件名称(OpenSource Name):

finn-no/maven-deploy

开源软件地址(OpenSource Url):

https://github.com/finn-no/maven-deploy

开源编程语言(OpenSource Language):

JavaScript 100.0%

开源软件介绍(OpenSource Introduction):

maven-deploy

Build Status Coverage Status Dependencies status

A simple Node.js module to create a war-/jar-package and install/deploy to a local/remote Maven repository. It uses mvn to do the actual deployment, so you need maven installed locally.

Project name and version is extracted from package.json and used as artifactId and maven version. Supply an object litteral with other Maven related config. Values from package.json can be used by adding curly-braces around the key. Example {finalName: "{name}-{version}"}.

The package is created from the {buildDir}/ folder. So you need to make sure that the files you want in the package is put there before packaging. The default is dist/. The package file will be output in the same folder.

var config = {
    "groupId"      : "com.example",    // required - the Maven group id.
    "artifactId"   : "{name}",         // the Maven artifact id.
    "buildDir"     : "dist",           // project build directory.
    "finalName"    : "{name}",         // the final name of the file created when the built project is packaged.
    "type"         : "war",            // type of package. "war" or "jar" supported.
    "fileEncoding" : "utf-8",          // file encoding when traversing the file system, default is UTF-8
    "generatePom"  : true,             // generate a POM based on the configuration
    "pomFile"      : "pom.xml",        // use this existing pom.xml instead of generating one (generatePom must be false)
    "settings"     : "settings.xml",    // override mvn settings file. ignore this field to use default
    "repositories" : [                 // array of repositories, each with id and url to a Maven repository.
      {
        "id": "example-internal-snapshot",
        "url": "http://mavenproxy.example.com/example-internal-snapshot/"
      },
      {
        "id": "example-internal-release",
        "url": "http://mavenproxy.example.com/example-internal-release/"
      }
    ]
};

It might be useful to store the config as a separate json-file, so you can re-use it in multiple files.

var config = require('./maven-config.json');

Package war/jar

It expects output from the project to be in dist/ directory. It zips the content and outputs it to dist/{finalName}.{type} Usage: maven.package( [callback] )

Example:

var maven = require('maven-deploy');
maven.config(config);
maven.package();

Install to local repository

Runs package first, then installs the package to your local Maven repository. Usage: maven.install( [callback] )

Example:

var maven = require('maven-deploy');
maven.config(config);
maven.install();

Deploy

Runs package first, then deploys the package to the specified Maven repository. Usage: maven.deploy( repositoryId, [snapshot = false], [callback])

Example: deploy to snapshot repo

var maven = require('maven-deploy');
maven.config(config);
maven.deploy('example-internal-snapshot', true);

Example: deploy to release repo

var maven = require('maven-deploy');
maven.config(config);
maven.deploy('example-internal-release');

Example: deploy existing archive file

var maven = require('maven-deploy');
maven.config(config);
maven.deploy('example-internal-release', 'file.jar');

Contributing

We would love your contribution, please consult the contributing page for how to make your contributions land into the project as easily as possible.




鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
brianwx5/Maven.Quiz3-1发布时间:2022-08-17
下一篇:
fabric8io/shootout-docker-maven: A comparison between the four major docker-mave ...发布时间:2022-08-17
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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