Re: Strange behavior using maven build-cache extension in maven-release-plugin goals

2024-01-29 Thread Javier Gómez

Hi Olivier,

No, the maven deploy goal is not executed twice if I launch it directly. 
It only happens with therelease:perform goal (which has a deploy goal 
configured)



  org.apache.maven.plugins
  maven-release-plugin
  3.0.0
  
-DskipEnforceSnapshots -DskipITs -DskipTests 
-DskipUTs
deploy

On 25/1/24 9:13, Olivier Lamy wrote:

PRECAUCIÓN: Este mensaje es de un REMITENTE EXTERNO - sea CUIDADOSO, en 
particular con los enlaces y archivos adjuntos. / CAUTION: This message is from 
an EXTERNAL SENDER - be CAUTIOUS, particularly with links and attachments.

interesting.
is the deploy goal executed twice as well when you run "mvn deploy"?
(as you marked as it as alwaysRun)

On Sun, 21 Jan 2024 at 23:00, Javier Gómez  wrote:

Hi all,

We are starting to apply the build-cache maven extension in our local and CI 
environment,  and we have seen strange behavior in several maven projects, when 
using the release plugin in conjunction with build-cache, which we have been 
able to reproduce both locally and in CI.

Our usual release plugin configuration is:

 
   org.apache.maven.plugins
   maven-release-plugin
   3.0.0
   
 -DskipEnforceSnapshots -DskipITs -DskipTests 
-DskipUTs
 deploy
 
SemVerVersionPolicy
 GithubReleaseStrategy
 @{prefix} Prepare release 
@{releaseLabel}
 @{prefix} Prepare for next development 
iteration
 @{project.version}
   

When we add the build-cache extension to the project, and execute the release 
with: mvn release:prepare release:perform -DreleaseVersion=x.y.z we can observe 
a strange behavior when maven is launching the release:perform goal, we see 
that the deploy goal is executed 2 times for each artifact (in fact it seems 
that the maven lifecycle restarts, once it reaches the deploy and begins to 
execute the validate again) and when it reaches the 2nd execution of deploy, it 
fails (since the user we use do not have permissions to overwrite artifacts). 
Below I show an extract from the log:

...

[INFO] [INFO] 

[INFO] [INFO] Reactor Build Order:
[INFO] [INFO]
[INFO] [INFO] temp.mectagcore:mectagcore [pom]
[INFO] [INFO] temp.mectagcore:mectagcore-domain  [jar]
[INFO] [INFO] temp.mectagcore:mectagcore-boot[jar]
[INFO] [INFO] temp.mectagcore:jacoco-report-aggregate[pom]
[INFO] [INFO]
[INFO] [INFO] -< temp.mectagcore:mectagcore >-
[INFO] [INFO] Building temp.mectagcore:mectagcore 1.0.0  [1/9]
[INFO] [INFO]   from pom.xml
[INFO] [INFO] [ pom 
]-
[INFO] [INFO] Going to calculate checksum for project [groupId=temp.mectagcore, 
artifactId=mectagcore]
[INFO] [INFO] Project inputs calculated in 12 ms. SHA-256 checksum 
[16534757c14aae9b1ff1961664995f0e7e9396fb88309d207a8a23c080c7f661] calculated 
in 4 ms.
[INFO] [INFO] Attempting to restore project temp.mectagcore:mectagcore from 
build cache
[INFO] [INFO] Local build found by checksum 
16534757c14aae9b1ff1961664995f0e7e9396fb88309d207a8a23c080c7f661
[INFO] [INFO] Found cached build, restoring temp.mectagcore:mectagcore from 
cache by checksum 
16534757c14aae9b1ff1961664995f0e7e9396fb88309d207a8a23c080c7f661
[INFO] [INFO] Project temp.mectagcore:mectagcore restored partially. Highest 
cached goal: verify, requested: deploy
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.failsafe.IntegrationTestMojo', role hint: 
'org.apache.maven.plugins:maven-failsafe-plugin:3.0.0:integration-test'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.failsafe.VerifyMojo', role hint: 
'org.apache.maven.plugins:maven-failsafe-plugin:3.0.0:verify'
[INFO] ---
[INFO] [INFO] Skipping plugin execution (cached): enforcer:enforce
[INFO] [INFO] Skipping plugin execution (cached): enforcer:enforce
[INFO] [INFO] Skipping plugin execution (cached): build-helper:add-source
[INFO] [INFO] Mojo execution is forced by project property: 
amiga-assembly:amiga-assembly
[INFO] [INFO]
[INFO] [INFO] --- amiga-assembly:5.5.0:amiga-assembly 
(amiga-assembly-execution) @ mectagcore ---
[INFO] [INFO] Mojo execution is forced by project property: source:jar-no-fork
[INFO] [INFO]
[INFO] [INFO] --- source:3.2.1:jar-no-fork (attach-sources) @ mectagcore ---
[INFO] [INFO] Skipping plugin execution (cached): failsafe:integration-test
[INFO] [INFO] Skipping plugin execution (cached): failsafe:verify
[INFO] [INFO]
[INFO] [INFO] --- install:3.1.1:install (default-install) @ mectagcore ---
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugins.install.Install

Strange behavior using maven build-cache extension in maven-release-plugin goals

2024-01-21 Thread Javier Gómez

Hi all,

We are starting to apply the build-cache maven extension in our local 
and CI environment,  and we have seen strange behavior in several maven 
projects, when using the release plugin in conjunction with build-cache, 
which we have been able to reproduce both locally and in CI.


Our usual release plugin configuration is:

    
org.apache.maven.plugins
maven-release-plugin
  3.0.0
  
*    -DskipEnforceSnapshots -DskipITs -DskipTests 
-DskipUTs

    deploy
* SemVerVersionPolicy
GithubReleaseStrategy
    @{prefix} Prepare release 
@{releaseLabel}
    @{prefix} Prepare for next 
development iteration

@{project.version}
  

When we add the build-cache extension to the project, and execute the 
release with: mvn release:prepare release:perform 
-DreleaseVersion=x.y.zwe can observe a strange behavior when maven is 
launching the release:perform goal, we see that the deploy goal is 
executed 2 times for each artifact (in fact it seems that the maven 
lifecycle restarts, once it reaches the deploy and begins to execute the 
validate again) and when it reaches the 2nd execution of deploy, it 
fails (since the user we use do not have permissions to overwrite 
artifacts). Below I show an extract from the log:


...

[INFO] [INFO] 


[INFO] [INFO] Reactor Build Order:
[INFO] [INFO]
[INFO] [INFO] temp.mectagcore:mectagcore [pom]
[INFO] [INFO] temp.mectagcore:mectagcore-domain [jar]
[INFO] [INFO] temp.mectagcore:mectagcore-boot [jar]
[INFO] [INFO] temp.mectagcore:jacoco-report-aggregate [pom]
[INFO] [INFO]
[INFO] [INFO] -< temp.mectagcore:mectagcore 
>-
[INFO] [INFO] Building temp.mectagcore:mectagcore 1.0.0  
[1/9]

[INFO] [INFO]   from pom.xml
[INFO] [INFO] [ pom 
]-
[INFO] [INFO] Going to calculate checksum for project 
[groupId=temp.mectagcore, artifactId=mectagcore]
[INFO] [INFO] Project inputs calculated in 12 ms. SHA-256 checksum 
[16534757c14aae9b1ff1961664995f0e7e9396fb88309d207a8a23c080c7f661] 
calculated in 4 ms.
[INFO] [INFO] Attempting to restore project temp.mectagcore:mectagcore 
from build cache
[INFO] [INFO] Local build found by checksum 
16534757c14aae9b1ff1961664995f0e7e9396fb88309d207a8a23c080c7f661
[INFO] [INFO] Found cached build, restoring temp.mectagcore:mectagcore 
from cache by checksum 
16534757c14aae9b1ff1961664995f0e7e9396fb88309d207a8a23c080c7f661
[INFO] [INFO] Project temp.mectagcore:mectagcore restored partially. 
Highest cached goal: verify, requested: deploy
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.failsafe.IntegrationTestMojo', role hint: 
'org.apache.maven.plugins:maven-failsafe-plugin:3.0.0:integration-test'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugin.failsafe.VerifyMojo', role hint: 
'org.apache.maven.plugins:maven-failsafe-plugin:3.0.0:verify'

[INFO] ---
[INFO] [INFO] Skipping plugin execution (cached): enforcer:enforce
[INFO] [INFO] Skipping plugin execution (cached): enforcer:enforce
[INFO] [INFO] Skipping plugin execution (cached): build-helper:add-source
[INFO] [INFO] Mojo execution is forced by project property: 
amiga-assembly:amiga-assembly

[INFO] [INFO]
[INFO] [INFO] --- amiga-assembly:5.5.0:amiga-assembly 
(amiga-assembly-execution) @ mectagcore ---
[INFO] [INFO] Mojo execution is forced by project property: 
source:jar-no-fork

[INFO] [INFO]
[INFO] [INFO] --- source:3.2.1:jar-no-fork (attach-sources) @ mectagcore ---
[INFO] [INFO] Skipping plugin execution (cached): failsafe:integration-test
[INFO] [INFO] Skipping plugin execution (cached): failsafe:verify
[INFO] [INFO]
[INFO] [INFO] --- install:3.1.1:install (default-install) @ mectagcore ---
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugins.install.InstallMojo', role hint: 
'org.apache.maven.plugins:maven-install-plugin:3.1.1:install'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugins.install.InstallFileMojo', role hint: 
'org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file'

[INFO] ---
[INFO] [INFO] Installing 
/tmp/mic-mectagcore/code/target/checkout/code/pom.xml to 
/home/alambike/.m2/repository/temp/mectagcore/mectagcore/1.0.0/mectagcore-1.0.0.pom

[INFO] [INFO]
[INFO] [INFO] --- deploy:3.1.1:deploy (default-deploy) @ mectagcore ---
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugins.deploy.DeployFileMojo', role hint: 
'org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy-file'
[INFO] role: 'org.apache.maven.plugin.Mojo', implementation: 
'org.apache.maven.plugins.maven_deploy_plugin.HelpMojo', role hint: 
'org.apache.maven.plugins:maven-deploy-plugin:3.1.1:help'

[INFO] ---
[INFO] [INFO] Uploading to maven-artifacts: 

overwriting a read-only attribute in Checkstyle config

2020-04-23 Thread Javier Gómez

Hi,

we are testing a config, that overwrites a readonly attribute, in Maven 
Checkstyle plugin config, to be able to analyze a set of resource 
folders in project root folder.


We don't want to define this spefic folders config in POM build 
 block, to avoid inherit that in child POMs, so we are 
forcing that at the plugin level, specifying the  block 
attribute.


That this is a read-only attribute, and we define it in the plugin 
configuration, does not imply that the compilation fails, as I would 
expect. Is that correct?


Any side effect that we could expect of this configuration?

Thanks in advance.


===

# Directory structure layout:

/module1
   src/main/java
   src/main/resources
   pom.xml
/module2
   ...
/src
/dir1
/dir2
pom.xml

#
# Parent POM build config
#





[Checkstyle config]





     # config to analyze the specific resources folders, in project 
root folder


org.apache.maven.plugins
maven-checkstyle-plugin
 false
 
 
 
 dir1
 
 
 dir2