mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Nicolas Capponi
11.39.2013 1eb7fb4d54021e8fa48d8b70215808593f8f02b3
Checkpoint commit for OPENDJ-175: Decouple OpenDJ LDAP SDK from Grizzly

* Fix issue with dependencies when using opendj-ldap-sdk
Now we ensure that :
- maven-based clients don't get dependencies on opendj-core and opendj-grizzly
- non-maven-based clients can use jar with all dependencies included

opendj-ldap-sdk module uses:
- maven-shade-plugin to build a jar from opendj-core and opendj-grizzly, to hide opendj-core and opendj-grizzly and to provide a corresponding (reduced) pom
- copy-maven-plugin to extract content of jar into target/classes directory (needed by bundle)
- maven-bundle-plugin to generate a custom META-INF/MANIFEST file

* Remove duplicated javadoc/overview.html file
1 files deleted
1 files added
2 files modified
329 ■■■■■ changed files
opendj3/opendj-grizzly/src/main/javadoc/overview.html 112 ●●●●● patch | view | raw | blame | history
opendj3/opendj-ldap-sdk-examples/pom.xml 15 ●●●● patch | view | raw | blame | history
opendj3/opendj-ldap-sdk/dependency-reduced-pom.xml 135 ●●●●● patch | view | raw | blame | history
opendj3/opendj-ldap-sdk/pom.xml 67 ●●●●● patch | view | raw | blame | history
opendj3/opendj-grizzly/src/main/javadoc/overview.html
File was deleted
opendj3/opendj-ldap-sdk-examples/pom.xml
@@ -53,20 +53,9 @@
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <configuration>
          <createDependencyReducedPom>false</createDependencyReducedPom>
          <artifactSet>
            <excludes>
              <!--  avoid duplicate classes, as opendj-ldap-sdk already contains them -->
              <exclude>org.forgerock.opendj:opendj-core</exclude>
              <exclude>org.forgerock.opendj:opendj-grizzly</exclude>
            </excludes>
          </artifactSet>
        </configuration>
        <executions>
          <execution>
@@ -77,6 +66,10 @@
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  <reporting>
opendj3/opendj-ldap-sdk/dependency-reduced-pom.xml
New file
@@ -0,0 +1,135 @@
<?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">
  <parent>
    <artifactId>opendj-project</artifactId>
    <groupId>org.forgerock.opendj</groupId>
    <version>2.7.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>opendj-ldap-sdk</artifactId>
  <name>OpenDJ SDK</name>
  <description>This module provides a complete LDAP SDK for developing LDAP Directory
    client and server applications. It includes both the core APIs and a
    default Grizzly based network transport.</description>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <createSourcesJar>true</createSourcesJar>
          <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
          <artifactSet>
            <includes>
              <include>org.forgerock.opendj:opendj-core</include>
              <include>org.forgerock.opendj:opendj-grizzly</include>
            </includes>
          </artifactSet>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.github.goldin</groupId>
        <artifactId>copy-maven-plugin</artifactId>
        <version>0.2.5</version>
        <executions>
          <execution>
            <id>unpack-jar-to-classes</id>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <resource>
                <targetPath>${project.build.outputDirectory}</targetPath>
                <file>${project.build.directory}/${project.build.finalName}.jar</file>
                <unpack>true</unpack>
              </resource>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>bundle</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <instructions>
            <Include-Resource>META-INF/services=target/classes/META-INF/services</Include-Resource>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.forgerock.commons</groupId>
      <artifactId>i18n-core</artifactId>
      <version>1.4.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.5</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.grizzly</groupId>
      <artifactId>grizzly-framework</artifactId>
      <version>2.3.6</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>mailing-list</report>
              <report>issue-tracking</report>
              <report>license</report>
              <report>cim</report>
              <report>distribution-management</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <links>
            <link>http://commons.forgerock.org/i18n-framework/i18n-core/apidocs</link>
          </links>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
  <properties>
    <opendj.osgi.import>com.sun.security.auth*;resolution:=optional,
      *</opendj.osgi.import>
  </properties>
</project>
opendj3/opendj-ldap-sdk/pom.xml
@@ -59,47 +59,66 @@
  </properties>
  <build>
    <plugins>
      <!-- Unpack opendj-core and opendj-grizzly to rebuild an unified jar with bundle -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.8</version>
        <artifactId>maven-shade-plugin</artifactId>
        <configuration>
          <createSourcesJar>true</createSourcesJar>
          <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
          <artifactSet>
            <includes>
              <include>org.forgerock.opendj:opendj-core</include>
              <include>org.forgerock.opendj:opendj-grizzly</include>
            </includes>
          </artifactSet>
        </configuration>
        <executions>
          <execution>
            <id>unpack-dependencies</id>
            <phase>package</phase>
            <goals>
              <goal>unpack-dependencies</goal>
              <goal>shade</goal>
            </goals>
            <configuration>
              <includeArtifactIds>opendj-grizzly, opendj-core</includeArtifactIds>
              <includes>**/*.class,**\/services\/*</includes>
              <excludes>**/*.properties</excludes>
              <outputDirectory>${project.build.directory}/classes</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
              <excludeTransitive>true</excludeTransitive>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <groupId>com.github.goldin</groupId>
            <artifactId>copy-maven-plugin</artifactId>
            <version>0.2.5</version>
        <executions>
          <execution>
            <id>unpack-jar-to-classes</id>
            <phase>package</phase>
            <goals>
              <goal>bundle</goal>
              <goal>copy</goal>
            </goals>
            <configuration>
              <resource>
                  <targetPath>${project.build.outputDirectory}</targetPath>
                  <file>${project.build.directory}/${project.build.finalName}.jar</file>
                  <unpack>true</unpack>
              </resource>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <instructions>
            <Include-Resource>META-INF/services=target/classes/META-INF/services</Include-Resource>
          </instructions>
        </configuration>
        </executions>
      </plugin>
      <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <instructions>
                        <Include-Resource>META-INF/services=target/classes/META-INF/services</Include-Resource>
                    </instructions>
                </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>