提交 bd27910d 编写于 作者: C Calvin

cleanup

上级 b0adb903
......@@ -22,9 +22,11 @@ public class Start {
System.out.println("Server running at " + BASE_URL);
System.out.println("Hit Enter in console to stop server");
if (System.in.read() != 0) {
server.stop();
System.out.println("Server stopped");
}
//wait for close
System.in.read();
server.stop();
server.join();
System.out.println("Server stopped");
}
}
......@@ -19,11 +19,14 @@ public class Start {
public static void main(String[] args) throws Exception {
Server server = JettyFactory.buildNormalServer(PORT, CONTEXT);
server.start();
System.out.println("Server running at " + BASE_URL);
System.out.println("Hit Enter in console to stop server");
if (System.in.read() != 0) {
server.stop();
System.out.println("Server stopped");
}
//wait for close
System.in.read();
server.stop();
server.join();
System.out.println("Server stopped");
}
}
......@@ -19,11 +19,14 @@ public class Start {
public static void main(String[] args) throws Exception {
Server server = JettyFactory.buildNormalServer(PORT, CONTEXT);
server.start();
System.out.println("Server running at " + BASE_URL);
System.out.println("Hit Enter in console to stop server");
if (System.in.read() != 0) {
server.stop();
System.out.println("Server stopped");
}
//wait for close
System.in.read();
server.stop();
server.join();
System.out.println("Server stopped");
}
}
......@@ -243,9 +243,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<wtpversion>none</wtpversion>
</configuration>
</plugin>
<!-- source attach plugin -->
......
......@@ -23,10 +23,12 @@ public class JettyFactory {
*/
public static Server buildNormalServer(int port, String contextPath) {
Server server = new Server(port);
server.setStopAtShutdown(true);
WebAppContext webContext = new WebAppContext("src/main/webapp", contextPath);
webContext.setClassLoader(Thread.currentThread().getContextClassLoader());
server.setHandler(webContext);
server.setStopAtShutdown(true);
return server;
}
......
......@@ -119,9 +119,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<wtpversion>none</wtpversion>
</configuration>
</plugin>
<!-- source attach plugin -->
......
......@@ -49,7 +49,7 @@
<repository>
<id>springside</id>
<name>SpringSide Additional Repository</name>
<url>https://github.com/springside/springside4-repository/raw/master/</url>
<url>http://github.com/springside/springside4-repository/raw/master/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
......@@ -791,14 +791,11 @@
</configuration>
</plugin>
<!-- resource插件, 设定编码 -->
<!-- resource插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<!-- test插件, 仅测试名称为*Test的类,使用支持分组测试的surefire-junit47 driver -->
......@@ -853,7 +850,6 @@
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
......@@ -889,14 +885,11 @@
</configuration>
</plugin>
<!-- jetty插件,设定重载模式 -->
<!-- jetty插件 -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<reload>manual</reload>
</configuration>
</plugin>
<!-- dependency相关插件 -->
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册