Skip to content

Commit f9c469d

Browse files
ARROW-17434: [Java][CI] Add build Windows support for Java (apache#13918)
Authored-by: david dali susanibar arce <davi.sarces@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 25a2734 commit f9c469d

5 files changed

Lines changed: 58 additions & 8 deletions

File tree

‎.github/workflows/java.yml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,30 @@ jobs:
125125
- name: Test
126126
shell: bash
127127
run: ci/scripts/java_test.sh $(pwd) $(pwd)/build
128+
129+
windows:
130+
name: AMD64 Windows Server 2022 Java JDK ${{ matrix.jdk }}
131+
runs-on: windows-latest
132+
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
133+
timeout-minutes: 30
134+
strategy:
135+
fail-fast: false
136+
matrix:
137+
jdk: [11]
138+
steps:
139+
- name: Set up Java
140+
uses: actions/setup-java@v3
141+
with:
142+
java-version: ${{ matrix.jdk }}
143+
distribution: 'temurin'
144+
- name: Checkout Arrow
145+
uses: actions/checkout@v3
146+
with:
147+
fetch-depth: 0
148+
submodules: recursive
149+
- name: Build
150+
shell: bash
151+
run: ci/scripts/java_build.sh $(pwd) $(pwd)/build
152+
- name: Test
153+
shell: bash
154+
run: ci/scripts/java_test.sh $(pwd) $(pwd)/build

‎java/adapter/avro/src/test/java/org/apache/arrow/AvroTestBase.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ public void init() {
6363
}
6464

6565
protected Schema getSchema(String schemaName) throws Exception {
66-
Path schemaPath = Paths.get(TestWriteReadAvroRecord.class.getResource("/").getPath(),
66+
Path schemaPath = Paths.get(Paths.get(TestWriteReadAvroRecord.class.getResource("/").toURI()).toString(),
6767
"schema", schemaName);
68+
6869
return new Schema.Parser().parse(schemaPath.toFile());
6970
}
7071

‎java/adapter/avro/src/test/java/org/apache/arrow/TestWriteReadAvroRecord.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ public class TestWriteReadAvroRecord {
4848
public void testWriteAndRead() throws Exception {
4949

5050
File dataFile = TMP.newFile();
51-
Path schemaPath = Paths.get(TestWriteReadAvroRecord.class.getResource("/").getPath(), "schema", "test.avsc");
51+
Path schemaPath = Paths.get(
52+
Paths.get(TestWriteReadAvroRecord.class.getResource("/").toURI()).toString(),
53+
"schema", "test.avsc");
5254
Schema schema = new Schema.Parser().parse(schemaPath.toFile());
5355

5456
//write data to disk

‎java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/AbstractJdbcToArrowTest.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.util.Calendar;
2828
import java.util.HashMap;
2929
import java.util.Map;
30+
import java.util.TimeZone;
3031

3132
import org.apache.arrow.memory.BufferAllocator;
3233
import org.apache.arrow.memory.RootAllocator;
@@ -95,6 +96,7 @@ protected static Table getTable(String ymlFilePath, @SuppressWarnings("rawtypes"
9596
*/
9697
@Before
9798
public void setUp() throws SQLException, ClassNotFoundException {
99+
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
98100
String url = "jdbc:h2:mem:JdbcToArrowTest";
99101
String driver = "org.h2.Driver";
100102
Class.forName(driver);

‎java/pom.xml‎

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@
353353
<ignoredDependencies>
354354
<!-- source annotations (not kept in compiled code) -->
355355
<ignoredDependency>javax.annotation:javax.annotation-api:*</ignoredDependency>
356+
<ignoredDependency>org.apache.hadoop:hadoop-client-api</ignoredDependency>
356357
</ignoredDependencies>
357358
</configuration>
358359
</execution>
@@ -397,7 +398,7 @@
397398
</plugin>
398399
<plugin>
399400
<artifactId>maven-surefire-plugin</artifactId>
400-
<version>3.0.0-M3</version>
401+
<version>3.0.0-M7</version>
401402
<configuration>
402403
<enableAssertions>true</enableAssertions>
403404
<childDelegation>true</childDelegation>
@@ -785,7 +786,7 @@
785786
<profile>
786787
<id>error-prone-jdk11+</id>
787788
<activation>
788-
<jdk>[11,)</jdk>
789+
<jdk>[11,]</jdk>
789790
<property>
790791
<name>!m2e.version</name>
791792
</property>
@@ -801,10 +802,7 @@
801802
<encoding>UTF-8</encoding>
802803
<compilerArgs combine.children="append">
803804
<arg>-XDcompilePolicy=simple</arg>
804-
<arg>
805-
-Xplugin:ErrorProne \
806-
-XepExcludedPaths:.*/(target/generated-sources)/.*
807-
</arg>
805+
<arg>-Xplugin:ErrorProne -XepExcludedPaths:.*/(target/generated-sources)/.*</arg>
808806
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
809807
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
810808
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
@@ -887,6 +885,26 @@
887885
</reporting>
888886
</profile>
889887

888+
<profile>
889+
<id>windows</id>
890+
<activation>
891+
<jdk>[17,]</jdk>
892+
<os>
893+
<family>windows</family>
894+
</os>
895+
</activation>
896+
<build>
897+
<plugins>
898+
<plugin>
899+
<artifactId>maven-surefire-plugin</artifactId>
900+
<configuration>
901+
<reuseForks>false</reuseForks>
902+
</configuration>
903+
</plugin>
904+
</plugins>
905+
</build>
906+
</profile>
907+
890908
</profiles>
891909

892910
</project>

0 commit comments

Comments
 (0)