Guice Maven Plugin
The Guice Maven Plugin allows you to run your Enterprise Integration Patterns using Guice for Dependency Injection inside Maven along with being able to support Visualisation along with integration of the Visualisation diagrams into the standard maven reports for your project.
| Documentation || Reference || Description |
| guice:run || guice:run || Boots up Camel in a new JVM using the Guice configuration in the jndi.properties file on the classpath and runs your routing rules |
| guice:embedded || guice:embedded || Boots up Camel in the same JVM as Maven using the Guice configuration at jndi.properties on the classpath and runs your routing rules |
| guice:dot || guice:dot || Generates DOT files and then HTML, PNG, SVG files for your EIP routing rules with integration into Maven Reports |
Adding the plugin to your pom.xml
Add the following in your <build><plugins> section
You can also specify what Main class to use when running the plugin. By default this is org.apache.camel.guice.Main.
The plugin will construct a classpath of any Maven dependency with scope "compile". The classpath is output as an INFO log statement upon startup.
Information about the generated routes is available through the GraphViz report, and also through the log statements generated by the run goal. If you would like to see this information then add a log4j (or other commons-logging implementation) config file with the following levels.
log4j.appender.stdout.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
This should produce a log statement similar to:
670 [org.apache.camel.guice.Main.main()] DEBUG org.apache.camel.impl.DefaultCamelContext
- Adding routes from: Routes: [Route[ [From[jms:queue:queueA]] -> [To[jms:queue:queueB], To[jms:queue:queueC]]]] routes: 
Integration into Maven Reports
If you add the guice-maven-plugin to your <reporting> section of your pom you will automatically get the Visualisation reporting generated for your project as part of the regular maven site generation.
For example add the following into your pom
Then when you run
Your context will be booted up via the jndi.properties files, the DOT file generated and a nice HTML report created.
|GraphViz DOT required|
Note to get the nice HTML, PNG and SVG outputs from the DOT files you will need to install the GraphViz DOT executable and add it to your PATH so that the plugin can invoke DOT to generate the PNG/SVG files.
For more details see the guice:dot.