You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Sharma, Jaikumar" <ja...@barco.com> on 2006/05/03 08:31:08 UTC

Artifacts reference in Maven2

Dear Maven Users,
 
Can I use third party libraries (required by build process to compile / test
sources etc.) which are located in application installed location in the
filesystem without installing them into local repository ? 
 
As far as Maven documentation is concerned it describes two ways : One by
installing the artifact into local repository and other by specifying the
<scopy>system</scope> and <systemPath><path of libs></systemPath> in the
<dependency> </dependency> section (use of this is discouraged as mentioned
by Maven docs).
http://maven.apache.org/ref/current/maven-model/maven.html
<http://maven.apache.org/ref/current/maven-model/maven.html> 
 
I want most of the artifacts to be referred by the build process at their
original location and not by moving everything to repository.
 
Is there a third way exists in maven 2 to refer the artifacts in the build
process ? Might be the case that I have not come across to that so far.
 
Thanks for your help!
 
Regards, Jaikumar
- - - - - - - DISCLAIMER- - - - - - - -
Unless indicated otherwise, the information contained in this message is
privileged and confidential, and is intended only for the use of the
addressee(s) named above and others who have been specifically authorized to
receive it. If you are not the intended recipient, you are hereby notified
that any dissemination, distribution or copying of this message and/or
attachments is strictly prohibited. The company accepts no liability for any
damage caused by any virus transmitted by this email. Furthermore, the
company does not warrant a proper and complete transmission of this
information, nor does it accept liability for any delays. If you have
received this message in error, please contact the sender and delete the
message. Thank you.

Re: Artifacts reference in Maven2

Posted by "Henry S. Isidro" <hi...@exist.com>.
On Wednesday 03 May 2006 2:45 pm, Simon Kitching wrote:
> On Wed, 2006-05-03 at 08:31 +0200, Sharma, Jaikumar wrote:
> > Dear Maven Users,
> >
> > Can I use third party libraries (required by build process to compile /
> > test sources etc.) which are located in application installed location in
> > the filesystem without installing them into local repository ?
> >
> > As far as Maven documentation is concerned it describes two ways : One by
> > installing the artifact into local repository and other by specifying the
> > <scopy>system</scope> and <systemPath><path of libs></systemPath> in the
> > <dependency> </dependency> section (use of this is discouraged as
> > mentioned by Maven docs).
> > http://maven.apache.org/ref/current/maven-model/maven.html
> > <http://maven.apache.org/ref/current/maven-model/maven.html>
> >
> > I want most of the artifacts to be referred by the build process at their
> > original location and not by moving everything to repository.
> >
> > Is there a third way exists in maven 2 to refer the artifacts in the
> > build process ? Might be the case that I have not come across to that so
> > far.
>
> The third option is to set up your own repository. This is very easy to
> do; configure an http server which serves files from a directory with a
> standard maven repository layout. Uploading files to such a system is
> probably easiest by network-mounting the directory the http server is
> serving files from. This tree can even be handily initialised by copying
> your local repository dir (just remove any metadata files). Once your
> repo is set up, just define it in the pom.
>
> I gues a custom plugin could be written to add jars from other sources,
> but I'm not aware of any existing plugin that does this, probably
> because the built-in maven options are fine.
>
> There are no other options I'm aware of. Maven doesn't support just
> pointing at arbitrary directories full of jars; it's considered bad
> practice as dependency info can't be properly managed. If dependency
> management isn't needed, then perhaps Ant is the best tool to use.
>
> Regards,
>
> Simon
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

One of maven's strengths is dependency management. In order to properly manage 
dependencies, these artifacts must be in a repository. Any reason why you 
don't want these in your local repository?

- Henry

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Artifacts reference in Maven2

Posted by Simon Kitching <sk...@apache.org>.
On Wed, 2006-05-03 at 08:31 +0200, Sharma, Jaikumar wrote:
> Dear Maven Users,
>  
> Can I use third party libraries (required by build process to compile / test
> sources etc.) which are located in application installed location in the
> filesystem without installing them into local repository ? 
>  
> As far as Maven documentation is concerned it describes two ways : One by
> installing the artifact into local repository and other by specifying the
> <scopy>system</scope> and <systemPath><path of libs></systemPath> in the
> <dependency> </dependency> section (use of this is discouraged as mentioned
> by Maven docs).
> http://maven.apache.org/ref/current/maven-model/maven.html
> <http://maven.apache.org/ref/current/maven-model/maven.html> 
>  
> I want most of the artifacts to be referred by the build process at their
> original location and not by moving everything to repository.
>  
> Is there a third way exists in maven 2 to refer the artifacts in the build
> process ? Might be the case that I have not come across to that so far.
>  

The third option is to set up your own repository. This is very easy to
do; configure an http server which serves files from a directory with a
standard maven repository layout. Uploading files to such a system is
probably easiest by network-mounting the directory the http server is
serving files from. This tree can even be handily initialised by copying
your local repository dir (just remove any metadata files). Once your
repo is set up, just define it in the pom.

I gues a custom plugin could be written to add jars from other sources,
but I'm not aware of any existing plugin that does this, probably
because the built-in maven options are fine.

There are no other options I'm aware of. Maven doesn't support just
pointing at arbitrary directories full of jars; it's considered bad
practice as dependency info can't be properly managed. If dependency
management isn't needed, then perhaps Ant is the best tool to use.

Regards,

Simon



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org