Skip to content

Commit af104eb

Browse files
author
孙健
committed
remove serizable jar
1 parent 154db1e commit af104eb

File tree

2 files changed

+50
-35
lines changed

2 files changed

+50
-35
lines changed

build.gradle

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ dependencies {
3838
compile 'org.apache.logging.log4j:log4j-core:2.6.2'
3939
compile 'org.apache.logging.log4j:log4j-web:2.6.2'
4040

41-
//java serizable
42-
compile 'io.protostuff:protostuff-core:1.4.4'
43-
compile 'io.protostuff:protostuff-runtime:1.4.4'
44-
compile 'org.objenesis:objenesis:2.4'
45-
46-
4741
//javaee support
4842
compile 'javax.servlet:javax.servlet-api:3.1.0'
4943
compile 'javax.servlet:jstl:1.2'

src/main/java/Bootstrap.java

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@
1010
import java.net.URL;
1111
import java.security.ProtectionDomain;
1212

13+
import org.eclipse.jetty.http.HttpVersion;
14+
import org.eclipse.jetty.server.HttpConfiguration;
15+
import org.eclipse.jetty.server.HttpConnectionFactory;
16+
import org.eclipse.jetty.server.SecureRequestCustomizer;
1317
import org.eclipse.jetty.server.Server;
18+
import org.eclipse.jetty.server.ServerConnector;
19+
import org.eclipse.jetty.server.SslConnectionFactory;
1420
import org.eclipse.jetty.server.handler.HandlerList;
1521
import org.eclipse.jetty.util.StringUtil;
22+
import org.eclipse.jetty.util.ssl.SslContextFactory;
1623
import org.eclipse.jetty.webapp.WebAppContext;
1724

1825
public class Bootstrap {
@@ -50,6 +57,8 @@ public static void main(String[] args) throws Exception {
5057
putEnv(PREFIX + "maven", dim[1]);
5158
} else if (dim[0].equals("--upload")) {
5259
putEnv(PREFIX + "upload", dim[1]);
60+
} else if (dim[0].equals("--ssl")) {
61+
putEnv(PREFIX + "ssl", dim[1]);
5362
}
5463
}
5564
} else if (!arg.startsWith("-f")) {
@@ -76,6 +85,39 @@ public static void main(String[] args) throws Exception {
7685

7786
WebAppContext context = new WebAppContext();
7887

88+
// //server for ssl ,default not open
89+
// String sslport = getOrCreateEnv(PREFIX + "ssl", "433");
90+
// if (sslport != null) {
91+
// // HTTP Configuration
92+
// HttpConfiguration http_config = new HttpConfiguration();
93+
// http_config.setSecureScheme("https");
94+
// http_config.setSecurePort(Integer.parseInt(sslport));
95+
//
96+
// SslContextFactory contextFactory = new SslContextFactory();
97+
//// sslContextFactory.setKeyStorePath(jetty_home + "/../../../jetty-server/src/test/config/etc/keystore");
98+
//// sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
99+
//// sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g");
100+
//// sslContextFactory.setTrustStorePath(jetty_home + "/../../../jetty-server/src/test/config/etc/keystore");
101+
//// sslContextFactory.setTrustStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
102+
//// sslContextFactory.setExcludeCipherSuites("SSL_RSA_WITH_DES_CBC_SHA",
103+
//// "SSL_DHE_RSA_WITH_DES_CBC_SHA", "SSL_DHE_DSS_WITH_DES_CBC_SHA",
104+
//// "SSL_RSA_EXPORT_WITH_RC4_40_MD5",
105+
//// "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA",
106+
//// "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA",
107+
//// "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA");
108+
//
109+
// // SSL HTTP Configuration
110+
// HttpConfiguration https_config = new HttpConfiguration(http_config);
111+
// https_config.addCustomizer(new SecureRequestCustomizer());
112+
//
113+
// // SSL Connector
114+
// ServerConnector sslConnector = new ServerConnector(server,
115+
// new SslConnectionFactory(contextFactory,HttpVersion.HTTP_1_1.asString()),
116+
// new HttpConnectionFactory(https_config));
117+
// sslConnector.setPort(8443);
118+
// server.addConnector(sslConnector);
119+
// }
120+
79121
File jcoderHome = new File(home);
80122

81123
makeFiles(jcoderHome, logPath);
@@ -137,35 +179,14 @@ private static void createLog4j2Config(File log4jFile, String logPath) throws Fi
137179
return;
138180
}
139181

140-
String logTemplate = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
141-
"<Configuration status=\"INFO\">\n" +
142-
" <properties>\n" +
143-
" <property name=\"LOG_PATH\">{{LOG_PATH}}</property>\n" +
144-
" </properties>\n" +
145-
" <Appenders>\n" +
146-
" <Console name=\"Console\" target=\"SYSTEM_OUT\">\n" +
147-
" <PatternLayout pattern=\"%c-%-4r %-5p [%d{yyyy-MM-dd HH:mm:ss}] %m%n\" />\n" +
148-
" </Console>\n" +
149-
"\n" +
150-
" <RollingRandomAccessFile name=\"File\" fileName=\"${LOG_PATH}\"\n" +
151-
" filePattern=\"${LOG_PATH}-%d{yyyyMMdd}\">\n" +
152-
" <PatternLayout pattern=\"%m%n\" />\n" +
153-
" <Policies>\n" +
154-
" <TimeBasedTriggeringPolicy interval=\"1\"\n" +
155-
" modulate=\"true\" />\n" +
156-
" </Policies>\n" +
157-
" </RollingRandomAccessFile>\n" +
158-
"\n" +
159-
" </Appenders>\n" +
160-
"\n" +
161-
"\n" +
162-
" <Loggers>\n" +
163-
" <Root level=\"info\">\n" +
164-
" <AppenderRef ref=\"Console\" />\n" +
165-
" <AppenderRef ref=\"File\" />\n" +
166-
" </Root>\n" +
167-
" </Loggers>\n" +
168-
"</Configuration>";
182+
String logTemplate = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<Configuration status=\"INFO\">\n" + " <properties>\n"
183+
+ " <property name=\"LOG_PATH\">{{LOG_PATH}}</property>\n" + " </properties>\n" + " <Appenders>\n"
184+
+ " <Console name=\"Console\" target=\"SYSTEM_OUT\">\n" + " <PatternLayout pattern=\"%c-%-4r %-5p [%d{yyyy-MM-dd HH:mm:ss}] %m%n\" />\n"
185+
+ " </Console>\n" + "\n" + " <RollingRandomAccessFile name=\"File\" fileName=\"${LOG_PATH}\"\n" + " filePattern=\"${LOG_PATH}-%d{yyyyMMdd}\">\n"
186+
+ " <PatternLayout pattern=\"%m%n\" />\n" + " <Policies>\n" + " <TimeBasedTriggeringPolicy interval=\"1\"\n"
187+
+ " modulate=\"true\" />\n" + " </Policies>\n" + " </RollingRandomAccessFile>\n" + "\n" + " </Appenders>\n" + "\n" + "\n"
188+
+ " <Loggers>\n" + " <Root level=\"info\">\n" + " <AppenderRef ref=\"Console\" />\n" + " <AppenderRef ref=\"File\" />\n"
189+
+ " </Root>\n" + " </Loggers>\n" + "</Configuration>";
169190

170191
wirteFile(log4jFile.getAbsolutePath(), "utf-8", logTemplate.replace("{{LOG_PATH}}", logPath));
171192

0 commit comments

Comments
 (0)