Add target/generated-sources/spi & yang/ as resource folders
[yangtools.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>target/generated-sources/spi/</directory>
37         </resource>
38         <resource>
39           <directory>target/generated-sources/yang</directory>
40         </resource>
41       </resources>
42     </build>
43
44     <dependencyManagement>
45         <dependencies>
46             <dependency>
47                 <groupId>org.opendaylight.yangtools</groupId>
48                 <artifactId>yangtools-artifacts</artifactId>
49                 <version>${yangtools.version}</version>
50                 <type>pom</type>
51                 <scope>import</scope>
52             </dependency>
53             <dependency>
54                 <groupId>org.opendaylight.mdsal</groupId>
55                 <artifactId>mdsal-artifacts</artifactId>
56                 <version>${mdsal.version}</version>
57                 <type>pom</type>
58                 <scope>import</scope>
59             </dependency>
60             <dependency>
61               <groupId>org.opendaylight.mdsal.model</groupId>
62               <artifactId>mdsal-model-artifacts</artifactId>
63               <version>${mdsalmodel.version}</version>
64               <type>pom</type>
65               <scope>import</scope>
66             </dependency>
67         </dependencies>
68     </dependencyManagement>
69
70     <profiles>
71         <profile>
72             <activation>
73                 <file>
74                     <exists>src/main/yang</exists>
75                 </file>
76             </activation>
77             <dependencies>
78                 <dependency>
79                     <groupId>org.opendaylight.mdsal</groupId>
80                     <artifactId>yang-binding</artifactId>
81                 </dependency>
82             </dependencies>
83             <build>
84                 <pluginManagement>
85                     <plugins>
86                         <plugin>
87                             <groupId>org.opendaylight.yangtools</groupId>
88                             <artifactId>yang-maven-plugin</artifactId>
89                             <version>${yangtools.version}</version>
90                             <dependencies>
91                                 <dependency>
92                                     <groupId>org.opendaylight.mdsal</groupId>
93                                     <artifactId>maven-sal-api-gen-plugin</artifactId>
94                                     <version>0.10.0-SNAPSHOT</version>
95                                     <type>jar</type>
96                                 </dependency>
97                             </dependencies>
98                             <executions>
99                                 <execution>
100                                     <id>binding</id>
101                                     <goals>
102                                         <goal>generate-sources</goal>
103                                     </goals>
104                                     <configuration>
105                                         <codeGenerators>
106                                             <generator>
107                                                 <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
108                                                 <outputBaseDir>${salGeneratorPath}</outputBaseDir>
109                                             </generator>
110                                         </codeGenerators>
111                                         <inspectDependencies>true</inspectDependencies>
112                                     </configuration>
113                                 </execution>
114                             </executions>
115                         </plugin>
116                         <plugin>
117                             <artifactId>maven-clean-plugin</artifactId>
118                             <configuration>
119                                 <filesets>
120                                     <fileset>
121                                         <directory>${salGeneratorPath}</directory>
122                                         <includes>
123                                             <include>**</include>
124                                         </includes>
125                                     </fileset>
126                                 </filesets>
127                             </configuration>
128                         </plugin>
129                         <plugin>
130                             <groupId>org.codehaus.mojo</groupId>
131                             <artifactId>build-helper-maven-plugin</artifactId>
132                             <executions>
133                                 <execution>
134                                     <id>add-yang-sources</id>
135                                     <phase>generate-sources</phase>
136                                     <goals>
137                                         <goal>add-source</goal>
138                                     </goals>
139                                     <configuration>
140                                         <sources>
141                                             <source>${salGeneratorPath}</source>
142                                         </sources>
143                                     </configuration>
144                                 </execution>
145                             </executions>
146                         </plugin>
147
148                         <!-- This has to match the definition in odlparent and exists only
149                              because for some reason PMD does not understand wildcards. -->
150                         <plugin>
151                             <groupId>org.apache.maven.plugins</groupId>
152                             <artifactId>maven-pmd-plugin</artifactId>
153                             <executions>
154                                 <execution>
155                                     <id>cpd</id>
156                                     <phase>process-sources</phase>
157                                     <goals>
158                                         <goal>cpd-check</goal>
159                                     </goals>
160                                     <configuration>
161                                         <excludeRoots>
162                                             <excludeRoot>${salGeneratorPath}</excludeRoot>
163                                         </excludeRoots>
164                                     </configuration>
165                                 </execution>
166                             </executions>
167                         </plugin>
168                     </plugins>
169                 </pluginManagement>
170                 <plugins>
171                     <plugin>
172                         <groupId>org.opendaylight.yangtools</groupId>
173                         <artifactId>yang-maven-plugin</artifactId>
174                     </plugin>
175                     <plugin>
176                         <groupId>org.codehaus.mojo</groupId>
177                         <artifactId>build-helper-maven-plugin</artifactId>
178                     </plugin>
179                 </plugins>
180             </build>
181         </profile>
182     </profiles>
183
184   <!--
185       Maven Site Configuration
186
187       The following configuration is necessary for maven-site-plugin to
188       correctly identify the correct deployment path for OpenDaylight Maven
189       sites.
190   -->
191   <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
192
193   <distributionManagement>
194     <site>
195       <id>opendaylight-site</id>
196       <url>${nexus.site.url}/${project.artifactId}/</url>
197     </site>
198   </distributionManagement>
199
200 </project>