You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2023/05/25 19:30:43 UTC

[accumulo] branch main updated: More build updates to reduce warnings (#3426)

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

ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new 0017fd8949 More build updates to reduce warnings (#3426)
0017fd8949 is described below

commit 0017fd8949cc1bc7253b8e90313d4fd1b71e2241
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Thu May 25 15:30:36 2023 -0400

    More build updates to reduce warnings (#3426)
    
    Reduce warnings at the end of the build from using Maven 3.9.2 by
    updating several plugins whose versions are specified in the parent POM
    to the latest, which resolves the warnings from Maven. Specifically,
    update maven-resources-plugin, maven-compiler-plugin, exec-maven-plugin,
    apilyzer-maven-plugin, maven-dependency-plugin, and
    maven-enforcer-plugin.
    
    Update some dependency declarations, based on new detections from latest
    version of maven-dependency-plugin (specifically, zookeeper-jute in
    minicluster and libthrift in the monitor).
    
    Updating exec-maven-plugin required addressing #3033 with a workaround,
    and testing the script added for that workaround caught some additional
    shellcheck issues in the assembly module's cluster management scripts
    (unreachable redundant exit command) and generate-thrift.sh (unquoted
    path variable). So those fixes are included here as well.
    
    This fixes #3033.
---
 assemble/bin/accumulo-cluster            |  1 -
 assemble/bin/accumulo-service            |  1 -
 assemble/bin/accumulo-util               |  1 -
 core/pom.xml                             |  3 +--
 core/src/main/scripts/generate-thrift.sh |  2 +-
 core/src/main/scripts/mkdirs.sh          | 27 +++++++++++++++++++++++++++
 minicluster/pom.xml                      |  4 ++++
 pom.xml                                  | 22 ++++++++++++++++++----
 server/monitor/pom.xml                   |  4 ++++
 9 files changed, 55 insertions(+), 10 deletions(-)

diff --git a/assemble/bin/accumulo-cluster b/assemble/bin/accumulo-cluster
index 152a622078..6af84aa167 100755
--- a/assemble/bin/accumulo-cluster
+++ b/assemble/bin/accumulo-cluster
@@ -34,7 +34,6 @@ Commands:
   start-here          Starts all services on this node
   stop-here           Stops all services on this node
 EOF
-  exit 1
 }
 
 function invalid_args {
diff --git a/assemble/bin/accumulo-service b/assemble/bin/accumulo-service
index 88d2725a52..c501876043 100755
--- a/assemble/bin/accumulo-service
+++ b/assemble/bin/accumulo-service
@@ -37,7 +37,6 @@ Commands:
   kill        Kills service
 
 EOF
-  exit 1
 }
 
 function invalid_args {
diff --git a/assemble/bin/accumulo-util b/assemble/bin/accumulo-util
index bc7fcb32e3..12707e2d69 100755
--- a/assemble/bin/accumulo-util
+++ b/assemble/bin/accumulo-util
@@ -28,7 +28,6 @@ Commands:
   gen-monitor-cert    Generates Accumulo monitor certificate
   
 EOF
-  exit 1
 }
 
 function build_native() {
diff --git a/core/pom.xml b/core/pom.xml
index aa94e45999..e31e21d553 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -334,9 +334,8 @@
             </goals>
             <phase>prepare-package</phase>
             <configuration>
-              <executable>mkdir</executable>
+              <executable>${basedir}/src/main/scripts/mkdirs.sh</executable>
               <arguments>
-                <argument>-p</argument>
                 <argument>${project.build.directory}/generated-docs</argument>
               </arguments>
             </configuration>
diff --git a/core/src/main/scripts/generate-thrift.sh b/core/src/main/scripts/generate-thrift.sh
index 1758e79cc1..0ad5911a33 100755
--- a/core/src/main/scripts/generate-thrift.sh
+++ b/core/src/main/scripts/generate-thrift.sh
@@ -78,7 +78,7 @@ done
 # add dummy method to suppress "unnecessary suppress warnings" for classes which don't have any unused variables
 # this only affects classes, enums aren't affected
 #shellcheck disable=SC1004
-find $BUILD_DIR/gen-java -name '*.java' -exec grep -Zl '^public class ' {} + | xargs -0 sed -i -e 's/^[}]$/  private static void unusedMethod() {}\
+find "$BUILD_DIR/gen-java" -name '*.java' -exec grep -Zl '^public class ' {} + | xargs -0 sed -i -e 's/^[}]$/  private static void unusedMethod() {}\
 }/'
 
 for lang in "${LANGUAGES_TO_GENERATE[@]}"; do
diff --git a/core/src/main/scripts/mkdirs.sh b/core/src/main/scripts/mkdirs.sh
new file mode 100755
index 0000000000..ce11309197
--- /dev/null
+++ b/core/src/main/scripts/mkdirs.sh
@@ -0,0 +1,27 @@
+#! /usr/bin/env bash
+#
+# 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
+#
+#   https://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.
+#
+
+# This script is a workaround for exec-maven-plugin's perpetual breakage
+# due to the `-p` flag being misinterpreted.
+# The latest iteration of this breakage is in 3.1.0
+# See:
+#   https://github.com/mojohaus/exec-maven-plugin/issues/334
+#   https://github.com/apache/accumulo/issues/3033
+mkdir -p "$@"
diff --git a/minicluster/pom.xml b/minicluster/pom.xml
index 9966c2a571..232cdf7d00 100644
--- a/minicluster/pom.xml
+++ b/minicluster/pom.xml
@@ -100,6 +100,10 @@
       <groupId>org.apache.zookeeper</groupId>
       <artifactId>zookeeper</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.zookeeper</groupId>
+      <artifactId>zookeeper-jute</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
diff --git a/pom.xml b/pom.xml
index 136b79975f..57337332cb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -746,6 +746,11 @@
             </plugins>
           </configuration>
         </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-resources-plugin</artifactId>
+          <version>3.3.1</version>
+        </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-remote-resources-plugin</artifactId>
@@ -809,6 +814,7 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.11.0</version>
           <configuration>
             <showDeprecation>true</showDeprecation>
             <showWarnings>true</showWarnings>
@@ -905,16 +911,14 @@
           <version>3.4.0</version>
         </plugin>
         <plugin>
-          <!-- 3.1.0 is broken https://github.com/mojohaus/exec-maven-plugin/issues/334 -->
-          <!-- problem tracked in https://github.com/apache/accumulo/issues/3033 -->
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>exec-maven-plugin</artifactId>
-          <version>3.0.0</version>
+          <version>3.1.0</version>
         </plugin>
         <plugin>
           <groupId>net.revelc.code</groupId>
           <artifactId>apilyzer-maven-plugin</artifactId>
-          <version>1.2.0</version>
+          <version>1.3.0</version>
         </plugin>
         <plugin>
           <groupId>net.revelc.code.formatter</groupId>
@@ -965,6 +969,16 @@
             </excludes>
           </configuration>
         </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-dependency-plugin</artifactId>
+          <version>3.6.0</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-enforcer-plugin</artifactId>
+          <version>3.3.0</version>
+        </plugin>
       </plugins>
     </pluginManagement>
     <plugins>
diff --git a/server/monitor/pom.xml b/server/monitor/pom.xml
index 34ac61efd0..d9da97a837 100644
--- a/server/monitor/pom.xml
+++ b/server/monitor/pom.xml
@@ -96,6 +96,10 @@
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-web</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.thrift</groupId>
+      <artifactId>libthrift</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.apache.zookeeper</groupId>
       <artifactId>zookeeper</artifactId>