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

Oliver Drotbohm commented on MBUILDCACHE-68:
--------------------------------------------

Looks like this is caused by the fact that I don't use an explicit build goal 
as there's a default one defined in the {{{}pom.xml{}}}. Once you use explicit 
goals, thing's are back to work (on the second run).

> NoSuchElementException in CacheUtils.getLast(…)
> -----------------------------------------------
>
>                 Key: MBUILDCACHE-68
>                 URL: https://issues.apache.org/jira/browse/MBUILDCACHE-68
>             Project: Maven Build Cache Extension
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>            Reporter: Oliver Drotbohm
>            Priority: Major
>
> I have a multi-module project with the build cache extension added. The first 
> run works fine, but the second run immediately fails to use the cache with 
> this exception of every module:
> {code}
> [INFO] Local build found by checksum fa6e7de90dd0f397
> [INFO] Found cached build, restoring 
> org.springframework.modulith:spring-modulith-actuator from cache by checksum 
> fa6e7de90dd0f397
> [ERROR] Failed to restore project
> java.util.NoSuchElementException
>     at org.apache.maven.buildcache.CacheUtils.getLast (CacheUtils.java:138)
>     at org.apache.maven.buildcache.xml.Build.getHighestCompletedGoal 
> (Build.java:138)
>     at 
> org.apache.maven.buildcache.LifecyclePhasesHelper.isLaterPhaseThanBuild 
> (LifecyclePhasesHelper.java:119)
>     at org.apache.maven.buildcache.LifecyclePhasesHelper.getCachedSegment 
> (LifecyclePhasesHelper.java:191)
>     at org.apache.maven.buildcache.CacheControllerImpl.analyzeResult 
> (CacheControllerImpl.java:248)
>     at org.apache.maven.buildcache.CacheControllerImpl.findLocalBuild 
> (CacheControllerImpl.java:222)
>     at org.apache.maven.buildcache.CacheControllerImpl.findCachedBuild 
> (CacheControllerImpl.java:187)
>     at org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.execute 
> (BuildCacheMojosExecutionStrategy.java:117)
>     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)
> {code}
> Steps to reproduce:
> {code}
> $ git clone https://github.com/spring-projects/spring-modulith
> $ cd spring-modulith
> $ ./mvnw # runs fine
> $ ./mvnw #shows the exception
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to