Use FileGenerator for java-api-generator
[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.mdsal</groupId>
14         <artifactId>dom-parent</artifactId>
15         <version>8.0.0-SNAPSHOT</version>
16         <relativePath>../../dom/dom-parent</relativePath>
17     </parent>
18
19     <modelVersion>4.0.0</modelVersion>
20     <artifactId>binding-parent</artifactId>
21     <packaging>pom</packaging>
22
23     <properties>
24         <salGeneratorPath>${project.build.directory}/generated-sources/mdsal-binding</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             <activation>
45                 <file>
46                     <exists>src/main/yang</exists>
47                 </file>
48             </activation>
49             <dependencies>
50                 <dependency>
51                     <groupId>org.opendaylight.mdsal</groupId>
52                     <artifactId>yang-binding</artifactId>
53                 </dependency>
54             </dependencies>
55             <build>
56                 <pluginManagement>
57                     <plugins>
58                         <plugin>
59                             <groupId>org.opendaylight.yangtools</groupId>
60                             <artifactId>yang-maven-plugin</artifactId>
61                             <version>7.0.3</version>
62                             <dependencies>
63                                 <dependency>
64                                     <groupId>org.opendaylight.mdsal</groupId>
65                                     <artifactId>mdsal-binding-generator-impl</artifactId>
66                                     <version>8.0.0-SNAPSHOT</version>
67                                 </dependency>
68                                 <dependency>
69                                     <groupId>org.opendaylight.mdsal</groupId>
70                                     <artifactId>mdsal-binding-java-api-generator</artifactId>
71                                     <version>8.0.0-SNAPSHOT</version>
72                                 </dependency>
73                                 <dependency>
74                                     <groupId>org.opendaylight.mdsal</groupId>
75                                     <artifactId>maven-sal-api-gen-plugin</artifactId>
76                                     <version>8.0.0-SNAPSHOT</version>
77                                 </dependency>
78                             </dependencies>
79                             <executions>
80                                 <execution>
81                                     <id>binding</id>
82                                     <goals>
83                                         <goal>generate-sources</goal>
84                                     </goals>
85                                     <configuration>
86                                         <inspectDependencies>true</inspectDependencies>
87                                     </configuration>
88                                 </execution>
89                             </executions>
90                         </plugin>
91                         <plugin>
92                             <artifactId>maven-clean-plugin</artifactId>
93                             <configuration>
94                                 <filesets>
95                                     <fileset>
96                                         <directory>${salGeneratorPath}</directory>
97                                         <includes>
98                                             <include>**</include>
99                                         </includes>
100                                     </fileset>
101                                 </filesets>
102                             </configuration>
103                         </plugin>
104                         <plugin>
105                             <groupId>org.codehaus.mojo</groupId>
106                             <artifactId>build-helper-maven-plugin</artifactId>
107                             <executions>
108                                 <execution>
109                                     <id>add-yang-sources</id>
110                                     <phase>generate-sources</phase>
111                                     <goals>
112                                         <goal>add-source</goal>
113                                     </goals>
114                                     <configuration>
115                                         <sources>
116                                             <source>${salGeneratorPath}</source>
117                                         </sources>
118                                     </configuration>
119                                 </execution>
120                             </executions>
121                         </plugin>
122
123                         <!-- This has to match the definition in odlparent and exists only
124                              because for some reason PMD does not understand wildcards. -->
125                         <plugin>
126                             <groupId>org.apache.maven.plugins</groupId>
127                             <artifactId>maven-pmd-plugin</artifactId>
128                             <executions>
129                                 <execution>
130                                     <id>cpd</id>
131                                     <phase>process-sources</phase>
132                                     <goals>
133                                         <goal>cpd-check</goal>
134                                     </goals>
135                                     <configuration>
136                                         <excludeRoots>
137                                             <excludeRoot>${salGeneratorPath}</excludeRoot>
138                                         </excludeRoots>
139                                     </configuration>
140                                 </execution>
141                             </executions>
142                         </plugin>
143                     </plugins>
144                 </pluginManagement>
145                 <plugins>
146                     <plugin>
147                         <groupId>org.opendaylight.yangtools</groupId>
148                         <artifactId>yang-maven-plugin</artifactId>
149                     </plugin>
150                     <plugin>
151                         <groupId>org.codehaus.mojo</groupId>
152                         <artifactId>build-helper-maven-plugin</artifactId>
153                     </plugin>
154                 </plugins>
155             </build>
156         </profile>
157     </profiles>
158 </project>