Declare the test-only arguments in an <execution> (
https://maven.apache.org/guides/mini/guide-default-execution-ids.html#Example:_Configuring_compile_and_testCompile_mojos_separately),
and possibly (untested, but theoretically it would work) take advantage of
combine.children="append" (https://maven.apache.org/pom.html#Plugins) to
avoid repeating the plugin-level configuration (compared to the mini-guide
example: put the shared arguments in the plugin-level configuration, and
append the test-only one in the test execution's configuration)

On Wed, Oct 9, 2019 at 2:48 PM Lovro Pandzic <lovro.pand...@infobip.com>
wrote:

> But this approach also affects production compiler...
> So the full use case is:
> production: -parameters
> test: -parameters --enable-preview
>
> BR,
>
>
> Lovro Pandzic
> Division Lead, Enterprise Zagreb
> lovro.pand...@infobip.com
>
> On 09/10/2019, 14:46, "Karl Heinz Marbaise" <khmarba...@gmx.de> wrote:
>
>     Hi,
>
>     this is documented on the documentation page[1]
>
>     which can be achieved by using the following:
>
>     <project>
>        [...]
>        <build>
>          [...]
>          <plugins>
>            <plugin>
>              <groupId>org.apache.maven.plugins</groupId>
>              <artifactId>maven-compiler-plugin</artifactId>
>              <version>3.8.1</version>
>              <configuration>
>                <compilerArgs>
>                  <arg>--enable-preview</arg>
>                  <arg>wished supplemental option</arg>
>                </compilerArgs>
>              </configuration>
>            </plugin>
>          </plugins>
>          [...]
>        </build>
>        [...]
>     </project>
>
>     Kind regards
>     Karl Heinz Marbaise
>
>
>     [1]:
>
> https://maven.apache.org/plugins/maven-compiler-plugin/examples/pass-compiler-arguments.html
>
>     On 09.10.19 14:23, Lovro Pandzic wrote:
>     > Hello,
>     >
>     > I'd like to pass -parameters and enable-preview arguments to the
> test compiler but I can't figure out how, the closest I got is:
>     >
>     > <testCompilerArguments>
>     >      <parameters/>
>     >      <enable-preview/>
>     > </testCompilerArguments>
>     >
>     > How can I pass two arguments to the test compiler where one of them
> requires double dash?
>     >
>     > Best Regards,
>     >
>     >
>     >
>     >
>     > [
> https://cf-cdn.infobip.com/email_signature/Infobip_logo_vertical_signature.png
> ]<
> https://www.infobip.com?utm_medium=email&utm_source=signature&utm_campaign=reach%20%7C%20email%20%7C%20global%20%7C%20signature&utm_term=all%20%7C%20recepient%20%7C%20mwc19&utm_content=signature
> >
>     >
>     > Lovro Pandzic
>     > Division Lead, Enterprise Zagreb
>     >
>     > lovro.pand...@infobip.com<mailto:lovro.pand...@infobip.com>
>     >
>     > [https://cf-cdn.infobip.com/email_signature/line.png]
>     >
>     >
>     >
>     > Office: Zadarska 80, 6th floor, 10000 Zagreb, Croatia
>     > Mobile: +385921001403
>     >
>     >
>     > [https://cf-cdn.infobip.com/email_signature/roccovendor2019.png]<
> https://www.infobip.com/en/media/press-releases/rocco-awards-2019-infobip-rated-1-a2p-sms-messaging-vendor-by-enterprises-m>
>  [https://cf-cdn.infobip.com/email_signature/spacer.png]
>     >
>     > [https://cf-cdn.infobip.com/email_signature/Facebook.png]<
> https://www.facebook.com/infobip>     [
> https://cf-cdn.infobip.com/email_signature/Linkedin.png] <
> https://www.linkedin.com/company/infobip>    [
> https://cf-cdn.infobip.com/email_signature/Twitter.png] <
> https://twitter.com/Infobip>  [
> https://cf-cdn.infobip.com/email_signature/Instagram.png] <
> https://www.instagram.com/infobip/>         [
> https://cf-cdn.infobip.com/email_signature/Youtube.png] <
> https://www.youtube.com/channel/UCUPSTy53VecI5GIir3J3ZbQ>
> www.infobip.com<
> https://www.infobip.com?utm_medium=email&utm_source=signature&utm_campaign=reach%20%7C%20email%20%7C%20global%20%7C%20signature&utm_term=all%20%7C%20recepient%20%7C%20mwc19&utm_content=signature
> >
>     >
>     >
>     > GSMA Associate Member   /  Mobey Forum Member
>     > This message is private and confidential. Any views or opinions
> expressed are solely those of the author and do not necessarily represent
> those of Infobip d.o.o. If you have received this message in error, please
> notify us immediately via email to customer.supp...@infobip.com<mailto:
> customer.supp...@infobip.com> or telephone +442032864231.
>     >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>


-- 
Thomas Broyer
/tɔ.ma.bʁwa.je/ <http://xn--nna.ma.xn--bwa-xxb.je/>

Reply via email to