You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by gotama <go...@bgb.net> on 2008/08/29 05:21:59 UTC

Can/should my repository id under distributionmanagement be the same as the one in settings.xml?

Repositories elements seem to play different roles - either you are
retrieving from the repository, using the defined <respository> element in
settings.xml or you are deploying to a repository using the <repository>
element inside of <distributionmanagement> within the pom.xml. The way in
which this is configured is confusing 

For my company repository (I think its called the "local remote"
repository), of course I want to do both retrieve and deploy artifacts. Is
it ok to use the same id name for both repository elements in settings.xml
and pom.xml - and are they even related or treated differently? For
instance, if I were to declare in the respository element in settings.xml
that the repository was disabled, and yet in the pom.xml I had a repository
element with the same id as the one in the settings.xml file, when I exec
'mvn deploy' on that project, will the deployment phase be disabled? If not,
how do I optionally disable the deployment to a repository and still exec
the "deploy" phase (if my repo is not yet setup but I still need to exec the
deploy phase)? What is the best practice here for defining repository ids
for local remote repositories which are used for both retrieving and
deploying artifacts? Both <respository> elements refer to the same hostname,
yet they appear to be defined separately and play different roles - so I am
curious if there would or would not be a conflict in defining the same id
name for both - as defining separate repo ids for the same host seems
unnecessary.

Example:

In my parent pom.xml:
...
<distributionManagement>
    <repository>
        <id>my-repo</id>
        <url>scp://repo/maven2</url>
    </repository>
</distributionManagement>
...

In settings.xml:
...
<repositories>
    <repository>
        <releases>
            <enabled>false</enabled>
            <updatePolicy>always</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
        </releases>
        <snapshots>
            <enabled>false</enabled>
            <updatePolicy>daily</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
        </snapshots>
        <id>my-repo</id>
        <url>http://repo/maven2/</url>
        <layout>default</layout>
    </repository>
</repositories>
...

Thanks!

-- 
View this message in context: http://www.nabble.com/Can-should-my-repository-id-under-distributionmanagement-be-the-same-as-the-one-in-settings.xml--tp19213047p19213047.html
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