You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Maarten Volders <ma...@sherpa-consulting.be> on 2007/06/01 15:10:24 UTC

How-to use a lib directory instead of the repository

All,

I have a lot of libs which are not in the repository (central) each of them
depending on a whole bunch of other libs, and manually putting them in the
internal repository is really a lot of work, type-work :-) because all the
dependencies have to be declared manually. So instead I want to make use of
a lib directory instead of retrieving all my jar from the repository.

How can this be accomplished with Maven?

Grtz

RE : How-to use a lib directory instead of the repository

Posted by "Deneux, Christophe" <ch...@capgemini.com>.
Hi,
 
To do that, you must use a private repository. A private repository has the same directory tree than your local repository ($HOME/.me/repository), and is located in your project. It is declared in your pom into the section <repositories> and/or <pluginRepositories>. Its URL is a file based URL.
Moreover, in a multomodule project you will define the property "topDirectoryLocation"
 
Example:
  <repository>
   <id>private</id>
   <name>Private Repository</name>
   <url>
    file:${basedir}/${topDirectoryLocation}/etc/maven/private-repository
   </url>
   <releases>
    <enabled>true</enabled>
   </releases>
   <snapshots>
    <enabled>false</enabled>
   </snapshots>
  </repository>
_______________________________________________________________________________
Christophe DENEUX / Capgemini Sud / Méditerranée
Technical Leader
Tel: + 33 4 93 95 55 92 / www.capgemini.com <http://www.capgemini.com/> 
Porte de l'Arénas - Entrée B / 455 Promenade des Anglais / 06200 Nice / FRANCE
Join the Collaborative Business Experience
_______________________________________________________________________________
Please consider the environment and do not print this email unless absolutely necessary. Capgemini encourages environmental awareness.

________________________________

De: Maarten Volders [mailto:maarten@sherpa-consulting.be]
Date: ven. 01/06/2007 15:10
À: users@maven.apache.org
Objet : How-to use a lib directory instead of the repository



All,

I have a lot of libs which are not in the repository (central) each of them
depending on a whole bunch of other libs, and manually putting them in the
internal repository is really a lot of work, type-work :-) because all the
dependencies have to be declared manually. So instead I want to make use of
a lib directory instead of retrieving all my jar from the repository.

How can this be accomplished with Maven?

Grtz




This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.

Re: How-to use a lib directory instead of the repository

Posted by Stefano Bagnara <ap...@bago.org>.
What I do is to setup a remote repository using the "file:" protocol and
${basedir} to point to a nested folder:

<repository>
 <id>local-mime4j-stage-repository</id>
 <name>Local mime4j stage repository</name>
 <!-- Please note that due to http://jira.codehaus.org/browse/MNG-2896 -->
 <!-- If you don't have james-project checked out in ../james-project -->
 <!-- you will have to place your absolute path to the project instead -->
 <!-- of ${basedir}, or, otherwise, manually install the parent poms -->
 <!--
   mvn -fignorepom.xml install:install-file
      -Dfile=stage\org.apache.james\poms\james-parent-1.1.pom
      -Dpackaging=pom
      -DgroupId=org.apache.james
      -DartifactId=james-parent
      -Dversion=1.1
   mvn -fignorepom.xml install:install-file
      -Dfile=stage\org.apache.james\poms\james-project-1.1.pom
      -Dpackaging=pom
      -DgroupId=org.apache.james
      -DartifactId=james-project
      -Dversion=1.1
 -->
 <url>file://${basedir}/stage</url>
 <layout>legacy</layout>
 <snapshots>
  <enabled>true</enabled>
  <checksumPolicy>ignore</checksumPolicy>
 </snapshots>
 <releases>
  <enabled>true</enabled>
  <checksumPolicy>ignore</checksumPolicy>
 </releases>
</repository>

Then I place my jars/poms in stage/groupId/jars/artifactId-version.jar
and stage/groupId/poms/artifactId-version.pom and so on.

This does not work correctly in multi module builds, but it fixed my
needs ATM.

HTH,
Stefano

Maarten Volders ha scritto:
> All,
> 
> I have a lot of libs which are not in the repository (central) each of them
> depending on a whole bunch of other libs, and manually putting them in the
> internal repository is really a lot of work, type-work :-) because all the
> dependencies have to be declared manually. So instead I want to make use of
> a lib directory instead of retrieving all my jar from the repository.
> 
> How can this be accomplished with Maven?
> 
> Grtz
> 



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


Re: How-to use a lib directory instead of the repository

Posted by Jeff Jensen <jj...@apache.org>.
To not have them in the repo, you could look at 
<dependency> <scope> of system, and set <systemPath>.

You will still have to declare each dependency.  It is a 
Maven tenet to declare all dependencies.

If your situation allows sharing the dep list across 
projects, a parent pom could contain some/all of the deps. 
 This would ease the pain of dupe deps across components.


On Fri, 1 Jun 2007 08:27:23 -0500
  "Wayne Fay" <wa...@gmail.com> wrote:
> If its really that much work, you could merge all your 
>jars into a
> single huge jar, then you only have one jar to install 
>and one
> dependency to add to your pom.xml files.
> 
> But more seriously, Maven does not have the ability to 
>utilize jars in
> lib folders. The only way it gets dependencies is via 
>the <dependency>
> node in the pom.xml file, which requires that your 
>artifacts be
> installed in a Maven repository.
> 
> A while back, someone wrote a little shell script which 
>installed all
> jars in a directory with a standard groupId and version 
>(and utilized
> the file name as the artifactId), and then produced a 
>report at the
> end with all the <dependency> nodes for all the 
>artifacts just
> installed. They sent the script to this email list, so 
>if you search
> Nabble or Google, you should probably be able to find 
>it.
> 
> Wayne
> 
> On 6/1/07, CasMeiron <ca...@gmail.com> wrote:
>> I dont think u can do that.
>> Maven uses repository (groupId + artifactID) to find urs 
>>dependencies, its
>> not that hard to create them using maven install command 
>>line.
>>
>> U should try.
>>
>> On 6/1/07, Maarten Volders 
>><ma...@sherpa-consulting.be> wrote:
>> >
>> > All,
>> >
>> > I have a lot of libs which are not in the repository 
>>(central) each of
>> > them
>> > depending on a whole bunch of other libs, and manually 
>>putting them in the
>> > internal repository is really a lot of work, type-work 
>>:-) because all the
>> > dependencies have to be declared manually. So instead 
>>I want to make use
>> > of
>> > a lib directory instead of retrieving all my jar from 
>>the repository.
>> >
>> > How can this be accomplished with Maven?
>> >
>> > Grtz
>> >
>>
>>
>>
>> --
>> Paulo Cesar Silva Reis
>> -------------------------------
>> Powered by GMAIL
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
>users-unsubscribe@maven.apache.org
>For additional commands, e-mail: 
>users-help@maven.apache.org
> 
> 

  

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


Re: How-to use a lib directory instead of the repository

Posted by Wayne Fay <wa...@gmail.com>.
If its really that much work, you could merge all your jars into a
single huge jar, then you only have one jar to install and one
dependency to add to your pom.xml files.

But more seriously, Maven does not have the ability to utilize jars in
lib folders. The only way it gets dependencies is via the <dependency>
node in the pom.xml file, which requires that your artifacts be
installed in a Maven repository.

A while back, someone wrote a little shell script which installed all
jars in a directory with a standard groupId and version (and utilized
the file name as the artifactId), and then produced a report at the
end with all the <dependency> nodes for all the artifacts just
installed. They sent the script to this email list, so if you search
Nabble or Google, you should probably be able to find it.

Wayne

On 6/1/07, CasMeiron <ca...@gmail.com> wrote:
> I dont think u can do that.
> Maven uses repository (groupId + artifactID) to find urs dependencies, its
> not that hard to create them using maven install command line.
>
> U should try.
>
> On 6/1/07, Maarten Volders <ma...@sherpa-consulting.be> wrote:
> >
> > All,
> >
> > I have a lot of libs which are not in the repository (central) each of
> > them
> > depending on a whole bunch of other libs, and manually putting them in the
> > internal repository is really a lot of work, type-work :-) because all the
> > dependencies have to be declared manually. So instead I want to make use
> > of
> > a lib directory instead of retrieving all my jar from the repository.
> >
> > How can this be accomplished with Maven?
> >
> > Grtz
> >
>
>
>
> --
> Paulo Cesar Silva Reis
> -------------------------------
> Powered by GMAIL
>

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


Re: How-to use a lib directory instead of the repository

Posted by CasMeiron <ca...@gmail.com>.
I dont think u can do that.
Maven uses repository (groupId + artifactID) to find urs dependencies, its
not that hard to create them using maven install command line.

U should try.

On 6/1/07, Maarten Volders <ma...@sherpa-consulting.be> wrote:
>
> All,
>
> I have a lot of libs which are not in the repository (central) each of
> them
> depending on a whole bunch of other libs, and manually putting them in the
> internal repository is really a lot of work, type-work :-) because all the
> dependencies have to be declared manually. So instead I want to make use
> of
> a lib directory instead of retrieving all my jar from the repository.
>
> How can this be accomplished with Maven?
>
> Grtz
>



-- 
Paulo Cesar Silva Reis
-------------------------------
Powered by GMAIL