che-server/assembly-multiuser/dashboard/pom.xml

215 lines
9.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012-2017 Codenvy, S.A.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Codenvy, S.A. - initial API and implementation
-->
<!-- Copyright (c) 2012-2016 Codenvy, S.A. All rights reserved. This program
and the accompanying materials are made available under the terms of the
Eclipse Public License v1.0 which accompanies this distribution, and is available
at http://www.eclipse.org/legal/epl-v10.html Contributors: Codenvy, S.A.
- initial API and implementation -->
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>che-assembly-parent</artifactId>
<groupId>org.eclipse.che.assembly-multiuser</groupId>
<version>5.16.0-SNAPSHOT</version>
</parent>
<artifactId>che-dashboard-war</artifactId>
<packaging>war</packaging>
<name>Fabric8 IDE :: Che Dashboard WAR</name>
<properties>
<npm-build-root>${project.build.directory}/patched</npm-build-root>
<original-project-basedir>${original-project-name}</original-project-basedir>
<original-project-name>dashboard</original-project-name>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-commons-j2ee</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<finalName>dashboard-war</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source-for-patched-files</id>
<phase>generate-sources</phase>
</execution>
<execution>
<id>add-resource-for-patched-files</id>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-web-resources</id>
<phase>process-sources</phase>
</execution>
<execution>
<id>copy-src-components</id>
<phase>process-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>${project.build.directory}/patched/src/components</outputDirectory>
<resources>
<resource>
<directory>src/components</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-patch-plugin</artifactId>
<executions>
<execution>
<id>patch-sources</id>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${npm-build-root}/bower_components</directory>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${npm-build-root}/node_modules</directory>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${npm-build-root}/dist</directory>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>prepare-patch-files</id>
<phase>generate-sources</phase>
</execution>
<execution>
<id>copy-all-files</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="copy all original Che files">
<copy todir="${project.build.directory}/patched" verbose="true">
<fileset dir="../../dashboard">
<include name="e2e/**" />
<include name="gulp/**" />
<include name="src/**" />
<include name="*.json" />
<include name="*.js" />
<include name=".*" />
</fileset>
</copy>
</target>
</configuration>
</execution>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Download NPM dependencies -->
<exec dir="${npm-build-root}" executable="npm" failonerror="true">
<arg value="install" />
</exec>
<!-- Change base HREF of the application
that will be hosted on /dashboard -->
<replace file="${npm-build-root}/dist/index.html">
<replacetoken><![CDATA[<base href="/">]]></replacetoken>
<replacevalue><![CDATA[<base href="/dashboard/">]]></replacevalue>
</replace>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>${npm-build-root}/dist</directory>
</resource>
</webResources>
<webXml>${npm-build-root}/src/webapp/WEB-INF/web.xml</webXml>
<packagingExcludes>/webapp/</packagingExcludes>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>withoutKeycloak</id>
<activation>
<property>
<name>withoutKeycloak</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>Remove Keycloak Patches</id>
<phase>process-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="copy all original Che files">
<delete verbose="true">
<fileset dir="${project.build.directory}/prepared-patches">
<include name="*.patch" />
</fileset>
</delete>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>