You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Saminda Abeyruwan <sa...@gmail.com> on 2006/12/19 12:57:50 UTC

[M2] Profiles to select jar according to jdk version

Hi All,

I've face with the following problem. For our project we are using
bouncycastle jars. They have jdk 1.4 and 1.5  compatible versions. In our
project we have a root pom.xml as follows,

<project>
<!-- usual maven2 settings -->

<dependecyManagement>
    <!-- jars -->
</dependecyManagement>

<profiles>
        <profile>
            <id>jdk14</id>
            <activation>
                <jdk>1.4</jdk>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>bouncycastle</groupId>
                    <artifactId>bcprov-jdk13</artifactId>
                    <version>${bcprov.jdk13.version}</version>
                </dependency>
            </dependencies>

        </profile>

        <profile>
            <id>jdk15</id>
            <activation>
                <jdk>1.5</jdk>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>bouncycastle</groupId>
                    <artifactId>bcprov-jdk15</artifactId>
                    <version>${bcprov.jdk15.version}</version>
                </dependency>
            </dependencies>
        </profile>

    </profiles>



</project>

[This is a multimodule project ..]

According to the documentation, if I'm using jdk1.4, Maven2 build should
select  bcprov-jdk13.

But  even i  Use  mvn clean install or mvn clean install -Djdk14, the TEST
CASES would always select bcprov-jdk15 jar,due to this, when the test cases
are running we are always getting,

java.lang.UnsupportedClassVersionError:
org/bouncycastle/jce/provider/BouncyCastleProvider (Unsupported
major.minorversion
49.0)

Above is mainly due to jdk version problem.


There's no problems, If the build is running under Jdk1.5.

What should I do to rectify this for jdk 1.4

Thank you

Saminda

-- 
Saminda Abeyruwan

Software Engineer
WSO2 - www.wos2.org