Groovyc and Java 12 preview featureHow do I increase Groovy's JVM Heap Size?Is Java “pass-by-reference” or “pass-by-value”?How do I efficiently iterate over each entry in a Java Map?Does a finally block always get executed in Java?What is the difference between public, protected, package-private and private in Java?How do I read / convert an InputStream into a String in Java?When to use LinkedList over ArrayList in Java?How do I generate random integers within a specific range in Java?How do I determine whether an array contains a particular value in Java?How do I convert a String to an int in Java?Creating a memory leak with Java

Is there a nice way to assign std::minmax(a, b) to std::tie(a, b)?

What is "oversubscription" in Networking?

Skipping over failed imports until they are needed (if ever)

What is the line crossing the Pacific Ocean that is shown on maps?

Can the passive "être + verbe" sometimes mean the past?

How can I reduce the sound of rain on a range hood vent?

Do space suits measure "methane" levels or other biological gases?

Miss Toad and her frogs

Why isn’t the tax system continuous rather than bracketed?

What's the safest way to inform a new user of their password on my web site?

Is it bad to describe a character long after their introduction?

Is this hogweed?

Getting geometries of hurricane's 'cone of uncertainty' using shapely?

Why are 120 V general receptacle circuits limited to 20 A?

Spicket or spigot?

Making an Email Address Validator

Should I share with a new service provider a bill from its competitor?

Symbol for "not absolutely continuous" in Latex

How can my story take place on Earth without referring to our existing cities and countries?

What is the highest number of sneak attacks that a Pure/High Level Rogue (Level 17+) can make in one round?

Procedurally generate regions on island

Why transcripts instead of degree certificates?

I hit a pipe with a mower and now it won't turn

Mean Value Theorem: Continuous or Defined?



Groovyc and Java 12 preview feature


How do I increase Groovy's JVM Heap Size?Is Java “pass-by-reference” or “pass-by-value”?How do I efficiently iterate over each entry in a Java Map?Does a finally block always get executed in Java?What is the difference between public, protected, package-private and private in Java?How do I read / convert an InputStream into a String in Java?When to use LinkedList over ArrayList in Java?How do I generate random integers within a specific range in Java?How do I determine whether an array contains a particular value in Java?How do I convert a String to an int in Java?Creating a memory leak with Java






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm trying to compile a project that has some tests written in groovy.
The project has --enable-preview for Java 12.



I'm using gmavenplus-plugin to do that:



 <plugin> 
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.6.3</version>
<configuration>
<targetBytecode>$java.version</targetBytecode>
<testSources>
<testSource>
<directory>$testSourceDirectory</directory>
<includes>
<include>**/*.groovy</include>
</includes>
</testSource>
</testSources>
</configuration>
<executions>
<execution>
<goals>
<goal>compileTests</goal>
</goals>
</execution>
</executions>
</plugin>


I have --enable-preview for maven compiler and surefire/failsafe (using argLine). Everything works if I disable the groovy plugin (and tests).



But when I enable it, it fails with:



Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.6.3:compileTests (default) on project apikey-manager-api: Error occurred while calling a method on a Groovy class from classpath.: InvocationTargetException: Preview features are not enabled for com/acme/config/EndToEndTest (class file version 56.65535). Try running with '--enable-preview' -> [Help 1]


I don't see any options that I could pass to this plugin to enable preview features. Does it use javac? Or should such option be in groovyc?










share|improve this question






















  • Looks like the compilation is working, but then running the test happens without --enable-preview set. In case you can check out the compiled .class files from the test with javap -v <class>, you can check that the minor class file version is non-zero, to verify that it was compiled with --enable-preview.

    – Jorn Vernee
    Mar 25 at 13:00












  • @JornVernee Unfortunately groovy compilation is not working, it fails because it sees EndToEnd.class which is a java class compiled with --enable-preview as a result groovyc fails.

    – Krzysztof Krasoń
    Mar 25 at 14:25











  • Oh I see, so groovyc is trying to load this class compiled with --enable-preview, and then it's failing because groovyc is not running in a JVM that has --enable-preview set. Maybe setting the JAVA_OPTS environment variable to "--enable-preview" will work? (this works isolation using the groovy command line)

    – Jorn Vernee
    Mar 25 at 14:58







  • 1





    Reported a bug github.com/groovy/GMavenPlus/issues/125

    – Krzysztof Krasoń
    Mar 26 at 9:18

















1















I'm trying to compile a project that has some tests written in groovy.
The project has --enable-preview for Java 12.



I'm using gmavenplus-plugin to do that:



 <plugin> 
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.6.3</version>
<configuration>
<targetBytecode>$java.version</targetBytecode>
<testSources>
<testSource>
<directory>$testSourceDirectory</directory>
<includes>
<include>**/*.groovy</include>
</includes>
</testSource>
</testSources>
</configuration>
<executions>
<execution>
<goals>
<goal>compileTests</goal>
</goals>
</execution>
</executions>
</plugin>


I have --enable-preview for maven compiler and surefire/failsafe (using argLine). Everything works if I disable the groovy plugin (and tests).



But when I enable it, it fails with:



Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.6.3:compileTests (default) on project apikey-manager-api: Error occurred while calling a method on a Groovy class from classpath.: InvocationTargetException: Preview features are not enabled for com/acme/config/EndToEndTest (class file version 56.65535). Try running with '--enable-preview' -> [Help 1]


I don't see any options that I could pass to this plugin to enable preview features. Does it use javac? Or should such option be in groovyc?










share|improve this question






















  • Looks like the compilation is working, but then running the test happens without --enable-preview set. In case you can check out the compiled .class files from the test with javap -v <class>, you can check that the minor class file version is non-zero, to verify that it was compiled with --enable-preview.

    – Jorn Vernee
    Mar 25 at 13:00












  • @JornVernee Unfortunately groovy compilation is not working, it fails because it sees EndToEnd.class which is a java class compiled with --enable-preview as a result groovyc fails.

    – Krzysztof Krasoń
    Mar 25 at 14:25











  • Oh I see, so groovyc is trying to load this class compiled with --enable-preview, and then it's failing because groovyc is not running in a JVM that has --enable-preview set. Maybe setting the JAVA_OPTS environment variable to "--enable-preview" will work? (this works isolation using the groovy command line)

    – Jorn Vernee
    Mar 25 at 14:58







  • 1





    Reported a bug github.com/groovy/GMavenPlus/issues/125

    – Krzysztof Krasoń
    Mar 26 at 9:18













1












1








1








I'm trying to compile a project that has some tests written in groovy.
The project has --enable-preview for Java 12.



I'm using gmavenplus-plugin to do that:



 <plugin> 
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.6.3</version>
<configuration>
<targetBytecode>$java.version</targetBytecode>
<testSources>
<testSource>
<directory>$testSourceDirectory</directory>
<includes>
<include>**/*.groovy</include>
</includes>
</testSource>
</testSources>
</configuration>
<executions>
<execution>
<goals>
<goal>compileTests</goal>
</goals>
</execution>
</executions>
</plugin>


I have --enable-preview for maven compiler and surefire/failsafe (using argLine). Everything works if I disable the groovy plugin (and tests).



But when I enable it, it fails with:



Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.6.3:compileTests (default) on project apikey-manager-api: Error occurred while calling a method on a Groovy class from classpath.: InvocationTargetException: Preview features are not enabled for com/acme/config/EndToEndTest (class file version 56.65535). Try running with '--enable-preview' -> [Help 1]


I don't see any options that I could pass to this plugin to enable preview features. Does it use javac? Or should such option be in groovyc?










share|improve this question














I'm trying to compile a project that has some tests written in groovy.
The project has --enable-preview for Java 12.



I'm using gmavenplus-plugin to do that:



 <plugin> 
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.6.3</version>
<configuration>
<targetBytecode>$java.version</targetBytecode>
<testSources>
<testSource>
<directory>$testSourceDirectory</directory>
<includes>
<include>**/*.groovy</include>
</includes>
</testSource>
</testSources>
</configuration>
<executions>
<execution>
<goals>
<goal>compileTests</goal>
</goals>
</execution>
</executions>
</plugin>


I have --enable-preview for maven compiler and surefire/failsafe (using argLine). Everything works if I disable the groovy plugin (and tests).



But when I enable it, it fails with:



Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.6.3:compileTests (default) on project apikey-manager-api: Error occurred while calling a method on a Groovy class from classpath.: InvocationTargetException: Preview features are not enabled for com/acme/config/EndToEndTest (class file version 56.65535). Try running with '--enable-preview' -> [Help 1]


I don't see any options that I could pass to this plugin to enable preview features. Does it use javac? Or should such option be in groovyc?







java groovy java-12 gmavenplus






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 25 at 12:14









Krzysztof KrasońKrzysztof Krasoń

16.7k10 gold badges63 silver badges87 bronze badges




16.7k10 gold badges63 silver badges87 bronze badges












  • Looks like the compilation is working, but then running the test happens without --enable-preview set. In case you can check out the compiled .class files from the test with javap -v <class>, you can check that the minor class file version is non-zero, to verify that it was compiled with --enable-preview.

    – Jorn Vernee
    Mar 25 at 13:00












  • @JornVernee Unfortunately groovy compilation is not working, it fails because it sees EndToEnd.class which is a java class compiled with --enable-preview as a result groovyc fails.

    – Krzysztof Krasoń
    Mar 25 at 14:25











  • Oh I see, so groovyc is trying to load this class compiled with --enable-preview, and then it's failing because groovyc is not running in a JVM that has --enable-preview set. Maybe setting the JAVA_OPTS environment variable to "--enable-preview" will work? (this works isolation using the groovy command line)

    – Jorn Vernee
    Mar 25 at 14:58







  • 1





    Reported a bug github.com/groovy/GMavenPlus/issues/125

    – Krzysztof Krasoń
    Mar 26 at 9:18

















  • Looks like the compilation is working, but then running the test happens without --enable-preview set. In case you can check out the compiled .class files from the test with javap -v <class>, you can check that the minor class file version is non-zero, to verify that it was compiled with --enable-preview.

    – Jorn Vernee
    Mar 25 at 13:00












  • @JornVernee Unfortunately groovy compilation is not working, it fails because it sees EndToEnd.class which is a java class compiled with --enable-preview as a result groovyc fails.

    – Krzysztof Krasoń
    Mar 25 at 14:25











  • Oh I see, so groovyc is trying to load this class compiled with --enable-preview, and then it's failing because groovyc is not running in a JVM that has --enable-preview set. Maybe setting the JAVA_OPTS environment variable to "--enable-preview" will work? (this works isolation using the groovy command line)

    – Jorn Vernee
    Mar 25 at 14:58







  • 1





    Reported a bug github.com/groovy/GMavenPlus/issues/125

    – Krzysztof Krasoń
    Mar 26 at 9:18
















Looks like the compilation is working, but then running the test happens without --enable-preview set. In case you can check out the compiled .class files from the test with javap -v <class>, you can check that the minor class file version is non-zero, to verify that it was compiled with --enable-preview.

– Jorn Vernee
Mar 25 at 13:00






Looks like the compilation is working, but then running the test happens without --enable-preview set. In case you can check out the compiled .class files from the test with javap -v <class>, you can check that the minor class file version is non-zero, to verify that it was compiled with --enable-preview.

– Jorn Vernee
Mar 25 at 13:00














@JornVernee Unfortunately groovy compilation is not working, it fails because it sees EndToEnd.class which is a java class compiled with --enable-preview as a result groovyc fails.

– Krzysztof Krasoń
Mar 25 at 14:25





@JornVernee Unfortunately groovy compilation is not working, it fails because it sees EndToEnd.class which is a java class compiled with --enable-preview as a result groovyc fails.

– Krzysztof Krasoń
Mar 25 at 14:25













Oh I see, so groovyc is trying to load this class compiled with --enable-preview, and then it's failing because groovyc is not running in a JVM that has --enable-preview set. Maybe setting the JAVA_OPTS environment variable to "--enable-preview" will work? (this works isolation using the groovy command line)

– Jorn Vernee
Mar 25 at 14:58






Oh I see, so groovyc is trying to load this class compiled with --enable-preview, and then it's failing because groovyc is not running in a JVM that has --enable-preview set. Maybe setting the JAVA_OPTS environment variable to "--enable-preview" will work? (this works isolation using the groovy command line)

– Jorn Vernee
Mar 25 at 14:58





1




1





Reported a bug github.com/groovy/GMavenPlus/issues/125

– Krzysztof Krasoń
Mar 26 at 9:18





Reported a bug github.com/groovy/GMavenPlus/issues/125

– Krzysztof Krasoń
Mar 26 at 9:18












1 Answer
1






active

oldest

votes


















1














With the changes in Groovy (GROOVY-9073) and GMavenPlus (#125), this is now available as of GMavenPlus 1.7.1 with Groovy 2.5.7+ / 3.0.0-beta-1+.






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55337570%2fgroovyc-and-java-12-preview-feature%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    With the changes in Groovy (GROOVY-9073) and GMavenPlus (#125), this is now available as of GMavenPlus 1.7.1 with Groovy 2.5.7+ / 3.0.0-beta-1+.






    share|improve this answer



























      1














      With the changes in Groovy (GROOVY-9073) and GMavenPlus (#125), this is now available as of GMavenPlus 1.7.1 with Groovy 2.5.7+ / 3.0.0-beta-1+.






      share|improve this answer

























        1












        1








        1







        With the changes in Groovy (GROOVY-9073) and GMavenPlus (#125), this is now available as of GMavenPlus 1.7.1 with Groovy 2.5.7+ / 3.0.0-beta-1+.






        share|improve this answer













        With the changes in Groovy (GROOVY-9073) and GMavenPlus (#125), this is now available as of GMavenPlus 1.7.1 with Groovy 2.5.7+ / 3.0.0-beta-1+.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 6 at 1:04









        KeeganKeegan

        4,9731 gold badge17 silver badges27 bronze badges




        4,9731 gold badge17 silver badges27 bronze badges


















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.








            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55337570%2fgroovyc-and-java-12-preview-feature%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현