Add new sliboot container
[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>*.sql</include>
103                                     </includes>
104                                     <filtering>true</filtering>
105                                 </resource>
106                             </resources>
107                         </configuration>
108                     </execution>
109                     <execution>
110                         <id>copy-script</id>
111                         <goals>
112                             <goal>copy-resources</goal>
113                         </goals><!-- here the phase you need -->
114                         <phase>validate</phase>
115                         <configuration>
116                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk/bin</outputDirectory>
117                             <resources>
118                                 <resource>
119                                     <directory>src/main/resources</directory>
120                                     <includes>
121                                         <include>*.sh</include>
122                                     </includes>
123                                     <filtering>true</filtering>
124                                 </resource>
125                             </resources>
126                         </configuration>
127                     </execution>
128                 </executions>
129             </plugin>
130             <plugin>
131                 <groupId>org.apache.maven.plugins</groupId>
132                 <artifactId>maven-dependency-plugin</artifactId>
133                 <version>3.0.2</version>
134                 <executions>
135                     <execution>
136                         <id>copy-dependencies</id>
137                         <goals>
138                             <goal>copy-dependencies</goal>
139                         </goals>
140                         <phase>prepare-package</phase>
141                         <configuration>
142                             <excludeTransitive>true</excludeTransitive>
143                             <outputDirectory>${project.build.directory}/docker-stage/opt/onap/ccsdk/lib</outputDirectory>
144                             <overWriteReleases>false</overWriteReleases>
145                             <overWriteSnapshots>true</overWriteSnapshots>
146                             <overWriteIfNewer>true</overWriteIfNewer>
147                             <useRepositoryLayout>false</useRepositoryLayout>
148                             <addParentPoms>false</addParentPoms>
149                             <copyPom>false</copyPom>
150                         </configuration>
151                     </execution>
152                     <execution>
153                         <id>unpack dgs</id>
154                         <phase>generate-sources</phase>
155                         <goals>
156                             <goal>unpack</goal>
157                         </goals>
158                         <configuration>
159                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/ccsdk</outputDirectory>
160                             <artifactItems>
161                                 <artifactItem>
162                                     <groupId>${project.groupId}</groupId>
163                                     <artifactId>platform-logic-installer</artifactId>
164                                     <version>${project.version}</version>
165                                     <type>zip</type>
166                                 </artifactItem>
167                             </artifactItems>
168                         </configuration>
169                     </execution>
170                 </executions>
171             </plugin>
172         </plugins>
173     </build>
174
175     <profiles>
176         <profile>
177             <id>docker</id>
178             <build>
179                 <plugins>
180                     <plugin>
181                         <groupId>io.fabric8</groupId>
182                         <artifactId>docker-maven-plugin</artifactId>
183                         <version>0.28.0</version>
184                         <inherited>false</inherited>
185                         <configuration>
186                             <images>
187                                 <image>
188                                     <name>${image.name}</name>
189                                     <build>
190                                         <cleanup>try</cleanup>
191                                         <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
192                                         <dockerFile>Dockerfile</dockerFile>
193                                         <tags>
194                                             <tag>${project.docker.latestminortag.version}</tag>
195                                             <tag>${project.docker.latestfulltag.version}</tag>
196                                             <tag>${project.docker.latesttagtimestamp.version}</tag>
197                                         </tags>
198                                     </build>
199                                 </image>
200                             </images>
201                         </configuration>
202                         <executions>
203                             <execution>
204                                 <id>generate-images</id>
205                                 <phase>package</phase>
206                                 <goals>
207                                     <goal>build</goal>
208                                 </goals>
209                             </execution>
210
211                             <execution>
212                                 <id>push-images</id>
213                                 <phase>${docker.push.phase}</phase>
214                                 <goals>
215                                     <goal>build</goal>
216                                     <goal>push</goal>
217                                 </goals>
218                             </execution>
219                         </executions>
220                     </plugin>
221                 </plugins>
222             </build>
223         </profile>
224     </profiles>
225 </project>