Wednesday, May 31, 2017

Including Libraries in your Ignition Modules

For those of you looking to include Java libraries, the new Maven build system makes this very easy.

If you haven't created a module yet, follow the steps in http://ignitionprogramming.blogspot.com/2017/05/module-development-quick-start-guide.html to get started.

How to include other libraries
1) Open pom.xml in the main project folder in IntelliJ IDEA
2) Add a section that looks like this:
  <dependencies>

  </dependencies>
3) Inside that <dependencies> block, copy paste the maven dependency for the library you want to include.
Example:
  <dependencies>

    <dependency>
      <groupId>com.google.zxing</groupId>
      <artifactId>core</artifactId>
      <version>3.3.0</version>
    </dependency>

  </dependencies>

And you're done! Maven makes library includes so easy that you'll forget you ever had to worry about dependency hell.


If you want to expose your newly included libraries through script functions, check out http://ignitionprogramming.blogspot.com/2011/07/adding-scripting-functions.html.

0 comments:

Post a Comment