You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Mangold, Kevin C." <ke...@nist.gov> on 2015/06/17 21:55:16 UTC

Default Maven Compiler Version

Why does the maven compiler plugin STILL target 1.5 by default and not the JDK's current version? This seems completely backwards. We use CI tools to test against different JDK versions and architectures and it is a massive pain to implement all these workarounds to have the compiler target each JDK's respective version.

RE: Default Maven Compiler Version

Posted by Jörg Schaible <jo...@swisspost.com>.
Hi Jason,

Jason Pyeron wrote:

>> -----Original Message-----
>> From: Manfred Moser [mailto:manfred@mosabuam.com]
>> Sent: Thursday, June 18, 2015 12:21 AM
>> To: dev@maven.apache.org
>> Subject: Re: Default Maven Compiler Version
>> 
>> Yes... a corporate or some other higher level pom is
> 
> I think some detail was missed in the OP's question.
> 
> It is not that he always wants version X. It is he wants the default to be
> the version in the path for each system.
> 
> In other words: On system A it should be java version A on system B it
> should be java version B, etc.
> 
> Maybe start with this idea:
> 
> <properties>
>   <maven.compiler.source>${java.version}</maven.compiler.source>
>   <maven.compiler.target>${java.version}</maven.compiler.target>
> </properties>
> 
> Now I know that ${java.version} is likley to have some cruft in it, but
> someone better than I can come up with a way to strip out the 1.x from the
> java.version.

this can be achieved with automatically activated profiles for specific JDK 
versions and setting there the appropriate version as property value.

However, this makes repeatable builds even more brittle (now, you're 
depending on the current environment).

Cheers,
Jörg



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


RE: Default Maven Compiler Version

Posted by Jason Pyeron <jp...@pdinc.us>.
> -----Original Message-----
> From: Manfred Moser [mailto:manfred@mosabuam.com] 
> Sent: Thursday, June 18, 2015 12:21 AM
> To: dev@maven.apache.org
> Subject: Re: Default Maven Compiler Version
> 
> Yes... a corporate or some other higher level pom is 

I think some detail was missed in the OP's question.

It is not that he always wants version X. It is he wants the default to be
the version in the path for each system.

In other words: On system A it should be java version A on system B it
should be java version B, etc.

Maybe start with this idea:

<properties>
  <maven.compiler.source>${java.version}</maven.compiler.source>
  <maven.compiler.target>${java.version}</maven.compiler.target>
</properties>

Now I know that ${java.version} is likley to have some cruft in it, but
someone better than I can come up with a way to strip out the 1.x from the
java.version.


> typically how you configure this across lots of projects. But 
> even if you dont ... its two lines of config on the compiler plugin.
> 
> Manfred
> 
> Sander Verhagen wrote on 17.06.2015 15:16:
> 
> > I wonder if this would be a good candidate for a corporate POM that 
> > deals with this kind of configuration?
> > 
> > 
> > 
> > Sander Verhagen
> > [  sander@sanderverhagen.net  ]
> > 
> > NOTICE: my e-mail address has changed. You may still e-mail me at 
> > Verhagen@Sander.com but you will see me using 
> > Sander@SanderVerhagen.net from now on. Feel free to update 
> your address book.
> > 
> >> -----Original Message-----
> >> From: Mangold, Kevin C. [mailto:kevin.mangold@nist.gov]
> >> Sent: Wednesday, June 17, 2015 12:55
> >> To: dev@maven.apache.org
> >> Subject: Default Maven Compiler Version
> >> 
> >> Why does the maven compiler plugin STILL target 1.5 by default and 
> >> not the JDK's current version? This seems completely backwards. We 
> >> use CI tools to test against different JDK versions and 
> architectures 
> >> and it is a massive pain to implement all these 
> workarounds to have 
> >> the compiler target each JDK's respective version.


--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 


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


Re: Default Maven Compiler Version

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi Tibor,

On 6/18/15 1:42 PM, Tibor Digana wrote:
> It's truth that we upgrade the JDK version for Maven distrib in 3.3/jdk7 and
> 3.2/jdk6 and not the compiler.


>>From the users perspective I would also suppose the compiler changed.

> On the other side migrating all plugins takes time. Due to most of them
> still depend on Maven API 2.2.1.

You know:
https://builds.apache.org/view/All/job/dist-tool-plugin/site/dist-tool-prerequisites.html

This was/is the plan...
http://mail-archives.apache.org/mod_mbox/maven-announce/201503.mbox/%3C20150320213920.6AE4B17423%40minotaur.apache.org%3E


> It takes some time to support Maven 3.0 API
Sure...currently the supporting shared components are under 
development...if they are ready we can start to migrate plugin after 
plugin...


Kind regards
Karl Heinz Marbaise

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


Re: Default Maven Compiler Version

Posted by Tibor Digana <ti...@apache.org>.
It's truth that we upgrade the JDK version for Maven distrib in 3.3/jdk7 and
3.2/jdk6 and not the compiler.
>From the users perspective I would also suppose the compiler changed.
On the other side migrating all plugins takes time. Due to most of them
still depend on Maven API 2.2.1. It takes some time to support Maven 3.0 API
in maven-compiler-plugin and maybe this topic would be relevant when this
would happen.



--
View this message in context: http://maven.40175.n5.nabble.com/Default-Maven-Compiler-Version-tp5837828p5837866.html
Sent from the Maven Developers mailing list archive at Nabble.com.

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


Re: Default Maven Compiler Version

Posted by Manfred Moser <ma...@mosabuam.com>.
Yes... a corporate or some other higher level pom is typically how you configure this across lots of projects. But even if you dont ... its two lines of config on the compiler plugin.

Manfred

Sander Verhagen wrote on 17.06.2015 15:16:

> I wonder if this would be a good candidate for a corporate POM that deals with
> this kind of configuration?
> 
> 
> 
> Sander Verhagen
> [  sander@sanderverhagen.net  ]
> 
> NOTICE: my e-mail address has changed. You may still e-mail me at
> Verhagen@Sander.com but you will see me using Sander@SanderVerhagen.net from
> now on. Feel free to update your address book.
> 
>> -----Original Message-----
>> From: Mangold, Kevin C. [mailto:kevin.mangold@nist.gov]
>> Sent: Wednesday, June 17, 2015 12:55
>> To: dev@maven.apache.org
>> Subject: Default Maven Compiler Version
>> 
>> Why does the maven compiler plugin STILL target 1.5 by default and not the
>> JDK's current version? This seems completely backwards. We use CI tools to
>> test against different JDK versions and architectures and it is a massive pain
>> to implement all these workarounds to have the compiler target each JDK's
>> respective version.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 


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


RE: Default Maven Compiler Version

Posted by Sander Verhagen <sa...@sanderverhagen.net>.
I wonder if this would be a good candidate for a corporate POM that deals with this kind of configuration?



Sander Verhagen
[  sander@sanderverhagen.net  ]

NOTICE: my e-mail address has changed. You may still e-mail me at Verhagen@Sander.com but you will see me using Sander@SanderVerhagen.net from now on. Feel free to update your address book.

> -----Original Message-----
> From: Mangold, Kevin C. [mailto:kevin.mangold@nist.gov]
> Sent: Wednesday, June 17, 2015 12:55
> To: dev@maven.apache.org
> Subject: Default Maven Compiler Version
> 
> Why does the maven compiler plugin STILL target 1.5 by default and not the
> JDK's current version? This seems completely backwards. We use CI tools to
> test against different JDK versions and architectures and it is a massive pain
> to implement all these workarounds to have the compiler target each JDK's
> respective version.

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