You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Ludwig Magnusson (JIRA)" <ji...@apache.org> on 2013/02/14 11:22:12 UTC

[jira] [Commented] (MTOMCAT-206) Runtime dependencies within multi module projects are not loaded.

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

Ludwig Magnusson commented on MTOMCAT-206:
------------------------------------------

I cant find a way to upload a patch in a file but here it is:

Index: src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
===================================================================
--- src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java	(revision 1446079)
+++ src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java	(working copy)
@@ -68,7 +68,7 @@
         {
             @SuppressWarnings ("unchecked") List<String> classPathElements = request.isUseTestClassPath()
                 ? request.getMavenProject().getTestClasspathElements()
-                : request.getMavenProject().getCompileClasspathElements();
+                : request.getMavenProject().getRuntimeClasspathElements();
             if ( classPathElements != null )
             {
                 for ( String classPathElement : classPathElements )

                
> Runtime dependencies within multi module projects are not loaded.
> -----------------------------------------------------------------
>
>                 Key: MTOMCAT-206
>                 URL: https://issues.apache.org/jira/browse/MTOMCAT-206
>             Project: Apache Tomcat Maven Plugin
>          Issue Type: Bug
>          Components: commons-lib
>    Affects Versions: 2.0
>            Reporter: Ludwig Magnusson
>            Assignee: Olivier Lamy (*$^¨%`£)
>
> I am not sure if this counts as a duplicate of MTOMCAT-46, there are some differences...
> Consider a multi module project in maven structured like this:
> - parent
>   - api
>   - implementation
>   - webapp
> The webapp has a compile scope dependency on the API and a runtime scope dependency on the implementation. The implementation classes are loaded with some dependency injection framework.
> If I run tomcat(7):run in the root project it will fail because the tomcat plugin does not add the implementation classes (i.e. the runtime dependency) to the classpath. If I change the dependency scope of the implementation dependency to compile, it works.
> The solution for this was pretty simple. Just change one method call in DefaultClassLoaderEntriesCalculator, viewable in the applied patch. All tests and IT-tests still pass.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org