Skip to content

Commit

Permalink
Merge pull request #8821 from swagger-api/ticket-8820
Browse files Browse the repository at this point in the history
ref #8820 - add external classpath to docker image jetty webapp
  • Loading branch information
frantuma authored Oct 17, 2018
2 parents 2807c71 + cb5dcb7 commit c061797
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/swagger-generator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ COPY target/lib/start.jar /jetty_home/
ENV JETTY_HOME /jetty_home
WORKDIR /generator
COPY docker/jetty_base /generator/
COPY docker/ROOT.xml /generator/webapps/ROOT.xml
COPY target/*.war /generator/webapps/ROOT.war
ENV JETTY_BASE /generator
ARG HIDDEN_OPTIONS_DEFAULT_PATH
Expand Down
31 changes: 31 additions & 0 deletions modules/swagger-generator/docker/ROOT.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">

<!--
This file is needed to allow to add an external dir as classpath source for generator webapp.
This is needed specifically to allow to add custom templates/generators as jar files, without needing to
rebuild the image
As `extraClasspath` property of WebAppContext is not capable of interpreting a directory as a jar container
(https://github.com/eclipse/jetty.project/issues/150), such directory is instead used here to list contained
jar files and build a csv string
-->
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/</Set>
<Set name="war"><Property name="jetty.webapps" default="."/>/ROOT.war</Set>
<New id="jarFilter" class="sun.misc.JarFilter">
</New>
<New id="classpathDirFile" class="java.io.File">
<Arg>/jetty_home/lib/shared</Arg>
</New>
<Ref refid="classpathDirFile">
<Call id="files" name="list">
<Arg><Ref refid="jarFilter"/></Arg>
</Call>
</Ref>
<Call id="oneLiner" class="java.lang.String" name="join">
<Arg>,/jetty_home/lib/shared/</Arg>
<Arg><Ref refid="files"/></Arg>
</Call>
<Set name="extraClasspath">/jetty_home/lib/shared/<Ref refid="oneLiner"/></Set>
</Configure>
2 changes: 1 addition & 1 deletion modules/swagger-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
<dockerfile.tag.skip>true</dockerfile.tag.skip>
<docker-latest-tag>unstable</docker-latest-tag>
<maven-plugin-version>1.0.0</maven-plugin-version>
<jetty-version>9.4.11.v20180605</jetty-version>
<jetty-version>9.4.12.v20180830</jetty-version>
<inflector-version>2.0.0-rc2</inflector-version>
<junit-version>4.8.2</junit-version>
<servlet-api.version>3.1.0</servlet-api.version>
Expand Down

0 comments on commit c061797

Please # to comment.