|
| 1 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 2 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 3 | + <parent> |
| 4 | + <artifactId>springboot</artifactId> |
| 5 | + <groupId>com.zyd</groupId> |
| 6 | + <version>0.0.1-SNAPSHOT</version> |
| 7 | + </parent> |
| 8 | + <modelVersion>4.0.0</modelVersion> |
| 9 | + |
| 10 | + <artifactId>springboot-docker</artifactId> |
| 11 | + <packaging>jar</packaging> |
| 12 | + |
| 13 | + <name>springboot-docker</name> |
| 14 | + <url>http://maven.apache.org</url> |
| 15 | + |
| 16 | + <properties> |
| 17 | + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 18 | + <!-- docker镜像的前缀:springboot --> |
| 19 | + <docker.image.prefix>springboot</docker.image.prefix> |
| 20 | + </properties> |
| 21 | + |
| 22 | + <dependencies> |
| 23 | + <dependency> |
| 24 | + <groupId>junit</groupId> |
| 25 | + <artifactId>junit</artifactId> |
| 26 | + <version>3.8.1</version> |
| 27 | + <scope>test</scope> |
| 28 | + </dependency> |
| 29 | + </dependencies> |
| 30 | + |
| 31 | + <build> |
| 32 | + <plugins> |
| 33 | + <plugin> |
| 34 | + <groupId>org.springframework.boot</groupId> |
| 35 | + <artifactId>spring-boot-maven-plugin</artifactId> |
| 36 | + </plugin> |
| 37 | + <!-- maven插件:docker-maven-plugin --> |
| 38 | + <plugin> |
| 39 | + <groupId>com.spotify</groupId> |
| 40 | + <artifactId>docker-maven-plugin</artifactId> |
| 41 | + <version>0.4.11</version> |
| 42 | + <configuration> |
| 43 | + <imageName>${docker.image.prefix}/${project.artifactId}</imageName> |
| 44 | + <dockerDirectory>src/main/docker</dockerDirectory> |
| 45 | + <resources> |
| 46 | + <resource> |
| 47 | + <targetPath>/</targetPath> |
| 48 | + <directory>${project.build.directory}</directory> |
| 49 | + <include>${project.build.finalName}.jar</include> |
| 50 | + </resource> |
| 51 | + </resources> |
| 52 | + </configuration> |
| 53 | + </plugin> |
| 54 | + </plugins> |
| 55 | + <finalName>springboot-docker</finalName> |
| 56 | + </build> |
| 57 | +</project> |
0 commit comments