coderplus/m2e-connector-for-maven-remote-resources-plugin

Resources not being updated for incremental builds

Opened this issue · 2 comments

I'm seeing issues where resources aren't updated when they're updated in a dependent project (workspace resolution).

Here's sample pom files that show this behaviour.

Common project:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>my-group</groupId>
    <artifactId>common</artifactId>
    <version>1.0-SNAPSHOT</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-remote-resources-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <resourcesDirectory>${basedir}/src/main/resources</resourcesDirectory>
                    <includes>
                        <include>**/*</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

Client project:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>my-group</groupId>
    <artifactId>client</artifactId>
    <version>1.0-SNAPSHOT</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-remote-resources-plugin</artifactId>
                <version>1.5</version>
                <configuration>
                    <resourceBundles>
                        <resourceBundle>my-group:common:1.0-SNAPSHOT</resourceBundle>
                    </resourceBundles>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>process</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>my-group</groupId>
            <artifactId>common</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
    </dependencies>

</project>

Thanks for the sample Jithesh 👍

You are right, currently the connector doesn't process the bundle in the client project if your resources in the bundle has changed. If this has to be fixed, the connector should try to resolve the resource bundle project from workspace and if present look for any delta. If there is some delta, it should trigger the process goal, otherwise not. I will see how this can be implemented.

Hi,

I'm facing this issue too.
There wasn't any progress in five years.
@aneesh-joseph , there weren't any update for many years in the code base, is this plugin dead or do you plan to work on issues ?

Regards