[ 
https://issues.apache.org/jira/browse/MBUILDCACHE-76?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17793159#comment-17793159
 ] 

Dave Moten commented on MBUILDCACHE-76:
---------------------------------------

`nah the problem here is because of the multi module and so projects are part 
of the reactor build.`

If I run mvn clean install on a new snapshot version of a single module project 
I expect that that version should be present in .m2/repository afterwards.

I move on to project B (completely separate) and try to use that new snapshot 
version of project A and it is not found (because build cache maven plugin 
skipped it).

Sure this is an edge case because normally when versions change the source code 
has changed but I still think the plugin can be robust enough to handle it.

Disabling the extension by default is annoying because project users lose 
efficiency and educating project users about these edge cases is a pain in the 
bum.

I've just confirmed the behaviour with a single module project. Just add the 
version to the checksum.

 

 

 

> pom project version change not detected
> ---------------------------------------
>
>                 Key: MBUILDCACHE-76
>                 URL: https://issues.apache.org/jira/browse/MBUILDCACHE-76
>             Project: Maven Build Cache Extension
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Dave Moten
>            Priority: Minor
>
> When I run `mvn versions:set -DnewVersion=BLAH`, the build cache extension 
> does not detect this and skips all modules in a multimodule project (and 
> fails when it encounters a module that depends on one of the other modules (a 
> maven plugin)).
> What should happen is that every module gets rebuilt.
> To duplicate
> ```
> git clone [https://github.com/davidmoten/openapi-codegen.git]
> cd openapi-codegen
> mvn clean install
> mvn versions:set -DnewVersion=1.2.3.4-SNAPSHOT
> mvn clean install
> ```
> Output:
> ```
> [ERROR] Invalid plugin descriptor for 
> com.github.davidmoten:openapi-codegen-maven-plugin:1.2.3.4-SNAPSHOT 
> (/home/dave/.m2/build-cache/v1/com.github.davidmoten/openapi-codegen-maven-plugin/ad4e1e854d87f274/local/openapi-codegen-maven-plugin.jar),
>  Plugin's descriptor contains the wrong version: 0.1.15-SNAPSHOT -> [Help 1]
> ```
> Here is my maven-build-cache-config.xml:
> ```
> <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 
> [https://maven.apache.org/xsd/build-cache-config-1.0.0.xsd]";>
>     <configuration>
>         <enabled>true</enabled>
>         <!-- activated via cli -->
>         <!-- to disable it just use -Dmaven.build.cache.enabled=false -->
>     </configuration>
>     <input>
>         <global>
>             <glob>{{*}.java,{*}.xml,{*}.properties,{*}.mod,*.adoc}</glob>
>             <excludes>
>                 <exclude>{*}Jenkinsfile{*}</exclude>
>                 <exclude>./idea/*</exclude>
>             </excludes>
>         </global>
>         <plugins>
>             <plugin groupId="org.apache.maven.plugins" 
> artifactId="maven-surefire-plugin">
>                 <effectivePom>
>                     <excludeProperties>
>                         
> <excludeProperty>systemPropertyVariables</excludeProperty>
>                     </excludeProperties>
>                 </effectivePom>
>             </plugin>
>         </plugins>
>     </input>
>     <executionControl>
>         <runAlways>
>             <goalsLists>
>                 <goalsList artifactId="maven-install-plugin">
>                     <goals>
>                         <goal>install</goal>
>                     </goals>
>                 </goalsList>
>                 <goalsList artifactId="maven-deploy-plugin">
>                     <goals>
>                         <goal>deploy</goal>
>                     </goals>
>                 </goalsList>
>             </goalsLists>
>         </runAlways>
>         <reconcile>
>             <plugins>
>                 <!-- workaround for 
> https://issues.apache.org/jira/browse/MBUILDCACHE-56 -->
>                 <plugin artifactId="maven-enforcer-plugin" goal="enforce">
>                     <nologs>
>                         <nolog propertyName="commandLineRules"/>
>                     </nologs>
>                 </plugin>
>                 <plugin artifactId="maven-surefire-plugin" goal="test">
>                     <reconciles>
>                         <reconcile propertyName="skip" skipValue="true"/>
>                         <reconcile propertyName="skipExec" skipValue="true"/>
>                         <reconcile propertyName="skipTests" skipValue="true"/>
>                         <reconcile propertyName="testFailureIgnore" 
> skipValue="true"/>
>                     </reconciles>
>                     <nologs>
>                         <nolog propertyName="systemPropertyVariables"/>
>                     </nologs>
>                 </plugin>
>             </plugins>
>         </reconcile>
>     </executionControl>
> </cache>
> ```
>     



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

Reply via email to