i dont believe <regular>expression parsing is currently available but you can 
modify org.apache.maven.profiles.Activation.java
package org.apache.maven.profiles;
@SuppressWarnings( "all" )
public class Activation
    implements java.io.Serializable
{
/* The conditions within the build runtime environment which will trigger  the 
automatic inclusion of the parent build profile. @version $Revision$ $Date$ */
@SuppressWarnings( "all" )
    /**
     *              Specifies that this profile will be activated based on 
existence of a file.              
     */
    private ActivationFile file;

      //-----------/
     //- Methods -/
    //-----------/

    /**
     * Get specifies that this profile will be activated based on
     * existence of a file.
     * @return ActivationFile
     */

    /**
     * Set specifies that this profile will be activated based on
     * existence of a file.
     * @param file
     */
    public void setFile( ActivationFile file )
    {
        this.file = file;            //*************Modify this code to acceept 
a Regular Expression and return a ActivationFile***********
    } //-- void setFile( ActivationFile )
}

<!-- you can implement <exists>FileNameToTestOn</exists> as seen here -->
<!-- the canonical-buildnumber profile is activated when literal .svn file is 
detected in current folder -->
<!-- existing exists code which will activate a profile called 
canonical-buildnumber -->
    <profile>
      <id>canonical-buildnumber</id>
      <activation>
        <file>
          <exists>.svn</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>buildnumber-maven-plugin</artifactId>
            <version>1.0-beta-1</version>
            <executions>
              <execution>
                <phase>generate-resources</phase>
                <goals>
                  <goal>create</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <doCheck>false</doCheck>
              <doUpdate>false</doUpdate>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

HTH
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> Date: Sat, 14 Nov 2009 09:20:29 -0500
> Subject: Re: properties in settings.xml
> From: sony.ant...@gmail.com
> To: users@maven.apache.org
> 
> The <file>,exists> block was inside <activation> right ?
> 
> <profiles>
> <profile>
> ...
> <activation>
> <file><exists>${nsis.path}</exists></file>
> </activation>
> 
>  ...
> <profile>
> <profiles>
> 
> --sony
> 
> On Fri, Nov 13, 2009 at 10:43 PM, James Russo <j...@halo3.net> wrote:
> 
> > Hello,
> >
> >        I have a project which uses nsis to create an installer, but NSIS
> > isn't available on all of the platforms which I build the project, and I'd
> > like it to skip making the NSIS when the makensis isn't available. I'd like
> > to make the path to NSIS be configurable in the ~/.m2/settings.xml, so I add
> > it to a "default" profile which I created having a bunch of other
> > properties:
> >
> >
> >  <profiles>
> >    <profile>
> >      <id>default</id>
> >      <properties>
> >
> >  <database.driverClassName>org.postgresql.Driver</database.driverClassName>
> >        <database.url>jdbc:postgresql://localhost/test</database.url>
> >        <database.user>user</database.user>
> >        <database.password>password</database.password>
> >        <cargo.tomcat.manager.url>http://localhost:8081/manager
> > </cargo.tomcat.manager.url>
> >        <cargo.remote.username>manager</cargo.remote.username>
> >        <cargo.remote.password>password</cargo.remote.password>
> >        <customer.webapp.context>/</customer.webapp.context>
> >        <client.webapp.context>/client</client.webapp.context>
> >        <nsis.path>/usr/local/nsis/nsis-2.45/bin/makensis</nsis.path>
> >        <!--
> >                Introduced by Hudson, uncomment if not being used via
> > hudson.
> >        <BUILD_NUMBER>dev-build</BUILD_NUMBER>
> >        <SVN_REVISION>unknown</SVN_REVISION>
> >        -->
> >      </properties>
> >    </profile>
> >  </profiles>
> >
> > So, I have a nsis.path defined in there.  However, I am trying to activate
> > the profile in my pom and neither way works. I've tried to just
> > activate the profile in the pom based on presence of nsis.path variable and
> > that doesn't work. And then I've also tried to do:
> >
> > <file><exists>${nsis.path}</exists></file>
> >
> > and that doesn't work either.
> >
> > How can I accomplish this? I could activate it manually with -P, but I'd
> > rather just have everything in the settings.xml file since I need to visit
> > that to setup the environment anyways.
> >
> > thanks!
> >
> > -jr
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >
                                          
_________________________________________________________________
Hotmail: Trusted email with Microsoft's powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141664/direct/01/
http://clk.atdmt.com/GBL/go/177141664/direct/01/

Reply via email to