spring用gradle导入eclipse时异常导致失败

来源:互联网 发布:条形码扫描软件 编辑:程序博客网 时间:2024/04/28 18:19

一、出现的异常

FAILURE: Build failed with an exception.



* What went wrong:
Execution failed for task ':spring-webmvc-tiles3:eclipseClasspath'.
> Could not resolve all dependencies for configuration 'detachedConfiguration2'.


   > Module version org.springframework:spring-webmvc-tiles3:4.0.0.M3, configura
tion 'detachedConfiguration2' declares a dependency on configuration 'runtimeMer
ge' which is not declared in the module descriptor for org.springframework:sprin
g-web:4.0.0.M3


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.


BUILD FAILED

二、解决办法

1、在spring主目录下找到build.gradle文件,用ultraEdit打开;

2、找到project("spring-webmvc-tiles3"),并在结尾处添加如下部分并保存。

eclipseClasspath {
        downloadSources = false; // required for eclipseClasspath to work
}

3、在cmd命令行中,重新运行命令gradle eclipse -x:eclipse.

0 0
原创粉丝点击