On Mon, Oct 4, 2010 at 12:43 PM, Phillip Hellewell <ssh...@gmail.com> wrote:
> On Mon, Oct 4, 2010 at 12:31 PM, Anders Hammar <and...@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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to