Gradle plugin is missing module signer

Hi,

I am trying to get the gradle plugin to work, but it can’t find the module signer required by the modl plugin.

I get this exception.

A problem occurred configuring root project 'Gateway'.
> Could not resolve all files for configuration ':classpath'.
   > Could not find com.inductiveautomation.ignitionsdk:module-signer:0.0.1.ia.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/com/inductiveautomation/ignitionsdk/module-signer/0.0.1.ia/module-signer-0.0.1.ia.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project : > io.ia.sdk.modl:io.ia.sdk.modl.gradle.plugin:0.1.0 > gradle.plugin.io.ia.sdk:gradle-module-plugin:0.1.0

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

I can see in the module-plugin project that it has a dependency on the module signer, but I can’t see any reference to it in the README.md telling me how to install it.

dependencies {
    // Align versions of all Kotlin components
    // Use the Kotlin JDK standard library.
    implementation(kotlin("bom", KotlinCompilerVersion.VERSION))
    api(kotlin("stdlib-jdk8", KotlinCompilerVersion.VERSION))
    api(kotlin("reflect", KotlinCompilerVersion.VERSION))
    implementation(libs.guava)
    implementation(libs.moshi)
    // kapt(libs.moshiCodegen)
    implementation(libs.kotlinXmlBuilder)
    api(libs.moduleSigner)
    testImplementation(libs.bundles.kotlinTest)
    testImplementation("io.ia.sdk.tools.module.gen:generator-core")
}

I am assuming this is pulled from a separate directory?

Do I need to install this seperately? Or should it pull it in via Gradle?

Thanks,
Tom

You probably need to declare a buildScript block with an additional repository, so that Gradle can download the plugin from us, e.g:

Edit: Got some clarification, looks like you should just need
maven { url "https://nexus.inductiveautomation.com/repository/inductiveautomation-releases/" }

Thank you,

Turns out I actually needed

pluginManagement {
    repositories {
        mavenLocal()
        gradlePluginPortal()
        maven {
            url 'https://nexus.inductiveautomation.com/repository/public'
        }
    }
}

Adding to my settings.gradle.

I have now ran into another issue when signing my module. The signModule task in gradle fails with the following error:

Unable to find method ''void com.inductiveautomation.ignitionsdk.ModuleSigner.<init>(java.security.PrivateKey, java.io.InputStream)''
'void com.inductiveautomation.ignitionsdk.ModuleSigner.<init>(java.security.PrivateKey, java.io.InputStream)'

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

I have tried the recommended fixes by Gradle, but I had no luck. Do you have any ideas?

If I can’t get it working, I may resort to the standalone module signer, although, the Gradle version would be nicer.

Thanks,
Tom

I’d try running gradlew --stop to halt any daemons and start a new one with the next build invocation. If you continue to have issues, we can certainly look at republishing. An alternative would be to build and publish the module signer lib to your mavenLocal repo and use dependency resolution constraints/rules to force use of that one. Shouldn’t need to though.

Please feel free to file an issue against the plugin repo if you continue to have issues and we’ll figure out how to improve it. We may be able to just republish as a shadowed/fat jar, but I’m a tad reluctant to follow that practice unless there is no alternative.