To use the maven archetype to generate the Maven project template and sample connector code, run the following command in the directory where you want to create the connector on your local machine:
mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeGroupId=org.wso2.carbon.extension.archetype -DarchetypeArtifactId=org.wso2.carbon.extension.esb.connector-archetype -DarchetypeVersion=2.0.0 -DgroupId=org.wso2.carbon.esb.connector -DartifactId=org.wso2.carbon.esb.connector.helloworld -Dversion=1.0.0 -DarchetypeRepository=http://maven.wso2.org/nexus/content/repositories/wso2-public/
Above is tested with Apache Maven 3.0.5.
If maven version is 2.x.x, use the following command in the directory where you want to create the connector on your local machine:
mvn archetype:generate -DarchetypeGroupId=org.wso2.carbon.extension.archetype -DarchetypeArtifactId=org.wso2.carbon.extension.esb.connector-archetype -DarchetypeVersion=
-DgroupId=org.wso2.carbon.connector -DartifactId=org.wso2.carbon.connector.helloworld -Dversion=
- When prompted, enter a name for the connector. Specify the name in upper camel case, such as
The directory structure includes the following files and directories.
|Contains the required dependencies for the connector core libraries, relevant Synapse libraries, and Maven repositories for a specific connector.|
|Contains files that are used at the connector build time. You do not need to modify these files.|
|Contains any Java code for the connector.|
|Contains the configurations and definitions for the connector and its methods (referred to as operations). The |
|Defines the metadata for the operations in each component. You create a |
|Defines an operation. This is the actual API operation calling configuration including the Synapse template of the sequence. It contains the steps necessary to call the API that is exposed by the third party. For example, the ActiveCollab connector has |
|Appears in the |
|Defines the connector name and dependent modules (i.e., the metadata of the connector).|
|Contains integration tests. This is required for integration tests for Java-based connectors. For more information, Perform integration tests below.|
After creating the Maven project template, import it to an IDE, and edit the following files.
The properties of the above
connector.xml file are described below.
|Defines the name of the connector, the package, and the components inside the |
A name for the connector. This connector name should be unique, as the connector methods will refer to the connector using this name as shown in the following example:
|The Java package from which connectors are implemented.|
Each dependency points to a component in the
|Relative path of the connector icon.|
The properties of the
component.xml file are described below.
The name of the component.
|The type of the Synapse component. These resources are Synapse templates, so the type is specified as |
Defines the operations in the component.
The name of the operation file with the extension.
A brief description about the functionality of the operation.
Edit the sample Synapse template (
For detailed information on working with connectors via the the ESB Management Console, see Working with Connectors via the Management Console.