[ 
https://issues.apache.org/jira/browse/CAMEL-11531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16089533#comment-16089533
 ] 

Harmen Renkema edited comment on CAMEL-11531 at 7/17/17 9:22 AM:
-----------------------------------------------------------------

Unless it's excluded in camel-servlet it will propagate to dependent projects. 

The results (dependency tree, war) of the following pom are displayed below. 
You'll see the servlet-api is included.

{noformat}
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd";>

        <modelVersion>4.0.0</modelVersion>

        <groupId>org.example</groupId>
        <artifactId>dependency-propagation</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <packaging>war</packaging>

        <dependencies>
                <dependency>
                        <groupId>org.apache.camel</groupId>
                        <artifactId>camel-servlet</artifactId>
                        <version>2.19.0</version>
                </dependency>
        </dependencies>

</project>
{noformat}


{noformat}
dependency-propagation$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building dependency-propagation 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ 
dependency-propagation ---
[INFO] org.example:dependency-propagation:war:0.0.1-SNAPSHOT
[INFO] \- org.apache.camel:camel-servlet:jar:2.19.0:compile
[INFO]    +- org.apache.camel:camel-core:jar:2.19.0:compile
[INFO]    |  \- org.slf4j:slf4j-api:jar:1.7.22:compile
[INFO]    +- org.apache.camel:camel-http-common:jar:2.19.0:compile
[INFO]    |  \- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO]    +- com.sun.xml.bind:jaxb-core:jar:2.2.11:compile
[INFO]    \- com.sun.xml.bind:jaxb-impl:jar:2.2.11:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.512 s
[INFO] Finished at: 2017-07-17T11:17:41+02:00
[INFO] Final Memory: 15M/304M
[INFO] ------------------------------------------------------------------------

{noformat}



{noformat}
dependency-propagation$ unzip -l 
target/dependency-propagation-0.0.1-SNAPSHOT.war 
Archive:  target/dependency-propagation-0.0.1-SNAPSHOT.war
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2017-07-17 11:20   META-INF/
      132  2017-07-17 11:20   META-INF/MANIFEST.MF
        0  2017-07-17 11:20   WEB-INF/
        0  2017-07-17 11:20   WEB-INF/classes/
        0  2017-07-17 11:20   WEB-INF/lib/
      301  2017-07-17 11:02   WEB-INF/web.xml
   252336  2017-07-05 14:19   WEB-INF/lib/jaxb-core-2.2.11.jar
  4749824  2017-07-05 14:19   WEB-INF/lib/camel-core-2.19.0.jar
    36407  2017-07-05 14:19   WEB-INF/lib/camel-servlet-2.19.0.jar
    66759  2017-07-05 14:19   WEB-INF/lib/camel-http-common-2.19.0.jar
  1047863  2017-07-05 14:19   WEB-INF/lib/jaxb-impl-2.2.11.jar
    41077  2017-07-17 10:57   WEB-INF/lib/slf4j-api-1.7.22.jar
    95806  2017-07-05 14:18   WEB-INF/lib/javax.servlet-api-3.1.0.jar
        0  2017-07-17 11:20   META-INF/maven/
        0  2017-07-17 11:20   META-INF/maven/org.example/
        0  2017-07-17 11:20   META-INF/maven/org.example/dependency-propagation/
      612  2017-07-17 11:04   
META-INF/maven/org.example/dependency-propagation/pom.xml
      128  2017-07-17 11:20   
META-INF/maven/org.example/dependency-propagation/pom.properties
---------                     -------
  6291245                     18 files
{noformat}



was (Author: harmen.renkema):
Unless it's excluded in camel-servlet it will propagate to dependent projects. 

The results (dependency tree, war) of the following pom are displayed below.

{noformat}
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd";>

        <modelVersion>4.0.0</modelVersion>

        <groupId>org.example</groupId>
        <artifactId>dependency-propagation</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <packaging>war</packaging>

        <dependencies>
                <dependency>
                        <groupId>org.apache.camel</groupId>
                        <artifactId>camel-servlet</artifactId>
                        <version>2.19.0</version>
                </dependency>
        </dependencies>

</project>
{noformat}


{noformat}
dependency-propagation$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building dependency-propagation 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ 
dependency-propagation ---
[INFO] org.example:dependency-propagation:war:0.0.1-SNAPSHOT
[INFO] \- org.apache.camel:camel-servlet:jar:2.19.0:compile
[INFO]    +- org.apache.camel:camel-core:jar:2.19.0:compile
[INFO]    |  \- org.slf4j:slf4j-api:jar:1.7.22:compile
[INFO]    +- org.apache.camel:camel-http-common:jar:2.19.0:compile
[INFO]    |  \- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO]    +- com.sun.xml.bind:jaxb-core:jar:2.2.11:compile
[INFO]    \- com.sun.xml.bind:jaxb-impl:jar:2.2.11:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.512 s
[INFO] Finished at: 2017-07-17T11:17:41+02:00
[INFO] Final Memory: 15M/304M
[INFO] ------------------------------------------------------------------------

{noformat}



{noformat}
dependency-propagation$ unzip -l 
target/dependency-propagation-0.0.1-SNAPSHOT.war 
Archive:  target/dependency-propagation-0.0.1-SNAPSHOT.war
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2017-07-17 11:20   META-INF/
      132  2017-07-17 11:20   META-INF/MANIFEST.MF
        0  2017-07-17 11:20   WEB-INF/
        0  2017-07-17 11:20   WEB-INF/classes/
        0  2017-07-17 11:20   WEB-INF/lib/
      301  2017-07-17 11:02   WEB-INF/web.xml
   252336  2017-07-05 14:19   WEB-INF/lib/jaxb-core-2.2.11.jar
  4749824  2017-07-05 14:19   WEB-INF/lib/camel-core-2.19.0.jar
    36407  2017-07-05 14:19   WEB-INF/lib/camel-servlet-2.19.0.jar
    66759  2017-07-05 14:19   WEB-INF/lib/camel-http-common-2.19.0.jar
  1047863  2017-07-05 14:19   WEB-INF/lib/jaxb-impl-2.2.11.jar
    41077  2017-07-17 10:57   WEB-INF/lib/slf4j-api-1.7.22.jar
    95806  2017-07-05 14:18   WEB-INF/lib/javax.servlet-api-3.1.0.jar
        0  2017-07-17 11:20   META-INF/maven/
        0  2017-07-17 11:20   META-INF/maven/org.example/
        0  2017-07-17 11:20   META-INF/maven/org.example/dependency-propagation/
      612  2017-07-17 11:04   
META-INF/maven/org.example/dependency-propagation/pom.xml
      128  2017-07-17 11:20   
META-INF/maven/org.example/dependency-propagation/pom.properties
---------                     -------
  6291245                     18 files
{noformat}


> camel-http-common; dependency servlet-api should be set to provided
> -------------------------------------------------------------------
>
>                 Key: CAMEL-11531
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11531
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-http-common, camel-servlet
>    Affects Versions: 2.19.0
>            Reporter: Harmen Renkema
>            Priority: Minor
>
> When using camel-servlet in WAR apps, the dependency on camel-http-common 
> brings in the servlet-api as a dependency with scope compile. The scope of 
> this dependency should be set to provided as it will be provided by the 
> container.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to