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>
5 <groupId>org.opendaylight.controller</groupId>
6 <artifactId>commons.opendaylight</artifactId>
7 <version>1.5.0-SNAPSHOT</version>
8 <relativePath>../../../commons/opendaylight</relativePath>
11 <artifactId>swagger-ui</artifactId>
12 <version>0.1.0-SNAPSHOT</version>
13 <packaging>bundle</packaging>
16 <api.dir>${resource.dir}/apis</api.dir>
17 <resource.dir>${project.build.directory}/classes</resource.dir>
22 <groupId>com.google.code.gson</groupId>
23 <artifactId>gson</artifactId>
26 <groupId>equinoxSDK381</groupId>
27 <artifactId>javax.servlet</artifactId>
29 <!-- add dependency on all northbound bundles -->
31 <groupId>org.opendaylight.controller</groupId>
32 <artifactId>connectionmanager.northbound</artifactId>
35 <groupId>org.opendaylight.controller</groupId>
36 <artifactId>controllermanager.northbound</artifactId>
39 <groupId>org.opendaylight.controller</groupId>
40 <artifactId>flowprogrammer.northbound</artifactId>
43 <groupId>org.opendaylight.controller</groupId>
44 <artifactId>forwarding.staticrouting.northbound</artifactId>
47 <groupId>org.opendaylight.controller</groupId>
48 <artifactId>hosttracker.northbound</artifactId>
51 <groupId>org.opendaylight.controller</groupId>
52 <artifactId>networkconfig.bridgedomain.northbound</artifactId>
55 <groupId>org.opendaylight.controller</groupId>
56 <artifactId>statistics.northbound</artifactId>
59 <groupId>org.opendaylight.controller</groupId>
60 <artifactId>subnets.northbound</artifactId>
63 <groupId>org.opendaylight.controller</groupId>
64 <artifactId>switchmanager.northbound</artifactId>
67 <groupId>org.opendaylight.controller</groupId>
68 <artifactId>topology.northbound</artifactId>
71 <groupId>org.opendaylight.controller</groupId>
72 <artifactId>usermanager.northbound</artifactId>
75 <groupId>org.opendaylight.controller</groupId>
76 <artifactId>networkconfig.neutron.northbound</artifactId>
79 <groupId>org.slf4j</groupId>
80 <artifactId>slf4j-api</artifactId>
87 <groupId>org.apache.felix</groupId>
88 <artifactId>maven-bundle-plugin</artifactId>
89 <extensions>true</extensions>
92 <Export-Package></Export-Package>
93 <Import-Package>org.slf4j,
97 javax.servlet.annotation,
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>
115 <groupId>org.apache.maven.plugins</groupId>
116 <artifactId>maven-antrun-plugin</artifactId>
117 <version>1.7</version>
120 <groupId>ant-contrib</groupId>
121 <artifactId>ant-contrib</artifactId>
122 <version>1.0b3</version>
125 <groupId>ant</groupId>
126 <artifactId>ant</artifactId>
136 <phase>generate-sources</phase>
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>
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>
157 <!-- Copy NorthBound json files into ui directory-->
158 <copy todir="${api.dir}">
159 <fileset dir="${basedir}/../../..">
160 <patternset refid="rest.paths"></patternset>
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>
169 <!-- Correct base path -->
170 <replaceregexp match="/full" replace="">
171 <fileset dir="${api.dir}">
172 <include name="**/*Northbound"></include>
175 <!-- Merge Resource list -->
176 <echo append="false" file="${resource.dir}/apilist.json">{
177 "swaggerVersion": "1.1",
178 "basePath": "http://localhost:8080/swagger/apis",
182 <fileset dir="${api.dir}">
183 <include name="**/*resource-list.json"></include>
184 <exclude name="**/neutron*"></exclude>
188 <echo message="Processing json resource @{file}"></echo>
189 <loadfile property="jsoncontent" srcfile="@{file}">
191 <headfilter lines="10"></headfilter>
192 <tailfilter lines="6"></tailfilter>
195 <echo append="true" file="${resource.dir}/apilist.json" message="${jsoncontent},"></echo>
196 <var name="jsoncontent" unset="true"></var>
200 <loadfile property="jsoncontent" srcfile="${api.dir}/neutron-resource-list.json">
202 <headfilter lines="46"></headfilter>
203 <tailfilter lines="42"></tailfilter>
206 <echo append="true" file="${resource.dir}/apilist.json" message="${jsoncontent},"></echo>
207 <var name="jsoncontent" unset="true"></var>
209 <echo append="true" file="${resource.dir}/apilist.json">{ }
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>
217 <!-- cleanup resource files as we don't need them -->
219 <fileset dir="${api.dir}" includes="**/*resource-list.json"></fileset>
221 <echo message="======== Build successful ========"></echo>
230 <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
231 <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
233 <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>