Is not possible? I'm using them. Take a look to my pom:

    <profiles>
        <profile>
            <id>development</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>env</name>
                    <value>dev</value>
                </property>
            </activation>
            <build>
                <filters>
                    <filter>
                        pom.dev.properties
                    </filter>
                </filters>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <groupId>org.apache.maven.plugins</groupId>
                        <version>2.1-beta-1</version>
                        <configuration>
                            <filtering>true</filtering>
                            <filters>
                                <filter>pom.dev.properties</filter>
                            </filters>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>test</id>
            <activation>
                <property>
                    <name>env</name>
                    <value>test</value>
                </property>
            </activation>
            <build>
                <filters>
                    <filter>
                        pom.test.properties
                    </filter>
                </filters>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <groupId>org.apache.maven.plugins</groupId>
                        <version>2.1-beta-1</version>
                        <configuration>
                            <filtering>true</filtering>
                            <filters>
                                <filter>pom.test.properties</filter>
                            </filters>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>pre-produccion</id>
            <activation>
                <property>
                    <name>env</name>
                    <value>pre</value>
                </property>
            </activation>
            <build>
                <filters>
                    <filter>
                        pom.pre.properties
                    </filter>
                </filters>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <groupId>org.apache.maven.plugins</groupId>
                        <version>2.1-beta-1</version>
                        <configuration>
                            <filtering>true</filtering>
                            <filters>
                                <filter>pom.pre.properties</filter>
                            </filters>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>produccion</id>
            <activation>
                <property>
                    <name>env</name>
                    <value>prod</value>
                </property>
            </activation>
            <build>
                <filters>
                    <filter>
                        pom.prod.properties
                    </filter>
                </filters>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <groupId>org.apache.maven.plugins</groupId>
                        <version>2.1-beta-1</version>
                        <configuration>
                            <filtering>true</filtering>
                            <filters>
                                <filter>pom.prod.properties</filter>
                            </filters>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

As you can see we are using 4 environment settings. In each one, we load a
different properties file to filter recources.

2009/10/19 Martin Trummer <martin.trum...@24act.com>

> hi,
>
> I've already read a lot about this
> seems, that it's not possible to set env-vars in a pom.xml or
> profiles.xml file in maven 2
> is that correct?
>
> does anyone know a workaround or a mini-plugin that allows to set those
> env vars?
>
> TIA, martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


-- 
"Computer science is not about computers any more than astronomy is about
telescopes." E.W. Dijkstra (1930-2002)

Reply via email to