b984aef67d56fa8ccca0d565ccd380713e1656b5
[mdsal.git] / binding2 / mdsal-model-binding2-parent / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- vi: set et smarttab sw=4 tabstop=4: -->
3 <!--
4  Copyright (c) 2016 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.mdsal</groupId>
14         <artifactId>dom-parent</artifactId>
15         <version>0.13.3-SNAPSHOT</version>
16         <relativePath>../../dom/dom-parent</relativePath>
17     </parent>
18
19     <modelVersion>4.0.0</modelVersion>
20     <artifactId>mdsal-model-binding2-parent</artifactId>
21     <packaging>pom</packaging>
22
23     <properties>
24         <salGeneratorPath>${project.build.directory}/generated-sources/mdsal-binding2</salGeneratorPath>
25     </properties>
26
27     <build>
28         <!-- https://bugs.opendaylight.org/show_bug.cgi?id=6252 -->
29         <resources>
30             <resource>
31                 <directory>src/main/resources</directory>
32             </resource>
33             <resource>
34                 <directory>${project.build.directory}/generated-sources/spi</directory>
35             </resource>
36             <resource>
37                 <directory>${project.build.directory}/generated-sources/yang</directory>
38             </resource>
39         </resources>
40     </build>
41
42     <profiles>
43         <profile>
44             <id>binding2-generator</id>
45             <activation>
46                 <file>
47                     <exists>src/main/yang</exists>
48                 </file>
49             </activation>
50             <dependencies>
51                 <dependency>
52                     <groupId>org.opendaylight.mdsal</groupId>
53                     <artifactId>mdsal-binding2-spec</artifactId>
54                 </dependency>
55             </dependencies>
56             <build>
57                 <pluginManagement>
58                     <plugins>
59                         <plugin>
60                             <groupId>org.opendaylight.yangtools</groupId>
61                             <artifactId>yang-maven-plugin</artifactId>
62                             <version>2.0.20</version>
63                             <dependencies>
64                                 <dependency>
65                                     <groupId>org.opendaylight.mdsal</groupId>
66                                     <artifactId>mdsal-binding2-maven-api-gen-plugin</artifactId>
67                                     <version>0.13.3-SNAPSHOT</version>
68                                     <type>jar</type>
69                                 </dependency>
70                             </dependencies>
71                             <executions>
72                                 <execution>
73                                     <id>binding2</id>
74                                     <goals>
75                                         <goal>generate-sources</goal>
76                                     </goals>
77                                     <configuration>
78                                         <codeGenerators>
79                                             <generator>
80                                                 <codeGeneratorClass>org.opendaylight.mdsal.binding.javav2.maven.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
81                                                 <outputBaseDir>${salGeneratorPath}</outputBaseDir>
82                                             </generator>
83                                         </codeGenerators>
84                                         <inspectDependencies>true</inspectDependencies>
85                                     </configuration>
86                                 </execution>
87                             </executions>
88                         </plugin>
89                         <plugin>
90                             <artifactId>maven-clean-plugin</artifactId>
91                             <configuration>
92                                 <filesets>
93                                     <fileset>
94                                         <directory>${salGeneratorPath}</directory>
95                                         <includes>
96                                             <include>**</include>
97                                         </includes>
98                                     </fileset>
99                                 </filesets>
100                             </configuration>
101                         </plugin>
102                         <plugin>
103                             <groupId>org.codehaus.mojo</groupId>
104                             <artifactId>build-helper-maven-plugin</artifactId>
105                             <executions>
106                                 <execution>
107                                     <id>add-yang-sources</id>
108                                     <phase>generate-sources</phase>
109                                     <goals>
110                                         <goal>add-source</goal>
111                                     </goals>
112                                     <configuration>
113                                         <sources>
114                                             <source>${salGeneratorPath}</source>
115                                         </sources>
116                                     </configuration>
117                                 </execution>
118                             </executions>
119                         </plugin>
120                     </plugins>
121                 </pluginManagement>
122                 <plugins>
123                     <plugin>
124                         <groupId>org.opendaylight.yangtools</groupId>
125                         <artifactId>yang-maven-plugin</artifactId>
126                     </plugin>
127                     <plugin>
128                         <groupId>org.codehaus.mojo</groupId>
129                         <artifactId>build-helper-maven-plugin</artifactId>
130                     </plugin>
131                 </plugins>
132             </build>
133         </profile>
134     </profiles>
135 </project>