<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you 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.
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.apache.brooklyn</groupId>
    <artifactId>brooklyn-parent</artifactId>
    <version>1.1.0</version>
    <relativePath>../brooklyn-server/parent/</relativePath>
  </parent>
  <groupId>org.apache.brooklyn.ui</groupId>
  <artifactId>brooklyn-ui-parent</artifactId>
  <version>1.1.0</version>
  <packaging>pom</packaging>
  <name>Brooklyn UI :: Parent</name>
  <description>Angular JS UI for interacting with Brooklyn, using the REST API,
        with server-side multi-module support</description>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <mailingLists>
    <mailingList>
      <name>Brooklyn Developer List</name>
      <subscribe>dev-subscribe@brooklyn.apache.org</subscribe>
      <unsubscribe>dev-unsubscribe@brooklyn.apache.org</unsubscribe>
      <post>dev@brooklyn.apache.org</post>
      <archive>http://mail-archives.apache.org/mod_mbox/brooklyn-dev/</archive>
    </mailingList>
  </mailingLists>
  <modules>
    <module>modularity-server</module>
    <module>ui-modules</module>
    <module>features</module>
  </modules>
  <scm>
    <connection>scm:git:https://git-wip-us.apache.org/repos/asf/brooklyn-ui.git</connection>
    <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/brooklyn-ui.git</developerConnection>
    <url>https://git-wip-us.apache.org/repos/asf?p=brooklyn-ui.git</url>
  </scm>
  <issueManagement>
    <system>JIRA</system>
    <url>https://issues.apache.org/jira/browse/BROOKLYN</url>
  </issueManagement>
  <ciManagement>
    <system>Jenkins</system>
    <url>https://builds.apache.org/view/Brooklyn/job/brooklyn-ui-master/</url>
  </ciManagement>
  <properties>
    <maven-war-plugin.version>3.0.0</maven-war-plugin.version>
    <assertj.version>2.2.0</assertj.version>
    <maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
    <brooklyn.version>1.1.0</brooklyn.version>
    <maven-resources-plugin.version>3.0.1</maven-resources-plugin.version>
    <osgi.core.version>${org.osgi.core.version}</osgi.core.version>
    <brooklyn.ui.brand.dir>default</brooklyn.ui.brand.dir>
    <maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <revision>${brooklyn.ui.version}</revision>
    <pax-web-extender-whiteboard.version>${pax-web.version}</pax-web-extender-whiteboard.version>
    <build-helper-maven-plugin.version>1.10</build-helper-maven-plugin.version>
    <build.name>Apache Brooklyn</build.name>
    <npm.version>8.5.0</npm.version>
    <java.version>1.8</java.version>
    <build.version>brooklyn.ui.version</build.version>
    <brooklyn.ui.modules.version>${brooklyn.ui.version}</brooklyn.ui.modules.version>
    <frontend-maven-plugin.version>1.9.0</frontend-maven-plugin.version>
    <brooklyn.ui.version>${brooklyn.version}</brooklyn.ui.version>
    <buildnumber-maven-plugin.version>1.4</buildnumber-maven-plugin.version>
    <brooklyn.ui.modularity.version>${brooklyn.ui.version}</brooklyn.ui.modularity.version>
    <node.version>v16.14.2</node.version>
    <servlet-api.version>${javax-servlet.version}</servlet-api.version>
    <pax-web.version>7.3.9</pax-web.version>
  </properties>
  <repositories>
    <repository>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>apache-snapshots</id>
      <url>https://repository.apache.org/content/repositories/snapshots</url>
    </repository>
  </repositories>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.karaf.tooling</groupId>
          <artifactId>karaf-maven-plugin</artifactId>
          <version>${karaf.version}</version>
          <extensions>true</extensions>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${build-helper-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${maven-clean-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${maven-resources-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-war-plugin</artifactId>
          <version>${maven-war-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>${buildnumber-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>com.github.eirslett</groupId>
          <artifactId>frontend-maven-plugin</artifactId>
          <version>${frontend-maven-plugin.version}</version>
          <executions>
            <execution>
              <id>install node and npm</id>
              <phase>generate-resources</phase>
              <goals>
                <goal>install-node-and-npm</goal>
              </goals>
              <configuration>
                <nodeVersion>${node.version}</nodeVersion>
                <npmVersion>${npm.version}</npmVersion>
              </configuration>
            </execution>
            <execution>
              <id>npm install</id>
              <phase>generate-resources</phase>
              <goals>
                <goal>npm</goal>
              </goals>
              <configuration>
                <arguments>install</arguments>
              </configuration>
            </execution>
            <execution>
              <id>npm build</id>
              <phase>generate-resources</phase>
              <goals>
                <goal>npm</goal>
              </goals>
              <configuration>
                <arguments>run build</arguments>
                <environmentVariables>
                  <NODE_ENV>production</NODE_ENV>
                  <BROOKLYN_VERSION>${brooklyn.version}</BROOKLYN_VERSION>
                  <BUILD_VERSION>${build.version}</BUILD_VERSION>
                  <BUILD_NAME>${build.name}</BUILD_NAME>
                  <BUILD_BRANCH>${scmBranch}</BUILD_BRANCH>
                  <BUILD_COMMIT_ID>${buildNumber}</BUILD_COMMIT_ID>
                  <BROOKLYN_UI_BRAND_DIR>${brooklyn.ui.brand.dir}</BROOKLYN_UI_BRAND_DIR>
                </environmentVariables>
              </configuration>
            </execution>
            <execution>
              <id>npm test</id>
              <phase>test</phase>
              <goals>
                <goal>npm</goal>
              </goals>
              <configuration>
                <arguments>test</arguments>
                <environmentVariables>
                  <NODE_ENV>production</NODE_ENV>
                  <BROOKLYN_VERSION>${brooklyn.version}</BROOKLYN_VERSION>
                  <BUILD_VERSION>${build.version}</BUILD_VERSION>
                  <BUILD_NAME>${build.name}</BUILD_NAME>
                  <BUILD_BRANCH>${scmBranch}</BUILD_BRANCH>
                  <BUILD_COMMIT_ID>${buildNumber}</BUILD_COMMIT_ID>
                  <BROOKLYN_UI_BRAND_DIR>${brooklyn.ui.brand.dir}</BROOKLYN_UI_BRAND_DIR>
                </environmentVariables>
              </configuration>
            </execution>
          </executions>
          <configuration>
            <installDirectory>${session.executionRootDirectory}/target</installDirectory>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>flatten-maven-plugin</artifactId>
                    <versionRange>[1.0.1,)</versionRange>
                    <goals>
                      <goal>flatten</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <configuration>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>create</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <shortRevisionLength>7</shortRevisionLength>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <version>1.1.0</version>
        <executions>
          <execution>
            <id>flatten</id>
            <phase>process-resources</phase>
            <goals>
              <goal>flatten</goal>
            </goals>
          </execution>
          <execution>
            <id>flatten.clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <updatePomFile>true</updatePomFile>
          <flattenMode>resolveCiFriendliesOnly</flattenMode>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.12</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <consoleOutput>true</consoleOutput>
          <excludes combine.children="append">
            <exclude>**/node_modules/**</exclude>
            <exclude>**/dist/**</exclude>
            <exclude>**/.babelrc</exclude>
            <exclude>**/.mvn/jvm.config</exclude>
            <exclude>**/.m2/**</exclude>
            <exclude>**/.travis.yml</exclude>
            <exclude>**/test/fixtures/brooklyn-api/v1/**</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>clean-node</id>
      <activation>
        <property>
          <name>clean-node</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <configuration>
              <filesets>
                <fileset>
                  <directory>dist</directory>
                  <followSymlinks>false</followSymlinks>
                </fileset>
                <fileset>
                  <directory>bower_components</directory>
                  <followSymlinks>false</followSymlinks>
                </fileset>
                <fileset>
                  <directory>node_modules</directory>
                  <followSymlinks>false</followSymlinks>
                </fileset>
              </filesets>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>skip-npm-install</id>
      <activation>
        <property>
          <name>skipNpmInstall</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>com.github.eirslett</groupId>
              <artifactId>frontend-maven-plugin</artifactId>
              <executions>
                <execution>
                  <id>npm install</id>
                  <phase>none</phase>
                  <goals>
                    <goal>install-node-and-npm</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>windows-npm-install-fix</id>
      <activation>
        <os>
          <family>windows</family>
        </os>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>com.github.eirslett</groupId>
              <artifactId>frontend-maven-plugin</artifactId>
              <executions>
                <execution>
                  <id>npm install</id>
                  <phase>generate-resources</phase>
                  <goals>
                    <goal>npm</goal>
                  </goals>
                  <configuration>
                    <arguments>install --force</arguments>
                  </configuration>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>
</project>
