Developing Adapters in Eclipse
Overview
As taught in previous Adapters tutorials, adapters are Maven projects that are created by using either Maven directly or via the PMF CLI. The adapter code can then be edited in any IDE, and later built and deployed using either Maven or the PMF CLI. A developer may also choose to create, develop, build and deploy all inside a supported IDEs, such as Eclipse or IntelliJ. In this tutorial an adapter is created and built from the Eclipse IDE.
Prerequisite:
- Get familiarized with adapters by reading the Adapters tutorials first.
- Maven integration in Eclipse. Starting Eclipse Kepler (v4.3), Maven support is built-in in Eclipse. If your Eclipse instance does not support Maven, follow the m2e instructions to add Maven support.
Jump to
- Creating a new adapter Maven project
- Importing an existing adapter Maven project
- Building and deploying an adapter Maven project
- Further reading
Import an Adapter Maven project
Follow the bellow instructions to import an existing one.
Importing an existing adapter Maven project
To import the adapter Maven project, select File → Import… → Maven → Existing Maven Projects.
Building and deploying an adapter Maven project
An adapter project can be built and deployed by using either Maven command-line commands, the PMF CLI or from Eclipse.
Learn how to build and deploy adapters.
Tip: Eclipse can also be enhanced to ease the deployment step by integrating a Command-line window using a plug-in, creating a consistant development environment. From this window Maven or PMF CLI commands can be run.
Building an adapter
To build an adapter, right-click on the adapter folder and select Run As → Maven install.
Deploying an adapter
To deploy an adapter, first add the deploy Maven command:
- Select Run → Run Configurations…, right-click on Maven Build and select New.
- Provide a Name: “Maven deploy”.
- Set as a Goal: “adapter:deploy”.
- Click Apply followed by clicking on Run to have an initial deploy.
You can now right-click on the adapter folder and select Run As → Maven Deploy
Building and deploying an adapter
You can also combine the “build” and “deploy” Maven Goals to a single “build and deploy” Goal: “clean install adapter:deploy”.
Further reading
Learn how to debug Java code in adapters in the Testing and debugging adaters tutorial.
▲