You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Venelin Koulaxazov (Jira)" <ji...@apache.org> on 2023/03/13 18:12:00 UTC

[jira] [Updated] (MBUILDCACHE-47) Extension computes a new check sum for a project with multiple modules without any changes

     [ https://issues.apache.org/jira/browse/MBUILDCACHE-47?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Venelin Koulaxazov updated MBUILDCACHE-47:
------------------------------------------
    Description: 
I have a maven project with 2 modules and a parent pom as such
{code:java}
<modules>
    <module>api</module>
    <module>service</module>
</modules> {code}
I would like to take advantage of the maven cache extension and I've added it in the build section of the parent pom as such
{code:java}
<extensions>
    <extension>
        <groupId>org.apache.maven.extensions</groupId>
        <artifactId>maven-build-cache-extension</artifactId>
        <version>1.0.0</version>
     </extension>
</extensions> {code}
I've also added a maven-build-cache-config.xml file however it would seem that every time I run {{mvn clean package}} a different checksum is generated for my submodules and as a result I don't actually benefit from the caching since all my java files are in those submodules

I've tried multiple configs with no luck unfortunately
{code:java}
<?xml version="1.0" encoding="UTF-8" ?>
<cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0 http://maven.apache.org/xsd/cache-config-1.0.0.xsd">
    <configuration>
        <enabled>true</enabled>
        <hashAlgorithm>XX</hashAlgorithm>
    </configuration>
    <input>
        <global>
            <glob>{*.java,*.xml,*.properties}</glob>
            <includes>
                <include>recursive=api/*</include>
                <include>recursive=service/*</include>
            </includes>
        </global>
    </input>
</cache> {code}
How can I make this extension actually cache the contents of my submodules with the same checksum if there haven't been changes. I know this extension is fairly recent and I haven't been able to find any hits online.

*EDIT*

Commenting one of the child modules out, actually ended up working and the cache is kicking in correctly. Is it possible there's a limitation to the extension in that it scans for a single module?

  was:
I have a maven project with 2 modules and a parent pom as such
{code:java}
<modules>
    <module>api</module>
    <module>service</module>
</modules> {code}
I would like to take advantage of the maven cache extension and I've added it in the build section of the parent pom as such
<extensions>
        <extension>
            <groupId>org.apache.maven.extensions</groupId>
            <artifactId>maven-build-cache-extension</artifactId>
            <version>1.0.0</version>
        </extension>
</extensions>

I've also added a maven-build-cache-config.xml file however it would seem that every time I run {{mvn clean package}} a different checksum is generated for my submodules and as a result I don't actually benefit from the caching since all my java files are in those submodules

I've tried multiple configs with no luck unfortunately
<?xml version="1.0" encoding="UTF-8" ?>
<cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0 http://maven.apache.org/xsd/cache-config-1.0.0.xsd">
    <configuration>
        <enabled>true</enabled>
        <hashAlgorithm>XX</hashAlgorithm>
    </configuration>
    <input>
        <global>
            <glob>\{*.java,*.xml,*.properties}</glob>
            <includes>
                <include>recursive=api/*</include>
                <include>recursive=service/*</include>
            </includes>
        </global>
    </input>
</cache>

How can I make this extension actually cache the contents of my submodules with the same checksum if there haven't been changes. I know this extension is fairly recent and I haven't been able to find any hits online.

*EDIT*

Commenting one of the child modules out, actually ended up working and the cache is kicking in correctly. Is it possible there's a limitation to the extension in that it scans for a single module?


> Extension computes a new check sum for a project with multiple modules without any changes
> ------------------------------------------------------------------------------------------
>
>                 Key: MBUILDCACHE-47
>                 URL: https://issues.apache.org/jira/browse/MBUILDCACHE-47
>             Project: Maven Build Cache Extension
>          Issue Type: Bug
>          Components: remote build cache
>            Reporter: Venelin Koulaxazov
>            Priority: Critical
>
> I have a maven project with 2 modules and a parent pom as such
> {code:java}
> <modules>
>     <module>api</module>
>     <module>service</module>
> </modules> {code}
> I would like to take advantage of the maven cache extension and I've added it in the build section of the parent pom as such
> {code:java}
> <extensions>
>     <extension>
>         <groupId>org.apache.maven.extensions</groupId>
>         <artifactId>maven-build-cache-extension</artifactId>
>         <version>1.0.0</version>
>      </extension>
> </extensions> {code}
> I've also added a maven-build-cache-config.xml file however it would seem that every time I run {{mvn clean package}} a different checksum is generated for my submodules and as a result I don't actually benefit from the caching since all my java files are in those submodules
> I've tried multiple configs with no luck unfortunately
> {code:java}
> <?xml version="1.0" encoding="UTF-8" ?>
> <cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0 http://maven.apache.org/xsd/cache-config-1.0.0.xsd">
>     <configuration>
>         <enabled>true</enabled>
>         <hashAlgorithm>XX</hashAlgorithm>
>     </configuration>
>     <input>
>         <global>
>             <glob>{*.java,*.xml,*.properties}</glob>
>             <includes>
>                 <include>recursive=api/*</include>
>                 <include>recursive=service/*</include>
>             </includes>
>         </global>
>     </input>
> </cache> {code}
> How can I make this extension actually cache the contents of my submodules with the same checksum if there haven't been changes. I know this extension is fairly recent and I haven't been able to find any hits online.
> *EDIT*
> Commenting one of the child modules out, actually ended up working and the cache is kicking in correctly. Is it possible there's a limitation to the extension in that it scans for a single module?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)