just FYI I have created a branch here
https://github.com/sonatype/plexus-compiler/tree/PLXCOMP-1
This supports 1.5 and javax.tools if available in the user env.

I have noticed some perf degradation testing the pull request
https://github.com/sonatype/plexus-compiler/pull/6.
Using  JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
for each compilation is very slower.

So I have tried to mimic similar stuff as done with current Javacc
(the reuseStrategy see
http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#compilerReuseStrategy
). NOTE that's a *very* basic pool mechanism :-).

As I have no idea if the compiler is threadsafe or not (it's not
documented to be thread safe in javadoc but at least javadoc samples
says it can be reused for future compilation). Tests on my env (osx +
java  1.6.0_37) looks to say yes.

In compiler plugin (not committed yet), I have added a flag to disable
use of javax.tools usage (as it if that breaks on some os/jdk users
will be able to disable it even if that's detected to be usable)

WDYT ?

2012/10/1 Stephen Connolly <stephen.alan.conno...@gmail.com>:
> On 28 September 2012 18:15, John Casey <jdca...@commonjava.org> wrote:
>
>> On 9/28/12 12:08 PM, Mark Struberg wrote:
>>
>>> +1
>>>
>>> Imo this comes hand in hand with moving maven-core to 1.6 as well and a
>>> version bump to mvn-3.2.0 or even mvn-3.5.0
>>>
>>> We might create a documentation page about "Strategies for targeting
>>> older Java versions" which outlines the animal-sniffer, etc
>>>
>>> LieGrue,
>>> strub
>>>
>>
>> I think the plugin could be a sort of advance guard for the core itself,
>> since people can still use the core + the older version of the compiler
>> plugin to run on 1.5...
>>
>> I wouldn't want to get mired in a discussion about when we're going to
>> move the core up to 1.6, since that's a bit more work.
>>
>>
> There is the Toolchains issue.
>
> At present, AFAIK we can use Toolchains to run Maven with Java 1.6 and
> compile with Java 1.3.
>
> Surefire supports running tests via toolchains down to Java 1.3 IIRC
>
> If we are doing something that makes this kind of thing impossible *even
> via toolchains* then my feeling is that I am -1.
>
> If we can find a way (more indirection please, it solves all problems don't
> you know) to allow this to work *and* retain toolchains support for
> compiling with JDK 1.3 then +1.
>
>
>>
>>
>>>
>>>
>>>
>>> ----- Original Message -----
>>>
>>>> From: John Casey <jdca...@commonjava.org>
>>>> To: Maven Developers List <dev@maven.apache.org>
>>>> Cc:
>>>> Sent: Friday, September 28, 2012 6:53 PM
>>>> Subject: PLXCOMP-1 and improving compiler-message parsing
>>>>
>>>> Hi everyone,
>>>>
>>>> There's a new patch to the plexus-compiler libraries which improves the
>>>> parsing of the output messages, especially for annotation processing.
>>>> Previously, a lot of non-error messages caused plexus-compiler (and
>>>> thereby,
>>>> Maven) to think a compilation error had occurred. The patch fixes this
>>>> by using
>>>> the javax.tools APIs to work with in-process compilation.
>>>>
>>>> The patch is here:
>>>>
>>>> https://github.com/sonatype/**plexus-compiler/pull/6<https://github.com/sonatype/plexus-compiler/pull/6>
>>>>
>>>>
>>>> The issue is here (it's been out there for a LONG time, as you can see:
>>>>
>>>> http://jira.codehaus.org/**browse/PLXCOMP-1<http://jira.codehaus.org/browse/PLXCOMP-1>
>>>>
>>>>
>>>> The javax.tools APIs are JDK 1.6+ IIRC, so merging this patch would
>>>> effectively
>>>> drag the future of the maven-compiler-plugin up to requiring JDK 1.6.
>>>> Personally, since JDK 1.5 has been out almost as long as I've been coding
>>>> (well, not too far), I don't see the problem. Remember, we're not asking
>>>> people to upgrade their production VM, only the build-time version...and
>>>> we have
>>>> documented strategies for targeting older VM versions successfully.
>>>>
>>>> We might look at strategies for degrading gracefully in case someone is
>>>> using
>>>> JDK 1.5, but IMO we need to be very careful about this. For instance, I
>>>> wouldn't want people to wind up with unexplained, random new errors
>>>> because
>>>> they accidentally set their $PATH wrong. But maybe we could give them a
>>>> large
>>>> warning then switch over to forked-mode compilation in this case?
>>>>
>>>> I'd really hate to see this patch go unmerged because we're stuck
>>>> supporting JDK 1.5...or if we do reject it on these grounds, maybe we
>>>> need to
>>>> talk about when it's reasonable to jump ship on 1.5 if not now?
>>>>
>>>> I'd LIKE to merge this patch, release plexus-compiler, and document how
>>>> to
>>>> use it as a plugin-level dependency...then make the move to 1.6 for the
>>>> compiler
>>>> plugin.
>>>>
>>>> Thoughts?
>>>>
>>>> -john
>>>>
>>>> -- John Casey
>>>> Developer, PMC Member - Apache Maven (http://maven.apache.org)
>>>> GitHub - http://github.com/jdcasey
>>>>
>>>> ------------------------------**------------------------------**
>>>> ---------
>>>> To unsubscribe, e-mail: 
>>>> dev-unsubscribe@maven.apache.**org<dev-unsubscr...@maven.apache.org>
>>>> For additional commands, e-mail: dev-h...@maven.apache.org
>>>>
>>>>
>>> ------------------------------**------------------------------**---------
>>> To unsubscribe, e-mail: 
>>> dev-unsubscribe@maven.apache.**org<dev-unsubscr...@maven.apache.org>
>>> For additional commands, e-mail: dev-h...@maven.apache.org
>>>
>>>
>>
>> --
>> John Casey
>> Developer, PMC Member - Apache Maven (http://maven.apache.org)
>> GitHub - http://github.com/jdcasey
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: 
>> dev-unsubscribe@maven.apache.**org<dev-unsubscr...@maven.apache.org>
>> For additional commands, e-mail: dev-h...@maven.apache.org
>>
>>



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to