This is an automated email from the ASF dual-hosted git repository.
sarankk pushed a commit to branch mutation-tracking-support
in repository https://gitbox.apache.org/repos/asf/cassandra-analytics.git
The following commit(s) were added to refs/heads/mutation-tracking-support by
this push:
new 1d2bc92d CASSANALYTICS-200: Update 6.0 dtest version to SHA from
cep-45-mutation-tracking branch (#247)
1d2bc92d is described below
commit 1d2bc92dba2f1a6211fd8c7cd776ce79e81f1870
Author: Saranya Krishnakumar <[email protected]>
AuthorDate: Tue Oct 6 16:57:07 2026 -0700
CASSANALYTICS-200: Update 6.0 dtest version to SHA from
cep-45-mutation-tracking branch (#247)
Patch by Saranya Krishnakumar; Reviewed by Bernardo Botella for
CASSANALYTICS-200
---
.circleci/config.yml | 6 +-
.github/workflows/test.yaml | 3 +-
CHANGES.txt | 1 +
DEV-README.md | 16 +++
.../apache/cassandra/bridge/CassandraVersion.java | 3 +
.../org/apache/cassandra/cdc/api/CommitLog.java | 4 +
.../cassandra/spark/bulkwriter/SSTables.java | 2 +
.../spark/bulkwriter/SortedSSTableWriterTest.java | 6 +-
.../build.gradle | 4 +
.../main/java/org/apache/cassandra/db/DbUtils.java | 7 +-
.../bridge/SSTableWriterImplementationTest.java | 2 +-
cassandra-six-zero/build.gradle | 30 +++++
gradle.properties | 8 +-
scripts/build-dtest-jars.sh | 18 ++-
scripts/install-cassandra-all-local.sh | 141 +++++++++++++++++++++
15 files changed, 237 insertions(+), 14 deletions(-)
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 02564dfc..1788e4b2 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -173,9 +173,10 @@ jobs:
JDK_VERSION: "11"
SPARK_VERSION: "3"
SCALA_VERSION: "2.12"
- # No downstream job of this one tests Cassandra 6.0, so skip its
dtest jar build
+ # Even though no downstream job of this one tests Cassandra 6.0,
we need to build the jar as six-zero
+ # module is also compiled
# (build-dtest-jars.sh reads this var to filter
CANDIDATE_BRANCHES).
- BRANCHES: "cassandra-4.0 cassandra-4.1 cassandra-5.0"
+ BRANCHES: "cassandra-4.0 cassandra-4.1 cassandra-5.0 cassandra-6.0"
command: |
./scripts/build-dependencies.sh
./gradlew --no-daemon --max-workers=2 codeCheckTasks
@@ -204,7 +205,6 @@ jobs:
SCALA_VERSION: "2.13"
# JDK17 only targets Cassandra 5.0+; skip 4.0 / 4.1 dtest jar
builds
# (build-dtest-jars.sh reads this var to filter
CANDIDATE_BRANCHES).
- # Only the Spark 4 matrix tests Cassandra 6.0, so its dtest jar is
built here and nowhere else.
BRANCHES: "cassandra-5.0 cassandra-6.0"
command: |
./scripts/build-dependencies.sh
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 2bc40c45..76391d42 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -116,8 +116,7 @@ jobs:
export SPARK_VERSION="4"
export SCALA_VERSION="2.13"
# JDK17 only targets Cassandra 5.0+; skip 4.0 / 4.1 dtest jar builds
- # (build-dtest-jars.sh reads this var to filter CANDIDATE_BRANCHES).
- export BRANCHES="cassandra-5.0"
+ export BRANCHES="cassandra-5.0 cassandra-6.0"
./scripts/build-dependencies.sh
diff --git a/CHANGES.txt b/CHANGES.txt
index dbb7415e..16f9ff38 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,6 @@
0.5.0
-----
+ * Update 6.0 dtest version to SHA from cep-45-mutation-tracking branch
(CASSANALYTICS-200)
* Parse <replicas>/<transient> replication factor for witness-enabled
keyspaces (CASSANALYTICS-194)
* Determine whether mutation tracking is enabled for keyspace for bulk writes
(CASSANALYTICS-160)
* Upgrade sidecar version to 0.4.0
diff --git a/DEV-README.md b/DEV-README.md
index a973174c..872dc9b0 100644
--- a/DEV-README.md
+++ b/DEV-README.md
@@ -50,6 +50,22 @@ SKIP_DTEST_JAR_BUILD=true SKIP_SIDECAR_BUILD=true
./scripts/build-dependencies.s
Note that `build-dependencies.sh` attempts to pull the latest from branches
specified in the `BRANCHES` environment
variable for Cassandra dtest jars, and trunk for the sidecar.
+### Locally built `cassandra-all`
+
+For integration testing from a commit in Cassandra, a dtest jar built from the
commit only replaces Cassandra on server
+side, the tests run against; the read/write bridges are compiled against the
`cassandra-all` artifacts named by
+`cassandra40Version`/`cassandra50Version`/`cassandra60Version` in
`gradle.properties`. When dtest jar is pinned to a commit
+that changes for e.g. the SSTable format, the SSTables the bulk writer
produces can no longer be imported into cluster under test.
+
+`build-dtest-jars.sh` therefore also builds and installs `cassandra-all` for
the branches listed in
+`CASSANDRA_ALL_BRANCHES` (`cassandra-6.0`), into the `dependencies` directory,
using the version string
+from `gradle.properties`. Nothing is installed while that version matches the
branch's own `base.version`, because the
+release on Maven Central is then the right artifact. To skip the extra build:
+
+```shell
+SKIP_CASSANDRA_ALL_BUILD=true ./scripts/build-dependencies.sh
+```
+
## Building
Once you've built the dependencies, you're ready to build the analytics
project.
diff --git
a/cassandra-analytics-common/src/main/java/org/apache/cassandra/bridge/CassandraVersion.java
b/cassandra-analytics-common/src/main/java/org/apache/cassandra/bridge/CassandraVersion.java
index bdeab3c1..c5dd7913 100644
---
a/cassandra-analytics-common/src/main/java/org/apache/cassandra/bridge/CassandraVersion.java
+++
b/cassandra-analytics-common/src/main/java/org/apache/cassandra/bridge/CassandraVersion.java
@@ -79,6 +79,9 @@ public enum CassandraVersion
// Cassandra 6.0 native sstable versions
"big-pa",
"bti-ea",
+ // Version introduced with MT
+ "big-pb",
+ "bti-eb",
}, 40);
private final int number;
diff --git
a/cassandra-analytics-common/src/main/java/org/apache/cassandra/cdc/api/CommitLog.java
b/cassandra-analytics-common/src/main/java/org/apache/cassandra/cdc/api/CommitLog.java
index 8a654100..52282c2c 100644
---
a/cassandra-analytics-common/src/main/java/org/apache/cassandra/cdc/api/CommitLog.java
+++
b/cassandra-analytics-common/src/main/java/org/apache/cassandra/cdc/api/CommitLog.java
@@ -71,6 +71,10 @@ public interface CommitLog extends Closeable, CassandraFile,
Comparable<CommitLo
case 9:
messagingVersion = 14;
break;
+ case 10:
+ // introduced with MT branch
+ messagingVersion = 15;
+ break;
default:
throw new IllegalStateException("Unknown commitlog
version " + version);
}
diff --git
a/cassandra-analytics-core/src/test/java/org/apache/cassandra/spark/bulkwriter/SSTables.java
b/cassandra-analytics-core/src/test/java/org/apache/cassandra/spark/bulkwriter/SSTables.java
index c9bc6786..93054979 100644
---
a/cassandra-analytics-core/src/test/java/org/apache/cassandra/spark/bulkwriter/SSTables.java
+++
b/cassandra-analytics-core/src/test/java/org/apache/cassandra/spark/bulkwriter/SSTables.java
@@ -59,7 +59,9 @@ public final class SSTables
.put("da", new CassandraVersionFeatures(50, 0, null))
.put("oa", new CassandraVersionFeatures(50, 0, null))
.put("ea", new CassandraVersionFeatures(60, 0, null))
+ .put("eb", new CassandraVersionFeatures(60, 0, null))
.put("pa", new CassandraVersionFeatures(60, 0, null))
+ .put("pb", new CassandraVersionFeatures(60, 0, null))
.build();
private SSTables()
diff --git
a/cassandra-analytics-core/src/test/java/org/apache/cassandra/spark/bulkwriter/SortedSSTableWriterTest.java
b/cassandra-analytics-core/src/test/java/org/apache/cassandra/spark/bulkwriter/SortedSSTableWriterTest.java
index fe692661..f94069eb 100644
---
a/cassandra-analytics-core/src/test/java/org/apache/cassandra/spark/bulkwriter/SortedSSTableWriterTest.java
+++
b/cassandra-analytics-core/src/test/java/org/apache/cassandra/spark/bulkwriter/SortedSSTableWriterTest.java
@@ -139,14 +139,14 @@ public class SortedSSTableWriterTest
}
break;
case 60:
- // Format is "pa-<generation>-big" or "ea-<generation>-bti"
+ // Format is "pb-<generation>-big" or "eb-<generation>-bti"
from MT branch
if ("big".equals(CassandraVersion.configuredSSTableFormat()))
{
- assertThat(baseFileName).matches("pa-\\d+-big");
+ assertThat(baseFileName).matches("pb-\\d+-big");
}
else
{
- assertThat(baseFileName).matches("ea-\\d+-bti");
+ assertThat(baseFileName).matches("eb-\\d+-bti");
}
break;
default:
diff --git a/cassandra-analytics-integration-framework/build.gradle
b/cassandra-analytics-integration-framework/build.gradle
index 7c97cb3b..0de9169e 100644
--- a/cassandra-analytics-integration-framework/build.gradle
+++ b/cassandra-analytics-integration-framework/build.gradle
@@ -89,6 +89,10 @@ dependencies {
// kafka-avro-serializer is only needed when sidecar publishes CDC
events to a
// Schema-Registry-backed Kafka topic, which our in-jvm integration
tests do not exercise.
exclude(group: 'io.confluent')
+ // Sidecar pulls in a published cassandra-analytics-core whose
_spark<N>_<scala> artifactId
+ // does not match project.name, so Gradle cannot dedupe it against the
local project and a
+ // stale copy of every class lingers on the classpath.
+ exclude(group: 'org.apache.cassandra', module:
'cassandra-analytics-core_spark3_2.12')
}
api(group: 'org.apache.cassandra', name: 'sidecar-server-common', version:
"${sidecarVersion}")
}
diff --git
a/cassandra-six-zero-bridge/src/main/java/org/apache/cassandra/db/DbUtils.java
b/cassandra-six-zero-bridge/src/main/java/org/apache/cassandra/db/DbUtils.java
index c1fa02da..4d0eef5b 100644
---
a/cassandra-six-zero-bridge/src/main/java/org/apache/cassandra/db/DbUtils.java
+++
b/cassandra-six-zero-bridge/src/main/java/org/apache/cassandra/db/DbUtils.java
@@ -40,13 +40,14 @@ public class DbUtils
}
/**
- * Cassandra 6.0 drops the {@code nowInSeconds} argument of {@code
LivenessInfo.create}, which 5.0
- * discarded. The parameter stays here so that callers are the same across
bridge versions.
+ * Cassandra 6.0 drops the {@code nowInSeconds} argument of {@code
LivenessInfo.create}, but the
+ * cep-45-mutation-tracking branch is yet to be updated with this change,
so the two-argument form is still the only
+ * one on the classpath. Switch to {@code create(timestamp)} once the pin
moves past that change.
*/
@VisibleForTesting
public static LivenessInfo livenessInfo(long timestamp, long nowInSeconds)
{
- return LivenessInfo.create(timestamp);
+ return LivenessInfo.create(timestamp, nowInSeconds);
}
@VisibleForTesting
diff --git
a/cassandra-six-zero-bridge/src/test/java/org/apache/cassandra/bridge/SSTableWriterImplementationTest.java
b/cassandra-six-zero-bridge/src/test/java/org/apache/cassandra/bridge/SSTableWriterImplementationTest.java
index 8dba1acf..a89bc2fd 100644
---
a/cassandra-six-zero-bridge/src/test/java/org/apache/cassandra/bridge/SSTableWriterImplementationTest.java
+++
b/cassandra-six-zero-bridge/src/test/java/org/apache/cassandra/bridge/SSTableWriterImplementationTest.java
@@ -105,7 +105,7 @@ class SSTableWriterImplementationTest
String sstableFormat = format.name();
assertThat(sstableFormat).containsAnyOf("big", "bti");
String sstableVersion = format.getLatestVersion().version;
- assertThat(sstableVersion).isEqualTo("bti".equals(sstableFormat) ?
"ea" : "pa");
+ assertThat(sstableVersion).isEqualTo("bti".equals(sstableFormat) ?
"eb" : "pb");
int firstGeneration = lowestGeneration(produced);
assertThat(produced.stream().map(e ->
e.baseFilename)).containsExactlyInAnyOrder(
toSStableFileName(sstableFormat, sstableVersion, firstGeneration),
diff --git a/cassandra-six-zero/build.gradle b/cassandra-six-zero/build.gradle
index 7c7ddab8..01593cae 100644
--- a/cassandra-six-zero/build.gradle
+++ b/cassandra-six-zero/build.gradle
@@ -24,7 +24,37 @@ plugins {
id('com.github.johnrengelman.shadow')
}
+// A cassandra-all built by scripts/install-cassandra-all-local.sh is served
only by the local
+// repository under dependencies/, not by Maven Central. Declaring that
exclusively keeps the
+// resolution independent of repository order, and avoids asking Central for a
version it cannot have.
+def locallyBuiltCassandraAll =
file("${rootProject.ext.dependencyLocation}org/apache/cassandra" +
+
"/cassandra-all/${cassandra60Version}/cassandra-all-${cassandra60Version}.pom")
+if (locallyBuiltCassandraAll.exists()) {
+ println("Using locally built cassandra-all ${cassandra60Version} from
${rootProject.ext.dependencyLocation}")
+ repositories {
+ exclusiveContent {
+ forRepository {
+ mavenLocal {
+ name = 'localCassandraBuild'
+ url = uri(rootProject.ext.dependencyLocation)
+ }
+ }
+ filter {
+ includeVersion('org.apache.cassandra', 'cassandra-all',
"${cassandra60Version}")
+ includeVersion('org.apache.cassandra', 'cassandra-parent',
"${cassandra60Version}")
+ // cassandra-all depends on cassandra-accord, which the accord
submodule publishes from the
+ // same commit and under the same version, so it is only in
the local repository.
+ includeVersion('org.apache.cassandra', 'cassandra-accord',
"${cassandra60Version}")
+ }
+ }
+ }
+}
+
dependencies {
+ // cassandra60Version points to a commit from cep-45 branch rather than a
Maven Central release, because the
+ // SSTables this bridge writes have to be readable by the cluster under
test. When that version cannot be resolved,
+ // run scripts/build-dependencies.sh (or
scripts/install-cassandra-all-local.sh) to build and install it - see
gradle.properties.
+ // JIRA https://issues.apache.org/jira/browse/CASSANDRA-21722
implementation(group: 'org.apache.cassandra', name: 'cassandra-all',
version: "$cassandra60Version") {
// Exclude JNA libraries from the cassandra-all dependency tree
because Spark has its own version
// and trying to load two different versions causes issues with the
native libraries
diff --git a/gradle.properties b/gradle.properties
index 203b809b..5e5f771e 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -23,7 +23,13 @@ description=Apache Cassandra Analytics
analyticsJDKLevel=17
cassandra40Version=4.0.17
cassandra50Version=5.0.7
-cassandra60Version=6.0-alpha2
+# The 6.0 dtest jar is pinned to a cep-45-mutation-tracking SHA
(scripts/build-dtest-jars.sh), which
+# bumped the SSTable format from big-pa to big-pb and from bti-ea to bti-eb.
The bulk writer has to
+# emit that format or injvm dtest cluster rejects its SSTables at import, so
cassandra-all is built
+# from the same commit by scripts/install-cassandra-all-local.sh and resolved
from dependencies/
+# Also note, the cep-45-mutation-tracking branch in C* has not yet been
updated with accord changes from trunk. Building
+# the bridge from the SHA is necessary for those reasons as well.
+cassandra60Version=6.0-alpha2.2af323f0
sidecarVersion=0.4.0
intellijVersion=9.0.4
junitVersion=5.10.2
diff --git a/scripts/build-dtest-jars.sh b/scripts/build-dtest-jars.sh
index 9757c668..8640ab86 100755
--- a/scripts/build-dtest-jars.sh
+++ b/scripts/build-dtest-jars.sh
@@ -46,9 +46,17 @@ else
"cassandra-4.0:cassandra-4.0.17"
"cassandra-4.1:99d9faeef57c9cf5240d11eac9db5b283e45a4f9"
"cassandra-5.0:cassandra-5.0.7"
- "cassandra-6.0:cassandra-6.0-alpha2"
+ # switch to latest SHA from cep-45-mutation-tracking branch for MT/Witness
testing
+ "cassandra-6.0:2af323f09d4ed324d36e6fcf20604d789fb5a99a"
)
BRANCHES=( ${BRANCHES:-cassandra-4.0 cassandra-4.1 cassandra-5.0
cassandra-6.0} )
+ # Branches whose cassandra-all artifact is also built from the pinned
commit-ish and installed
+ # locally. A dtest jar only replaces the server side, for e.g. a pin that
changes the SSTable format also
+ # needs the writer bridge built from the same commit, or the SSTables the
bulk writer produces cannot be imported
+ # by the cluster under test. The install is a no-op while gradle.properties
still points at a released version -
+ # see scripts/install-cassandra-all-local.sh and cassandra60Version in
gradle.properties. Set
+ # SKIP_CASSANDRA_ALL_BUILD=true to opt out.
+ CASSANDRA_ALL_BRANCHES=( ${CASSANDRA_ALL_BRANCHES:-cassandra-6.0} )
echo ${BRANCHES[*]}
REPO=${REPO:-"https://github.com/apache/cassandra.git"}
SCRIPT_DIR=$( dirname -- "$( readlink -f -- "$0"; )"; )
@@ -59,6 +67,7 @@ else
if [[ "$CLEAN" == "true" ]]; then
echo "Clean up $DTEST_JAR_DIR"
rm -rf "$DTEST_JAR_DIR/cassandra-build"
+ rm -rf "$DTEST_JAR_DIR/org"
rm "$DTEST_JAR_DIR"/dtest*.jar
exit 0
fi
@@ -125,6 +134,13 @@ exit 0
echo "Build failed with exit code: ${RETURN}"
exit ${RETURN}
fi
+
+ # Build the writer side from the same commit-ish for branches that need
it. Runs while the source
+ # tree is still checked out, and does nothing unless gradle.properties
asks for a version that is
+ # not the released one.
+ if [[ "${CASSANDRA_ALL_BRANCHES[*]}" =~ ${branch} ]] && [
"${SKIP_CASSANDRA_ALL_BUILD}" != "true" ]; then
+ "${SCRIPT_DIR}/install-cassandra-all-local.sh" "$(pwd)" "${branch}"
"${DTEST_JAR_DIR}"
+ fi
done
# always delete the Cassandra source after dtest.jar is built to avoid
confusing IDE
rm -rf "$DTEST_JAR_DIR/cassandra-build"
diff --git a/scripts/install-cassandra-all-local.sh
b/scripts/install-cassandra-all-local.sh
new file mode 100755
index 00000000..efffcf86
--- /dev/null
+++ b/scripts/install-cassandra-all-local.sh
@@ -0,0 +1,141 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Builds cassandra-all from an already checked-out Cassandra source tree and
installs it into a
+# local Maven repository, so that the bulk-writer bridge (for e.g.
cassandra-six-zero) is compiled against
+# the same Cassandra code that the pinned in-JVM dtest cluster runs.
+#
+# Why this is needed: build-dtest-jars.sh can pin a commit-ish that is not a
released tag (currently
+# a cep-45-mutation-tracking SHA for cassandra-6.0). The dtest jar only
replaces the server side -
+# the bridge keeps compiling against the released cassandra-all from Maven
Central. That is fine for
+# server-only changes, but not when the pinned commit changes for e.g. SSTable
format: the writer then
+# produces SSTables the server refuses to open and bulk-write integration test
fails at
+# SSTable import (500).
+#
+# Usage: install-cassandra-all-local.sh <cassandra-source-dir> <branch>
<local-maven-repo-dir>
+#
+# The version to install is read from gradle.properties
(cassandra<major><minor>Version), so what
+# gets installed is by construction what Gradle asks for. Nothing is installed
while that property
+# still matches the source tree's own base.version, because the release on
Maven Central is then the
+# right artifact to use.
+
+set -xe
+
+SRC_DIR="$1"
+BRANCH="$2"
+LOCAL_REPO="$3"
+
+if [ -z "${SRC_DIR}" ] || [ -z "${BRANCH}" ] || [ -z "${LOCAL_REPO}" ]; then
+ echo "Usage: $0 <cassandra-source-dir> <branch> <local-maven-repo-dir>"
+ exit 1
+fi
+
+SCRIPT_DIR=$( dirname -- "$( readlink -f -- "$0"; )"; )
+ROOT_DIR=$( dirname "${SCRIPT_DIR}" )
+
+# cassandra-6.0 -> cassandra60Version
+VERSION_PROPERTY="cassandra$(echo "${BRANCH}" | sed -e 's/^cassandra-//' -e
's/\.//g')Version"
+CONFIGURED_VERSION=$(grep -E "^${VERSION_PROPERTY}="
"${ROOT_DIR}/gradle.properties" | head -1 | cut -d'=' -f2 | tr -d '[:space:]')
+
+if [ -z "${CONFIGURED_VERSION}" ]; then
+ echo "Could not read ${VERSION_PROPERTY} from ${ROOT_DIR}/gradle.properties"
+ exit 1
+fi
+
+cd "${SRC_DIR}"
+BASE_VERSION=$(cat build.xml | grep 'property name="base.version"' | awk -F
"\"" '{print $4}')
+
+if [ "${CONFIGURED_VERSION}" == "${BASE_VERSION}" ]; then
+ echo "${VERSION_PROPERTY}=${CONFIGURED_VERSION} matches base.version of
$(pwd); the released"
+ echo "cassandra-all from Maven Central is the artifact to use, nothing to
install."
+ exit 0
+fi
+
+ARTIFACT_DIR="${LOCAL_REPO}/org/apache/cassandra/cassandra-all/${CONFIGURED_VERSION}"
+
+# 'ant mvn-install' installs into ~/.m2; copy the artifacts over so they land
in the repository
+# Gradle reads (see the mavenLocal block in build.gradle, whose url is the
dependencies directory).
+# cassandra-parent is copied as well because the cassandra-all pom names it as
its parent, and Gradle
+# has to resolve that pom too; cassandra-accord because the cassandra-all pom
depends on it and the
+# accord submodule publishes it from the same commit (build.xml leaves it to
the submodule build).
+copy_artifacts_from_m2() {
+ for artifact in cassandra-all cassandra-parent cassandra-accord; do
+ if [ ! -f
"${LOCAL_REPO}/org/apache/cassandra/${artifact}/${CONFIGURED_VERSION}/${artifact}-${CONFIGURED_VERSION}.pom"
]; then
+
installed="${HOME}/.m2/repository/org/apache/cassandra/${artifact}/${CONFIGURED_VERSION}"
+ if [ -d "${installed}" ]; then
+ mkdir -p "${LOCAL_REPO}/org/apache/cassandra/${artifact}"
+ cp -R "${installed}" "${LOCAL_REPO}/org/apache/cassandra/${artifact}/"
+ fi
+ fi
+ done
+}
+
+# A previous run may have installed cassandra-all without every artifact the
pom pulls in, so top the
+# copy up before deciding there is nothing left to do.
+copy_artifacts_from_m2
+
+if [ -f "${ARTIFACT_DIR}/cassandra-all-${CONFIGURED_VERSION}.jar" ]; then
+ echo "cassandra-all ${CONFIGURED_VERSION} is already installed in
${LOCAL_REPO}"
+ exit 0
+fi
+
+# Overriding base.version keeps the build self-consistent: the jar name, the
generated poms and the
+# installed coordinates all carry ${CONFIGURED_VERSION}, so no pom has to be
rewritten afterwards.
+# Keep the build qualifier dot-separated (6.0-alpha2.<sha>, not
6.0-alpha2-<sha>) - a second dash
+# does not parse as a Cassandra release version.
+# local.repository is deliberately left at its default (~/.m2/repository):
build.xml reads artifacts
+# back out of it (e.g. it unzips the jacoco agent from
+# ${local.repository}/org/jacoco/org.jacoco.agent) while
maven-resolver-ant-tasks writes them to
+# ~/.m2/repository regardless of that property, so pointing it at
${LOCAL_REPO} fails the build.
+# The copy step below moves the installed artifacts into ${LOCAL_REPO} instead.
+# release=true is what makes build.xml use ${base.version} verbatim as the
artifact version; without
+# it the build appends -SNAPSHOT and the installed coordinates no longer match
the version Gradle
+# asks for.
+ant mvn-install -Dbase.version="${CONFIGURED_VERSION}" \
+ -Drelease=true \
+ -Dno-checkstyle=true \
+ -Dno-javadoc=true \
+ -Dant.gen-doc.skip=true \
+ ${CASSANDRA_ANT_FLAGS}
+
+copy_artifacts_from_m2
+
+if [ ! -f "${ARTIFACT_DIR}/cassandra-all-${CONFIGURED_VERSION}.jar" ]; then
+ echo "cassandra-all ${CONFIGURED_VERSION} did not end up in ${LOCAL_REPO}."
+ echo "Read the 'ant mvn-install' output above; to finish by hand:"
+ echo " cd ${SRC_DIR}"
+ echo " ant mvn-install -Dbase.version=${CONFIGURED_VERSION}"
+ echo " mkdir -p ${LOCAL_REPO}/org/apache/cassandra/cassandra-all"
+ echo " cp -R
~/.m2/repository/org/apache/cassandra/cassandra-all/${CONFIGURED_VERSION} \\"
+ echo " ${LOCAL_REPO}/org/apache/cassandra/cassandra-all/"
+ exit 1
+fi
+
+# A cassandra-all pom that declares a parent is unresolvable without that
parent pom, and the parent
+# is not on Maven Central for a version built here.
+if grep -q '<parent>'
"${ARTIFACT_DIR}/cassandra-all-${CONFIGURED_VERSION}.pom" 2>/dev/null &&
+ [ ! -f
"${LOCAL_REPO}/org/apache/cassandra/cassandra-parent/${CONFIGURED_VERSION}/cassandra-parent-${CONFIGURED_VERSION}.pom"
]; then
+ echo "WARNING: cassandra-all-${CONFIGURED_VERSION}.pom declares a parent,
but"
+ echo "cassandra-parent-${CONFIGURED_VERSION}.pom is not in ${LOCAL_REPO};
Gradle will fail to"
+ echo "resolve the module. Install the parent pom from the build as well,
e.g.:"
+ echo " cd ${SRC_DIR} && ant mvn-install
-Dbase.version=${CONFIGURED_VERSION}"
+ echo " cp -R
~/.m2/repository/org/apache/cassandra/cassandra-parent/${CONFIGURED_VERSION} \\"
+ echo " ${LOCAL_REPO}/org/apache/cassandra/cassandra-parent/"
+fi
+
+echo "Installed cassandra-all ${CONFIGURED_VERSION} (built from $(git
rev-parse HEAD 2>/dev/null || echo unknown)) into ${LOCAL_REPO}"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]