Newer
Older
<?xml version="1.0" encoding="UTF-8"?>
<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>eu.europa.ec.edelivery</groupId>
<artifactId>smp-modules</artifactId>
<version>5.1-SNAPSHOT</version>
<artifactId>smp-angular</artifactId>
<packaging>jar</packaging>
<name>SMP Angular UI</name>
<properties>
<!-- Only selected modules are deployed -->
<maven.deploy.skip>false</maven.deploy.skip>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Currently last version not supported by the build server :(
node.version>v18.18.2</node.version>
<npm.version>9.8.1</npm.version -->
<node.version>v16.20.0</node.version>
<!--
set variable to force use of pre-installed npm-->
<!-- To build with preinstalled nodejs build with usePreInstalledNpm argument as example
(works only on linux for Windows update arguments in exec plugin below)
mvn clean install -DusePreInstalledNpm -Dnpm.path=/opt/programs/node-v14.17.0-linux-x64/bin
-->
<npm.path>${env.bamboo_CITNET_NODEJS_18_LINUX_PATH}</npm.path>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>./src/main/resources/META-INF/resources</directory>
<includes>
<include>**/*</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>defaultInstallNpm</id>
<activation>
<property>
<name>!usePreInstallNpm</name>
</property>
</activation>
<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>${node.version}</nodeVersion>
<npmVersion>${npm.version}</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install --unsafe-perm</arguments>
</configuration>
</execution>
<execution>
<id>prod</id>
<phase>generate-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run-script prod</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>usePreInstalledNpm</id>
<activation>
<property>
<name>usePreInstallNpm</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>npm install</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<arguments>
<argument>${npm.path}/npm</argument>
<argument>install</argument>
<argument>@angular/cli</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>angular build</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<arguments>
<argument>${npm.path}/npm</argument>
<argument>run-script</argument>
<argument>prod</argument>
</arguments>
</configuration>
</execution>
</executions>
<configuration>
</configuration>
<!--configuration>
<executable>${npm.path}/node</executable>
<arguments>
<argument>run-script</argument>
<argument>prod</argument>
</arguments>
</plugin>
</plugins>
</build>
</profile>
</profiles>