Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
28054c7d
Commit
28054c7d
authored
Jun 20, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] add local jetty run to run fast
parent
73da29b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
pom.xml
atms-api/pom.xml
+13
-0
JettyLauncher.java
atms-api/src/test/java/pwc/taxtech/atms/JettyLauncher.java
+41
-0
No files found.
atms-api/pom.xml
View file @
28054c7d
...
...
@@ -316,6 +316,19 @@
<artifactId>
guava
</artifactId>
<version>
24.0-jre
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.eclipse.jetty.aggregate/jetty-all -->
<!-- https://mvnrepository.com/artifact/org.eclipse.jetty.aggregate/jetty-all -->
<dependency>
<groupId>
org.eclipse.jetty.aggregate
</groupId>
<artifactId>
jetty-all
</artifactId>
<version>
9.4.10.v20180503
</version>
<type>
pom
</type>
</dependency>
<dependency>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
apache-jsp
</artifactId>
<version>
9.4.10.v20180503
</version>
</dependency>
</dependencies>
<profiles>
...
...
atms-api/src/test/java/pwc/taxtech/atms/JettyLauncher.java
0 → 100644
View file @
28054c7d
package
pwc
.
taxtech
.
atms
;
import
org.eclipse.jetty.server.Server
;
import
org.eclipse.jetty.webapp.WebAppContext
;
import
org.eclipse.jetty.websocket.jsr356.server.ServerContainer
;
import
org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer
;
public
class
JettyLauncher
{
public
static
void
main
(
String
[]
args
)
{
int
port
=
8180
;
Server
server
=
new
Server
(
port
);
WebAppContext
webAppContext
=
new
WebAppContext
(
"webapp"
,
"/"
);
webAppContext
.
setDescriptor
(
"webapp/WEB-INF/web.xml"
);
webAppContext
.
setResourceBase
(
"src/main/webapp"
);
webAppContext
.
setDisplayName
(
"atms-api"
);
webAppContext
.
setClassLoader
(
Thread
.
currentThread
().
getContextClassLoader
());
webAppContext
.
setConfigurationDiscovered
(
true
);
webAppContext
.
setParentLoaderPriority
(
true
);
server
.
setHandler
(
webAppContext
);
System
.
out
.
println
(
webAppContext
.
getContextPath
());
System
.
out
.
println
(
webAppContext
.
getDescriptor
());
System
.
out
.
println
(
webAppContext
.
getResourceBase
());
System
.
out
.
println
(
webAppContext
.
getBaseResource
());
try
{
ServerContainer
wscontainer
=
WebSocketServerContainerInitializer
.
configureContext
(
webAppContext
);
// Add WebSocket endpoint to javax.websocket layer
// wscontainer.addEndpoint(MyWebSocket.class); //这行是如果需要使用websocket就加上,不需要就注释掉这行,mywebsocket是自己写的websocket服务类
server
.
start
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
System
.
out
.
println
(
"server is start, port is "
+
port
+
"............"
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment