Usage

The following examples describe the basic usage of the LDAP Maven Plugin.

Basic Configuration

The recommended basic configuration is as follows.

<project>
  ...  
  <build>
    <plugins>
      ...
      <plugin>
        <groupId>com.btmatthews.maven.plugins.ldap</groupId>
        <artifactId>parent</artifactId>
        <configuration>
          <host>somehost</host>
          <port>someport</port>
          <authDn>somedn</authDn>
          <passwd>somepasswd</passwd>
          <continueOnError>true|false</continueOnError>
          ...
        </configuration>
        <executions>
          <execution>
            <goal>load|dump|run|stop</goal>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Configuring Load

When loading records to the LDAP server a list of LDAP files should be specified in the <ldapFiles/> element.

Example:

<project>
  ...
  <build>
    ...
    <plugins>
      ...
        <groupId>com.btmatthews.maven.plugins</groupId>
        <artifactId>ldap-maven-plugin</artifactId>
        <configuration>
          <host>localhost</host>
          <port>10389</port>
          <authDn>uid=admin,ou=system</authDn>
          <passwd>secret</passwd>
          ...
          <sources>
            <ldif>${basedir}/load.ldif</ldif>
            ...
          </sources>
        </configuration>
        <executions>
          <execution>
            <goal>load</goal>
          </execution>
        </executions>
    </plugins>
  </build>
</project>

Configuring Dump

When dumping records from the LDAP server a target file should be specified using the filename element.

Example:

<project>
  ...
  <build>
    ...
    <plugins>
      ...
        <groupId>com.btmatthews.maven.plugins</groupId>
        <artifactId>ldap-maven-plugin</artifactId>
        <configuration>
          <host>localhost</host>
          <port>10389</port>
          <authDn>uid=admin,ou=system</authDn>
          <passwd>secret</passwd>
          ...
          <filename>dump.ldif</filename>
        </configuration>
        <executions>
          <execution>
            <goal>dump</goal>
          </execution>
        </executions>
    </plugins>
  </build>
</project>

Example:

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