You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Camel Maven Plugin

The Camel Maven Plugin is used to run Camel Spring configurations inside Maven for easy testing. A good example application to get you started is the Spring Example.

cd examples/camel-example-spring
mvn camel:run

How this works is that the plugin will compile the source code in the maven project, then boot up a Spring ApplicationContext using the XMl confiuration files on the classpath at

META-INF/spring/*.xml

This allows you to boot up any Spring services you wish; whether they are Camel related or any other Spring POJOs.

Visualiation

Camel supports Visualisation to be able to turn your Enterprise Integration Patterns into a nice graphical represenation.

If you run the camel:doc plugin it will boot up your CamelContext just like the camel:run plugin but it will only keep up for a few seconds. During that time
it will generate a DOT file generated in target/site/cameldoc. Then this DOT file will be converted nicely into a HTML report.

mvn camel:doc

Your generated PNG/SVG files will then be in the target/site/cameldoc directory.

Integration into Maven Reports

If you add the camel-maven-plugin to your <reporting> section of your pom you will automatically get the Visualisation reporting generated for your project.

For example add the following into your pom

<project>
  ...
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>  
</project>

Then when you run

mvn site

Your context will be booted up via the META-INF/spring/*.xml files, the DOT file generated and a nice HTML report created.

  • No labels