This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-site.git
The following commit(s) were added to refs/heads/master by this push:
new dac9705 [MNGSITE-465] Java Code Convention - import layouts
dac9705 is described below
commit dac97054d7060ecfb54f1f13fccf062c6c82200e
Author: Slawomir Jaranowski <[email protected]>
AuthorDate: Sun Oct 17 23:01:34 2021 +0200
[MNGSITE-465] Java Code Convention - import layouts
---
content/apt/developers/conventions/code.apt | 22 ++++++++++++++++++++++
.../resources/developers/maven-idea-codestyle.xml | 14 +++++++++++++-
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/content/apt/developers/conventions/code.apt
b/content/apt/developers/conventions/code.apt
index 5bc7ff9..d709521 100644
--- a/content/apt/developers/conventions/code.apt
+++ b/content/apt/developers/conventions/code.apt
@@ -179,6 +179,28 @@ public class MyMojo
[]
+** {Java Code Convention - import layouts}
+
+ For consistency reasons, Java imports should be organized as:
+
+ * import <<javax.*>>
+
+ * blank line
+
+ * import <<java.*>>
+
+ * blank line
+
+ * import <<all other imports>>
+
+ * blank line
+
+ * import <<static all other imports>>
+
+ []
+
+ all imports in each group should be sorted alphabetically.
+
** {JavaDoc Convention}
TO BE DISCUSSED
diff --git a/content/resources/developers/maven-idea-codestyle.xml
b/content/resources/developers/maven-idea-codestyle.xml
index b90ef07..ea802a5 100644
--- a/content/resources/developers/maven-idea-codestyle.xml
+++ b/content/resources/developers/maven-idea-codestyle.xml
@@ -30,6 +30,18 @@ under the License.
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
+ <option name="IMPORT_LAYOUT_TABLE">
+ <value>
+ <package name="javax" withSubpackages="true" static="false" />
+ <emptyLine />
+ <package name="java" withSubpackages="true" static="false" />
+ <emptyLine />
+ <package name="" withSubpackages="true" static="false" />
+ <emptyLine />
+ <package name="" withSubpackages="true" static="true" />
+ </value>
+ </option>
+ <option name="JD_PRESERVE_LINE_FEEDS" value="true" />
</JavaCodeStyleSettings>
<ADDITIONAL_INDENT_OPTIONS fileType="groovy">
<option name="INDENT_SIZE" value="2" />
@@ -109,4 +121,4 @@ under the License.
<option name="TAB_SIZE" value="4" />
</indentOptions>
</codeStyleSettings>
-</code_scheme>
\ No newline at end of file
+</code_scheme>