Posted by: Marek | March 21, 2009

Compiling production and test code with different settings

Even tough CLDC and MIDP applications need to be compiled to Java 1.3, it is often convenient to compile the test code with different settings so that Java features like annotations or generics can be used in test cases. The following example shows how to achieve that:





































Note that the testCompile goal needs to be bound to the process-test-sources rather than test-compile, otherwise it will not work correctly (tested with Maven 2.0.9). This seems to be a bug in Maven.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: