7e0d73f7c82e8d4b7ec1d1d12d866060b918a821
[ccsdk/distribution.git] / sliboot / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4     <modelVersion>4.0.0</modelVersion>
5
6     <parent>
7         <groupId>org.onap.ccsdk.parent</groupId>
8         <artifactId>spring-boot-starter-parent</artifactId>
9         <version>2.0.0-SNAPSHOT</version>
10         <relativePath/>
11     </parent>
12
13     <groupId>org.onap.ccsdk.distribution</groupId>
14     <artifactId>distribution-sliboot</artifactId>
15     <version>1.0.0-SNAPSHOT</version>
16     <packaging>pom</packaging>
17
18     <name>ccsdk-distribution :: sliboot</name>
19     <description>Creates Springboot-based Docker container</description>
20     <organization>
21         <name>ONAP</name>
22     </organization>
23
24     <properties>
25         <base.image.name>onap/ccsdk-alpine-image</base.image.name>
26         <image.name>onap/ccsdk-sliboot-alpine-image</image.name>
27         <ccsdk.project.version>${project.version}</ccsdk.project.version>
28         <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
29         <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
30         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
31         <docker.push.phase>deploy</docker.push.phase>
32         <docker.verbose>true</docker.verbose>
33
34         <ccsdk.sli.core.version>1.0.0-SNAPSHOT</ccsdk.sli.core.version>
35         <ccsdk.sliboot.jar>sliapi-springboot-${ccsdk.sli.core.version}.jar</ccsdk.sliboot.jar>
36     </properties>
37
38     <dependencies>
39         <dependency>
40             <groupId>org.onap.ccsdk.sli.core</groupId>
41             <artifactId>sliapi-springboot</artifactId>
42             <version>${ccsdk.sli.core.version}</version>
43         </dependency>
44     </dependencies>
45
46     <build>
47
48         <plugins>
49             <plugin>
50                 <groupId>org.codehaus.groovy.maven</groupId>
51                 <artifactId>gmaven-plugin</artifactId>
52                 <executions>
53                     <execution>
54                         <phase>validate</phase>
55                         <goals>
56                             <goal>execute</goal>
57                         </goals>
58                         <configuration>
59                             <source>${basedir}/../src/main/scripts/TagVersion.groovy</source>
60                         </configuration>
61                     </execution>
62                 </executions>
63             </plugin>
64
65
66             <plugin>
67                 <artifactId>maven-resources-plugin</artifactId>
68                 <version>2.6</version>
69                 <executions>
70                     <execution>
71                         <id>copy-dockerfile</id>
72                         <goals>
73                             <goal>copy-resources</goal>
74                         </goals><!-- here the phase you need -->
75                         <phase>validate</phase>
76                         <configuration>
77                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
78                             <resources>
79                                 <resource>
80                                     <directory>src/main/docker</directory>
81                                     <includes>
82                                         <include>Dockerfile</include>
83                                     </includes>
84                                     <filtering>true</filtering>
85                                 </resource>
86                             </resources>
87                         </configuration>
88                     </execution>
89                     <execution>
90                         <id>copy-config</id>
91                         <goals>
92                             <goal>copy-resources</goal>
93                         </goals><!-- here the phase you need -->
94                         <phase>validate</phase>
95                         <configuration>
96                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/config</outputDirectory>
97                             <resources>
98                                 <resource>
99                                     <directory>src/main/resources</directory>
100                                     <includes>
101                                         <include>*.properties</include>
102                                         <include>*.props</include>
103                                         <include>*.sql</include>
104                                     </includes>
105                                     <filtering>true</filtering>
106                                 </resource>
107                                 <resource>
108                                     <directory>src/main/resources</directory>
109                                     <includes>
110                                         <include>*.keyfile</include>
111                                         <include>*.jks</include>
112                                         <include>*.p12</include>
113                                     </includes>
114                                     <filtering>false</filtering>
115                                 </resource>
116                             </resources>
117                         </configuration>
118                     </execution>
119                     <execution>
120                         <id>copy-script</id>
121                         <goals>
122                             <goal>copy-resources</goal>
123                         </goals><!-- here the phase you need -->
124                         <phase>validate</phase>
125                         <configuration>
126                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/bin</outputDirectory>
127                             <resources>
128                                 <resource>
129                                     <directory>src/main/resources</directory>
130                                     <includes>
131                                         <include>*.sh</include>
132                                     </includes>
133                                     <filtering>true</filtering>
134                                 </resource>
135                             </resources>
136                         </configuration>
137                     </execution>
138                 </executions>
139             </plugin>
140             <plugin>
141                 <groupId>org.apache.maven.plugins</groupId>
142                 <artifactId>maven-dependency-plugin</artifactId>
143                 <version>3.0.2</version>
144                 <executions>
145                     <execution>
146                         <id>copy-dependencies</id>
147                         <goals>
148                             <goal>copy-dependencies</goal>
149                         </goals>
150                         <phase>prepare-package</phase>
151                         <configuration>
152                             <excludeTransitive>true</excludeTransitive>
153                             <outputDirectory>${project.build.directory}/docker-stage/opt/onap/ccsdk/lib</outputDirectory>
154                             <overWriteReleases>false</overWriteReleases>
155                             <overWriteSnapshots>true</overWriteSnapshots>
156                             <overWriteIfNewer>true</overWriteIfNewer>
157                             <useRepositoryLayout>false</useRepositoryLayout>
158                             <addParentPoms>false</addParentPoms>
159                             <copyPom>false</copyPom>
160                         </configuration>
161                     </execution>
162                     <execution>
163                         <id>unpack dgs</id>
164                         <phase>generate-sources</phase>
165                         <goals>
166                             <goal>unpack</goal>
167                         </goals>
168                         <configuration>
169                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk</outputDirectory>
170                             <artifactItems>
171                                 <artifactItem>
172                                     <groupId>${project.groupId}</groupId>
173                                     <artifactId>platform-logic-installer</artifactId>
174                                     <version>${project.version}</version>
175                                     <type>zip</type>
176                                 </artifactItem>
177                             </artifactItems>
178                         </configuration>
179                     </execution>
180                 </executions>
181             </plugin>
182         </plugins>
183     </build>
184
185     <profiles>
186         <profile>
187             <id>docker</id>
188             <build>
189                 <plugins>
190                     <plugin>
191                         <groupId>io.fabric8</groupId>
192                         <artifactId>docker-maven-plugin</artifactId>
193                         <version>0.28.0</version>
194                         <inherited>false</inherited>
195                         <configuration>
196                             <images>
197                                 <image>
198                                     <name>${image.name}</name>
199                                     <build>
200                                         <cleanup>try</cleanup>
201                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
202                                         <dockerFile>Dockerfile</dockerFile>
203                                         <tags>
204                                             <tag>${project.docker.latestminortag.version}</tag>
205                                             <tag>${project.docker.latestfulltag.version}</tag>
206                                             <tag>${project.docker.latesttagtimestamp.version}</tag>
207                                         </tags>
208                                     </build>
209                                 </image>
210                             </images>
211                         </configuration>
212                         <executions>
213                             <execution>
214                                 <id>generate-images</id>
215                                 <phase>package</phase>
216                                 <goals>
217                                     <goal>build</goal>
218                                 </goals>
219                             </execution>
220
221                             <execution>
222                                 <id>push-images</id>
223                                 <phase>${docker.push.phase}</phase>
224                                 <goals>
225                                     <goal>build</goal>
226                                     <goal>push</goal>
227                                 </goals>
228                             </execution>
229                         </executions>
230                     </plugin>
231                 </plugins>
232             </build>
233         </profile>
234     </profiles>
235 </project>