Skip to content Skip to sidebar Skip to footer

Plugin Request For Plugin Already On The Classpath Must Not Include A Version

I've done web search for 'plugin request for plugin already on the classpath must not include a version site:stackoverflow.com' and found nothing that particular. Search for 'plugi

Solution 1:

Gradle doesn't allow multiple versions of a plugin to be present on the classpath. So if you have a multi module build, there could be a chance that more than one module has declared the same plugin with a different version.

To fix this, you will need to specify a single version in a single place i.e settings.gradle

For example, you will put the following in settings.gradle

pluginManagement {
  plugins {
    id'org.springframework.boot' version "2.3.3.RELEASE"id'io.spring.dependency-management' version '1.0.10.RELEASE'
  }
}

And then in the individual module gradle files, you will do the following (no version mentioned)

plugins {
  id'org.springframework.boot'id'io.spring.dependency-management'
}

Just for the record, the error mentioned in the question may also show up with this message

plugin was loaded multiple times in different subprojects, which is not supported and may break the build

Solution 2:

I was facing same problem, I was using spring boot with plugins as follows

plugins {
    id'org.springframework.boot' version '2.2.0.RELEASE'id'io.spring.dependency-management' version '1.0.8.RELEASE'id'java'id'war'
}

Since this plugin was present in one dependency gradle was complaining about it. I simply removed those dependencies and it worked:

plugins {
    id'java'id'war'
}

Solution 3:

Put configuration into build.gradle in the root project with apply false.

plugins {
    id'org.springframework.boot' version "2.5.1" apply falseid'io.spring.dependency-management' version '1.0.11.RELEASE' apply false
}

Then you can just put it everywhere without the version

plugins {
    id'org.springframework.boot'id'io.spring.dependency-management'
}

More information: ->Example 3. Applying plugins only on certain subprojects

Post a Comment for "Plugin Request For Plugin Already On The Classpath Must Not Include A Version"