I´m trying to run a project using gradle but I´m getting the following error.
FAILURE: Build failed with an exception. * Where: Build file 'D:\ISEP\ODSOFT\Projects\odsoft-21-22-nmb-g311\odsoft-21-22-nmb-g311\project\build.gradle' line: 4 * What went wrong: An exception occurred applying plugin request [id: 'fr.putnami.gwt', version: '0.4.0'] > Failed to apply plugin class 'org.gradle.api.plugins.MavenPlugin'. > The legacy `maven` plugin was removed in Gradle 7. Please use the `maven-publish` plugin instead. See for details * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. The command I´m using to run project is gradle gwtRun.
I leave below my gradle bulid file
plugins { id "fr.putnami.gwt" version "0.4.0" id "maven-publish" } apply plugin: 'war' apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'jacoco' apply plugin: 'maven-publish' //Java version compatibility to use when compiling Java source. sourceCompatibility = 1.8 //Java version to generate classes for. targetCompatibility = 1.8 //Script Version version = '1.0' repositories { mavenCentral() } dependencies { //testCompile 'junit:junit:4.12' //testCompile group: 'junit', name: 'junit', version: '4.12' testImplementation group: 'junit', name: 'junit', version: '4.12' testImplementation 'org.easymock:easymock:2.5.2' testImplementation 'com.google.gwt:gwt-dev:2.8.1' implementation 'net.sourceforge.plantuml:plantuml:8001' //compile 'net.sourceforge.plantuml:plantuml:8001' } javadoc { options.addStringOption("sourcepath", "") } // If we woant to use the default ant build inside gradle // ant.importBuild "build.xml" putnami{ module 'pt.isep.cms.Showcase' //module 'com.google.gwt.sample.contacts.Contacts' /** add gwt nature on eclipse project. require apply plugin: 'eclipse' to work. default : false*/ googlePluginEclipse = true gwtVersion='2.8.1' compile { sourceLevel = '1.8' } jetty { /** enable debugging. */ debugJava = true /** debug port to listen. */ debugPort = 8000 /** wait for debugger attachment. */ debugSuspend = false } } // Jacoco jacocoTestReport { reports { xml.enabled false csv.enabled false } } // This task generates the coverage report for the integration tests. // Notice that it only includes data about the server code sice Jaccoco is not able to get data about cliente code that is transpiled to javascript task jacocoIntegrationReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { sourceSets sourceSets.main executionData = files("${buildDir}/jacoco/integrationTest.exec") reports { html.enabled = true xml.enabled = false csv.enabled = false } } // Integration Tests task integrationTest(type: Test) { filter { //all GWT unit tests, by naming convention includeTestsMatching "*GWTTest*" } jacoco { append = true enabled = true //classDumpFile = file("${buildDir}/jacoco/classpathdumps") excludes = ["com/steadystate/**"] } // These Properties are required to run gwt integration tests systemProperties['gwt.args'] = "-devMode -logLevel WARN -war www-test" } tasks.withType(Test) { reports.html.destination = file("${reporting.baseDir}/${name}") } // Unit Tests test { filter { //all JRE unit tests, by naming convention includeTestsMatching "*JRETest*" } jacoco { append = true enabled = true //classDumpFile = file("${buildDir}/jacoco/classpathdumps") } } From what I understood the plugin maven was removed in the version 7 of gradle. Is this sentence correct? Or is the putnami plugin that was removed?
What should I do to make it to work?
2 Answers
The plugin fr.putnami.gwt applies the maven plugin internally:
Therefore, fr.putnami.gwt is not compatible with Gradle 7.
As stated in the README in the repo:
A fork of it that is still supported and has a newer release is available at . Please use the new version if you need GWT support for Gradle.
So, then the following should work:
plugins { id "de.esoco.gwt" version "1.1.1" } Go to settings->Gradle->Gradle jdk make sure jdk version is updated. In my case issue was resolved by updating jdk version.