You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "John Tolentino (JIRA)" <ji...@codehaus.org> on 2006/03/24 09:48:12 UTC

[jira] Commented: (MWAR-21) Need a way to include limited set of webapp's dependencies

    [ http://jira.codehaus.org/browse/MWAR-21?page=comments#action_61851 ] 

John Tolentino commented on MWAR-21:
------------------------------------

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


> Need a way to include limited set of webapp's dependencies
> ----------------------------------------------------------
>
>          Key: MWAR-21
>          URL: http://jira.codehaus.org/browse/MWAR-21
>      Project: Maven 2.x War Plugin
>         Type: Improvement

>  Environment: M2.0.1
>     Reporter: Dirk Olmes
>     Assignee: John Tolentino
>     Priority: Blocker
>      Fix For: 2.0
>  Attachments: AbstractWarMojo.diff
>
>
> I need a way to pack a war that includes only a limited set of the webapp's dependencies. We're deploying in mainly two different environments: for testing, the webapp runs standalone and thus needs to include all its dependencies in the war. For production we deploy the webapp into a JBoss server that has all the dependencies already installed.
> I've modified AbstractWarMojo in the following way: 1) allow to specify dependencyIncludes an dependencyExcludes (as lists) 2) upon building the war, each dependency is checked against the excludes and the includes and will be added to the war accordingly.
> While this patch may not be the best way to to it, it clearly shows my requirements.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira