You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/10/19 10:55:19 UTC

[GitHub] [maven-ear-plugin] elharo commented on a change in pull request #24: [MEAR-153] skinnyModules option

elharo commented on a change in pull request #24:
URL: https://github.com/apache/maven-ear-plugin/pull/24#discussion_r507647064



##########
File path: src/main/java/org/apache/maven/plugins/ear/AbstractEarModule.java
##########
@@ -360,34 +374,34 @@ public String toString()
     }
 
     /**
-     * Cleans the bundle directory so that it might be used properly.
+     * Cleans the path pointing to resource inside archive so that it might be used properly.

Review comment:
       the resource inside the archive

##########
File path: src/main/java/org/apache/maven/plugins/ear/AbstractEarModule.java
##########
@@ -91,6 +91,14 @@
 
     private String moduleId;
 
+    /**
+     * Directory of module which contains libraries packaged into module. {@code null} value means that module
+     * doesn't contain any library. Each module type can provide default value for this directory and this option
+     * can be used to override that default value. If module libraries are located at the root of module then use
+     * single slash (/) to configure that in POM, i.e. single slash is treated as empty string.

Review comment:
        single slash (/) to configure that in POM. That is, a single slash is treated as an empty string.

##########
File path: src/main/java/org/apache/maven/plugins/ear/EarModule.java
##########
@@ -114,7 +114,8 @@ void resolveArtifact( Set<Artifact> artifacts )
     boolean changeManifestClasspath();
 
     /**
-     * @return The libDir.
+     * @return The directory of module which contains JAR libraries packaged within module. Can be {@code null},

Review comment:
       the directory of the module which contains the JAR files packages within the module 

##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License.  You may obtain a copy of the License at
+~~
+~~   http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied.  See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+  * {{{../modules.html#webModule}WAR}}
+
+  * {{{../modules.html#rarModule}RAR}}
+
+  * {{{../modules.html#wsrModule}WSR}}
+
+  * {{{../modules.html#sarModule}SAR}}
+
+  * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing

Review comment:
       3.1.1., the

##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License.  You may obtain a copy of the License at
+~~
+~~   http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied.  See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+  * {{{../modules.html#webModule}WAR}}
+
+  * {{{../modules.html#rarModule}RAR}}
+
+  * {{{../modules.html#wsrModule}WSR}}
+
+  * {{{../modules.html#sarModule}SAR}}
+
+  * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing

Review comment:
       the Maven EAR

##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License.  You may obtain a copy of the License at
+~~
+~~   http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied.  See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+  * {{{../modules.html#webModule}WAR}}
+
+  * {{{../modules.html#rarModule}RAR}}
+
+  * {{{../modules.html#wsrModule}WSR}}
+
+  * {{{../modules.html#sarModule}SAR}}
+
+  * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged

Review comment:
       delete "just"

##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -211,6 +211,18 @@
     @Parameter( defaultValue = "false" )
     private boolean skinnyWars;
 
+    /**
+     * Whether to create skinny EAR modules or not. A skinny EAR module is a WAR, SAR, HAR, RAR or WSR module that
+     * does not have all of its dependencies in it. Instead those dependencies are shared between the WARs, SARs, HARs,
+     * RARs and WSRs through the EAR. This option takes precedence over {@link #skinnyWars} option, i.e. if

Review comment:
       over the
   . i.e. --> . That is,

##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -739,6 +751,11 @@ public boolean isNonFilteredExtension( String fileName )
     private void changeManifestClasspath( EarModule module, File original, JavaEEVersion javaEEVersion )
         throws MojoFailureException
     {
+        final String moduleLibDir = module.getLibDir();
+        if ( !( moduleLibDir == null || skinnyModules || skinnyWars && module instanceof WebModule ) )

Review comment:
       Please add some extra parentheses for those of us who don't immediately the exact precedence of || and &&

##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -211,6 +211,18 @@
     @Parameter( defaultValue = "false" )
     private boolean skinnyWars;
 
+    /**
+     * Whether to create skinny EAR modules or not. A skinny EAR module is a WAR, SAR, HAR, RAR or WSR module that
+     * does not have all of its dependencies in it. Instead those dependencies are shared between the WARs, SARs, HARs,

Review comment:
       "have all of its dependencies in it" --> contain all of its dependencies.

##########
File path: src/main/java/org/apache/maven/plugins/ear/EarMojo.java
##########
@@ -799,16 +816,16 @@ private void changeManifestClasspath( EarModule module, File original, JavaEEVer
                 classPath = new Attribute( "Class-Path", "" );
             }
 
-            // Remove JAR modules
-            for ( JarModule jm : getAllJarModules() )
+            if ( moduleLibDir != null && ( skinnyModules || skinnyWars && module instanceof WebModule ) )

Review comment:
       more parentheses please

##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License.  You may obtain a copy of the License at
+~~
+~~   http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied.  See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+  * {{{../modules.html#webModule}WAR}}
+
+  * {{{../modules.html#rarModule}RAR}}
+
+  * {{{../modules.html#wsrModule}WSR}}
+
+  * {{{../modules.html#sarModule}SAR}}
+
+  * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
+ in EAR and to keep them close to the names used in local repository
+ for a better readability.
+
++-----------------+
+<project>
+  ...
+  <dependencies>
+    <!-- This is the JAR we want to share -->
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>shared-jar</artifactId>
+      <version>1.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>war</artifactId>
+      <version>1.0.0</version>
+      <type>war</type>
+    </dependency>
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>rar</artifactId>
+      <version>1.0.0</version>
+      <type>rar</type>
+    </dependency>
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>sar</artifactId>
+      <version>1.0.0</version>
+      <type>sar</type>
+    </dependency>
+  </dependencies>
+  ...
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-ear-plugin</artifactId>
+        <version>${project.version}</version>
+        <configuration>
+          <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
+          <defaultLibBundleDir>libs/</defaultLibBundleDir>
+          <skinnyModules>true</skinnyModules>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  ...
+</project>
++-----------------+
+
+ Your EAR will contain something like this:
+
++-----------------+
+ .
+ |-- META-INF
+ |   `-- application.xml
+ |-- libs
+ |   `-- shared-jar-1.0.0.jar
+ |-- war-1.0.0.war
+ |-- sar-1.0.0.sar
+ `-- rar-1.0.0.rar
++-----------------+
+
+ If you look inside the copies of <<<war-1.0.0.war>>>, <<<rar-1.0.0.ear>>>
+ and <<<sar-1.0.0.sar>>>, that are packaged within the EAR, you will see that
+ they no longer contain <<<WEB-INF/lib/shared-jar-1.0.0.jar>>>,
+ <<<shared-jar-1.0.0.jar>>> and <<<lib/shared-jar-1.0.0.jar>>> files respectively.
+
+ Also, if you inspect the <<<MANIFEST.MF>>> of WAR, SAR and HAR modules of EAR
+ you will notice that the <<<Class-Path>>> entry has been modified or added,
+ if it was missing, and now has a reference to <<<libs/shared-jar-1.0.0.jar>>>.
+
+ If archive representing EAR module has non standard location of libraries then
+ this location can be configured using <<<libDirectory>>> property.

Review comment:
       using the

##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License.  You may obtain a copy of the License at
+~~
+~~   http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied.  See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+  * {{{../modules.html#webModule}WAR}}
+
+  * {{{../modules.html#rarModule}RAR}}
+
+  * {{{../modules.html#wsrModule}WSR}}
+
+  * {{{../modules.html#sarModule}SAR}}
+
+  * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
+ in EAR and to keep them close to the names used in local repository
+ for a better readability.
+
++-----------------+
+<project>
+  ...
+  <dependencies>
+    <!-- This is the JAR we want to share -->
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>shared-jar</artifactId>
+      <version>1.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>war</artifactId>
+      <version>1.0.0</version>
+      <type>war</type>
+    </dependency>
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>rar</artifactId>
+      <version>1.0.0</version>
+      <type>rar</type>
+    </dependency>
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>sar</artifactId>
+      <version>1.0.0</version>
+      <type>sar</type>
+    </dependency>
+  </dependencies>
+  ...
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-ear-plugin</artifactId>
+        <version>${project.version}</version>
+        <configuration>
+          <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
+          <defaultLibBundleDir>libs/</defaultLibBundleDir>
+          <skinnyModules>true</skinnyModules>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  ...
+</project>
++-----------------+
+
+ Your EAR will contain something like this:
+
++-----------------+
+ .
+ |-- META-INF
+ |   `-- application.xml
+ |-- libs
+ |   `-- shared-jar-1.0.0.jar
+ |-- war-1.0.0.war
+ |-- sar-1.0.0.sar
+ `-- rar-1.0.0.rar
++-----------------+
+
+ If you look inside the copies of <<<war-1.0.0.war>>>, <<<rar-1.0.0.ear>>>
+ and <<<sar-1.0.0.sar>>>, that are packaged within the EAR, you will see that
+ they no longer contain <<<WEB-INF/lib/shared-jar-1.0.0.jar>>>,
+ <<<shared-jar-1.0.0.jar>>> and <<<lib/shared-jar-1.0.0.jar>>> files respectively.
+
+ Also, if you inspect the <<<MANIFEST.MF>>> of WAR, SAR and HAR modules of EAR
+ you will notice that the <<<Class-Path>>> entry has been modified or added,
+ if it was missing, and now has a reference to <<<libs/shared-jar-1.0.0.jar>>>.
+
+ If archive representing EAR module has non standard location of libraries then
+ this location can be configured using <<<libDirectory>>> property.
+
+ Here is example for SAR which contains libraries at the root of archive

Review comment:
       the archive. (Refer

##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License.  You may obtain a copy of the License at
+~~
+~~   http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied.  See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+  * {{{../modules.html#webModule}WAR}}
+
+  * {{{../modules.html#rarModule}RAR}}
+
+  * {{{../modules.html#wsrModule}WSR}}
+
+  * {{{../modules.html#sarModule}SAR}}
+
+  * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
+ in EAR and to keep them close to the names used in local repository
+ for a better readability.
+
++-----------------+
+<project>
+  ...
+  <dependencies>
+    <!-- This is the JAR we want to share -->
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>shared-jar</artifactId>
+      <version>1.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>war</artifactId>
+      <version>1.0.0</version>
+      <type>war</type>
+    </dependency>
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>rar</artifactId>
+      <version>1.0.0</version>
+      <type>rar</type>
+    </dependency>
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>sar</artifactId>
+      <version>1.0.0</version>
+      <type>sar</type>
+    </dependency>
+  </dependencies>
+  ...
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-ear-plugin</artifactId>
+        <version>${project.version}</version>
+        <configuration>
+          <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
+          <defaultLibBundleDir>libs/</defaultLibBundleDir>
+          <skinnyModules>true</skinnyModules>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  ...
+</project>
++-----------------+
+
+ Your EAR will contain something like this:
+
++-----------------+
+ .
+ |-- META-INF
+ |   `-- application.xml
+ |-- libs
+ |   `-- shared-jar-1.0.0.jar
+ |-- war-1.0.0.war
+ |-- sar-1.0.0.sar
+ `-- rar-1.0.0.rar
++-----------------+
+
+ If you look inside the copies of <<<war-1.0.0.war>>>, <<<rar-1.0.0.ear>>>

Review comment:
       This is good. In general, stick to third person or second if necessary. That is, I suggest rewriting the "We" in these docs as "You". 

##########
File path: src/site/apt/index.apt.vm
##########
@@ -63,13 +63,18 @@ ${project.name}
   For more information about the Java EE technology, please visit
   {{http://www.oracle.com/us/technologies/java/enterprise-edition/overview/index.html}}.
 
+* Version 3.1.1
+
+  Starting with version 3.1.1 {{{./ear-mojo.html#skinnyModules}skinnyModules}} parameter

Review comment:
       Delete "Starting with version 3.1.1" as it's redundant with the header. 

##########
File path: src/site/apt/examples/skinny-modules.apt.vm
##########
@@ -0,0 +1,191 @@
+ ------
+ Creating Skinny Modules
+ ------
+ Marat Abrarov
+ ------
+ 2020-10-18
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License.  You may obtain a copy of the License at
+~~
+~~   http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied.  See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Creating Skinny Modules
+
+ This is a bit like {{{./skinny-wars.html}skinny WARs}}, but taken to the
+ next level and applied to EAR modules of type:
+
+  * {{{../modules.html#webModule}WAR}}
+
+  * {{{../modules.html#rarModule}RAR}}
+
+  * {{{../modules.html#wsrModule}WSR}}
+
+  * {{{../modules.html#sarModule}SAR}}
+
+  * {{{../modules.html#harModule}HAR}}
+
+ Starting with version 3.1.1 Maven EAR Plugin supports referencing
+ external JARs packaged within the EAR via the <<<Class-Path>>> setting
+ in EAR module <<<MANIFEST.MF>>>.
+
+ We need to change the EAR project's <<<pom.xml>>> to package those JARs
+ in the EAR and to use the
+ {{{../ear-mojo.html#skinnyModules}skinnyModules}} parameter.
+
+ <<Note:>> In this example we package all JARs into a <<<libs/>>> directory
+ within the EAR. This is just to distinguish between Java EE modules
+ (which will be packaged in the root of the EAR) and Java libraries
+ (which are packaged in <<<libs/>>>). Also, we use non standard
+ <<<outputFileNameMapping>>> just to shorten names of files packaged
+ in EAR and to keep them close to the names used in local repository
+ for a better readability.
+
++-----------------+
+<project>
+  ...
+  <dependencies>
+    <!-- This is the JAR we want to share -->
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>shared-jar</artifactId>
+      <version>1.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>war</artifactId>
+      <version>1.0.0</version>
+      <type>war</type>
+    </dependency>
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>rar</artifactId>
+      <version>1.0.0</version>
+      <type>rar</type>
+    </dependency>
+    <dependency>
+      <groupId>com.acme</groupId>
+      <artifactId>sar</artifactId>
+      <version>1.0.0</version>
+      <type>sar</type>
+    </dependency>
+  </dependencies>
+  ...
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-ear-plugin</artifactId>
+        <version>${project.version}</version>
+        <configuration>
+          <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
+          <defaultLibBundleDir>libs/</defaultLibBundleDir>
+          <skinnyModules>true</skinnyModules>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  ...
+</project>
++-----------------+
+
+ Your EAR will contain something like this:
+
++-----------------+
+ .
+ |-- META-INF
+ |   `-- application.xml
+ |-- libs
+ |   `-- shared-jar-1.0.0.jar
+ |-- war-1.0.0.war
+ |-- sar-1.0.0.sar
+ `-- rar-1.0.0.rar
++-----------------+
+
+ If you look inside the copies of <<<war-1.0.0.war>>>, <<<rar-1.0.0.ear>>>
+ and <<<sar-1.0.0.sar>>>, that are packaged within the EAR, you will see that
+ they no longer contain <<<WEB-INF/lib/shared-jar-1.0.0.jar>>>,
+ <<<shared-jar-1.0.0.jar>>> and <<<lib/shared-jar-1.0.0.jar>>> files respectively.
+
+ Also, if you inspect the <<<MANIFEST.MF>>> of WAR, SAR and HAR modules of EAR
+ you will notice that the <<<Class-Path>>> entry has been modified or added,
+ if it was missing, and now has a reference to <<<libs/shared-jar-1.0.0.jar>>>.
+
+ If archive representing EAR module has non standard location of libraries then

Review comment:
       an archive representing the EAR module has a non-standard location of libraries, then




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org