nifi/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/pom.xml

222 lines
9.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-server-nar-bom</artifactId>
<version>2.0.0-SNAPSHOT</version>
<relativePath>../../../nifi-server-nar-bom</relativePath>
</parent>
<artifactId>nifi-web-frontend</artifactId>
<version>2.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<frontend.source>${basedir}/src/main/nifi</frontend.source>
<frontend.working.dir>${project.build.directory}/frontend-working-directory</frontend.working.dir>
<copy-rename-maven-plugin.version>1.0.1</copy-rename-maven-plugin.version>
<!--
String name of the theme file to be used.
Ex: 'purple' // will overwrite the 'material' theme file with the 'purple' theme.
-->
<frontend.theme>material</frontend.theme>
<frontend.skipTests>true</frontend.skipTests>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<!--
Copy src into frontend working directory.
-->
<execution>
<id>copy-source</id>
<phase>initialize</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${frontend.working.dir}</outputDirectory>
<resources>
<resource>
<directory>${frontend.source}</directory>
<filtering>false</filtering>
<excludes>
<exclude>.angular/**/*</exclude>
<exclude>node_modules/**/*</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
<!--
Stage the final bundle of JS to be included in the .war
-->
<execution>
<id>copy-web-ui-bundle</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
<resources>
<resource>
<directory>${frontend.working.dir}/dist/nifi/browser</directory>
<filtering>false</filtering>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>${copy-rename-maven-plugin.version}</version>
<executions>
<!--
Copy theme.
-->
<execution>
<id>copy-theme</id>
<phase>initialize</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<sourceFile>${frontend.working.dir}/src/assets/themes/${frontend.theme}.scss</sourceFile>
<destinationFile>${frontend.working.dir}/src/assets/themes/material.scss</destinationFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend.mvn.plugin.version}</version>
<configuration>
<installDirectory>${frontend.working.dir}</installDirectory>
</configuration>
<executions>
<!--
Install node and npm.
-->
<execution>
<id>install-node-and-npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>initialize</phase>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
</configuration>
</execution>
<!--
Install node_modules (build, test, AND client side dependencies).
-->
<execution>
<id>npm-install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>initialize</phase>
<configuration>
<arguments>run ci</arguments>
<workingDirectory>${frontend.working.dir}</workingDirectory>
</configuration>
</execution>
<!--
Run the code linter
-->
<execution>
<id>lint</id>
<goals>
<goal>npx</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>nx lint</arguments>
<workingDirectory>${frontend.working.dir}</workingDirectory>
<skip>${frontend.skipTests}</skip>
</configuration>
</execution>
<!--
Run the unit tests
-->
<execution>
<id>unit-tests</id>
<goals>
<goal>npx</goal>
</goals>
<phase>test</phase>
<configuration>
<arguments>nx test --maxWorkers=2</arguments>
<workingDirectory>${frontend.working.dir}</workingDirectory>
<skip>${frontend.skipTests}</skip>
</configuration>
</execution>
<!--
Bundle, minify, and gzip compress all the javascript.
-->
<execution>
<id>package-web-ui</id>
<goals>
<goal>npx</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>nx build</arguments>
<workingDirectory>${frontend.working.dir}</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<configuration>
<excludes combine.children="append">
<exclude>src/main/nifi/coverage/**/*</exclude>
<exclude>src/main/nifi/node_modules/**/*</exclude>
<exclude>src/main/nifi/src/assets/fonts/**/*</exclude>
<exclude>src/main/nifi/.editorconfig</exclude>
<exclude>src/main/nifi/README.md</exclude>
<exclude>src/main/nifi/proxy.config.mjs</exclude>
<exclude>src/main/nifi/.prettierrc</exclude>
<exclude>src/main/nifi/.prettierignore</exclude>
<exclude>src/main/nifi/dist/**/*</exclude>
<exclude>src/main/nifi/.angular/**/*</exclude>
<exclude>src/main/nifi/.nx/**/*</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>