Work with the SDK samples
The SDK sample pack demonstrates the various tool types available in Data Management. The easiest way to get started with the samples is by importing the sample pack as a Maven project.
Using Eclipse
Importing the project
Eclipse bundles Maven and provides good Maven integration, making it simple to import and build a Maven project:
From the menu bar, select File > Import.
Select Existing Maven Projects and click Next.
Browse to the root of
%SDK_HOME%
and click OK.Eclipse will populate the Projects list with
/pom.xml MyGroundId:MyTools:1.0:jar
. Accept these defaults and click Finish.
You'll end up with a MyTools project in your Package Explorer.
Building the project
You can build the project in Eclipse:
Right-click the MyTools project and select Run As > Maven build.
In the Edit Configuration dialog, enter Package RPDM SDK samples (or something similarly descriptive) in the Name box.
Leave Base directory unchanged.
In the Goals box, enter package.
Click Apply, then Run.
Eclipse should print a message like this to the console::
CODE
|
You can find the samples JAR in %SDK_HOME%\target
.
You'll also notice some warnings like this:
CODE
|
You can ignore these for now. When you start building your own projects, you may want to change how Maven resolves dependencies.
If you encounter an error like the one shown below, you may want to check this link to resolve the error, and then try to build the project again.
⚠
CODE
|
Running the project
Once you've built the samples, you're ready to run them in Data Management. There are two ways to do this.
The simplest is to place the tool’s JAR file in the %RPDM_HOME\java_plugins
directory. RPDM will auto-discover and load any tool JAR it finds in its java_plugins
directory. This is the preferred method of loading tool JARs. Alternatively, you can do this:
In the RPDM client, go to Repository > Settings > Site > Java.
Under Add folders and jars to classpath, add the JAR you created during the Building the Project procedure
(e.g.%SDK_HOME%\target\MyTools-1.0.jar
) and commit your changes.
To see the sample tools on the palette, select Reset from the Palette menu. Once the palette is reloaded, scroll to the bottom of the palette, until you see the categories Java Samples and SDK Testing.
Drag the sample tools from the Palette to the Canvas, where you can connect them and run them like standard Data Management tools.
From here, you might want to explore the samples, learn more about the tool lifecycle, build your own tools, and debug your tools.
Using Netbeans
Importing the project
NetBeans 8.2 bundles the Maven plugin and provides a similar Maven integration as Eclipse, making it simple to import and build a Maven project:
From the menu bar, select File > Open Project (CTRL+SHIFT+O).
In the Open Project file explorer, Browse to the root of
%SDK_HOME%
, accept the defaults, and click Open Project.You'll end up with a MyTools project directory in your NetBeans Projects Explorer.
Building the project
You can build the project in NetBeans:
On the Projects Explorer window, Right click MyTools, and then click Clean and Build.
NetBeans should print a message like this to the console:
CODE
|
You can find the samples JAR in %SDK_HOME%\target
.
You may encounter build errors like this:
CODE
|
In this case, you'll need to configure some additional properties for a successful Maven build on Netbeans:
Right-click MyTools and select Properties.
Under Categories, select Actions, and then select Clean and Build Project.
Paste
maven.compiler.failOnError=false
into the Set Properties field.Rebuild the project.
Configure an SDK project in Eclipse
After downloading and installing the Redpoint Data Management SDK sample pack, you can configure a new SDK project in Eclipse.
If you have Maven installed and want to use it
Eclipse bundles Maven and provides good Maven integration, making it simple to import a Maven project. You can use the SDK samples as your Maven project template to bootstrap your Data Management tool development:
Download and unpack the SDK samples to a directory named
MyProject
or something comparably descriptive.Copy
rpdmcore-VERSION-shaded.jar
from%RPDM_HOME%\java
toMyProject\lib
.Copy
rpdmsdk-VERSION-shaded.jar
from%RPDM_HOME%\java
toMyProject\lib
.Edit
MyProject\pom.xml
and changeartifactId
andgroupId
to something that makes sense for your project.From the Eclipse menu bar, select File > Import.
Select Existing Maven Projects and click Next.
Browse to the
MyProject
project and open it.Accept the defaults and click Finish.
You should see your new project in the Eclipse project explorer. You can add your Sources and Resources to the project and start developing. To build your project, see "Using Maven" in Building and installing your tool.
By default, projects based on the bootstrap project are configured to resolve required dependencies using system-scoped artifacts. This allows us to distribute a self-contained bootstrap project SDK that users can start working with immediately. If you’re familiar with Maven, or you'll be developing lots of Tools and plan to set up your own Maven archetypes, you may wish to change this behavior, and instead install dependencies to your local repository.
If you don't have Maven installed, or don't want to use Maven
You can configure an SDK project in Eclipse without using Maven, though it required a bit more work:
From the menu bar, select File > New > Java Project.
In the Project name field, name your project something descriptive.
Under JRE, ensure you're using a 1.8 JRE.
Accept the remaining default settings and click Next.
Under the Libraries tab, click Add External JARs.
Browse to
%RPDM_HOME%\java
, selectrpdmcore-VERSION-shaded.jar
, then click OKUnder the Libraries tab, click Add External JARs.
Browse to
%RPDM_HOME%\java
, selectrpdmsdk-VERSION-shaded.jar
, then click OKClick Finish
You'll now have a new project in your package explorer. You can add your Sources and Resources to the project and start developing. You're not quite done yet - to run your tools, you must still configure Eclipse to build a JAR file that can be installed into Data Management. See "Without Maven" in Building and installing your tool.