[ 
http://jira.codehaus.org/browse/MASSEMBLY-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=133550#action_133550
 ] 

Stephane Gamble commented on MASSEMBLY-324:
-------------------------------------------

Hi,

I was experiencing the same issue.

One of my project's dependencies had its scope set to "provided" in the pom 
file but was taken by the assembly despite the runtime scope parameter. I 
changed the output name mapping so that the scope would be part of the 
dependency file name and it turned out to be considered as a "compile" 
dependency.

In fact it was just brought as a transitive dependency with a compile scope by 
another direct dependency.
The funny thing is that when I ran the dependency:tree task, I found out that 
this artifact appeared only once in the dependency tree, with the following 
information :
+- groupId:artifactId:jar:version:provided (scope not updated to compile)
It was not mentionned as part of the dependencies of the artifact bringing it 
with the compile scope.

I am not too sure about this "scope not updated to compile" thing.
The phenomena is the same with 2.2-beta-1 but not with 2.1. With 2.1, this 
dependency was actually considered provided and therefore skipped in the 
assembly. Maybe you were used to 2.1's behaviour ? The backward compatibility 
may be missing on this specific point ?

You may have done this check already, but make sure there is not another 
dependency messing up with a compile or runtime scope. Check the dependencies 
scope directly in the pom files of your local repository as the dependency:tree 
task may not be 100% reliable for the witch hunt.

In my case, the provided dependencies are correctly excluded with the 
<scope>runtime</scope> parameter (using assembly:2.2-beta-2, maven-2.0.8 & 
Windows XP).

Good luck !

> DependencySet scope runtime includes jars that are scope provided
> -----------------------------------------------------------------
>
>                 Key: MASSEMBLY-324
>                 URL: http://jira.codehaus.org/browse/MASSEMBLY-324
>             Project: Maven 2.x Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2-beta-2
>            Reporter: Michael Mattox
>
> I use some jars in provided scope:
>               <dependency>
>                       <groupId>javax.servlet</groupId>
>                       <artifactId>servlet-api</artifactId>
>                       <version>2.5</version>
>                       <scope>provided</scope>
>               </dependency>
> in my assembly, I specify scope as runtime:
>               <dependencySet>
>                       <outputDirectory>WEB-INF/lib</outputDirectory>
>                       <unpack>false</unpack>
>                       <scope>runtime</scope>
>               </dependencySet>
> Yet I still find the servlet-api-2.5.jar in my WAR.  SInce the servlet-api is 
> scope provided, it should be provided by the container and not included in 
> the WAR.

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