Hi James,

Maven 3.2.0 (which is on the final stretch before a release) will require a
minimum version of Java 1.6 as the JVM that Maven runs as. So if you want
to fix an issue in Maven Core, the 3.2 line is the place where that will be
fixed... the fix has to compile and run on Java 1.6 or it will not work

Maven plugins follow the JVM requirements of the Maven Core version they
have as a <prerequisite>... if they claim any Maven version pre 2.2.1, then
that means you are Java 1.4... A file handle leak would be a good enough
reason to bump the minimum requires Maven so in your patch you could bump
that to at least 2.2.1 (that gets you onto Java 1.5 at least) but as 3.2.0
is not released, you cannot really go much further

FYI You have not listed Option 6:

Write a library to close URLClassLoaders... that library would be compiled
with -target 1.4 but only build using Java 1.7 and would basically wrap
your options 1 through 3 into a utility class so that if there is a
LinkerError thrown it falls back to various reflection-based attempts to
stem the leak. Make your utility class Apache License v2 and we can suck it
in as a dependency to any affected plugins and just make the call... that
way you don't need to worry about build JVM requirements, etc

HTH

-Stephen



On 30 January 2014 08:38, James Nord (jnord) <[email protected]> wrote:

> Hi All,
>
> 1.    I have discovered a few file handle leaks in core plugins  - which
> leads to random build failures with large multi-module projects.
>
> Before I go and make & submit some changes I wanted to ask what's likely
> to be accepted (in the case where this is classloader related[1]).
>
>
> 1)    Use JDK7 only and call URLClassLoader.close()
>
> 2)    Use reflection to do the same (would only fix the issue when run on
> JDK7+)
>
> 3)    Use reflection to access Oracle private methods in JDK<7 and generic
> in JDK7+ (would not work when run on non oracle JVMs <7)
>
> 4)    Write a custom Classloader (may not get all the securityManager
> aspects correct)
>
> 5)    Use someone elses ClassLoader (e.g eclipse - what licences are
> available to use for deps in core plugins?)
> /James
>
> [1] http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4950148
>

Reply via email to