Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle Build Error

Tags:

maven

gradle

My build failed due to this error:

A problem occurred evaluating project ':DBSupport'. > Could not find method providedCompile() for arguments [project ':Core:Platform '] on project ':DBSupport'.

Any idea what that means?

description = 'DBSupport main component of DBSupportTool'
dependencies {
providedCompile project(':Core:Platform')
providedCompile project(':Core:Verification')
providedCompile project(':DBSupportWeb')
providedCompile project(':DBSupportEJB')
  compile(group: 'commons-lang', name: 'commons-lang', version:'1.0.1') {
   /* This dependency was originally in the Maven provided scope, but the project was not of type war.
   This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.
   Please review and delete this closure when resolved. */
}
  compile(group: 'commons-logging', name: 'commons-logging', version:'1.0.4') {
   /* This dependency was originally in the Maven provided scope, but the project was not of type war.
   This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.
   Please review and delete this closure when resolved. */
}
  compile(group: 'javax', name: 'j2ee', version:'1.0') {
   /* This dependency was originally in the Maven provided scope, but the project was not of type war.
   This behavior is not yet supported by Gradle, so this dependency has been converted to a compile dependency.
   Please review and delete this closure when resolved. */
}
like image 631
user3150054 Avatar asked Feb 15 '23 01:02

user3150054


1 Answers

I assume these modules should in fact be treated as provided (e.g. should not be packages in a WAR archive). If not just change it to compile.

providedCompile configuration is not available in Gradle out of the box. If this is a web module you can just add/apply a war plugin:

apply plugin: 'war'

If not you should be able to add this configuration manually:

configurations {
    providedCompile
}

dependencies {
    providedCompile project(':Core:Platform')
    ...
}

sourceSets.main.compileClasspath += configurations.providedCompile
sourceSets.test.compileClasspath += configurations.providedCompile
sourceSets.test.runtimeClasspath += configurations.providedCompile

There is also a propdeps-plugin which claims to do the same thing transparently.

like image 146
Marcin Zajączkowski Avatar answered Feb 24 '23 18:02

Marcin Zajączkowski