|
@@ -64,5 +64,56 @@
|
|
</dependency>
|
|
</dependency>
|
|
|
|
|
|
</dependencies>
|
|
</dependencies>
|
|
|
|
+ <build>
|
|
|
|
+ <plugins>
|
|
|
|
+ <plugin>
|
|
|
|
+ <groupId>org.springframework.boot</groupId>
|
|
|
|
+ <artifactId>spring-boot-maven-plugin</artifactId>
|
|
|
|
+ <version>2.1.1.RELEASE</version>
|
|
|
|
+ <configuration>
|
|
|
|
+ <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
|
|
|
+ </configuration>
|
|
|
|
+ <executions>
|
|
|
|
+ <execution>
|
|
|
|
+ <goals>
|
|
|
|
+ <goal>repackage</goal>
|
|
|
|
+ </goals>
|
|
|
|
+ </execution>
|
|
|
|
+ </executions>
|
|
|
|
+ </plugin>
|
|
|
|
+ <plugin>
|
|
|
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
|
+ <artifactId>maven-war-plugin</artifactId>
|
|
|
|
+ <version>3.1.0</version>
|
|
|
|
+ <configuration>
|
|
|
|
+ <failOnMissingWebXml>false</failOnMissingWebXml>
|
|
|
|
+ <warName>${project.artifactId}</warName>
|
|
|
|
+ </configuration>
|
|
|
|
+ </plugin>
|
|
|
|
+ <plugin>
|
|
|
|
+ <groupId>com.spotify</groupId>
|
|
|
|
+ <artifactId>docker-maven-plugin</artifactId>
|
|
|
|
+ <version>1.0.0</version>
|
|
|
|
+ <configuration>
|
|
|
|
+ <imageName>${project.artifactId}:${project.version}</imageName>
|
|
|
|
+ <baseImage>kdvolder/jdk8</baseImage>
|
|
|
|
+ <maintainer>docker_maven docker_maven@email.com</maintainer>
|
|
|
|
+ <workdir>/</workdir>
|
|
|
|
+ <cmd>["java", "-version"]</cmd>
|
|
|
|
+ <entryPoint>["java", "-jar", "${project.build.finalName}.jar"]</entryPoint>
|
|
|
|
+ <!-- 这里是复制 jar 包到 docker 容器指定目录配置 -->
|
|
|
|
+ <resources>
|
|
|
|
+ <resource>
|
|
|
|
+ <targetPath>/</targetPath>
|
|
|
|
+ <directory>${project.build.directory}</directory>
|
|
|
|
+ <include>${project.build.finalName}.jar</include>
|
|
|
|
+ </resource>
|
|
|
|
+ </resources>
|
|
|
|
+ <dockerHost>http://8.140.143.122:2375</dockerHost>
|
|
|
|
+ </configuration>
|
|
|
|
+ </plugin>
|
|
|
|
+ </plugins>
|
|
|
|
+ <finalName>${project.artifactId}</finalName>
|
|
|
|
+ </build>
|
|
|
|
|
|
</project>
|
|
</project>
|