Maven - System Jar provoded by Websphere Library
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.
For j2ee.jar
, you have two options. One is to install the jar to your local repository using mvn install:install-file
. The other is to specify it as a system dependency.
As for castor-core
, you can add the classifier
tag
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor</artifactId>
<version>1.3.1</version>
<classifier>core</classifier>
</dependency>
精彩评论