maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kieran Brady" <kieran.br...@teamcgi.net>
Subject Re: Best practices for multi-flavour build?
Date Thu, 08 Jun 2006 07:46:29 GMT
Sure! The below is from one of our webapps.

  <!-- ... -->
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources/filtered</directory>
      </resource>
      <resource>
        <directory>src/main/profiles/${delivery.name}/resources</directory>
      </resource>
      <resource>
        <targetPath>../${delivery.finalName}</targetPath>
        <filtering>true</filtering>
        <directory>src/main/webapp-filtered</directory>
      </resource>
      <resource>
        <targetPath>../${delivery.finalName}</targetPath>
        <directory>src/main/webapp</directory>
      </resource>
      <resource>
        <targetPath>../${delivery.finalName}</targetPath>
        <directory>src/main/profiles/${delivery.name}/webapp</directory>
      </resource>
    </resources>
    <finalName>${delivery.finalName}</finalName>
    <filters>
      <filter>src/main/profiles/${delivery.name}/general-filter.properties</filter>
      <filter>src/main/profiles/${delivery.name}/${environment.name}-filter.properties</filter>
      <filter>src/main/resources/${operatingsys.name}-filter.properties</filter>
    </filters>

 <!-- ... Some more build stuff, plugins etc -->

  </build>
  <profiles>
   <profile>
    <profile>
      <id>demo</id>
      <activation>
        <property>
          <name>delivery.name</name>
          <value>demo</value>
        </property>
      </activation>
      <properties>
        <delivery.finalName>Demo</delivery.finalName>
        <delivery.name>demo</delivery.name>
      </properties>
    </profile>
    <profile>
      <id>windows</id>
      <activation>
        <property>
          <name>operatingsys.name</name>
          <value>windows</value>
        </property>
      </activation>
      <properties>
        <operatingsys.name>windows</operatingsys.name>
        <app.home>c:/app</app.home>
      </properties>
    </profile>
    <profile>
      <id>unix</id>
      <activation>
        <property>
          <name>operatingsys.name</name>
          <value>unix</value>
        </property>
      </activation>
      <properties>
        <operatingsys.name>unix</operatingsys.name>
        <app.home>/home/app</app.home>
      </properties>
    </profile>
    <profile>
      <id>dev</id>
      <activation>
        <property>
          <name>environment.name</name>
          <value>dev</value>
        </property>
      </activation>
      <properties>
        <environment.name>dev</environment.name>
      </properties>
    </profile>
    <profile>
      <id>test</id>
      <activation>
        <property>
          <name>environment.name</name>
          <value>test</value>
        </property>
      </activation>
      <properties>
        <environment.name>test</environment.name>
      </properties>
    </profile>
    <profile>
      <id>live</id>
      <activation>
        <property>
          <name>environment.name</name>
          <value>live</value>
        </property>
      </activation>
      <properties>
        <environment.name>live</environment.name>
      </properties>
    </profile>
  </profiles>

  <!-- ... Dependencies etc -->


  <!-- Now the default settings for when no profiles are passed in 
externally -->
  <properties>
      <operatingsys.name>windows</operatingsys.name>
      <environment.name>dev</environment.name>
      <delivery.name>demo</delivery.name>
  </properties>
</project>
----- Original Message ----- 
From: "badaud" <vcm3wrt02@sneakemail.com>
To: <users@maven.apache.org>
Sent: Thursday, June 08, 2006 8:17 AM
Subject: Re: Best practices for multi-flavour build?


>
> Using build profiles is what I intended to do.
>
> My main concern is: as Maven usually uses fixed directories for most of 
> the
> tasks, how should I structure my project to easily maintain the different
> configuration files/class files?
>
> Coudl you provide some samples of your pom files?
>
> Thank you
> --
> View this message in context: 
> http://www.nabble.com/Best-practices-for-multi-flavour-build--t1741483.html#a4767318
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


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


Mime
View raw message