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
<[email protected]>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>
>        <id>default_profile</id>
>        <activation>
>                <activeByDefault>true</activeByDefault>
>        </activation>
>        <repositories>
>                <repository>
>                        <id>archiva.internal</id>
>                        <name>Internal Release Repository</name>
>                        <url>
> http://2e02057b.aessuccess.org:8085/archiva/repository/internal/</url>
>                        <snapshots>
>                                <enabled>false</enabled>
>                        </snapshots>
>                        <releases>
>                                <enabled>true</enabled>
>                        </releases>
>                </repository>
>                <repository>
>                        <id>archiva.snapshots</id>
>                        <name>Internal Snapshot Repository</name>
>                        <url>
> http://2e02057b.aessuccess.org:8085/archiva/repository/snapshots/</url>
>                        <snapshots>
>                                <enabled>true</enabled>
>                        </snapshots>
>                        <releases>
>                                <enabled>false</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.
>
> ==============================================================================
>

Reply via email to