camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pablo Gra\\~na (JIRA)" <>
Subject [jira] Created: (CAMEL-3533) classpath problem with camel:dot and provided dependencies
Date Wed, 12 Jan 2011 12:27:45 GMT
classpath problem with camel:dot and provided dependencies

                 Key: CAMEL-3533
             Project: Camel
          Issue Type: Improvement
          Components: tooling
    Affects Versions: 2.5.0
         Environment: Running on linux, jdk 1.6. Looks irrelevant.
            Reporter: Pablo Gra\~na
         Attachments: depends_on_test_classpath.txt

camel:dot in is failing with a class not found exception when the application context instantiates
a class in a jar with provided scope.

If in your maven project you have:


and in your application context there is, for example, a subclass of ServletContextListener,
mvn camel:dot fails with:

Caused by: java.lang.ClassNotFoundException:
       at Method)
       at java.lang.ClassLoader.loadClass(
       at java.lang.ClassLoader.loadClass(
       ... 92 more

If you change it to:


then camel-maven-plugin correctly generates the output. The fact is
that the servlet-api jar must not be included in the final war.

I don't know the correct way to fix this. One option would be to add the includePluginDependencies
option in the plugin and add the provided jars as runtime dependencies of the plugin.

The other, very easy to implement, option would be to change the requiresDependencyResolution
from runtime to test.

The third option would be to make the requiresDependencyResolution configurable.

Attached is a patch for the 2nd option (lazy me).

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message