I may be just missing something obvious, but the module-signer as provided @ github doesn’t run.
It’s missing the manifest indicating the class that contains the main function. When I add the appropriate entries to the pom.xml
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.inductiveautomation.ignitionsdk.ModuleSigner</mainClass>>
</manifest>
</archive>
</configuration>
</plugin>
That doesn’t work because the main method is contained in a static subclass of ModuleSigner, and when I specify the full path to that class, I get an error message
java -cp module-signer-1.0.0-SNAPSHOT.jar com.inductiveautomation.ignitionsdk.ModuleSigner.Main
Error: Could not find or load main class com.inductiveautomation.ignitionsdk.ModuleSigner.Main
When I end with just ModuleSigner I get
[code]java -cp module-signer-1.0.0-SNAPSHOT.jar com.inductiveautomation.ignitionsdk.ModuleSigner
Error: Main method not found in class com.inductiveautomation.ignitionsdk.ModuleSigner, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
[/code]
This is fixed by moving the Main class into it’s own source file.
Next, the class path doesn’t include the CommandLineParser, or either of the two dependency jars. So, I replaced the maven-jar-plugin with the maven-shade-plugin and now I have a executable jar produced from the sources at github.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.inductiveautomation.ignitionsdk.Main</mainClass>>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
Now to attempt to figure out how to use a self-signed certificate (hopefully created correctly) with this module…