Maven 实施
您好,我正在将我的 ant 项目实施到 Maven 中。 我有一个正在创建 EAR 文件的父项目。 1 个 Web 项目、1 个服务和 1 个架构项目。 我有带有 .EAR 扩展名的共享库。 在共享库中,我们有一些在所有项目中使用的通用依赖项。 假设我想构建以下项目
<groupId>Services1</groupId>
<artifactId>Services1</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
然后我需要共享库中的一些类,比如 Shared-util.ear。 我正在尝试包括 **
<groupId>iservices</groupId>
<artifactId>shared-utils</artifactId>
<version>1.0</version>
<type>ear</type>
** 但 Maven 并不把这只耳朵当作依赖。但是当我提取这只耳朵并从那里获取特定的 jar 文件时
**
<dependency>
<groupId>iservices</groupId>
<artifactId>commom-service</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>**
它工作正常。那么,maven 有什么方法可以从 EAR 读取类吗? 我知道这是一个有点复杂的问题,但我正在努力找到解决方案。
Hi I am implementing on of my ant project into maven.
I have one parent project which is creating a EAR file.
one web project and 1 service and 1 schema project.
I have shared libraries with .EAR extension.
In shared libraries we have some common dependencies which is use in all projects.
so let's say i want to build following project
<groupId>Services1</groupId>
<artifactId>Services1</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
Then i need some classes from shared libraries let say Shared-util.ear.
I am trying to include
**
<groupId>iservices</groupId>
<artifactId>shared-utils</artifactId>
<version>1.0</version>
<type>ear</type>
**
but maven is not taking this ear as dependency. but when i extract this ear and get particular jar file from there
**
<dependency>
<groupId>iservices</groupId>
<artifactId>commom-service</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>**
It is working fine.So is there any way that maven read classes from EAR.
I know it is little bit complicated question but I am trying to get the solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
maven不会读取和使用wars和ears(可能包含jar)的依赖项。您的项目设置非常规。您可以查看在本地/镜像存储库中安装/部署构成您的ear的jar,然后将其用作正常的依赖项。
maven does not read and use dependencies from wars and ears (which may contain jars). Your project set up is unconventional. You could look at installing/deploying the jars which make up your ear in local/mirrored repository and then use it as a normal dependency.