adding pom and phase script
[dcaegen2/platform/cli.git] / dcae-cli / pom.xml
1 <?xml version="1.0"?>
2 <!--
3 ================================================================================
4 Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
5 ================================================================================
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10      http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 ============LICENSE_END=========================================================
18
19 ECOMP is a trademark and service mark of AT&T Intellectual Property.
20 -->
21 <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">
22   <modelVersion>4.0.0</modelVersion>
23   <!--parent>
24     <groupId>org.onap.oparent</groupId>
25     <artifactId>oparent</artifactId>
26     <version>1.0.0-SNAPSHOT</version>
27   </parent-->
28   <parent>
29     <groupId>org.onap.dcaegen2.platform</groupId>
30     <artifactId>cli</artifactId>
31     <version>1.0.0-SNAPSHOT</version>
32   </parent>
33   <groupId>org.onap.dcaegen2.platform.cli</groupId>
34   <artifactId>dcae-cli</artifactId>
35   <name>dcae-cli</name>
36   <version>1.0.0-SNAPSHOT</version>
37   <url>http://maven.apache.org</url>
38   <properties>
39     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
40     <sonar.sources>.</sonar.sources>
41     <!-- customize the SONARQUBE URL -->
42     <sonar.host.url>http://localhost:9000</sonar.host.url>
43     <!-- below are language dependent -->
44     <!-- for Python -->
45     <sonar.language>py</sonar.language>
46     <sonar.pluginName>Python</sonar.pluginName>
47     <sonar.inclusions>**/*.py</sonar.inclusions>
48     <!-- for JavaScaript -->
49     <!--
50     <sonar.language>js</sonar.language>
51     <sonar.pluginName>JS</sonar.pluginName>
52     <sonar.inclusions>**/*.js</sonar.inclusions>
53     -->
54   </properties>
55
56   <build>
57     <finalName>${project.artifactId}-${project.version}</finalName>
58     <pluginManagement>
59       <plugins>
60         <plugin>
61           <groupId>org.codehaus.mojo</groupId>
62           <artifactId>sonar-maven-plugin</artifactId>
63           <version>2.7.1</version>
64         </plugin>
65
66         <!-- nexus-staging-maven-plugin is called during deploy phase by default behavior.
67          we do not need it -->
68         <plugin>
69           <groupId>org.sonatype.plugins</groupId>
70           <artifactId>nexus-staging-maven-plugin</artifactId>
71           <version>1.6.7</version>
72           <configuration>
73             <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
74           </configuration>
75         </plugin>
76       </plugins>
77     </pluginManagement>
78
79     <plugins>
80       <!-- plugin>
81         <artifactId>maven-assembly-plugin</artifactId>
82         <version>2.4.1</version>
83         <configuration>
84           <descriptors>
85             <descriptor>assembly/dep.xml</descriptor>
86           </descriptors>
87         </configuration>
88         <executions>
89           <execution>
90             <id>make-assembly</id>
91             <phase>package</phase>
92             <goals>
93               <goal>single</goal>
94             </goals>
95           </execution>
96         </executions>
97       </plugin -->
98
99       <!-- first disable the default Java plugins at various stages -->
100       <!-- maven-resources-plugin is called during "*resource" phases by default behavior.  it prepares the resources
101        dir.  we do not need it -->
102       <plugin>
103         <groupId>org.apache.maven.plugins</groupId>
104         <artifactId>maven-resources-plugin</artifactId>
105         <version>2.6</version>
106         <configuration>
107           <skip>true</skip>
108         </configuration>
109       </plugin>
110
111       <!-- maven-compiler-plugin is called during "compile" phases by default behavior.  we do not need it -->
112       <plugin>
113         <groupId>org.apache.maven.plugins</groupId>
114         <artifactId>maven-compiler-plugin</artifactId>
115         <version>3.1</version>
116         <configuration>
117           <skip>true</skip>
118         </configuration>
119       </plugin>
120
121       <!-- maven-jar-plugin is called during "compile" phase by default behavior.  we do not need it -->
122       <plugin>
123         <groupId>org.apache.maven.plugins</groupId>
124         <artifactId>maven-jar-plugin</artifactId>
125         <version>2.4</version>
126         <executions>
127           <execution>
128             <id>default-jar</id>
129             <phase/>
130           </execution>
131         </executions>
132       </plugin>
133
134       <!-- maven-install-plugin is called during "install" phase by default behavior.  it tries to copy stuff under 
135        target dir to ~/.m2.  we do not need it -->
136       <plugin>
137         <groupId>org.apache.maven.plugins</groupId>
138         <artifactId>maven-install-plugin</artifactId>
139         <version>2.4</version>
140         <configuration>
141           <skip>true</skip>
142         </configuration>
143       </plugin>
144
145       <!-- maven-surefire-plugin is called during "test" phase by default behavior.  it triggers junit test.
146        we do not need it -->
147       <plugin>
148         <groupId>org.apache.maven.plugins</groupId>
149         <artifactId>maven-surefire-plugin</artifactId>
150         <version>2.12.4</version>
151         <configuration>
152           <skipTests>true</skipTests>
153         </configuration>
154       </plugin>
155
156
157       <!-- now we configure custom action (calling a script) at various lifecycle phases -->
158       <plugin>
159         <groupId>org.codehaus.mojo</groupId>
160         <artifactId>exec-maven-plugin</artifactId>
161         <version>1.2.1</version>
162         <executions>
163           <execution>
164             <id>clean phase script</id>
165             <phase>clean</phase>
166             <goals><goal>exec</goal></goals>
167             <configuration>
168               <executable>${session.executionRootDirectory}/mvn-phase-script.sh</executable>
169               <arguments>
170                 <argument>${project.artifactId}</argument>
171                 <argument>clean</argument>
172               </arguments>
173               <environmentVariables>
174                 <!-- make mvn properties as env for our script -->
175                 <MVN_PROJECT_GROUPID>${project.groupId}</MVN_PROJECT_GROUPID> 
176                 <MVN_PROJECT_ARTIFACTID>${project.artifactId}</MVN_PROJECT_ARTIFACTID> 
177                 <MVN_PROJECT_VERSION>${project.version}</MVN_PROJECT_VERSION> 
178                 <MVN_NEXUSPROXY>${onap.nexus.url}</MVN_NEXUSPROXY> 
179                 <!--MVN_DOCKERREG_URL>${docker.push.registry}</MVN_DOCKERREG_URL--> 
180               </environmentVariables> 
181             </configuration>
182           </execution>
183
184           <execution>
185             <id>generate-sources script</id>
186             <phase>generate-sources</phase>
187             <goals><goal>exec</goal></goals>
188             <configuration>
189               <executable>mvn-phase-script.sh</executable>
190               <arguments>
191                 <argument>${project.artifactId}</argument>
192                 <argument>generate-sources</argument>
193               </arguments>
194               <environmentVariables>
195                 <!-- make mvn properties as env for our script -->
196                 <MVN_PROJECT_GROUPID>${project.groupId}</MVN_PROJECT_GROUPID> 
197                 <MVN_PROJECT_ARTIFACTID>${project.artifactId}</MVN_PROJECT_ARTIFACTID> 
198                 <MVN_PROJECT_VERSION>${project.version}</MVN_PROJECT_VERSION> 
199                 <MVN_NEXUSPROXY>${onap.nexus.url}</MVN_NEXUSPROXY> 
200                 <!--MVN_DOCKERREG_URL>${docker.push.registry}</MVN_DOCKERREG_URL--> 
201               </environmentVariables> 
202             </configuration>
203           </execution>
204
205           <execution>
206             <id>compile script</id>
207             <phase>compile</phase>
208             <goals><goal>exec</goal></goals>
209             <configuration>
210               <executable>mvn-phase-script.sh</executable>
211               <arguments>
212                 <argument>${project.artifactId}</argument>
213                 <argument>compile</argument>
214               </arguments>
215               <environmentVariables>
216                 <!-- make mvn properties as env for our script -->
217                 <MVN_PROJECT_GROUPID>${project.groupId}</MVN_PROJECT_GROUPID> 
218                 <MVN_PROJECT_ARTIFACTID>${project.artifactId}</MVN_PROJECT_ARTIFACTID> 
219                 <MVN_PROJECT_VERSION>${project.version}</MVN_PROJECT_VERSION> 
220                 <MVN_NEXUSPROXY>${onap.nexus.url}</MVN_NEXUSPROXY> 
221                 <!--MVN_DOCKERREG_URL>${docker.push.registry}</MVN_DOCKERREG_URL--> 
222               </environmentVariables> 
223             </configuration>
224           </execution>
225
226           <execution>
227             <id>package script</id>
228             <phase>package</phase>
229             <goals><goal>exec</goal></goals>
230             <configuration>
231               <executable>mvn-phase-script.sh</executable>
232               <arguments>
233                 <argument>${project.artifactId}</argument>
234                 <argument>package</argument>
235               </arguments>
236               <environmentVariables>
237                 <!-- make mvn properties as env for our script -->
238                 <MVN_PROJECT_GROUPID>${project.groupId}</MVN_PROJECT_GROUPID> 
239                 <MVN_PROJECT_ARTIFACTID>${project.artifactId}</MVN_PROJECT_ARTIFACTID> 
240                 <MVN_PROJECT_VERSION>${project.version}</MVN_PROJECT_VERSION> 
241                 <MVN_NEXUSPROXY>${onap.nexus.url}</MVN_NEXUSPROXY> 
242                 <!--MVN_DOCKERREG_URL>${docker.push.registry}</MVN_DOCKERREG_URL--> 
243               </environmentVariables> 
244             </configuration>
245           </execution>
246
247           <execution>
248             <id>test script</id>
249             <phase>test</phase>
250             <goals><goal>exec</goal></goals>
251             <configuration>
252               <executable>mvn-phase-script.sh</executable>
253               <arguments>
254                 <argument>${project.artifactId}</argument>
255                 <argument>test</argument>
256               </arguments>
257               <environmentVariables>
258                 <!-- make mvn properties as env for our script -->
259                 <MVN_PROJECT_GROUPID>${project.groupId}</MVN_PROJECT_GROUPID> 
260                 <MVN_PROJECT_ARTIFACTID>${project.artifactId}</MVN_PROJECT_ARTIFACTID> 
261                 <MVN_PROJECT_VERSION>${project.version}</MVN_PROJECT_VERSION> 
262                 <MVN_NEXUSPROXY>${onap.nexus.url}</MVN_NEXUSPROXY> 
263                 <!--MVN_DOCKERREG_URL>${docker.push.registry}</MVN_DOCKERREG_URL--> 
264               </environmentVariables> 
265             </configuration>
266           </execution>
267
268           <execution>
269             <id>install script</id>
270             <phase>install</phase>
271             <goals><goal>exec</goal></goals>
272             <configuration>
273               <executable>mvn-phase-script.sh</executable>
274               <arguments>
275                 <argument>${project.artifactId}</argument>
276                 <argument>install</argument>
277               </arguments>
278               <environmentVariables>
279                 <!-- make mvn properties as env for our script -->
280                 <MVN_PROJECT_GROUPID>${project.groupId}</MVN_PROJECT_GROUPID> 
281                 <MVN_PROJECT_ARTIFACTID>${project.artifactId}</MVN_PROJECT_ARTIFACTID> 
282                 <MVN_PROJECT_VERSION>${project.version}</MVN_PROJECT_VERSION> 
283                 <MVN_NEXUSPROXY>${onap.nexus.url}</MVN_NEXUSPROXY> 
284                 <!--MVN_DOCKERREG_URL>${docker.push.registry}</MVN_DOCKERREG_URL--> 
285               </environmentVariables> 
286             </configuration>
287           </execution>
288
289           <execution>
290             <id>deploy script</id>
291             <phase>deploy</phase>
292             <goals><goal>exec</goal></goals>
293             <configuration>
294               <executable>mvn-phase-script.sh</executable>
295               <arguments>
296                 <argument>${project.artifactId}</argument>
297                 <argument>deploy</argument>
298               </arguments>
299               <environmentVariables>
300                 <!-- make mvn properties as env for our script -->
301                 <MVN_PROJECT_GROUPID>${project.groupId}</MVN_PROJECT_GROUPID> 
302                 <MVN_PROJECT_ARTIFACTID>${project.artifactId}</MVN_PROJECT_ARTIFACTID> 
303                 <MVN_PROJECT_VERSION>${project.version}</MVN_PROJECT_VERSION> 
304                 <MVN_NEXUSPROXY>${onap.nexus.url}</MVN_NEXUSPROXY> 
305                 <!--MVN_DOCKERREG_URL>${docker.push.registry}</MVN_DOCKERREG_URL--> 
306               </environmentVariables> 
307             </configuration>
308           </execution>
309         </executions>
310       </plugin>
311     </plugins>
312   </build>
313 </project>