本项目是将restful项目打包成可执行的war包,在docker中执行
环境介绍:
docker 1.10.3
jetty 8
jersey 1.19
关键配置:
1、pom.xml配置
<build>
<finalName>${project.artifactId}
</finalName>
<plugins>
<plugin>
<groupId>org.mortbay.jetty
</groupId>
<artifactId>jetty-maven-plugin
</artifactId>
<version>${jetty.version}
</version>
<configuration>
<systemProperties>
</systemProperties>
<webApp>
<contextPath>/
</contextPath>
</webApp>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins
</groupId>
<artifactId>maven-compiler-plugin
</artifactId>
<version>2.5.1
</version>
<configuration>
<source>1.7
</source>
<target>1.7
</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins
</groupId>
<artifactId>maven-source-plugin
</artifactId>
<version>2.2
</version>
<executions>
<execution>
<id>attach-sources
</id>
<goals>
<goal>jar
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins
</groupId>
<artifactId>maven-dependency-plugin
</artifactId>
<version>2.5.1
</version>
<executions>
<execution>
<id>jetty-classpath
</id>
<phase>prepare-package
</phase>
<goals>
<goal>unpack-dependencies
|