From ce5acfc52357423508c9f4d58a9fb54a32c985ea Mon Sep 17 00:00:00 2001
From: Mark Craig <mark.craig@forgerock.com>
Date: Wed, 29 Jul 2015 07:24:19 +0000
Subject: [PATCH] CR-7759 OPENDJ-2195 Move hand-written server docs

---
 opendj-sdk/opendj-server-legacy/src/svr4/OpenDJ/layout.xml                           |    2 
 opendj-sdk/opendj-server-legacy/src/main/assembly/generated-doc-sources-assembly.xml |   44 +++++
 opendj-sdk/opendj-server-legacy/src/main/assembly/man-pages-assembly.xml             |   44 +++++
 opendj-sdk/opendj-server-legacy/src/main/assembly/man-page-sources-assembly.xml      |   44 +++++
 opendj-sdk/opendj-server-legacy/pom.xml                                              |  277 +++++++++++++++++++---------------
 opendj-sdk/opendj-server-legacy/src/main/docbkx/reference/index.xml                  |    4 
 opendj-sdk/opendj-server-legacy/src/main/assembly/config-ref-assembly.xml            |   44 +++++
 7 files changed, 331 insertions(+), 128 deletions(-)

diff --git a/opendj-sdk/opendj-server-legacy/pom.xml b/opendj-sdk/opendj-server-legacy/pom.xml
index 0849b8e..b578193 100644
--- a/opendj-sdk/opendj-server-legacy/pom.xml
+++ b/opendj-sdk/opendj-server-legacy/pom.xml
@@ -1846,6 +1846,57 @@
               </execution>
             </executions>
           </plugin>
+
+          <!-- Format man pages -->
+          <plugin>
+            <groupId>org.forgerock.commons</groupId>
+            <artifactId>forgerock-doc-maven-plugin</artifactId>
+            <configuration>
+              <formats combine.self="override">
+                <format>man</format>
+              </formats>
+            </configuration>
+            <executions>
+              <execution>
+                <id>build-man-pages</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>process</goal>
+                  <goal>build</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+
+          <plugin>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>man-pages-sources</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <descriptors>
+                    <descriptor>src/main/assembly/man-page-sources-assembly.xml</descriptor>
+                  </descriptors>
+                </configuration>
+              </execution>
+              <execution>
+                <id>man-pages</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <descriptors>
+                    <descriptor>src/main/assembly/man-pages-assembly.xml</descriptor>
+                  </descriptors>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
         </plugins>
       </build>
     </profile>
@@ -1857,26 +1908,41 @@
       <build>
         <plugins>
           <plugin>
-            <artifactId>maven-enforcer-plugin</artifactId>
+            <artifactId>maven-dependency-plugin</artifactId>
             <executions>
               <execution>
-                <id>enforce-man-pages-exist</id>
+                <id>unpack-source-dependencies</id>
                 <phase>prepare-package</phase>
                 <goals>
-                  <goal>enforce</goal>
+                  <goal>unpack</goal>
                 </goals>
                 <configuration>
-                  <rules>
-                    <requireFilesExist>
-                      <files>
-                        <file>${project.build.directory}/docbkx-sources/man-pages/man-dsconfig.xml</file>
-                      </files>
-                      <message>
-                        Man pages not found. You must build with -P man-pages.
-                      </message>
-                    </requireFilesExist>
-                  </rules>
-                  <fail>true</fail>
+                  <artifactItems>
+                    <artifactItem>
+                      <groupId>org.forgerock.opendj</groupId>
+                      <artifactId>opendj-core</artifactId>
+                      <version>${project.version}</version>
+                      <classifier>sources</classifier>
+                    </artifactItem>
+                  </artifactItems>
+                </configuration>
+              </execution>
+              <execution>
+                <id>unpack-doc-dependencies</id>
+                <phase>pre-site</phase>
+                <goals>
+                  <goal>unpack</goal>
+                </goals>
+                <configuration>
+                  <artifactItems>
+                    <artifactItem>
+                      <groupId>org.forgerock.opendj</groupId>
+                      <artifactId>opendj-server-legacy</artifactId>
+                      <version>${project.version}</version>
+                      <classifier>server-man-page-sources</classifier>
+                      <outputDirectory>${project.build.directory}/docbkx-sources/man-pages</outputDirectory>
+                    </artifactItem>
+                  </artifactItems>
                 </configuration>
               </execution>
             </executions>
@@ -1931,7 +1997,7 @@
                 <phase>prepare-package</phase>
                 <configuration>
                   <messagesDirectory>${basedir}/src/messages/org/opends/messages</messagesDirectory>
-                  <outputDirectory>${project.build.directory}/docbkx-sources/reference</outputDirectory>
+                  <outputDirectory>${project.build.directory}/docbkx-sources/shared</outputDirectory>
                   <messageFileNames>
                     <!-- for xxx_yyy.properties generates a log-ref-xxx-yyy.xml file -->
                     <messageFileName>admin</messageFileName>
@@ -1961,13 +2027,43 @@
 
               <execution>
                 <id>generate-result-code-doc</id>
-                <phase>pre-site</phase>
+                <phase>prepare-package</phase>
                 <goals>
                   <goal>generate-result-code-doc</goal>
                 </goals>
                 <configuration>
-                  <resultCodeSource>../opendj-core/src/main/java/org/forgerock/opendj/ldap/ResultCode.java</resultCodeSource>
-                  <xmlFile>${project.build.directory}/docbkx-sources/reference/appendix-ldap-result-codes.xml</xmlFile>
+                  <resultCodeSource>${project.build.directory}/dependency/org/forgerock/opendj/ldap/ResultCode.java</resultCodeSource>
+                  <xmlFile>${project.build.directory}/docbkx-sources/shared/appendix-ldap-result-codes.xml</xmlFile>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+
+          <plugin>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>config-ref</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <descriptors>
+                    <descriptor>src/main/assembly/config-ref-assembly.xml</descriptor>
+                  </descriptors>
+                </configuration>
+              </execution>
+              <execution>
+                <id>generated-doc-sources</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <descriptors>
+                    <descriptor>src/main/assembly/generated-doc-sources-assembly.xml</descriptor>
+                  </descriptors>
                 </configuration>
               </execution>
             </executions>
@@ -2017,58 +2113,35 @@
           <deb.docprefix>/usr/share/doc/${lowerCaseProductName}</deb.docprefix>
           <deb.release>1</deb.release>
           <deb.maintainer>opendj@forgerock.org</deb.maintainer>
-          <manpage.dir>${project.build.directory}/docbkx/manpages/reference</manpage.dir>
+          <manpage.dir>${project.build.directory}/dependency/man</manpage.dir>
         </properties>
 
         <build>
           <plugins>
             <plugin>
-              <artifactId>maven-enforcer-plugin</artifactId>
+              <artifactId>maven-dependency-plugin</artifactId>
               <executions>
                 <execution>
-                  <id>enforce-man-pages-exist</id>
+                  <id>unpack-man-pages</id>
                   <phase>prepare-package</phase>
                   <goals>
-                    <goal>enforce</goal>
+                    <goal>unpack</goal>
                   </goals>
                   <configuration>
-                    <rules>
-                      <requireFilesExist>
-                        <files>
-                          <file>${project.build.directory}/docbkx-sources/man-pages/man-dsconfig.xml</file>
-                        </files>
-                        <message>
-                          Man pages not found. You must build with -P man-pages.
-                        </message>
-                      </requireFilesExist>
-                    </rules>
-                    <fail>true</fail>
+                    <artifactItems>
+                      <artifactItem>
+                        <groupId>org.forgerock.opendj</groupId>
+                        <artifactId>opendj-server-legacy</artifactId>
+                        <version>${project.version}</version>
+                        <classifier>server-man-pages</classifier>
+                        <outputDirectory>${project.build.directory}/dependency/man</outputDirectory>
+                      </artifactItem>
+                    </artifactItems>
                   </configuration>
                 </execution>
               </executions>
             </plugin>
 
-            <!-- Format man pages -->
-            <plugin>
-                <groupId>org.forgerock.commons</groupId>
-                <artifactId>forgerock-doc-maven-plugin</artifactId>
-                <configuration>
-                    <formats combine.self="override">
-                        <format>man</format>
-                    </formats>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>build-man-pages</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>process</goal>
-                            <goal>build</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
             <!-- Filter deb install and remove scripts -->
             <plugin>
               <artifactId>maven-resources-plugin</artifactId>
@@ -2249,52 +2322,29 @@
       <build>
         <plugins>
           <plugin>
-            <artifactId>maven-enforcer-plugin</artifactId>
+            <artifactId>maven-dependency-plugin</artifactId>
             <executions>
               <execution>
-                <id>enforce-man-pages-exist</id>
+                <id>unpack-man-pages</id>
                 <phase>prepare-package</phase>
                 <goals>
-                  <goal>enforce</goal>
+                  <goal>unpack</goal>
                 </goals>
                 <configuration>
-                  <rules>
-                    <requireFilesExist>
-                      <files>
-                        <file>${project.build.directory}/docbkx-sources/man-pages/man-dsconfig.xml</file>
-                      </files>
-                      <message>
-                        Man pages not found. You must build with -P man-pages.
-                      </message>
-                    </requireFilesExist>
-                  </rules>
-                  <fail>true</fail>
+                  <artifactItems>
+                    <artifactItem>
+                      <groupId>org.forgerock.opendj</groupId>
+                      <artifactId>opendj-server-legacy</artifactId>
+                      <version>${project.version}</version>
+                      <classifier>server-man-pages</classifier>
+                      <outputDirectory>${project.build.directory}/dependency/man</outputDirectory>
+                    </artifactItem>
+                  </artifactItems>
                 </configuration>
               </execution>
             </executions>
           </plugin>
 
-          <!-- Format man pages -->
-          <plugin>
-            <groupId>org.forgerock.commons</groupId>
-            <artifactId>forgerock-doc-maven-plugin</artifactId>
-            <configuration>
-              <formats combine.self="override">
-                <format>man</format>
-              </formats>
-            </configuration>
-            <executions>
-              <execution>
-                <id>build-man-pages</id>
-                <phase>package</phase>
-                <goals>
-                  <goal>process</goal>
-                  <goal>build</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-
           <plugin>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>rpm-maven-plugin</artifactId>
@@ -2411,7 +2461,7 @@
                   <directory>${rpm.prefix}/share/man</directory>
                   <sources>
                     <source>
-                      <location>${project.build.directory}/docbkx/manpages/reference</location>
+                      <location>${project.build.directory}/dependency/man</location>
                       <includes>
                         <include>**/*.*</include>
                       </includes>
@@ -2486,52 +2536,29 @@
       <build>
         <plugins>
           <plugin>
-            <artifactId>maven-enforcer-plugin</artifactId>
+            <artifactId>maven-dependency-plugin</artifactId>
             <executions>
               <execution>
-                <id>enforce-man-pages-exist</id>
+                <id>unpack-man-pages</id>
                 <phase>prepare-package</phase>
                 <goals>
-                  <goal>enforce</goal>
+                  <goal>unpack</goal>
                 </goals>
                 <configuration>
-                  <rules>
-                    <requireFilesExist>
-                      <files>
-                        <file>${project.build.directory}/docbkx-sources/man-pages/man-dsconfig.xml</file>
-                      </files>
-                      <message>
-                        Man pages not found. You must build with -P man-pages.
-                      </message>
-                    </requireFilesExist>
-                  </rules>
-                  <fail>true</fail>
+                  <artifactItems>
+                    <artifactItem>
+                      <groupId>org.forgerock.opendj</groupId>
+                      <artifactId>opendj-server-legacy</artifactId>
+                      <version>${project.version}</version>
+                      <classifier>server-man-pages</classifier>
+                      <outputDirectory>${project.build.directory}/dependency/man</outputDirectory>
+                    </artifactItem>
+                  </artifactItems>
                 </configuration>
               </execution>
             </executions>
           </plugin>
 
-          <!-- Format man pages -->
-          <plugin>
-            <groupId>org.forgerock.commons</groupId>
-            <artifactId>forgerock-doc-maven-plugin</artifactId>
-            <configuration>
-              <formats combine.self="override">
-                <format>man</format>
-              </formats>
-            </configuration>
-            <executions>
-              <execution>
-                <id>build-man-pages</id>
-                <phase>package</phase>
-                <goals>
-                  <goal>process</goal>
-                  <goal>build</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-antrun-plugin</artifactId>
diff --git a/opendj-sdk/opendj-server-legacy/src/main/assembly/config-ref-assembly.xml b/opendj-sdk/opendj-server-legacy/src/main/assembly/config-ref-assembly.xml
new file mode 100644
index 0000000..bf20e32
--- /dev/null
+++ b/opendj-sdk/opendj-server-legacy/src/main/assembly/config-ref-assembly.xml
@@ -0,0 +1,44 @@
+<!--
+  ! CDDL HEADER START
+  !
+  ! The contents of this file are subject to the terms of the
+  ! Common Development and Distribution License, Version 1.0 only
+  ! (the "License").  You may not use this file except in compliance
+  ! with the License.
+  !
+  ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
+  ! or http://forgerock.org/license/CDDLv1.0.html.
+  ! See the License for the specific language governing permissions
+  ! and limitations under the License.
+  !
+  ! When distributing Covered Code, include this CDDL HEADER in each
+  ! file and include the License file at
+  ! legal-notices/CDDLv1_0.txt.  If applicable,
+  ! add the following below this CDDL HEADER, with the fields enclosed
+  ! by brackets "[]" replaced with your own identifying information:
+  !      Portions Copyright [yyyy] [name of copyright owner]
+  !
+  ! CDDL HEADER END
+  !
+  !      Copyright 2015 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>config-ref</id>
+
+  <formats>
+    <format>jar</format>
+  </formats>
+
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <fileSets>
+    <fileSet>
+      <directory>${project.build.directory}/site/configref</directory>
+      <outputDirectory />
+    </fileSet>
+  </fileSets>
+</assembly>
diff --git a/opendj-sdk/opendj-server-legacy/src/main/assembly/generated-doc-sources-assembly.xml b/opendj-sdk/opendj-server-legacy/src/main/assembly/generated-doc-sources-assembly.xml
new file mode 100644
index 0000000..20cce33
--- /dev/null
+++ b/opendj-sdk/opendj-server-legacy/src/main/assembly/generated-doc-sources-assembly.xml
@@ -0,0 +1,44 @@
+<!--
+  ! CDDL HEADER START
+  !
+  ! The contents of this file are subject to the terms of the
+  ! Common Development and Distribution License, Version 1.0 only
+  ! (the "License").  You may not use this file except in compliance
+  ! with the License.
+  !
+  ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
+  ! or http://forgerock.org/license/CDDLv1.0.html.
+  ! See the License for the specific language governing permissions
+  ! and limitations under the License.
+  !
+  ! When distributing Covered Code, include this CDDL HEADER in each
+  ! file and include the License file at
+  ! legal-notices/CDDLv1_0.txt.  If applicable,
+  ! add the following below this CDDL HEADER, with the fields enclosed
+  ! by brackets "[]" replaced with your own identifying information:
+  !      Portions Copyright [yyyy] [name of copyright owner]
+  !
+  ! CDDL HEADER END
+  !
+  !      Copyright 2015 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>generated-doc-sources</id>
+
+  <formats>
+    <format>jar</format>
+  </formats>
+
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <fileSets>
+    <fileSet>
+      <directory>${project.build.directory}/docbkx-sources/shared</directory>
+      <outputDirectory />
+    </fileSet>
+  </fileSets>
+</assembly>
diff --git a/opendj-sdk/opendj-server-legacy/src/main/assembly/man-page-sources-assembly.xml b/opendj-sdk/opendj-server-legacy/src/main/assembly/man-page-sources-assembly.xml
new file mode 100644
index 0000000..9022471
--- /dev/null
+++ b/opendj-sdk/opendj-server-legacy/src/main/assembly/man-page-sources-assembly.xml
@@ -0,0 +1,44 @@
+<!--
+  ! CDDL HEADER START
+  !
+  ! The contents of this file are subject to the terms of the
+  ! Common Development and Distribution License, Version 1.0 only
+  ! (the "License").  You may not use this file except in compliance
+  ! with the License.
+  !
+  ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
+  ! or http://forgerock.org/license/CDDLv1.0.html.
+  ! See the License for the specific language governing permissions
+  ! and limitations under the License.
+  !
+  ! When distributing Covered Code, include this CDDL HEADER in each
+  ! file and include the License file at
+  ! legal-notices/CDDLv1_0.txt.  If applicable,
+  ! add the following below this CDDL HEADER, with the fields enclosed
+  ! by brackets "[]" replaced with your own identifying information:
+  !      Portions Copyright [yyyy] [name of copyright owner]
+  !
+  ! CDDL HEADER END
+  !
+  !      Copyright 2015 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>server-man-page-sources</id>
+
+  <formats>
+    <format>jar</format>
+  </formats>
+
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <fileSets>
+    <fileSet>
+      <directory>${project.build.directory}/docbkx-sources/man-pages</directory>
+      <outputDirectory />
+    </fileSet>
+  </fileSets>
+</assembly>
diff --git a/opendj-sdk/opendj-server-legacy/src/main/assembly/man-pages-assembly.xml b/opendj-sdk/opendj-server-legacy/src/main/assembly/man-pages-assembly.xml
new file mode 100644
index 0000000..9a1d7ab
--- /dev/null
+++ b/opendj-sdk/opendj-server-legacy/src/main/assembly/man-pages-assembly.xml
@@ -0,0 +1,44 @@
+<!--
+  ! CDDL HEADER START
+  !
+  ! The contents of this file are subject to the terms of the
+  ! Common Development and Distribution License, Version 1.0 only
+  ! (the "License").  You may not use this file except in compliance
+  ! with the License.
+  !
+  ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
+  ! or http://forgerock.org/license/CDDLv1.0.html.
+  ! See the License for the specific language governing permissions
+  ! and limitations under the License.
+  !
+  ! When distributing Covered Code, include this CDDL HEADER in each
+  ! file and include the License file at
+  ! legal-notices/CDDLv1_0.txt.  If applicable,
+  ! add the following below this CDDL HEADER, with the fields enclosed
+  ! by brackets "[]" replaced with your own identifying information:
+  !      Portions Copyright [yyyy] [name of copyright owner]
+  !
+  ! CDDL HEADER END
+  !
+  !      Copyright 2015 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>server-man-pages</id>
+
+  <formats>
+    <format>jar</format>
+  </formats>
+
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <fileSets>
+    <fileSet>
+      <directory>${project.build.directory}/docbkx/manpages/reference</directory>
+      <outputDirectory />
+    </fileSet>
+  </fileSets>
+</assembly>
diff --git a/opendj-sdk/opendj-server-legacy/src/main/docbkx/reference/index.xml b/opendj-sdk/opendj-server-legacy/src/main/docbkx/reference/index.xml
index 49cdad2..f686be0 100644
--- a/opendj-sdk/opendj-server-legacy/src/main/docbkx/reference/index.xml
+++ b/opendj-sdk/opendj-server-legacy/src/main/docbkx/reference/index.xml
@@ -194,7 +194,7 @@
  <xinclude:include href="../shared/glossary.xml" />
 
  <xinclude:include href="appendix-rest2ldap.xml" />
- <xinclude:include href="appendix-ldap-result-codes.xml">
+ <xinclude:include href="../shared/appendix-ldap-result-codes.xml">
   <xinclude:fallback>
    <appendix>
     <title>LDAP Result Codes Missing</title>
@@ -209,7 +209,7 @@
  <xinclude:include href='appendix-extended-ops.xml' />
  <xinclude:include href='appendix-l10n.xml' />
  <xinclude:include href='appendix-interface-stability.xml' />
- <xinclude:include href='log-message-reference.xml'>
+ <xinclude:include href='../shared/log-message-reference.xml'>
   <xinclude:fallback>
    <appendix>
     <title>Log Message Reference Missing</title>
diff --git a/opendj-sdk/opendj-server-legacy/src/svr4/OpenDJ/layout.xml b/opendj-sdk/opendj-server-legacy/src/svr4/OpenDJ/layout.xml
index 9cc5f20..321482a 100644
--- a/opendj-sdk/opendj-server-legacy/src/svr4/OpenDJ/layout.xml
+++ b/opendj-sdk/opendj-server-legacy/src/svr4/OpenDJ/layout.xml
@@ -77,7 +77,7 @@
 
     <!-- Add man pages -->
     <copy todir="${svr4.layout.pkg.dir}/man">
-      <fileset dir="${project.build.directory}/docbkx/manpages/reference" />
+      <fileset dir="${project.build.directory}/dependency/man" />
     </copy>
   </target>
 

--
Gitblit v1.10.0