2
votes

I am new to gradle. We use gradle for our project but this is the first time I am having to make gradle related changes.

I am trying to use the gradle js plugin for minifying. Here is a link to the doc.

I added the classpath for plugin to the existing buildScript dependencies object and then do gradlew clean build from the command line and it builds sucessfully.

After adding apply plugin: 'com.eriwen.gradle.js' and rebuilding, I get the following error:

Plugin with id 'com.eriwen.gradle.js' not found.

Here is the existing buildScript to which I have added classpath for plugin

buildscript {
    repositories {
        maven {
            url "${artifactory_contextUrl}/plugins-release"
        }

    }
    dependencies {      
        classpath 'org.gradle.api.plugins:gradle-tomcat-plugin:1.0'
        classpath 'com.eriwen:gradle-js-plugin:1.11.0'
    }
}

apply plugin: "com.eriwen.gradle.js"

What am I missing here?

Gradle v. is 1.9 and plugin v. is 1.11.0

1

1 Answers

3
votes

The mentioned plugin apply id for version 1.11.0 is js, so it will be:

buildscript {
    repositories {
       mavenCentral()
    }
    dependencies {      
        classpath 'com.eriwen:gradle-js-plugin:1.11.0'
    }
}

apply plugin: 'js'

BTW: this plugin is available to download via mavenCentral().

To verify it download this artifact, extract it and display the content of:

cat META-INF/gradle-plugins/js.properties

file, which is:

implementation-class=com.eriwen.gradle.js.JsPlugin

The file name (js) of this js.properties file is the ID you need to apply.