|
23 | 23 | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
24 | 24 | <java.version>1.8</java.version> |
25 | 25 | <spring-cloud.version>Dalston.RELEASE</spring-cloud.version> |
| 26 | + <docker.baseDir>${basedir}/src/main/docker</docker.baseDir> |
26 | 27 | </properties> |
27 | 28 |
|
28 | 29 | <dependencies> |
29 | 30 | <dependency> |
30 | 31 | <groupId>org.springframework.boot</groupId> |
31 | 32 | <artifactId>spring-boot-starter-actuator</artifactId> |
32 | 33 | </dependency> |
33 | | - |
| 34 | + <dependency> |
| 35 | + <groupId>org.springframework.boot</groupId> |
| 36 | + <artifactId>spring-boot-starter-actuator</artifactId> |
| 37 | + </dependency> |
34 | 38 | <dependency> |
35 | 39 | <groupId>org.springframework.cloud</groupId> |
36 | 40 | <artifactId>spring-cloud-config-server</artifactId> |
37 | 41 | </dependency> |
| 42 | + <dependency> |
| 43 | + <groupId>org.springframework.cloud</groupId> |
| 44 | + <artifactId>spring-cloud-starter-eureka</artifactId> |
| 45 | + </dependency> |
38 | 46 |
|
39 | 47 | <dependency> |
40 | 48 | <groupId>org.springframework.boot</groupId> |
41 | 49 | <artifactId>spring-boot-starter-test</artifactId> |
42 | 50 | <scope>test</scope> |
43 | 51 | </dependency> |
44 | | - |
45 | | - <dependency> |
46 | | - <groupId>org.springframework.cloud</groupId> |
47 | | - <artifactId>spring-cloud-starter-eureka</artifactId> |
48 | | - </dependency> |
49 | 52 | </dependencies> |
50 | 53 |
|
51 | 54 | <dependencyManagement> |
|
66 | 69 | <groupId>org.springframework.boot</groupId> |
67 | 70 | <artifactId>spring-boot-maven-plugin</artifactId> |
68 | 71 | </plugin> |
| 72 | + <plugin> |
| 73 | + <artifactId>maven-antrun-plugin</artifactId> |
| 74 | + <configuration> |
| 75 | + <tasks> |
| 76 | + <copy file="${project.build.directory}/${project.build.finalName}.jar" |
| 77 | + tofile="${project.build.directory}/${project.artifactId}.jar"/> |
| 78 | + </tasks> |
| 79 | + </configuration> |
| 80 | + <executions> |
| 81 | + <execution> |
| 82 | + <phase>install</phase> |
| 83 | + <goals> |
| 84 | + <goal>run</goal> |
| 85 | + </goals> |
| 86 | + </execution> |
| 87 | + </executions> |
| 88 | + </plugin> |
| 89 | + <plugin> |
| 90 | + <groupId>com.spotify</groupId> |
| 91 | + <artifactId>docker-maven-plugin</artifactId> |
| 92 | + <version>1.0.0</version> |
| 93 | + <executions> |
| 94 | + <execution> |
| 95 | + <id>build-image</id> |
| 96 | + <phase>install</phase> |
| 97 | + <goals> |
| 98 | + <goal>build</goal> |
| 99 | + </goals> |
| 100 | + </execution> |
| 101 | + </executions> |
| 102 | + <configuration> |
| 103 | + <imageName>${project.artifactId}</imageName> |
| 104 | + <dockerDirectory>${docker.baseDir}</dockerDirectory> |
| 105 | + <resources> |
| 106 | + <resource> |
| 107 | + <targetPath>/</targetPath> |
| 108 | + <directory>${project.build.directory}</directory> |
| 109 | + <include>${project.artifactId}.jar</include> |
| 110 | + </resource> |
| 111 | + </resources> |
| 112 | + </configuration> |
| 113 | + </plugin> |
69 | 114 | </plugins> |
70 | 115 | </build> |
71 | | - |
72 | | - |
73 | 116 | </project> |
0 commit comments