Error When Trying To Compile Perspective-Momentary-Button module example

Hi guys,

I just wondering if any of you have similar experience like what i had. I was trying to compile the example module from Ignition github repository. The name of the project as perspective-momentary-module , which is an example module to develop a simple module for perspective.

but for some reason i was stuck with error mentioned on the screen shot.

I would appreciate any help to resolve the issue.

Regards

I did some changes, by commenting ignition-module-plugin on allprojets section, then move it to plugins sections. Now i am getting different error saying the plugin ignition-module-plugin version 1.2.10-SNAPSHOT couldn’t be resolved.

Anyone has an idea what’s going on ?

Regards

Can you post your entire current build.gradle.kts and settings.gradle.kts files, along with the full error you're getting, not a screenshot, as preformatted text.

Otherwise we're working uphill trying to understand what might be the issue.

1 Like
Thanks Paul for responding. 

perspective-momentary-button-1.0.3_modified.zip (502.6 KB)

Below is the code for build.gradle

import java.util.concurrent.TimeUnit


buildscript {
    repositories {
        gradlePluginPortal()
        mavenLocal()
        mavenCentral()
        jcenter()
        maven { url "https://nexus.inductiveautomation.com/repository/inductiveautomation-thirdparty/" }
        maven { url "https://nexus.inductiveautomation.com/repository/inductiveautomation-releases/" }
        maven { url "https://nexus.inductiveautomation.com/repository/inductiveautomation-snapshots/" }

    }

    ext.sdk_version = "8.1.0"

    dependencies {
        classpath("com.inductiveautomation.gradle:ignition-module-plugin:1.2.10-SNAPSHOT")
    }
}

plugins {
    id "base"
    id "ignition-module-plugin" version "1.2.10"
}

version "1.0.3"
group "org.imdc"


allprojects {
    //apply plugin: "ignition-module-plugin"

    ignitionModule {
        // name of the .modl file to build
        fileName "PerspectiveMomentaryButton"

        // what is the name of the "root" gradle project for this module.  In this case, it"s "this", aka, the project
        // specified as <repoPath>/perspective-component/build.gradle
        moduleRoot "perspective-momentary-button"

        // module xml configuration
        moduleName "Perspective Momentary Button"
        moduleId "org.imdc.perspective.momentarybutton"
        moduleVersion "${project.version}"
        moduleDescription "The module provides a Perspective momentary button component"
        requiredIgnitionVersion "8.1.0"
        requiredFrameworkVersion "8"
        isFree true
        license "license.html"
        moduleDependencies = [
                [scope: "G", moduleId: "com.inductiveautomation.perspective"],
                [scope: "D", moduleId: "com.inductiveautomation.perspective"]
        ]
        // map our projects to the scopes their jars should apply.  Web isn't here because its assets are moved
        // into the gateway resource folder as part of the module's build
        projectScopes = [
                [name: "gateway", scope: "G"],
                [name: "designer", scope: "D"],
                [name: "common", scope: "GD"]
        ]

        hooks = [
                [scope: "G", hookClass: "org.imdc.perspective.momentarybutton.gateway.GatewayHook"],
                [scope: "D", hookClass: "org.imdc.perspective.momentarybutton.designer.DesignerHook"]
        ]

    }

    if (project.plugins.hasPlugin("java")) {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }

    // check for new versions of dependencies more frequently than default 24 hours.
    configurations.all {
        resolutionStrategy {
            cacheChangingModulesFor(30, TimeUnit.SECONDS)
        }
    }

    // where should we try to resolve maven artifacts from?
    repositories {
        mavenLocal()
        mavenCentral()
        google()
        jcenter()

        maven {
            name "teamdev"
            url "http://maven.teamdev.com/repository/products"

        }
        maven { url "https://nexus.inductiveautomation.com/repository/inductiveautomation-releases/" }
        maven { url "https://nexus.inductiveautomation.com/repository/inductiveautomation-thirdparty/" }
        maven { url "https://nexus.inductiveautomation.com/repository/inductiveautomation-snapshots/" }
    }
}

task deepClean() {
    dependsOn allprojects.collect { "${it.path}:clean" }
    description "Executes clean tasks and remove node plugin caches."
    doLast {
        delete(file(".gradle"))
    }
}

/**
 * Gradle wrapper configuration*/
wrapper {
    distributionUrl = "https://services.gradle.org/distributions/gradle-5.6.4-all.zip"
}


settings.gradle


// this file configures settings for the gradle build tools, as well as the project structure.
// Generally this doesn't need to be altered unless you are adding/removing sub-projects.

rootProject.name = "perspective-momentary-button"

// link up our subprojects as part of this multi-project build.  Add/remove subprojects gradle path notation.
include(":common", ":gateway", ":designer", ":web")

After installing ignition version 8.3 beta and downlading the ignition-sdk-example-8.3, i no longer have a problem. So i close the case and thank you for your time. I think ver 8.3 is superb.:smiley:

I was having a similar issue on 8.1, which I think I’ll be sticking with for now.

The issue was with ignition-sdk-examples/perspective-component-minimal (branch ignition-8.1), and I fixed it with the following diff to settings.gradle.kts:

pluginManagement {
         gradlePluginPortal()
         mavenCentral()
         mavenLocal()
+        // add the IA repo to pull in the module-signer artifact.  Can be removed if the module-signer is maven
+        // published locally from its source-code and loaded via mavenLocal.
+        maven {
+            url = uri("https://nexus.inductiveautomation.com/repository/public/")
+        }
+
     }
 }

1 Like