jira-importer commented on issue #190:
URL: 
https://github.com/apache/maven-war-plugin/issues/190#issuecomment-2967849145

   **[Ernesto S. Tolentino 
Jr.](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jtolentino)** 
commented
   
   DIRK OLMES:
   
   Usecase: Pack a war that includes only a limited set of the webapp's 
dependencies.
   
   Solution: Profiles
   
   Usecase: To run from the development machines, need ejb*-client, only. And 
for deployment on the production server, those dependencies have to be omitted.
   
   Solution: Still profiles. Create a "test" profile where the dependencies 
used only for the development machines (ejb*-client) are declared.
   
   Concern: Don't want to duplicate all the dependencies of our-ejb-facade in 
the webapp's pom.
   
   Answer: There will be no duplicates here because, like what Trygve said, you 
only need to declare the uncommon artifacts (in this case your ejb*-client 
dependencies).
   
   Related URL:
   
   - http://maven.apache.org/guides/introduction/introduction-to-profiles.html
   
   ---
   
   DAVID BODEN:
   
   Usecase: Packaging three .war files in a .ear. They share most of their 
dependencies. Same as "Developer packages multiple war files in an ear and 
wants to consolidate the dependencies onto the ear classpath."
   
   EAR-PROJECT (parent)
   * WAR1 (child-module)
   * WAR2 (child-module)
   * WAR3 (child-module)
   
   Need to include the dependencies as .jar files in the .ear and have them 
loaded in my container by the EJB ClassLoader.
   
   But don't want the .jar files packed into both of the .war files.
   
   Solution:
   
   PARENT-POM
   * EAR-PROJECT
   * PARENT-POM2
     * WAR1
     * WAR2
     * WAR3
   
   Declare common dependencies in WAR1, WAR2 and WAR3 in PARENT-POM2 with 
provided scope.
   
   Also declare these dependencies (without the provided scope) in the EAR 
project.
   
   Add WAR1, WAR2 and WAR3 to EAR-PROJECT's dependencies as well.
   
   Verified this setup works in a similar project. WAR1, WAR2 and WAR3 builds 
but their common dependencies are not included in the wars. EAR-PROJECT 
includes all the WARs and their dependencies in its packaging.
   
   ---
   
   EUGENE KULESHOV:
   
   Need: Dependency scope that is required for compilation but not in the 
runtime. Same As "Way to exclude certain dependencies from being packaged into 
war. Eg. servlet-api-2.4.jar is required for most of the sevlet or web 
framework but it should not be packaged into war because api is provided by 
container."
   
   Answer: Provided scope, As was mentioned by Grzegorz Slowikowski. Also 
verified this and war builds but does not add jars with provided scope.
   
   Related URLs:
   - 
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
   - http://maven.apache.org/ref/2.0.3-SNAPSHOT/maven-model/maven.html
   
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

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

Reply via email to