siom79 / japicmp

Comparison of two versions of a jar archive
https://siom79.github.io/japicmp
Apache License 2.0
712 stars 107 forks source link

maven plugin (0.15.3) fails when applied to the first version of a given artifact, ignoreNonResolvableArtifacts not honoured #288

Closed juanpablo-santos closed 3 years ago

juanpablo-santos commented 3 years ago

Kind of follow-up of #283, when the plugin is applied to the first version of a given artifact, it fails, no matter if the ignoreNonResolvableArtifacts plugin parameter is set to true, with the following stack trace (included relevant provided parameters in case they help to pinpoint the issue):

[DEBUG] Configuring mojo com.github.siom79.japicmp:japicmp-maven-plugin:0.15.3:cmp from plugin realm ClassRealm[plugin>com.github.siom79.japicmp:japicmp-maven-plugin:0.15.3, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@443b7951]
[DEBUG] Configuring mojo 'com.github.siom79.japicmp:japicmp-maven-plugin:0.15.3:cmp' with basic configurator -->
[...]
[DEBUG]   (f) mojoExecution = com.github.siom79.japicmp:japicmp-maven-plugin:0.15.3:cmp {execution: api-cmp}
[DEBUG]   (s) breakBuildBasedOnSemanticVersioning = true
[DEBUG]   (s) ignoreMissingClasses = true
[DEBUG]   (s) ignoreMissingOldVersion = true
[DEBUG]   (s) ignoreNonResolvableArtifacts = true
[DEBUG]   (s) binaryCompatible = false
[DEBUG]   (s) sourceCompatible = false
[DEBUG]   (s) semanticVersionLevel = PATCH
[DEBUG]   (s) skipPomModules = true
[DEBUG]   (s) skipXmlReport = true
[...]
[DEBUG]   (f) versionRangeWithProjectVersion = (,1.0.0-SNAPSHOT)
[DEBUG] -- end configuration --
[...]
[ERROR] Failed to execute goal com.github.siom79.japicmp:japicmp-maven-plugin:0.15.3:cmp (api-cmp) on project test: Could not find previous version for artifact: test:test -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.siom79.japicmp:japicmp-maven-plugin:0.15.3:cmp (api-cmp) on project test: Could not find previous version for artifact: test:test
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:567)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoFailureException: Could not find previous version for artifact: test:test
    at japicmp.maven.JApiCmpMojo.getComparisonArtifact (JApiCmpMojo.java:231)
    at japicmp.maven.JApiCmpMojo.populateArchivesListsFromParameters (JApiCmpMojo.java:297)
    at japicmp.maven.JApiCmpMojo.getOptions (JApiCmpMojo.java:417)
    at japicmp.maven.JApiCmpMojo.executeWithParameters (JApiCmpMojo.java:135)
    at japicmp.maven.JApiCmpMojo.execute (JApiCmpMojo.java:120)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
[...]
alexbudgh commented 3 years ago

Regression is present even in 15.1 (was trying some older versions to see if I could work around it).

paulthvt commented 3 years ago

It seems that the regression has been introduced in 0.15.0. Version 0.14.4 is working well.

davidnewcomb commented 3 years ago

We have this problem too. I tried to fix it (before I found this issue) and came up with pretty much the same as @alexbudgh. 0.14.4 works so I've switched us down to that. I hope the report isn't too different!

siom79 commented 3 years ago

Fixed: 0.15.4