Visitar URL original
Revapi produces inconsistent results · Issue #268 · revapi/revapi · GitHub
Skip to content

Revapi produces inconsistent results #268

Open

Description

@rgoers

After upgrading the revapi Maven plugin and revaapi versions in Log4j 2 we immediately ran into failures due to breakage in backward compatibility in configuration from previous versions. Once those were addressed I was able to get a clean build on my MacBook Pro. However, the Linux build is failing in a module with

Error:  Failed to execute goal org.revapi:revapi-maven-plugin:0.14.6:check (default) on project log4j-1.2-api: Failed to execute the API analysis. Failed to obtain class tree due to compilation failure. Compilation failed while analyzing API[archives=[org.apache.logging.log4j:log4j-1.2-api:jar:2.17.1], supplementary=[]]:
Error:  error: cannot access IdentityArrayList
Error:    class file for sun.awt.util.IdentityArrayList not found
Error:    Consult the following stack trace for details.
Error:    com.sun.tools.javac.code.Symbol$CompletionFailure: class file for sun.awt.util.IdentityArrayList not found
Error:  -> [Help 1]

Another committer on the project is also not getting that error but is experiencing a failure in a different Maven module.

Failed to obtain class tree due to compilation failu
re. Compilation failed while analyzing API[archives=[org.apache.logging.log4j:log4j-mongodb3:jar:2.17.1], supplementary=[]]:
[ERROR] error: cannot access MongoCollection
[ERROR]   class file for com.mongodb.client.MongoCollection not found

This is despite the module having a revapi.json that contains:

[ {"extension": "revapi.filter",
    "configuration": {
      "elements": {
        "exclude": ["class com\\.mongodb\\.client\\.MongoCollection"]
      }
    }
  }
]

While running maven clean install works locally for me, when I ran maven release:prepare release:perform I got a different error:

[INFO] [ERROR] Failed to execute goal org.revapi:revapi-maven-plugin:0.14.6:check (default) on project log4j-1.2-api: Failed to execute the API analysis.: Failed to obtain class tree due to compilation failure. Compilation failed while analyzing API[archives=[org.apache.logging.log4j:log4j-1.2-api:jar:2.17.1], supplementary=[]]:
[INFO] [ERROR] error: cannot access PluginType
[INFO] [ERROR]   class file for org.apache.logging.log4j.core.config.plugins.util.PluginType not found
[INFO] [ERROR]   Consult the following stack trace for details.
[INFO] [ERROR]   com.sun.tools.javac.code.Symbol$CompletionFailure: class file for org.apache.logging.log4j.core.config.plugins.util.PluginType not found
[INFO] [ERROR] -> [Help 1]

even though the revapi.json for the module contains

[
  {
    "extension": "revapi.filter",
    "configuration": {
      "elements": {
        "include": [
          {
            "matcher": "java-package",
            "match": "/org\\.apache\\.log4j(\\..*)?/"
          }
        ],
        "exclude": [
          "class org\\.apache\\.logging\\.log4j\\.core\\.config\\.plugins\\.util\\.PluginType"
        ]
      }
    }
  }
]

In addition, while I am able to have revapi run successfully in all Maven modules when performing a "clean install", when I run "mvn site" I get the error shown in issue #267.

Note that I have configured the plugin to only include "org.apache.logging.log4j.*" yet I had a case where I had to specifically exclude Jackson and the error above also shows it looking for a class that should be excluded by default. So it is not clear to me at all why it is looking for com.sun, com.mongodb, or any other classes outside of what it has been instructed to include.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions