29bad46905543d346e598bef470fd54bf09232cf
[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.odlparent</groupId>
14         <artifactId>bundle-parent</artifactId>
15         <version>3.0.2</version>
16         <relativePath/>
17     </parent>
18
19     <modelVersion>4.0.0</modelVersion>
20     <groupId>org.opendaylight.mdsal</groupId>
21     <artifactId>mdsal-model-binding2-parent</artifactId>
22     <version>0.13.0-SNAPSHOT</version>
23     <packaging>pom</packaging>
24
25     <properties>
26         <salGeneratorPath>${project.build.directory}/generated-sources/mdsal-binding2</salGeneratorPath>
27     </properties>
28
29     <build>
30         <!-- https://bugs.opendaylight.org/show_bug.cgi?id=6252 -->
31         <resources>
32             <resource>
33                 <directory>src/main/resources</directory>
34             </resource>
35             <resource>
36                 <directory>${project.build.directory}/generated-sources/spi</directory>
37             </resource>
38             <resource>
39                 <directory>${project.build.directory}/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>2.0.2</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>2.5.0-SNAPSHOT</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>0.13.0-SNAPSHOT</version>
64               <type>pom</type>
65               <scope>import</scope>
66             </dependency>
67         </dependencies>
68     </dependencyManagement>
69
70     <profiles>
71         <profile>
72             <id>binding2-generator</id>
73             <activation>
74                 <file>
75                     <exists>src/main/yang</exists>
76                 </file>
77             </activation>
78             <dependencies>
79                 <dependency>
80                     <groupId>org.opendaylight.mdsal</groupId>
81                     <artifactId>mdsal-binding2-spec</artifactId>
82                 </dependency>
83             </dependencies>
84             <build>
85                 <pluginManagement>
86                     <plugins>
87                         <plugin>
88                             <groupId>org.opendaylight.yangtools</groupId>
89                             <artifactId>yang-maven-plugin</artifactId>
90                             <version>2.0.2</version>
91                             <dependencies>
92                                 <dependency>
93                                     <groupId>org.opendaylight.mdsal</groupId>
94                                     <artifactId>mdsal-binding2-maven-api-gen-plugin</artifactId>
95                                     <version>0.13.0-SNAPSHOT</version>
96                                     <type>jar</type>
97                                 </dependency>
98                             </dependencies>
99                             <executions>
100                                 <execution>
101                                     <id>binding2</id>
102                                     <goals>
103                                         <goal>generate-sources</goal>
104                                     </goals>
105                                     <configuration>
106                                         <codeGenerators>
107                                             <generator>
108                                                 <codeGeneratorClass>org.opendaylight.mdsal.binding.javav2.maven.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
109                                                 <outputBaseDir>${salGeneratorPath}</outputBaseDir>
110                                             </generator>
111                                         </codeGenerators>
112                                         <inspectDependencies>true</inspectDependencies>
113                                     </configuration>
114                                 </execution>
115                             </executions>
116                         </plugin>
117                         <plugin>
118                             <artifactId>maven-clean-plugin</artifactId>
119                             <configuration>
120                                 <filesets>
121                                     <fileset>
122                                         <directory>${salGeneratorPath}</directory>
123                                         <includes>
124                                             <include>**</include>
125                                         </includes>
126                                     </fileset>
127                                 </filesets>
128                             </configuration>
129                         </plugin>
130                         <plugin>
131                             <groupId>org.codehaus.mojo</groupId>
132                             <artifactId>build-helper-maven-plugin</artifactId>
133                             <executions>
134                                 <execution>
135                                     <id>add-yang-sources</id>
136                                     <phase>generate-sources</phase>
137                                     <goals>
138                                         <goal>add-source</goal>
139                                     </goals>
140                                     <configuration>
141                                         <sources>
142                                             <source>${salGeneratorPath}</source>
143                                         </sources>
144                                     </configuration>
145                                 </execution>
146                             </executions>
147                         </plugin>
148                     </plugins>
149                 </pluginManagement>
150                 <plugins>
151                     <plugin>
152                         <groupId>org.opendaylight.yangtools</groupId>
153                         <artifactId>yang-maven-plugin</artifactId>
154                     </plugin>
155                     <plugin>
156                         <groupId>org.codehaus.mojo</groupId>
157                         <artifactId>build-helper-maven-plugin</artifactId>
158                     </plugin>
159                 </plugins>
160             </build>
161         </profile>
162     </profiles>
163 </project>