Maven - Websphere Library 提供的系统 Jar
我有两个关于依赖关系的问题:
Q1:我的 unix 机器上有一个 j2ee.jar (由 Websphere Library 提供)。这就是我在 ANT 中引用它的方式:
<path id="was.lib">
<fileset dir="${was.home}/lib">
<include name="**/j2ee.jar" />
</fileset>
</path>
<property name="was.lib" refid="was.lib" />
<path id="myProj.lib">
<!-- path to my project's JAR's -->
</path>
<property name="myProj.lib" refid="myProj.lib" />
<path id="myProj.classpath">
<path refid="myProj.lib" />
<path refid="was.lib" />
</path>
我不确定,如何在 Maven 中定义此依赖项,以便它引用系统路径?
Q2:我的项目中有一个 jar castor-1.3.1.jar 和 castor-1.3.1-core.jar 。当我为两者定义依赖关系时,Maven 只选择一个,因为只是版本不同。但我希望他们两个都被包括在内。 这就是我对它们的定义:
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor</artifactId>
<version>1.3.1-core</version>
</dependency>
请帮助我解决同样的问题。
I have two questions regarding dependencies:
Q1: I have a j2ee.jar on my unix box (provided by Websphere Library). This is how I refer it in ANT:
<path id="was.lib">
<fileset dir="${was.home}/lib">
<include name="**/j2ee.jar" />
</fileset>
</path>
<property name="was.lib" refid="was.lib" />
<path id="myProj.lib">
<!-- path to my project's JAR's -->
</path>
<property name="myProj.lib" refid="myProj.lib" />
<path id="myProj.classpath">
<path refid="myProj.lib" />
<path refid="was.lib" />
</path>
I am not sure, how to define this dependency in Maven so that it refers to the system path?
Q2: I have a jar castor-1.3.1.jar and castor-1.3.1-core.jar in my project. When I define the dependency for both of them, Maven only picks one, since only the version is different. But I want both of them to be included.
This is how I have defined them:
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor</artifactId>
<version>1.3.1-core</version>
</dependency>
Please help me regarding the same.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于
j2ee.jar
,您有两个选择。一种是使用mvn install:install-file
将 jar 安装到本地存储库。另一种是将其指定为 系统依赖性。对于
castor-core
,您可以添加classifier
标签For
j2ee.jar
, you have two options. One is to install the jar to your local repository usingmvn install:install-file
. The other is to specify it as a system dependency.As for
castor-core
, you can add theclassifier
tag