Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Support multiple source directories #32

Open
anthony-o opened this issue Jan 2, 2015 · 6 comments
Open

Support multiple source directories #32

anthony-o opened this issue Jan 2, 2015 · 6 comments

Comments

@anthony-o
Copy link

Here is my use case : I'm generating my @Entity files into target/generated-sources/another-plugin with another maven plugin.

I would like com.mysema.maven:apt-maven-plugin to be able to handle multiple sources directories with for example a configuration parameter like <sourceDirectories>.

@timowest
Copy link
Member

Are you executing the plugins in the right order? And the apt-maven-plugin doesn't pick up the source folder of your other plugin execution?

@timowest
Copy link
Member

timowest commented Feb 8, 2015

@anthony-o Have you been able to resolve the issue?

@anthony-o
Copy link
Author

Thanks for your replies @timowest .

Yes, I'm executing the plugins in the right order (the other plugin THEN com.mysema.maven:apt-maven-plugin:1.1.3) and the sources were not taken into account.

As a workaround, for now I'm generating the entities with the other plugin in src/main/other_plugin_generated_src and configured this as a source using:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <version>1.9.1</version>
    <executions>
        <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>add-source</goal>
            </goals>
            <configuration>
                <sources>
                    <source>src/main/other_plugin_generated_src</source>
                </sources>
            </configuration>
        </execution>
    </executions>
</plugin>

And with this, apt-maven-plugin use my generated entities.

@timowest
Copy link
Member

timowest commented Jun 3, 2015

How do the sources of the other plugin get compiled, if the folder is not added as a compile source root?

@Tcharl
Copy link

Tcharl commented Jun 12, 2016

Hi,

I've the same issues, my sources that should be processed by apt-maven-plugin are in the src/main/java and the src/main/java-gen package.
The plugin is compiled, because of the build-helper-plugin 'add-source' MOJO that add the java-gen folder in the classpath.
Unfortunately, apt-maven-plugin only uses the src/main/java folder.
It should be nice to either take in account the sources folders added by build-helper (the hard but optimal way), or at least add a mojo parameter 'additionalSourceRoot' parameter.
Unfortunately, I don't have the time to contribute for now, I'll do it when I will, but it can be long. Can anyone investigate on it?

Best regards,
Charlie

@Kiemes
Copy link

Kiemes commented Mar 31, 2020

Seems the coding is in since 2016

private List<String> additionalSourceRoots;
but there is not release cut and hence no new version available on https://mvnrepository.com/artifact/com.mysema.maven/apt-maven-plugin (latest of Nov 2014) Could you please create a new release?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants