Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
pom.xml 5.36 KiB
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>
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
    <groupId>eu.europa.ec.edelivery</groupId>
    <artifactId>smp-modules</artifactId>
    <version>5.1-SNAPSHOT</version>
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
    <relativePath>../pom.xml</relativePath>
  </parent>
  <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.13.0</node.version>
    <npm.version>8.19.3</npm.version -->
    <node.version>v16.20.0</node.version>
    <npm.version>8.19.4</npm.version>
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed

    <!--
    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
    -->
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
    <!--suppress UnresolvedMavenProperty -->
    <npm.path>${env.bamboo_CITNET_NODEJS_16_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>
      <id>defaultInstallNpm</id>
          <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>
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
              <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>
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
                <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>
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
                <configuration>
                  <arguments>
                    <argument>${npm.path}/npm</argument>
                    <argument>run-script</argument>
                    <argument>prod</argument>
                  </arguments>
                </configuration>

              </execution>
            </executions>
            <configuration>
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
              <executable>${npm.path}/node</executable>
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
            </configuration>
            <!--configuration>
              <executable>${npm.path}/node</executable>
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
                <argument>${npm.path}/npm</argument>
                <argument>run-script</argument>
                <argument>prod</argument>
              </arguments>
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
            </configuration-->
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>