Modify maven for angular build
Using the same plugin that portal has been using
to perform angular cli builds in jenkins.
Also modifed maven assembly plugin to package the
generated angular javascript code into a deployable
zip file.
Change-Id: Ib26801ca6b4d8dd5195b570bc694d37efe421684
Signed-off-by: Patrick Brady <pb071s@att.com>
Issue-ID: APPC-627
diff --git a/pom.xml b/pom.xml
index 8ec1088..dd06451 100644
--- a/pom.xml
+++ b/pom.xml
@@ -117,60 +117,75 @@
</executions>
</plugin> -->
<plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.5.3</version>
+ <groupId>com.github.eirslett</groupId>
+ <artifactId>frontend-maven-plugin</artifactId>
+ <!-- Use the latest released version: https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
+ <version>1.3</version>
<configuration>
- <descriptors>
- <descriptor>src/main/assembly/assembly.xml</descriptor>
- </descriptors>
+ <nodeVersion>v7.7.4</nodeVersion>
+ <nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>
+ <npmDownloadRoot>https://nodejs.org/dist/npm/</npmDownloadRoot>
+ <installDirectory>./</installDirectory>
</configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.12</version>
<executions>
<execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
+ <id>install node and npm</id>
<goals>
- <goal>attach-artifact</goal>
+ <goal>install-node-and-npm</goal>
</goals>
+ <phase>generate-resources</phase>
+ </execution>
+
+ <execution>
+ <id>npm install</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+
+ <phase>generate-resources</phase>
+
<configuration>
- <artifacts>
- <artifact>
- <file>target/${project.artifactId}-${project.version}-zip.zip</file>
- <type>zip</type>
- </artifact>
- </artifacts>
+ <arguments>install</arguments>
</configuration>
</execution>
+
+ <execution>
+ <id>npm build</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+
+ <phase>generate-resources</phase>
+
+ <configuration>
+ <arguments>run build</arguments>
+ </configuration>
+ </execution>
+
</executions>
</plugin>
- <!-- <plugin> -->
- <!-- <groupId>org.apache.maven.plugins</groupId> -->
- <!-- <artifactId>maven-resources-plugin</artifactId> -->
- <!-- <version>2.4.2</version> -->
- <!-- <executions> -->
- <!-- <execution> -->
- <!-- <id>default-copy-resources</id> -->
- <!-- <phase>process-resources</phase> -->
- <!-- <goals> -->
- <!-- <goal>copy-resources</goal> -->
- <!-- </goals> -->
- <!-- <configuration> -->
- <!-- <format>zip</format> -->
- <!-- <overwrite>true</overwrite> -->
- <!-- <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/</outputDirectory> -->
- <!-- <resources> -->
- <!-- <resource> -->
- <!-- <directory>${project.basedir}/dist</directory> -->
- <!-- </resource> -->
- <!-- </resources> -->
- <!-- </configuration> -->
- <!-- </execution> -->
- <!-- </executions> -->
- <!-- </plugin> -->
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>maven-repo-zip</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <attach>false</attach>
+ <finalName>${project.artifactId}-${project.version}</finalName>
+ <descriptors>
+ <descriptor>assemble_dist_zip.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
</build>
<profiles>