关于这个问题,从插件访问配置 ResolutionStrategy
我现在很高兴为我的项目设置解决策略,并且构建工作正常。解析策略将接受默认版本并将其映射到库的实际版本,正确解析它。
但是,我无法生成想法或 Eclipse 项目,因为分离的配置无法解析默认版本。
有没有办法为分离配置设置解析策略?
* 编辑 *
当我使用应用的插件运行构建时得到的错误是:
:ideaProject FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ideaProject'.
> Could not resolve all dependencies for configuration 'detachedConfiguration4'.
> Module version group:xxx, module:mmm, version:trunk, configuration:detachedConfiguration4 declares a dependency on configuration 'default' which is not declared in the module descriptor for group:xxx, module:nnn, version:trunk
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
我假设因为我使用configurations.all 设置resolutionStrategy 并且这是一个分离的配置,所以resolutionStrategy 没有应用于分离的配置。