Enterprise Java Development@TOPIC@

Chapter 11. Maven Profiles

11.1. Profile Definition
11.2. Activation
11.2.1. Explicit Activation/Deactivation
11.2.2. Activation/Deactivation By Rule

<profile> <!-- defines our default database -->
        <id>h2db</id>
        <properties>
              <jdbc.driver>org.h2.Driver</jdbc.driver>
              <jdbc.url>jdbc:h2:\${basedir}/target/h2db/ejava</jdbc.url>
              <jdbc.user>sa</jdbc.user>
              <jdbc.password/>
              <hibernate.dialect>
                  org.hibernate.dialect.H2Dialect
              </hibernate.dialect>
        </properties>
        <dependencies>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </profile>

The example above defines the properties and dependencies for the H2 database driver when the h2db profile is active