One way to do this: simply include the library's jars in your .modl file, and include them in your module.xml. This will make the library accessible for your module's classes' classloader.
What if the library is very large, though? This makes development take longer, since every module load requires reloading the entire library.
The solution I came up with was to package the library in its own module.
Steps
1) Grab the library's .jar files, and throw them in a directory.
2) Create a module.xml, like what I have below.
3) Package these in a .zip file, and change the extention to .modl
My library's module.xml:
<?xml version="1.0" encoding="UTF-8"?>
<modules>
<module>
<id>ApacheCXF</id>
<name>Apache CXF</name>
<description>The full Apache CXF 2.4.0 library and supporting libraries.</description>
<version>2.4.0.1</version>
<requiredignitionversion>7.2.5.76</requiredignitionversion>
<requiredframeworkversion>2</requiredframeworkversion>
<freemodule>true</freemodule>
<!-- All the Apache CXF and CXF support libraries -->
<jar scope="DG">antlr-2.7.7.jar</jar>
<jar scope="DG">aopalliance-1.0.jar</jar>
<jar scope="DG">asm-3.3.jar</jar>
...
</module>
</modules>
Then, in your main module's module.xml, include this module as a dependency.
My main module.xml:
<?xml version="1.0" encoding="UTF-8"?>
<modules>
<module>
<id>myawesomemodule</id>
<name>@NAME@</name>
<description>@DESCRIPTION@</description>
<version>@VERSION@</version>
<requiredignitionversion>7.2.5.76</requiredignitionversion>
<requiredframeworkversion>2</requiredframeworkversion>
<freemodule>false</freemodule>
<depends scope="G">ApacheCXF</depends>
<depends scope="D">ApacheCXF</depends>
...
</module>
</modules>
Note: A module can't have two dependencies. If your module already depends on fpmi, you'll need to move that dependency to the library module, and have your module just depend on the library module. So: "Your module" ->(depends)-> "Library module" ->(depends)->"fpmi"
Note 2: Your module will still load, even if it's missing dependencies. In your module's start up, make sure to check for the library's presence, and fault your module if it's not there.
Ignition Version: 7.2 (7.2.5)