wangkang5 opened a new issue, #414:
URL: https://github.com/apache/maven-build-cache-extension/issues/414
### Affected version
1.2.1
### Bug description
After executing the command `mvn clean package -Dmaven.test.skip=true -Pdev
-f ./pom.xml`, and then modifying the -P parameter to execute `mvn clean
package -Dmaven.test.skip=true -Ptest -f ./pom.xml`, the build retrieved an
incorrect cache.
pom.xml
```
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<mainClass>ServerApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>spring-service-dubbo.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources/${profiles.active}</directory>
</resource>
</resources>
</build>
```
I tried to modify the maven-build-cache-config.xml by adding the following
configuration:
```
<reconcile logAllProperties="true">
<plugins>
<plugin artifactId="maven-resources-plugin" goal="resources">
<reconciles>
<reconcile propertyName="resources"/>
<reconcile propertyName="filtering"/>
</reconciles>
</plugin>
</plugins>
</reconcile>
```
Rebuilding the cache is not working anymore.
```
[INFO] Scanning plugins configurations to find input files. Probing is
enabled, values will be checked for presence in file system
[INFO] Found 135 input files. Project dir processing: 12, plugins: 1 millis
...
[INFO] Project inputs calculated in 24 ms. SHA-256 checksum
[179be61b922f372ba9a918eb809217a535ff3d9b31c09236bb0a0bee395f38ae] calculated
in 163 ms.
[INFO] Attempting to restore project ... from build cache
[INFO] Local build found by checksum
179be61b922f372ba9a918eb809217a535ff3d9b31c09236bb0a0bee395f38ae
[INFO] Found cached build, restoring ... from cache by checksum
179be61b922f372ba9a918eb809217a535ff3d9b31c09236bb0a0bee395f38ae
[WARNING] Tracked property `resources` not found in cached build. Execution:
default-resources:resources:process-resources:maven-resources-plugin:org.apache.maven.plugins
[WARNING] Cached build record doesn't contain all tracked properties.
Plugin: Plugin [org.apache.maven.plugins:maven-resources-plugin], goal:
resources, executionId: default-resources
[INFO] Cached build violates cache rules, cannot restore
```
Is there a solution to address the issue of differentiating the -P parameter?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]