英文:
maven dependency not visible for importing
问题
在我的多模块项目中,其中一个模块中包含了依赖项,有些是可见的,而其他一些则不可见。我尝试更好地解释:
在父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的问题吗?
英文:
i have a multimodule project and in one of this module I include dependency, some are visibile the other not; try to explain better:
i have this module in parent pom:
<modules>
<module>DataModelIbm</module>
<module>commonResources</module>
<module>wsdlClient</module>
<module>utente</module>
</modules>
in the pom of the module utente I have:
<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>
In the project of Utenti, I import:
from module DataModelIbm
import dc.ita.int.gu.database.model.GuUserCon;
import dc.ita.int.gu.database.model.GuUserNon;
from commonResources:
import dc.ita.int.gu.errorhandler.ErrDetails;
from wsdlClient
import dc.ita.int.gu.wes.websso.wsdl.CreateUserResponse;
import dc.ita.int.gu.wes.websso.wsdl.GetUser;
But when I try to compile there is error only on the class imported from wsdlClient;
What can be the reason, is maven bug???
答案1
得分: 1
我认为这是构建模块时使用的顺序的问题。
链接:https://stackoverflow.com/questions/11131575/build-order-of-maven-multimodule-project
英文:
I think it is an issue with the order used to build the modules
https://stackoverflow.com/questions/11131575/build-order-of-maven-multimodule-
project
答案2
得分: 1
不,这听起来不像是Maven的bug。作为一个起点,在utente
模块中打开一个命令shell,并运行mvn dependency:tree
来检查您的依赖项,确保您正确导入了wsdlClient
模块。另外,由于与wsdl相关的代码通常是自动生成的,请检查源代码,确保类的可见性表达式、包等方面都正确无误。很不幸,没有看到错误消息,通过这个清单进行检查是可以提供的最有帮助的。
英文:
No, it doesn't sound like a Maven bug. As a starting point, open a command shell in the utente
module and run mvn dependency:tree
to check your dependencies to make sure that you are importing the wsdlClient
module properly. Also, since wsdl-related code is often autogenerated, check the source code to make sure that everything is proper with class visibility expressions, packages, etc. Without seeing the error message, going through this checklist is the most help that can be given unfortunately.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论