This repository has been archived by the owner on Dec 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: move user document from README to maven site
- Loading branch information
Showing
7 changed files
with
63 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,38 +37,11 @@ | |
|
||
/** | ||
* A mojo to generate {@code -onlyAnalyze} parameter for spotbugs-maven-plugin. Generated parameter | ||
* will be set as property of current Maven execution. | ||
* will be set as property of current Maven execution.<br> | ||
* | ||
* <p>Execute this mojo before you run spotbugs-maven-plugin, then you can check analysis only for | ||
* Execute this mojo before you run spotbugs-maven-plugin, then you can check analysis only for | ||
* updated Java classes. | ||
* | ||
* <pre> | ||
* <plugin> | ||
* <groupId>com.worksap.tools</groupId> | ||
* <artifactId>incremental-analysis-maven-plugin</artifactId> | ||
* <version>1.0.1</version> | ||
* <executions> | ||
* <execution> | ||
* <phase>verify</phase> | ||
* <goals> | ||
* <goal>spotbugs</goal> | ||
* </goals> | ||
* </execution> | ||
* </executions> | ||
* </plugin> | ||
* <plugin> | ||
* <groupId>org.codehaus.mojo</groupId> | ||
* <artifactId>spotbugs-maven-plugin</artifactId> | ||
* <executions> | ||
* <execution> | ||
* <phase>verify</phase> | ||
* <goals> | ||
* <goal>spotbugs</goal> | ||
* </goals> | ||
* </execution> | ||
* </executions> | ||
* </plugin></pre> | ||
* | ||
* @author Kengo TODA ([email protected]) | ||
*/ | ||
@Mojo( | ||
|
@@ -79,21 +52,36 @@ | |
public class SpotBugsMojo extends AbstractMojo { | ||
private final GitUpdatedJavaCodeDetector detector; | ||
|
||
@Parameter(property = "project", required = true) | ||
@Parameter(property = "project") | ||
private MavenProject project; | ||
|
||
/** | ||
* Name of the property to generate value by this plugin, to specify {@code -onlyAnalyze} option to SpotBugs. | ||
*/ | ||
@Parameter(defaultValue = "spotbugs.onlyAnalyze") | ||
private String propertyToAnalyze; | ||
|
||
/** | ||
* Name of the property to generate value by this plugin, to decide that spotbugs-maven-plugin needs to skip analysis or not. | ||
*/ | ||
@Parameter(defaultValue = "spotbugs.skip") | ||
private String propertyToSkip; | ||
|
||
/** | ||
* Git ref of the source of pull-request or merge-request. | ||
*/ | ||
@Parameter(defaultValue = Constants.HEAD, property = "incremental.spotbugs.source") | ||
private String source; | ||
|
||
/** | ||
* Git ref of the target of pull-request or merge-request. | ||
*/ | ||
@Parameter(defaultValue = "refs/heads/master", property = "incremental.spotbugs.target") | ||
private String target; | ||
|
||
/** | ||
* Flag to skip execution of this incremental-analysis plugin. | ||
*/ | ||
@Parameter(defaultValue = "false", property = "incremental.spotbugs.skip") | ||
private boolean skip; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## Run incremental analysis in local | ||
|
||
By default, this plugin runs to detect changes between your `HEAD` and `refs/heads/master`. | ||
This fits [the GitHub Flow](https://githubflow.github.io/) and [the GitLab Flow](https://docs.gitlab.com/ee/workflow/gitlab_flow.html). | ||
|
||
If you want to full analysis in local, use `<skip>` configuration then Maven run full analysis by default. | ||
You may overwrite this configuration by profile activated in the CI build. | ||
|
||
```xml | ||
<plugin> | ||
<groupId>com.worksap.tools</groupId> | ||
<artifactId>incremental-analysis-maven-plugin</artifactId> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## Run incremental analysis in your Maven project | ||
|
||
Refer [the plugin documentation](/plugin-info.html) and modify your `pom.xml` accordingly. | ||
|
||
Make sure this plugin is described before the [spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin/). | ||
Then spotbugs-maven-plugin can use updated property and run incremental analysis. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## Incremental Analysis Maven Plugin | ||
|
||
This Maven Plugin helps developers to run static analysis only for updated codes. | ||
Designed to use in incremental build, like pre-merge build and local build. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters