build(portal): add Maven build chain to portal
Also add a range of metadata for WAR-based portal distro.
MODIFY
.gitignore
.gitignore
/out-tsc
# Only exists if Bazel was run
/bazel-out
+target
# dependencies
/node_modules
+/node
# profiling files
chrome-profiler-events*.json

MODIFY
angular.json
angular.json
"node_modules/simplebar/dist/simplebar.min.js"
]
},
- "configurations": {
+ "configurations": { // --configuration production,java
+ "java": {
+ "fileReplacements": [
+ {
+ "replace": "src/environments/environment.ts",
+ "with": "src/environments/environment.prod.java.ts"
+ }
+ ]
+ },
"production": {
"sourceMap": true,
"budgets": [

MODIFY
package.json
package.json
"lint": "ng lint && stylelint '**/*.scss'",
"lint-fix": "ng lint --fix && stylelint --fix '**/*.scss'",
"build-production": "ng build --configuration production",
+ "build-production-mvn": "ng build --configuration production,java --output-path=target/classes/ --base-href=/portal/",
"cy:open": "cypress open",
"cy:run": "cypress run",
"prepare": "husky install"

ADD
pom.xml
+<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>io.apiman</groupId>
+ <artifactId>apiman-portal</artifactId>
+ <version>3.1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <packaging>jar</packaging>
+ <artifactId>apiman-portal-ui</artifactId>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.eirslett</groupId>
+ <artifactId>frontend-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>install node and npm</id>
+ <goals>
+ <goal>install-node-and-npm</goal>
+ </goals>
+ <configuration>
+ <nodeVersion>v16.16.0</nodeVersion>
+ <npmVersion>8.15.0</npmVersion>
+ </configuration>
+ </execution>
+ <execution>
+ <id>npm install (npm ci)</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+ <configuration>
+ <arguments>ci</arguments>
+ </configuration>
+ </execution>
+ <execution>
+ <id>npm run-script prod</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+ <configuration>
+ <arguments>run build-production-mvn</arguments>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>

ADD
src/environments/environment.prod.java.ts
+/*
+ * Copyright 2022 Scheer PAS Schweiz AG
+ *
+ * Licensed 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
+ * imitations under the License.
+ */
+
+import { IEnvironment } from '../app/interfaces/IEnvironment';
+import packageJson from './../../package.json';
+
+export const environment: IEnvironment = {
+ production: true,
+ configFilePath: 'assets/config-java.json5',
+ version: packageJson.version
+};

ADD
src/main/resources/.gitkeep
src/main/resources/.gitkeep
build(portal): add Maven build chain to portal

Also add a range of metadata for WAR-based portal distro.