Ignition Maven Plugin v1.0.11 Fails

In order to have the modl file automatically installed to the local gateway, I specified use of v1.0.11 of the Ignition Maven Plugin.

The build fails at two places, described below.

Failure #1:
The log file reports:
SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.

To fix this, I added dependencies for slf4j and log4j to the root pom file. Both of these packages (slf4j and log4j) are in the local Maven repository.

The build still fails.

Dependencies from pom file and build log are reproduced here.


Begin: Dependencies added to root pom file


<dependencies>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${project.slf4jVersion}</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${project.slf4jVersion}</version>
    </dependency>

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
        <scope>runtime</scope>
    </dependency>
</dependencies>

End: Dependencies added to root pom file



Begin: Build log reports failure to load slf4j


[INFO] creating module.xml: C:\Users\gashmore\AppData\Local\Temp\modl2886238889354801523\module.xml
[INFO] Adding documentation to module.
[INFO] Creating modl file at: C:\Ignition\IntelliJ\XasIgnition\ItemQualityLogBuild\target\ItemQualityLog-unsigned.modl
SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See slf4j.org/codes.html#StaticLoggerBinder for further details.


End: Build log reports failure to load slf4j


Failure #2:
The gateway rejects the load of the module, as shown in the log.

[
Update:
I reverted to v1.0.5 of the Ignition Maven plug-in, got a successful build of the module file, attempted manual installation of the module in the gateway. Parse of module xml file failed due to incorrectly formatted version number. Changed 1.0 to 1.0.0; module installed. So, this failure #2 may have been solved.
]


Begin: Build log reports failure to install module to gateway


[INFO] — ignition-maven-plugin:1.0.11:post (postexecution) @ ItemQualityLogBuild —
[INFO] Installing C:\Ignition\IntelliJ\XasIgnition\ItemQualityLogBuild\target\ItemQualityLog-unsigned.modl to gateway.
[INFO] Deploying to localhost:8088/main/system/Devel … ingServlet
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] XasIgnitionProject … SUCCESS [0.563s]
[INFO] CommonLib … SUCCESS [2.470s]
[INFO] ItemQualityLog … SUCCESS [3.744s]
[INFO] ItemQualityLogBuild … FAILURE [1.612s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.570s
[INFO] Finished at: Thu Sep 08 08:42:43 EDT 2016
[INFO] Final Memory: 15M/260M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.inductiveautomation.ignitionsdk:ignition-maven-plugin:1.0.11:post (postexecution) on project ItemQualityLogBuild: Could not post the module to the Gateway. Could not post module to gateway. Server returned HTTP response code: 500 for URL: localhost:8088/main/system/Devel … ingServlet -> [Help 1]


End: Build log reports failure to install module to gateway


Hi, I’m not able to replicate issue #1 on any of the SDK example projects so I might need to see more of what you’ve got set up.

#2 is because your gateway is not in “developer mode”, which is a feature of the license you’re running. I think you have to contact a sales rep to get a developer license these days (it’s free). Alternatively… you can start the Ignition gateway with the system property “-Dia.developer.moduleupload=true” and it should allow modules to be loaded as well. You would add this to the additional params section in ignition.conf.

What info do you need me to provide?

I installed a license that put the gateway in developer mode.
This is what I saw as I installed the module manually:
<<<
This module is not signed. You are currently running in developer mode and can run unsigned modules. Modules can make changes to your system. Be sure you understand the risk.

[quote=“Kevin.Herron”]Alternatively… you can start the Ignition gateway with the system property “-Dia.developer.moduleupload=true” and it should allow modules to be loaded as well.[/quote]Sweet! I didn’t know this trick. It’ll be very handy.

I’m not sure what I’m looking for really. SLF4j is not a dependency of the ignition-maven-plugin. I’m not sure where that message is coming from. Is any of your code using slf4j?

The module installation stuff may interact weird with the new module signing logic… it might work after one time installing it manually so that your module license and author info has been accepted. I’ll have a look and see.

No, I don't use slf4j. I do not see this fault with v1.0.5 of the Ignition Maven Plugin; I see it with v1.0.11.

[quote=“xasga”]
No, I don’t use slf4j. I do not see this fault with v1.0.5 of the Ignition Maven Plugin; I see it with v1.0.11.[/quote]
But I wouldn’t see it with 1.0.5, because it does not execute the install phase.

What is your development environment? In Eclipse, the slf4j error message was a bug that has been fixed some years ago. It was only a warning, that could be safely ignored (at least for the Eclipse integrated Maven).
Does this warning really stop your build? Output logging should not be a vital part of a maven build.

[quote=“chi”]What is your development environment? In Eclipse, the slf4j error message was a bug that has been fixed some years ago. It was only a warning, that could be safely ignored (at least for the Eclipse integrated Maven).
Does this warning really stop your build? Output logging should not be a vital part of a maven build.[/quote]
No, the build does not stop. The error message indicates that logging will not be available at runtime in the gateway, which would be a problem. However, given that none of my code uses slf4j, and (so I understand Kevin Herron) neither does the Ignition system code, the message may not have any practical consequence. I’d still like it gone, as a failure notice at every build will result in wasted time.

No, this is simply the logging of the Maven build output. It has nothing to do with Ignition or the created module.

Are you running this build from the command line or from inside Eclipse? Does it happen when you try to package one of the example projects?

I'm using IntelliJ IDEA.

In my own project:

In IDEA:
Right-click on Lifecycle->install
Click Run Maven Build.
The "failed to load class org.slf4j.impl.StaticLoggerBinder" warning is generated.

Command Line:
mvn install.
The slf4j warning does not appear.

In example project simple-tag-provider:

In IDEA:
Right-click on Lifecycle->install
Click Run Maven Build.
The "failed to load class org.slf4j.impl.StaticLoggerBinder" warning is generated.

Command Line:
mvn install.
The slf4j warning does not appear.

In all cases, the module is installed to the gateway, and the build is declared a success.
So this is a mild nuisance, not a work-stopping problem.