<policy.apex-pdp.version>2.4.0</policy.apex-pdp.version>
<policy.common.version>1.10.1-SNAPSHOT</policy.common.version>
<policy.models.version>2.6.1-SNAPSHOT</policy.models.version>
- <webapp.dir>src/main/resources/webapp</webapp.dir>
- <sonar.nodejs.executable>${project.basedir}/src/main/resources/webapp/node/node</sonar.nodejs.executable>
- <sonar.sources>${project.basedir}/src/main/java,${project.basedir}/src/main/resources/webapp/js</sonar.sources>
- <sonar.exclusions>src/main/resources/webapp/js/__test__/**,src/main/resources/webapp/js/jquery/**,src/main/resources/webapp/js/edit_area/**,src/main/resources/webapp/js/jquery-ui-1.12.1/**,src/main/resources/webapp/js/lib/**</sonar.exclusions>
+ <webapp.dir>${project.basedir}/src/main/webapp</webapp.dir>
+ <sonar.nodejs.executable>${webapp.dir}/node/node</sonar.nodejs.executable>
+ <sonar.sources>${project.basedir}/src/main/java,${webapp.dir}/js</sonar.sources>
+ <sonar.exclusions>${webapp.dir}/js/__test__/**</sonar.exclusions>
</properties>
<dependencies>
</dependencies>
<build>
- <defaultGoal>install</defaultGoal>
- <outputDirectory>${project.build.directory}/classes</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <excludes>
- <exclude>webapp/node/**</exclude>
- <exclude>webapp/node_modules/**</exclude>
- <exclude>webapp/webpack.config.js</exclude>
- <exclude>webapp/package.json</exclude>
- <exclude>webapp/package-lock.json</exclude>
- <exclude>webapp/dist/**</exclude>
- </excludes>
- </resource>
- <resource>
- <directory>${webapp.dir}/dist/</directory>
- <targetPath>webapp/</targetPath>
- </resource>
- </resources>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<version>1.9.1</version>
<configuration>
<nodeVersion>v14.17.0</nodeVersion>
+ <npmVersion>6.14.5</npmVersion>
<installDirectory>${webapp.dir}</installDirectory>
<workingDirectory>${webapp.dir}</workingDirectory>
<npmDownloadRoot>${repo.npm}</npmDownloadRoot>
<goals>
<goal>install-node-and-npm</goal>
</goals>
- <configuration>
- <npmVersion>6.14.5</npmVersion>
- </configuration>
+ <phase>generate-resources</phase>
</execution>
<execution>
<id>npm install</id>
<configuration>
<arguments>install</arguments>
</configuration>
+ <phase>generate-resources</phase>
</execution>
<execution>
<id>npm test</id>
<goals>
<goal>npm</goal>
</goals>
- <phase>test</phase>
<configuration>
<arguments>test</arguments>
</configuration>
+ <phase>test</phase>
</execution>
<execution>
<id>webpack build</id>
<goals>
<goal>webpack</goal>
</goals>
+ <phase>generate-resources</phase>
</execution>
</executions>
</plugin>
+
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy frontend resources</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/classes/webapp</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${webapp.dir}/dist</directory>
+ </resource>
+ <resource>
+ <directory>${webapp.dir}</directory>
+ <includes>
+ <include>js/fileMenu.js</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
</filesets>
</configuration>
</plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/node/**</exclude>
- <exclude>**/node_modules/**</exclude>
- <exclude>webapp/webpack.config.js</exclude>
- <exclude>webapp/package.json</exclude>
- <exclude>webapp/package-lock.json</exclude>
- </excludes>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>make shared resources</id>
- <goals>
- <goal>single</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/resources.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
</plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
- <exclude>webapp/package-lock.json</exclude>
- <exclude>webapp/package.json</exclude>
- <exclude>webapp/.babelrc</exclude>
- <exclude>webapp/.gitignore</exclude>
- <exclude>webapp/webpack.config.js</exclude>
- <exclude>webapp/dist/</exclude>
- <exclude>webapp/js/Apex*.js</exclude>
- <exclude>webapp/js/__test__/</exclude>
</excludes>
</filter>
</filters>
</transformers>
</configuration>
</plugin>
+
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
+++ /dev/null
-<!--
- ============LICENSE_START=======================================================
- Copyright (C) 2018 Ericsson. All rights reserved.
- Modifications Copyright (C) 2020 Nordix Foundation.
- ================================================================================
- 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
- limitations under the License.
-
- SPDX-License-Identifier: Apache-2.0
- ============LICENSE_END=========================================================
--->
-<assembly>
- <id>resources</id>
- <formats>
- <format>zip</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>target/classes/webapp</directory>
- <outputDirectory>editor</outputDirectory>
- <excludes>
- <exclude>**/node/**</exclude>
- <exclude>**/node_modules/**</exclude>
- <exclude>webpack.config.js</exclude>
- <exclude>package.json</exclude>
- <exclude>package-lock.json</exclude>
- </excludes>
- </fileSet>
- </fileSets>
-</assembly>
\ No newline at end of file
node/
dist/bundle.js
coverage/
-reports/
\ No newline at end of file
+reports/
+package-lock.json
<!--
============LICENSE_START=======================================================
Copyright (C) 2016-2018 Ericsson. All rights reserved.
- Modifications Copyright (C) 2020-2021 Nordix Foundation.
+ Modifications Copyright (C) 2020-2022 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
<!-- fileMenu JS file -->
<script type="text/javascript" src="js/fileMenu.js"></script>
- <!-- showhideElement JS file -->
- <script type="text/javascript" src="js/showhideElement.js"></script>
<!-- edit area JS file -->
<script language="javascript" type="text/javascript" src="js/edit_area/edit_area_full.js"></script>
<!-- generated bundle.js -->
const apexPolicyTab = require('../ApexPolicyTab');
const keyInformationTab = require('../ApexKeyInformationTab');
-require('../jquery-ui-1.12.1/jquery-ui.js');
+require('../../dist/js/jquery-ui-1.12.1/jquery-ui.js');
const data = {
messages: {
$("#menu li").click();
let h1 = document.querySelector('ul');
expect(h1.textContent).toEqual('menuFileNew');
-});
\ No newline at end of file
+});
},
"jest": {
"collectCoverage": true,
- "coverageDirectory": "../../../../target/code-coverage",
+ "coverageDirectory": "../../../target/code-coverage",
+ "collectCoverageFrom": [
+ "js/**",
+ "!dist/**"
+ ],
"transform": {
"^.+\\.[t|j]sx?$": "babel-jest"
},
]
},
"jestSonar": {
- "reportPath": "../../../../target/reports",
+ "reportPath": "../../../target/reports",
"reportFile": "test-reporter.xml",
"indent": 4,
"sonar56x": true