Things in a POM file that are not probably incorrect

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Things in a POM file that are not probably incorrect

Simon Spero
    <maven.compiler.source>1.5</maven.compiler.source>
    <maven.compiler.target>1.5</maven.compiler.target>
    <commons.module.name>org.apache.commons.functor</commons.module.name>

JDK 9 cannot generate or parse class files compiled with -target 1.5  [1].

Per the JPMS Armistice talks,   "Automatic-Module-Name" header should only
be added to jars that have been tested under JDK 9 [2].

Also, javac now supports the new "--release" argument as an alternative to
source + target.
Roughly speaking, this option combines -source & -target with a little bit
of animal sniffing.  JDK 9 includes  signatures for JDK 6,7,8, and 9 (i.e.
all the releases which jdk9 can compile for).
This option is supported by maven-compiler-plugin [4] via a <release>
element in the plugin  configuration, or by settting the property
*maven.compiler.release* .

Simon

[1] https://bugs.openjdk.java.net/browse/JDK-8011044
[2]
http://openjdk.java.net/projects/jigsaw/spec/minutes/2017-05-18#AutomaticModuleNames--ModuleNameInManifest
[3] http://openjdk.java.net/jeps/247
[4]
https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#release
Reply | Threaded
Open this post in threaded view
|

Re: Things in a POM file that are not probably incorrect

Benedikt Ritter-4
Hello Simon,

> Am 27.06.2017 um 00:02 schrieb Simon Spero <[hidden email]>:
>
>    <maven.compiler.source>1.5</maven.compiler.source>
>    <maven.compiler.target>1.5</maven.compiler.target>
>    <commons.module.name>org.apache.commons.functor</commons.module.name>
>
> JDK 9 cannot generate or parse class files compiled with -target 1.5  [1].
>
> Per the JPMS Armistice talks,   "Automatic-Module-Name" header should only
> be added to jars that have been tested under JDK 9 [2].
>
> Also, javac now supports the new "--release" argument as an alternative to
> source + target.
> Roughly speaking, this option combines -source & -target with a little bit
> of animal sniffing.  JDK 9 includes  signatures for JDK 6,7,8, and 9 (i.e.
> all the releases which jdk9 can compile for).
> This option is supported by maven-compiler-plugin [4] via a <release>
> element in the plugin  configuration, or by settting the property
> *maven.compiler.release* .

Thank you for the heads up! We should definitely try to use the new release option once JDK9 is released and our components require at least Java 1.6.

Cheers,
Benedikt

>
> Simon
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8011044
> [2]
> http://openjdk.java.net/projects/jigsaw/spec/minutes/2017-05-18#AutomaticModuleNames--ModuleNameInManifest
> [3] http://openjdk.java.net/jeps/247
> [4]
> https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#release


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Things in a POM file that are not probably incorrect

Emmanuel Bourg-3
In reply to this post by Simon Spero
Le 27/06/2017 à 00:02, Simon Spero a écrit :

> JDK 9 cannot generate or parse class files compiled with -target 1.5  [1].

AFAIK Java 9 can still parse 1.5 (and lower) class files.

Emmanuel Bourg

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Things in a POM file that are not probably incorrect

Rob Tompkins


> On Jun 27, 2017, at 7:45 PM, Emmanuel Bourg <[hidden email]> wrote:
>
>> Le 27/06/2017 à 00:02, Simon Spero a écrit :
>>
>> JDK 9 cannot generate or parse class files compiled with -target 1.5  [1].
>
> AFAIK Java 9 can still parse 1.5 (and lower) class files.

But it does matter what you declare the target to be: http://openjdk.java.net/jeps/182

-Rob


>
> Emmanuel Bourg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
Reply | Threaded
Open this post in threaded view
|

Re: Things in a POM file that are not probably incorrect

Matt Sicker
In reply to this post by Emmanuel Bourg-3
Java 9 can still run old bytecode, but they're removing compiler support
for outputting that bytecode apparently (either that or syntax support).

On 27 June 2017 at 18:45, Emmanuel Bourg <[hidden email]> wrote:

> Le 27/06/2017 à 00:02, Simon Spero a écrit :
>
> > JDK 9 cannot generate or parse class files compiled with -target 1.5
> [1].
>
> AFAIK Java 9 can still parse 1.5 (and lower) class files.
>
> Emmanuel Bourg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Matt Sicker <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Things in a POM file that are not probably incorrect

garydgregory
In reply to this post by Simon Spero
It sounds like building on Java 9 renders the animal sniffer Maven plugin
obsolete.

Gary

On Jun 26, 2017 15:02, "Simon Spero" <[hidden email]> wrote:

>     <maven.compiler.source>1.5</maven.compiler.source>
>     <maven.compiler.target>1.5</maven.compiler.target>
>     <commons.module.name>org.apache.commons.functor</commons.module.name>
>
> JDK 9 cannot generate or parse class files compiled with -target 1.5  [1].
>
> Per the JPMS Armistice talks,   "Automatic-Module-Name" header should only
> be added to jars that have been tested under JDK 9 [2].
>
> Also, javac now supports the new "--release" argument as an alternative to
> source + target.
> Roughly speaking, this option combines -source & -target with a little bit
> of animal sniffing.  JDK 9 includes  signatures for JDK 6,7,8, and 9 (i.e.
> all the releases which jdk9 can compile for).
> This option is supported by maven-compiler-plugin [4] via a <release>
> element in the plugin  configuration, or by settting the property
> *maven.compiler.release* .
>
> Simon
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8011044
> [2]
> http://openjdk.java.net/projects/jigsaw/spec/minutes/2017-05-18#
> AutomaticModuleNames--ModuleNameInManifest
> [3] http://openjdk.java.net/jeps/247
> [4]
> https://maven.apache.org/plugins/maven-compiler-plugin/
> compile-mojo.html#release
>
Reply | Threaded
Open this post in threaded view
|

Re: Things in a POM file that are not probably incorrect

Ralph Goers
It seems so, although it sounds like there is a solution to do it with Java 7 and 8 as well.

http://events.linuxfoundation.org/sites/events/files/slides/Java9%20and%20the%20impact%20on%20Maven%20projects.pdf <http://events.linuxfoundation.org/sites/events/files/slides/Java9%20and%20the%20impact%20on%20Maven%20projects.pdf>

Ralph

> On Jun 28, 2017, at 10:05 AM, Gary Gregory <[hidden email]> wrote:
>
> It sounds like building on Java 9 renders the animal sniffer Maven plugin
> obsolete.
>
> Gary
>
> On Jun 26, 2017 15:02, "Simon Spero" <[hidden email]> wrote:
>
>>    <maven.compiler.source>1.5</maven.compiler.source>
>>    <maven.compiler.target>1.5</maven.compiler.target>
>>    <commons.module.name>org.apache.commons.functor</commons.module.name>
>>
>> JDK 9 cannot generate or parse class files compiled with -target 1.5  [1].
>>
>> Per the JPMS Armistice talks,   "Automatic-Module-Name" header should only
>> be added to jars that have been tested under JDK 9 [2].
>>
>> Also, javac now supports the new "--release" argument as an alternative to
>> source + target.
>> Roughly speaking, this option combines -source & -target with a little bit
>> of animal sniffing.  JDK 9 includes  signatures for JDK 6,7,8, and 9 (i.e.
>> all the releases which jdk9 can compile for).
>> This option is supported by maven-compiler-plugin [4] via a <release>
>> element in the plugin  configuration, or by settting the property
>> *maven.compiler.release* .
>>
>> Simon
>>
>> [1] https://bugs.openjdk.java.net/browse/JDK-8011044
>> [2]
>> http://openjdk.java.net/projects/jigsaw/spec/minutes/2017-05-18#
>> AutomaticModuleNames--ModuleNameInManifest
>> [3] http://openjdk.java.net/jeps/247
>> [4]
>> https://maven.apache.org/plugins/maven-compiler-plugin/
>> compile-mojo.html#release
>>