[ 
http://jira.codehaus.org/browse/MNG-4770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=232321#action_232321
 ] 

Ove Gram Nipen commented on MNG-4770:
-------------------------------------

I believe that wsdl dependencies should be listed as a true dependency in 
maven, because of the documentation value it provides. You should be able to do 
{{mvn dependency:list}} and see that this project does indeed depend upon a web 
service. 

I understand your rationale for saying that maven should not know that wsdls 
are inherently different from jar dependencies, but there is no way of telling 
maven that right now. There is a dependency exclusion mechanism now, but it's 
not practical when you want to exclude *all* transitive dependencies, since you 
have to specify each and every artifact you want to exclude. 

It is probably very hard to change the way Maven WAR Plugin handles optional 
dependencies, since it has behaved that way for some time, and people depend on 
this behavior. One example is the skinny wars pattern. 

I know that there is a way of telling (the next version of) CXF Codegen Plugin 
to fetch wsdls from the repository, but this breaks my number one priority, 
which is that it should be possible to see that a project depends on a web 
service by doing {{mvn dependency:list}}. 

I propose to introduce a new parameter to the <dependency> block that excludes 
transitive dependencies altogether. For instance: 

{code}
<project>
        <groupId>org.something</groupId>
        <artifactId>HelloConsumer</artifactId>
        <packaging>war</packaging>

        <dependencies>
                <dependency>
                        <groupId>com.example</groupId>
                        <artifactId>HelloService</artifactId>
                        <version>1.0</version>
                        <type>wsdl</type>

                        <exclusions>*</exclusions>

                        or perhaps:

                        <transitive>false</transitive>

                        or even:

                        
<excludeTransitiveDependencies>true</excludeTransitiveDependencies>

                </dependency>

        ...
</project>
{code}

If this solution were to be implemented, maven itself does not have to know 
anything about wsdls (or other technologies with similar behavior which may 
turn up).

Please reopen, so we can discuss an appropriate solution.

> WSDL dependencies should not be transitive
> ------------------------------------------
>
>                 Key: MNG-4770
>                 URL: http://jira.codehaus.org/browse/MNG-4770
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.2.x (to be reviewed)
>            Reporter: Ove Gram Nipen
>            Assignee: Benjamin Bentmann
>
> Some web service frameworks, such as CXF, lets you deploy wsdl artifacts in 
> the maven repository. When another project (the client) depends on a wsdl 
> artifact, the client should not receive the dependencies of the web service 
> project transitively, since the web service is isolated. 
> It is not possible to work around the problem by declaring the dependencies 
> of the web service project as optional, since this leads to missing jar files 
> in the web service's {{WEB-INF/lib}}. 
> More specifically: 
> Say you have a service called {{HelloService}}, defined in its own pom: 
> {code}
> <project>
>       <groupId>com.example</groupId>
>       <artifactId>HelloService</artifactId>
>       <version>1.0</version>
>       <packaging>war</packaging>
>       <dependencies>
>               <dependency>
>                       <dependency>
>                       <groupId>org.springframework</groupId>
>                       <artifactId>spring-core</artifactId>
>                       <version>2.5.6</version>
>               </dependency>
>       ...
> </project>
> {code}
> {{HelloService}} uses the {{cxf-java2ws-plugin}}, which generates a wsdl file 
> and installs it in the maven repository during {{mvn install}}. 
> You then have a client project called {{HelloConsumer}}, defined in its own 
> pom: 
> {code}
> <project>
>       <groupId>org.something</groupId>
>       <artifactId>HelloConsumer</artifactId>
>       <packaging>war</packaging>
>       <dependencies>
>               <dependency>
>                       <groupId>com.example</groupId>
>                       <artifactId>HelloService</artifactId>
>                       <version>1.0</version>
>                       <type>wsdl</type>
>               </dependency>
>       ...
> </project>
> {code}
> {{HelloConsumer}} would then use the {{maven-dependency-plugin}} together 
> with the {{cxf-codegen-plugin}} to copy the wsdl locally and generate the 
> necessary web service stubs. 
> If you then do {{mvn dependency:tree}} on {{HelloConsumer}}, you would expect 
> to see only {{HelloService}}, not spring, because {{HelloService}} and 
> {{HelloConsumer}} are isolated from each other by the web service transport 
> layer, most often http. *However, maven currently includes spring 
> transitively*, which is wrong.

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