There's also a more in depth screencast if you prefer to watch that first.
So if you have installed Maven, type the following:
mvn org.apache.maven.plugins:maven-archetype-plugin:2.2:generate -Dfilter=io.fabric8:
This will list all the various archetypes. Pick one that suits your fancy, e.g. io.fabric8.archetypes:cbr-archetype for the Camel Content Based Router Quickstart.
Then enter these values:
groupId: cool artifactId: mydemo version: 1.0.0.SNAPSHOT package: cool
And confirm with 'Y'.
Now type this in your shell:
cd mydemo mvn fabric8:deploy
Or just click on this link to the my-cbr profile to go staight to the profile page.
Now create a new container for this profile; by clicking the New button on the top right of the profile page. Enter a container name and hit Create and start container
Your new container should now be running; you should be able to connect into the new JVM and see the camel route diagram with real time metrics etc.
Now if you want to be able to change the code in an IDE and have it updated in fabric8, just run the following command in the fabric8 shell:
Fabric8:[email protected]> fabric:watch *
This is like the Karaf command:
Fabric8:[email protected]> dev:watch *
which has been around for a long time and is quite awesome at watching a single container and detect snapshot builds of its bundles being rebuilt.
The fabric:watch version is even more awesome than dev:watch; it will watch the local maven repository for all bundles which are snapshots which are provisioned in any profile in any container in the fabric (whatever machine they are running on, including remote machines, OpenShift/Docker/EC2 etc). If a local maven build is done on your machine, it’ll detect that, upload the new artefacts into fabric8’s maven repository and update any container running that profile in your fabric.
e.g. so just edit any code (e.g. the camel XML file) in your IDE; then just type:
Or or setup your IDE to run the "mvn install” goal whenever you save/compile the project.
Now every time you save in your IDE or do a maven build, fabric8 auto-updates all containers running that profile and you can see the effects of the update in real time via hawtio web console. Pretty neat!