@@ -0,0 +1,2740 @@
+package pl.openrest.filters.generator;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.Set;%0A%0Aimport org.apache.maven.plugin.AbstractMojo;%0Aimport org.apache.maven.plugin.MojoExecutionException;%0Aimport org.reflections.Reflections;%0Aimport org.reflections.scanners.MethodParameterNamesScanner;%0Aimport org.reflections.scanners.TypeAnnotationsScanner;%0Aimport org.reflections.util.ConfigurationBuilder;%0A%0Aimport pl.openrest.filters.generator.predicate.context.PredicateInformationFactory;%0Aimport pl.openrest.filters.generator.predicate.context.PredicateRepositoryInformation;%0Aimport pl.openrest.filters.generator.predicate.context.PredicateRepositoryInformationFactory;%0Aimport pl.openrest.filters.generator.predicate.serializer.DefaultRemotePredicateRepositoryNamingStrategy;%0Aimport pl.openrest.filters.generator.predicate.serializer.JavaRemotePredicateRepositorySerializer;%0Aimport pl.openrest.filters.generator.predicate.serializer.RemotePredicateRepositoryNamingStrategy;%0Aimport pl.openrest.filters.generator.predicate.serializer.RemotePredicateRepositorySerializer;%0Aimport pl.openrest.filters.predicate.annotation.PredicateRepository;%0A%0A/**%0A * @goal process%0A * @phase process-sources%0A */%0Apublic class RemotePredicateRepositoryGeneratorMojo extends AbstractMojo %7B%0A    /**%0A     * %0A     * @parameter expression=%22$%7Bproject.build.directory%7D/generated-sources/java%22%0A     * @required%0A     */%0A    private File outputDirectory;%0A%0A    public void execute() throws MojoExecutionException %7B%0A        Reflections reflections = new Reflections(new ConfigurationBuilder().forPackages(%22example%22).addScanners(%0A                new MethodParameterNamesScanner(), new TypeAnnotationsScanner()));%0A%0A        RemotePredicateRepositoryNamingStrategy namingStrategy = new DefaultRemotePredicateRepositoryNamingStrategy();%0A        RemotePredicateRepositorySerializer serializer = new JavaRemotePredicateRepositorySerializer(outputDirectory, namingStrategy);%0A        PredicateInformationFactory predicateInfoFactory = new PredicateInformationFactory(reflections);%0A        PredicateRepositoryInformationFactory repoFactory = new PredicateRepositoryInformationFactory(predicateInfoFactory);%0A%0A        Set%3CClass%3C?%3E%3E repositoriesTypes = reflections.getTypesAnnotatedWith(PredicateRepository.class);%0A        List%3CPredicateRepositoryInformation%3E repositoriesInfo = new ArrayList%3CPredicateRepositoryInformation%3E(repositoriesTypes.size());%0A%0A        for (Class repoType : repositoriesTypes) %7B%0A            repositoriesInfo.add(repoFactory.from(repoType));%0A        %7D%0A        try %7B%0A            serializer.serialize(repositoriesInfo);%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%7D%0A

Create RemotePredicateRepositoryGeneratorMojo that searches for PredicateRepositories in classpath, and generates remote predicate repositories