[ 
http://jira.codehaus.org/browse/MDEP-112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_107826
 ] 

Alan Mehio commented on MDEP-112:
---------------------------------

Brian,
Idealy maven dependency should not copy the servlet-api since the container 
provide it 
maven is copying the one which struts depends on please see the pom below
The one which get copied into my web application lib directory is a subset of 
the one which is supplied by the container
Manen dependency plugin should look at the jar content and prevent duplication 
of the same classes 




<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
        <modelVersion>4.0.0</modelVersion>
        <parent>
                <groupId>mygroupId</groupId>
                <artifactId>mygroupId-parent</artifactId>
                <version>1</version>
        </parent>
        <groupId>mygroupId</groupId>
        <artifactId>groupmarketrisk</artifactId>
        <version>1.0.0</version>
        <name>mygroup</name>
        <url>http://maven.apache.org</url>
        <packaging>pom</packaging>
        <modules>
               <module>common</module>
                <module>model</module>
                <module>dao</module>
                <module>service</module>
                <module>web</module>
        </modules>
        <dependencies>
                
                <dependency>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                        <version>1.0.4</version>
                </dependency>
                <dependency>
                        <groupId>commons-lang</groupId>
                        <artifactId>commons-lang</artifactId>
                        <version>2.0</version>
                </dependency>
                <dependency>
                        <groupId>commons-beanutils</groupId>
                        <artifactId>commons-beanutils</artifactId>
                        <version>1.6</version>
                </dependency>
                <dependency>
                        <groupId>org.hibernate</groupId>
                        <artifactId>hibernate</artifactId>
                        <version>3.0.3</version>
                </dependency>
                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring</artifactId>
                        <version>1.2</version>
                </dependency>
                  
                 <!--  this one does not get copied which is fine 
                                             this contains more implementation 
classes for the container 
                                              -->
                <dependency>
                        <groupId>tomcat</groupId>
                        <artifactId>servlet-api</artifactId>
                        <version>5.0.18</version>
                        <scope>provided</scope>
                </dependency>
                
                <!--
                this one get copied to the webaplication lib directory since 
struts-1.2.4.jar depends on it 
                                         this is a subset of the above with the 
same manifest file i.e. same spec version 
                -->
                <!--
                <dependency>
                        <groupId>javax.servlet</groupId>
                        <artifactId>servlet-api</artifactId>
                        <version>2.2</version>
                        
                </dependency>
                -->
                <dependency>
                        <groupId>struts</groupId>
                        <artifactId>struts</artifactId>
                        <version>1.2.4</version>
                </dependency>
                <dependency>
                        <groupId>dbunit</groupId>
                        <artifactId>dbunit</artifactId>
                        <version>2.1</version>
                        <scope>test</scope>
                </dependency>
        </dependencies>

        <build>
                <plugins>
                        <plugin>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <configuration>
                                        <source>1.5</source>
                                        <target>1.5</target>
                                </configuration>
                        </plugin>
                </plugins>
        </build>


</project>

Regards,
Alan Mehio
London, UK



> Container dependency jar file get copied during the deployment or during hte 
> installation1
> ------------------------------------------------------------------------------------------
>
>                 Key: MDEP-112
>                 URL: http://jira.codehaus.org/browse/MDEP-112
>             Project: Maven 2.x Dependency Plugin
>          Issue Type: Bug
>          Components: copy-dependencies
>    Affects Versions: 2.0
>         Environment: WindowXP(CYGWIN)     JDK 1.5.0_07
>            Reporter: Alan Mehio
>            Assignee: Brian Fox
>            Priority: Trivial
>
> The dependency get copied even it is provided by the container 
> This happens in the following scenario :
> module A has dependecies as below 
> <dependencies>
>               <dependency>
>                       <groupId>axis</groupId>
>                       <artifactId>axis-schema</artifactId>
>                       <version>1.3</version>
>               </dependency>
>               <dependency>
>                       <groupId>axis</groupId>
>                       <artifactId>axis-wsdl4j</artifactId>
>                       <version>1.3</version>
>               </dependency>
>               <dependency>
>                       <groupId>xml-apis</groupId>
>                       <artifactId>xml-apis</artifactId>
>                       <version>1.0.b2</version>
>               </dependency>
>               <dependency>
>                       <groupId>javax.xml</groupId>
>                       <artifactId>jaxrpc-api</artifactId>
>                       <version>1.1</version>
>               </dependency>
>               <dependency>
>                       <groupId>commons-discovery</groupId>
>                       <artifactId>commons-discovery</artifactId>
>                       <version>0.2</version>
>               </dependency>
>               <dependency>
>                       <groupId>axis</groupId>
>                       <artifactId>axis-saaj</artifactId>
>                       <version>1.2</version>
>               </dependency>
>       </dependencies>
> you have module B which has the below  dependencies
> <dependencies>
>               <dependency>
>                       <groupId>mygroup</groupId>
>                       <artifactId>common</artifactId>
>                       <version>1.0.0</version>
>               </dependency>
>               <dependency>
>                       <groupId>mygroup</groupId>
>                       <artifactId>service</artifactId>
>                       <version>1.0.0</version>
>               </dependency>
>               <dependency>
>                       <groupId>mygroup</groupId>
>                       <artifactId>model</artifactId>
>                       <version>1.0.0</version>
>               </dependency>
>               <dependency>
>                       <groupId>tomcat</groupId>
>                       <artifactId>servlet-api</artifactId>
>                       <version>5.0.18</version>
>                       <scope>provided</scope>
>               </dependency>
>       </dependencies>
> The one which get copied is servlet-api-2.3.jar 
> On the otherhand, the other project is using the same dependency ( 
> servlet-api ) but the only difference is the axis artifact and its 
> dependencies are not included
> Regards,
> Alan Mehio
> London, UK

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

        

Reply via email to