[
https://issues.apache.org/jira/browse/MBUILDCACHE-24?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17623171#comment-17623171
]
ASF GitHub Bot commented on MBUILDCACHE-24:
-------------------------------------------
AlexanderAshitkin commented on PR #30:
URL:
https://github.com/apache/maven-build-cache-extension/pull/30#issuecomment-1289033331
> I'd like to start a release of `maven-build-cache-extension` this week
after merging #29. @AlexanderAshitkin Is this PR something you want in this
first release ?
HI. So, current situation is that plugin falls with error for a number of
popular plugins (pod and spot bugs among them). I think we need fix this before
releasing first version. The fix looks pretty safe for me, but it requires to
get execution events which are only available in "core extension mode".
In "build extension" mode `EventSpyDispatcher` is not available to extension
and it is not possible to subscribe for events easily. If I add EventSpy into
extension, it disables cache because `BuildCacheMojosExecutionStrategy` is not
discovered by guide. So I'm trying to find solution which will allow to run
extension in both modes
> Cache cannot be processed in presence of forked executions
> ----------------------------------------------------------
>
> Key: MBUILDCACHE-24
> URL: https://issues.apache.org/jira/browse/MBUILDCACHE-24
> Project: Maven Build Cache Extension
> Issue Type: Bug
> Reporter: Alexander Ashitkin
> Priority: Major
> Labels: pull-request-available
>
> Current implementation relies on lifecycle phases presence in
> `MojoExecution`. In case of forked execution
> `MojoExecution#getLifecyclePhase` could return null which result in IAEs in
> multiples places in cache:
>
> {code:java}
> java.lang.IllegalArgumentException: Unsupported phase: null
> at org.apache.maven.buildcache.LifecyclePhasesHelper.isLaterPhase
> (LifecyclePhasesHelper.java:121)
> at
> org.apache.maven.buildcache.LifecyclePhasesHelper.isLaterPhaseThanClean
> (LifecyclePhasesHelper.java:105)
> at org.apache.maven.buildcache.LifecyclePhasesHelper.getCleanSegment
> (LifecyclePhasesHelper.java:139)
> at org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.execute
> (BuildCacheMojosExecutionStrategy.java:101)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:153)
> at
> org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions
> (MojoExecutor.java:366)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:211)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:167)
> at org.apache.maven.lifecycle.internal.MojoExecutor.access$000
> (MojoExecutor.java:66)
> at org.apache.maven.lifecycle.internal.MojoExecutor$1.run
> (MojoExecutor.java:158)
> at org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.execute
> (BuildCacheMojosExecutionStrategy.java:127)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:153)
> at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
> (LifecycleModuleBuilder.java:117)
> at
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call
> (MultiThreadedBuilder.java:196)
> at
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call
> (MultiThreadedBuilder.java:186)
> at java.util.concurrent.FutureTask.run (FutureTask.java:266)
> at java.util.concurrent.Executors$RunnableAdapter.call
> (Executors.java:511)
> at java.util.concurrent.FutureTask.run (FutureTask.java:266)
> at java.util.concurrent.ThreadPoolExecutor.runWorker
> (ThreadPoolExecutor.java:1149)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run
> (ThreadPoolExecutor.java:624)
>
> {code}
> Proposed fix is to resolve `lifecyclePhase` from the originating mojo and use
> it as a lifecycle phase for forked mojos.
> Optionally, the issue probably could be resolved in maven-core by properly
> setting execution phase.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)