You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Mirko Friedenhagen <mf...@gmail.com> on 2013/01/23 10:08:41 UTC

settings or pom - where should repositories be defined?

Hello,

in a lot of threads on the dev and user list, I have read that "thou
shalt not define repositories in your pom" is the way to go. However
http://maven.apache.org/settings.html#Servers reads:
"The repositories for download and deployment are defined by the
repositories and distributionManagement elements of the POM."

Is this a bug or is there no consensus on this :-)?

Regards Mirko

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


Re: settings or pom - where should repositories be defined?

Posted by Mirko Friedenhagen <mf...@gmail.com>.
Hello Json, hello Stephen,

thanks for your answers. I have read a lot about this before :-). My
point was: should new users reading introductory pages  like
"http://maven.apache.org/settings.html" not be pushed in the direction
to *avoid* repositories in their POMs.

I mean, now they are almost forced to think it would be "a good idea"
to have repositories *in* the POM.
Should maybe the two referenced articles be linked in the settings.html page?

Regards Mirko


On Wed, Jan 23, 2013 at 12:26 PM, Jason van Zyl <ja...@tesla.io> wrote:
> Brian has a good blog entry on this:
>
> http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/
>
> On Jan 23, 2013, at 4:08 AM, Mirko Friedenhagen <mf...@gmail.com> wrote:
>
>> Hello,
>>
>> in a lot of threads on the dev and user list, I have read that "thou
>> shalt not define repositories in your pom" is the way to go. However
>> http://maven.apache.org/settings.html#Servers reads:
>> "The repositories for download and deployment are defined by the
>> repositories and distributionManagement elements of the POM."
>>
>> Is this a bug or is there no consensus on this :-)?
>>
>> Regards Mirko
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder & CTO, Sonatype
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> ---------------------------------------------------------
>
> The modern conservative is engaged in one of man's oldest exercises in moral philosophy; that is,
> the search for a superior moral justification for selfishness.
>
>  -- John Kenneth Galbraith
>
>
>
>
>

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


Re: settings or pom - where should repositories be defined?

Posted by Jason van Zyl <ja...@tesla.io>.
Brian has a good blog entry on this:

http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/

On Jan 23, 2013, at 4:08 AM, Mirko Friedenhagen <mf...@gmail.com> wrote:

> Hello,
> 
> in a lot of threads on the dev and user list, I have read that "thou
> shalt not define repositories in your pom" is the way to go. However
> http://maven.apache.org/settings.html#Servers reads:
> "The repositories for download and deployment are defined by the
> repositories and distributionManagement elements of the POM."
> 
> Is this a bug or is there no consensus on this :-)?
> 
> Regards Mirko
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder & CTO, Sonatype
Founder,  Apache Maven
http://twitter.com/jvanzyl
---------------------------------------------------------

The modern conservative is engaged in one of man's oldest exercises in moral philosophy; that is, 
the search for a superior moral justification for selfishness.

 -- John Kenneth Galbraith






Re: settings or pom - where should repositories be defined?

Posted by Stephen Connolly <st...@gmail.com>.
Well, for one thing, not all <repositories> in the pom.xml are evil...

Repositories which *only resolve -SNAPSHOT* artifacts are fine... better if
you don't need them, but they are fine.

I wrote a blog post about whether one should deploy -SNAPSHOTs in the first
place:
http://developer-blog.cloudbees.com/2012/12/should-you-deploy-snapshots.html

My view is that deploying -SNAPSHOTs is something you should only do *if*
absolutely necessary. Otherwise don't!

But, if you are on an active tip HEAD of development, and some dependent
modules are currently -SNAPSHOT, then adding the <repository> entry to the
pom for -SNAPSHOTs only (i.e. <releases>false</releases>) will not affect
the resolution when the artifact is released, and hence does not bring the
complete world of pain onto anyone pulling the released artifact from
central.

If you are in-house, you should have a proxying MRM and be using
<mirrorOf>*</mirrorOf> so <repositories> should not be necessary at all.

HTH


On 23 January 2013 09:08, Mirko Friedenhagen <mf...@gmail.com>wrote:

> Hello,
>
> in a lot of threads on the dev and user list, I have read that "thou
> shalt not define repositories in your pom" is the way to go. However
> http://maven.apache.org/settings.html#Servers reads:
> "The repositories for download and deployment are defined by the
> repositories and distributionManagement elements of the POM."
>
> Is this a bug or is there no consensus on this :-)?
>
> Regards Mirko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>