Skip to content

Commit 5097722

Browse files
committed
Added module that doesn't compile or test by default
Original approach would have caused an issue when releasing as version would not get incremented in module.
1 parent 9704244 commit 5097722

File tree

4 files changed

+41
-47
lines changed

4 files changed

+41
-47
lines changed

.github/workflows/test-lang-java.yml

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,13 @@ jobs:
7575
run: ./build.sh lint
7676

7777
- name: Test
78+
if: matrix.java < 17
7879
run: ./build.sh test
7980

81+
- name: Test Java >= 17
82+
if: matrix.java >= 17
83+
run: ./build.sh testJava17
84+
8085
interop:
8186
name: Java ${{ matrix.java }} Interop
8287
runs-on: ubuntu-latest
@@ -149,42 +154,3 @@ jobs:
149154
- name: Run Interop Tests
150155
working-directory: lang/java/ipc
151156
run: mvn -B test -P interop-data-test
152-
153-
testJava17:
154-
name: Java ${{ matrix.java }} Test
155-
runs-on: ubuntu-latest
156-
strategy:
157-
matrix:
158-
java:
159-
- '17'
160-
- '18'
161-
- '19'
162-
steps:
163-
- uses: actions/checkout@v2
164-
165-
- name: Cache Local Maven Repository
166-
uses: actions/cache@v2
167-
with:
168-
path: ~/.m2/repository
169-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
170-
restore-keys: |
171-
${{ runner.os }}-maven-
172-
173-
- name: Setup Temurin JDK
174-
if: matrix.java == '17'
175-
uses: actions/setup-java@v2
176-
with:
177-
distribution: 'temurin'
178-
java-version: ${{ matrix.java }}
179-
180-
- name: Setup Oracle JDK
181-
if: matrix.java == '18' || matrix.java == '19'
182-
uses: oracle-actions/setup-java@v1
183-
with:
184-
website: jdk.java.net
185-
release: ${{ matrix.java }}
186-
version: latest
187-
188-
- name: Run Interop Tests
189-
working-directory: lang/java
190-
run: mvn -B test -P java17

lang/java/build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
set -e
1919

2020
usage() {
21-
echo "Usage: $0 {lint|test|dist|clean}"
21+
echo "Usage: $0 {lint|test|testJava17|dist|clean}"
2222
exit 1
2323
}
2424

@@ -35,6 +35,11 @@ main() {
3535
# Test the modules that depend on hadoop using Hadoop 2
3636
mvn -B test -Phadoop2
3737
;;
38+
testJava17)
39+
mvn -DdisableJava17=false -B test
40+
# Test the modules that depend on hadoop using Hadoop 2
41+
mvn -B test -Phadoop2
42+
;;
3843
dist)
3944
mvn -P dist package -DskipTests javadoc:aggregate
4045
;;

lang/java/java17-test/pom.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
<maven.compiler.target>17</maven.compiler.target>
3737
<maven.compiler.source>17</maven.compiler.source>
3838
<main.basedir>${project.parent.parent.basedir}</main.basedir>
39+
<!-- by default we skip this but if the JAVA17 env variable is set then this check will no longer pass compiling and running the tests -->
40+
<disableJava17>true</disableJava17>
41+
3942
</properties>
4043

4144
<dependencies>
@@ -45,6 +48,32 @@
4548
<version>${project.version}</version>
4649
</dependency>
4750
</dependencies>
51+
52+
<build>
53+
<plugins>
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-deploy-plugin</artifactId>
57+
<configuration>
58+
<skip>true</skip>
59+
</configuration>
60+
</plugin>
61+
<plugin>
62+
<groupId>org.apache.maven.plugins</groupId>
63+
<artifactId>maven-compiler-plugin</artifactId>
64+
<configuration>
65+
<skip>${disableJava17}</skip>
66+
</configuration>
67+
</plugin>
68+
<plugin>
69+
<groupId>org.apache.maven.plugins</groupId>
70+
<artifactId>maven-surefire-plugin</artifactId>
71+
<configuration>
72+
<skip>${disableJava17}</skip>
73+
</configuration>
74+
</plugin>
75+
</plugins>
76+
</build>
4877

4978
</project>
5079

lang/java/pom.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
<module>grpc</module>
8787
<module>integration-test</module>
8888
<module>perf</module>
89+
<module>java17-test</module>
8990
</modules>
9091

9192
<build>
@@ -471,13 +472,6 @@
471472
<hadoop.version>2.10.1</hadoop.version>
472473
</properties>
473474
</profile>
474-
<profile>
475-
<id>java17</id>
476-
<modules>
477-
<module>avro</module>
478-
<module>java17-test</module>
479-
</modules>
480-
</profile>
481475
</profiles>
482476

483477
<!-- dependencyManagement can be used to define dependency versions, scopes, and

0 commit comments

Comments
 (0)