You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Laird Nelson <lj...@gmail.com> on 2010/12/16 22:20:15 UTC

Known bugs in profile activation in Maven 3.0.1?

I have default properties listed in my pom like this:

<properties>
  <liquibaseTestingEnabled>false</liquibaseTestingEnabled>
  <testHibernateHbm2DdlAuto>create</testHibernateHbm2DdlAuto>

<testEclipseLinkDdlGeneration>drop-and-create-tables</testEclipseLinkDdlGeneration>

<testOpenJPAJdbcSynchronizeMappings>buildSchema(foreignKeys=true)</testOpenJPAJdbcSynchronizeMappings>
</properties>

I have a profile that is activated like this:

<profile>
      <id>liquibase</id>
      <activation>
        <file>

<exists>src/main/resources/META-INF/liquibase/changelog.xml</exists>
        </file>
        <property>
          <name>liquibaseTestingEnabled</name>
          <value>true</value>
        </property>
      </activation>
      <properties>
        <testHibernateHbm2DdlAuto>false</testHibernateHbm2DdlAuto>
        <testEclipseLinkDdlGeneration>none</testEclipseLinkDdlGeneration>

<testOpenJPAJdbcSynchronizeMappings>validate</testOpenJPAJdbcSynchronizeMappings>
      </properties>
    </profile>

When I run help:effective-pom without any command line arguments, and with
an existing src/main/resources/META-INF/liquibase/changelog.xml file, the
properties section of the effective pom contains this:

<properties>
  <liquibaseTestingEnabled>false</liquibaseTestingEnabled>
        <testHibernateHbm2DdlAuto>false</testHibernateHbm2DdlAuto>
        <testEclipseLinkDdlGeneration>none</testEclipseLinkDdlGeneration>

<testOpenJPAJdbcSynchronizeMappings>validate</testOpenJPAJdbcSynchronizeMappings>
      </properties>

Note that although I have not specified one of the conditions for profile
activation, that profile's property settings have been applied.  It's like
the profile was activated, even though one of its conditions for
activation--namely the presence of a liquibaseTestingEnabled property whose
value is true--is not in fact true.

mvn help:active-profiles does not list the liquibase profile in its output.

The output of effective pom also doesn't list a <profiles> section at all.

Um, what on earth is going on here?

Thanks,
Laird