Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multiple sourceDirectory #182

Open
trydofor opened this issue Feb 19, 2024 · 1 comment
Open

support multiple sourceDirectory #182

trydofor opened this issue Feb 19, 2024 · 1 comment

Comments

@trydofor
Copy link

trydofor commented Feb 19, 2024

support multiple sourceDirectory, somethig like build-helper-maven-plugin do

<sourceDirectory>src1,src2</sourceDirectory>

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <version>${build-helper-maven-plugin.version}</version>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>add-source</goal>
            </goals>
            <configuration>
                <sources>
                    <source>${source.srcMainJava}</source>
                    <source>${source.srcMainJavaGen}</source>
                </sources>
            </configuration>
        </execution>
    </executions>
</plugin>
<plugin>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok-maven-plugin</artifactId>
    <version>${lombok-maven-plugin.version}</version>
    <configuration>
        <addOutputDirectory>false</addOutputDirectory>
        <sourceDirectory>${source.srcMainJava},${source.srcMainJavaGen}</sourceDirectory>
        <outputDirectory>${source.srcMainDelombok}</outputDirectory>
    </configuration>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>delombok</goal>
            </goals>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
        </dependency>
    </dependencies>
</plugin>
@trydofor
Copy link
Author

workaround, copy resources to tmp dir

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <executions>
        <execution>
            <id>copy-java-main-lombok</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>copy-resources</goal>
            </goals>
            <configuration>
                <outputDirectory>${source.srcMainLombok}</outputDirectory>
                <resources>
                    <resource>
                        <directory>${source.srcMainJava}</directory>
                    </resource>
                    <resource>
                        <directory>${source.srcMainJavaGen}</directory>
                    </resource>
                </resources>
            </configuration>
        </execution>
    </executions>
</plugin>

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

No branches or pull requests

1 participant