Apt-maven-plugin

I am using this plugin in a maven pom.xml:

		<plugin>
			<groupId>com.mysema.maven</groupId>
			<artifactId>apt-maven-plugin</artifactId>
			<version>1.1.3</version>
			<executions>
				<execution>
					<goals>
						<goal>process</goal>
					</goals>
					<configuration>
						<outputDirectory>target/generated-sources/java</outputDirectory>
						<processors>
							<processor>org.springframework.data.ldap.repository.support.LdapAnnotationProcessor</processor>
						</processors>
					</configuration>
				</execution>
			</executions>
			<dependencies>
				<dependency>
					<groupId>com.querydsl</groupId>
					<artifactId>querydsl-apt</artifactId>
					<version>${querydsl.version}</version>
				</dependency>
			</dependencies>
		</plugin>

How to do the same (execute the LdapAnnotationProcessor) with Gradle?

Declare your dependency for the annotationProcessor configuration and if you are not happy with the default path where the generated sources land, configure it on the respective JavaCompile-typed task in the options.

And how can i specify which annotation processor class to run?

Iirc it should just detect all annotation processors and run them.
If you want to restrict to just a specific one, afair you just use options.compilerArgs to specify it using the -processor parameter.