You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by dc...@apache.org on 2021/07/11 23:29:27 UTC

[datasketches-memory] 01/01: Fix build errors for multi-module build

This is an automated email from the ASF dual-hosted git repository.

dcromberge pushed a commit to branch fix-build-errors
in repository https://gitbox.apache.org/repos/asf/datasketches-memory.git

commit 4cdf01224f1568d0215fb994ae118fb6e3f20132
Author: David Cromberge <dc...@apache.org>
AuthorDate: Mon Jul 12 00:26:28 2021 +0100

    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.
---
 .github/workflows/maven.yml             |  1 +
 .lgtm.yml                               | 60 ----------------------
 README.md                               | 14 +++--
 datasketches-memory-java11/pom.xml      |  1 +
 datasketches-memory-java8-tests/pom.xml |  1 +
 datasketches-memory-java8/pom.xml       |  1 +
 datasketches-memory-java9-tests/pom.xml |  1 +
 datasketches-memory-java9/pom.xml       |  1 +
 datasketches-memory-tests/pom.xml       | 91 ++++++++++++++++++++++++++++++---
 tools/toolchains.xml                    | 63 +++++++++++++++++++++++
 10 files changed, 162 insertions(+), 72 deletions(-)

diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index c2ac063..38d3b47 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -111,6 +111,7 @@ jobs:
           mvn package
           -Dmaven.javadoc.skip=true
           -Dgpg.skip=true
+          -Denvironment=ci
           --toolchains .github/workflows/.toolchains.xml
 
       - name: Test & Report
diff --git a/.lgtm.yml b/.lgtm.yml
deleted file mode 100644
index 53a53b5..0000000
--- a/.lgtm.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-##########################################################################################
-# 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.
-##########################################################################################
-
-#########################################################################################
-# Use the extraction block to define changes to the default code extraction process     #
-# for one or more languages. The settings for each language are defined in a child      #
-# block, with one or more steps.                                                        #
-#########################################################################################
-
-extraction:
-
-  # Define settings for Java analysis
-  ####################################
-  java:
-    # The `index` step extracts information from the files in the codebase.
-    index:
-      # Specify the Java version required to build the project.
-      java_version: 8
-      # Specify Maven settings.
-      maven:
-        # Specify the path of a Maven toolchains file.
-        # Default: Maven uses a toolchains file in the default location, if it exists.
-        toolchains_file: .github/workflows/.toolchains.xml
-
-  # Define settings for JavaScript analysis
-  ##########################################
-  javascript:
-
-    # The `index` step extracts information from the files in the codebase.
-    index:
-      # Specify a list of files and folders to exclude from extraction.
-      exclude:
-        - **/*/site
-      # Specify a list of glob patterns to include/exclude files from extraction; this
-      # is applied on top of the include/exclude paths from above; patterns are
-      # processed in the same way as for path classifiers above.
-      # Default: include all files with known extensions (such as .js, .ts and .html),
-      # but exclude files ending in `-min.js` or `.min.js` and folders named `node_modules`
-      # or `bower_components`
-      filters:
-        # exclude any *.js files anywhere.
-        - exclude: "**/*.js"
-        # exclude any *.html files anywhere.
-        - exclude: "**/*.html"
diff --git a/README.md b/README.md
index 7e4c562..cb58ea4 100644
--- a/README.md
+++ b/README.md
@@ -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 Reso [...]
 
+__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
 
diff --git a/datasketches-memory-java11/pom.xml b/datasketches-memory-java11/pom.xml
index d1362bc..4a1e1da 100644
--- a/datasketches-memory-java11/pom.xml
+++ b/datasketches-memory-java11/pom.xml
@@ -30,6 +30,7 @@
 
     <artifactId>datasketches-memory-java11</artifactId>
     <name>${project.artifactId}</name>
+    <packaging>jar</packaging>
 
     <properties>
         <java.version>11</java.version>
diff --git a/datasketches-memory-java8-tests/pom.xml b/datasketches-memory-java8-tests/pom.xml
index d98db7b..af2bcc4 100644
--- a/datasketches-memory-java8-tests/pom.xml
+++ b/datasketches-memory-java8-tests/pom.xml
@@ -60,6 +60,7 @@
 
   <artifactId>datasketches-memory-java8-tests</artifactId>
   <name>${project.artifactId}</name>
+  <packaging>jar</packaging>
 
   <properties>
     <java.version>1.8</java.version>
diff --git a/datasketches-memory-java8/pom.xml b/datasketches-memory-java8/pom.xml
index 7c3bcd3..ed45b16 100644
--- a/datasketches-memory-java8/pom.xml
+++ b/datasketches-memory-java8/pom.xml
@@ -30,6 +30,7 @@
 
   <artifactId>datasketches-memory-java8</artifactId>
   <name>${project.artifactId}</name>
+  <packaging>jar</packaging>
 
   <properties>
     <java.version>1.8</java.version>
diff --git a/datasketches-memory-java9-tests/pom.xml b/datasketches-memory-java9-tests/pom.xml
index 17cd2f8..dc92171 100644
--- a/datasketches-memory-java9-tests/pom.xml
+++ b/datasketches-memory-java9-tests/pom.xml
@@ -44,6 +44,7 @@
 
     <artifactId>datasketches-memory-java9-tests</artifactId>
     <name>${project.artifactId}</name>
+    <packaging>jar</packaging>
 
     <properties>
         <java.version>9</java.version>
diff --git a/datasketches-memory-java9/pom.xml b/datasketches-memory-java9/pom.xml
index 9990386..7014dee 100644
--- a/datasketches-memory-java9/pom.xml
+++ b/datasketches-memory-java9/pom.xml
@@ -38,6 +38,7 @@
 
     <artifactId>datasketches-memory-java9</artifactId>
     <name>${project.artifactId}</name>
+    <packaging>jar</packaging>
 
     <properties>
         <java.version>9</java.version>
diff --git a/datasketches-memory-tests/pom.xml b/datasketches-memory-tests/pom.xml
index 61510c1..11e454d 100644
--- a/datasketches-memory-tests/pom.xml
+++ b/datasketches-memory-tests/pom.xml
@@ -37,13 +37,6 @@
       <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>
       <version>${testng.version}</version>
@@ -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>
 
diff --git a/tools/toolchains.xml b/tools/toolchains.xml
new file mode 100644
index 0000000..06863de
--- /dev/null
+++ b/tools/toolchains.xml
@@ -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>
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org