maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phillip Hellewell <ssh...@gmail.com>
Subject Re: Can't specify distributionManagement in settings.xml
Date Mon, 04 Oct 2010 19:04:59 GMT
On Mon, Oct 4, 2010 at 12:43 PM, Phillip Hellewell <sshock@gmail.com> wrote:
> On Mon, Oct 4, 2010 at 12:31 PM, Anders Hammar <anders@hammar.net> wrote:
>> Are you seeing the pattern yet? Don't fight Maven!
>
> Hehe, yeah I am.  But using a parent pom for this setting is still not
> making complete sense to me, so I've got to play with it some more and
> hopefully it will.

Ok, I figured out what I feel is a valid and good solution.  Not sure
why I didn't think of this before, but in the default profile in my
settings.xml I can simply define a property called "repos.url", right
where I define my repository.  Then I can use that same property in my
distributionManagement section in any of my poms that I want to.

So something like this goes in my settings.xml:
  <profiles>
    <profile>
      <id>default</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <repos.url>file:///c:/test123</repos.url>
      </properties>
      <repositories>
        <repository>
          <id>test123</id>
          <name>test</name>
          <url>${repos.url}</url>
        </repository>
      </repositories>
    </profile>
  </profiles>

And something like this goes in my pom files:
  <distributionManagement>
    <repository>
      <id>myrepos</id>
      <url>${repos.url}</url>
    </repository>
  </distributionManagement>

The other advantage here is that I can pass in repos.url on the
command-line with -D if I want to deploy to another repository.

I hope you won't tell me this is the "wrong" way, because it seems
like a perfectly valid approach to me.

Phillip

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


Mime
View raw message