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.4.2-SNAPSHOT</version>
8 <relativePath>../../commons/opendaylight</relativePath>
11 <artifactId>swagger-ui</artifactId>
12 <version>0.0.1-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.slf4j</groupId>
76 <artifactId>slf4j-api</artifactId>
83 <groupId>org.apache.felix</groupId>
84 <artifactId>maven-bundle-plugin</artifactId>
85 <extensions>true</extensions>
88 <Export-Package></Export-Package>
89 <Import-Package>org.slf4j,
93 javax.servlet.annotation,
95 com.google.gson,</Import-Package>
96 <Export-Package></Export-Package>
97 <Include-Resource>apis=target/classes/apis,
98 index.html=target/classes/index.html,
99 apilist.json=target/classes/apilist.json,
100 css=target/classes/css,
101 lib=target/classes/lib,
102 swagger-ui.min.js=target/classes/swagger-ui.min.js,
103 swagger-ui.js=target/classes/swagger-ui.js,
104 images=target/classes/images,
105 WEB-INF/web.xml=target/classes/WEB-INF/web.xml</Include-Resource>
106 <Web-ContextPath>/swagger</Web-ContextPath>
111 <groupId>org.apache.maven.plugins</groupId>
112 <artifactId>maven-antrun-plugin</artifactId>
113 <version>1.7</version>
116 <groupId>ant-contrib</groupId>
117 <artifactId>ant-contrib</artifactId>
118 <version>1.0b3</version>
121 <groupId>ant</groupId>
122 <artifactId>ant</artifactId>
132 <phase>generate-sources</phase>
135 <taskdef classpathref="maven.plugin.classpath" resource="net/sf/antcontrib/antlib.xml"></taskdef>
136 <patternset id="rest.paths">
137 <include name="**/enunciate/generate/swagger/ui/*.json"></include>
138 <exclude name="**/java-client/**"></exclude>
139 <exclude name="**/swagger-ui/**"></exclude>
142 <echo message="======== Assembling swagger docs ========"></echo>
143 <!-- make api directory -->
144 <mkdir dir="${api.dir}"></mkdir>
145 <!-- copy swagger libs -->
146 <copy todir="${resource.dir}">
147 <fileset dir="../subnets/target/enunciate/generate/swagger/ui">
148 <exclude name="**/*.json"></exclude>
149 <exclude name="**/*.png"></exclude>
150 <exclude name="**/index.html"></exclude>
153 <!-- Copy NorthBound json files into ui directory-->
154 <copy todir="${api.dir}">
155 <fileset dir="${basedir}/../../..">
156 <patternset refid="rest.paths"></patternset>
159 <regexpmapper from="^(.*)/([^/]+)/*/target/enunciate/generate/swagger/ui/(.*Northbound).*$$" to="\3"></regexpmapper>
160 <regexpmapper from="^(.*)/([^/]+)/*/target/enunciate/generate/swagger/ui/(.*resource-list.json)$$" to="\2-\3"></regexpmapper>
164 <!-- Correct base path -->
165 <replaceregexp match="/full" replace="">
166 <fileset dir="${api.dir}">
167 <include name="**/*Northbound"></include>
170 <!-- Merge Resource list -->
171 <echo append="false" file="${resource.dir}/apilist.json">{
172 "swaggerVersion": "1.1",
173 "basePath": "http://localhost:8080/swagger/apis",
177 <fileset dir="${api.dir}">
178 <include name="**/*resource-list.json"></include>
179 <exclude name="**/neutron*"></exclude>
183 <echo message="Processing json resource @{file}"></echo>
184 <loadfile property="jsoncontent" srcfile="@{file}">
186 <headfilter lines="10"></headfilter>
187 <tailfilter lines="6"></tailfilter>
190 <echo append="true" file="${resource.dir}/apilist.json" message="${jsoncontent},"></echo>
191 <var name="jsoncontent" unset="true"></var>
195 <loadfile property="jsoncontent" srcfile="${api.dir}/neutron-resource-list.json">
197 <headfilter lines="46"></headfilter>
198 <tailfilter lines="42"></tailfilter>
201 <echo append="true" file="${resource.dir}/apilist.json" message="${jsoncontent},"></echo>
202 <var name="jsoncontent" unset="true"></var>
204 <echo append="true" file="${resource.dir}/apilist.json">{ }
208 <!-- Remove .json from api paths -->
209 <replaceregexp file="${resource.dir}/apilist.json" flags="g" match=".json" replace=""></replaceregexp>
210 <replaceregexp file="${resource.dir}/apilist.json" flags="g" match="JAXRS" replace=""></replaceregexp>
212 <!-- cleanup resource files as we don't need them -->
214 <fileset dir="${api.dir}" includes="**/*resource-list.json"></fileset>
216 <echo message="======== Build successful ========"></echo>
225 <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
226 <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
228 <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>