You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Mattox (JIRA)" <ji...@codehaus.org> on 2008/04/30 15:03:48 UTC

[jira] Created: (MASSEMBLY-324) DependencySet scope runtime includes jars that are scope provided

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

        

[jira] Commented: (MASSEMBLY-324) DependencySet scope runtime includes jars that are scope provided

Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MASSEMBLY-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=277581#comment-277581 ] 

John Casey commented on MASSEMBLY-324:
--------------------------------------

Does anyone know if this is still happening in maven-assembly-plugin version 2.2.1?

> DependencySet scope runtime includes jars that are scope provided
> -----------------------------------------------------------------
>
>                 Key: MASSEMBLY-324
>                 URL: https://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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MASSEMBLY-324) DependencySet scope runtime includes jars that are scope provided

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MASSEMBLY-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg updated MASSEMBLY-324:
--------------------------------------

    Description: 
I use some jars in provided scope:
{code:xml}
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>
{code}
in my assembly, I specify scope as runtime:
{code:xml}
		<dependencySet>
			<outputDirectory>WEB-INF/lib</outputDirectory>
			<unpack>false</unpack>
			<scope>runtime</scope>
		</dependencySet>
{code}
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.



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




> DependencySet scope runtime includes jars that are scope provided
> -----------------------------------------------------------------
>
>                 Key: MASSEMBLY-324
>                 URL: https://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:
> {code:xml}
> 		<dependency>
> 			<groupId>javax.servlet</groupId>
> 			<artifactId>servlet-api</artifactId>
> 			<version>2.5</version>
> 			<scope>provided</scope>
> 		</dependency>
> {code}
> in my assembly, I specify scope as runtime:
> {code:xml}
> 		<dependencySet>
> 			<outputDirectory>WEB-INF/lib</outputDirectory>
> 			<unpack>false</unpack>
> 			<scope>runtime</scope>
> 		</dependencySet>
> {code}
> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MASSEMBLY-324) DependencySet scope runtime includes jars that are scope provided

Posted by "Dennis Homann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MASSEMBLY-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182981#action_182981 ] 

Dennis Homann commented on MASSEMBLY-324:
-----------------------------------------

I have the same issue with 2.2-beta-3 and 2.2-beta-4.

In my case, I am running the assembly plug-in on project A which has a compile dependency on project B. B has a compile dependency on project C. I do not want C to show up in my assembly, so I have added dependency C with scope "provided" in A's pom. (exactly the same as described with javax.servlet:servlet-api above). The assembly descriptor looks like the one in the description of this issue.

maven-dependency-plugin 2.0 shows the C resolved to "provided" as expected (the -X debug output gives a more detailed description of what's going on, and the behavior is correct).

When I run assembly:single as part of my build, the -X debug output states correctly, that C should not be included:

{noformat}
[DEBUG] Statistics for Scope filter [null-scope=true, compile=true, runtime=true, test=false, provided=false, system=false]

[DEBUG] The following scope filters were not used:
o System
[DEBUG] The following artifacts were removed by this filter:
 ....<C is listed here>....
{noformat}

Then, further down, the output shows that C is being added to the artifact.

> 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

        

[jira] Commented: (MASSEMBLY-324) DependencySet scope runtime includes jars that are scope provided

Posted by "Stephane Gamble (JIRA)" <ji...@codehaus.org>.
    [ 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

        

[jira] Commented: (MASSEMBLY-324) DependencySet scope runtime includes jars that are scope provided

Posted by "Tuomas Kiviaho (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MASSEMBLY-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=252327#action_252327 ] 

Tuomas Kiviaho commented on MASSEMBLY-324:
------------------------------------------

I propose adding of an excludeScope element to dependencySet (with similar behavior as in maven-dependency-plugin:copy-dependencies)

> 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

        

[jira] (MASSEMBLY-324) DependencySet scope runtime includes jars that are scope provided

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MASSEMBLY-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg updated MASSEMBLY-324:
--------------------------------------

    Component/s: dependencySet
    
> DependencySet scope runtime includes jars that are scope provided
> -----------------------------------------------------------------
>
>                 Key: MASSEMBLY-324
>                 URL: https://jira.codehaus.org/browse/MASSEMBLY-324
>             Project: Maven 2.x Assembly Plugin
>          Issue Type: Bug
>          Components: dependencySet
>    Affects Versions: 2.2-beta-2
>            Reporter: Michael Mattox
>
> I use some jars in provided scope:
> {code:xml}
> 		<dependency>
> 			<groupId>javax.servlet</groupId>
> 			<artifactId>servlet-api</artifactId>
> 			<version>2.5</version>
> 			<scope>provided</scope>
> 		</dependency>
> {code}
> in my assembly, I specify scope as runtime:
> {code:xml}
> 		<dependencySet>
> 			<outputDirectory>WEB-INF/lib</outputDirectory>
> 			<unpack>false</unpack>
> 			<scope>runtime</scope>
> 		</dependencySet>
> {code}
> 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, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira