[英]gradle project's build fails
I have a java EE project. 我有一个Java EE项目。 I am using gradle as a build tool. 我正在使用gradle作为构建工具。 My build.gradle file looks as follows: 我的build.gradle文件如下所示:
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 但是,当我尝试执行gradle build时,出现以下错误
couldnot resolve all dependencies required for configuration
for all the dependencies that I have mentioned in my build.gradle file. couldnot resolve all dependencies required for configuration
我在build.gradle文件中提到的couldnot resolve all dependencies required for configuration
所需的所有依赖项。 I think I have correctly mentioned the repositories . 我认为我已经正确提到了存储库。 I cant figure out why my build is failing. 我不知道为什么我的构建失败了。 Any suggestion would be appreciated. 任何建议,将不胜感激。
You need to add a repositories {...}
configuration block to your build script. 您需要在构建脚本中添加repositories {...}
配置块。 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. 在buildscript {...}
块中声明的一个仅用于解决构建脚本本身的依赖关系(在本例中为javascript插件),但不用于解决项目依赖关系。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.