NIFI-13354: (#8936)

- Moving NiFi front end source into a top level maven module. This prepares for the introduction of other UIs that NiFi offers (like Custom UIs, Data Viewers, etc) to be colocated and share common components, styles, and dependencies.
- The nifi-web-frontend module which produces the war that is included in the server nar now no longer contains any source. It simply depends on the new nifi-frontend artifact that bundles all built UIs and unpacks its contents into the resulting war.
- Renaming nifi-web-frontend to nifi-ui. Now nifi-frontend at the top level will hold all frontend apps. In this commit the nifi app in nifi-frontend is bundled into a war called nifi-ui.

This closes #8936
This commit is contained in:
Matt Gilman 2024-06-07 16:25:07 -04:00 committed by GitHub
parent d86686bf0a
commit 406dbced3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1295 changed files with 376 additions and 45 deletions

View File

@ -51,6 +51,8 @@ env:
-pl -:nifi-nar-provider-assembly
-pl -:nifi-py4j-integration-tests
-pl -:nifi-python-extensions-bundle
-pl -:nifi-server-nar
-pl -:nifi-ui
MAVEN_VERIFY_COMMAND: >-
verify
--show-version
@ -163,7 +165,7 @@ jobs:
with:
filters: |
frontend:
- 'nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/**'
- 'nifi-frontend/**'
- name: Maven Compile
env:
MAVEN_OPTS: >-
@ -236,7 +238,7 @@ jobs:
with:
filters: |
frontend:
- 'nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/**'
- 'nifi-frontend/**'
- name: Maven Compile
env:
MAVEN_OPTS: >-
@ -311,7 +313,7 @@ jobs:
with:
filters: |
frontend:
- 'nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/**'
- 'nifi-frontend/**'
- name: Maven Compile
env:
MAVEN_OPTS: >-

View File

@ -2865,5 +2865,5 @@ The binary distribution of this product bundles 'Py4J' under a BSD license.
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For the binary distribution of nifi-web-frontend see its 3rdpartylicenses.txt
For the binary distribution of nifi-ui see its 3rdpartylicenses.txt
for additional license and notice information.

View File

@ -2573,5 +2573,5 @@ SIL OFL 1.1
The following binary components are provided under the SIL Open Font License 1.1
(SIL OFL 1.1) FontAwesome (4.7.0 - https://fontawesome.com/license/free)
For the binary distribution of nifi-web-frontend see its 3rdpartylicenses.txt
For the binary distribution of nifi-ui see its 3rdpartylicenses.txt
for additional license and notice information.

View File

@ -253,7 +253,7 @@ public class JettyServer implements NiFiServer, ExtensionUiLoader {
webDocsWar = war;
} else if (war.getName().toLowerCase().startsWith("nifi-web-content-viewer")) {
webContentViewerWar = war;
} else if (war.getName().toLowerCase().startsWith("nifi-web-frontend")) {
} else if (war.getName().toLowerCase().startsWith("nifi-ui")) {
webUiWar = war;
} else {
otherWars.put(war, warBundle);

View File

@ -0,0 +1,80 @@
<?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-ui</artifactId>
<version>2.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<nifi.ui.working.dir>${project.build.directory}/nifi-ui-working-directory</nifi.ui.working.dir>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-frontend</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<!--
Unpack the built nifi front end application
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-nifi-ui</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>org.apache.nifi</includeGroupIds>
<includeArtifactIds>nifi-frontend</includeArtifactIds>
<excludeTransitive>true</excludeTransitive>
<silent>false</silent>
<outputDirectory>${nifi.ui.working.dir}</outputDirectory>
<includes>nifi/**/*</includes>
</configuration>
</execution>
</executions>
</plugin>
<!--
Include the NiFi UI and exclude the JAR dependency
-->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warSourceDirectory>${nifi.ui.working.dir}/nifi</warSourceDirectory>
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -208,5 +208,5 @@ notices and license terms. Your use of the source code for the these
subcomponents is subject to the terms and conditions of the following
licenses.
For the binary distribution of nifi-web-frontend see its 3rdpartylicenses.txt
For the binary distribution of nifi-ui see its 3rdpartylicenses.txt
for additional license and notice information.

View File

@ -1,4 +1,4 @@
nifi-web-frontend
nifi-ui
Copyright 2014-2024 The Apache Software Foundation
This product includes software developed at
@ -11,5 +11,5 @@ SIL OFL 1.1
The following binary components are provided under the SIL Open Font License 1.1
(SIL OFL 1.1) FontAwesome (4.7.0 - https://fontawesome.com/license/free)
For the binary distribution of nifi-web-frontend see its 3rdpartylicenses.txt
For the binary distribution of nifi-ui see its 3rdpartylicenses.txt
for additional license and notice information.

View File

@ -29,7 +29,7 @@
<module>nifi-web-api</module>
<module>nifi-web-docs</module>
<module>nifi-web-content-viewer</module>
<module>nifi-web-frontend</module>
<module>nifi-ui</module>
<module>nifi-jetty</module>
<module>nifi-web-content-access</module>
<module>nifi-ui-extension</module>

View File

@ -50,7 +50,7 @@
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-web-frontend</artifactId>
<artifactId>nifi-ui</artifactId>
<version>2.0.0-SNAPSHOT</version>
<type>war</type>
</dependency>

View File

@ -359,5 +359,5 @@ For details see http://asm.ow2.org/asmdex-license.html
This product bundles 'reset.css' which is available in the 'public domain'.
For details see http://meyerweb.com/eric/tools/css/reset/
For the binary distribution of nifi-web-frontend see its 3rdpartylicenses.txt
For the binary distribution of nifi-ui see its 3rdpartylicenses.txt
for additional license and notice information.

View File

@ -204,5 +204,5 @@ SIL OFL 1.1
The following binary components are provided under the SIL Open Font License 1.1
(SIL OFL 1.1) FontAwesome (4.7.0 - https://fontawesome.com/license/free)
For the binary distribution of nifi-web-frontend see its 3rdpartylicenses.txt
For the binary distribution of nifi-ui see its 3rdpartylicenses.txt
for additional license and notice information.

View File

@ -14,21 +14,22 @@
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">
<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>
<artifactId>nifi</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>
<artifactId>nifi-frontend</artifactId>
<packaging>jar</packaging>
<properties>
<frontend.source>${basedir}/src/main/nifi</frontend.source>
<frontend.source>${basedir}/src/main/frontend</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>
<!--
@ -50,7 +51,7 @@
-->
<execution>
<id>copy-source</id>
<phase>initialize</phase>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
@ -64,22 +65,24 @@
<exclude>.angular/**/*</exclude>
<exclude>.nx/**/*</exclude>
<exclude>node_modules/**/*</exclude>
<exclude>coverage/**/*</exclude>
<exclude>dist/**/*</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
<!--
Stage the final bundle of JS to be included in the .war
Stage the final bundle of the application. Each application needs its own configuration.
-->
<execution>
<id>copy-web-ui-bundle</id>
<phase>prepare-package</phase>
<id>copy-built-apps</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
<outputDirectory>${project.build.directory}/${project.build.finalName}/nifi</outputDirectory>
<resources>
<resource>
<directory>${frontend.working.dir}/dist/nifi/browser</directory>
@ -98,6 +101,28 @@
</resources>
</configuration>
</execution>
<!--
Copy the staged applications into the bundle. Each application requires its own configuration.
-->
<execution>
<id>bundle-built-apps</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/nifi</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/${project.build.finalName}/nifi</directory>
<filtering>false</filtering>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
@ -110,7 +135,7 @@
-->
<execution>
<id>copy-theme-nifi</id>
<phase>initialize</phase>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
@ -150,13 +175,12 @@
<goals>
<goal>npm</goal>
</goals>
<phase>initialize</phase>
<phase>generate-resources</phase>
<configuration>
<arguments>run ci</arguments>
<workingDirectory>${frontend.working.dir}</workingDirectory>
</configuration>
</execution>
<!--
Run the code linter
-->
@ -172,7 +196,6 @@
<skip>${frontend.skipTests}</skip>
</configuration>
</execution>
<!--
Run the unit tests
-->
@ -188,7 +211,6 @@
<skip>${frontend.skipTests}</skip>
</configuration>
</execution>
<!--
Bundle, minify, and gzip compress all the javascript.
-->
@ -203,7 +225,6 @@
<workingDirectory>${frontend.working.dir}</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
@ -211,17 +232,17 @@
<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/apps/nifi/src/assets/fonts/**/*</exclude>
<exclude>src/main/nifi/.editorconfig</exclude>
<exclude>src/main/nifi/README.md</exclude>
<exclude>src/main/nifi/apps/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>
<exclude>src/main/frontend/coverage/**/*</exclude>
<exclude>src/main/frontend/node_modules/**/*</exclude>
<exclude>src/main/frontend/apps/nifi/src/assets/fonts/**/*</exclude>
<exclude>src/main/frontend/.editorconfig</exclude>
<exclude>src/main/frontend/README.md</exclude>
<exclude>src/main/frontend/apps/nifi/proxy.config.mjs</exclude>
<exclude>src/main/frontend/.prettierrc</exclude>
<exclude>src/main/frontend/.prettierignore</exclude>
<exclude>src/main/frontend/dist/**/*</exclude>
<exclude>src/main/frontend/.angular/**/*</exclude>
<exclude>src/main/frontend/.nx/**/*</exclude>
</excludes>
</configuration>
</plugin>

Some files were not shown because too many files have changed in this diff Show More