-
Notifications
You must be signed in to change notification settings - Fork 75
LinkageCheckerMain
com.google.cloud.tools.opensource.classpath.LinkageCheckerMain
is a utility class to run Linkage Checker without depending on Maven enforcer rule plugin.
The class is in Maven artifact com.google.cloud.tools:dependencies
. To use this class you need to resolve its dependencies using a build tool such as Maven or Gradle. For using it with Gradle, please refer to Linkage Checker with Gradle page
The tool requires one of the following options to build a class path.
-
-b <BOM coordinates>
creates a class path from content of a BOM and their dependencies. -
-a <artifact1,artifact2,artifact3...>
creates a class path from the list of Maven artifact coordinates and their dependencies. -
-j <jar1,jar2,jar3...>
creates a class path consists of the list of JAR files.
Sometimes, Linkage Checker reports irrelevant linkage errors from the classes your project never touch. To avoid such noise, you can use -r
option to show linkage errors that are only reachable from entry point classes in terms of class reference graph. For the detail of reachability analysis, please refer to Class reference graph in JLBP Glossary.
You can use exclusion files to control linkage errors. For the detail of Linkage Checker's exclusion files, please refer to its document. This capability is currently in alpha.
-
-e <input exclusion file>
: Use this option to filter out linkage errors by the exclusion file. -
-o <output exclusion file>
: Use this option to output linkage errors into exclusion file format. This option is useful to create a baseline of linkage errors when comparing a change in dependencies.
The following options controls its interaction with Maven repositories when building a class path from Maven artifacts (-a
or -b
option).
-
-m
to add Maven repository to search when resolving dependencies of Maven artifacts. -
-nm
to avoid using default Maven Central repository.