You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Thomas Knowlton <to...@gmail.com> on 2007/01/13 00:42:07 UTC

Restricting maven's dependency search

I am in the process of migrating the build of a largish project from
Ant to Maven 2.

I'm trying to figure out whether it's possible and how to configure a
Maven project to depend on artifacts from a given repository ONLY.
That is, I want to restrict Maven's search path to a "blessed"
repository, for artifacts that my project directly depends on;
however, I don't want to prevent Maven being able to get its plugins
(and their dependencies) from our (internal) mirror of central
(containing "unblessed" artifacts).

I was wondering about the difference between <repositories> and
<pluginRepositories>, but I haven't figured out from the documentation
how to use them to accomplish this.

Does anybody know, is it possible to do what I'm describing? If so,
could you post a snippet? Thanks for your time.
--
Tommy

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


Re: Restricting maven's dependency search

Posted by Tommy Knowlton <To...@KE4KUG.net>.
Maybe I wasn't thinking about this problem the right way.

It turns out that when I override the Super POM's "central" repository
entry using my project's POM, with <enabled>false</enabled> for both
<snapshots> and <releases>, maven2 exhibits the desired behavior.

The build now (correctly) fails for artifacts that would have been
obtainable from central, which are not found in my blessed repository.
Maven continues to download the plugin artifacts it requires from
central.

Problem appears to be solved.

If any of you know of issues that are likely to arise using this
approach, please reply.

Thanks,
--
Tommy

On 1/12/07, Thomas Knowlton <to...@gmail.com> wrote:
> I am in the process of migrating the build of a largish project from
> Ant to Maven 2.
>
> I'm trying to figure out whether it's possible and how to configure a
> Maven project to depend on artifacts from a given repository ONLY.
> That is, I want to restrict Maven's search path to a "blessed"
> repository, for artifacts that my project directly depends on;
> however, I don't want to prevent Maven being able to get its plugins
> (and their dependencies) from our (internal) mirror of central
> (containing "unblessed" artifacts).
>
> I was wondering about the difference between <repositories> and
> <pluginRepositories>, but I haven't figured out from the documentation
> how to use them to accomplish this.
>
> Does anybody know, is it possible to do what I'm describing? If so,
> could you post a snippet? Thanks for your time.
> --
> Tommy
>


-- 
--
Tommy

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


Re: Restricting maven's dependency search

Posted by franz see <fr...@gmail.com>.
Good day to you, Tommy,

AFAIK, you cannot specify which repository a certain artifact should be
downloaded from. However, what you can do is to add your repository so that
maven can download from there. But I am guessing that you have some artifact
that you want only to be downloaded from your internal repository because an
artifact with the same artifact key exists in another repository but is
different from  yours ( binary-wise ). If so, you might what to change your
artifact's artifact key ( easiest would be through the version ).

As for the repository and plugin repository - the plugin repository is where
the plugins are updated from, whlie the repositories are where the rest of
the artifacts you are using are updated/taken from ( such as dependencies ).

Cheers,
Franz


Thomas Knowlton wrote:
> 
> I am in the process of migrating the build of a largish project from
> Ant to Maven 2.
> 
> I'm trying to figure out whether it's possible and how to configure a
> Maven project to depend on artifacts from a given repository ONLY.
> That is, I want to restrict Maven's search path to a "blessed"
> repository, for artifacts that my project directly depends on;
> however, I don't want to prevent Maven being able to get its plugins
> (and their dependencies) from our (internal) mirror of central
> (containing "unblessed" artifacts).
> 
> I was wondering about the difference between <repositories> and
> <pluginRepositories>, but I haven't figured out from the documentation
> how to use them to accomplish this.
> 
> Does anybody know, is it possible to do what I'm describing? If so,
> could you post a snippet? Thanks for your time.
> --
> Tommy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Restricting-maven%27s-dependency-search-tf2969340s177.html#a8312811
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