strip fat jar, strip exception messages

This commit is contained in:
Peter Hormanns 2016-08-31 17:50:15 +02:00
parent 664136d563
commit ff67ca8c96
3 changed files with 19 additions and 7 deletions

View File

@ -44,6 +44,16 @@
<groupId>org.apache.xmlrpc</groupId>
<artifactId>xmlrpc-client</artifactId>
<version>3.1.3</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jline</groupId>
@ -55,10 +65,5 @@
<artifactId>commons-cli</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
</project>

View File

@ -62,7 +62,7 @@ public class Main {
}
if (cmdParser.isInteractive()) {
String command = console.readInput();
while (!("bye".equals(command.trim()) || "exit".equals(command.trim()) || "quit".equals(command.trim()))) {
while (!isExitCommand(command)) {
try {
scriptClient.execute(command);
console.println(formatter.format(scriptClient.getLastRpcResult()));
@ -78,6 +78,11 @@ public class Main {
}
}
private static boolean isExitCommand(String command) {
String trimmedCommand = command.trim();
return "bye".equals(trimmedCommand) || "exit".equals(trimmedCommand) || "quit".equals(trimmedCommand);
}
private static String findRootException(final Exception exp) {
Throwable cause = exp;
while (cause.getCause() != null && cause.getCause() != cause) {

View File

@ -75,7 +75,9 @@ public class RpcClient {
}
return list;
} catch (XmlRpcException e) {
throw new JSCliException(e);
final String message = e.getLocalizedMessage();
final int messageStartIndex = message.lastIndexOf("Exception:") + 10;
throw new JSCliException(message.substring(messageStartIndex).trim());
}
}