Done.

I had a look in the outstanding issues for tools and I think the
existing one you were refering to is different enough to this issue to
warrant a new one, as it affects a different mojo/goal.


----- Original message -----
From: "Claus Ibsen" <[EMAIL PROTECTED]>
To: camel-user@activemq.apache.org
Date: Wed, 17 Sep 2008 14:38:43 +0200
Subject: RE: [SPAM]  Re: Camel Maven Plugin looking in test-classes

Hi Martin

Please add a comment on the new ticket pointing to this topic via nabble
http://www.nabble.com/Camel-Maven-Plugin-looking-in-test-classes-td19530527s22882.html

This is quite important to remember so when someone steps up to fix it
he can see this conversation.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: Martin Gilday [mailto:[EMAIL PROTECTED] 
Sent: 17. september 2008 14:12
To: camel-user@activemq.apache.org
Subject: [SPAM] Re: Camel Maven Plugin looking in test-classes

I'd rather it didn't start changing the dependencies.  The Maven plugin
is very useful for getting a Camel app running as it would be in your
live environment, adjusting the dependencies would mean that is no
longer always true.  Although the Jetty plugin has a "useTestClasspath"
parameter. Is there actually a use case where you could want to define
Camel routes in src/test/java AND have them run using the Camel Maven
plugin?  I would think test routes would only be needed when you are
either running tests from your IDE or through Maven Surefire plugin.

----- Original message -----
From: "James Strachan" <[EMAIL PROTECTED]>
To: camel-user@activemq.apache.org
Date: Wed, 17 Sep 2008 13:04:36 +0100
Subject: Re: Camel Maven Plugin looking in test-classes

2008/9/17 Martin Gilday <[EMAIL PROTECTED]>:
> Hi Camel riders,
>
> We follow what I think is a fairly standard pattern where we name our
> test classes the same as the class under test with the suffix UnitTest
> or IntTest.  We place this in the same package name, but under
> src/test/java instead of src/main/java.
>
> I have a route scanner defined as so:
>
> <camel:camelContext>
>  <camel:package>example.routes</camel:package>
> </camel:camelContext>
>
> When I start up mvn camel:run I can see the following log lines:
>
> DEBUG org.apache.camel.util.ResolverUtil  - Loading from directory:
> C:\workspace\projectname\target\classes\example\routes
> DEBUG org.apache.camel.util.ResolverUtil  - Loading from directory:
> C:\workspace\projectname\target\test-classes\example\routes
>
> This causes a problem as it attempts to load a class in test-classes
> which has a super class of AbstractJUnit4SpringContextTests which in the
> Maven POM is defined with test depdendency scope.  Therefore you get a
> java.lang.NoClassDefFoundError.
>
> Why is Camel scanning test classes for routes?  Is there a way to
> prevent this other than changing the test package name?

Hmm - I guess you could just disable the logging messages so you don't
see it happening :)

Maybe we could change camel:run to also include the test dependencies?

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Reply via email to