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

Compare with Current View Page History

« Previous Version 4 Next »

Introduction

Before you attempt at creating a JBI component using http://servicemix.org/site/creating-a-standard-jbi-component.html;. My suggestion is that you should visit Maven's home page and have a look at the getting started page http://maven.apache.org/guides/getting-started/index.html;. Get acquainted with the term archetype- going by definition it's more of "an original pattern or model from which all other things of the same kind are made". So there you go, Servicemix already has a template which you can use!

First things first

Check if you have maven2 installed, if not then please install it.

1) To create a JBI component as you might have guessed by now - run the mvn command: (needless to say you should create a new directory where you want all your stuff to be generated )

mvn archetype:create \
        -DarchetypeGroupId=org.apache.servicemix.tooling \
        -DarchetypeArtifactId=servicemix-service-engine \
        -DarchetypeVersion=1.0-incubating-SNAPSHOT \
        -DgroupId=org.apache.servicemix.package \
        -DartifactId=servicemix-package

Well, notice the text in blue in the above mvn command. This is meant to be the package info. So if you are creating a component which maybe does some xslt transformation then you would end up with something like:

mvn archetype:create \
        -DarchetypeGroupId=org.apache.servicemix.tooling \
        -DarchetypeArtifactId=servicemix-service-engine \
        -DarchetypeVersion=1.0-incubating-SNAPSHOT \
        -DgroupId=org.apache.servicemix.xslt \
        -DartifactId=servicemix-xslt

 2) After you have successfully run the above command this is what you would end up with servicemix-xslt\
pom.xml
src\
main\
java\
org\
apache\
servicemix\
xslt\
MyBootstrap.java
MyComponent.java
MyDeployer.java
MyEndpoint.java
MyLifeCycle.java
MySpringComponent.java
test\
java\
org\
apache\
servicemix\
xslt\
MySpringComponentTest.java
resources\
spring.xml      
Now you might be wondering why all the classes have the work "My" prefixed to it. Don't worry these are just driven from the templates, you just need to rename them to whatever you want to. Just make sure you change the corresponding resource files such as:

  • No labels