I am using specific jar library, provided via Maven vendor-specific repository. There is only jar file in the repository, i.e. no sources and no javadocs.
But I know, that sources are available online, in SVN repository. Can I tell Maven to download sources of specific JAR from specific SVN location and may be from specific revision number?
No you can't tell maven to download sources from a SVN repository. Maven expects all kinds of artifacts within the appropriate Maven repository.
What you can do is to tell Maven in which Repository to look for the libraries including the resources.
If the sources are not available in a Maven repostory format, you can tell your IDE (e.g. Eclipse) to link them directly from a location on your hard disk.
Jars are not stored in SVN repositories, they're stored in artifact repositories when working with Maven. Keeping binary artifacts (such as jar files) under version control is considered bad practice.
If you would like to check if a certain artifact produces a sources or javadoc artifact which is available via Maven Central, then you can check in:
http://search.maven.org/
http://www.jarvana.com/
http://findjar.com/
If you have your own Maven repository (such as Nexus, Artifactory), etc, you can use it as well.
If I understand you correctly, your problem is that the sources for these artifacts are not being displayed in your IDE. If this is the case and you are sure they produce source/javadoc artifacts, then you can set up your IDE to resolve these dependencies.
If you're using Eclipse, you will need something along the lines of:
<project ...>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
</plugins>
</build>
</project>
In the pom.xml file you have to set the dependencies, for example:
<dependency>
<groupId> junit </ groupId>
<artifactId> junit </ artifactId>
<scope> test </ scope>
<version> 4.10 </ version>
</ dependency>
I think you can not see it for revisions, look for the libraries including the resources and dependencies of pom.xml.
Related
In Maven's assembly guide (https://maven.apache.org/guides/mini/guide-assemblies.html), it is stated:
You'll notice that the assembly descriptor is located in
${project.basedir}/src/assembly which is the standard location for
assembly descriptors.
But in the maven assembly plugin page (https://maven.apache.org/plugins/maven-assembly-plugin/examples/sharing-descriptors.html) it says:
Note: Your assembly descriptors must be in the directory
/src/main/resources/assemblies to be available to the Assembly Plugin.
Are them 2 different things? Is any of them outdated?
It is the difference between using assemblies and making them available to other projects.
The idea of putting assembly descriptors in src/main/resources/assemblies is to make them available to other modules or projects. You create a project, say my-assembly-descriptor, with one or more assembly descriptors in src/main/resources/assemblies. Then in a different project that you want to use the descriptor in you configure the assembly plugin to use my-assembly-descriptor as a dependency.
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<dependencies>
<dependency>
<groupId>your.group.id</groupId>
<artifactId>my-assembly-descriptor</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<executions>
...
</executions>
</plugin>
The assembly plugin finds your descriptors on its classpath and can use them.
The assembly descriptors placed in src/assembly can be used to assemble artifacts but the can't be reused in other modules or projects.
My hope was that it would be easy to get Maven to run our application on any machine by simply deploying the pom.xml and using the maven exec goal.
The main class to run is inside the jar which is produced from the same pom.xml. But it seems that, while Maven quite nicely includes all the dependencies on the classpath, the pom's jar does not get included, or else it cannot be resolved from the repository where maven deployed it (which is an internal not public repository).
The steps I followed:
run mvn deploy -- this deploys our jar on an internal maven repository
install maven on the target machine (not the same as the build machine)
deploy the pom.xml to the target machine.
try to run using mvn exec:java ... or mvn exec:exec ...
What I see is that Maven pulls all the dependency jars onto the classpath correctly, but does not pull in the jar described by the pom.xml.
I tried various configuration options in the pom.xml, but nothing seemed to work. First, tried to configure exec:java as shown in this answer, but Maven did not search the internal repository for that jar. (It did seem to check the public maven repositories though).
Second, I tried to switch to the exec:exec version and configure like this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<configuration>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath/>
<argument>com.ezxinc.tfix.TFix</argument>
</arguments>
</configuration>
<dependencies>
<dependency>
<groupId>ezxinc</groupId>
<artifactId>tfix</artifactId>
<version>0.0.3-SNAPSHOT</version>
<type>jar</type>
</dependency>
</dependencies>
</plugin>
The dependency shown there is the information for the jar which the pom.xml deployed into our internal repository.
Of course, everything works fine if I unjar the class files into target subdirectory beneath the one where the pom.xml is.
If it helps, the full pom.xml can viewed here.
I think you'll need to have a different pom.xml file rather than trying to use the same pom from the project being built in step 1 of your description. This separate pom file could then include the project in question as a dependency so that it will get downloaded and included in the classpath when running maven commands.
The problem is that maven assumes that the project being described by a pom file is going to be compiled form source rather than downloaded from a repository. Anything you want downloaded from a repository needs to be a dependency, and if you try to include the current project as a dependency of itself you end up with a problem where the project could never be built the first time since it hasn't already been built and deployed to the repository yet.
I have 2 Maven web projects A and B. B contains some common parts and A depends on B.
In A's pom.xml I have:
<dependencies>
<dependency>
<groupId>com.mygroup</groupId>
<artifactId>B</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
</plugin>
</plugins>
</build>
I have 2 problems:
When making some changes in B, if I run a maven build on A I don't see the changes in the resulting exploded archive.
Trying to deploy A from Eclipse does not work - the contents of B are not included in the resulting war/exploded archive.
Thanks for your help.
Well, if you changes stuff in B, you have to re-install it into your local maven repo (mvn install) for other local projects that have it as dependency to receive the latest modifications.
When building a maven project it's best if you build it using Maven (like with commands such as mvn package) and not using some other building tool (such as Eclipse). If you wanna build it a la Maven but from the comfort of your Eclipse GUI, you can istall m2_eclipse plugin from :
http://m2eclipse.sonatype.org/installing-m2eclipse.html
which integrates Maven with Eclipse. Then, when you rigth click on your project in Eclipse, under the "Run..." options you'll have the one that allows your to Maven build it, redirecting all console output to the Eclipse console window.
And as a final note, in a setup such as the one aboce, ideally you'd create a parent Maven project (packaged as "pom") which has as child projects B and A (in that order). This way if you've modified stuff in both projects and you want everything to be build with the latest modifs, you can just do a maven install on the parent pom and Maven will take care of everything.
Amplifying #AndreiBodnarescu's point, you may not be seeing the changes you made to project-B when you build project-A because the changes aren't available in the Maven repository.
If project-B is being built on the same machine can you ensure that you used mvn install to install to your local repository? If project-B is being derived from a build on a different machine then use mvn deploy to deploy project-B to a common shared repository. In this case you may still not pick up project-B if you aren't using SNAPSHOTted versioning or you don't increment project-B's version number.
I see that B is of type war. What is the packaging of A? Is it an EAR? If so using the maven-war-plugin with project-A is not going to be of help.
It's my first couple of days learning Maven and I'm still struggling with the basics. I have an external .jar file (not available in the public repos) that I need to reference in my project and I'm trying to figure out what my best option is.
It's a small scale project without a central repository for libraries, so it has to be either a local repository (somehow added to source control, don't know if it's supposed to work that way?) or the .jar needs to be stored on disk outside of any formal repository.
1) What's my best option for adding the .jar file to my project's references with maven given that I want both the project and the library to be in source control?
2) I still can't seem to have Eclipse see the dependency. I manually added it to the section of the pom, and it shows up fine in the Dependencies list in m2eclipse. mvn compile and mvn package both succeed, but running the program results in:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
LibraryStuff cannot be resolved to a type
This is after editing the POM as:
<dependency>
<groupId>stuff</groupId>
<artifactId>library</artifactId>
<version>1.0</version>
<systemPath>${lib.location}/MyLibrary.jar</systemPath>
<scope>system</scope>
</dependency>
Should I be executing mvn install:install-file even thought I already have the pom.xml edited as above?
Thanks!
You can create an In Project Repository, so you don't have to run mvn install:install-file every time you work on a new computer
<repository>
<id>in-project</id>
<name>In Project Repo</name>
<url>file://${project.basedir}/libs</url>
</repository>
<dependency>
<groupId>dropbox</groupId>
<artifactId>dropbox-sdk</artifactId>
<version>1.3.1</version>
</dependency>
/groupId/artifactId/version/artifactId-verion.jar
detail read this blog post
https://web.archive.org/web/20121026021311/charlie.cu.cc/2012/06/how-add-external-libraries-maven
I think you should use mvn install:install-file to populate your local repository with the library jars then you should change the scope from system to compile.
If you are starting with maven I suggest to use maven directly not IDE plugins as it adds an extra layer of complexity.
As for the error, do you put the required jars on your classpath? If you are using types from the library, you need to have access to it in the runtime as well. This has nothing to do with maven itself.
I don't understand why you want to put the library to source control - it is for sources code not binary jars.
This can be easily achieved by using the <scope> element nested inside <dependency> element.
For example:
<dependencies>
<dependency>
<groupId>ldapjdk</groupId>
<artifactId>ldapjdk</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\src\lib\ldapjdk.jar</systemPath>
</dependency>
</dependencies>
Reference: http://www.tutorialspoint.com/maven/maven_external_dependencies.htm
The Maven manual says to do this:
mvn install:install-file -Dfile=non-maven-proj.jar -DgroupId=some.group -DartifactId=non-maven-proj -Dversion=1 -Dpackaging=jar
update We have since just installed our own Nexus server, much easier and cleaner.
At our company we had some jars that we some jars that were common but were not hosted in any maven repositories, nor did we want to have them in local storage.
We created a very simple mvn (public) repo on Github (but you can host it on any server or locally):
note that this is only ideal for managing a few rarely chaning jar files
Create repo on GitHub:
https://github.com/<user_name>/mvn-repo/
Add Repository in pom.xml
(Make note that the full path raw file will be a bit different than the repo name)
<repository>
<id>project-common</id>
<name>Project Common</name>
<url>https://github.com/<user_name>/mvn-repo/raw/master/</url>
</repository>
Add dependency to host (Github or private server)
a. All you need to know is that files are stored in the pattern mentioned by #glitch
/groupId/artifactId/version/artifactId-version.jar
b. On your host create the folders to match this pattern.
i.e if you have a jar file named service-sdk-0.0.1.jar, create the folder service-sdk/service-sdk/0.0.1/ and place the jar file service-sdk-0.0.1.jar into it.
c. Test it by trying to download the jar from a browser (in our case: https://github.com/<user_name>/mvn-repo/raw/master/service-sdk/service-sdk/0.0.1/service-sdk-0.0.1.jar
Add dependency to your pom.xml file:
<dependency>
<groupId>service-sdk</groupId>
<artifactId>service-sdk</artifactId>
<version>0.0.1</version>
</dependency>
Enjoy
Don't use systemPath. Contrary to what people have said here, you can put an external jar in a folder under your checked-out project directory and haven Maven find it like other dependencies. Here are two crucial steps:
Use "mvn install:install-file" with -DlocalRepositoryPath.
Configure a repository to point to that path in your POM.
It is fairly straightforward and you can find a step-by-step example here:
http://randomizedsort.blogspot.com/2011/10/configuring-maven-to-use-local-library.html
If you meet the same problem and you are using spring-boot v1.4+, you can do it in this way.
There is an includeSystemScope that you can use to add system-scope dependencies to the jar.
e.g.
I'm using oracle driver into my project.
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.3.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/extra-jars/ojdbc14-10.2.0.3.0.jar</systemPath>
</dependency>
then make includeSystemScope=true to include the jar into path /BOOT-INF/lib/**
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
and exclude from resource to avoid duplicated include, the jar is fat enought~
<build>
<testSourceDirectory>src/test/java</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>**/*.jar</exclude>
</excludes>
</resource>
</resources>
</build>
Good luck!
Maven way to add non maven jars to maven project
Maven Project and non maven jars
Add the maven install plugins in your build section
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${version.maven-install-plugin}</version>
<executions>
<execution>
<id>install-external-non-maven1-jar</id>
<phase>clean</phase>
<configuration>
<repositoryLayout>default</repositoryLayout>
<groupId>jar1.group</groupId>
<artifactId>non-maven1</artifactId>
<version>${version.non-maven1}</version>
<file>${project.basedir}/libs/non-maven1.jar</file>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
<goals>
<goal>install-file</goal>
</goals>
</execution>
<execution>
<id>install-external-non-maven2-jar</id>
<phase>clean</phase>
<configuration>
<repositoryLayout>default</repositoryLayout>
<groupId>jar2.group</groupId>
<artifactId>non-maven2</artifactId>
<version>${version.non-maven2}</version>
<file>${project.basedir}/libs/non-maven2.jar</file>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
<goals>
<goal>install-file</goal>
</goals>
</execution>
<execution>
<id>install-external-non-maven3-jar</id>
<phase>clean</phase>
<configuration>
<repositoryLayout>default</repositoryLayout>
<groupId>jar3.group</groupId>
<artifactId>non-maven3</artifactId>
<version>${version.non-maven3}</version>
<file>${project.basedir}/libs/non-maven3.jar</file>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
<goals>
<goal>install-file</goal>
</goals>
</execution>
</executions>
</plugin>
Add the dependency
<dependencies>
<dependency>
<groupId>jar1.group</groupId>
<artifactId>non-maven1</artifactId>
<version>${version.non-maven1}</version>
</dependency>
<dependency>
<groupId>jar2.group</groupId>
<artifactId>non-maven2</artifactId>
<version>${version.non-maven2}</version>
</dependency>
<dependency>
<groupId>jar3.group</groupId>
<artifactId>non-maven3</artifactId>
<version>${version.non-maven3}</version>
</dependency>
</dependencies>
References Note I am the owner of the blog
Change your systemPath.
<dependency>
<groupId>stuff</groupId>
<artifactId>library</artifactId>
<version>1.0</version>
<systemPath>${project.basedir}/MyLibrary.jar</systemPath>
<scope>system</scope>
</dependency>
The pom.xml is going to look at your local repository to try and find the dependency that matches your artifact.
Also you shouldn't really be using the system scope or systemPath attributes, these are normally reserved for things that are in the JDK and not the JRE
See this question for how to install maven artifacts.
Note that all of the example that use
<repository>...</respository>
require outer
<repositories>...</repositories>
enclosing tags. It's not clear from some of the examples.
The best solution here is to install a repository: Nexus or Artifactory. If gives you a place to put things like this, and further it speeds things up by caching your stuff from the outside.
If the thing you are dealing with is open source, you might also consider putting in into central.
See the guide.
With Eclipse Oxygen you can do the below things:
Place your libraries in WEB-INF/lib
Project -> Configure Build Path -> Add Library -> Web App Library
Maven will take them when installing the project.
If the external jar is created by a Maven project only then you can copy the entire project on your system and run a
mvn install
in the project directory. This will add the jar into .m2 directory which is local maven repository.
Now you can add the
<dependency>
<groupId>copy-from-the=maven-pom-of-existing-project</groupId>
<artifactId>copy-from-the=maven-pom-of-existing-project</artifactId>
<version>copy-from-the=maven-pom-of-existing-project</version>
</dependency>
This will ensure that you
mvn exec:java
works. If you use suggested here
<scope>system</scope>
Then you will have to add classes individually while using executing through command line.
You can add the external jars by the following command described here
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
-DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
The most efficient and cleanest way I have found to deal with this problem is by using Github Packages
Create a simple empty public/private repository on GitHub as per your requirement whether you want your external jar to be publicly hosted or not.
Run below maven command to deploy you external jar in above created github repository
mvn deploy:deploy-file \
-DgroupId= your-group-id \
-DartifactId= your-artifact-id \
-Dversion= 1.0.0 -Dpackaging= jar -Dfile= path-to-file \
-DrepositoryId= id-to-map-on-server-section-of-settings.xml \
-Durl=https://maven.pkg.github.com/github-username/github-reponame-created-in-above-step
Above command will deploy you external jar in GitHub repository mentioned in -Durl=.
You can refer this link on How to deploy dependencies as GitHub Packages GitHub
Package Deployment Tutorial
After that you can add the dependency using groupId,artifactId and version mentioned in above step in maven pom.xml and run mvn install
Maven will fetch the dependency of external jar from GitHub Packages registry and provide in your maven project.
For this to work you will also need to configure you maven's settings.xml to fetch from GitHub Package registry.
I need to use a third-party JAR library in my project (actually it's Dresden OCL for Eclipse) that is not provided as a Maven artifact. Instead, it's just a downloadable JAR file. Can I instruct Maven to use this JAR file the same way I'm using <dependencies>? I suppose that there should be some plugin for this purpose?
ps. I just don't want to add 35Mb of third-party binaries into my SVN repository.
Would be nice to have it configured this way:
<build>
<plugins>
<plugin>
<groupId>com.example</groupId>
<artifactId>non-maven-dependencies-injector</artifactId>
<configuration>
<libraries>
<library>http://www.example.com/something*.jar</library>
<library>http://www.example.com/something-else*.jar</library>
</libraries>
</configuration>
</plugin>
<plugins>
</build>
And this plugin would 1) download these JAR files, and 2) add them as dependencies into pom.xml. Maybe this plugin could store them somewhere in ~/.m2/temp/...
yes you can install it into your local repository with maven-install plugin
mvn install:install-file -Dfile=your-artifact-1.0.jar \
-DgroupId=org.some.group \
-DartifactId=your-artifact \
-Dversion=1.0 \
-Dpackaging=jar \
-DgeneratePom=true
If you want your other team members to be able to download this dependency without having to install it them thelves, you need to setup your own artifact repo, and deploy the artifact there with maven-deploy-plugin in same way as you installed it localy.
Yes. This (using non-Mavenized dependencies) is supported by the maven-external-dependency-plugin.
Example:
<artifactItem>
<groupId>jwbroek.cuelib</groupId>
<artifactId>cuelib</artifactId>
<version>${cuelib-version}</version>
<packaging>jar</packaging>
<downloadUrl>http://cuelib.googlecode.com/files/cuelib-${cuelib-version}.jar</downloadUrl>
<checksum>d03b6b960b3b83a2a419e8b5f07b6ba4bd18387b</checksum>
</artifactItem>
It can also extract artifacts from zip files:
<artifactItem>
<groupId>mediautil</groupId>
<artifactId>mediautil</artifactId>
<version>${mediautil-version}</version>
<packaging>jar</packaging>
<install>true</install>
<force>false</force>
<downloadUrl>http://downloads.sourceforge.net/project/mediachest/MediaUtil/Version%201.0/mediautil-1.zip</downloadUrl>
<checksum>aa7ae51bb24a9268a8e57c6afe478c4293f84fda</checksum>
<extractFile>mediautil-${mediautil-version}/mediautil-${mediautil-version}.jar</extractFile>
<extractFileChecksum>e843cd55def75dce57123c79b7f36caca4841466</extractFileChecksum>
</artifactItem>
You can use "system"-scope in your pom.xml for local library dependencies:
system This scope is similar to
provided except that you have to
provide the JAR which contains it
explicitly. The artifact is always
available and is not looked up in a
repository.
systemPath
is used only if the the dependency scope is system. Otherwise, the build will fail if this element is set. The path must be absolute, so it is recommended to use a property to specify the machine-specific path (more on properties below), such as ${java.home}/lib. Since it is assumed that system scope dependencies are installed a priori, Maven will not check the repositories for the project, but instead checks to ensure that the file exists. If not, Maven will fail the build and suggest that you download and install it manually.
<dependency>
<groupId>some.id</groupId>
<artifactId>artifact</artifactId>
<version>1.2.3</version>
<scope>system</scope>
<systemPath>${basedir}/path/to/jarFile.jar</systemPath>
</dependency>
AFAIK, you can use pretty much what you want for groupId, artifactId and version. See Maven System Depencies and this question.
Taking that your example Dresden OCL has over 20 JAR files, and you need to distribute it to many developers, the best solution would be to install a repository manager somewhere (like nexus or artifactory), take your time to upload these 20 jars to that repository, and use them. Best bet would be to put them in a private groupId, so if they'll get published to a m2 repo sometime, you won't end up with name conflicts.
Another point, would be to ask the Dresden OCL Maintainers, if they can offer a m2 repository. Now that m2eclipse is an eclipse incubator project, this might interest more people.
You can install it local or deploy it to your site-local (e.g. company-wide) repository.
If you use a dependency maven cannot find in the configured repositories, it even gives you the required commands:
Then, install it using the command:
mvn install:install-file -DgroupId=mygid -DartifactId=myaid -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=mygid -DartifactId=myaid -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Please note: This way you only add the .jar to your repository, there will be no pom along with it to specify transient dependencies. So if your third-party library has dependencies of it's own you'll have to add them manually to your pom.xml as there will be no automatic resolution.
"mvn install:install-file" mentioned here will help you to install the jars into your local repository. However, if you want to make these jars subsequently available to the developers on the project automaticall, copy the relevant pieces to a repository available to everybody on the project and make this repository available using the tag, for example by checking all the files into the SVN. See http://code.google.com/p/codebistro/wiki/BuildNumber#Maven_Plugin_Example which refers to a SVN-hosted repository for example.
P.S. Have a safe trip to the SV!
Here's a different approach that'll let add a Maven repository inside the project directory, use that as a repository in you pom.xml, and share the repository on SVN with anyone checking out the project. Crosspost from here.
In your project directory, create a folder called repo, which we'll use as a folder based Maven repository.
Add the following file repository to your project pom.xml:
<repositories>
<repository>
<id>file.repo</id>
<url>file://${project.basedir}/repo</url>
</repository>
</repositories>
Deploy the external jar(s) to the file repository with the following command:
mvn deploy:deploy-file
-Durl=file:///absolute/path/to/your-project/repo \
-DrepositoryId=file.repo \
-Dfile=path-to-your.jar \
-DgroupId=some.external.project.group \
-DartifactId=the-artifact-name \
-Dversion=1.0 \
-Dpackaging=jar;
Following this you can just add a normal dependency on the jar in your project pom.xml, using the values for groupId, artifactId and version you passed above. You can then add the repo folder to SVN, and commit the changes to your pom.xml. Any developer checking out your project will now be able to use the same dependency without any effort.
I think the below answer will help you...just place jar files on your SVN and tell them all to e synch with SVN and here the ${lib.directory} will be t he local path
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>db2jcc9</id>
<phase>compile</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>com.ibm</groupId>
<artifactId>db2jcc</artifactId>
<version>9</version>
<packaging>jar</packaging>
<file>${lib.directory}\db2jcc-9.jar</file>
</configuration>
</execution>
</executions>
<plugin>