summaryrefslogtreecommitdiffstats
path: root/gui-editors/gui-editor-apex/pom.xml
diff options
context:
space:
mode:
authorwaynedunican <wayne.dunican@est.tech>2020-09-07 12:21:03 +0100
committerwaynedunican <wayne.dunican@est.tech>2020-09-07 14:36:10 +0100
commit483f0f8457f8b10d426e8135ab66000d3a3ff7a9 (patch)
tree2b81bb636d596332c77a2b6848810f65aea279f0 /gui-editors/gui-editor-apex/pom.xml
parent0bdca95bb07cd2e9f896ba2e9fce6522b785940e (diff)
JavaScript tests for apex-editor
JavaScript tests added to improve code coverage for policy-gui Issue-ID: POLICY-2783 Change-Id: Ie12fb6089b872842bb5c668a8126675f89772d79 Signed-off-by: waynedunican <wayne.dunican@est.tech>
Diffstat (limited to 'gui-editors/gui-editor-apex/pom.xml')
-rw-r--r--gui-editors/gui-editor-apex/pom.xml93
1 files changed, 92 insertions, 1 deletions
diff --git a/gui-editors/gui-editor-apex/pom.xml b/gui-editors/gui-editor-apex/pom.xml
index c209f99..8c656d5 100644
--- a/gui-editors/gui-editor-apex/pom.xml
+++ b/gui-editors/gui-editor-apex/pom.xml
@@ -34,6 +34,10 @@
<properties>
<policy.apex-pdp.version>2.4.0</policy.apex-pdp.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>
</properties>
<dependencies>
@@ -122,7 +126,94 @@
<defaultGoal>install</defaultGoal>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<plugins>
-
+ <plugin>
+ <groupId>com.github.eirslett</groupId>
+ <artifactId>frontend-maven-plugin</artifactId>
+ <version>1.9.1</version>
+ <configuration>
+ <nodeVersion>v9.9.0</nodeVersion>
+ <installDirectory>${webapp.dir}</installDirectory>
+ <workingDirectory>${webapp.dir}</workingDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <id>install node</id>
+ <goals>
+ <goal>install-node-and-npm</goal>
+ </goals>
+ <configuration>
+ <nodeVersion>v10.16.0</nodeVersion>
+ <npmVersion>6.9.0</npmVersion>
+ </configuration>
+ </execution>
+ <execution>
+ <id>npm install</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+ <configuration>
+ <arguments>install</arguments>
+ </configuration>
+ </execution>
+ <execution>
+ <id>npm test</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+ <phase>test</phase>
+ <configuration>
+ <arguments>test</arguments>
+ </configuration>
+ </execution>
+ <execution>
+ <id>webpack build</id>
+ <goals>
+ <goal>webpack</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>Copy frontend build to target</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/classes/webapp</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${webapp.dir}/dist</directory>
+ <filtering>false</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>3.0.0</version>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${webapp.dir}/node</directory>
+ </fileset>
+ <fileset>
+ <directory>${webapp.dir}/node_modules</directory>
+ </fileset>
+ <fileset>
+ <directory>${webapp.dir}/dist/</directory>
+ <includes>bundle.js</includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
<!-- https://blog.sonatype.com/2008/04/how-to-share-resources-across-projects-in-maven/ -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>