Angular Client Maven Plugin


License

License

MIT
Categories

Categories

Maven Build Tools CLI User Interface
GroupId

GroupId

com.github.taodong
ArtifactId

ArtifactId

ngcli-maven-plugin
Last Version

Last Version

0.3
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Angular Client Maven Plugin
Angular Client Maven Plugin
Project URL

Project URL

https://github.com/taodong/ng-maven-plugin
Source Code Management

Source Code Management

https://github.com/taodong/ng-maven-plugin

Download ngcli-maven-plugin

How to add to project

<plugin>
    <groupId>com.github.taodong</groupId>
    <artifactId>ngcli-maven-plugin</artifactId>
    <version>0.3</version>
</plugin>

Dependencies

compile (4)

Group / Artifact Type Version
org.apache.maven : maven-core jar 3.5.0
org.apache.commons : commons-exec jar 1.3
org.slf4j : slf4j-api jar 1.7.25
com.google.guava : guava jar 20.0

provided (2)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.5.0
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5

test (2)

Group / Artifact Type Version
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

ngcli-maven-plugin

This is a maven plug in for Angular client for integration purpose. This plugin runs ng command to build the front end pages, then copy files to the desired folder used by backend.

This plugin doesn't include functions to install any front end runner

Requirements

  • Angular client installed
  • NPM installed

Installation

Include the plugin as a dependency in your Maven project. Change LATEST_VERSION to the latest tagged version.

<plugin>
    <groupId>com.github.taodong</groupId>
    <artifactId>ngcli-maven-plugin</artifactId>
    <version>LATEST_VERSION</version>
    ...
</plugin>

Usage

This plugin includes two modules ng-cli-run and ng-cli-clean. To run this plugin, two parameters are required to be configured.

  • sourceDir - should be the root folder of all the front end sources
  • distDir - the folder which the front end files to be copy to

ng-cli-run

Run ng client to build front end. It will run command "ng test", "ng e2e", "ng build" under ${sourceDir} folder, then copy files under ${sourceDir}/dist to ${distDir}. Default phase is set to generate-resources. A sample usage is:

<execution>
    <id>ng-cli-run</id>
    <goals>
        <goal>ng-cli-run</goal>
    </goals>
    <configuration>
        <isProduct>false</isProduct>
        <runE2e>false</runE2e>
    </configuration>
</execution>

Optional configuration parameter include:

  • isProduct: whether to build front end for production. Default is false.
  • skipNgBuild: whether to skip the execution of this module. Default is false.
  • skipTests: a shared flag with maven tests. Default is false.
  • skipNgTests: whether to skip front end tests. Default is false.
  • runE2e: whether to run front end E2E tests. Default is true.
  • timeout: shell time out in minutes. Default is 10 minutes. You might want to increase it if your front end has many tests. It also can be used to force close testing Browsers.
  • rootNgProject: the defaultProject defined in angular.json. If a value is set, all the files under dist/rootNgProject will be copy under ${distDir}.

ng-cli-clean

Clean front end files. It will remove all files under ${sourceDir}/dist folder and ${distDir} folder. Default phase is set to clean. A sample usage is:

<execution>
    <id>ng-cli-clean</id>
    <goals>
        <goal>ng-cli-clean</goal>
    </goals>
    <configuration>
        <cleanNode>true</cleanNode>
    </configuration>
</execution>

Optional configuration parameter include:

  • cleanNode: whether to remove all the files under ${sourceDir}/node_module. Default is false.

License

MIT

Versions

Version
0.3
0.2