The LDAP Maven Plugin was relying on the jcabi-aether library to resolve dependencies. When I first wrote the LDAP Maven Plugin I couldn’t find much information on how to resolve dependencies and jcabi-aether proved to be invaluable. Aether is dependency resolution framework used under the hood by Maven 3 and higher.
Aether was originally managed by Sonatype but it was moved to stewardship of the Eclipse foundation. Since Maven 3.1 the Eclipse version has been used.
Since I wanted to the maintain support for Maven 3.0.5 I decided to revert to the Maven 2 dependency resolution API.
In addition, I downgraded the version of ApacheDS used by the plugin to 1.5.5. I was having trouble resolving one of the transitive dependencies for 2.0.0-M15 during integration testing and I didn’t have any luck using the latest version (2.0.0-M17) or later. So I decided to downgrade for now and revisit the issue when ApacheDS 2.0.0 is released and documentation on embedding it becomes available.
The following POM fragment demonstrates how to load content into a LDAP directory server from a LDIF formatted file using the load goal of the LDAP Maven Plugin.
Export
The following POM fragment demonstrates how to export content from a LDAP directory server to a LDIF formatted file using the dump goal of the LDAP Maven Plugin.
Directory Service Markup Language (DSML)
Import
The following POM fragment demonstrates how to load content into a LDAP directory server from a DSML formatted file using the load goal of the LDAP Maven Plugin.
Export
The following POM fragment demonstrates how to export content from a LDAP directory server to a DSML formatted file using the dump goal of the LDAP Maven Plugin.
Running an LDAP Server in the build life-cycle
pom.xml
The following POM fragment uses the run goal to launch an embedded LDAP directory server prior to the execution of the integration tests and then uses the stop goal to shutdown the embedded LDAP directory server upon completion of the integration tests.
Connecting in Java
The following LDAP client libraries can be used to connect to the embedded LDAP server: