Dump entries to DSML file

The following example demonstrates how to use the LDAP Maven Plugin to dump directory contents to DSML format after integration tests have been performed.

  • LDAP Directory Server

    In this example we are assuming that Apache Directory Server is being used and is installed locally on port 10389 with the default administration account (uid=admin,ou=system) and password (secret). Furthermore, we are assuming that the base DN has not been modified from the default (o=sevenSeas).

  • Configure a POM

    Add the following configuration to your project POM to dump the data after test execution:

    <project>
      <modelVersion>4.0.0</modelVersion>
      ...
      <build>
        <plugins>
          <plugin>
            <groupId>com.btmatthews.maven.plugins</groupId>
            <artifactId>ldap-maven-plugin</artifactId>
            <executions>
              <execution>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>dump</goal>
                </goals>
                <configuration>
                  <host>localhost</host>
                  <port>10389</port>
                  <authDn>uid=admin,ou=system</authDn>
                  <passwd>secret</passwd>
                  <filename>dump.dsml</filename>
                  <format>dsml</format>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </project>