Skip to content

Commit

Permalink
More build updates to reduce warnings (#3426)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ctubbsii committed Aug 14, 2023
1 parent a07499e commit 4f5d358
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 10 deletions.
1 change: 0 additions & 1 deletion assemble/bin/accumulo-cluster
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion assemble/bin/accumulo-service
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Commands:
kill Kills service
EOF
exit 1
}

function invalid_args {
Expand Down
1 change: 0 additions & 1 deletion assemble/bin/accumulo-util
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Commands:
gen-monitor-cert Generates Accumulo monitor certificate
EOF
exit 1
}

function build_native() {
Expand Down
3 changes: 1 addition & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scripts/generate-thrift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions core/src/main/scripts/mkdirs.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
4 changes: 4 additions & 0 deletions minicluster/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
22 changes: 18 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,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>
Expand Down Expand Up @@ -828,6 +833,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>
Expand Down Expand Up @@ -924,16 +930,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>
Expand Down Expand Up @@ -985,6 +989,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>
Expand Down
4 changes: 4 additions & 0 deletions server/monitor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,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>
Expand Down

0 comments on commit 4f5d358

Please sign in to comment.