Smrita
Smrita

Reputation: 1279

gradle project's build fails

I have a java EE project. I am using gradle as a build tool. My build.gradle file looks as follows:

apply plugin:'war'
apply plugin:'eclipse'

buildscript {
  repositories {   
   mavenCentral()   
   jcenter()
  }
  dependencies {
    classpath "com.eriwen:gradle-js-plugin:1.12.1"
  }
}

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


minifyJs {
    source = file("src/main/webapp/js/App.js")
    dest = file("build/all-min.js")
    closure {
        warningLevel = 'QUIET'
    }
}

war.doFirst {
tasks.minifyJs.execute()
}

war.webInf {
from "build/all-min.js"
into "/js/"
}

dependencies{

    compile 'org.springframework:spring-context:4.1.4.RELEASE' 
    compile 'org.springframework:spring-core:4.1.4.RELEASE' 
    compile 'org.springframework:spring-web:4.1.4.RELEASE' 
    compile 'org.springframework:spring-webmvc:4.1.4.RELEASE'
    compile 'org.springframework:spring-jdbc:4.1.4.RELEASE'
    compile 'org.springframework:spring-tx:4.1.4.RELEASE'
    compile 'org.google.code.gson:gson:2.3.1+'
    compile 'log4j:log4j:1.2.17+'
    compile 'org.slf4j:jcl-over-slf4j:1.5.8+'
    compile 'org.slf4j:slf4j-api:1.5.8+'
    compile 'org.slf4j:slf4j-log4j12:1.5.8+'
    compile 'org.apache.commons:commons-dbcp2:2.0.1+'
    compile 'org.mybatis:mybatis-spring:1.2.2+'
    compile 'org.mybatis:mybatis:3.2.8+'
    compile 'com.oracle:ojdbc14:10.2.0.4.0+'
    compile 'commons-fileupload:commons-fileupload:1.2.1+'
    compile 'commons-io:commons-io:2.4+'
    compile 'junit:junit:4.11'
    compile 'javax.servlet:servlet-api:2.5'
}

However when I try to execute gradle build I get the following error

couldnot resolve all dependencies required for configuration for all the dependencies that I have mentioned in my build.gradle file. I think I have correctly mentioned the repositories . I cant figure out why my build is failing. Any suggestion would be appreciated.

Upvotes: 0

Views: 639

Answers (1)

Mark Vieira
Mark Vieira

Reputation: 13476

You need to add a repositories {...} configuration block to your build script. The one declared inside the buildscript {...} block is only used for resolving dependencies of the build script itself (in this case, the javascript plugin), but it is not used for resolving project dependencies.

Upvotes: 1

Related Questions