Hi Guys, recently I started working on integrating Maven Build Cache extension into our Multi Module Project
I'm also caching test reports to the build can be faster, however I'm facing with this issue
"Unsupported phase: sonar:sonar" and due to which cache is not utilized.
Some Analysis :- It always fails with the above error If I use maven 3.9.0 so I upgraded my local maven and runner maven to 3.9.6 however it fails on gitlab runner but gets passed on local system
Java Version used -: 17.0.9
Maven Version 3.9.6
Maven command :- mvn clean package sonar:sonar -Dsonartokens urls and etc
Local build found by checksum d73234c6f0575ab192af2177fc929534192b35f4c43b232ec33ab550
[INFO] Found cached build, restoring project from cache by checksum d73234c6f0575ab192af2177fc929534192b35f4c43b232ec33ab550
[ERROR] Failed to restore project
java.lang.IllegalArgumentException: Unsupported phase: sonar:sonar
at org.apache.maven.buildcache.LifecyclePhasesHelper.isLaterPhase (LifecyclePhasesHelper.java:135)
at org.apache.maven.buildcache.LifecyclePhasesHelper.isLaterPhaseThanBuild (LifecyclePhasesHelper.java:120)
at org.apache.maven.buildcache.LifecyclePhasesHelper.getCachedSegment (LifecyclePhasesHelper.java:205)
at org.apache.maven.buildcache.CacheControllerImpl.analyzeResult (CacheControllerImpl.java:265)
at org.apache.maven.buildcache.CacheControllerImpl.findLocalBuild (CacheControllerImpl.java:234)
at org.apache.maven.buildcache.CacheControllerImpl.findCachedBuild (CacheControllerImpl.java:185)
at org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.execute (BuildCacheMojosExecutionStrategy.java:114)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
[INFO] Local build was not found by checksum d73234c6f0575ab192af2177fc929534192b35f4c43b232ec33ab550 for project
Regards,
Abhishek Singh
“This email and it’s contents are confidential and intended for the addressee. If you receive this message by mistake, please inform the sender immediately and destroy all copies of this email. It is prohibited to share this email with any third party without the written consent of the sender. Recipients should check the email for threats as the sender accepts no liability for any damage suffered by viewing the contents of this email.”