Package org.basepom.mojo.duplicatefinder
Class DuplicateFinderMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.basepom.mojo.duplicatefinder.DuplicateFinderMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="check",
requiresProject=true,
threadSafe=true,
defaultPhase=VERIFY,
requiresDependencyResolution=TEST)
public final class DuplicateFinderMojo
extends org.apache.maven.plugin.AbstractMojo
Finds duplicate classes/resources on the classpath.
-
Field Summary
Modifier and TypeFieldDescriptionDeprecated.Inspecting the boot classpath is no longer supported in Java 9+boolean
Check resources and classes on the compile class path.boolean
Check resources and classes on the runtime class path.boolean
Check resources and classes on the test class path.Artifacts with expected and resolved versions that are checked.boolean
Fail the build if any files with the same name are found.boolean
Fail the build if files with the same name but different content are detected.boolean
Fail the build if files with the same name and the same content are detected.String[]
Ignored classes, which are not checked for multiple occurences.String[]
Ignored resources, which are not checked for multiple occurences.boolean
Deprecated.Inspecting the boot classpath is no longer supported in Java 9+boolean
Include POM projects in validation.boolean
Whether existing local directories with classes or existing artifacts are preferred.boolean
Report files that have the same sha256 has value.org.apache.maven.project.MavenProject
The maven project (effective pom).boolean
Deprecated.Maven logging controls the log level now.Output file for the result of the plugin.int
Minimum occurences on the class path to be listed in the result file.boolean
Skips the plugin execution.boolean
Use the default class ignore list.boolean
Use the default resource ignore list.boolean
Write result to output file.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
void
setIgnoredDependencies
(org.apache.maven.model.Dependency... dependencies) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
project
@Parameter(defaultValue="${project}", readonly=true) public org.apache.maven.project.MavenProject projectThe maven project (effective pom). -
printEqualFiles
@Parameter(defaultValue="false", property="duplicate-finder.printEqualFiles") public boolean printEqualFilesReport files that have the same sha256 has value.- Since:
- 1.0.6
-
failBuildInCaseOfDifferentContentConflict
@Parameter(defaultValue="false", property="duplicate-finder.failBuildInCaseOfDifferentContentConflict") public boolean failBuildInCaseOfDifferentContentConflictFail the build if files with the same name but different content are detected.- Since:
- 1.0.3
-
failBuildInCaseOfEqualContentConflict
@Parameter(defaultValue="false", property="duplicate-finder.failBuildInCaseOfEqualContentConflict") public boolean failBuildInCaseOfEqualContentConflictFail the build if files with the same name and the same content are detected.- Since:
- 1.0.3
-
failBuildInCaseOfConflict
@Parameter(defaultValue="false", property="duplicate-finder.failBuildInCaseOfConflict") public boolean failBuildInCaseOfConflictFail the build if any files with the same name are found. -
useDefaultResourceIgnoreList
@Parameter(defaultValue="true", property="duplicate-finder.useDefaultResourceIgnoreList") public boolean useDefaultResourceIgnoreListUse the default resource ignore list. -
useDefaultClassIgnoreList
@Parameter(defaultValue="true", property="duplicate-finder.useDefaultClassIgnoreList") public boolean useDefaultClassIgnoreListUse the default class ignore list.- Since:
- 1.2.1
-
ignoredResourcePatterns
Ignored resources, which are not checked for multiple occurences. -
ignoredClassPatterns
Ignored classes, which are not checked for multiple occurences.- Since:
- 1.2.1
-
conflictingDependencies
Artifacts with expected and resolved versions that are checked. -
checkCompileClasspath
@Parameter(defaultValue="true", property="duplicate-finder.checkCompileClasspath") public boolean checkCompileClasspathCheck resources and classes on the compile class path. -
checkRuntimeClasspath
@Parameter(defaultValue="true", property="duplicate-finder.checkRuntimeClasspath") public boolean checkRuntimeClasspathCheck resources and classes on the runtime class path. -
checkTestClasspath
@Parameter(defaultValue="true", property="duplicate-finder.checkTestClasspath") public boolean checkTestClasspathCheck resources and classes on the test class path. -
skip
@Parameter(defaultValue="false", property="duplicate-finder.skip") public boolean skipSkips the plugin execution. -
quiet
@Parameter(defaultValue="false", property="duplicate-finder.quiet") @Deprecated public boolean quietDeprecated.Maven logging controls the log level now.Quiets the plugin (report only errors).- Since:
- 1.1.0
-
preferLocal
@Parameter(defaultValue="true", property="duplicate-finder.preferLocal") public boolean preferLocalWhether existing local directories with classes or existing artifacts are preferred.- Since:
- 1.1.0
-
resultFile
@Parameter(defaultValue="${project.build.directory}/duplicate-finder-result.xml", property="duplicate-finder.resultFile") public File resultFileOutput file for the result of the plugin.- Since:
- 1.1.0
-
useResultFile
@Parameter(defaultValue="true", property="duplicate-finder.useResultFile") public boolean useResultFileWrite result to output file.- Since:
- 1.1.0
-
resultFileMinClasspathCount
@Parameter(defaultValue="2", property="duplicate-finder.resultFileMinClasspathCount") public int resultFileMinClasspathCountMinimum occurences on the class path to be listed in the result file.- Since:
- 1.1.0
-
includeBootClasspath
@Parameter(defaultValue="false", property="duplicate-finder.includeBootClasspath") @Deprecated public boolean includeBootClasspathDeprecated.Inspecting the boot classpath is no longer supported in Java 9+Include the boot class path in duplicate detection. This will find duplicates with the JDK internal classes (e.g. the classes in rt.jar).- Since:
- 1.1.1
-
bootClasspathProperty
@Parameter(property="duplicate-finder.bootClasspathProperty") @Deprecated public String bootClasspathPropertyDeprecated.Inspecting the boot classpath is no longer supported in Java 9+System property that contains the boot class path.- Since:
- 1.1.1
-
includePomProjects
@Parameter(defaultValue="false", property="duplicate-finder.includePomProjects") public boolean includePomProjectsInclude POM projects in validation.- Since:
- 1.2.0
-
-
Constructor Details
-
DuplicateFinderMojo
public DuplicateFinderMojo()
-
-
Method Details
-
setIgnoredDependencies
public void setIgnoredDependencies(org.apache.maven.model.Dependency... dependencies) throws org.apache.maven.artifact.versioning.InvalidVersionSpecificationException - Throws:
org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-