You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2022/04/25 17:09:20 UTC

[maven-war-plugin] 01/01: [MWAR-452] One page about Skinny WARs

This is an automated email from the ASF dual-hosted git repository.

sjaranowski pushed a commit to branch MWAR-452
in repository https://gitbox.apache.org/repos/asf/maven-war-plugin.git

commit f61dd01b5039240a517a23fc8f1e99ebd232b4fa
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Mon Apr 25 19:08:33 2022 +0200

    [MWAR-452] One page about Skinny WARs
---
 src/site/apt/examples/skinny-wars.apt.vm | 112 -------------------------------
 src/site/apt/index.apt.vm                |   2 +-
 src/site/site.xml                        |   2 +-
 3 files changed, 2 insertions(+), 114 deletions(-)

diff --git a/src/site/apt/examples/skinny-wars.apt.vm b/src/site/apt/examples/skinny-wars.apt.vm
deleted file mode 100644
index f530dbd..0000000
--- a/src/site/apt/examples/skinny-wars.apt.vm
+++ /dev/null
@@ -1,112 +0,0 @@
- ------
- Creating Skinny WARs
- ------
- Mike Perham
- Karl-Heinz Marbaise
- ------
- 2014-10-01
- ------
-
-~~ 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 WARs
-
- In a typical J2EE environment, a WAR is packaged within an EAR for deployment.  The
- WAR can contain all its dependent JARs in <<<WEB-INF/lib>>> but then the EAR can quickly grow
- very large if there are multiple WARs, due to the presence of duplicate JARs.  Instead
- the J2EE specification allows WARs to reference external JARs packaged within the EAR
- via the <<<Class-Path>>> setting in their <<<MANIFEST.MF>>>.
-
- The Maven EAR Plugin has direct support for creating skinny wars which simply
- means to {{{http://maven.apache.org/plugins/maven-ear-plugin/examples/skinny-wars.html}configure the maven-ear-plugin}}
- accordingly.
-
- You need to change the EAR project's <<<pom.xml>>> to package those dependent JARs in the EAR.
- Notice that we package everything into a <<<lib/>>> directory within the EAR.  This is
- just my own personal preference to distinguish between J2EE modules (which will
- be packaged in the root of the EAR) and Java libraries (which are packaged in <<<lib/>>>).
-
-+-----------------+
-<project>
-  ...
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-ear-plugin</artifactId>
-        <version>2.9.1</version>
-        <configuration>
-          <defaultLibBundleDir>lib/</defaultLibBundleDir>
-          <skinnyWars>true</skinnyWars>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  ...
-</project>
-+-----------------+
-
- Now the painful part.  Your EAR project's <<<pom.xml>>> needs to list every dependency that the WAR has.
- This is because Maven assumes fat WARs and does not include transitive dependencies
- of WARs within the EAR.
-
-+-----------------+
-<project>
-  ....
-  <dependencies>
-    <dependency>
-      <groupId>com.acme</groupId>
-      <artifactId>shared-jar</artifactId>
-      <version>1.0.0</version>
-    </dependency>
-    <dependency>
-      <groupId>com.acme</groupId>
-      <artifactId>war1</artifactId>
-      <version>1.0.0</version>
-      <type>war</type>
-    </dependency>
-    <dependency>
-      <groupId>com.acme</groupId>
-      <artifactId>war2</artifactId>
-      <version>1.0.0</version>
-      <type>war</type>
-    </dependency>
-  </dependencies>
-  ...
-</project>
-+-----------------+
-
- Your EAR will contain something like this:
-
------------------
- .
- |-- META-INF
- |   `-- application.xml
- |-- lib
- |   `-- shared-jar-1.0.0.jar
- |-- war1-1.0.0.war
- `-- war2-1.0.0.war
------------------
-
-
-* Alternatives
-
- Our users have submitted alternatives to the above recipe on
- {{{http://docs.codehaus.org/display/MAVENUSER/Solving+the+Skinny+Wars+problem}the Wiki}}.
diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm
index edcc5c5..466bacc 100644
--- a/src/site/apt/index.apt.vm
+++ b/src/site/apt/index.apt.vm
@@ -83,7 +83,7 @@ ${project.name}
 
  * {{{./examples/rapid-testing-jetty6-plugin.html}Rapid Testing the Jetty Plugin}}
 
- * {{{./examples/skinny-wars.html}Creating Skinny WARs}}
+ * {{{https://maven.apache.org/plugins/maven-ear-plugin/examples/skinny-wars.html}Creating Skinny WARs}}
 
  * {{{./examples/including-excluding-files-from-war.html}Including and Excluding Files From the WAR}}
 
diff --git a/src/site/site.xml b/src/site/site.xml
index 2f81f26..98febf3 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -40,7 +40,7 @@ under the License.
       <item name="Adding and Filtering External Web Resources" href="examples/adding-filtering-webresources.html"/>
       <item name="WAR Manifest Customization" href="examples/war-manifest-guide.html"/>
       <item name="Rapid Testing Using the Jetty Plugin" href="examples/rapid-testing-jetty6-plugin.html"/>
-      <item name="Creating Skinny WARs" href="examples/skinny-wars.html"/>
+      <item name="Creating Skinny WARs" href="https://maven.apache.org/plugins/maven-ear-plugin/examples/skinny-wars.html"/>
       <item name="Including and Excluding Files From the WAR" href="examples/including-excluding-files-from-war.html"/>
       <item name="Using File Name Mapping" href="examples/file-name-mapping.html"/>
     </menu>