You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kent Närling <ke...@seamless.se> on 2008/10/30 09:13:36 UTC

Fallback strategy for buildnumber plugin?

Anyone knows if there is a way to configure a fallback strategy for the
buildnumber plugin when a project is not yet in the SCM?
The background is this:

It makes sense to add a company wide buildnumber strategy to the company
POM, ok?

However if you create a new project you might want to be able to build it
before adding it to the SCM?
Right now (if you use the company POM) this will fail since the buildnumber
plugin fails if it is not is added to the SCM (at least with SVN)

Re: Fallback strategy for buildnumber plugin?

Posted by Wendy Smoak <ws...@gmail.com>.
On Thu, Oct 30, 2008 at 1:13 AM, Kent Närling <ke...@seamless.se> wrote:
> Anyone knows if there is a way to configure a fallback strategy for the
> buildnumber plugin when a project is not yet in the SCM?
> The background is this:

It also causes a problem when trying to build from a source
distribution.  We ran into this in Continuum and Olivier put
buildnumber in a profile that is activated by the presence of the .svn
directory:

http://svn.apache.org/repos/asf/continuum/trunk/pom.xml

<profile>
      <id>buildnumber</id>
      <activation>
        <file>
          <exists>.svn</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>buildnumber-maven-plugin</artifactId>
...

(I think the plugin could probably be made a bit smarter about when it
should execute, but I haven't checked into it further.)

HTH,
-- 
Wendy

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


Re: Fallback strategy for buildnumber plugin?

Posted by Dirk Olmes <di...@xanthippe.ping.de>.
Kent Närling wrote:
> Anyone knows if there is a way to configure a fallback strategy for the
> buildnumber plugin when a project is not yet in the SCM?
> The background is this:
> 
> It makes sense to add a company wide buildnumber strategy to the company
> POM, ok?
> 
> However if you create a new project you might want to be able to build it
> before adding it to the SCM?
> Right now (if you use the company POM) this will fail since the buildnumber
> plugin fails if it is not is added to the SCM (at least with SVN)

We have put the buildnumber plugin in a profile that has the following
activation:

<activation>
    <property>
        <!--
                This profile is activated if NO system property
                'skipBuildnumber' is found. Disable this profile
                by specifying -DskipBuildnumber=true on the commandline
        -->
        <name>!skipBuildnumber</name>
    </property>
</activation>

-dirk


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