It sounds like you have 2 artifacts at the end.

One that is compiled and built with 1.5 and will run under 1.5 JVM and probably under 1.6 JVM
One that is compiled and built with 1.6 and will not run under 1.5 JVM.

It seems that these are 2 different artifacts and should have different ArtifactIDs (or at least classifiers).

Can you isolate the code that does not cause any problem and compiles under both? Make that a jar on its own and then make two projects with the VM dependent code.

At some point you will probably drop support for 1.5 and your 1.6 code will start to look a lot different as you take advantage of the rest of the features of 1.6.

Alternatively you could just build and compile under 1.5 until you are ready to drop support for 1.5 in the same way that you no longer support 1.4.

Ron

On 23/07/2012 11:26 AM, Andreas Riedel wrote:
Hello users,

I have the following problem:
   - One system must be compiled with two different JDK.
   - I have two test suites, one for smoke test, one for all.

Base scenario:
   - Two profiles, 'SmokeTest' activate by default, 'All' activate by
     switch -P.
   - One additional profile with dependencies only required for build by
     JDK 1.5. At JDK 1.6 these dependencies are part of the JDK itself.

In the POM this is realize as follow:
   <profiles>
     <profile>
       <id>smokeTest</id>
       <activation>
         <activeByDefault>true</activeByDefault>
       </activation>
       <build>
         <plugins>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
               <suiteXmlFiles>
                 <suiteXmlFile>src/test/misc/smoke.testng.xml</suiteXmlFile>
               </suiteXmlFiles>
             </configuration>
           </plugin>
         </plugins>
       </build>
     </profile>
     <profile>
       <id>jdk__1_5</id>
       <activation>
         <jdk>1.5</jdk>
       </activation>
       <dependencies>
         ...........
       </dependencies>
     </profile>
     <profile>
       <id>broadsideTest</id>
       <build>
         <plugins>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
               <suiteXmlFiles>
                 <suiteXmlFile>......</suiteXmlFile>
                 <suiteXmlFile>......</suiteXmlFile>
                 <suiteXmlFile>......</suiteXmlFile>
                 <suiteXmlFile>......</suiteXmlFile>
                 <suiteXmlFile>......</suiteXmlFile>
                 <suiteXmlFile>......</suiteXmlFile>
                 <suiteXmlFile>......</suiteXmlFile>
                 <suiteXmlFile>......</suiteXmlFile>
               </suiteXmlFiles>
             </configuration>
           </plugin>
         </plugins>
       </build>
     </profile>
   </profiles>

<<<<<<<<<<<<<<<<


What I need:
   - Default test to run should always be the smoketest.
   - Under JDK 1.5 the dependencies should be included, but the smoke
     test should also run.

And this is the problem:
   - Under jdk 1.6 it works correct.
   - With JDK 1.5 the profile for JDK 1.5 is taken. I understand the
     logic, but for this scenario it is wrong.
     It should be taken the dependencies from JDK 1.5 profiles and
     additionally the smoketest should run.
   - This means, the default behaviour should be something like:
     >>>
     mvn help:active-profiles -P smokeTest
The following profiles are active:
      - smokeTest (source: pom)
      - jdk__1_5 (source: pom)
     <<<
Any idea what would be the best way to realize this?

TIA
   Andraes

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




--
Ron Wheeler
President
Artifact Software Inc
email: [email protected]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to