Skip to content

Commit cb5dcb7

Browse files
committed
ref #8820 - add external classpath to docker image jetty webapp
1 parent 2807c71 commit cb5dcb7

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

modules/swagger-generator/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ COPY target/lib/start.jar /jetty_home/
99
ENV JETTY_HOME /jetty_home
1010
WORKDIR /generator
1111
COPY docker/jetty_base /generator/
12+
COPY docker/ROOT.xml /generator/webapps/ROOT.xml
1213
COPY target/*.war /generator/webapps/ROOT.war
1314
ENV JETTY_BASE /generator
1415
ARG HIDDEN_OPTIONS_DEFAULT_PATH
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
3+
4+
<!--
5+
This file is needed to allow to add an external dir as classpath source for generator webapp.
6+
This is needed specifically to allow to add custom templates/generators as jar files, without needing to
7+
rebuild the image
8+
As `extraClasspath` property of WebAppContext is not capable of interpreting a directory as a jar container
9+
(https://github.com/eclipse/jetty.project/issues/150), such directory is instead used here to list contained
10+
jar files and build a csv string
11+
12+
-->
13+
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
14+
<Set name="contextPath">/</Set>
15+
<Set name="war"><Property name="jetty.webapps" default="."/>/ROOT.war</Set>
16+
<New id="jarFilter" class="sun.misc.JarFilter">
17+
</New>
18+
<New id="classpathDirFile" class="java.io.File">
19+
<Arg>/jetty_home/lib/shared</Arg>
20+
</New>
21+
<Ref refid="classpathDirFile">
22+
<Call id="files" name="list">
23+
<Arg><Ref refid="jarFilter"/></Arg>
24+
</Call>
25+
</Ref>
26+
<Call id="oneLiner" class="java.lang.String" name="join">
27+
<Arg>,/jetty_home/lib/shared/</Arg>
28+
<Arg><Ref refid="files"/></Arg>
29+
</Call>
30+
<Set name="extraClasspath">/jetty_home/lib/shared/<Ref refid="oneLiner"/></Set>
31+
</Configure>

modules/swagger-generator/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@
330330
<dockerfile.tag.skip>true</dockerfile.tag.skip>
331331
<docker-latest-tag>unstable</docker-latest-tag>
332332
<maven-plugin-version>1.0.0</maven-plugin-version>
333-
<jetty-version>9.4.11.v20180605</jetty-version>
333+
<jetty-version>9.4.12.v20180830</jetty-version>
334334
<inflector-version>2.0.0-rc2</inflector-version>
335335
<junit-version>4.8.2</junit-version>
336336
<servlet-api.version>3.1.0</servlet-api.version>

0 commit comments

Comments
 (0)