From c48eedf2c052ae945cd56d260be753bcbcb764fc Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Thu, 16 Jun 2016 10:07:15 +0000
Subject: [PATCH] OPENDJ-2941 Fix tools extension informations

---
 opendj-server-legacy/src/snmp/resource/META-INF/services/org.forgerock.opendj.config.AbstractManagedObjectDefinition |    0 
 opendj-server-legacy/pom.xml                                                                                         |   30 ++++++---------
 opendj-server-legacy/src/main/assembly/snmp-jar-assembly.xml                                                         |   37 ++++++++++++++++++
 3 files changed, 49 insertions(+), 18 deletions(-)

diff --git a/opendj-server-legacy/pom.xml b/opendj-server-legacy/pom.xml
index 4d2f25d..e6e1c1f 100644
--- a/opendj-server-legacy/pom.xml
+++ b/opendj-server-legacy/pom.xml
@@ -1262,11 +1262,6 @@
       </dependencies>
 
       <build>
-        <resources>
-          <resource>
-            <directory>src/snmp/resource</directory>
-          </resource>
-        </resources>
         <plugins>
           <plugin>
             <groupId>org.codehaus.mojo</groupId>
@@ -1360,22 +1355,26 @@
             </executions>
           </plugin>
 
-          <!-- Creates snmp jar file -->
           <plugin>
-            <artifactId>maven-jar-plugin</artifactId>
+            <artifactId>maven-assembly-plugin</artifactId>
             <executions>
+              <!-- Package snmp jar -->
               <execution>
-                <id>create-snmp-jar</id>
+                <id>build-snmp-jar</id>
                 <phase>prepare-package</phase>
                 <goals>
-                  <goal>jar</goal>
+                  <goal>single</goal>
                 </goals>
                 <configuration>
                   <outputDirectory>${jars.dir}</outputDirectory>
                   <finalName>${snmp.jar.name}</finalName>
-                  <includes>
-                    <include>org/opends/server/snmp/**</include>
-                  </includes>
+                  <descriptors>
+                    <descriptor>src/main/assembly/snmp-jar-assembly.xml</descriptor>
+                  </descriptors>
+                  <appendAssemblyId>false</appendAssemblyId>
+                  <formats>
+                    <format>jar</format>
+                  </formats>
                   <archive>
                     <index>true</index>
                     <addMavenDescriptor>false</addMavenDescriptor>
@@ -1387,13 +1386,8 @@
                   </archive>
                 </configuration>
               </execution>
-            </executions>
-          </plugin>
 
-          <!-- Package the final zip -->
-          <plugin>
-            <artifactId>maven-assembly-plugin</artifactId>
-            <executions>
+              <!-- Package the final zip -->
               <execution>
                 <id>build-opendj-archive</id>
                 <phase>package</phase>
diff --git a/opendj-server-legacy/src/main/assembly/snmp-jar-assembly.xml b/opendj-server-legacy/src/main/assembly/snmp-jar-assembly.xml
new file mode 100644
index 0000000..c6d716e
--- /dev/null
+++ b/opendj-server-legacy/src/main/assembly/snmp-jar-assembly.xml
@@ -0,0 +1,37 @@
+<!--
+  The contents of this file are subject to the terms of the Common Development and
+  Distribution License (the License). You may not use this file except in compliance with the
+  License.
+
+  You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
+  specific language governing permission and limitations under the License.
+
+  When distributing Covered Software, include this CDDL Header Notice in each file and include
+  the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
+  Header, with the fields enclosed by brackets [] replaced by your own identifying
+  information: "Portions Copyright [year] [name of copyright owner]".
+
+  Copyright 2016 ForgeRock AS.
+  -->
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+	<id>snmp-jar-generation</id>
+	<includeBaseDirectory>false</includeBaseDirectory>
+
+	<!-- Assembly descriptor SNMP complement for OpenDJ archive -->
+	<fileSets>
+		<!-- Adds snmp binairies -->
+		<fileSet>
+			<directory>${project.build.outputDirectory}/org/opends/server/snmp</directory>
+			<outputDirectory>org/opends/server/snmp</outputDirectory>
+		</fileSet>
+	</fileSets>
+	<files>
+		<!-- Adds generated mib rfc 2605 file -->
+		<file>
+			<source>src/snmp/resource/META-INF/services/org.forgerock.opendj.config.AbstractManagedObjectDefinition</source>
+			<outputDirectory>META-INF/services</outputDirectory>
+		</file>
+	</files>
+</assembly>
\ No newline at end of file
diff --git a/opendj-server-legacy/src/snmp/resource/META-INF/services/org.forgerock.opendj.config.AbstractManagedObjectDefinition b/opendj-server-legacy/src/snmp/resource/META-INF/services/org.forgerock.opendj.config.AbstractManagedObjectDefinition
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/opendj-server-legacy/src/snmp/resource/META-INF/services/org.forgerock.opendj.config.AbstractManagedObjectDefinition

--
Gitblit v1.10.0