You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jeff Care <ca...@gmail.com> on 2012/12/12 19:57:39 UTC

What's new in maven-compiler-plugin 3.0?

Is there any documentation about what's new in maven-compiler-plugin 3.0
over the 2.5.1 version? I scoured the project site & found nothing; various
Google searches have also found nothing.

After switching to maven-compiler-plugin 3.0 I'm seeing compilation
problems that do not show up when using the 2.5.1 version, nor do they show
up in Eclipse.

Re: What's new in maven-compiler-plugin 3.0?

Posted by Jeff Care <ca...@us.ibm.com>.
Wayne Fay wrote
> Would be great if you could switch back to 3.0 and try again, then
> report back with the error details (ideally with a small sample) so it
> can be looked into and resolved if it is a problem/bug.

Just responded to Anders with details of additional testing.

Bottom line, 3.0 works for me single-threaded, or multithreaded when
*forceJavacCompilerUse* is true, but fails otherwise.

Unfortunately my small sample wasn't able to reproduce the problem. My hunch
is that our combination of a large project (~150 modules) & multi-threading
(-T 2C on a 24-way box) is exposing a problem that a "small" sample wouldn't
expose.



--
View this message in context: http://maven.40175.n5.nabble.com/What-s-new-in-maven-compiler-plugin-3-0-tp5738129p5738311.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: What's new in maven-compiler-plugin 3.0?

Posted by Wayne Fay <wa...@gmail.com>.
> These were errors, not warnings. I've since switched back to 2.5.1 so I
> don't have the exact messages but the one I specifically remember was a
> purported syntax error (class, interface or enum expected) on the same line
> (or one previous to) as the location of the package declaration. As I
> mentioned, the same file compiles fine after switching back to 2.5.1 & also
> compiles fine in Eclipse.

Would be great if you could switch back to 3.0 and try again, then
report back with the error details (ideally with a small sample) so it
can be looked into and resolved if it is a problem/bug.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: What's new in maven-compiler-plugin 3.0?

Posted by Jeff Care <ca...@us.ibm.com>.
Wayne Fay wrote
> Can you be more specific (with error messages etc), or perhaps even
> create a little sample Maven project to share that demonstrates the
> issues you're seeing? Eclipse has its own compiler so it is not
> necessarily true that no failures in Eclipse means no failures when
> compiling with Oracle's JDK.

These were errors, not warnings. I've since switched back to 2.5.1 so I
don't have the exact messages but the one I specifically remember was a
purported syntax error (class, interface or enum expected) on the same line
(or one previous to) as the location of the package declaration. As I
mentioned, the same file compiles fine after switching back to 2.5.1 & also
compiles fine in Eclipse.

I attempted to put together a small test case but I wasn't able to replicate
the problem. This build is very large (~150 modules) & we are using
multithreading; my supposition is that there's some combination of things
that is messing up the compiler.

I will be experimenting with single threading on 3.0 to see if I can
replicate the problem that way on the real build.



--
View this message in context: http://maven.40175.n5.nabble.com/What-s-new-in-maven-compiler-plugin-3-0-tp5738129p5738296.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: What's new in maven-compiler-plugin 3.0?

Posted by Wayne Fay <wa...@gmail.com>.
> Is there any documentation about what's new in maven-compiler-plugin 3.0
> over the 2.5.1 version? I scoured the project site & found nothing; various
> Google searches have also found nothing.

---------- Forwarded message ----------
From: Olivier Lamy <ol...@apache.org>
Date: Mon, Nov 19, 2012 at 2:29 AM
Subject: [ANN] Maven Compiler Plugin 3.0 Released
To: announce@maven.apache.org, Maven Users List <us...@maven.apache.org>
Cc: Maven Developers List <de...@maven.apache.org>


The Maven team is pleased to announce the release of the Maven
Compiler Plugin, version 3.0

...snip...

Release Notes - Maven 2.x Compiler Plugin - Version 3.0

** Bug
    * [MCOMPILER-160] - javac error but build SUCCESS
    * [MCOMPILER-173] - use new maven plugin annotations
    * [MCOMPILER-179] - Warnings
    * [MCOMPILER-181] - Exception on compilation are not properly reported
    * [MCOMPILER-182] - Case sensitivity changes in class names not
detected by compiler
    * [MCOMPILER-184] - use last plexus-compiler 2.0 api
    * [MCOMPILER-186] - mojos are in wrong package (org.apache.maven.plugin)

** Task
    * [MCOMPILER-171] - use maven-plugin-tools' java 5 annotations


> After switching to maven-compiler-plugin 3.0 I'm seeing compilation
> problems that do not show up when using the 2.5.1 version, nor do they show
> up in Eclipse.

Can you be more specific (with error messages etc), or perhaps even
create a little sample Maven project to share that demonstrates the
issues you're seeing? Eclipse has its own compiler so it is not
necessarily true that no failures in Eclipse means no failures when
compiling with Oracle's JDK.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: What's new in maven-compiler-plugin 3.0?

Posted by Jeff Care <ca...@us.ibm.com>.
olamy wrote
> "Since 3.0, the default compiler is javax.tools.JavaCompiler (if you
> are using java 1.6) and is used to compile Java sources. If you want
> to force the plugin using javac, you must configure the plugin option
> forceJavacCompilerUse."
> 
> This can definitely show more warning than the previous versions of
> plexus compiler could missed.
> If you don't want that
> add configuration field on compiler plugin: <
> forceJavacCompilerUse>true
> </forceJavacCompilerUse>
> or -Dmaven.compiler.forceJavacCompilerUse=true

Hmm, this is interesting. I will have to try this & report back.



--
View this message in context: http://maven.40175.n5.nabble.com/What-s-new-in-maven-compiler-plugin-3-0-tp5738129p5738297.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: What's new in maven-compiler-plugin 3.0?

Posted by Olivier Lamy <ol...@apache.org>.
Hi,


2012/12/12 Jeff Care <ca...@gmail.com>:
> Is there any documentation about what's new in maven-compiler-plugin 3.0
> over the 2.5.1 version? I scoured the project site & found nothing; various
> Google searches have also found nothing.
>
> After switching to maven-compiler-plugin 3.0 I'm seeing compilation
> problems that do not show up when using the 2.5.1 version, nor do they show
> up in Eclipse.

I missed something in release notes.
See coming new version doc:
http://maven.apache.org/plugins-archives/maven-compiler-plugin-3.1-SNAPSHOT/

"Since 3.0, the default compiler is javax.tools.JavaCompiler (if you
are using java 1.6) and is used to compile Java sources. If you want
to force the plugin using javac, you must configure the plugin option
forceJavacCompilerUse."

This can definitely show more warning than the previous versions of
plexus compiler could missed.
If you don't want that
add configuration field on compiler plugin: <
forceJavacCompilerUse>true</forceJavacCompilerUse>
or -Dmaven.compiler.forceJavacCompilerUse=true



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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: What's new in maven-compiler-plugin 3.0?

Posted by Anders Hammar <an...@hammar.net>.
Could I please ask you to file a ticket with this info, so we have it on
the board.

Thanks,
/Anders


On Fri, Dec 14, 2012 at 11:16 PM, Jeff Care <ca...@us.ibm.com> wrote:

> Anders Hammar wrote
> > OK, looks like a bug. Would be very good if you could reproduce this so
> it
> > could get fixed.
>
> I was able to confirm a few things:
>
> 1) Multi-threaded (-T 2C) builds with compiler plugin 3.0 consistently fail
> when *forceJavacCompilerUse* is false.
>
> 2) Single-threaded builds with compiler plugin 3.0 work fine when
> *forceJavacCompilerUse* is false.
>
> 3) Multi-threaded builds with compiler plugin 3.0 work fine when
> *forceJavacCompilerUse* is true.
>
> I wish I could put together a simple test case to demonstrate the issue but
> unfortunately I can't share the code where I am seeing the problem.
> Hopefully the above will yield some clues.
>
> Other potentially pertinent info:
>
> *> java -version*
> java version "1.6.0"
> Java(TM) SE Runtime Environment (build pxa6460sr10-20111208_01(SR10))
> IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64
> jvmxa6460sr10-20111207_96808 (JIT enabled, AOT enabled)
> J9VM - 20111207_096808
> JIT  - r9_20111107_21307ifx1
> GC   - 20110519_AA)
> JCL  - 20111104_02
>
> *>  uname -a*
> Linux REDACTED 2.6.32-220.7.1.el6.x86_64 #1 SMP Fri Feb 10 15:22:22 EST
> 2012
> x86_64 x86_64 x86_64 GNU/Linux
>
> *> cat /proc/cpuinfo | grep processor | wc -l*
> 24
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/What-s-new-in-maven-compiler-plugin-3-0-tp5738129p5738310.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: What's new in maven-compiler-plugin 3.0?

Posted by Olivier Lamy <ol...@apache.org>.
2012/12/14 Jeff Care <ca...@us.ibm.com>:
> Anders Hammar wrote
>> OK, looks like a bug. Would be very good if you could reproduce this so it
>> could get fixed.
>
> I was able to confirm a few things:
>
> 1) Multi-threaded (-T 2C) builds with compiler plugin 3.0 consistently fail
> when *forceJavacCompilerUse* is false.

What you can do is to use compilerReuseStrategy parameter see
http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#compilerReuseStrategy
maybe in your case alwaysNew can help.

The compiler is very platform dependent (I have tested some but not
this one :-) )

>
> 2) Single-threaded builds with compiler plugin 3.0 work fine when
> *forceJavacCompilerUse* is false.
>
> 3) Multi-threaded builds with compiler plugin 3.0 work fine when
> *forceJavacCompilerUse* is true.
>
> I wish I could put together a simple test case to demonstrate the issue but
> unfortunately I can't share the code where I am seeing the problem.
> Hopefully the above will yield some clues.
>
> Other potentially pertinent info:
>
> *> java -version*
> java version "1.6.0"
> Java(TM) SE Runtime Environment (build pxa6460sr10-20111208_01(SR10))
> IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64
> jvmxa6460sr10-20111207_96808 (JIT enabled, AOT enabled)
> J9VM - 20111207_096808
> JIT  - r9_20111107_21307ifx1
> GC   - 20110519_AA)
> JCL  - 20111104_02
>
> *>  uname -a*
> Linux REDACTED 2.6.32-220.7.1.el6.x86_64 #1 SMP Fri Feb 10 15:22:22 EST 2012
> x86_64 x86_64 x86_64 GNU/Linux
>
> *> cat /proc/cpuinfo | grep processor | wc -l*
> 24
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/What-s-new-in-maven-compiler-plugin-3-0-tp5738129p5738310.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: What's new in maven-compiler-plugin 3.0?

Posted by Jeff Care <ca...@us.ibm.com>.
Anders Hammar wrote
> OK, looks like a bug. Would be very good if you could reproduce this so it
> could get fixed.

I was able to confirm a few things:

1) Multi-threaded (-T 2C) builds with compiler plugin 3.0 consistently fail
when *forceJavacCompilerUse* is false.

2) Single-threaded builds with compiler plugin 3.0 work fine when
*forceJavacCompilerUse* is false.

3) Multi-threaded builds with compiler plugin 3.0 work fine when
*forceJavacCompilerUse* is true.

I wish I could put together a simple test case to demonstrate the issue but
unfortunately I can't share the code where I am seeing the problem.
Hopefully the above will yield some clues.

Other potentially pertinent info:

*> java -version*
java version "1.6.0"
Java(TM) SE Runtime Environment (build pxa6460sr10-20111208_01(SR10))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64
jvmxa6460sr10-20111207_96808 (JIT enabled, AOT enabled)
J9VM - 20111207_096808
JIT  - r9_20111107_21307ifx1
GC   - 20110519_AA)
JCL  - 20111104_02

*>  uname -a*
Linux REDACTED 2.6.32-220.7.1.el6.x86_64 #1 SMP Fri Feb 10 15:22:22 EST 2012
x86_64 x86_64 x86_64 GNU/Linux

*> cat /proc/cpuinfo | grep processor | wc -l*
24



--
View this message in context: http://maven.40175.n5.nabble.com/What-s-new-in-maven-compiler-plugin-3-0-tp5738129p5738310.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: What's new in maven-compiler-plugin 3.0?

Posted by Anders Hammar <an...@hammar.net>.
> The specific error that I remember was about a syntax error (class,
> interface or enum expected) in a Java file that is syntactically correct.
>

OK, looks like a bug. Would be very good if you could reproduce this so it
could get fixed.

/Anders


>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/What-s-new-in-maven-compiler-plugin-3-0-tp5738129p5738298.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: What's new in maven-compiler-plugin 3.0?

Posted by Jeff Care <ca...@us.ibm.com>.
Anders Hammar wrote
> Do you mean compilation errors or warnings? There's some major changes in
> the the underlying plexus-compiler that will provide compilation info in a
> better way. So although you didn't see this in earlier version you might
> still have had the "problems".

They were errors in that they caused Maven to stop. In my test I had not
changed any compiler plugin configuration settings, just the version.

The specific error that I remember was about a syntax error (class,
interface or enum expected) in a Java file that is syntactically correct.



--
View this message in context: http://maven.40175.n5.nabble.com/What-s-new-in-maven-compiler-plugin-3-0-tp5738129p5738298.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: What's new in maven-compiler-plugin 3.0?

Posted by Anders Hammar <an...@hammar.net>.
> After switching to maven-compiler-plugin 3.0 I'm seeing compilation
> problems that do not show up when using the 2.5.1 version, nor do they show
> up in Eclipse.
>

Do you mean compilation errors or warnings? There's some major changes in
the the underlying plexus-compiler that will provide compilation info in a
better way. So although you didn't see this in earlier version you might
still have had the "problems".

/Anders