Re: Why define repositories in settings.xml and pom?

2010-05-04 Thread Timothy Mcginnis
Sorry about that secure post.  I hit the wrong button.

Thanks for all your discussion.  I now understand why repositories must be 
defined in the pom.

Tim McGinnis
717 720-1962
Web Development
AES/PHEAA



From:
Justin Edelson justinedel...@gmail.com
To:
Maven Users List users@maven.apache.org
Date:
05/03/2010 10:20 PM
Subject:
Re: Why define repositories in settings.xml and pom?



This seems like a very specific use case. I think it's more to the point
to say that many people (including, I suspect, 100% of Maven developers)
use the same workstation to work on projects which are deployed to
different repositories, e.g. apache, codehaus, shudder java.net, a
corporate repository, etc. It doesn't make sense to deploy an apache.org
project to the codehaus repository or vice versa. Nor do you want to
deploy corporate artifacts to the java.net repository. Thus, artifact
deployment/distribution is project-specific.

However, in all of those cases, you can use the same mirror of central.
And which mirror you pick should be based on your environment, not the
particular project. It should either be the closet mirror or a nearby
caching repository manager.

If you want build reproducibility, you should be using release artifacts
and only reference repositories with immutability rules. You should be
able to reproduce a build using an entirely different mirror (again,
assuming repository immutability). If you reference mutable
repositories, you lose build reproducibility regardless of what you put
in your pom or settings.xml.

Justin

On 5/3/10 11:59 AM, Thiessen, Todd (Todd) wrote:
 I think the best way to think about this is that the read 
 side is (or should
 be) an aspect of your environment whereas the write side is 
 an aspect of your project.
 
 Very true. But we should make it clear why reading is an aspect of your 
environment whereas writing is an aspect of your project.
 
 I think the reason is when your deploying a project, you are doing so 
because you are making an actual change to the code itself. If you are 
already changing the code and the server to which you deploy to also 
happens to change, it is a relatively simple matter to change the pom at 
the same time you are changing the code.
 
 However, you may want to build an EXACT version of software that was 
previously deployed but the repos you read from may not be the same since 
the time the software was first deployed to the time you want to repeat 
the build. Thus you don't want to touch any of the source code, including 
the pom. You can change the settings.xml file point to the repos you are 
currently reading from.
 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org
 


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





==
This message contains privileged and confidential information intended for the 
above addressees only.  If you
receive this message in error please delete or destroy this message and/or 
attachments.  

The sender of this message will fully cooperate in the civil and criminal 
prosecution of any individual engaging
in the unauthorized use of this message.
==


RE: Why define repositories in settings.xml and pom?

2010-05-04 Thread Thiessen, Todd (Todd)
 This seems like a very specific use case. I think it's more 
 to the point to say that many people (including, I suspect, 
 100% of Maven developers) use the same workstation to work on 
 projects which are deployed to different repositories, e.g. 
 apache, codehaus, shudder java.net, a corporate repository, 
 etc. It doesn't make sense to deploy an apache.org project to 
 the codehaus repository or vice versa. Nor do you want to 
 deploy corporate artifacts to the java.net repository. Thus, 
 artifact deployment/distribution is project-specific.

Sort of. What seems to happen is that artifacts will go through an incubation 
period on a particular repo before it gets migrated to a more central 
accessible repository. The feature content that the artifact offers remains 
largely the same. All that changes is the GAV and the repo it gets deployed to. 
So corporate artifacts can very much start on a corporate repo and then migrate 
to a more public one like java.net or central. That seems to be a fairly common 
scenario in fact.

Thus I definately could see an argument for putting distribution management in 
the settings.xml file. Particularly in a corporate environment where you are 
deploying to a local repository and the location of that repo may change. 
-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Why define repositories in settings.xml and pom?

2010-05-03 Thread Timothy Mcginnis
I am a confused about where repositories need to be defined.

I have my repositories defined in my settings.xml file under my default 
profile.

profile
iddefault_profile/id
activation
activeByDefaulttrue/activeByDefault
/activation
repositories
repository
idarchiva.internal/id
nameInternal Release Repository/name
url
http://2e02057b.aessuccess.org:8085/archiva/repository/internal//url
snapshots
enabledfalse/enabled
/snapshots
releases
enabledtrue/enabled
/releases
/repository
repository
idarchiva.snapshots/id
nameInternal Snapshot Repository/name
url
http://2e02057b.aessuccess.org:8085/archiva/repository/snapshots//url
snapshots
enabledtrue/enabled
/snapshots
releases
enabledfalse/enabled
/releases
/repository
/repositories
/profile

I thought this would tell Maven where to store and retrieve all my 
artifacts.  But when I run a deploy it gives me the error

Deployment failed: repository element was not specified in the pom inside 
distributionManagement element or in 
-DaltDeploymentRepository=id::layout::url parameter

If I define the repositories in the pom using the distributionManagement 
element it works fine.

But this seems confusing to me.  Why do I have to define them in both 
places?

Tim McGinnis
717 720-1962
Web Development
AES/PHEAA
==
This message contains privileged and confidential information intended for the 
above addressees only.  If you
receive this message in error please delete or destroy this message and/or 
attachments.  

The sender of this message will fully cooperate in the civil and criminal 
prosecution of any individual engaging
in the unauthorized use of this message.
==


RE: Why define repositories in settings.xml and pom?

2010-05-03 Thread Thiessen, Todd (Todd)
I believe its because deploying a release isn't something you do more than once.

However, you may need to rebuild a release from a tag more than once. You may 
actually need to rebuild many years after a tag was released and your 
environment may have changed since then and thus need to download artifacts 
from a different place. 

 -Original Message-
 From: Timothy Mcginnis [mailto:tmcgi...@aessuccess.org] 
 Sent: Monday, May 03, 2010 10:36 AM
 To: users@maven.apache.org
 Subject: Why define repositories in settings.xml and pom?
 
 I am a confused about where repositories need to be defined.
 
 I have my repositories defined in my settings.xml file under 
 my default profile.
 
 profile
 iddefault_profile/id
 activation
 activeByDefaulttrue/activeByDefault
 /activation
 repositories
 repository
 idarchiva.internal/id
 nameInternal Release Repository/name
 url
 http://2e02057b.aessuccess.org:8085/archiva/repository/internal//url
 snapshots
 enabledfalse/enabled
 /snapshots
 releases
 enabledtrue/enabled
 /releases
 /repository
 repository
 idarchiva.snapshots/id
 nameInternal Snapshot Repository/name
 url
 http://2e02057b.aessuccess.org:8085/archiva/repository/snapsho
 ts//url
 snapshots
 enabledtrue/enabled
 /snapshots
 releases
 enabledfalse/enabled
 /releases
 /repository
 /repositories
 /profile
 
 I thought this would tell Maven where to store and retrieve 
 all my artifacts.  But when I run a deploy it gives me the error
 
 Deployment failed: repository element was not specified in 
 the pom inside distributionManagement element or in 
 -DaltDeploymentRepository=id::layout::url parameter
 
 If I define the repositories in the pom using the 
 distributionManagement element it works fine.
 
 But this seems confusing to me.  Why do I have to define them 
 in both places?
 
 Tim McGinnis
 717 720-1962
 Web Development
 AES/PHEAA
 ==
 
 This message contains privileged and confidential information 
 intended for the above addressees only.  If you receive this 
 message in error please delete or destroy this message and/or 
 attachments.  
 
 The sender of this message will fully cooperate in the civil 
 and criminal prosecution of any individual engaging in the 
 unauthorized use of this message.
 ==
 
 
-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Why define repositories in settings.xml and pom?

2010-05-03 Thread Paul Benedict
Consider the repositories in your POM to be those for your local
development. That's your choice.

You put things in the POM if you want to distribute your repository to
other people. Having it in the POM means that it gets added to the
build and things can be pulled there automatically. I believe JBoss
does this with their artifacts.

Paul

On Mon, May 3, 2010 at 9:46 AM, Thiessen, Todd (Todd)
tthies...@avaya.com wrote:
 I believe its because deploying a release isn't something you do more than 
 once.

 However, you may need to rebuild a release from a tag more than once. You may 
 actually need to rebuild many years after a tag was released and your 
 environment may have changed since then and thus need to download artifacts 
 from a different place.

 -Original Message-
 From: Timothy Mcginnis [mailto:tmcgi...@aessuccess.org]
 Sent: Monday, May 03, 2010 10:36 AM
 To: users@maven.apache.org
 Subject: Why define repositories in settings.xml and pom?

 I am a confused about where repositories need to be defined.

 I have my repositories defined in my settings.xml file under
 my default profile.

 profile
         iddefault_profile/id
         activation
                 activeByDefaulttrue/activeByDefault
         /activation
         repositories
                 repository
                         idarchiva.internal/id
                         nameInternal Release Repository/name
                         url
 http://2e02057b.aessuccess.org:8085/archiva/repository/internal//url
                         snapshots
                                 enabledfalse/enabled
                         /snapshots
                         releases
                                 enabledtrue/enabled
                         /releases
                 /repository
                 repository
                         idarchiva.snapshots/id
                         nameInternal Snapshot Repository/name
                         url
 http://2e02057b.aessuccess.org:8085/archiva/repository/snapsho
 ts//url
                         snapshots
                                 enabledtrue/enabled
                         /snapshots
                         releases
                                 enabledfalse/enabled
                         /releases
                 /repository
         /repositories
 /profile

 I thought this would tell Maven where to store and retrieve
 all my artifacts.  But when I run a deploy it gives me the error

 Deployment failed: repository element was not specified in
 the pom inside distributionManagement element or in
 -DaltDeploymentRepository=id::layout::url parameter

 If I define the repositories in the pom using the
 distributionManagement element it works fine.

 But this seems confusing to me.  Why do I have to define them
 in both places?

 Tim McGinnis
 717 720-1962
 Web Development
 AES/PHEAA
 ==
 
 This message contains privileged and confidential information
 intended for the above addressees only.  If you receive this
 message in error please delete or destroy this message and/or
 attachments.

 The sender of this message will fully cooperate in the civil
 and criminal prosecution of any individual engaging in the
 unauthorized use of this message.
 ==
 

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



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



Re: Why define repositories in settings.xml and pom?

2010-05-03 Thread Jason van Zyl
http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/

On May 3, 2010, at 4:35 PM, Timothy Mcginnis wrote:

 I am a confused about where repositories need to be defined.
 
 I have my repositories defined in my settings.xml file under my default 
 profile.
 
 profile
iddefault_profile/id
activation
activeByDefaulttrue/activeByDefault
/activation
repositories
repository
idarchiva.internal/id
nameInternal Release Repository/name
url
 http://2e02057b.aessuccess.org:8085/archiva/repository/internal//url
snapshots
enabledfalse/enabled
/snapshots
releases
enabledtrue/enabled
/releases
/repository
repository
idarchiva.snapshots/id
nameInternal Snapshot Repository/name
url
 http://2e02057b.aessuccess.org:8085/archiva/repository/snapshots//url
snapshots
enabledtrue/enabled
/snapshots
releases
enabledfalse/enabled
/releases
/repository
/repositories
 /profile
 
 I thought this would tell Maven where to store and retrieve all my 
 artifacts.  But when I run a deploy it gives me the error
 
 Deployment failed: repository element was not specified in the pom inside 
 distributionManagement element or in 
 -DaltDeploymentRepository=id::layout::url parameter
 
 If I define the repositories in the pom using the distributionManagement 
 element it works fine.
 
 But this seems confusing to me.  Why do I have to define them in both 
 places?
 
 Tim McGinnis
 717 720-1962
 Web Development
 AES/PHEAA
 ==
 This message contains privileged and confidential information intended for 
 the above addressees only.  If you
 receive this message in error please delete or destroy this message and/or 
 attachments.  
 
 The sender of this message will fully cooperate in the civil and criminal 
 prosecution of any individual engaging
 in the unauthorized use of this message.
 ==

Thanks,

Jason

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






Re: Why define repositories in settings.xml and pom?

2010-05-03 Thread Benson Margulies
I see repositories and not deploymentManagement, so unless I'm
confused there's nothing here to make the 'write' side work.


On Mon, May 3, 2010 at 11:27 AM, Jason van Zyl ja...@sonatype.com wrote:
 http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/

 On May 3, 2010, at 4:35 PM, Timothy Mcginnis wrote:

 I am a confused about where repositories need to be defined.

 I have my repositories defined in my settings.xml file under my default
 profile.

 profile
        iddefault_profile/id
        activation
                activeByDefaulttrue/activeByDefault
        /activation
        repositories
                repository
                        idarchiva.internal/id
                        nameInternal Release Repository/name
                        url
 http://2e02057b.aessuccess.org:8085/archiva/repository/internal//url
                        snapshots
                                enabledfalse/enabled
                        /snapshots
                        releases
                                enabledtrue/enabled
                        /releases
                /repository
                repository
                        idarchiva.snapshots/id
                        nameInternal Snapshot Repository/name
                        url
 http://2e02057b.aessuccess.org:8085/archiva/repository/snapshots//url
                        snapshots
                                enabledtrue/enabled
                        /snapshots
                        releases
                                enabledfalse/enabled
                        /releases
                /repository
        /repositories
 /profile

 I thought this would tell Maven where to store and retrieve all my
 artifacts.  But when I run a deploy it gives me the error

 Deployment failed: repository element was not specified in the pom inside
 distributionManagement element or in
 -DaltDeploymentRepository=id::layout::url parameter

 If I define the repositories in the pom using the distributionManagement
 element it works fine.

 But this seems confusing to me.  Why do I have to define them in both
 places?

 Tim McGinnis
 717 720-1962
 Web Development
 AES/PHEAA
 ==
 This message contains privileged and confidential information intended for 
 the above addressees only.  If you
 receive this message in error please delete or destroy this message and/or 
 attachments.

 The sender of this message will fully cooperate in the civil and criminal 
 prosecution of any individual engaging
 in the unauthorized use of this message.
 ==

 Thanks,

 Jason

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







RE: Why define repositories in settings.xml and pom?

2010-05-03 Thread Thiessen, Todd (Todd)
I don't think the original poster was questioning whether or not artifacts 
should be downloaded from repos defined in settings.xml. But rather artifacts 
that get deployed do not go in settings.xml. They have to go in the pom. Why do 
these repos not also go in settings.xml?

I agree with the OP that this is a bit confusing.

 -Original Message-
 From: Jason van Zyl [mailto:ja...@sonatype.com] 
 Sent: Monday, May 03, 2010 11:27 AM
 To: Maven Users List
 Subject: Re: Why define repositories in settings.xml and pom?
 
 http://www.sonatype.com/people/2009/02/why-putting-repositorie
 s-in-your-poms-is-a-bad-idea/
 
 On May 3, 2010, at 4:35 PM, Timothy Mcginnis wrote:
 
  I am a confused about where repositories need to be defined.
  
  I have my repositories defined in my settings.xml file under my 
  default profile.
  
  profile
 iddefault_profile/id
 activation
 activeByDefaulttrue/activeByDefault
 /activation
 repositories
 repository
 idarchiva.internal/id
 nameInternal Release Repository/name
 url
  
 http://2e02057b.aessuccess.org:8085/archiva/repository/internal//url
 snapshots
 enabledfalse/enabled
 /snapshots
 releases
 enabledtrue/enabled
 /releases
 /repository
 repository
 idarchiva.snapshots/id
 nameInternal Snapshot Repository/name
 url
  
 http://2e02057b.aessuccess.org:8085/archiva/repository/snapsho
 ts//url
 snapshots
 enabledtrue/enabled
 /snapshots
 releases
 enabledfalse/enabled
 /releases
 /repository
 /repositories
  /profile
  
  I thought this would tell Maven where to store and retrieve all my 
  artifacts.  But when I run a deploy it gives me the error
  
  Deployment failed: repository element was not specified in the pom 
  inside distributionManagement element or in 
  -DaltDeploymentRepository=id::layout::url parameter
  
  If I define the repositories in the pom using the 
  distributionManagement element it works fine.
  
  But this seems confusing to me.  Why do I have to define 
 them in both 
  places?
  
  Tim McGinnis
  717 720-1962
  Web Development
  AES/PHEAA
  
 ==
   This message contains privileged and confidential 
 information 
  intended for the above addressees only.  If you receive 
 this message 
  in error please delete or destroy this message and/or attachments.
  
  The sender of this message will fully cooperate in the civil and 
  criminal prosecution of any individual engaging in the 
 unauthorized use of this message.
  
 ==
  
 
 Thanks,
 
 Jason
 
 --
 Jason van Zyl
 Founder,  Apache Maven
 http://twitter.com/jvanzyl
 -
 
 
 
 
 
-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Why define repositories in settings.xml and pom?

2010-05-03 Thread Justin Edelson
The reason you can define them in two places is that Maven separates the
configuration of the repository from which you read artifacts from those
which you write (or _distribute_) artifacts (and further separates the
repository to which you distribute snapshots from that to which you
distribute releases). The former can be specified in either settings.xml or
pom.xml. The latter can only be specified in pom.xml.

I think the best way to think about this is that the read side is (or should
be) an aspect of your environment whereas the write side is an aspect of
your project.

HTH,
Justin

On Mon, May 3, 2010 at 10:35 AM, Timothy Mcginnis
tmcgi...@aessuccess.orgwrote:

 I am a confused about where repositories need to be defined.

 I have my repositories defined in my settings.xml file under my default
 profile.

 profile
iddefault_profile/id
activation
activeByDefaulttrue/activeByDefault
/activation
repositories
repository
idarchiva.internal/id
nameInternal Release Repository/name
url
 http://2e02057b.aessuccess.org:8085/archiva/repository/internal//url
snapshots
enabledfalse/enabled
/snapshots
releases
enabledtrue/enabled
/releases
/repository
repository
idarchiva.snapshots/id
nameInternal Snapshot Repository/name
url
 http://2e02057b.aessuccess.org:8085/archiva/repository/snapshots//url
snapshots
enabledtrue/enabled
/snapshots
releases
enabledfalse/enabled
/releases
/repository
/repositories
 /profile

 I thought this would tell Maven where to store and retrieve all my
 artifacts.  But when I run a deploy it gives me the error

 Deployment failed: repository element was not specified in the pom inside
 distributionManagement element or in
 -DaltDeploymentRepository=id::layout::url parameter

 If I define the repositories in the pom using the distributionManagement
 element it works fine.

 But this seems confusing to me.  Why do I have to define them in both
 places?

 Tim McGinnis
 717 720-1962
 Web Development
 AES/PHEAA

 ==
 This message contains privileged and confidential information intended for
 the above addressees only.  If you
 receive this message in error please delete or destroy this message and/or
 attachments.

 The sender of this message will fully cooperate in the civil and criminal
 prosecution of any individual engaging
 in the unauthorized use of this message.

 ==



RE: Why define repositories in settings.xml and pom?

2010-05-03 Thread Thiessen, Todd (Todd)
 I think the best way to think about this is that the read 
 side is (or should
 be) an aspect of your environment whereas the write side is 
 an aspect of your project.

Very true. But we should make it clear why reading is an aspect of your 
environment whereas writing is an aspect of your project.

I think the reason is when your deploying a project, you are doing so because 
you are making an actual change to the code itself. If you are already changing 
the code and the server to which you deploy to also happens to change, it is a 
relatively simple matter to change the pom at the same time you are changing 
the code.

However, you may want to build an EXACT version of software that was previously 
deployed but the repos you read from may not be the same since the time the 
software was first deployed to the time you want to repeat the build. Thus you 
don't want to touch any of the source code, including the pom. You can change 
the settings.xml file point to the repos you are currently reading from.
-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Why define repositories in settings.xml and pom?

2010-05-03 Thread Justin Edelson
This seems like a very specific use case. I think it's more to the point
to say that many people (including, I suspect, 100% of Maven developers)
use the same workstation to work on projects which are deployed to
different repositories, e.g. apache, codehaus, shudder java.net, a
corporate repository, etc. It doesn't make sense to deploy an apache.org
project to the codehaus repository or vice versa. Nor do you want to
deploy corporate artifacts to the java.net repository. Thus, artifact
deployment/distribution is project-specific.

However, in all of those cases, you can use the same mirror of central.
And which mirror you pick should be based on your environment, not the
particular project. It should either be the closet mirror or a nearby
caching repository manager.

If you want build reproducibility, you should be using release artifacts
and only reference repositories with immutability rules. You should be
able to reproduce a build using an entirely different mirror (again,
assuming repository immutability). If you reference mutable
repositories, you lose build reproducibility regardless of what you put
in your pom or settings.xml.

Justin

On 5/3/10 11:59 AM, Thiessen, Todd (Todd) wrote:
 I think the best way to think about this is that the read 
 side is (or should
 be) an aspect of your environment whereas the write side is 
 an aspect of your project.
 
 Very true. But we should make it clear why reading is an aspect of your 
 environment whereas writing is an aspect of your project.
 
 I think the reason is when your deploying a project, you are doing so because 
 you are making an actual change to the code itself. If you are already 
 changing the code and the server to which you deploy to also happens to 
 change, it is a relatively simple matter to change the pom at the same time 
 you are changing the code.
 
 However, you may want to build an EXACT version of software that was 
 previously deployed but the repos you read from may not be the same since the 
 time the software was first deployed to the time you want to repeat the 
 build. Thus you don't want to touch any of the source code, including the 
 pom. You can change the settings.xml file point to the repos you are 
 currently reading from.
 -
 To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
 For additional commands, e-mail: users-h...@maven.apache.org
 


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