aboutsummaryrefslogtreecommitdiffstats
path: root/src/site-docs/adoc/fragments/howto-codestyle/30-configure-checkstyle-maven.adoc
diff options
context:
space:
mode:
authorramverma <ram.krishna.verma@ericsson.com>2018-07-31 18:25:39 +0100
committerramverma <ram.krishna.verma@ericsson.com>2018-07-31 18:27:31 +0100
commitaf74a6270d6ab6badf04a97495a6ef8ccded9b4b (patch)
tree2c7a536e54207a0870ca2008ce457a64de917ab9 /src/site-docs/adoc/fragments/howto-codestyle/30-configure-checkstyle-maven.adoc
parent9e318f20f2e64970bf3c2e3a5532c516231a6f8a (diff)
Adding first set of apex-pdp document changes
Adding document changes for auth, context, core, model, services & the main apex-pdp module. Change-Id: Id0d026baa258f1dc6998978f9911f3c4a73b5b3b Issue-ID: POLICY-867 Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
Diffstat (limited to 'src/site-docs/adoc/fragments/howto-codestyle/30-configure-checkstyle-maven.adoc')
-rw-r--r--src/site-docs/adoc/fragments/howto-codestyle/30-configure-checkstyle-maven.adoc45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/site-docs/adoc/fragments/howto-codestyle/30-configure-checkstyle-maven.adoc b/src/site-docs/adoc/fragments/howto-codestyle/30-configure-checkstyle-maven.adoc
new file mode 100644
index 000000000..2e6698fff
--- /dev/null
+++ b/src/site-docs/adoc/fragments/howto-codestyle/30-configure-checkstyle-maven.adoc
@@ -0,0 +1,45 @@
+//
+// ============LICENSE_START=======================================================
+// Copyright (C) 2016-2018 Ericsson. All rights reserved.
+// ================================================================================
+// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE
+// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode
+//
+// SPDX-License-Identifier: CC-BY-4.0
+// ============LICENSE_END=========================================================
+//
+// @author Sven van der Meer (sven.van.der.meer@ericsson.com)
+//
+
+== Configure Checkstyle (Maven)
+
+When using a custom style configuration with Checkstyle, the definition of that style must of course be available to Checkstyle.
+In order not to have to distribute style files for checkstyle into all Maven modules, it is recommended that a special Maven module be built that contains the checkstyle style definition.
+That module is then used as a dependency in the __POM__ for all other modules that wish to use that checkstyle style.
+For a full explanation see link:https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html[the explanation of Checkstyle multi-module configuration].
+
+In Apex, the module `apex-model.build-tools` provides the Apex checkstyle style files as resources in `src/main/resources/checkstyle`.
+This style is a slightly tweaked version of the standard Google checkstyle style that allows longer lines and has some other checks slightly relaxed.
+Therefore, all modules that wish to use the Apex style must put the following build directive into their `pom.xml`.
+
+[source%nowrap,xml]
+----
+<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.17</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.policy.apex.model</groupId>
+ <artifactId>apex-model.build-tools</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <configLocation>checkstyle/apex_style_checks.xml</configLocation>
+ <headerLocation>checkstyle/apex_header.txt</headerLocation>
+ </configuration>
+</plugin>
+----
+
+