If your test routes are bundled up into an artifact you can add them as a
dependency to the camel plugin. The plugin needs to be configured to use the
plugin classpath using the 'includePluginDependencies' configuration value.

The easiest way to do this is to add the test-jar goal to the project that
contains the test routes.

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

This will create an artifact with the '-tests' classifier which you can then
add to your camel plugin config as follows.

      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-maven-plugin</artifactId>
        <version>${camel.version}</version>
        <configuration>
            <includePluginDependencies>true</includePluginDependencies>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>${pom.groupId}</groupId>
            <artifactId>my-extra-routes</artifactId>
            <version>${pom.version}</version>
            <classifier>tests</classifier>
          </dependency>
        </dependencies>
      </plugin>

Give this a try, it should work well for you.

ste


On Thu, Dec 17, 2009 at 2:42 PM, mistrz <[email protected]> wrote:

>
> I have a use case where I want to use test classes--a parameter similar to
> Jetty's "useTestClasspath" would be useful.
>
> I have a core library that other projects will be using and I want that
> core
> library to be run with mvn camel:run for a sample route.  The sample route
> is defined under test because I don't want projects including my library to
> contain it.
>
>
>
>
> --
> View this message in context:
> http://old.nabble.com/Camel-Maven-Plugin-looking-in-test-classes-tp19530527p26836330.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>

Reply via email to