Merge "Add java-client pom project for merged java clients and docs"
authorGiovanni Meo <gmeo@cisco.com>
Tue, 12 Nov 2013 13:03:54 +0000 (13:03 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 12 Nov 2013 13:03:54 +0000 (13:03 +0000)
opendaylight/northbound/java-client/enunciate.xml [new file with mode: 0644]
opendaylight/northbound/java-client/pom.xml [new file with mode: 0644]
pom.xml

diff --git a/opendaylight/northbound/java-client/enunciate.xml b/opendaylight/northbound/java-client/enunciate.xml
new file mode 100644 (file)
index 0000000..ce9186e
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
+
+  <services> </services>
+
+  <modules>
+    <!-- Disable doc generation -->
+    <docs disabled="true"/>
+
+    <!-- Disable all the client generation tools -->
+    <basic-app disabled="true" />
+    <c disabled="true" />
+    <csharp disabled="true" />
+    <jaxws-client disabled="true" />
+    <jaxws-ri disabled="true" />
+    <jaxws-support disabled="true" />
+    <obj-c disabled="true" />
+    <ruby disabled="true"/>
+    <php disabled="true"/>
+
+    <!-- enable only the java clients -->
+    <xml disabled="false" />
+    <java-client disabled="false"/>
+  </modules>
+
+  <api-classes>
+    <include pattern="org.opendaylight.controller.**"/>
+  </api-classes>
+
+  <api-import pattern="org.opendaylight.controller.**"/>
+</enunciate>
diff --git a/opendaylight/northbound/java-client/pom.xml b/opendaylight/northbound/java-client/pom.xml
new file mode 100644 (file)
index 0000000..b6fd296
--- /dev/null
@@ -0,0 +1,301 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>commons.opendaylight</artifactId>
+    <version>1.4.1-SNAPSHOT</version>
+    <relativePath>../../commons/opendaylight</relativePath>
+  </parent>
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
+    <tag>HEAD</tag>
+  </scm>
+
+  <artifactId>northbound.client</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <properties>
+    <docs.output.dir>${project.build.directory}/rest-api-docs</docs.output.dir>
+    <java-client>${project.build.directory}/enunciate/build/java-client/full-client.jar</java-client>
+    <java-client-sources>${project.build.directory}/enunciate/build/java-client/full-client-sources.jar</java-client-sources>
+    <json-client>${project.build.directory}/enunciate/build/java-client/full-json-client.jar</json-client>
+    <json-client-sources>${project.build.directory}/enunciate/build/java-client/full-json-client-sources.jar</json-client-sources>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.enunciate</groupId>
+        <artifactId>maven-enunciate-plugin</artifactId>
+        <version>${enunciate.version}</version>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.5</version>
+        <executions>
+          <execution>
+            <phase>install</phase>
+            <goals>
+                <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <target>
+            <taskdef resource="net/sf/antcontrib/antcontrib.properties"
+                     classpathref="maven.plugin.classpath" />
+            <patternset id="rest.paths">
+              <include name="**/target/site/wsdocs/**"/>
+              <exclude name="**/java-client/**"/>
+            </patternset>
+
+            <echo message="======== Assembling enunciate docs ========"/>
+            <!-- cleanup existing generated files -->
+            <delete dir="${docs.output.dir}"/>
+            <delete file="${docs.output.dir}.zip"/>
+            <mkdir dir="${docs.output.dir}"/>
+            <!-- copy enunciate docs to stage -->
+            <copy todir="${docs.output.dir}">
+              <fileset dir="${basedir}/../../..">
+                <patternset refid="rest.paths"/>
+              </fileset>
+              <mapper type="regexp"
+                      from="^(.*)/([^/]+)/target/site/wsdocs/(.*)$$"
+                      to="\2/\3"/>
+            </copy>
+            <!-- generate index.html -->
+            <!-- append header -->
+            <echo file="${docs.output.dir}/index.html" append="true">
+&lt;![CDATA[
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt; OpenDaylight REST API Documentation &lt;/title&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+  &lt;h2&gt;OpenDaylight REST API Documentation&lt;/h2&gt;
+  &lt;p&gt; OpenDaylight supports the following &lt;a href="http://en.wikipedia.org/wiki/Representational_State_Transfer"&gt;Representational State Transfer (REST)&lt;/a&gt; APIs: &lt;/p&gt;
+  &lt;h4&gt;
+]]&gt;
+            </echo>
+            <dirset id="nbset" dir="${docs.output.dir}">
+              <include name="*"/>
+            </dirset>
+            <pathconvert pathsep="&amp;#36;{line.separator}"
+                         property="nbs"
+                         refid="nbset"/>
+            <echo file="${docs.output.dir}/index.html"
+                  append="true"
+                  message="${nbs}"/>
+            <replaceregexp file="${docs.output.dir}/index.html"
+                           match="^\${docs.output.dir}/(.*)$"
+                           replace="&amp;lt;li&amp;gt;&amp;lt;a href=\1/index.html&amp;gt; \1 &amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;"
+                           byline="true"/>
+
+            <!-- append footer -->
+            <echo file="${docs.output.dir}/index.html" append="true">
+&lt;![CDATA[
+  &lt;/h4&gt;
+  &lt;i&gt;---&lt;/i&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
+]]&gt;
+            </echo>
+            <!-- archive all the docs excluding whatever is not needed -->
+            <echo message="======== Archiving enunciate docs ========"/>
+            <zip destfile="${docs.output.dir}.zip">
+              <zipfileset dir="${docs.output.dir}"/>
+            </zip>
+
+            <echo message="======== Build successful ========"/>
+            <echo message="REST docs archive: ${docs.output.dir}.zip"/>
+          </target>
+        </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>ant-contrib</groupId>
+            <artifactId>ant-contrib</artifactId>
+            <version>20020829</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <version>2.5</version>
+        <configuration>
+          <packaging>jar</packaging>
+          <groupId>${project.groupId}</groupId>
+          <version>${project.version}</version>
+        </configuration>
+        <executions>
+          <execution>
+            <!-- skip default install -->
+            <id>default-install</id>
+            <phase>install</phase>
+            <goals>
+              <goal>install</goal>
+            </goals>
+            <configuration>
+              <skip>true</skip>
+            </configuration>
+          </execution>
+          <execution>
+            <!-- install full java client -->
+            <id>install-full-client</id>
+            <phase>install</phase>
+            <goals>
+              <goal>install-file</goal>
+            </goals>
+            <configuration>
+              <artifactId>${project.artifactId}.full-client</artifactId>
+              <file>${java-client}</file>
+              <sources>${java-client-sources}</sources>
+            </configuration>
+          </execution>
+          <execution>
+            <!-- install full java json client -->
+            <id>install-full-json-client</id>
+            <phase>install</phase>
+            <goals>
+              <goal>install-file</goal>
+            </goals>
+            <configuration>
+              <artifactId>${project.artifactId}.full-json-client</artifactId>
+              <file>${json-client}</file>
+              <sources>${json-client-sources}</sources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-deploy-plugin</artifactId>
+        <version>2.5</version>
+        <configuration>
+          <packaging>jar</packaging>
+          <generatePom>true</generatePom>
+          <groupId>${project.groupId}</groupId>
+          <version>${project.version}</version>
+          <url>${project.distributionManagement.repository.url}</url>
+        </configuration>
+        <executions>
+          <execution>
+            <!-- skip default deploy -->
+            <id>default-deploy</id>
+            <phase>deploy</phase>
+            <goals>
+              <goal>deploy</goal>
+            </goals>
+            <configuration>
+              <skip>true</skip>
+            </configuration>
+          </execution>
+          <execution>
+            <!-- deploy full java client -->
+            <id>deploy-full-client</id>
+            <phase>deploy</phase>
+            <goals>
+              <goal>deploy-file</goal>
+            </goals>
+            <configuration>
+              <artifactId>${project.artifactId}.full-client</artifactId>
+              <file>${java-client}</file>
+              <sources>${java-client-sources}</sources>
+            </configuration>
+          </execution>
+          <execution>
+            <!-- deploy full java json client -->
+            <id>deploy-full-json-client</id>
+            <phase>deploy</phase>
+            <goals>
+              <goal>deploy-file</goal>
+            </goals>
+            <configuration>
+              <artifactId>${project.artifactId}.full-json-client</artifactId>
+              <file>${json-client}</file>
+              <sources>${json-client-sources}</sources>
+            </configuration>
+          </execution>
+       </executions>
+    </plugin>
+
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.enunciate</groupId>
+      <artifactId>enunciate-core-annotations</artifactId>
+      <version>${enunciate.version}</version>
+    </dependency>
+
+    <!-- add dependency on all northbound bundles -->
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>connectionmanager.northbound</artifactId>
+      <version>0.1.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>controllermanager.northbound</artifactId>
+      <version>0.0.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>flowprogrammer.northbound</artifactId>
+      <version>0.4.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>hosttracker.northbound</artifactId>
+      <version>0.4.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>networkconfig.bridgedomain.northbound</artifactId>
+      <version>0.0.2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>networkconfig.neutron.northbound</artifactId>
+      <version>0.4.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>forwarding.staticrouting.northbound</artifactId>
+      <version>0.4.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>statistics.northbound</artifactId>
+      <version>0.4.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>subnets.northbound</artifactId>
+      <version>0.4.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>switchmanager.northbound</artifactId>
+      <version>0.4.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>topology.northbound</artifactId>
+      <version>0.4.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>usermanager.northbound</artifactId>
+      <version>0.0.1-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/pom.xml b/pom.xml
index c603a94..f7f9bc2 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                 <module>opendaylight/distribution/sanitytest/</module>
             </modules>
         </profile>
+        <profile>
+           <id>docs</id>
+           <activation>
+               <activeByDefault>false</activeByDefault>
+           </activation>
+            <modules>
+              <module>opendaylight/northbound/java-client</module>
+            </modules>
+        </profile>
     </profiles>
 </project>