maven improvements and clean up
[sdc.git] / openecomp-be / dist / sdc-onboard-backend-docker / pom.xml
1 <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
2          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     <name>openecomp-sdc-docker-backend</name>
6     <groupId>org.openecomp.sdc</groupId>
7     <artifactId>openecomp-sdc-docker-backend</artifactId>
8     <packaging>pom</packaging>
9
10     <url>http://maven.apache.org</url>
11
12     <parent>
13         <groupId>org.openecomp.sdc</groupId>
14         <artifactId>openecomp-sdc-docker-dist</artifactId>
15         <version>1.3.0-SNAPSHOT</version>
16     </parent>
17
18
19     <properties>
20         <docker.image.name>sdc-onboard-backend</docker.image.name>
21     </properties>
22     <build>
23         <plugins>
24             <plugin>
25                 <artifactId>maven-resources-plugin</artifactId>
26                 <version>3.0.2</version>
27                         <executions>
28                             <execution>
29                                 <id>copy-resources-war</id>
30                                 <phase>verify</phase>
31                                 <goals>
32                                     <goal>copy-resources</goal>
33                                 </goals>
34                                 <configuration>
35                                     <outputDirectory>${project.basedir}/artifacts</outputDirectory>
36                                     <resources>
37                                         <resource>
38                                             <directory>
39                                                 ${project.parent.basedir}/../../openecomp-be/tools/swagger-ui/target/api-docs
40                                             </directory>
41                                             <includes>
42                                                 <include>api-docs.war</include>
43                                             </includes>
44                                         </resource>
45                                         <resource>
46                                             <directory>
47                                                 ${project.parent.basedir}/../../openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/target
48                                             </directory>
49                                             <includes>
50                                                 <include>onboarding-be-${project.version}.war</include>
51                                             </includes>
52                                         </resource>
53                                         <resource>
54                                             <directory>
55                                                 ${project.parent.basedir}/../../openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/resources
56                                             </directory>
57                                             <includes>
58                                                 <include>onboarding_configuration.yaml</include>
59                                             </includes>
60                                         </resource>
61                                         <resource>
62                                             <directory>
63                                                 ${project.parent.basedir}/../../catalog-be/src/main/resources/config
64                                             </directory>
65                                             <includes>
66                                                 <include>logback.xml</include>
67                                             </includes>
68                                         </resource>
69                                     </resources>
70                                 </configuration>
71                             </execution>
72                         </executions>
73                     </plugin>
74                     <plugin>
75                         <groupId>io.fabric8</groupId>
76                         <artifactId>docker-maven-plugin</artifactId>
77                         <configuration>
78                             <apiVersion>1.23</apiVersion>
79                             <registry>nexus3.onap.org:10001</registry>
80                             <authConfig>
81                                 <pull>
82                                     <username>docker</username>
83                                     <password>docker</password>
84                                 </pull>
85                             </authConfig>
86                             <images>
87
88                                 <!-- Build backend image -->
89                                 <image>
90                                     <name>onap/${docker.image.name}</name>
91                                     <alias>${docker.image.name}</alias>
92                                     <build>
93                                         <cleanup>try</cleanup>
94                                         <dockerFileDir>${project.basedir}/artifacts</dockerFileDir>
95                                         <tags>
96                                             <tag>${docker.tag}</tag>
97                                             <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest</tag>
98                                         </tags>
99                                     </build>
100                                 </image>
101                             </images>
102                         </configuration>
103                         <executions>
104                             <execution>
105                                 <id>clean-images</id>
106                                 <phase>pre-clean</phase>
107                                 <goals>
108                                     <goal>remove</goal>
109                                 </goals>
110                                 <configuration>
111                                     <removeAll>true</removeAll>
112                                     <image>onap/${docker.image.name}</image>
113                                 </configuration>
114                             </execution>
115
116                             <execution>
117                                 <id>generate-images</id>
118                                 <phase>install</phase>
119                                 <goals>
120                                     <goal>build</goal>
121                                 </goals>
122                             </execution>
123
124                             <execution>
125                                 <id>push-images</id>
126                                 <phase>deploy</phase>
127                                 <goals>
128                                     <goal>push</goal>
129                                 </goals>
130                                 <configuration>
131                                     <image>onap/${docker.image.name}</image>
132                                 </configuration>
133                             </execution>
134                         </executions>
135                     </plugin>
136                 </plugins>
137             </build>
138 </project>