The following examples describe the basic usage of the LDAP Maven Plugin.
The recommended basic configuration is as follows.
<project> ... <build> <plugins> ... <plugin> <groupId>com.btmatthews</groupId> <artifactId>ldap-maven-plugin</artifactId> <configuration> <version>2|3</version> <host>somehost</host> <port>someport</port> <authDn>somedn</authDn> <passwd>somepasswd</passwd> <continueOnError>true|false</continueOnError> ... </configuration> <executions> <execution> <goal>ldif-load|ldif-dump|dsml-dump</goal> </execution> </executions> </plugin> </plugins> </build> </project>
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</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> ... <ldapFiles> <ldapFile>${basedir}/load.ldif</ldapFile> ... </ldapFiles> </configuration> <executions> <execution> <goal>ldif-load</goal> </execution> </executions> </plugins> </build> </project>
When dumping records from the LDAP server a target file should be specified using the filename element.
Example:
<project> ... <build> ... <plugins> ... <groupId>com.btmatthews</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>${basedir}/dump.ldif</filename> </configuration> <executions> <execution> <goal>ldif-dump</goal> </execution> </executions> </plugins> </build> </project>
Example:
<project> ... <build> ... <plugins> ... <groupId>com.btmatthews</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>${basedir}/dump.dsml</filename> </configuration> <executions> <execution> <goal>dsml-dump</goal> </execution> </executions> </plugins> </build> </project>