-
Notifications
You must be signed in to change notification settings - Fork 4
/
pom.xml
170 lines (154 loc) · 5.97 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.mainstreethub</groupId>
<artifactId>parent-pom</artifactId>
<version>1.6.6</version>
</parent>
<artifactId>ecs-parent-pom</artifactId>
<version>1.5.0-SNAPSHOT</version>
<packaging>pom</packaging>
<scm>
<url>https://github.com/mainstreethub/ecs-parent-pom</url>
<connection>scm:git:https://github.com/mainstreethub/ecs-parent-pom</connection>
<developerConnection>scm:git:https://github.com/mainstreethub/ecs-parent-pom</developerConnection>
<tag>HEAD</tag>
</scm>
<properties>
<docker.maven.plugin.version>0.26.0</docker.maven.plugin.version>
<ecr.maven.plugin.version>0.1.0</ecr.maven.plugin.version>
<maven.release.plugin.version>2.5.3</maven.release.plugin.version>
<!-- By default only build and publish Docker images when specifically asked. -->
<skip.docker.image.build>true</skip.docker.image.build>
<skip.docker.image.push>true</skip.docker.image.push>
<!-- Base image which the application is added to -->
<docker.image.base>docker.io/openjdk:8-jre-alpine</docker.image.base>
<!-- Name of the image -->
<docker.image.name>${docker.repository}/${docker.artifactId}:${project.version}</docker.image.name>
<!-- The address of the MainStreetHub docker registry in ECR. -->
<docker.repository>681582213432.dkr.ecr.us-east-1.amazonaws.com</docker.repository>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.mainstreethub</groupId>
<artifactId>ecr-maven-plugin</artifactId>
<version>${ecr.maven.plugin.version}</version>
<!-- At the beginning of mvn:deploy, connect to ECR to get a login. -->
<executions>
<execution>
<phase>deploy</phase>
<goals>
<goal>login</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker.maven.plugin.version}</version>
<configuration>
<verbose>true</verbose>
<skip>${skip.docker.image.build}</skip>
</configuration>
<executions>
<!-- As part of mvn:package build the Docker image. -->
<execution>
<id>docker-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
<configuration>
<!-- Always check for a newer version of the base image and download it. -->
<autoPull>always</autoPull>
<images>
<image>
<name>${docker.image.name}</name>
<build>
<skip>${skip.docker.image.build}</skip>
<from>${docker.image.base}</from>
<tags>
<tag>latest</tag>
</tags>
<entryPoint>
<arg>java</arg>
<arg>-jar</arg>
<arg>maven/${project.build.finalName}.jar</arg>
</entryPoint>
<labels>
<application>${docker.artifactId}</application>
<version>${project.version}</version>
</labels>
<!-- Include the maven build artifact in the docker image. -->
<assembly>
<descriptorRef>artifact</descriptorRef>
</assembly>
</build>
</image>
</images>
</configuration>
</execution>
<!-- As part of mvn:deploy publish the Docker image to ECR. -->
<execution>
<id>docker-push</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
<!-- Remove our image after pushing it to the repository. -->
<goal>remove</goal>
</goals>
<configuration>
<skip>${skip.docker.image.push}</skip>
<removeAll>true</removeAll>
<skipExtendedAuth>true</skipExtendedAuth>
<images>
<image>
<name>${docker.repository}/${docker.artifactId}:${project.version}</name>
<build>
<tags>
<tag>latest</tag>
</tags>
</build>
</image>
</images>
<authConfig>
<username>${aws.ecr.login.user}</username>
<password>${aws.ecr.login.password}</password>
</authConfig>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>artifactory.mirror</id>
<name>Artifactory Maven Central Mirror</name>
<url>https://artifactory.secureserver.net/artifactory/java-virt</url>
</repository>
<repository>
<id>maven-s3-release-repo</id>
<name>S3 Release Repository</name>
<url>s3://artifacts.mainstreethub.com/maven/releases</url>
</repository>
</repositories>
<profiles>
<profile>
<id>docker</id>
<properties>
<skip.docker.image.build>false</skip.docker.image.build>
<skip.docker.image.push>false</skip.docker.image.push>
</properties>
</profile>
</profiles>
</project>