Skip to content

Commit

Permalink
fix: missing pom.xml needed for build and cleaning some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesw committed Apr 18, 2023
1 parent 3df4d87 commit 04c1adb
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# war file builds
target/**
temp/**
src/**

# compiled output
/dist
/tmp
Expand Down
8 changes: 5 additions & 3 deletions build-wars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ sk-dir-make ~/log

for build_env in $build_envs;do
echo_log "building $build_env"
# set the version tag to be -${build_env}-${tag_numeric}
mvn versions:set -DnewVersion="${tag_numeric}" -DgenerateBackupPoms=false --activate-profiles ${build_env} -Dnodejs.workingDirectory=. --settings settings-custom.xml

build_log_file=~/log/orcid-angular-${build_env}-${tag_numeric}.log

echo_log "log file: $build_log_file"

# set the version tag to be -${build_env}-${tag_numeric}
mvn versions:set -DnewVersion="${tag_numeric}" -DgenerateBackupPoms=false --activate-profiles ${build_env} -Dnodejs.workingDirectory=. --settings settings-custom.xml -l $build_log_file

# perform the build
mvnd install --activate-profiles ${build_env} -Dnodejs.workingDirectory=. -DskipTest -l $build_log_file --settings settings-custom.xml

Expand Down
198 changes: 198 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
<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>
<groupId>org.orcid</groupId>
<artifactId>orcid-web-frontend-${buildEnv}</artifactId>
<packaging>war</packaging>
<name>ORCID - Web frontend</name>
<description>A web application the serves the Angular frontend of the ORCID Registry</description>
<version>2.0.1</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.basedir>${project.parent.basedir}</main.basedir>
<nodejs.workingDirectory>${env.HOME}/git/orcid-angular</nodejs.workingDirectory>
<buildEnv>prod</buildEnv>
<branchVersion>1.1.5-SNAPSHOT</branchVersion>
</properties>

<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>


<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>${tomcat.manager.url}</url>
<server>${tomcat.server.id}</server>
<path>${artifactID}</path>
<update>true</update>
</configuration>
</plugin>
<plugin>
<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.8.0</version>
<configuration>
<nodeVersion>v16.13.2</nodeVersion>
<yarnVersion>v1.19.1</yarnVersion>
<downloadRoot>https://nodejs.org/dist/</downloadRoot>
<workingDirectory>${nodejs.workingDirectory}</workingDirectory>
<installDirectory>temp</installDirectory>
</configuration>
<executions>
<execution>
<id>install node and yarn</id>
<goals>
<goal>install-node-and-yarn</goal>
</goals>
<phase>generate-resources</phase>
</execution>
<execution>
<id>yarn install</id>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>build</id>
<goals>
<goal>yarn</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<yarnInheritsProxyConfigFromMaven>false</yarnInheritsProxyConfigFromMaven>
<arguments>build:${buildEnv}</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>
<overwrite>true</overwrite>
<outputDirectory>${project.build.directory}/${project.artifactId}/</outputDirectory>
<resources>
<resource>
<directory>${nodejs.workingDirectory}/dist</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-to-src</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>${project.basedir}/src/main/webapp/</outputDirectory>
<resources>
<resource>
<directory>${nodejs.workingDirectory}/dist</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>prod</id>
<activation>
<property>
<name>env</name>
<value>prod</value>
</property>
</activation>
<properties>
<buildEnv>prod</buildEnv>
</properties>
</profile>
<profile>
<id>qa</id>
<activation>
<property>
<name>env</name>
<value>qa</value>
</property>
</activation>
<properties>
<buildEnv>qa</buildEnv>
</properties>
</profile>
<profile>
<id>sandbox</id>
<activation>
<property>
<name>env</name>
<value>sandbox</value>
</property>
</activation>
<properties>
<buildEnv>sandbox</buildEnv>
</properties>
</profile>
<profile>
<id>int</id>
<activation>
<property>
<name>env</name>
<value>int</value>
</property>
</activation>
<properties>
<buildEnv>int</buildEnv>
</properties>
</profile>
<profile>
<id>local</id>
<activation>
<property>
<name>env</name>
<value>local</value>
</property>
</activation>
<properties>
<buildEnv>local-tomcat</buildEnv>
</properties>
</profile>
</profiles>
</project>
4 changes: 4 additions & 0 deletions reset-temp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

rm -R temp

0 comments on commit 04c1adb

Please sign in to comment.