...
Import Google style preferences
Follow If the above ONAP Eclipse formatter is not used, follow instructions on: Installing the coding style settings in eclipse.
See also Java code style
Modify settings to adapt to ONAP
...
- Check out oparent
- git tag -l
- git co tags/1.2.1 3 -b 1.2.1
- edit checkstyle/src/main/resources/onap-checkstyle/onap-java-style.xml, fix bug
- <property name="maxLineLength" value="120"/>
+ <!--property name="maxLineLength" value="120"/→ - 3
- If you want CheckStyle to ignore generated files, do the following:
- Add the following tag to the above file:
<module name="SuppressionFilter">
<property name="file" value="<absolute path to the directory of the file>/suppressions.xml"/>
</module> - Create a file called "suppressions.xml" in the folder given above, and put the following content in it:
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions>
<suppress files="[\\/]generated-sources[\\/]" checks="[a-zA-Z0-9]*"/>
</suppressions>
- Add the following tag to the above file:
- The versions in the POMs in oparent are snapshot, so we need to change those to 1.2.1
mvn versions:set -DnewVersion=1.2.1 - Now build locally:
mvn clean install
...
Wrapping and Braces → hard wrap at ( 120)
SO Project: Method above won't work, install plugin Eclipse Code Formatter and configure it with the corresponding xml file (so/project-configs/code-tools/onap-eclipse-format.xml)
Configure ONAP copyright for IntelliJ
...