在 运行 应用程序的 intellij 2017.3 中添加到类路径外部库而不更改范围

Add to classpath external libraries in intellij 2017.3 on run application without changing scope

大家好,我在 IntelliJ IDEA 中遇到了问题。我有 运行 我的应用程序的配置。当我 运行 时,它在我的模块中添加了一些像依赖项一样的库,并用范围 "Provided" 定义,但没有添加到 classpath 中,并给我一个 class not found 异常。 如果我将范围从 "Provided" 更改为 "Compile" 它确实有效。

但我不确定它是否正确,因为在我的 pom.xml 中,它们配置了范围 "Provided",当我 运行 maven 配置时,依赖项更改为 "Provided" 在项目结构中,它不再起作用。

我的问题:

有没有办法在 运行 期间在 class 路径中包含一些依赖项而不更改 pom.xml 中的范围?

IntelliJ IDEA 2018.1 可以选择将具有提供范围的依赖项包含到类路径中,它可用于某些 run/debug 配置,例如 Application and Spring Boot.