Apache ServiceMix Development Environment Setup
Join the DZone community and get the full member experience.
Join For FreeHere is a quick guide to setting up a development environment for working on Apache Servicemix projects... You can update some of these versions mentioned in the rundown, as it was written a little while ago.
Java 1.6
Monitoring
If you know of other configurations or tools that are relevant, let me know...
Java 1.6
- download the JDK and run installation
- add the /jdk/bin directory to your system path
- create JAVA_HOME environment variable pointing to the root JDK directory
- download binary and unzip to a local directory
- edit the /bin/mvn.bat file to increase the Maven heap size (MAVEN_OPTS=-Xmx512m)
- add the /maven/bin directory to your system path
- download Eclipse and run installation
- open Eclipse
- create a new workspace
- create new project or import any existing projects
- setup m2eclipse plugin
- go to Help->Software Updates->Available Software tab
- then click 'Add Site' and add 'http://m2eclipse.sonatype.org/update/ and call it 'm2eclipse'
- select the m2clipse components to install, click finish and restart Eclipse
- go to Windows->Preferences->Maven->Installations
- set the user settings to your maven settings.xml file
- verify that this setup the M2_REPO variable to point to your local repo under Java->Build Path->Classpath Variables
- go to Windows->Preferences->Maven->Archetypes
- click 'Add Remote Catalog'
- catalog file = http://repo.fusesource.com/maven2
- name = Fuse Catalog
- click OK
- click 'Add Remote Catalog'
- donwload Fuse ESB 4.2 and run installation
- create a new project using an archetype (Maven template) that best matches your application needs
- from Eclipse
- File->New->Maven->Maven Project
- check 'use default workspace location' and click next
- choose the 'Fuse Catalog' and enter a desire filter
- choose an archetype
- click next
- enter a group id of 'com.<company>.<project>'
- enter an artifact of '<component>'
- enter a package name of 'com.<company>.<project>.<component>'
- click finish
- note: I have seen issues with some archetypes in Eclipse, if this happens, use the command line approach instead
- from command line
- mvn archetype:create
-DarchetypeGroupId=org.apache.servicemix.tooling
-DarchetypeArtifactId=servicemix-osgi-camel-archetype
-DarchetypeVersion=2010.01.0-fuse-01-00
-DremoteRepositories=http://repo.fusesource.com/maven2
-DgroupId=com.mycompany.project1
-DartifactId=component1
-Dversion=0.0.1-SNAPSHOT
- mvn archetype:create
- from Eclipse
- build the project
- in Eclipse
- right click on the project, go to Run As->Maven install
- from command line
- run 'mvn install'
- project JAR will be created under the /target directory and deployed it to your local Maven repository
- in Eclipse
- deploying the project to Fuse ESB 4.2
- run /<smx>/bin/servicemix to start the server
- make sure any required features/bundles have been installed
- activemq, camel, etc
- from the karaf console, install your project bundle
- osgi:install -s mvn:com.mycompany.project1/component1
- assuming that worked, you now have a working project
- customize project and repeat build/deploy process
Monitoring
- watch the servicemix log file
- tail -f /<smx>/data/log/karaf.log
- JConsole
- <jdk>/bin/jconsole.exe
- provides remote/local JVM monitoring
- remote connection uri = service:jmx:rmi:///jndi/rmi://:1099/jmxrmi
- default user/password = karaf/karaf
- VisualVM
- <jdk>/bin/jvisualvm.exe
- provides remote/local JVM monitoring (slightly better than JConsole)
- cygwin - adds basic Linux command support for Windows
- PowerCMD - tabbed command prompts...trial/not free
- kdiff3 - excellent file/directory comparison tool
- SoapUI - for testing HTTP endpoints
If you know of other configurations or tools that are relevant, let me know...
Apache ServiceMix
Published at DZone with permission of Ben O'Day, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments