Skip to content

Commit

Permalink
Fix geosolutions-it#3360 - Refactor of binary build (geosolutions-it#…
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz authored Jan 21, 2019
1 parent 637e804 commit cbaf5b4
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 29 deletions.
18 changes: 16 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/bin/bash
#
# Builds MapStore2, doing all needed clean-ups tests and checks and adding documentation.
# You should use this script to generate a full valid MapStore2 package.
# Use the `release` profile to build also the binary package
#
# Usage:
# $ ./build.sh [version] [profiles]
# * version: The version for the final package
# * profiles: profiles for mvn build. (use `release` to build also the binary package)
#

set -e

echo "Running NPM install to update dependencies"
Expand Down Expand Up @@ -30,8 +41,11 @@ echo `date`
if [ $# -eq 0 ]
then
mvn clean install
else
mvn clean install -Dmapstore2.version=$1
elif [ $# -eq 1 ]
then
mvn clean install -Dmapstore2.version=$1
else
mvn clean install -Dmapstore2.version=$1 -P$2
fi

echo "Final Cleanup"
Expand Down
17 changes: 9 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
<version>1.0-SNAPSHOT</version>
<name>MapStore 2</name>
<url>http://www.geo-solutions.it</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>


<dependencies>


</dependencies>

<build>
</build>

<profiles>
<profile>
<id>default</id>
Expand All @@ -30,7 +30,7 @@
<modules>
<module>web</module>
</modules>

</profile>
<profile>
<id>release</id>
Expand All @@ -40,6 +40,7 @@
</property>
</activation>
<modules>
<module>web</module>
<module>release</module>
</modules>
</profile>
Expand Down
55 changes: 55 additions & 0 deletions release/bin-war/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<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>it.geosolutions.mapstore</groupId>
<artifactId>mapstore-bin-war</artifactId>
<packaging>war</packaging>
<version>${mapstore2.version}</version>
<name>MapStore 2 Release Module WAR</name>
<description>Creates the war for the binary package, adding customization (e.g. h2 database)</description>
<url>http://www.geo-solutions.it</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tomcat.version>7.0.75</tomcat.version>
<release.number>${project.version}</release.number>
</properties>

<dependencies>
<dependency>
<groupId>it.geosolutions.mapstore</groupId>
<artifactId>mapstore-web</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
<finalName>mapstore</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<overlays>
<overlay>
<groupId>it.geosolutions.mapstore</groupId>
<artifactId>mapstore-web</artifactId>
</overlay>
</overlays>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory -->
<directory>../data/</directory>
<!-- the list has a default value of ** -->
<includes>
<include>*.db</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</project>
14 changes: 3 additions & 11 deletions release/bin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,10 @@
<fileSets>
<fileSet>
<!-- the main webapp -->
<directory>../web/target/mapstore</directory>
<outputDirectory>mapstore2/webapps/mapstore</outputDirectory>
<directory>./bin-war/target/</directory>
<outputDirectory>mapstore2/webapps/</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet>
<!-- the main database -->
<directory>target</directory>
<outputDirectory>mapstore2/webapps/mapstore</outputDirectory>
<includes>
<include>geostore.h2.db</include>
<include>mapstore.war</include>
</includes>
</fileSet>
<fileSet>
Expand Down
Binary file modified release/data/geostore.h2.db
Binary file not shown.
15 changes: 8 additions & 7 deletions release/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<modelVersion>4.0.0</modelVersion>
<groupId>it.geosolutions.mapstore</groupId>
<artifactId>mapstore-bin-release</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<version>${mapstore2.version}</version>
<name>MapStore 2 Release Module</name>
<description>Project to create the binary package</description>
<url>http://www.geo-solutions.it</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tomcat.version>7.0.75</tomcat.version>
<release.number>${project.version}</release.number>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.tomcat</groupId>
Expand Down Expand Up @@ -91,7 +91,7 @@
<version>${tomcat.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand All @@ -118,8 +118,6 @@
<echo message="Untar JRE..." />
<gunzip src="${project.build.directory}/jre.tar.gz" dest="${project.build.directory}/jre.tar" />
<untar src="${project.build.directory}/jre.tar" dest="${project.build.directory}/jre" />
<echo message="Copy Database..." />
<copyfile src="data/geostore.h2.db" dest="${project.build.directory}/geostore.h2.db" />
</tasks>
</configuration>
<goals>
Expand Down Expand Up @@ -165,4 +163,7 @@
</plugin>
</plugins>
</build>
<modules>
<module>bin-war</module>
</modules>
</project>
2 changes: 1 addition & 1 deletion web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<artifactId>print-lib</artifactId>
<version>geosolutions-2.0-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-epsg-hsql</artifactId>
Expand Down

0 comments on commit cbaf5b4

Please sign in to comment.