You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Swenson, Eric" <Er...@am.sony.com> on 2006/10/27 19:45:48 UTC

local repository relative to top-level pom

I'd like to store some bootstrap artifacts (like third party jars) in
maven2 repository layout structure and deliver this repository with my
project's sources.  I'd like the top-level project pom to define this
repository such that all lower-level projects will attempt to retrieve
resources from this repository.  But I want to refer to the repository
with a relative path so that everything will work whether the project's
source tree is placed. So, for example, I'd like this kind of layout:

 

            pom.xml 

            repository/

            module1/

            module2/

 

And I'd like module1 and module2 to find bootstrap artifacts in the
"repository" subdirectory of the top-level project.  If I define, in the
parent project's pom, something like:

 

  <repositories>

    <repository>

      <id>bootstrap</id>

      <name> Bootstrap Repoitory</name>

      <url>file://localhost/${basedir}/repository</url>

    </repository>

  </repositories>

 

Things won't work because ${basedir} is evaluated in the context of a
child module's pom, and will refer to the directory where that child
module's pom is located.  How can I define the file: URL such that it
will be valid in all sub-modules?

 

-- Eric


Re: local repository relative to top-level pom

Posted by Wayne Fay <wa...@gmail.com>.
Is it not possible to tell your users to edit the pom.xml (or provide
a profile.xml) such that the file:// reference is absolute rather than
relative? This seems to be the simplest way to do it.

Or provide a relative path in each pom perhaps, unsure if this would
work ie child/pom.xml <url>${basedir}/../repository</url>.

Wayne

On 10/27/06, Swenson, Eric <Er...@am.sony.com> wrote:
> I'd like to store some bootstrap artifacts (like third party jars) in
> maven2 repository layout structure and deliver this repository with my
> project's sources.  I'd like the top-level project pom to define this
> repository such that all lower-level projects will attempt to retrieve
> resources from this repository.  But I want to refer to the repository
> with a relative path so that everything will work whether the project's
> source tree is placed. So, for example, I'd like this kind of layout:
>
>
>
>            pom.xml
>
>            repository/
>
>            module1/
>
>            module2/
>
>
>
> And I'd like module1 and module2 to find bootstrap artifacts in the
> "repository" subdirectory of the top-level project.  If I define, in the
> parent project's pom, something like:
>
>
>
>  <repositories>
>
>    <repository>
>
>      <id>bootstrap</id>
>
>      <name> Bootstrap Repoitory</name>
>
>      <url>file://localhost/${basedir}/repository</url>
>
>    </repository>
>
>  </repositories>
>
>
>
> Things won't work because ${basedir} is evaluated in the context of a
> child module's pom, and will refer to the directory where that child
> module's pom is located.  How can I define the file: URL such that it
> will be valid in all sub-modules?
>
>
>
> -- Eric
>
>
>

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