Maven Создание нескольких профилей за один раз

Наша политика - построить только 1 развертываемый jar. все конфигурации, зависящие от среды, хранятся отдельно, и мы создаем их все вместе сразу. поэтому в нашем текущем процессе Ant у нас есть файл свойств для каждой среды, мы перебираем их и создаем набор файлов конфигурации для каждой среды.

В моем текущем POM XML я ' m может создать только один профиль, указанный в командной строке. Можно ли этого добиться с помощью Maven?

Вот некоторые из соответствующих частей POM.xml

<!-- Define profiles here and make DEV as default profile -->
<profiles>

    <!-- dev Profile -->
    <profile>
        <id>dev</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
    </profile>

    <!-- qa Profile -->
    <profile>
        <id>qa</id>
        <properties>
            <env>qa</env>
        </properties>
    </profile>

    <!-- prod Profile -->
    <profile>
        <id>prod</id>
        <properties>
            <env>prod</env>
        </properties>
    </profile>

</profiles>
...


<plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.4.3</version>

    <executions>
        <execution>

            <phase>validate</phase>
            <goals>
                <goal>copy-resources</goal>
            </goals>

            <configuration>

                <filters>
                    <filter>env/${env}.properties</filter>
                </filters>

                <outputDirectory>${project.build.directory}/config/${env}
                </outputDirectory>
                <resources>
                    <resource>

                        <filtering>true</filtering>

                        <directory>${basedir}/src/main/config/default
                        </directory>
                        <includes>
                            <include>*.xml</include>
                            <include>*.properties</include>
                        </includes>
                    </resource>

.....

Спасибо, Prabhjot

17
задан Sean Patrick Floyd 8 February 2011 в 12:35
поделиться