Clirr cannot resolve transitive dependencies correctly having a version range 
specified.
----------------------------------------------------------------------------------------

                 Key: MCLIRR-16
                 URL: http://jira.codehaus.org/browse/MCLIRR-16
             Project: Maven 2.x Clirr Plugin
          Issue Type: Bug
    Affects Versions: 2.2.2
            Reporter: johan1


If a previous version has dependencies declared with a version range, e.g. 
[1.0,), clirr will fail with the following very missleading error:

[INFO] [clirr:clirr]
[INFO] Comparing to version: 1.1
[WARNING] Attempting to build MavenProject instance for Artifact 
(com.acme.test:mytest:1.1) of type: jar; constructing POM artifact instead.
[ERROR] No previous version was found. Use 'comparisonArtifacts' for explicit 
configuration if you think this is wrong.
[ERROR] VM #displayTree: error : too few arguments to macro. Wanted 2 got 0
[ERROR] VM #menuItem: error : too few arguments to macro. Wanted 1 got 0
[INFO] ------------------------------------------------------------------------

The first problem is, that the clirr plugin completely suppresses the real 
cause. Starting in line 70 of ClirrCheckMojo it says:
        catch ( MissingPreviousException e )
        {
            getLog().info( "No previous version was found. Use 
'comparisonArtifacts'"
                    + " for explicit configuration if you think this is wrong." 
);
            return;
        }

Instead this should be something like:
        catch ( MissingPreviousException e )
        {
            getLog().debug(e);
            getLog().info( "No previous version was found. Use 
'comparisonArtifacts'"
                    + " for explicit configuration if you think this is wrong." 
);
            return;
        }


If this line is added one can see the real exception which in my case was:

org.apache.maven.artifact.versioning.OverConstrainedVersionException: Couldn't 
find a version in [1.0-beta-10, 1.0-beta-7, 1.0-beta-8, 1.0-beta-9, 1.0-jsr-01, 
1.0-jsr-02, 1.0-jsr-03, 1.0-jsr-04] to match range [1.0,)
  groovy:groovy-all:jar:null

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

        at 
org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:365)
        at 
org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(DefaultArtifactCollector.java:76)
        at 
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:300)
        at 
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:288)
        at 
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:259)
        at 
org.codehaus.mojo.clirr.AbstractClirrMojo.getTransitiveDependencies(AbstractClirrMojo.java:442)
        at 
org.codehaus.mojo.clirr.AbstractClirrMojo.resolvePreviousReleaseClasses(AbstractClirrMojo.java:533)
        at 
org.codehaus.mojo.clirr.AbstractClirrMojo.executeClirr(AbstractClirrMojo.java:315)
        at org.codehaus.mojo.clirr.ClirrReport.doReport(ClirrReport.java:250)
        at org.codehaus.mojo.clirr.ClirrReport.generate(ClirrReport.java:226)
        at org.codehaus.mojo.clirr.ClirrReport.generate(ClirrReport.java:382)
        at org.codehaus.mojo.clirr.ClirrReport.execute(ClirrReport.java:189)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to