Dear All,

I would like to ask if it is possible to define dependencies in Maven2
POM file to reflect the JRE version.  For example, I would like to use
commons-dbcp-1.3 in JRE 1.5 and commons-dbcp-1.4 in JRE 1.6.

Defining the corresponding profiles doesn't work - I am most probably
missing something.
 
   ....

        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>${dbcpVersion}</version>
        </dependency>
    ...
      <profile>
          <id>JRE5</id>
          <activation>
            <jdk>1.5</jdk>
            <property>
              <name>dbcpVersion</name>
              <value>1.3</value>
            </property>
          </activation>
        </profile>
        <profile>
          <id>JRE6</id>
          <activation>
            <jdk>1.6</jdk>
            <property>
              <name>dbcpVersion</name>
              <value>1.4</value>
            </property>
          </activation>
        </profile>   
      </profiles>

Best regards,
Nina Jeliazkova

Reply via email to