Builds and runs.
This commit is contained in:
parent
f034cef465
commit
396351771c
40
pom.xml
40
pom.xml
@ -35,6 +35,7 @@
|
|||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<systemPath>${basedir}/bukkit-build/bukkit.jar</systemPath>
|
<systemPath>${basedir}/bukkit-build/bukkit.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.sshd</groupId>
|
<groupId>org.apache.sshd</groupId>
|
||||||
<artifactId>sshd-core</artifactId>
|
<artifactId>sshd-core</artifactId>
|
||||||
@ -42,16 +43,52 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.mina</groupId>
|
||||||
|
<artifactId>mina-core</artifactId>
|
||||||
|
<version>2.0.16</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<version>1.7.25</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-jdk14</artifactId>
|
||||||
|
<version>1.7.25</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<!-- Build -->
|
<!-- Build -->
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<descriptorRefs>
|
||||||
|
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||||
|
</descriptorRefs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
<!-- Shade plugin -->
|
<!-- Shade plugin -->
|
||||||
<!-- <plugin>
|
<!-- <plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>1.5</version>
|
<version>1.7</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
@ -74,6 +111,7 @@
|
|||||||
<minimizeJar>true</minimizeJar>
|
<minimizeJar>true</minimizeJar>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin> -->
|
</plugin> -->
|
||||||
|
|
||||||
<!-- Compile plugin -->
|
<!-- Compile plugin -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
@ -15,6 +15,9 @@ import java.io.OutputStream;
|
|||||||
import java.util.logging.StreamHandler;
|
import java.util.logging.StreamHandler;
|
||||||
|
|
||||||
public class ConsoleShellFactory implements Factory<Command> {
|
public class ConsoleShellFactory implements Factory<Command> {
|
||||||
|
public Command get() {
|
||||||
|
return this.create();
|
||||||
|
}
|
||||||
|
|
||||||
public Command create() {
|
public Command create() {
|
||||||
return new ConsoleShell();
|
return new ConsoleShell();
|
||||||
|
@ -3,6 +3,7 @@ package com.ryanmichela.sshd;
|
|||||||
import org.apache.sshd.common.SshException;
|
import org.apache.sshd.common.SshException;
|
||||||
import org.bukkit.craftbukkit.libs.jline.console.ConsoleReader;
|
import org.bukkit.craftbukkit.libs.jline.console.ConsoleReader;
|
||||||
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
||||||
|
@ -22,7 +22,7 @@ public class PemDecoder extends java.io.BufferedReader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PublicKey getPemBytes() throws Exception {
|
public PublicKey getPemBytes() throws Exception {
|
||||||
StringBuffer b64 = new StringBuffer();
|
StringBuilder b64 = new StringBuilder();
|
||||||
|
|
||||||
String line = readLine();
|
String line = readLine();
|
||||||
if (!line.matches(BEGIN)) {
|
if (!line.matches(BEGIN)) {
|
||||||
|
@ -28,9 +28,7 @@ public class ReflectionUtil {
|
|||||||
modifiersField.setInt(f, f.getModifiers() & ~Modifier.FINAL);
|
modifiersField.setInt(f, f.getModifiers() & ~Modifier.FINAL);
|
||||||
|
|
||||||
f.set(o, newValue);
|
f.set(o, newValue);
|
||||||
} catch (NoSuchFieldException ex) {
|
} catch (NoSuchFieldException | IllegalAccessException ex) {
|
||||||
System.out.println("*** " + c.getName() + ":" + ex);
|
|
||||||
} catch (IllegalAccessException ex) {
|
|
||||||
System.out.println("*** " + c.getName() + ":" + ex);
|
System.out.println("*** " + c.getName() + ":" + ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,12 +71,12 @@ public class StreamHandlerAppender implements Appender {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public State getState() {
|
public State getState() {
|
||||||
return null; // TODO: Generated method stub
|
return State.INITIALIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
// TODO: Generated method stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -96,6 +96,6 @@ public class StreamHandlerAppender implements Appender {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isStopped() {
|
public boolean isStopped() {
|
||||||
return false; // TODO: Generated method stub
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,24 +22,19 @@ public class PluginSlf4jFactory implements ILoggerFactory {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private boolean isEnabled(Level level) {
|
private boolean isEnabled(Level level) {
|
||||||
if (SshdPlugin.instance != null) {
|
return SshdPlugin.instance != null && SshdPlugin.instance.getLogger().isLoggable(level);
|
||||||
return SshdPlugin.instance.getLogger().isLoggable(level);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void log(Level level, String s, Object[] objects) {
|
private void log(Level level, String s, Object[] objects) {
|
||||||
if (SshdPlugin.instance != null && isEnabled(level)) {
|
if (SshdPlugin.instance != null && isEnabled(level)) {
|
||||||
FormattingTuple ft = MessageFormatter.arrayFormat(s, objects);
|
FormattingTuple ft = MessageFormatter.arrayFormat(s, objects);
|
||||||
SshdPlugin.instance.getLogger().log(level, ft.getMessage(), ft.getThrowable());
|
SshdPlugin.instance.getLogger().log(level, ft.getMessage(), ft.getThrowable());
|
||||||
SshdPlugin.instance.getLogger().log(level, s, Thread.currentThread().getStackTrace());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void log(Level level, String s, Throwable throwable) {
|
private void log(Level level, String s, Throwable throwable) {
|
||||||
if (SshdPlugin.instance != null && isEnabled(level)) {
|
if (SshdPlugin.instance != null && isEnabled(level)) {
|
||||||
SshdPlugin.instance.getLogger().log(level, s, throwable);
|
SshdPlugin.instance.getLogger().log(level, s, throwable);
|
||||||
SshdPlugin.instance.getLogger().log(level, s, Thread.currentThread().getStackTrace());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user