Skip to content

Commit

Permalink
GEOMESA-3404 Provide BOM module (#3216)
Browse files Browse the repository at this point in the history
  • Loading branch information
elahrvivaz authored Oct 11, 2024
1 parent 58bec85 commit ff83fb0
Show file tree
Hide file tree
Showing 8 changed files with 635 additions and 10 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ geospatial analytics.
* [Main documentation](https://www.geomesa.org/documentation/)
* [Upgrade Guide](https://www.geomesa.org/documentation/user/upgrade.html)
* Quick Starts:
[HBase](https://www.geomesa.org/documentation/tutorials/geomesa-quickstart-hbase.html) |
[Accumulo](https://www.geomesa.org/documentation/tutorials/geomesa-quickstart-accumulo.html) |
[HBase](https://www.geomesa.org/documentation/tutorials/geomesa-quickstart-hbase.html) |
[Cassandra](https://www.geomesa.org/documentation/tutorials/geomesa-quickstart-cassandra.html) |
[Kafka](https://www.geomesa.org/documentation/tutorials/geomesa-quickstart-kafka.html) |
[Redis](https://www.geomesa.org/documentation/tutorials/geomesa-quickstart-redis.html) |
Expand All @@ -40,8 +40,8 @@ geospatial analytics.
**Current release: [5.1.0](https://github.com/locationtech/geomesa/releases/tag/geomesa-5.1.0)**

    
[**HBase**](https://github.com/locationtech/geomesa/releases/download/geomesa-5.1.0/geomesa-hbase_2.12-5.1.0-bin.tar.gz) |
[**Accumulo**](https://github.com/locationtech/geomesa/releases/download/geomesa-5.1.0/geomesa-accumulo_2.12-5.1.0-bin.tar.gz) |
[**HBase**](https://github.com/locationtech/geomesa/releases/download/geomesa-5.1.0/geomesa-hbase_2.12-5.1.0-bin.tar.gz) |
[**Cassandra**](https://github.com/locationtech/geomesa/releases/download/geomesa-5.1.0/geomesa-cassandra_2.12-5.1.0-bin.tar.gz) |
[**Kafka**](https://github.com/locationtech/geomesa/releases/download/geomesa-5.1.0/geomesa-kafka_2.12-5.1.0-bin.tar.gz) |
[**Redis**](https://github.com/locationtech/geomesa/releases/download/geomesa-5.1.0/geomesa-redis_2.12-5.1.0-bin.tar.gz) |
Expand Down Expand Up @@ -79,11 +79,27 @@ GeoMesa is hosted on Maven Central. To include it as a dependency, add the desir
```xml
<dependency>
<groupId>org.locationtech.geomesa</groupId>
<artifactId>geomesa-hbase-datastore_2.12</artifactId>
<artifactId>geomesa-accumulo-datastore_2.12</artifactId>
<version>5.1.0</version>
</dependency>
```

GeoMesa provides a bill-of-materials module, which can simplify version management:

```xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.locationtech.geomesa</groupId>
<artifactId>geomesa-bom_2.12</artifactId>
<version>5.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
```

GeoMesa depends on several third-party libraries that are only available in separate repositories. To include
GeoMesa in your project, add the following repositories to your pom:

Expand Down
22 changes: 19 additions & 3 deletions build/templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ geospatial analytics.
* [Main documentation](https://www.geomesa.org/documentation/)
* [Upgrade Guide](https://www.geomesa.org/documentation/user/upgrade.html)
* Quick Starts:
[HBase](https://www.geomesa.org/documentation/tutorials/geomesa-quickstart-hbase.html) |
[Accumulo](https://www.geomesa.org/documentation/tutorials/geomesa-quickstart-accumulo.html) |
[HBase](https://www.geomesa.org/documentation/tutorials/geomesa-quickstart-hbase.html) |
[Cassandra](https://www.geomesa.org/documentation/tutorials/geomesa-quickstart-cassandra.html) |
[Kafka](https://www.geomesa.org/documentation/tutorials/geomesa-quickstart-kafka.html) |
[Redis](https://www.geomesa.org/documentation/tutorials/geomesa-quickstart-redis.html) |
Expand All @@ -40,8 +40,8 @@ geospatial analytics.
**Current release: [${geomesa.release.version}](https://github.com/locationtech/geomesa/releases/tag/geomesa-${geomesa.release.version})**

&nbsp;&nbsp;&nbsp;&nbsp;
[**HBase**](https://github.com/locationtech/geomesa/releases/download/geomesa-${geomesa.release.version}/geomesa-hbase_${scala.binary.version}-${geomesa.release.version}-bin.tar.gz) |
[**Accumulo**](https://github.com/locationtech/geomesa/releases/download/geomesa-${geomesa.release.version}/geomesa-accumulo_${scala.binary.version}-${geomesa.release.version}-bin.tar.gz) |
[**HBase**](https://github.com/locationtech/geomesa/releases/download/geomesa-${geomesa.release.version}/geomesa-hbase_${scala.binary.version}-${geomesa.release.version}-bin.tar.gz) |
[**Cassandra**](https://github.com/locationtech/geomesa/releases/download/geomesa-${geomesa.release.version}/geomesa-cassandra_${scala.binary.version}-${geomesa.release.version}-bin.tar.gz) |
[**Kafka**](https://github.com/locationtech/geomesa/releases/download/geomesa-${geomesa.release.version}/geomesa-kafka_${scala.binary.version}-${geomesa.release.version}-bin.tar.gz) |
[**Redis**](https://github.com/locationtech/geomesa/releases/download/geomesa-${geomesa.release.version}/geomesa-redis_${scala.binary.version}-${geomesa.release.version}-bin.tar.gz) |
Expand Down Expand Up @@ -79,11 +79,27 @@ GeoMesa is hosted on Maven Central. To include it as a dependency, add the desir
```xml
<dependency>
<groupId>org.locationtech.geomesa</groupId>
<artifactId>geomesa-hbase-datastore_${scala.binary.version}</artifactId>
<artifactId>geomesa-accumulo-datastore_${scala.binary.version}</artifactId>
<version>${geomesa.release.version}</version>
</dependency>
```

GeoMesa provides a bill-of-materials module, which can simplify version management:

```xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.locationtech.geomesa</groupId>
<artifactId>geomesa-bom_${scala.binary.version}</artifactId>
<version>${geomesa.release.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
```

GeoMesa depends on several third-party libraries that are only available in separate repositories. To include
GeoMesa in your project, add the following repositories to your pom:

Expand Down
18 changes: 17 additions & 1 deletion docs/user/download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ repositories to your pom:
</repository>
</repositories>
and then include the desired ``geomesa-*`` dependencies:
and then include the desired GeoMesa dependencies:

.. parsed-literal::
Expand All @@ -58,6 +58,22 @@ and then include the desired ``geomesa-*`` dependencies:
<version>${geomesa.version}</version>
</dependency>
GeoMesa provides a bill-of-materials module, which can simplify version management:

.. code-block:: xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.locationtech.geomesa</groupId>
<artifactId>geomesa-bom_${scala.binary.version}</artifactId>
<version>${geomesa.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
For cutting-edge development, nightly snapshots are available from Eclipse:

.. code-block:: xml
Expand Down
4 changes: 2 additions & 2 deletions docs/user/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ User Manual
spark/index
nifi/index
process
hbase/index
accumulo/index
hbase/index
cassandra/index
postgis/index
kafka/index
redis/index
filesystem/index
postgis/index
lambda/index
ds_views
upgrade
Expand Down
2 changes: 1 addition & 1 deletion docs/user/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Installation

Installation instructions are available for each data store implementation:

* :doc:`/user/hbase/install`
* :doc:`/user/accumulo/install`
* :doc:`/user/hbase/install`
* :doc:`/user/cassandra/install`
* :doc:`/user/kafka/install`
* :doc:`/user/redis/install`
Expand Down
67 changes: 67 additions & 0 deletions geomesa-utils-parent/geomesa-bom/generate-pom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash
set -e
set -u
set -o pipefail

cd "$(dirname "$0")/../.." || exit

export LC_ALL=C # ensure stable sort order across different locales
POM="geomesa-utils-parent/geomesa-bom/pom.xml"

echo "Running maven build to generate installed artifact list"
deps=()
# mapfile reads the results into an array
# we get the list of artifacts from `mvn clean install` (seems to be only way...)
mapfile -t deps < <(
mvn clean install -DskipTests -Pzinc -B -T2C 2>&1 |
grep Installing | # pull out installed artifacts only
grep -v -e "\-sources\.jar$" -e "\.pom$" | # skip sources jars and poms
sed 's|.*\.m2/repository/org/locationtech/geomesa/||' | # strip line prefix
sed 's|\.|!|g' | # replace . with ! so that classifiers sort after regular artifact
sort | # sort artifacts
sed 's|!|.|g' # undo classifier sort hack
)

# truncate everything after the opening dependencyManagement
sed -i '/ <dependencyManagement>/q' "$POM"
echo -e " <dependencies>\n" >> "$POM"

function printDependency() {
local dep="$1"
# elements look like 'geomesa-utils_2.12/4.0.0-SNAPSHOT/geomesa-utils_2.12-4.0.0-SNAPSHOT.jar'
artifact="$(echo "$dep" | awk -F '/' '{ print $1 }')"
version="$(echo "$dep" | awk -F '/' '{ print $2 }')"
classifier=""
if ! [[ $dep =~ .*$artifact-$version.jar ]]; then
classifier=$'\n'" <classifier>$(echo "$dep" | sed -E 's/.*-([a-z]+)\.jar/\1/')</classifier>"
if [[ $classifier =~ test ]]; then
classifier="$classifier"$'\n'" <scope>test</scope>"
fi
fi
{
echo " <dependency>"
echo " <groupId>org.locationtech.geomesa</groupId>"
echo " <artifactId>${artifact%_*}_\${scala.binary.version}</artifactId>"
echo " <version>\${geomesa.version}</version>$classifier"
echo " </dependency>"
} | tee -a "$POM"
}

for dep in "${deps[@]}"; do
if ! [[ $dep =~ .*tests.jar ]]; then
printDependency "$dep"
fi
done

echo -e "\n <!-- test dependencies -->\n" | tee -a "$POM"

for dep in "${deps[@]}"; do
if [[ $dep =~ .*tests.jar ]]; then
printDependency "$dep"
fi
done

echo "
</dependencies>
</dependencyManagement>
</project>" >> "$POM"
Loading

0 comments on commit ff83fb0

Please sign in to comment.