You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Vincent Massol (Jira)" <ji...@apache.org> on 2020/06/14 12:24:00 UTC

[jira] [Commented] (SUREFIRE-1431) @{argLine} not replaced if undefined

    [ https://issues.apache.org/jira/browse/SUREFIRE-1431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17135136#comment-17135136 ] 

Vincent Massol commented on SUREFIRE-1431:
------------------------------------------

[~tibordigana] Hi. I'm curious to understand why you say:

bq. No, you have to use dollar symbol: ${argLine} but the property is not the best choice.

The doc says that {{@}} can be use for late resolution: http://maven.apache.org/surefire/maven-surefire-plugin/faq.html#late-property-evaluation

I use the following in the surefire and failsafe configs:

{code}
<argLine>@{argLine} -Xmx1024m</argLine>
{code}

And I've also found that the property is unresolved in some cases leading to surefire/failsafe wrongly executing with:

{noformat}
/bin/sh -c cd ... && /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java '@{argLine}' -Xmx1024m -jar ...
{noformat}

Note that I've tried the following but it doesn't work (the surefire plugin doesn't use it):

{code}
<test.argLine>-Xmx1024m</test.argLine>
{code}

What works is to use:

{code}
<argLine>-Xmx1024m</argLine>
{code}

However that's not great since it means that properties will be used by all plugins accepting an argLine property when I'd only like it to be used by the surefire/failsafe plugins.

Thanks a lot.


> @{argLine} not replaced if undefined
> ------------------------------------
>
>                 Key: SUREFIRE-1431
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1431
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 2.21.1
>         Environment: Maven 3.5.0
>            Reporter: Matthieu Fillon
>            Assignee: Tibor Digana
>            Priority: Major
>         Attachments: maven.log
>
>
> I need to specify argLine for my tests. I also need it to work with Java agent Jacoco when a certain Maven profile is activated.
> So I added `@{argLine}` to my argLine property and it works fine when running with Jacoco agent activated.
> When running the tests without profile that activates Jacoco agent, the surefire plugin fails with following line (relevant maven logs attached) :
> {color:red}Error: Could not find or load main class @\{argLine} {color}
> I guess @{argLine} is only replaced if an argLine has been defined before by another plugin but if not it is not replaced at all.
> Should'nt it be replaced in any case and if none defined, just replace with empty value?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)