Subscribe

  • Subscribe via XML
  • Subscribe via Bloglines
  • Subscribe via NewsGator
  • Subscribe via MyYahoo
  • Subscribe via Google
  • Subscribe via MyMSN
  • Add this blog to my Technorati Favorites!

Archive for the 'Java' Category

Maven and Perforce: Forget about SCM Location

Wednesday, October 17th, 2007

Because of SCM-229, you no longer need to specify the <scm/> stuff in your POM. Because anything you checkout from Perforce always knows from where in the source it originated (via the ClientSpec), Maven can now dynamically determine where this code is, what should be labeled (during release), and won’t complain if this value is completely wrong.

This last point should be taken seriously though — putting a real value in the <scm/> element could lead to confusion. For my projects, I use an SCM section that looks like this:

...
<scm>
  <connection>scm:perforce://fake-scm-paths</connection>
  <developerConnection>scm:perforce://see-SCM-229</developerConnection>
</scm>
...

The point being that this is clearly a fake SCM location, but also points you to the reason why (SCM-229). This is especially useful when branching — you don’t need to update the SCM location in order to release your project from a branched location in source control.

Oh — one important thing to note is which version of the release plugin you are using. SCM-229 was fixed in version 1.0-beta-4 of maven-scm-provider-perforce, which is used in the 2.0-beta-6 version of the maven-release-plugin. So if you are not already explicitly declaring the versions of your plugins (you should be!), you’ll need to ensure your POM has this info:

<build>
  ...
  <plugins>
    ...
    <plugin>
      <artifactId>maven-release-plugin</artifactId>
      <version>2.0-beta-6</version>
    </plugin>
    ...
  </plugins>
  ...
</build>

Enjoy :)