Update config-module-archetype. 09/5709/2
authorTomas Olvecky <tolvecky@cisco.com>
Fri, 21 Mar 2014 13:23:26 +0000 (14:23 +0100)
committerTomas Olvecky <tolvecky@cisco.com>
Fri, 21 Mar 2014 13:25:33 +0000 (14:25 +0100)
Increase config version to 0.2.5-SNAPSHOT.
Add sal code generator as netconf relies on YangModuleInfo.
Fix generated pom to be able to install the artifact.

Change-Id: I09b6460615aa9788a9be5819707b923b2d340a9e
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
opendaylight/config/config-module-archetype/README.txt [new file with mode: 0644]
opendaylight/config/config-module-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
opendaylight/config/config-module-archetype/src/main/resources/archetype-resources/pom.xml

diff --git a/opendaylight/config/config-module-archetype/README.txt b/opendaylight/config/config-module-archetype/README.txt
new file mode 100644 (file)
index 0000000..8b1f29b
--- /dev/null
@@ -0,0 +1,12 @@
+Use
+GROUP_ID=com.mycompany.app
+ARTIFACT_ID=my-app
+mvn archetype:generate -DgroupId=$GROUP_ID -DartifactId=$ARTIFACT_ID \
+ -DarchetypeArtifactId=config-module-archetype -DarchetypeGroupId=org.opendaylight.controller  \
+ -DarchetypeVersion=0.2.5-SNAPSHOT
+
+Module name and prefix define yang module name and its java name prefix.
+For example when creating thread factory wrapper, yang name might be
+thread-factory
+and java prefix
+ThreadFactory
\ No newline at end of file
index fc30b4d..f7b8729 100644 (file)
@@ -15,7 +15,7 @@
             <defaultValue>2013-04-05</defaultValue>
         </requiredProperty>
         <requiredProperty key="config-api-version">
-            <defaultValue>0.2.4-SNAPSHOT</defaultValue>
+            <defaultValue>0.2.5-SNAPSHOT</defaultValue>
         </requiredProperty>
         <requiredProperty key="yang-maven-plugin-version">
             <defaultValue>0.6.2-SNAPSHOT</defaultValue>
index d1c371d..21b1a55 100644 (file)
@@ -9,8 +9,13 @@
 
     <properties>
         <jmxGeneratorPath>${project.build.directory}/generated-sources/config</jmxGeneratorPath>
+        <salGeneratorPath>${project.build.directory}/generated-sources/sal</salGeneratorPath>
         <config.version>${config-api-version}</config.version>
+        <yangtools.version>${yang-maven-plugin-version}</yangtools.version>
         <maven.bundle.version>${maven-bundle-plugin-version}</maven.bundle.version>
+        <java.version.source>1.7</java.version.source>
+        <java.version.target>1.7</java.version.target>
+        <maven.compile.plugin.version>2.5.1</maven.compile.plugin.version>
     </properties>
 
     <dependencies>
@@ -26,7 +31,7 @@
             <plugin>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
-                <version>${yang-maven-plugin-version}</version>
+                <version>${yangtools.version}</version>
                 <executions>
                     <execution>
                         <id>config</id>
                                         </namespaceToPackage1>
                                     </additionalConfiguration>
                                 </generator>
+                                <generator>
+                                    <codeGeneratorClass>
+                                        org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
+                                    </codeGeneratorClass>
+                                    <outputBaseDir>
+                                        ${salGeneratorPath}
+                                    </outputBaseDir>
+                                </generator>
                             </codeGenerators>
                             <inspectDependencies>true</inspectDependencies>
                         </configuration>
                         <artifactId>yang-jmx-generator-plugin</artifactId>
                         <version>${config.version}</version>
                     </dependency>
+                    <dependency>
+                        <groupId>org.opendaylight.yangtools</groupId>
+                        <artifactId>maven-sal-api-gen-plugin</artifactId>
+                        <version>${yangtools.version}</version>
+                    </dependency>
                 </dependencies>
             </plugin>
 
                 <configuration>
                     <instructions>
                         <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
-                        <Export-Package>
-                            ${yang-namespace-mapping-to}.${module-name},
-                        </Export-Package>
-                        <Import-Package>
-                            *
-                        </Import-Package>
                     </instructions>
                 </configuration>
             </plugin>
 
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>${maven.compile.plugin.version}</version>
+                <configuration>
+                    <source>${java.version.source}</source>
+                    <target>${java.version.target}</target>
+                    <testSource>${java.version.source}</testSource>
+                    <testTarget>${java.version.target}</testTarget>
+                </configuration>
+            </plugin>
 
         </plugins>
     </build>