Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Maven User
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<p>In <a href="http://www.nabble.com/-solved--product-codes-at-java-1.4%2C-test-sources-at-java-1.5-t2233884.html">this thread</a>, Nicolas De Loof writes:</p> <p>I solved the issue of compiling the application code for Java 1.3 AND<br /> using java5 for tests :</p> <p>Application code is compiled based on java 1.3 using compiler<br /> bootclasspath argument.</p> <p>Tests are compiled by adding a compiler execution prior to test-phase<br /> (as I didn't find a way to configure testCompile to use a != configuration).</p> <p>Here is my POM :</p> <table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.3</source> <target>1.3</target> <compilerArguments> <bootclasspath>${settings.localRepository}/com/sun/rt/1.3.1_08/rt-1.3.1_08.jar</bootclasspath> </compilerArguments> </configuration> <executions> <execution> <id>compile-tests</id> <phase>process-test-sources</phase> <goals> <goal>testCompile</goal> </goals> <configuration> <source>1.5</source> <target>1.5</target> <compilerArguments> <bootclasspath> ${java.home}/lib/rt.jar </bootclasspath> </compilerArguments> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>rt</artifactId> <version>1.3.1_08</version> </dependency> </dependencies> </plugin> </pre></td></tr></table> <p>Please note this is only a maven2 hack. Tests are compiled prior to the "test-compile" phase to allow compiler configuration substitution. A better solution should be to have support for separate configuration of the compiler plugin for compile and test-compile phases. </p> <table class="wysiwyg-macro" data-macro-name="tip" data-macro-parameters="title=Handy Hint" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e3RpcDp0aXRsZT1IYW5keSBIaW50fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"> <p>If you have to set more than one jar in your bootClasspath you need to separate them according to your platform (';' on Windows and ':' on Unix). The simplest way to support multi-plateform environment is to use ${path.separator} so you would have for example :</p> <table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> <bootclasspath>${settings.localRepository}/com/sun/rt/1.4.2_13/rt-1.4.2_13.jar${path.separator}${java.home}/lib/jsse.jar${path.separator}${java.home}/lib/jce.jar</bootclasspath> </pre></td></tr></table></td></tr></table> <p>In this thread:</p> <p><a href="http://mail-archives.apache.org/mod_mbox/maven-users/200702.mbox/%3C8770432.post@talk.nabble.com%3E">http://mail-archives.apache.org/mod_mbox/maven-users/200702.mbox/%3C8770432.post@talk.nabble.com%3E</a></p> <p>James Wiltshire found a way to obtain the desired result without needing to specify the bootclasspath.</p> <p>An example that has source and target at 1.4 and 1.5 for production and test source, respectively:</p> <table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <executions> <execution> <id>java-1.4-compile</id> <phase>compile</phase> <goals> <goal>compile</goal> </goals> <configuration> <source>1.4</source> <target>1.4</target> </configuration> </execution> <execution> <id>java-1.5-compile</id> <phase>process-test-sources</phase> <goals> <goal>testCompile</goal> </goals> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </execution> </executions> </plugin> </plugins> </build> </pre></td></tr></table> <p>The above example is known to work with Maven 2.0.9.</p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced