Why not put the jars in a repository?  A repository is perfect for
containing 3rd party jars, and one of maven's major benefits.  Once you do
that, you don't need to refer to the jars through a hardcoded path, but
simply by a portable artifact identifier.  You don't need any special tools
or repository managers, but you do need to setup your own remote repository
somehow.

I simply use mvn install:install-file, and then copy the generated files
from my local repository to a remote repository that I have created just for
3rd party libs.

I'm fairly new to maven, and this is one of the first things I had to do.
 The rest is just defining and managing repositories, which can be a
discussion of its own.  I'm not using any repository managers yet (learning
to live with maven is enough work for me right now).  My A-B-Cs of
repository management have been the following:

A)  At first I used only my local repository, which I shared with other
developers by putting it under version control in svn, just like I had my
3rd party libs before maven.   I used mvn -o most of the time, to avoid
accessing Maven's central repository.  I was a bit annoyed that I had to use
-o.  I tried to use the <offline> configuration in settings.xml, but I
couldn't get it to work (one of my first frustrations with maven).  mvn -o
worked reliably, but I had to remember to use it.  Whenever I needed a piece
of Maven that I didn't have, I used mvn without the -o flag, and once
everything worked, I added the new artifacts from my local repository to
svn.  I did not add my snapshots.

B)  I then figured out how to avoid the -o flag, by defining a mirror of the
central repository in my settings.xml.  The mirror was simply an
http-accessible location of the single svn-managed repository that I had.
 Whenever I needed to use a new piece of maven, I commented out the mirror
specifiction in my settings.xml, ran mvn so it could get new pieces from
repo1.maven.org, and then took the comment out of settings.xml.  The rest
was as in A.

C)  I now use two repositories:
1)  A repository of non-maven released artifacts.  Essentially this contains
3rd party libraries.  These are libraries that I've gotten directly from
their source, and which I've entered in the repository through
install:install-file.  I plan to also put my own released artifacts there.

2)  A central-mirror repository that has just the things that maven needs
(plugins and their dependencies).  This is the most difficult repository to
manage, and a source of problems, as I find maven's dependencies chaotic and
unstable.  This is why I've isolated them from my other artifacts.

D)  I plan to also use a snapshots repository that is automatically updated
with my daily build artifacts.  In fact, I may simply provide http access to
the daily build's local repository.
For now, I rebuild all of my artifacts locally.

Alex

On Fri, Nov 28, 2008 at 10:38 PM, <[EMAIL PROTECTED]> wrote:

> Hi,
>
> Is there any way to get the maven build process to include a set of jars
> when compiling/packaging that are not in the repository?  I have some
> vendor jars and I don't fancy packing them all up and placing them into
> the repository - I just want to point maven at a lib directory?
>
> Thanks,
>
>
> john
> _______________________________________________
>
> This e-mail may contain information that is confidential, privileged or
> otherwise protected from disclosure. If you are not an intended recipient of
> this e-mail, do not duplicate or redistribute it by any means. Please delete
> it and any attachments and notify the sender that you have received it in
> error. Unless specifically indicated, this e-mail is not an offer to buy or
> sell or a solicitation to buy or sell any securities, investment products or
> other financial product or service, an official confirmation of any
> transaction, or an official statement of Barclays. Any views or opinions
> presented are solely those of the author and do not necessarily represent
> those of Barclays. This e-mail is subject to terms available at the
> following link: www.barcap.com/emaildisclaimer. By messaging with Barclays
> you consent to the foregoing.  Barclays Capital is the investment banking
> division of Barclays Bank PLC, a company registered in England (number
> 1026167) with its registered office at 1 Churchill Place, London, E14 5HP.
>  This email may relate to or be sent from other members of the Barclays
> Group.
> _______________________________________________
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to