a0af417671e7bbbc5fdc224f3a5def64b2163ada
[controller.git] / opendaylight / config / config-parent / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
4
5 This program and the accompanying materials are made available under the
6 terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 and is available at http://www.eclipse.org/legal/epl-v10.html
8 -->
9 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
11   <parent>
12     <groupId>org.opendaylight.mdsal</groupId>
13     <artifactId>binding-parent</artifactId>
14     <version>0.13.0-SNAPSHOT</version>
15     <relativePath/>
16   </parent>
17
18   <modelVersion>4.0.0</modelVersion>
19   <groupId>org.opendaylight.controller</groupId>
20   <artifactId>config-parent</artifactId>
21   <version>0.9.0-SNAPSHOT</version>
22   <packaging>pom</packaging>
23
24   <properties>
25     <config.version>0.9.0-SNAPSHOT</config.version>
26     <mdsal.version>1.8.0-SNAPSHOT</mdsal.version>
27     <yangtools.version>2.0.2</yangtools.version>
28     <jmxGeneratorPath>${project.build.directory}/generated-sources/config-binding</jmxGeneratorPath>
29     <config.file>src/main/config/default-config.xml</config.file>
30   </properties>
31
32   <dependencyManagement>
33     <dependencies>
34       <!-- project specific dependencies -->
35       <dependency>
36         <groupId>org.opendaylight.controller</groupId>
37         <artifactId>config-artifacts</artifactId>
38         <version>${config.version}</version>
39         <type>pom</type>
40         <scope>import</scope>
41       </dependency>
42       <dependency>
43         <groupId>org.opendaylight.controller</groupId>
44         <artifactId>mdsal-artifacts</artifactId>
45         <version>${mdsal.version}</version>
46         <type>pom</type>
47         <scope>import</scope>
48       </dependency>
49       <dependency>
50         <groupId>org.opendaylight.yangtools</groupId>
51         <artifactId>yangtools-artifacts</artifactId>
52         <version>${yangtools.version}</version>
53         <type>pom</type>
54         <scope>import</scope>
55       </dependency>
56       <dependency>
57         <groupId>org.opendaylight.mdsal</groupId>
58         <artifactId>mdsal-artifacts</artifactId>
59         <version>2.5.0-SNAPSHOT</version>
60         <type>pom</type>
61         <scope>import</scope>
62       </dependency>
63     </dependencies>
64   </dependencyManagement>
65
66   <dependencies>
67     <dependency>
68       <groupId>org.opendaylight.yangtools</groupId>
69       <artifactId>yang-common</artifactId>
70     </dependency>
71     <dependency>
72       <groupId>org.opendaylight.controller</groupId>
73       <artifactId>config-api</artifactId>
74     </dependency>
75     <dependency>
76       <groupId>org.opendaylight.controller</groupId>
77       <artifactId>sal-binding-config</artifactId>
78     </dependency>
79   </dependencies>
80   <build>
81     <pluginManagement>
82       <plugins>
83         <plugin>
84           <groupId>org.opendaylight.yangtools</groupId>
85           <artifactId>yang-maven-plugin</artifactId>
86           <version>${yangtools.version}</version>
87           <dependencies>
88             <dependency>
89               <groupId>org.opendaylight.controller</groupId>
90               <artifactId>yang-jmx-generator-plugin</artifactId>
91               <version>${config.version}</version>
92             </dependency>
93           </dependencies>
94           <executions>
95             <execution>
96               <id>config</id>
97               <goals>
98                 <goal>generate-sources</goal>
99               </goals>
100               <configuration>
101                 <codeGenerators>
102                   <generator>
103                     <codeGeneratorClass>org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator</codeGeneratorClass>
104                     <outputBaseDir>${jmxGeneratorPath}</outputBaseDir>
105                     <additionalConfiguration>
106                       <namespaceToPackage1>urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang</namespaceToPackage1>
107                     </additionalConfiguration>
108                   </generator>
109                 </codeGenerators>
110                 <inspectDependencies>true</inspectDependencies>
111               </configuration>
112             </execution>
113           </executions>
114         </plugin>
115         <plugin>
116           <artifactId>maven-clean-plugin</artifactId>
117           <configuration>
118             <filesets>
119               <fileset>
120                 <directory>${jmxGeneratorPath}</directory>
121                 <includes>
122                   <include>**</include>
123                 </includes>
124               </fileset>
125               <fileset>
126                 <directory>${salGeneratorPath}</directory>
127                 <includes>
128                   <include>**</include>
129                 </includes>
130               </fileset>
131             </filesets>
132           </configuration>
133         </plugin>
134         <plugin>
135           <groupId>org.codehaus.mojo</groupId>
136           <artifactId>build-helper-maven-plugin</artifactId>
137           <executions>
138             <execution>
139               <id>add-yang-sources</id>
140               <phase>generate-sources</phase>
141               <goals>
142                 <goal>add-source</goal>
143               </goals>
144               <configuration>
145                 <sources>
146                   <source>${jmxGeneratorPath}</source>
147                   <source>${salGeneratorPath}</source>
148                 </sources>
149               </configuration>
150             </execution>
151           </executions>
152         </plugin>
153
154         <!-- This has to match the definition in odlparent and exists only
155              because for some reason PMD does not understand wildcards. -->
156         <plugin>
157           <groupId>org.apache.maven.plugins</groupId>
158           <artifactId>maven-pmd-plugin</artifactId>
159           <executions>
160             <execution>
161               <id>cpd</id>
162               <phase>process-sources</phase>
163               <goals>
164                 <goal>cpd-check</goal>
165               </goals>
166               <configuration>
167                 <excludeRoots>
168                   <excludeRoot>${jmxGeneratorPath}</excludeRoot>
169                   <excludeRoot>${salGeneratorPath}</excludeRoot>
170                 </excludeRoots>
171               </configuration>
172             </execution>
173           </executions>
174         </plugin>
175       </plugins>
176     </pluginManagement>
177   </build>
178   <profiles>
179     <profile>
180       <id>attach-config-without-filtering</id>
181       <activation>
182         <file>
183           <exists>${config.file}</exists>
184         </file>
185       </activation>
186       <build>
187         <pluginManagement>
188           <plugins>
189             <plugin>
190               <groupId>org.codehaus.mojo</groupId>
191               <artifactId>build-helper-maven-plugin</artifactId>
192               <executions>
193                 <execution>
194                   <id>attach-artifacts</id>
195                   <goals>
196                     <goal>attach-artifact</goal>
197                   </goals>
198                   <phase>package</phase>
199                   <configuration>
200                     <artifacts>
201                       <artifact>
202                         <file>${config.file}</file>
203                         <type>xml</type>
204                         <classifier>config</classifier>
205                       </artifact>
206                     </artifacts>
207                   </configuration>
208                 </execution>
209               </executions>
210             </plugin>
211           </plugins>
212         </pluginManagement>
213         <plugins>
214           <plugin>
215             <groupId>org.codehaus.mojo</groupId>
216             <artifactId>build-helper-maven-plugin</artifactId>
217           </plugin>
218         </plugins>
219       </build>
220     </profile>
221   </profiles>
222 </project>