Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle 4.0 Build Causes java.lang.NoSuchMethodError #9600

Closed
jsicotte opened this issue Jun 26, 2017 · 6 comments
Closed

Gradle 4.0 Build Causes java.lang.NoSuchMethodError #9600

jsicotte opened this issue Jun 26, 2017 · 6 comments
Labels
status: duplicate A duplicate of another issue

Comments

@jsicotte
Copy link

It seems that multi-project builds may break when upgrading to Gradle 4.0. I have provided a sample project here. When ./gradlew --stacktrace build is run, the build will fail with the following error (some lines removed for brevity):

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':projectB:bootRepackage'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)

Caused by: java.lang.NoSuchMethodError: org.gradle.api.artifacts.ProjectDependency.getConfiguration()Ljava/lang/String;
        at org.springframework.boot.gradle.repackage.ProjectLibraries.getLibrariesForFileDependencies(ProjectLibraries.java:132)
        at org.springframework.boot.gradle.repackage.ProjectLibraries.getLibraries(ProjectLibraries.java:113)

BUILD FAILED in 1s

I have only experienced the NoSuchMethodError when dealing with multi-project builds, everything works fine once I remove the dependancy:

--- a/projectB/build.gradle
+++ b/projectB/build.gradle
@@ -7,5 +7,4 @@ dependencies {
         exclude module: "spring-boot-starter-tomcat"
     }
     compile("org.springframework.boot:spring-boot-starter-jetty")
-    compile project(':projectA')
 }
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 26, 2017
@iyossi
Copy link

iyossi commented Jun 26, 2017

Hi
I have the same problem . After upgrading from gradle 3.4.1 to 4.0 with multi-project build.

@wilkinsona
Copy link
Member

Duplicates #8154

@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 26, 2017
@iyossi
Copy link

iyossi commented Jun 26, 2017 via email

@wilkinsona
Copy link
Member

@lyossi You said that you have the same problem as @jsicotte. @jsicotte was using Spring Boot 1.5.1 with Gradle 4.0. #8154, which was fixed in Spring Boot 1.5.2, replaced the usage of a Gradle API that was deprecated in 3.3 and removed in 4.0.

@gigenthomas
Copy link

I am running into the same issue after upgrading to Gradle 4 , with spring-boot 1.5.4

@wilkinsona
Copy link
Member

@gigenthomas If that is the case, please open a new issue with a sample project that reproduces the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

5 participants