@@ -0,0 +1,2498 @@
+package pl.openrest.rdto.generator;%0A%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0Aimport java.util.Set;%0A%0Aimport org.apache.maven.plugin.MojoExecutionException;%0Aimport org.apache.maven.plugins.annotations.LifecyclePhase;%0Aimport org.apache.maven.plugins.annotations.Mojo;%0Aimport org.junit.runners.Parameterized.Parameter;%0Aimport org.reflections.Reflections;%0Aimport org.reflections.scanners.Scanner;%0Aimport org.reflections.scanners.TypeAnnotationsScanner;%0Aimport org.springframework.util.ReflectionUtils.FieldFilter;%0A%0Aimport pl.openrest.dto.annotations.Dto;%0Aimport pl.openrest.generator.commons.AbstractGeneratorMojo;%0Aimport pl.openrest.generator.commons.Configuration;%0Aimport pl.openrest.generator.commons.type.TypeResolver;%0A%0A@Mojo(name = %22process%22, defaultPhase = LifecyclePhase.PROCESS_SOURCES)%0Apublic class RemoteDtoGeneratorMojo extends AbstractGeneratorMojo %7B%0A%0A    @Parameter%0A    private List%3CFieldFilter%3E dtoFieldFilters = new LinkedList%3C%3E();%0A%0A    @Override%0A    protected void doExecute() throws MojoExecutionException %7B%0A        Reflections reflections = configuration.get(%22reflections%22);%0A        TypeResolver defaultTypeResolver = configuration.get(%22defaultTypeResolver%22);%0A        Set%3CClass%3C?%3E%3E dtoTypes = reflections.getTypesAnnotatedWith(Dto.class);%0A        for (Class%3C?%3E dtoType : dtoTypes) %7B%0A            if (defaultTypeResolver.supports(dtoType))%0A                defaultTypeResolver.resolve(dtoType);%0A        %7D%0A    %7D%0A%0A    @Override%0A    protected Configuration createConfiguration() %7B%0A        Configuration configuration = super.createConfiguration();%0A        configuration.put(%22dtoFieldFilters%22, dtoFieldFilters);%0A        return configuration;%0A    %7D;%0A%0A    @Override%0A    protected void addDefaultTypeResolvers(List%3CTypeResolver%3E typeResolvers) %7B%0A        super.addDefaultTypeResolvers(typeResolvers);%0A        dtoFieldFilters.add(new NonFinalOrStaticFieldFilter());%0A        DtoTypeResolver dtoTypeResolver = new DtoTypeResolver(new CompositeFieldFilter(dtoFieldFilters));%0A        typeResolvers.add(dtoTypeResolver);%0A    %7D%0A%0A    @Override%0A    protected void initializeDefault() %7B%0A        super.initializeDefault();%0A        if (dtoFieldFilters == null) %7B%0A            dtoFieldFilters = new LinkedList%3C%3E();%0A        %7D%0A    %7D%0A%0A    @Override%0A    protected void addDefaultScanners(List%3CScanner%3E scanners) %7B%0A        scanners.add(new TypeAnnotationsScanner());%0A    %7D%0A%0A    public void setDtoFieldFilters(List%3CFieldFilter%3E dtoFieldFilters) %7B%0A        this.dtoFieldFilters = dtoFieldFilters;%0A    %7D%0A%0A%7D%0A

Add RemoteDtoGeneratorMojo that scans classpath for dtos and creates remote classes