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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3a1dc3d  Fix #885 Simplify 'accumulo classpath' command (#887)
3a1dc3d is described below

commit 3a1dc3d36a3e51cb3b2f970211e3f3b0b8ed18b3
Author: Mike Walch <mwa...@apache.org>
AuthorDate: Thu Jan 10 10:53:44 2019 -0500

    Fix #885 Simplify 'accumulo classpath' command (#887)
    
    * Remove Java implementation and echo CLASSPATH variable
---
 assemble/bin/accumulo                              |  5 ++
 .../org/apache/accumulo/core/util/Classpath.java   | 58 ----------------------
 .../main/java/org/apache/accumulo/start/Main.java  |  1 +
 .../apache/accumulo/test/start/KeywordStartIT.java |  2 -
 4 files changed, 6 insertions(+), 60 deletions(-)

diff --git a/assemble/bin/accumulo b/assemble/bin/accumulo
index 77665e2..895adac 100755
--- a/assemble/bin/accumulo
+++ b/assemble/bin/accumulo
@@ -51,6 +51,11 @@ function main() {
   mkdir -p "${ACCUMULO_LOG_DIR}" 2>/dev/null
   : "${MALLOC_ARENA_MAX:?"variable is not set in accumulo-env.sh"}"
 
+  if [[ $cmd == "classpath" ]]; then
+    echo "$CLASSPATH"
+    exit 0
+  fi
+
   if [[ -x "$JAVA_HOME/bin/java" ]]; then
     JAVA="$JAVA_HOME/bin/java"
   else
diff --git a/core/src/main/java/org/apache/accumulo/core/util/Classpath.java 
b/core/src/main/java/org/apache/accumulo/core/util/Classpath.java
deleted file mode 100644
index 02d24d5..0000000
--- a/core/src/main/java/org/apache/accumulo/core/util/Classpath.java
+++ /dev/null
@@ -1,58 +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.
- */
-package org.apache.accumulo.core.util;
-
-import org.apache.accumulo.start.Main;
-import org.apache.accumulo.start.spi.KeywordExecutable;
-
-import com.beust.jcommander.Parameter;
-import com.google.auto.service.AutoService;
-
-@AutoService(KeywordExecutable.class)
-public class Classpath implements KeywordExecutable {
-
-  static class Opts extends org.apache.accumulo.core.cli.Help {
-
-    @Parameter(names = {"-d", "--debug"}, description = "Turns on debugging")
-    public boolean debug = false;
-  }
-
-  @Override
-  public String keyword() {
-    return "classpath";
-  }
-
-  @Override
-  public UsageGroup usageGroup() {
-    return UsageGroup.CORE;
-  }
-
-  @Override
-  public String description() {
-    return "Prints Accumulo classpath";
-  }
-
-  @Override
-  public void execute(final String[] args) throws Exception {
-
-    Opts opts = new Opts();
-    opts.parseArgs("accumulo classpath", args);
-
-    Main.getVFSClassLoader().getMethod("printClassPath", boolean.class)
-        .invoke(Main.getVFSClassLoader(), opts.debug);
-  }
-}
diff --git a/start/src/main/java/org/apache/accumulo/start/Main.java 
b/start/src/main/java/org/apache/accumulo/start/Main.java
index fa3d1dc..3b205e3 100644
--- a/start/src/main/java/org/apache/accumulo/start/Main.java
+++ b/start/src/main/java/org/apache/accumulo/start/Main.java
@@ -218,6 +218,7 @@ public class Main {
     printCommands(executables, UsageGroup.CORE);
 
     System.out.println(
+        "  classpath                      Prints Accumulo classpath\n" +
         "  <main class> args              Runs Java <main class> located on 
Accumulo classpath");
 
     System.out.println("\nProcess Commands:");
diff --git 
a/test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java 
b/test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java
index 4bfa41e..1ca2c9d 100644
--- a/test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java
@@ -33,7 +33,6 @@ import java.util.Map.Entry;
 import java.util.TreeMap;
 
 import org.apache.accumulo.core.file.rfile.PrintInfo;
-import org.apache.accumulo.core.util.Classpath;
 import org.apache.accumulo.core.util.CreateToken;
 import org.apache.accumulo.core.util.Help;
 import org.apache.accumulo.core.util.Version;
@@ -103,7 +102,6 @@ public class KeywordStartIT {
     TreeMap<String,Class<? extends KeywordExecutable>> expectSet = new 
TreeMap<>();
     expectSet.put("admin", Admin.class);
     expectSet.put("check-server-config", ConfigSanityCheck.class);
-    expectSet.put("classpath", Classpath.class);
     expectSet.put("convert-config", ConvertConfig.class);
     expectSet.put("create-token", CreateToken.class);
     expectSet.put("gc", GCExecutable.class);

Reply via email to