Closed xiumin1993 closed 2 years ago
Hmm. I thought all releases prior to 9 had to have the 1.
in front of them. It appears this behavior in javac has changed. Do you know where the list of targets recognized by javac
might be documented (I suppose that could differ between different JDK implementations).
It's also worth noting you can use skipBytecodeCheck
to skip this verification.
I tried it .do not work
发自我的iPhone
------------------ Original ------------------ From: Keegan Witt @.> Date: Fri,Jul 1,2022 10:44 PM To: groovy/GMavenPlus @.> Cc: xiumin1993 @.>, Author @.> Subject: Re: [groovy/GMavenPlus] Unrecognized target bytecode: '8' (Issue#223)
It's also worth noting you can use skipBytecodeCheck to skip this verification.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
I can't find the source code for it, but it looks like the synonyms are what you'd expect (https://docs.oracle.com/en/java/javase/11/tools/javac.html#GUID-AEEC9F07-CB49-4E96-8BC7-BCC2C7F725C9). I'll add these.
In the mean time, it works for me with the below XML
<properties>
<skipBytecodeCheck>true</skipBytecodeCheck>
</properties>
Actually, I'm remembering why I implemented it this way now. It's because while javac accepts both 1.8
and 8
, Groovy does not. See https://github.com/apache/groovy/blob/38c85f371128b6bc46ba952228640d433b1c799e/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
I suggest either
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Since this would be equivalent and works for both javac and groovyc, or
<targetBytecode>1.8</targetBytecode>
The second of these can be placed in <properties>
or in the <configuration>
of GMavenPlus or one of its <execution>
s.
Thanks for your reply ,You guys do the great things
I made a mistake setting skipBytecodeCheck=false
you're rigth,it does work
------------------ 原始邮件 ------------------ 发件人: "groovy/GMavenPlus" @.>; 发送时间: 2022年7月1日(星期五) 晚上11:33 @.>; @.**@.>; 主题: Re: [groovy/GMavenPlus] Unrecognized target bytecode: '8' (Issue #223)
I can't find the source code for it, but it looks like the synonyms are what you'd expect (https://docs.oracle.com/en/java/javase/11/tools/javac.html#GUID-AEEC9F07-CB49-4E96-8BC7-BCC2C7F725C9). I'll add these.
In the mean time, it works for me with the below XML <properties> <skipBytecodeCheck>true</skipBytecodeCheck> </properties>
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
yeah,After check plugin source code ,I already change to this
发自我的iPhone
------------------ Original ------------------ From: Keegan Witt @.> Date: Fri,Jul 1,2022 11:45 PM To: groovy/GMavenPlus @.> Cc: xiumin1993 @.>, Author @.> Subject: Re: [groovy/GMavenPlus] Unrecognized target bytecode: '8' (Issue#223)
Actually, I'm remembering why I implemented it this way now. It's because while javac accepts both 1.8 and 8, Groovy does not. See https://github.com/apache/groovy/blob/38c85f371128b6bc46ba952228640d433b1c799e/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
I suggest either <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties>
Since this would be equivalent and works for both javac and groovyc, or <targetBytecode>1.8</targetBytecode>
The second of these can be placed in <properties> or in the <configuration> of GMavenPlus or one of its <execution>s.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
I'm thinking about whether to translate the synonym to make this easier. I want to be careful I'm not breaking something else I haven't thought of.
Add the synonym , like 1.8||8,then test it with right Java version and maven config If it works normal I think it's ok
发自我的iPhone
------------------ Original ------------------ From: Keegan Witt @.> Date: Sat,Jul 2,2022 0:08 AM To: groovy/GMavenPlus @.> Cc: xiumin1993 @.>, Author @.> Subject: Re: [groovy/GMavenPlus] Unrecognized target bytecode: '8' (Issue#223)
I'm thinking about whether to translate the synonym to make this easier. I want to be careful I'm not breaking something else I haven't thought of.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
I was more worried about if there was other JDK vendors (like Azul Zulu, Amazon Corretto, Alibaba Dragonwell, IBM, etc) that have other strings they accept that I haven't accounted for. I'm pretty confident this will work with Eclipse Adoptium and Oracle JDK.
I suppose if more cases come up, we can deal with them at that time. This seems reasonable to proceed with for now.
I released 2.0.0-SNAPSHOT with this change. As an additional verification, it'd be helpful to confirm this resolves your issue. You can get that from here
<repository>
<id>sonatype-oss-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
I think the best solustion is add a note on the exception message that they can use skipBytecodeCheck=true to skip this check when they get the same exception with me, also clearly descripe the exception message “Unrecognized target bytecode: '8'” not clear enough
发件人: Keegan Witt 发送时间: 2022年7月2日 1:41 收件人: groovy/GMavenPlus 抄送: xiumin1993; Author 主题: Re: [groovy/GMavenPlus] Unrecognized target bytecode: '8' (Issue#223)
I suppose if more cases come up, we can deal with them at that time. This seems reasonable to proceed with for now. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
I'm using gmavenplus-plugin 1.13.1 when I setting maven
cmd
get error
Maybe should add java version 6 to 8 in this function