You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by andrew <li...@pyroboy.com.au> on 2005/09/28 04:45:14 UTC
[m2] multiple repository confusion
Maven version: 2.0-beta-2
Hi,
I am having some trouble getting m2 repositories to work as I expect.
Not sure if the problem is with my configuration, or my expectation :)
I can download plugins and dependencies from the main maven/ibiblio
repositories to my local (~/.m2/repository) repository without any hassle.
I can also install artefacts to my local repository (via install or
install:install-file) and deploy them to my deployment repository[1].
Where I am having trouble is if I have a dependency that is not
available on the central maven/ibiblio repository, or my local
repository, but is available on my deployment repository. For example,
when a colleague deploys a project that I do not have locally.
m2 appears to try my local repository, then the central repository, then
gives up.
I have tried adding a repository element to my ~/.m2/settings.xml[2] but
this doesn't appear to make any difference.
Is my expectation of m2 that it can draw dependencies from multiple
repositories correct? If so, can anyone let me know what may be wrong
with my configuration?
Also, in previous m2 releases, when a dependency is not found m2 would
provide a pre-filled-in command line snippet for install:install-file.
A nice hint so you could easily add it to your local
repository. It no longer appears to do this. Is this by design?
Thanks,
...andrew
Listing 1:
<project>
...
<distributionManagement>
<repository>
<id>myrepo</id>
<url>file:///path/to/myrepo</url>
</repository>
</distributionManagement>
...
</project>
Listing 2:
<settings>
...
<profiles>
<profile>
<repositories>
<repository>
<id>myrepo</id>
<url>file:///path/to/myrepo</url>
</repository>
</repositories>
</profile>
</profiles>
...
</settings>
--
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] multiple repository confusion
Posted by andrew <li...@pyroboy.com.au>.
Brett Porter wrote:
> Finally, the profile you have below should also work (you need to be
> able to add this on some occasions - specifically when the parent that
> specifies the repository to use is actually in the repository). I
> think what you are lacking is a line to activate the profile.
Aha! Named the profile and activated it. All working now. Obvious in
hindsight :)
Thanks,
...andrew
--
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] multiple repository confusion
Posted by Saleem Shafi <sa...@gmail.com>.
Thanks for the tip, but it didn't quite work.. i wasn't sure if you
meant that i should delete just the RELEASE value/element or the
entire file.. i did both but neither worked, the value/file just came
right back.. what did seem to work was replacing the RELEASE value
with '1.0-alpha-3', the version that matched the repository on
ibiblio.
i'm not sure if this is what you were asking me to do or not, and if
not, if that means that this is a different bug, but that got me a
little BUILD SUCCESSFUL message, so i'm happy for tonight.. thanks
again..
Saleem.
p.s. someone might want to put a little note on the Getting Started
page that explains this workaround in case anyone else has any
problems..
On 9/27/05, Brett Porter <br...@gmail.com> wrote:
> On 9/28/05, andrew <li...@pyroboy.com.au> wrote:
> > Where I am having trouble is if I have a dependency that is not
> > available on the central maven/ibiblio repository, or my local
> > repository, but is available on my deployment repository. For example,
> > when a colleague deploys a project that I do not have locally.
>
> You should specify a repository in the project that needs to use it
> (using <repositories>, similar to below).
>
> FYI, if it is not something specific to the project but just something
> you want to add, you can declare a mirror in settings.xml - this says
> that the repository is ibiblio, but I want to use planetmirror, or
> maven-proxy, etc.
>
> Finally, the profile you have below should also work (you need to be
> able to add this on some occasions - specifically when the parent that
> specifies the repository to use is actually in the repository). I
> think what you are lacking is a line to activate the profile.
>
> The m2 installation has a commented settings.xml to use as a basis.
>
> > Also, in previous m2 releases, when a dependency is not found m2 would
> > provide a pre-filled-in command line snippet for install:install-file.
> > A nice hint so you could easily add it to your local
> > repository. It no longer appears to do this. Is this by design?
>
> I think its a bug - I already filed it this morning.
>
> Cheers,
> Brett
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
Saleem Shafi
Partner
Pomatics Technology Partners LTD
http://pomatics.com
ph: 512.577.1472
email: saleemshafi@pomatics.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] multiple repository confusion
Posted by Brett Porter <br...@gmail.com>.
On 9/28/05, andrew <li...@pyroboy.com.au> wrote:
> Where I am having trouble is if I have a dependency that is not
> available on the central maven/ibiblio repository, or my local
> repository, but is available on my deployment repository. For example,
> when a colleague deploys a project that I do not have locally.
You should specify a repository in the project that needs to use it
(using <repositories>, similar to below).
FYI, if it is not something specific to the project but just something
you want to add, you can declare a mirror in settings.xml - this says
that the repository is ibiblio, but I want to use planetmirror, or
maven-proxy, etc.
Finally, the profile you have below should also work (you need to be
able to add this on some occasions - specifically when the parent that
specifies the repository to use is actually in the repository). I
think what you are lacking is a line to activate the profile.
The m2 installation has a commented settings.xml to use as a basis.
> Also, in previous m2 releases, when a dependency is not found m2 would
> provide a pre-filled-in command line snippet for install:install-file.
> A nice hint so you could easily add it to your local
> repository. It no longer appears to do this. Is this by design?
I think its a bug - I already filed it this morning.
Cheers,
Brett
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org