【问题标题】:maven dependency not visible for importingmaven 依赖项对于导入不可见
【发布时间】:2020-11-28 07:01:06
【问题描述】:

我有一个多模块项目,在其中一个模块中我包含依赖项,有些是可见的,而另一些则不是;尝试更好地解释:

我在父 pom 中有这个模块:

    <modules>
        <module>DataModelIbm</module>
        <module>commonResources</module>
        <module>wsdlClient</module>
        <module>utente</module>
  </modules>

在模块 utente 的 pom 中我有:

  <dependency>
        <groupId>dc.ita.int.gu</groupId>
        <artifactId>DataModelIbm</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>dc.ita.int.gu</groupId>
        <artifactId>commonResources</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>dc.ita.int.gu.wes</groupId>
        <artifactId>wsdlClient</artifactId>
        <version>0.0.1-SNAPSHOT</version>
     </dependency>

在Utenti的项目中,我导入:

来自模块 DataModelIbm

import dc.ita.int.gu.database.model.GuUserCon;
import dc.ita.int.gu.database.model.GuUserNon;

来自commonResources:

import dc.ita.int.gu.errorhandler.ErrDetails;

来自 wsdlClient

import dc.ita.int.gu.wes.websso.wsdl.CreateUserResponse;
import dc.ita.int.gu.wes.websso.wsdl.GetUser;

但是当我尝试编译时,只有从 wsdlClient 导入的类有错误;

可能是什么原因,是maven bug???

【问题讨论】:

    标签: java maven dependencies multi-module


    【解决方案1】:

    我认为这是用于构建模块的顺序的问题

    Build order of Maven multimodule project? 项目

    【讨论】:

      【解决方案2】:

      不,这听起来不像是 Maven 错误。作为起点,在utente 模块中打开一个命令shell 并运行mvn dependency:tree 来检查您的依赖关系,以确保您正确地导入了wsdlClient 模块。此外,由于与 wsdl 相关的代码通常是自动生成的,因此请检查源代码以确保与类可见性表达式、包等有关的一切都是正确的。在没有看到错误消息的情况下,不幸的是,通过此检查表可以得到最大的帮助.

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-08-30
        • 2014-10-12
        • 2012-03-07
        • 1970-01-01
        • 2016-07-20
        • 1970-01-01
        • 2021-02-20
        相关资源
        最近更新 更多