Effort to reduce image layer and size
[sdnc/oam.git] / installation / ueb-listener / 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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3     <modelVersion>4.0.0</modelVersion>
4
5     <parent>
6         <groupId>org.onap.sdnc.oam</groupId>
7         <artifactId>installation</artifactId>
8         <version>2.2.0-SNAPSHOT</version>
9     </parent>
10
11     <artifactId>installation-ueb-listener</artifactId>
12     <packaging>pom</packaging>
13
14     <name>sdnc-oam :: installation :: ${project.artifactId}</name>
15     <description>Creates ueb-listener Docker container</description>
16     <organization>
17         <name>ONAP</name>
18     </organization>
19
20     <properties>
21         <image.name>onap/sdnc-ueb-listener-image</image.name>
22         <sdnc.project.version>${project.version}</sdnc.project.version>
23         <sdnc.build.timestamp>${maven.build.timestamp}</sdnc.build.timestamp>
24         <ccsdk.docker.version>${ccsdk.docker.alpine.j11.version}</ccsdk.docker.version>
25         <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
26         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
27     </properties>
28
29     <build>
30         <plugins>
31             <plugin>
32                 <groupId>org.codehaus.groovy.maven</groupId>
33                 <artifactId>gmaven-plugin</artifactId>
34                 <version>1.0</version>
35                 <executions>
36                     <execution>
37                         <phase>validate</phase>
38                         <goals>
39                             <goal>execute</goal>
40                         </goals>
41                         <configuration>
42                             <source>${basedir}/../TagVersion.groovy</source>
43                         </configuration>
44                     </execution>
45                 </executions>
46             </plugin>
47             <plugin>
48                 <artifactId>maven-resources-plugin</artifactId>
49                 <version>2.6</version>
50                 <executions>
51                     <execution>
52                         <id>copy-dockerfile</id>
53                         <goals>
54                             <goal>copy-resources</goal>
55                         </goals><!-- here the phase you need -->
56                         <phase>validate</phase>
57                         <configuration>
58                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
59                             <resources>
60                                 <resource>
61                                     <directory>src/main/docker</directory>
62                                     <includes>
63                                         <include>Dockerfile</include>
64                                     </includes>
65                                     <filtering>true</filtering>
66                                 </resource>
67                             </resources>
68                         </configuration>
69                     </execution>
70                     <execution>
71                         <id>copy-scripts</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/opt/onap/sdnc/ueb-listener/bin</outputDirectory>
78                             <resources>
79                                 <resource>
80                                     <directory>src/main/scripts</directory>
81                                     <includes>
82                                         <include>*.sh</include>
83                                     </includes>
84                                     <filtering>true</filtering>
85                                 </resource>
86                             </resources>
87                         </configuration>
88                     </execution>
89                     <execution>
90                         <id>copy-properties</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/sdnc/data/properties</outputDirectory>
97                             <resources>
98                                 <resource>
99                                     <directory>src/main/properties</directory>
100                                     <includes>
101                                         <include>*</include>
102                                     </includes>
103                                     <filtering>true</filtering>
104                                 </resource>
105                             </resources>
106                         </configuration>
107                     </execution>
108                 </executions>
109             </plugin>
110             <plugin>
111                 <groupId>org.apache.maven.plugins</groupId>
112                 <artifactId>maven-dependency-plugin</artifactId>
113                 <executions>
114                     <execution>
115                         <id>unpack</id>
116                         <goals>
117                             <goal>unpack</goal>
118                         </goals>
119                         <phase>initialize</phase>
120                         <configuration>
121                             <artifactItems>
122                                 <artifactItem>
123                                     <groupId>org.onap.ccsdk.sli.northbound</groupId>
124                                     <artifactId>ueb-listener</artifactId>
125                                     <type>zip</type>
126                                     <version>${ccsdk.sli.northbound.version}</version>
127                                 </artifactItem>
128                             </artifactItems>
129                             <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/ueb-listener</outputDirectory>
130                             <excludes>bin/**,**/*-javadoc.jar,**/*-sources.jar</excludes>
131                             <overWriteReleases>true</overWriteReleases>
132                             <overWriteSnapshots>true</overWriteSnapshots>
133                         </configuration>
134                     </execution>
135                 </executions>
136             </plugin>
137             <plugin>
138                 <groupId>org.apache.maven.plugins</groupId>
139                 <artifactId>maven-antrun-plugin</artifactId>
140                 <version>1.8</version>
141                 <executions>
142                     <execution>
143                         <id>change-shell-permissions</id>
144                         <phase>process-sources</phase>
145                         <configuration>
146                             <target>
147                                 <chmod dir="${basedir}/target/docker-stage/opt/onap/sdnc" perm="+x" includes="**/*.sh"/>
148                             </target>
149                         </configuration>
150                         <goals>
151                             <goal>run</goal>
152                         </goals>
153                     </execution>
154                 </executions>
155             </plugin>
156         </plugins>
157     </build>
158
159     <profiles>
160         <profile>
161             <id>docker</id>
162             <build>
163                 <plugins>
164                     <plugin>
165                         <groupId>io.fabric8</groupId>
166                         <artifactId>docker-maven-plugin</artifactId>
167                         <version>0.34.0</version>
168                         <inherited>false</inherited>
169                         <configuration>
170                             <images>
171                                 <image>
172                                     <name>${image.name}</name>
173                                     <build>
174                                         <cleanup>try</cleanup>
175                                         <noCache>true</noCache>
176                                         <contextDir>${basedir}/target/docker-stage</contextDir>
177                                         <dockerFile>Dockerfile</dockerFile>
178                                         <tags>
179                                             <tag>${project.docker.latestminortag.version}</tag>
180                                             <tag>${project.docker.latestfulltag.version}</tag>
181                                             <tag>${project.docker.latesttagtimestamp.version}</tag>
182                                         </tags>
183                                     </build>
184                                 </image>
185                             </images>
186                             <verbose>${docker.verbose}</verbose>
187                             <skipPush>${docker.skip.push}</skipPush>
188                         </configuration>
189                         <executions>
190                             <execution>
191                                 <id>build-push-images</id>
192                                 <goals>
193                                     <goal>build</goal>
194                                     <goal>push</goal>
195                                 </goals>
196                             </execution>
197                         </executions>
198                     </plugin>
199                 </plugins>
200             </build>
201         </profile>
202     </profiles>
203 </project>