OK, this apt file is not in synch with current public maven site, so
searching "You can use any JDK to compile" had no result.
Here is my patch
Brett Porter a écrit :
maven-compiler-plugin/src/site/apt/examples/compile_using_different_jdk.apt
On 7/07/2006 8:29 PM, Nicolas De Loof wrote:
Looking in maven-compiler-plugin I don't find the howto document.
Did I miss something ?
Nicolas De Loof a écrit :
I'll checkout maven-compiler-plugin from SVN and prepare a doc patch.
Brett Porter a écrit :
This is a good alternative. I think it should be added to the
documentation (both approaches should be documented).
Can you provide a patch?
Thanks,
Brett
On 5/07/2006 5:33 PM, Nicolas De Loof wrote:
I've read on
http://maven.apache.org/plugins/maven-compiler-plugin/howto.html
the "official" way to compile a Java1.3 application.
I think this solution isn't the best/easier as this requires the
target environment to have the expected JDK installed and the
correct properties set, with no standard naming for it.
I myself get troubles with it as I can run JDK1.3 on my nightly
build server (Linux Ubuntu : requires some "stdlibc++libc6....")
I'm using an alternative solution that has less expectation on the
compilation environment :
- Add a dependency to target runtime in the compiler plugin
configuration
- Set the compiler bootclasspaht to use it
<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>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>rt</artifactId>
<version>1.3.1_08</version>
</dependency>
</dependencies>
</plugin>
This solution only requires the to install first the expected
rt.jar in repo, as any others java API jars (com.sun:rt POM is in
maven2 repo).
Don't you think this solution may be promoted on compiler plugin
documentation ?
Niso.
This message contains information that may be privileged or
confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are
not the intended recipient, you are not authorized to read,
print, retain, copy, disseminate, distribute, or use this message
or any part thereof. If you receive this message in error, please
notify the sender immediately and delete all copies of this message.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This message contains information that may be privileged or
confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not
the intended recipient, you are not authorized to read, print,
retain, copy, disseminate, distribute, or use this message or any
part thereof. If you receive this message in error, please notify
the sender immediately and delete all copies of this message.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This message contains information that may be privileged or
confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not
the intended recipient, you are not authorized to read, print,
retain, copy, disseminate, distribute, or use this message or any
part thereof. If you receive this message in error, please notify
the sender immediately and delete all copies of this message.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This message contains information that may be privileged or confidential and is
the property of the Capgemini Group. It is intended only for the person to whom
it is addressed. If you are not the intended recipient, you are not authorized
to read, print, retain, copy, disseminate, distribute, or use this message or
any part thereof. If you receive this message in error, please notify the
sender immediately and delete all copies of this message.
Index: compile_using_different_jdk.apt
===================================================================
--- compile_using_different_jdk.apt (revision 419851)
+++ compile_using_different_jdk.apt (working copy)
@@ -33,4 +33,32 @@
</build>
[...]
</project>
-+-------
\ No newline at end of file
++-------
+
+
+ An alternative is to install the rt.jar from your target JRE in your local
repo using
+ standardized maven groupId "com.sun", and configure the compiler plugin to
use it
+ as bootclasspath for javac using <<<compilerArguments>>> :
+
++-------
+<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>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>rt</artifactId>
+ <version>1.3.1_08</version>
+ </dependency>
+ </dependencies>
+</plugin>
++-------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]