【问题标题】:Module Dependency in Intellij- not able to reference Classes from other ProjectsIntellij 中的模块依赖性 - 无法引用其他项目中的类
【发布时间】:2019-08-25 08:48:50
【问题描述】:

我需要在项目 B 中使用项目 A 中的 java 类。我相信我编写了包并成功导入,但在编译 (./gradlew clean build) 时仍然收到一条消息:

java:3: `error: package x.x.x.x.x.common.api.filter does not exist`

接下来,我尝试在IntelliJ 中创建模块依赖项,方法是将新包作为模块导入并重写包和导入语句以反映导入的包(模块依赖项),但我仍然看到相同的错误。

java:3: error: package x.x.x.x.x.common.api.filter does not exist

这会是build.gradle 文件的问题吗?还是我设置模块依赖项? 我该如何解决?

【问题讨论】:

    标签: spring gradle intellij-idea module dependencies


    【解决方案1】:

    问题出在build.gradle配置上,与IDE无关。

    您应该按照Gradle documentation 中的描述定义项目之间的依赖关系。

    另一个可能的解决方案是Composite Builds

    【讨论】:

      猜你喜欢
      • 2013-09-20
      • 2016-05-29
      • 1970-01-01
      • 1970-01-01
      • 2011-02-18
      • 2013-04-17
      • 1970-01-01
      • 2014-05-05
      • 2019-02-18
      相关资源
      最近更新 更多