add target/generated-sources/spi & yang/ as resource folders
[mdsal.git] / binding / binding-parent / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- vi: set et smarttab sw=4 tabstop=4: -->
3 <!--
4  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
5
6  This program and the accompanying materials are made available under the
7  terms of the Eclipse Public License v1.0 which accompanies this distribution,
8  and is available at http://www.eclipse.org/legal/epl-v10.html
9 -->
10 <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">
11
12     <parent>
13         <groupId>org.opendaylight.odlparent</groupId>
14         <artifactId>bundle-parent</artifactId>
15         <version>1.8.0-SNAPSHOT</version>
16         <relativePath/>
17     </parent>
18
19     <modelVersion>4.0.0</modelVersion>
20     <groupId>org.opendaylight.mdsal</groupId>
21     <artifactId>binding-parent</artifactId>
22     <version>0.10.0-SNAPSHOT</version>
23     <packaging>pom</packaging>
24
25     <properties>
26         <yangtools.version>1.1.0-SNAPSHOT</yangtools.version>
27         <mdsal.version>2.2.0-SNAPSHOT</mdsal.version>
28         <mdsalmodel.version>0.10.0-SNAPSHOT</mdsalmodel.version>
29         <salGeneratorPath>target/generated-sources/mdsal-binding</salGeneratorPath>
30     </properties>
31
32     <build>
33         <!-- https://bugs.opendaylight.org/show_bug.cgi?id=6252 -->
34         <resources>
35             <resource>
36                 <directory>src/main/resources</directory>
37             </resource>
38             <resource>
39                 <directory>target/generated-sources/spi</directory>
40             </resource>
41             <resource>
42                 <directory>target/generated-sources/yang</directory>
43             </resource>
44         </resources>
45     </build>
46
47     <dependencyManagement>
48         <dependencies>
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>${mdsal.version}</version>
60                 <type>pom</type>
61                 <scope>import</scope>
62             </dependency>
63             <dependency>
64               <groupId>org.opendaylight.mdsal.model</groupId>
65               <artifactId>mdsal-model-artifacts</artifactId>
66               <version>${mdsalmodel.version}</version>
67               <type>pom</type>
68               <scope>import</scope>
69             </dependency>
70         </dependencies>
71     </dependencyManagement>
72
73     <profiles>
74         <profile>
75             <activation>
76                 <file>
77                     <exists>src/main/yang</exists>
78                 </file>
79             </activation>
80             <dependencies>
81                 <dependency>
82                     <groupId>org.opendaylight.mdsal</groupId>
83                     <artifactId>yang-binding</artifactId>
84                 </dependency>
85             </dependencies>
86             <build>
87                 <pluginManagement>
88                     <plugins>
89                         <plugin>
90                             <groupId>org.opendaylight.yangtools</groupId>
91                             <artifactId>yang-maven-plugin</artifactId>
92                             <version>${yangtools.version}</version>
93                             <dependencies>
94                                 <dependency>
95                                     <groupId>org.opendaylight.mdsal</groupId>
96                                     <artifactId>maven-sal-api-gen-plugin</artifactId>
97                                     <version>0.10.0-SNAPSHOT</version>
98                                     <type>jar</type>
99                                 </dependency>
100                             </dependencies>
101                             <executions>
102                                 <execution>
103                                     <id>binding</id>
104                                     <goals>
105                                         <goal>generate-sources</goal>
106                                     </goals>
107                                     <configuration>
108                                         <codeGenerators>
109                                             <generator>
110                                                 <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
111                                                 <outputBaseDir>${salGeneratorPath}</outputBaseDir>
112                                             </generator>
113                                         </codeGenerators>
114                                         <inspectDependencies>true</inspectDependencies>
115                                     </configuration>
116                                 </execution>
117                             </executions>
118                         </plugin>
119                         <plugin>
120                             <artifactId>maven-clean-plugin</artifactId>
121                             <configuration>
122                                 <filesets>
123                                     <fileset>
124                                         <directory>${salGeneratorPath}</directory>
125                                         <includes>
126                                             <include>**</include>
127                                         </includes>
128                                     </fileset>
129                                 </filesets>
130                             </configuration>
131                         </plugin>
132                         <plugin>
133                             <groupId>org.codehaus.mojo</groupId>
134                             <artifactId>build-helper-maven-plugin</artifactId>
135                             <executions>
136                                 <execution>
137                                     <id>add-yang-sources</id>
138                                     <phase>generate-sources</phase>
139                                     <goals>
140                                         <goal>add-source</goal>
141                                     </goals>
142                                     <configuration>
143                                         <sources>
144                                             <source>${salGeneratorPath}</source>
145                                         </sources>
146                                     </configuration>
147                                 </execution>
148                             </executions>
149                         </plugin>
150
151                         <!-- This has to match the definition in odlparent and exists only
152                              because for some reason PMD does not understand wildcards. -->
153                         <plugin>
154                             <groupId>org.apache.maven.plugins</groupId>
155                             <artifactId>maven-pmd-plugin</artifactId>
156                             <executions>
157                                 <execution>
158                                     <id>cpd</id>
159                                     <phase>process-sources</phase>
160                                     <goals>
161                                         <goal>cpd-check</goal>
162                                     </goals>
163                                     <configuration>
164                                         <excludeRoots>
165                                             <excludeRoot>${salGeneratorPath}</excludeRoot>
166                                         </excludeRoots>
167                                     </configuration>
168                                 </execution>
169                             </executions>
170                         </plugin>
171                     </plugins>
172                 </pluginManagement>
173                 <plugins>
174                     <plugin>
175                         <groupId>org.opendaylight.yangtools</groupId>
176                         <artifactId>yang-maven-plugin</artifactId>
177                     </plugin>
178                     <plugin>
179                         <groupId>org.codehaus.mojo</groupId>
180                         <artifactId>build-helper-maven-plugin</artifactId>
181                     </plugin>
182                 </plugins>
183             </build>
184         </profile>
185     </profiles>
186
187   <!--
188       Maven Site Configuration
189
190       The following configuration is necessary for maven-site-plugin to
191       correctly identify the correct deployment path for OpenDaylight Maven
192       sites.
193   -->
194   <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
195
196   <distributionManagement>
197     <site>
198       <id>opendaylight-site</id>
199       <url>${nexus.site.url}/${project.artifactId}/</url>
200     </site>
201   </distributionManagement>
202
203 </project>