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

Olivier Lamy commented on MBUILDCACHE-76:
-----------------------------------------

a temporary workaround is to disable the cache only for the maven-plugin module 
Module `openapi-codegen-maven-plugin`
in the properties section:

{{<properties>
  ....
  <maven.build.cache.enabled>false</maven.build.cache.enabled>
  ....
</properties>}}

We might need to change the code here in the case of a maven-plugin type and 
take into account version when calculating hash for this type.
Or restore the output directory earlier to be able to setup runAlways for 
plugin:descriptor



> 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)).
> 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