Skip to end of metadata
Go to start of metadata

Download Eclipse

Download Eclipse from http://www.eclipse.org. You want the download: "Eclipse IDE for Java Developers".  Install to a convenient space.

 

Start Eclipse and Set-Up Your Workspace

When you first start Eclipse, it asks you what workspace you want to work in. A workspace is a folder on your hard drive that holds a collection of projects. You can have multiple workspaces. If you're already an eclipse user, you'll want to create a new workspace.  To make a workspace, simple create a folder somewhere to be your workspace or choose a path through Eclipse when you start the IDE. For example: C:\development\IgnitionSDK_Workspace. Prior to ignition 7.8, you would have a downloaded a zip of jars through the Inductive Automation SDK website.  Since converting to a fully artifact-based SDK, you can now skip that step.  We will configure the SDK dependencies inside the IDE. 

Download Example Projects

We have a number of SDK examples available on Inductive Automation's Github repo, and we will walk through the setup process using one of these example projects.  If you'd like to follow along, first make sure you have git installed, and then simply clone the repo to a folder on your local disk at the command line with the command git clone https://github.com/inductiveautomation/ignition-sdk-examples.git , or by using your preferred graphical git tool (examples include Sourcetree, TortoiseGit, etc).  Cloning the repo will give you a copy of all the examples and source code.

Import Example Projects

Now in eclipse, you will want to import a project.  Select "Import project" from the Eclipse welcome screen, or choose "Open project from file..." in the File menu of the IDE.  Navigate to an example you'd like to import, such as the SimpleTagProvider, select the folder and import.  After importing an example, you will see them added to your workspace, it should look something like this.

 

Compiling the example

With the project now in eclipse, we just need to compile the module. While the new SDK can be a change to those with experience using Ant + jars from the old method, it makes dealing with dependencies much easier.  You don't have to worry about jars anymore.  Dependencies will automatically be downloaded from our artifact repository, to your system.  To see this in action, click the parent example (in our case, SimpleTagProviderExample) in the navigation tree.  Then, select from the Run menu, Run As -> Maven test.  

After choosing Maven test, we should see our console fill up with execution information.  As part of the build process, you'll see that a number of artifacts are downloaded from our public repository at http://nexus.inductiveautomation.com:8081/nexus/content/repositories/.  When we publish a new version of Ignition, we also publish the jars (artifacts) to be available through the SDK.

After seeing that we are correctly resolving our artifacts, we can add a new build target aimed at 'Maven package', which will create our module.

 

Building the Module

The ignition-maven-plugin helps create a properly assembled modl file.   The examples all use the plugin, so we simply need give Eclipse the target to run the package Maven goal.

So we will select our parent project again (the root project of the example), and from the same run button, select Run As -> Maven build... .   This will bring up a configuration window that asks to specify a goal.  Type in 'package', as seen in the image below.  If you'd like to always check for newer versions of 'SNAPSHOT' artifacts (which are pre-release versions), check the box.  Set the name to be something descriptive like "STP Module" (for Simple Tag Provider Module) to make it easy to identify in the menu, and then click 'Run'.

Now, back at the main workspace, you can click Run -> STP Module.  If you look in your console you should see something like this, as well as have a new .modl file in your build/target:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] simple-tag-provider
[INFO] stp-gateway
[INFO] stp-build
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building simple-tag-provider 1.7.0
[INFO] ------------------------------------------------------------------------
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building stp-gateway 1.7.0
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://repo.eclipse.org/content/repositories/paho-releases/com/inductiveautomation/ignition/bootstrap/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots/com/inductiveautomation/ignition/bootstrap/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-thirdparty/com/inductiveautomation/ignition/bootstrap/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-releases/com/inductiveautomation/ignition/bootstrap/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots/com/inductiveautomation/ignition/bootstrap/7.7.2-SNAPSHOT/maven-metadata.xml (2 KB at 14.2 KB/sec)
[INFO] Downloading: https://repo.eclipse.org/content/repositories/paho-releases/com/inductiveautomation/ignition/ignition-platform/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-releases/com/inductiveautomation/ignition/ignition-platform/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots/com/inductiveautomation/ignition/ignition-platform/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-thirdparty/com/inductiveautomation/ignition/ignition-platform/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots/com/inductiveautomation/ignition/ignition-platform/7.7.2-SNAPSHOT/maven-metadata.xml (628 B at 61.3 KB/sec)
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-releases/com/inductiveautomation/ignition/common/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots/com/inductiveautomation/ignition/common/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: https://repo.eclipse.org/content/repositories/paho-releases/com/inductiveautomation/ignition/common/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-thirdparty/com/inductiveautomation/ignition/common/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots/com/inductiveautomation/ignition/common/7.7.2-SNAPSHOT/maven-metadata.xml (1006 B at 98.2 KB/sec)
[INFO] Downloading: https://repo.eclipse.org/content/repositories/paho-releases/com/inductiveautomation/ignition/simple-orm/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots/com/inductiveautomation/ignition/simple-orm/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-releases/com/inductiveautomation/ignition/simple-orm/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-thirdparty/com/inductiveautomation/ignition/simple-orm/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots/com/inductiveautomation/ignition/simple-orm/7.7.2-SNAPSHOT/maven-metadata.xml (1010 B at 109.6 KB/sec)
[INFO] Downloading: https://repo.eclipse.org/content/repositories/paho-releases/com/inductiveautomation/ignition/gateway-api-jars/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-releases/com/inductiveautomation/ignition/gateway-api-jars/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots/com/inductiveautomation/ignition/gateway-api-jars/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-thirdparty/com/inductiveautomation/ignition/gateway-api-jars/7.7.2-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded: http://nexus.inductiveautomation.com:8081/nexus/content/repositories/inductiveautomation-snapshots/com/inductiveautomation/ignition/gateway-api-jars/7.7.2-SNAPSHOT/maven-metadata.xml (627 B at 87.5 KB/sec)
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ stp-gateway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/pjones/dev/ignition-sdk-examples/ignition-sdk-examples/SimpleTagProviderExample/stp-gateway/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ stp-gateway ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ stp-gateway ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/pjones/dev/ignition-sdk-examples/ignition-sdk-examples/SimpleTagProviderExample/stp-gateway/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ stp-gateway ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ stp-gateway ---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ stp-gateway ---
[INFO] Building jar: /Users/pjones/dev/ignition-sdk-examples/ignition-sdk-examples/SimpleTagProviderExample/stp-gateway/target/stp-gateway-1.7.0.jar
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building stp-build 1.7.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ stp-build ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/pjones/dev/ignition-sdk-examples/ignition-sdk-examples/SimpleTagProviderExample/stp-build/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ stp-build ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ stp-build ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/pjones/dev/ignition-sdk-examples/ignition-sdk-examples/SimpleTagProviderExample/stp-build/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ stp-build ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ stp-build ---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ stp-build ---
[INFO] Building jar: /Users/pjones/dev/ignition-sdk-examples/ignition-sdk-examples/SimpleTagProviderExample/stp-build/target/stp-build-1.7.0.jar
[INFO] 
[INFO] --- ignition-maven-plugin:1.0.5:modl (default) @ stp-build ---
[INFO] project=stp-build, ignitionScope=null
[INFO] project=stp-gateway, ignitionScope=G
[INFO] Using temp dir: /var/folders/p8/26vg1h8d3svcy3gcl6db8_08s08vdw/T/modl8098692758546594530
[INFO] copying g artifacts
[INFO] copying dependency artifact: org.eclipse.paho.client.mqttv3-1.0.2.jar
[INFO] copying dependency artifact: stp-gateway-1.7.0.jar
[INFO] copying c+d artifacts
[INFO] creating module.xml: /var/folders/p8/26vg1h8d3svcy3gcl6db8_08s08vdw/T/modl8098692758546594530/module.xml
[INFO] Creating modl file at: /Users/pjones/dev/ignition-sdk-examples/ignition-sdk-examples/SimpleTagProviderExample/stp-build/target/SimpleTagProvider.modl
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] simple-tag-provider ................................ SUCCESS [  0.001 s]
[INFO] stp-gateway ........................................ SUCCESS [  4.604 s]
[INFO] stp-build .......................................... SUCCESS [  0.337 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.028 s
[INFO] Finished at: 2016-09-22T10:38:26-07:00
[INFO] Final Memory: 16M/242M
[INFO] ------------------------------------------------------------------------

 

If you see 'Build Success', then your environment is correctly setup!  

That's it! You're up and running. You've compiled and built a module using the SDK. Now you can write your own module or adapt one of the examples to create new functionality for Ignition.   

 

 

 

 

  • No labels

2 Comments

  1. Anonymous

    Could we also have a page on how to setup Eclipse using Maven?

    1. I updated the docs to reflect the new SDK.  If there is more information you may find helpful, feel free to ask!