You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by NGUYEN Cong Kinh <co...@it-sudparis.eu> on 2010/06/02 10:03:28 UTC

[internal-repository] How to use relative path in the declaration of repository

Hi everybody,

I have a problem with deploying an internal repository. In fact, I have 
some modules as the following:
- module A
    + module A1
          + module A11
                + pom.xml
                + src
                + libs
          + module A12
    + module A2


In the module A11, I use some libraries and they are stored in the 
'libs' directory. One of them, for example the library "B". I created 
the structure of directory 
(groupId/actifactId/version/artifactId-version) so that I ready deploy 
the library "B" from the 'libs' directory. In the pom.xml, I declared below:

  <repositories>
    <repository>
      <id>private-cosmos-B</id>
      <url>file:${basedir}/libs</url>
    </repository>
  </repositories>


But it seems to me that Maven can't understand the usage of ${basedir} 
in this context. In fact, the relative path is important so that I can 
compile my modules from the module A. Could anyone help me to solve my 
problem?

Thanks in advance,
Kinh

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


Re: [internal-repository] How to use relative path in the declaration of repository

Posted by Karl Heinz Marbaise <ka...@soebes.de>.
Hi,


NGUYEN Cong Kinh-2 wrote:
> 
>   <repositories>
>     <repository>
>       <id>private-cosmos-B</id>
>       <url>file:${basedir}/libs</url>
>     </repository>
>   </repositories>
> 

The problem you aren't aware of is that if you like to use a file based URL
you have to do it like this:


<url>file://${basedir}/libs</url>

But i would recommend to follow the recomandations of the other post.

Kind regards
Karl Heinz Marbaise

-- 
View this message in context: http://old.nabble.com/-internal-repository--How-to-use-relative-path-in-the-declaration-of-repository-tp28751349p28752713.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: [internal-repository] How to use relative path in the declaration of repository

Posted by Anders Hammar <an...@hammar.net>.
I don't understand. You say you have a problem with an internal repo and
that you have deploy the library 'B', but the module structure and the
repositories element you're outlining talkes about your local file system
structure.

This is what you should do:
1. Get yourself an internal remote repo. This is easiest managed by using a
repo manager like Nexus.
2. Deploy the third party lib 'B' (which I assume doesn't exist in central
for instance) to your internal repo.
3. Set up your Maven environment to use your internal repo (there are loads
of docs about that on the Internet).
4. Remove the repositories section which points at your local file syste,
5. You should be all set to use Maven the way it is meant to be used.

/Anders

On Wed, Jun 2, 2010 at 10:03, NGUYEN Cong Kinh <
cong_kinh.nguyen@it-sudparis.eu> wrote:

> Hi everybody,
>
> I have a problem with deploying an internal repository. In fact, I have
> some modules as the following:
> - module A
>   + module A1
>         + module A11
>               + pom.xml
>               + src
>               + libs
>         + module A12
>   + module A2
>
>
> In the module A11, I use some libraries and they are stored in the 'libs'
> directory. One of them, for example the library "B". I created the structure
> of directory (groupId/actifactId/version/artifactId-version) so that I ready
> deploy the library "B" from the 'libs' directory. In the pom.xml, I declared
> below:
>
>  <repositories>
>   <repository>
>     <id>private-cosmos-B</id>
>     <url>file:${basedir}/libs</url>
>   </repository>
>  </repositories>
>
>
> But it seems to me that Maven can't understand the usage of ${basedir} in
> this context. In fact, the relative path is important so that I can compile
> my modules from the module A. Could anyone help me to solve my problem?
>
> Thanks in advance,
> Kinh
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>