geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick McGuire <>
Subject Re: Maven compiler & endorsed libraries
Date Wed, 07 Apr 2010 09:47:44 GMT
On 4/6/2010 5:23 PM, Jarek Gawor wrote:
> I came up with one solution (committed in revision 931319).
> In this solution I created a maven-property-plugin which executes in
> the "validate" phase and sets "bootClassPath" system property. The
> value of "bootClassPath" property is set to
> -Xbootclasspath/p:<path><pathSeparator><path>... string where each
> <path>  is the jar file to prepend to boot classpath. The
> "bootClassPath" property is then used in maven-compiler-plugin and
> maven-surefire-plugin and passed as a java/javac argument.
> This seems to work for me but I'm wondering if it works for other
> people on different OSes and JVMs (especially on Windows and on
> non-Sun JVMs).
What's driving the need for doing this?  Generally, prepending something 
to the bootstrap classpath is considered very bad form.  The JVM 
supported method for overriding bootstrap classes is the endorsed 
directory path.  I took another look at what Yoko does to get around 
this problem, and it appears the mavan-compiler-plugin and surefire 
plugins have all the support you need.  Here are some snippets from the 
Yoko core subproject.  To compile this code, it requires the 
yoko-corba-spec classes rather than the JVM provided ones.   The build 
contains the following build steps:

1)  Get the required jars into an endorsed directory:  This is done 
using the dependency plugin.


2)  Compile the code with a specified endorsed dir.  This is handled 
using the maven-comiler-plugin:


3)  Run the unit tests with the same endorsed dir:


I knew about steps 1&3, but I just discovered step 2 when I double 
checked after seeing your solution.  This solution really should be used 
rather than overriding the bootClasspath.


> Jarek
> On Fri, Apr 2, 2010 at 2:08 PM, Jarek Gawor<>  wrote:
>> Hi,
>> We need to find a way to make the compiler in Maven to load certain
>> libraries as endorsed libraries. I know this has been discussed before
>> but do we have some specific solutions for this problem? We will need
>> to deal with this fairly soon now - for example to implement the
>> @Resource.lookup support.
>> Jarek

View raw message