You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Olivier Lamy <ol...@apache.org> on 2013/04/08 12:15:15 UTC

[ANN] Maven Compiler Plugin 3.1 Released

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

The Compiler Plugin is used to compile the sources of your project.
The default compiler is javac and is used to compile Java sources.
Also note that at present the default source setting is 1.5 and the
default target setting is 1.5, independently of the JDK you run Maven
with.

http://maven.apache.org/plugins/maven-compiler-plugin/

You should specify the version in your project's plugin configuration:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.1</version>
</plugin>

Release Notes - Apache Maven 2.x Compiler Plugin - Version 3.1

** Bug
    * [MCOMPILER-178] - can't specify -Xlint:-path option without
violation of XML well-formness
    * [MCOMPILER-187] - incremental stuff detect changes even if
nothing has changed means too much compilation
    * [MCOMPILER-190] - No compile errors with plexus-compiler-eclipse
    * [MCOMPILER-192] - No error reporting with forked compiler when
Compiler includes non java files
    * [MCOMPILER-198] - Some parameters introduced in version 3.0 are
annoted with since 2.6
    * [MCOMPILER-199] - Plugin 3.0 does not compile src/main/groovy if
neither src/main/java nor src/main/resources folders exist

** Improvement
    * [MCOMPILER-188] - Add a flag to be able to disable incremental feature

** New Feature
    * [MCOMPILER-132] - Provide general "maven.compiler.main.skip" attribute


Have Fun,
--
The Apache Maven team

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


Re: [ANN] Maven Compiler Plugin 3.1 Released

Posted by Stanimir Stamenkov <s7...@netscape.net>.
Thu, 11 Apr 2013 23:38:17 -0500, /Wayne Fay/:

>> I'm not sure it could be a clue but it happens for some (I haven't
>> verified all) WAR modules.
>
> What code are you compiling in a WAR module? Best practice says to move the
> Java code to a Jar module. Are you precompiling jsps with jspc or ...?

No JSPs or the like.  It's a WAR module with JAX-RS classes 
implementing REST services.  If we move the Java code to a JAR 
module, the WAR would become pretty much hollow.  I don't think I 
like having extra modules, as a workaround.  We already have some of 
the Java code (the client interfaces) in a JAR which is meant for 
inclusion elsewhere, besides the WAR.

> Is this a project you can share via Github? Or can you make a sample that
> (consistently) exhibits the behavior, and share just that part?

Unfortunately I can't share the code, but I'll try to make a minimal 
sample which consistently exhibits the behavior.

-- 
Stanimir

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


Re: [ANN] Maven Compiler Plugin 3.1 Released

Posted by Stanimir Stamenkov <s7...@netscape.net>.
Mon, 15 Apr 2013 22:10:19 +1000, /Olivier Lamy/:

> +                  <excludes>
> +                    <exclude>**/package-info.java</exclude>
> +                  </excludes>
> [...]
> As all package-info.java files never go to
> ${project.build.outputDirectory} a compilation is triggered.

This is really untrue generally and in all cases, and I can't accept 
the proposed solution as serious.

-- 
Stanimir

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


Re: [ANN] Maven Compiler Plugin 3.1 Released

Posted by Olivier Lamy <ol...@apache.org>.
mb-olamy:maven-compiler-sample olamy$ hg diff
diff -r 282cd9fe95c4 pom.xml
--- a/pom.xml Sun Apr 14 14:48:37 2013 +0300
+++ b/pom.xml Mon Apr 15 22:06:35 2013 +1000
@@ -41,6 +41,9 @@
                     <encoding>${project.build.sourceEncoding}</encoding>
                     <source>${maven.compiler.source}</source>
                     <target>${maven.compiler.target}</target>
+                  <excludes>
+                    <exclude>**/package-info.java</exclude>
+                  </excludes>
                 </configuration>
             </plugin>
         </plugins>

the compiler plugin compare timestamp (and or new file **/*.java from
${project.build.sourceDirectory} to ${project.build.outputDirectory}
as long as there is any timestamp change or new file a compilation is
triggered.
As all package-info.java files never go to
${project.build.outputDirectory} a compilation is triggered.
HTH

2013/4/14 Stanimir Stamenkov <s7...@netscape.net>:
> Sat, 13 Apr 2013 20:55:17 +0300, /Stanimir Stamenkov/:
>
>> Thu, 11 Apr 2013 23:38:17 -0500, /Wayne Fay/:
>>
>>>> I'm not sure it could be a clue but it happens for some (I haven't
>>>> verified all) WAR modules.
>>>
>>> [...]
>>> Is this a project you can share via Github? Or can you make a
>>> sample that
>>> (consistently) exhibits the behavior, and share just that part?
>>
>>
>> All right.  Doesn't appear WAR-related, but consistently happens if
>> there are "package-info.java" files with no annotations (at least
>> @Retention(RUNTIME) ones) to cause a "package-info.class" generated
>> in the target/classes directory.
>
>
> I don't use Git but here's a Hg source:
>
> https://bitbucket.org/stanio/maven-compiler-sample
>
> One could download a zipped bundle from:
>
> https://bitbucket.org/stanio/maven-compiler-sample/downloads
>
> (select "Tags" or "Branches")
>
>
> --
> Stanimir
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>



-- 
Olivier Lamy
Ecetera: http://ecetera.com.au
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: [ANN] Maven Compiler Plugin 3.1 Released

Posted by Stanimir Stamenkov <s7...@netscape.net>.
Sat, 13 Apr 2013 20:55:17 +0300, /Stanimir Stamenkov/:
> Thu, 11 Apr 2013 23:38:17 -0500, /Wayne Fay/:
>
>>> I'm not sure it could be a clue but it happens for some (I haven't
>>> verified all) WAR modules.
>> [...]
>> Is this a project you can share via Github? Or can you make a
>> sample that
>> (consistently) exhibits the behavior, and share just that part?
>
> All right.  Doesn't appear WAR-related, but consistently happens if
> there are "package-info.java" files with no annotations (at least
> @Retention(RUNTIME) ones) to cause a "package-info.class" generated
> in the target/classes directory.

I don't use Git but here's a Hg source:

https://bitbucket.org/stanio/maven-compiler-sample

One could download a zipped bundle from:

https://bitbucket.org/stanio/maven-compiler-sample/downloads

(select "Tags" or "Branches")

-- 
Stanimir

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


Re: [ANN] Maven Compiler Plugin 3.1 Released

Posted by Stanimir Stamenkov <s7...@netscape.net>.
Thu, 11 Apr 2013 23:38:17 -0500, /Wayne Fay/:

>> I'm not sure it could be a clue but it happens for some (I haven't
>> verified all) WAR modules.
> [...]
> Is this a project you can share via Github? Or can you make a sample that
> (consistently) exhibits the behavior, and share just that part?

All right.  Doesn't appear WAR-related, but consistently happens if 
there are "package-info.java" files with no annotations (at least 
@Retention(RUNTIME) ones) to cause a "package-info.class" generated 
in the target/classes directory.

I think I had seen this exact case not causing recompilation before, 
but may be it was just those "package-info.java" files recompiled.

-- 
Stanimir

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


Re: [ANN] Maven Compiler Plugin 3.1 Released

Posted by Wayne Fay <wa...@gmail.com>.
> I'm not sure it could be a clue but it happens for some (I haven't
> verified all) WAR modules.

What code are you compiling in a WAR module? Best practice says to move the
Java code to a Jar module. Are you precompiling jsps with jspc or ...?

Is this a project you can share via Github? Or can you make a sample that
(consistently) exhibits the behavior, and share just that part?

Wayne

Re: [ANN] Maven Compiler Plugin 3.1 Released

Posted by Stanimir Stamenkov <s7...@netscape.net>.
Mon, 8 Apr 2013 20:15:15 +1000, /Olivier Lamy/:

> Release Notes - Apache Maven 2.x Compiler Plugin - Version 3.1
>
> ** Bug
>      * [MCOMPILER-187] - incremental stuff detect changes even if
> nothing has changed means too much compilation

I'm not sure it is the same, but it seems I'm still observing 
instance of this.  I perform `mvn clean compile`, then immediately 
`mvn compile` after it and I still see:

[INFO] Changes detected - recompiling the module!

It doesn't appear for all modules I've tried with, though.  I'm not 
sure it could be a clue but it happens for some (I haven't verified 
all) WAR modules.

-- 
Stanimir

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