Hi Damon,

First thing. If the 3rd party jars are not available in repositories, there
is no other solution than installing them in your repository manually and
generate/create a POM for them. Nothing to do about that.
You don't install a 3rd party jar by creating a new maven project for them
and trying to build it, but by executing the following command for each of
the jars you want to install:

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
   -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=jar
-DgeneratePom=true


Next. The term "dependency management" has nothing to do with installing
dependencies in your repository.
It is used by a parent project to define default dependency details at a
top-level. This makes defining dependencies for its child projects (modules)
easier and helps to keep their dependency versions in line.

Finally. If you don't like to define a lot of recurring dependencies, there
is a nifty trick you could do:
- Create a project with packaging set to "pom". Add all recurring
dependencies as dependencies of this project.
- Install this project by executing "mvn install". Because the type of the
project is "pom", the pom file will be installed in your local repository.
- In other projects, depend on the previously installed project, and don't
forget to specify its type (pom).

Because of Maven2's transitive dependency resolution, the dependencies of
this project will be injected into the  projects that depend on it.

Cheers
Jo

On 5/30/07, Damon Rand <[EMAIL PROTECTED]> wrote:

Hi,

I've spent all afternoon working on this but am stuck.. I am building
several wars that all depend on the same set of 3rd party jar files. I
could write a batch file to install the jars to my local repos and
then copy and paste the list of dependencies into each war. But what I
really want is to be able to depend on a single mydependencies/pom.xml
project instead. I tried getting maven to install my jars using the
systemPath variable like this but it didn't work.

<project xmlns="http://maven.apache.org/POM/4.0.0";
        xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
        <parent>
                <groupId>com.xyz</groupId>
                <artifactId>abc-parent</artifactId>
                <version> 3.5.1-SNAPSHOT</version>
        </parent>
        <modelVersion>4.0.0</modelVersion>
        <artifactId>mydependencies</artifactId>
        <packaging>jar</packaging>
        <name>mydependencies</name>
        <build></build>
        <dependencies>
                <dependency>
                        <groupId>com.xyz</groupId>
                        <artifactId>abc</artifactId>
                        <version>3.5.1</version>
                        <scope>system</scope>
                        <systemPath>${basedir}/lib/abc.jar</systemPath>
                </dependency>
        </dependencies>
</project>

I've read all about dependencyManagement and installing 3rd party jars
but its just not clicking..


Regards,
Damon.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to