Browse Source

AMBARI-9023. License issue in Ambari Shell. (Krisztian Horvath via yusaku)

Yusaku Sako 10 years ago
parent
commit
a00189a363

+ 0 - 5
ambari-project/pom.xml

@@ -443,11 +443,6 @@
         <artifactId>spring-boot-starter-test</artifactId>
         <version>1.0.2.RELEASE</version>
       </dependency>
-      <dependency>
-        <groupId>com.github.lalyos</groupId>
-        <artifactId>jfiglet</artifactId>
-        <version>0.0.3</version>
-      </dependency>
       <dependency>
         <groupId>org.codehaus.groovy</groupId>
         <artifactId>groovy-all</artifactId>

+ 1 - 4
ambari-shell/ambari-groovy-shell/pom.xml

@@ -43,10 +43,6 @@
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-test</artifactId>
     </dependency>
-    <dependency>
-      <groupId>com.github.lalyos</groupId>
-      <artifactId>jfiglet</artifactId>
-    </dependency>
     <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
@@ -94,6 +90,7 @@
         <configuration>
           <excludes>
             <exclude>src/main/resources/elephant.txt</exclude>
+            <exclude>src/main/resources/banner.txt</exclude>
             <exclude>src/test/resources/2columns</exclude>
             <exclude>src/test/resources/3columns</exclude>
             <exclude>src/test/resources/testBlueprint.json</exclude>

+ 8 - 3
ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/customization/AmbariBanner.java

@@ -17,11 +17,12 @@
  */
 package org.apache.ambari.shell.customization;
 
+import java.io.IOException;
+
+import org.apache.commons.io.IOUtils;
 import org.springframework.shell.plugin.BannerProvider;
 import org.springframework.stereotype.Component;
 
-import com.github.lalyos.jfiglet.FigletFont;
-
 /**
  * Prints the banner when the user starts the shell.
  */
@@ -35,7 +36,11 @@ public class AmbariBanner implements BannerProvider {
 
   @Override
   public String getBanner() {
-    return FigletFont.convertOneLine("AmbariShell");
+    try {
+      return IOUtils.toString(getClass().getResourceAsStream("/banner.txt"));
+    } catch (IOException e) {
+      return "AmbariShell";
+    }
   }
 
   @Override

+ 5 - 0
ambari-shell/ambari-groovy-shell/src/main/resources/banner.txt

@@ -0,0 +1,5 @@
+    _                _                   _  ____   _            _  _
+   / \    _ __ ___  | |__    __ _  _ __ (_)/ ___| | |__    ___ | || |
+  / _ \  | '_ ` _ \ | '_ \  / _` || '__|| |\___ \ | '_ \  / _ \| || |
+ / ___ \ | | | | | || |_) || (_| || |   | | ___) || | | ||  __/| || |
+/_/   \_\|_| |_| |_||_.__/  \__,_||_|   |_||____/ |_| |_| \___||_||_|