Merge "Bug 1029: Remove dead code: samples/clustersession"
[controller.git] / opendaylight / adsal / northbound / swagger-ui / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <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">
3   <modelVersion>4.0.0</modelVersion>
4   <parent>
5     <groupId>org.opendaylight.controller</groupId>
6     <artifactId>commons.opendaylight</artifactId>
7     <version>1.5.0-SNAPSHOT</version>
8     <relativePath>../../../commons/opendaylight</relativePath>
9   </parent>
10
11   <artifactId>swagger-ui</artifactId>
12   <version>0.1.0-SNAPSHOT</version>
13   <packaging>bundle</packaging>
14
15   <properties>
16     <api.dir>${resource.dir}/apis</api.dir>
17     <resource.dir>${project.build.directory}/classes</resource.dir>
18   </properties>
19
20   <dependencies>
21     <dependency>
22       <groupId>com.google.code.gson</groupId>
23       <artifactId>gson</artifactId>
24     </dependency>
25     <dependency>
26       <groupId>equinoxSDK381</groupId>
27       <artifactId>javax.servlet</artifactId>
28     </dependency>
29     <!-- add dependency on all northbound bundles -->
30     <dependency>
31       <groupId>org.opendaylight.controller</groupId>
32       <artifactId>connectionmanager.northbound</artifactId>
33     </dependency>
34     <dependency>
35       <groupId>org.opendaylight.controller</groupId>
36       <artifactId>controllermanager.northbound</artifactId>
37     </dependency>
38     <dependency>
39       <groupId>org.opendaylight.controller</groupId>
40       <artifactId>flowprogrammer.northbound</artifactId>
41     </dependency>
42     <dependency>
43       <groupId>org.opendaylight.controller</groupId>
44       <artifactId>forwarding.staticrouting.northbound</artifactId>
45     </dependency>
46     <dependency>
47       <groupId>org.opendaylight.controller</groupId>
48       <artifactId>hosttracker.northbound</artifactId>
49     </dependency>
50     <dependency>
51       <groupId>org.opendaylight.controller</groupId>
52       <artifactId>networkconfig.bridgedomain.northbound</artifactId>
53     </dependency>
54     <dependency>
55       <groupId>org.opendaylight.controller</groupId>
56       <artifactId>statistics.northbound</artifactId>
57     </dependency>
58     <dependency>
59       <groupId>org.opendaylight.controller</groupId>
60       <artifactId>subnets.northbound</artifactId>
61     </dependency>
62     <dependency>
63       <groupId>org.opendaylight.controller</groupId>
64       <artifactId>switchmanager.northbound</artifactId>
65     </dependency>
66     <dependency>
67       <groupId>org.opendaylight.controller</groupId>
68       <artifactId>topology.northbound</artifactId>
69     </dependency>
70     <dependency>
71       <groupId>org.opendaylight.controller</groupId>
72       <artifactId>usermanager.northbound</artifactId>
73     </dependency>
74     <dependency>
75       <groupId>org.opendaylight.controller</groupId>
76       <artifactId>networkconfig.neutron.northbound</artifactId>
77     </dependency>
78     <dependency>
79       <groupId>org.slf4j</groupId>
80       <artifactId>slf4j-api</artifactId>
81     </dependency>
82   </dependencies>
83
84   <build>
85     <plugins>
86       <plugin>
87         <groupId>org.apache.felix</groupId>
88         <artifactId>maven-bundle-plugin</artifactId>
89         <extensions>true</extensions>
90         <configuration>
91           <instructions>
92             <Export-Package></Export-Package>
93             <Import-Package>org.slf4j,
94               javax.annotation,
95               javax.naming,
96               javax.servlet,
97               javax.servlet.annotation,
98               javax.servlet.http,
99               com.google.gson,</Import-Package>
100             <Export-Package></Export-Package>
101             <Include-Resource>apis=target/classes/apis,
102                 index.html=target/classes/index.html,
103                 apilist.json=target/classes/apilist.json,
104                 css=target/classes/css,
105                 lib=target/classes/lib,
106                 swagger-ui.min.js=target/classes/swagger-ui.min.js,
107                 swagger-ui.js=target/classes/swagger-ui.js,
108                 images=target/classes/images,
109                 WEB-INF/web.xml=target/classes/WEB-INF/web.xml</Include-Resource>
110             <Web-ContextPath>/swagger</Web-ContextPath>
111           </instructions>
112         </configuration>
113       </plugin>
114       <plugin>
115         <groupId>org.apache.maven.plugins</groupId>
116         <artifactId>maven-antrun-plugin</artifactId>
117         <version>1.7</version>
118         <dependencies>
119           <dependency>
120             <groupId>ant-contrib</groupId>
121             <artifactId>ant-contrib</artifactId>
122             <version>1.0b3</version>
123             <exclusions>
124               <exclusion>
125                 <groupId>ant</groupId>
126                 <artifactId>ant</artifactId>
127               </exclusion>
128             </exclusions>
129           </dependency>
130         </dependencies>
131         <executions>
132           <execution>
133             <goals>
134               <goal>run</goal>
135             </goals>
136             <phase>generate-sources</phase>
137             <configuration>
138               <target>
139                 <taskdef classpathref="maven.plugin.classpath" resource="net/sf/antcontrib/antlib.xml"></taskdef>
140                 <patternset id="rest.paths">
141                   <include name="**/enunciate/generate/swagger/ui/*.json"></include>
142                   <exclude name="**/java-client/**"></exclude>
143                   <exclude name="**/swagger-ui/**"></exclude>
144                 </patternset>
145
146                 <echo message="======== Assembling swagger docs ========"></echo>
147                 <!-- make api directory -->
148                 <mkdir dir="${api.dir}"></mkdir>
149                 <!--  copy swagger libs -->
150                 <copy todir="${resource.dir}">
151                   <fileset dir="../subnets/target/enunciate/generate/swagger/ui">
152                     <exclude name="**/*.json"></exclude>
153                     <exclude name="**/*.png"></exclude>
154                     <exclude name="**/index.html"></exclude>
155                   </fileset>
156                 </copy>
157                 <!--  Copy NorthBound json files into ui directory-->
158                 <copy todir="${api.dir}">
159                   <fileset dir="${basedir}/../../..">
160                     <patternset refid="rest.paths"></patternset>
161                   </fileset>
162                   <mapper>
163                     <regexpmapper from="^(.*)/([^/]+)/*/target/enunciate/generate/swagger/ui/(.*Northbound).*$$" to="\3"></regexpmapper>
164                     <regexpmapper from="^(.*)/neutron/([^/]+)/*/target/enunciate/generate/swagger/ui/(.*resource-list.json)$$" to="neutron-\3"></regexpmapper>
165                     <regexpmapper from="^(.*)/([^/]+)/*/target/enunciate/generate/swagger/ui/(.*resource-list.json)$$" to="\2-\3"></regexpmapper>
166                   </mapper>
167                 </copy>
168
169                 <!--  Correct base path -->
170                 <replaceregexp match="/full" replace="">
171                   <fileset dir="${api.dir}">
172                     <include name="**/*Northbound"></include>
173                   </fileset>
174                 </replaceregexp>
175                 <!--  Merge Resource list -->
176                 <echo append="false" file="${resource.dir}/apilist.json">{
177   "swaggerVersion": "1.1",
178   "basePath": "http://localhost:8080/swagger/apis",
179   "apis": [</echo>
180                 <for param="file">
181                   <path>
182                     <fileset dir="${api.dir}">
183                       <include name="**/*resource-list.json"></include>
184                       <exclude name="**/neutron*"></exclude>
185                     </fileset>
186                   </path>
187                   <sequential>
188                     <echo message="Processing json resource @{file}"></echo>
189                     <loadfile property="jsoncontent" srcfile="@{file}">
190                       <filterchain>
191                         <headfilter lines="10"></headfilter>
192                         <tailfilter lines="6"></tailfilter>
193                       </filterchain>
194                     </loadfile>
195                     <echo append="true" file="${resource.dir}/apilist.json" message="${jsoncontent},"></echo>
196                     <var name="jsoncontent" unset="true"></var>
197                   </sequential>
198                 </for>
199                 <sequential>
200                   <loadfile property="jsoncontent" srcfile="${api.dir}/neutron-resource-list.json">
201                     <filterchain>
202                       <headfilter lines="46"></headfilter>
203                       <tailfilter lines="42"></tailfilter>
204                     </filterchain>
205                   </loadfile>
206                   <echo append="true" file="${resource.dir}/apilist.json" message="${jsoncontent},"></echo>
207                   <var name="jsoncontent" unset="true"></var>
208                 </sequential>
209                 <echo append="true" file="${resource.dir}/apilist.json">{ }
210   ]
211 }</echo>
212
213                 <!-- Remove .json from api paths -->
214                 <replaceregexp file="${resource.dir}/apilist.json" flags="g" match=".json" replace=""></replaceregexp>
215                 <replaceregexp file="${resource.dir}/apilist.json" flags="g" match="JAXRS" replace=""></replaceregexp>
216
217                 <!-- cleanup resource files as we don't need them -->
218                 <delete>
219                   <fileset dir="${api.dir}" includes="**/*resource-list.json"></fileset>
220                 </delete>
221                 <echo message="======== Build successful ========"></echo>
222               </target>
223             </configuration>
224           </execution>
225         </executions>
226       </plugin>
227     </plugins>
228   </build>
229   <scm>
230     <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
231     <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
232     <tag>HEAD</tag>
233     <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
234   </scm>
235 </project>