Skip to content
Permalink
Browse files
Fix build errors for multi-module build
Multi-module dependency resolution fails for
certain plugins that require dependency resolution
in early phases of the maven lifecycle.  This
behaviour is described in the associated JIRA
ticket: https://issues.apache.org/jira/browse/MNG-3283

This pull-request aims to address instability
due to dependency resolution by adopting the
suggestion in the linked ticket above.
  • Loading branch information
davecromberge committed Jul 11, 2021
1 parent 413136b commit 4cdf01224f1568d0215fb994ae118fb6e3f20132
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 72 deletions.
@@ -111,6 +111,7 @@ jobs:
mvn package
-Dmaven.javadoc.skip=true
-Dgpg.skip=true
-Denvironment=ci
--toolchains .github/workflows/.toolchains.xml
- name: Test & Report

This file was deleted.

@@ -74,6 +74,8 @@ module datasketches.memory.multirelease.test {
## Build Instructions
__NOTE:__ This component accesses resource files for testing. As a result, the directory elements of the full absolute path of the target installation directory must qualify as Java identifiers. In other words, the directory elements must not have any space characters (or non-Java identifier characters) in any of the path elements. This is required by the Oracle Java Specification in order to ensure location-independent access to resources: [See Oracle Location-Independent Access to Resources](https://docs.oracle.com/javase/8/docs/technotes/guides/lang/resources.html)

__IMPORTANT:__ This project is structured as a maven multi-module project. Building this project might affect plugins that require early dependency resolution, such as the javadoc and eclipse plugins. The build instructions below have been modified to use the `process-classes` phase (instead of `compile`) for these use cases. For more information, see [this Maven Reactor issue](https://issues.apache.org/jira/browse/MNG-3283).

### JDK versions required to compile
This DataSketches component is pure Java and requires the following JDKs to compile:
- JDK8/Hotspot
@@ -95,9 +97,11 @@ To run the strict profile tests:

To run javadoc on this multi-module project, use:

$ mvn clean package javadoc:javadoc -DskipTests=true
$ mvn clean process-classes javadoc:javadoc -DskipTests=true

To run the eclipse plugin on this multi-module project, use:

* There are sometimes problems resolving module deps, e.g. see https://issues.apache.org/jira/browse/MJAVADOC-437
$ mvn clean process-classes eclipse:eclipse -DskipTests=true

To install jars built from the downloaded source:

@@ -115,14 +119,14 @@ This will create the following Jars:

This project makes use of Maven toolchains to ensure that the correct Java compiler version is used when compiling source files.

The reference toolchains.xml can be found in .github/workflows/.toolchains.xml, and can be copied to your local maven home
The reference toolchains.xml can be found in `tools/toolchains.xml`, and can be copied to your local maven home
directory e.g. `~/.m2/toolchains.xml`.

Alternatively, the maven commands above can be supplemented with: `--toolchains .github/workflows/.toolchains.xml`
Alternatively, the maven commands above can be supplemented with: `--toolchains tools/toolchains.xml`

For example, to run normal unit tests:

$ mvn clean test --toolchains .github/workflows/.toolchains.xml
$ mvn clean test --toolchains tools/toolchains.xml

### Dependencies

@@ -30,6 +30,7 @@

<artifactId>datasketches-memory-java11</artifactId>
<name>${project.artifactId}</name>
<packaging>jar</packaging>

<properties>
<java.version>11</java.version>
@@ -60,6 +60,7 @@

<artifactId>datasketches-memory-java8-tests</artifactId>
<name>${project.artifactId}</name>
<packaging>jar</packaging>

<properties>
<java.version>1.8</java.version>
@@ -30,6 +30,7 @@

<artifactId>datasketches-memory-java8</artifactId>
<name>${project.artifactId}</name>
<packaging>jar</packaging>

<properties>
<java.version>1.8</java.version>
@@ -44,6 +44,7 @@

<artifactId>datasketches-memory-java9-tests</artifactId>
<name>${project.artifactId}</name>
<packaging>jar</packaging>

<properties>
<java.version>9</java.version>
@@ -38,6 +38,7 @@

<artifactId>datasketches-memory-java9</artifactId>
<name>${project.artifactId}</name>
<packaging>jar</packaging>

<properties>
<java.version>9</java.version>
@@ -36,13 +36,6 @@
<artifactId>datasketches-memory</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.datasketches</groupId>
<artifactId>datasketches-memory-java8-tests</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
@@ -78,6 +71,10 @@
<id>java8</id>
<activation>
<jdk>[1.8,1.9),8</jdk>
<property>
<name>environment</name>
<value>ci</value>
</property>
</activation>

<properties>
@@ -87,6 +84,16 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.datasketches</groupId>
<artifactId>datasketches-memory-java8-tests</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
@@ -124,6 +131,10 @@
<id>java9</id>
<activation>
<jdk>9</jdk>
<property>
<name>environment</name>
<value>ci</value>
</property>
</activation>

<properties>
@@ -133,6 +144,16 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.datasketches</groupId>
<artifactId>datasketches-memory-java8-tests</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>

@@ -171,6 +192,10 @@
<id>java10</id>
<activation>
<jdk>10</jdk>
<property>
<name>environment</name>
<value>ci</value>
</property>
</activation>

<properties>
@@ -180,6 +205,16 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.datasketches</groupId>
<artifactId>datasketches-memory-java8-tests</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>

@@ -218,6 +253,10 @@
<id>java11</id>
<activation>
<jdk>11</jdk>
<property>
<name>environment</name>
<value>ci</value>
</property>
</activation>

<properties>
@@ -227,6 +266,16 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.datasketches</groupId>
<artifactId>datasketches-memory-java8-tests</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>

@@ -265,6 +314,10 @@
<id>java12</id>
<activation>
<jdk>12</jdk>
<property>
<name>environment</name>
<value>ci</value>
</property>
</activation>

<properties>
@@ -274,6 +327,16 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.datasketches</groupId>
<artifactId>datasketches-memory-java8-tests</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>

@@ -313,6 +376,10 @@
<id>java13</id>
<activation>
<jdk>13</jdk>
<property>
<name>environment</name>
<value>ci</value>
</property>
</activation>

<properties>
@@ -322,6 +389,16 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.datasketches</groupId>
<artifactId>datasketches-memory-java8-tests</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF8"?>

<!--
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.
-->

<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>1.8</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${env.JAVA8_HOME}</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>8</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${env.JAVA8_HOME}</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>9</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${env.JAVA9_HOME}</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>11</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${env.JAVA11_HOME}</jdkHome>
</configuration>
</toolchain>
</toolchains>

0 comments on commit 4cdf012

Please sign in to comment.