Skip to content

Commit

Permalink
Fixed Asqatasun#79 - Added maven-checkstyle-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dzc34 committed Jul 11, 2017
1 parent ba1eaa4 commit 7c87b87
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 35 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ none
none

### Task
none
- [#79 - Pom.xml: added maven-checkstyle-plugin](https://github.com/Asqatasun/Contrast-Finder/issues/79)




Contrast-Finder 0.5.2, 2017-07-04
Expand Down
113 changes: 80 additions & 33 deletions documentation/en/30_Contributor_doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,28 @@
* [Release a version of Contrast-Finder](Release/README.md)

-----

* JavaDoc
* OWASP Dependency-Check
* Checking for new dependency / plugin updates
* OWASP Dependency-Check
* Checkstyle
* JavaDoc

## JavaDoc

## Checking for new dependency / plugin updates
```bash
git clone https://github.com/Asqatasun/Contrast-Finder
cd Contrast-finder
```
# Checking for new dependency updates
mvn versions:display-dependency-updates

One of the following command lines:
```bash
mvn javadoc:javadoc
mvn javadoc:aggregate
mvn javadoc:test-javadoc
mvn javadoc:test-aggregate
mvn site
```
# Checking for new plugin updates
mvn versions:display-plugin-updates

JavaDoc is available in the following directories:
```bash
target/site/apidocs
target/site/testapidocs
# Checking for new property-linked updates
mvn versions:display-property-updates
```

### Documentation
* [Apache Maven Javadoc Plugin](https://maven.apache.org/plugins/maven-javadoc-plugin/)
* [Generate Javadocs](https://maven.apache.org/plugins/maven-javadoc-plugin/usage.html)
* [Javadoc Plugin Documentation](https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html)

* http://www.mojohaus.org/versions-maven-plugin/examples/display-dependency-updates.html
* http://www.mojohaus.org/versions-maven-plugin/examples/display-plugin-updates.html
* http://www.mojohaus.org/versions-maven-plugin/examples/display-property-updates.html


## OWASP Dependency-Check
Expand Down Expand Up @@ -69,18 +59,75 @@ mvn dependency-check:help -Ddetail=true -Dgoal=aggregate
* http://jeremylong.github.io/DependencyCheck/
* http://jeremylong.github.io/DependencyCheck/dependency-check-maven/

## Checking for new dependency / plugin updates

## Checkstyle
Scan Contrast-Finder to check the violations of a coding standard.

### Documentation
* http://checkstyle.sourceforge.net/
* http://maven.apache.org/plugins/maven-checkstyle-plugin/

### maven-checkstyle-plugin
```bash
# Checking for new dependency updates
mvn versions:display-dependency-updates
git clone https://github.com/Asqatasun/Contrast-Finder
cd Contrast-finder

# Checking for new plugin updates
mvn versions:display-plugin-updates
# Performs Checkstyle analysis and outputs violations or a count of violations
# to the console, potentially failing the build.
mvn checkstyle:check

# Checking for new property-linked updates
mvn versions:display-property-updates
# A reporting task that performs Checkstyle analysis
# and generates an HTML report for each module
mvn checkstyle:checkstyle

# a reporting task that performs Checkstyle analysis
# and generates an aggregate HTML report
mvn checkstyle:checkstyle-aggregate
mvn site

# Checking for violations as part of the Build
mvn clean install
# Before, remove comments
# around <goal>check</goal> in pom.xml file
```

### checkstyle CLI
```bash
apt-get install checkstyle
git clone https://github.com/Asqatasun/Contrast-Finder
checkstyle -c checkstyle.xml Contrast-Finder/**/*.java
```


### CI (Travis, Gitlab, Jenkins)
...



## JavaDoc

```bash
git clone https://github.com/Asqatasun/Contrast-Finder
cd Contrast-finder
```

One of the following command lines:
```bash
mvn javadoc:javadoc
mvn javadoc:aggregate
mvn javadoc:test-javadoc
mvn javadoc:test-aggregate
mvn site
```

JavaDoc is available in the following directories:
```bash
target/site/apidocs
target/site/testapidocs
```

### Documentation
* http://www.mojohaus.org/versions-maven-plugin/examples/display-dependency-updates.html
* http://www.mojohaus.org/versions-maven-plugin/examples/display-plugin-updates.html
* http://www.mojohaus.org/versions-maven-plugin/examples/display-property-updates.html
* [Apache Maven Javadoc Plugin](https://maven.apache.org/plugins/maven-javadoc-plugin/)
* [Generate Javadocs](https://maven.apache.org/plugins/maven-javadoc-plugin/usage.html)
* [Javadoc Plugin Documentation](https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html)

45 changes: 44 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,35 @@
</configuration>
</plugin>


<!-- Checkstyle
http://checkstyle.sourceforge.net/
http://maven.apache.org/plugins/maven-checkstyle-plugin/
Before, remove comments around <goal>check</goal>
usage: mvn clean install
mvn checkstyle:check -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<configuration>
<!-- <configLocation>checkstyle.xml</configLocation> -->
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<linkXRef>false</linkXRef>
</configuration>
<goals>
<!-- <goal>check</goal> -->
</goals>
</execution>
</executions>
</plugin>

<!-- OWASP Dependency-Check
https://www.owasp.org/index.php/OWASP_Dependency_Check
http://jeremylong.github.io/DependencyCheck/
Expand Down Expand Up @@ -145,6 +174,7 @@
<footerHtmlFile>${project.basedir}/engine/resources/src/main/resources/markdown/html/footer.html</footerHtmlFile>
</configuration>
</plugin>

</plugins>
</build>

Expand All @@ -155,7 +185,20 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
<!-- <version>2.9</version> -->
</plugin>

<!-- Checkstyle
http://checkstyle.sourceforge.net/
http://maven.apache.org/plugins/maven-checkstyle-plugin/
report: target/site/checkstyle-aggregate.html
usage: mvn site
mvn checkstyle:checkstyle-aggregate
mvn checkstyle:checkstyle -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
</plugin>

<!-- OWASP Dependency-Check
Expand Down

0 comments on commit 7c87b87

Please sign in to comment.