Skip to content

Commit a5f2442

Browse files
Feature/scala2.11 12 cross build (#193)
* Add scala 2.11 / scala 2.12 cross build * Fix foreachBatch ambiguity with Scala 2.12 * Force version of paranamer * Rename artefacts * Remove directory maven plugin as it assumes a project dir based on the artefact id * Fix archetype readme * Try matrix build script * Fix build name * Add cross compile info to readme * Fix readme
1 parent 86b1006 commit a5f2442

File tree

14 files changed

+120
-59
lines changed

14 files changed

+120
-59
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build
1+
name: Build
22

33
on:
44
pull_request:
@@ -7,12 +7,24 @@ on:
77
jobs:
88
build:
99
runs-on: ubuntu-latest
10-
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
scala: [ 2.11, 2.12 ]
14+
name: Scala ${{ matrix.scala }}, Spark 2.4
1115
steps:
1216
- uses: actions/checkout@v2
1317
- name: Set up JDK 1.8
1418
uses: actions/setup-java@v1
1519
with:
1620
java-version: 1.8
17-
- name: Run tests
18-
run: mvn clean test -Pall-tests
21+
- uses: actions/cache@v2
22+
with:
23+
path: ~/.m2/repository
24+
key: ${{ runner.os }}-${{ matrix.scala }}-${{ hashFiles('**/pom.xml') }}
25+
restore-keys: |
26+
${{ runner.os }}-${{ matrix.scala }}-
27+
- name: Switch scala version
28+
run: mvn scala-cross-build:change-version -Pscala-${{ matrix.scala }}
29+
- name: Build and run tests
30+
run: mvn clean test -Pscala-${{ matrix.scala }},all-tests

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,3 +356,22 @@ writer.kafka.schema.registry.url=${transformer.[avro.decoder].schema.registry.ur
356356
Hyperdrive ingestions may be triggered using the Workflow Manager, which is developed in a separate repository: https://github.com/AbsaOSS/hyperdrive-trigger
357357

358358
A key feature of the Workflow Manager are triggers, which define when an ingestion should be executed and how it should be requested. The workflow manager supports cron-based triggers as well as triggers that listen to a notification topic.
359+
360+
361+
## How to build
362+
- Scala 2.12 (default)
363+
```
364+
mvn clean install
365+
```
366+
- Scala 2.11
367+
```
368+
mvn scala-cross-build:change-version -Pscala-2.11
369+
mvn clean install -Pscala-2.11
370+
```
371+
372+
### E2E tests with Docker
373+
E2E tests require a running Docker instance on the executing machine and are not executed by default.
374+
To execute them, build using the profile `all-tests`
375+
```
376+
mvn clean test -Pall-tests
377+
```

api/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717

1818
<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/xsd/maven-4.0.0.xsd">
1919
<parent>
20-
<artifactId>parent-conf</artifactId>
20+
<artifactId>parent-conf_2.12</artifactId>
2121
<groupId>za.co.absa.hyperdrive</groupId>
2222
<version>4.1.1-SNAPSHOT</version>
2323
<relativePath>../parent-conf/pom.xml</relativePath>
2424
</parent>
2525
<modelVersion>4.0.0</modelVersion>
26-
<artifactId>api</artifactId>
26+
<artifactId>api_2.12</artifactId>
2727
<packaging>jar</packaging>
2828
</project>

component-archetype/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This is a Maven archetype for creating custom Hyperdrive components.
2525

2626
Download the artifact to your local maven repository
2727
```
28-
mvn dependency:get -Dartifact=za.co.absa.hyperdrive:component-archetype:4.0.0
28+
mvn dependency:get -Dartifact=za.co.absa.hyperdrive:component-archetype:4.2.0
2929
```
3030

3131
Update the local archetype catalog
@@ -37,8 +37,8 @@ Generate a skeleton project by executing the following command
3737
```
3838
mvn archetype:generate \
3939
-DarchetypeGroupId=za.co.absa.hyperdrive \
40-
-DarchetypeArtifactId=component-archetype \
41-
-DarchetypeVersion=4.0.0 \
40+
-DarchetypeArtifactId=component-archetype_2.12 \
41+
-DarchetypeVersion=4.2.0 \
4242
-DgroupId=<groupId> \
4343
-DartifactId=<artifactId> \
4444
-Dversion=<artifact-version>
@@ -47,6 +47,8 @@ mvn archetype:generate \
4747
- `<artifactId>` is the name for your artifact, e.g. mytransformer,
4848
- `<artifact-version>` is the version number of the artifact, e.g. 0.1.0-SNAPSHOT
4949

50+
Hint: For Scala 2.11, use `-DarchetypeArtifactId=component-archetype_2.11`.
51+
5052
## Implementing a Hyperdrive component
5153

5254
There are three types of Hyperdrive components: Reader, Transformer and Writer.

component-archetype/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616

1717
<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/xsd/maven-4.0.0.xsd">
1818
<parent>
19-
<artifactId>parent-conf</artifactId>
19+
<artifactId>parent-conf_2.12</artifactId>
2020
<groupId>za.co.absa.hyperdrive</groupId>
2121
<version>4.1.1-SNAPSHOT</version>
2222
<relativePath>../parent-conf/pom.xml</relativePath>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

26-
<artifactId>component-archetype</artifactId>
26+
<artifactId>component-archetype_2.12</artifactId>
2727
<packaging>maven-archetype</packaging>
2828

2929
<properties>

component-archetype/src/main/resources/archetype-resources/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<!-- Hyperdrive -->
5050
<dependency>
5151
<groupId>za.co.absa.hyperdrive</groupId>
52-
<artifactId>api</artifactId>
52+
<artifactId>api_\${scala.compat.version}</artifactId>
5353
<version>\${hyperdrive.version}</version>
5454
<scope>provided</scope>
5555
</dependency>

component-scanner/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616

1717
<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/xsd/maven-4.0.0.xsd">
1818
<parent>
19-
<artifactId>parent-conf</artifactId>
19+
<artifactId>parent-conf_2.12</artifactId>
2020
<groupId>za.co.absa.hyperdrive</groupId>
2121
<version>4.1.1-SNAPSHOT</version>
2222
<relativePath>../parent-conf/pom.xml</relativePath>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
25-
<artifactId>component-scanner</artifactId>
25+
<artifactId>component-scanner_2.12</artifactId>
2626
<packaging>jar</packaging>
2727

2828

2929
<dependencies>
3030
<dependency>
3131
<groupId>za.co.absa.hyperdrive</groupId>
32-
<artifactId>api</artifactId>
32+
<artifactId>api_${scala.compat.version}</artifactId>
3333
<version>4.1.1-SNAPSHOT</version>
3434
</dependency>
3535

driver/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,30 @@
1616

1717
<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/xsd/maven-4.0.0.xsd">
1818
<parent>
19-
<artifactId>parent-conf</artifactId>
19+
<artifactId>parent-conf_2.12</artifactId>
2020
<groupId>za.co.absa.hyperdrive</groupId>
2121
<version>4.1.1-SNAPSHOT</version>
2222
<relativePath>../parent-conf/pom.xml</relativePath>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

26-
<artifactId>driver</artifactId>
26+
<artifactId>driver_2.12</artifactId>
2727

2828
<dependencies>
2929
<!--Components from the project-->
3030
<dependency>
3131
<groupId>za.co.absa.hyperdrive</groupId>
32-
<artifactId>api</artifactId>
32+
<artifactId>api_${scala.compat.version}</artifactId>
3333
<version>${project.version}</version>
3434
</dependency>
3535
<dependency>
3636
<groupId>za.co.absa.hyperdrive</groupId>
37-
<artifactId>ingestor-default</artifactId>
37+
<artifactId>ingestor-default_${scala.compat.version}</artifactId>
3838
<version>${project.version}</version>
3939
</dependency>
4040
<dependency>
4141
<groupId>za.co.absa.hyperdrive</groupId>
42-
<artifactId>shared</artifactId>
42+
<artifactId>shared_${scala.compat.version}</artifactId>
4343
<version>${project.version}</version>
4444
</dependency>
4545

hyperdrive-release/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616

1717
<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/xsd/maven-4.0.0.xsd">
1818
<parent>
19-
<artifactId>parent-conf</artifactId>
19+
<artifactId>parent-conf_2.12</artifactId>
2020
<groupId>za.co.absa.hyperdrive</groupId>
2121
<version>4.1.1-SNAPSHOT</version>
2222
<relativePath>../parent-conf/pom.xml</relativePath>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

26-
<artifactId>hyperdrive-release</artifactId>
26+
<artifactId>hyperdrive-release_2.12</artifactId>
2727

2828
<dependencies>
2929
<dependency>
3030
<groupId>za.co.absa.hyperdrive</groupId>
31-
<artifactId>driver</artifactId>
31+
<artifactId>driver_${scala.compat.version}</artifactId>
3232
<version>${project.version}</version>
3333
</dependency>
3434
</dependencies>

ingestor-default/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@
1616

1717
<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/xsd/maven-4.0.0.xsd">
1818
<parent>
19-
<artifactId>parent-conf</artifactId>
19+
<artifactId>parent-conf_2.12</artifactId>
2020
<groupId>za.co.absa.hyperdrive</groupId>
2121
<version>4.1.1-SNAPSHOT</version>
2222
<relativePath>../parent-conf/pom.xml</relativePath>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

26-
<artifactId>ingestor-default</artifactId>
26+
<artifactId>ingestor-default_2.12</artifactId>
2727

2828
<dependencies>
2929
<!--Hyperdrive-->
3030
<dependency>
3131
<groupId>za.co.absa.hyperdrive</groupId>
32-
<artifactId>api</artifactId>
32+
<artifactId>api_${scala.compat.version}</artifactId>
3333
<version>${project.version}</version>
3434
</dependency>
3535
<dependency>
3636
<groupId>za.co.absa.hyperdrive</groupId>
37-
<artifactId>shared</artifactId>
37+
<artifactId>shared_${scala.compat.version}</artifactId>
3838
<version>${project.version}</version>
3939
</dependency>
4040

0 commit comments

Comments
 (0)