Add client code to generic-resource-api 73/57873/1
authorTimoney, Dan (dt5972) <dt5972@att.com>
Fri, 27 Jul 2018 14:07:10 +0000 (10:07 -0400)
committerTimoney, Dan (dt5972) <dt5972@att.com>
Fri, 27 Jul 2018 14:07:10 +0000 (10:07 -0400)
Add code to generate generic-resource-api client which was contributed
to sdnc/apps repo to sdnc/northbound/generic-resource-api, so that it
will automatically be updated when yang model is updated.

Change-Id: I4d36073e9771e72a2ebc38cb45f2151a88699ae6
Issue-ID: SDNC-406
Signed-off-by: Timoney, Dan (dt5972) <dt5972@att.com>
generic-resource-api/client/pom.xml [new file with mode: 0644]
generic-resource-api/pom.xml

diff --git a/generic-resource-api/client/pom.xml b/generic-resource-api/client/pom.xml
new file mode 100644 (file)
index 0000000..b0b6a47
--- /dev/null
@@ -0,0 +1,110 @@
+<?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/maven-v4_0_0.xsd">
+
+
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+    <groupId>org.onap.sdnc.northbound</groupId>
+    <artifactId>generic-resource-api-client</artifactId>
+    <version>1.4.0-SNAPSHOT</version>
+
+    <name>sdnc-northbound :: generic-resource-api:: ${project.artifactId}</name>
+    <url>http://wiki.onap.org</url>
+    <description>POM to be used for yang2swagger generation of client in SDNC project</description>
+    
+    <parent>
+        <groupId>org.onap.ccsdk.parent</groupId>
+        <artifactId>client-parent</artifactId>
+        <version>1.1.0-SNAPSHOT</version>
+    </parent>
+
+    <dependencies>
+        <!-- This is where the yang comes from -->
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>generic-resource-api-model</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- End this is where the yang comes from -->        
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <configuration>
+                    <includeGroupIds>org.opendaylight.mdsal.model, org.onap.sdnc.northbound</includeGroupIds>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.opendaylight.yangtools</groupId>
+                <artifactId>yang-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>io.swagger</groupId>
+                <artifactId>swagger-codegen-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                        <configuration>
+                            <configOptions>
+                                <java8>true</java8>
+                                <withXml>true</withXml>
+                                <output>${project.build.directory}/generated-sources/swagger</output>
+                                <generateApis>false</generateApis>
+                                <generateApiTests>false</generateApiTests>
+                                <generateModels>true</generateModels>
+                                <generateModelTests>false</generateModelTests>
+                                <generateSupportingFiles>true</generateSupportingFiles>
+                                <apiPackage>org.onap.sdnc.northbound.client.handler</apiPackage>
+                                <modelPackage>org.onap.sdnc.northbound.client.model</modelPackage>
+                                <invokerPackage>org.onap.sdnc.northbound.client.invoker</invokerPackage>
+                                <sourceFolder>src/main/java</sourceFolder>
+                                <useBeanValidation>true</useBeanValidation>
+                                <interfaceOnly>true</interfaceOnly>
+                            </configOptions>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+            </plugin>
+             <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.10</version>
+                <executions>
+                    <execution>
+                        <id>attach-artifacts</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>attach-artifact</goal>
+                        </goals>
+                        <configuration>
+                            <artifacts>
+                                <artifact>
+                                    <file>target/generated-sources/swagger-maven-api-gen/client.yaml</file>
+                                    <type>yaml</type>
+                                </artifact>
+                            </artifacts>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
index d2a18f2..9842dd3 100644 (file)
@@ -1,5 +1,7 @@
 <?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">
+<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>
@@ -18,8 +20,9 @@
 
        <modules>
                <module>model</module>
-        <module>provider</module>
+               <module>provider</module>
                <module>features</module>
+               <module>client</module>
                <module>installer</module>
        </modules>
 </project>