You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2019/04/18 22:09:00 UTC

[jira] [Updated] (GROOVY-9091) Grape's @GrabConfig systemProperties set too late

     [ https://issues.apache.org/jira/browse/GROOVY-9091?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King updated GROOVY-9091:
------------------------------
    Description: 
This minimalistic example with {{@GrabConfig(systemProperties='ivy.message.logger.level=3')}} does not cause logging output to be produced, i.e. {{Grape.grab(...)}} does not execute with the additional systemProperties being set.
{code}
GrabConfig(systemProperties='ivy.message.logger.level=3')
@Grab(group='commons-lang', module='commons-lang', version='2.6')
import org.apache.commons.lang.StringUtils
assert StringUtils.name == 'org.apache.commons.lang.StringUtils'
{code}
On setting properties explicitly before the {{grab()}} in {{GrabAnnotationTransformation.java}} as done in the attached version of the class, it works as expected, but of course is not a proper fix ;) 

The properties are only set by the {{ResolveVisitor}} after the Ivy dependency resolution completed, which is too late for being effective for Grape grabbing dependencies.

This bug is problematic in our enterprise setup where we try to configure proxy settings through a {{@GrabConfig(systemProperties='http.proxyHost=10.0.0.100,...}} annotation.

  was:
This minimalistic example with {{@GrabConfig(systemProperties='ivy.message.logger.level=3')}} does not cause logging output to be produced, i.e. {{Grape.grab(...)}} does not execute with the additional systemProperties being set.

{{@GrabConfig(systemProperties='ivy.message.logger.level=3')}}
 {{@Grab(group='commons-lang', module='commons-lang', version='2.6')}}
 {{import org.apache.commons.lang.StringUtils}}
 {{assert StringUtils.name == 'org.apache.commons.lang.StringUtils'}}

On setting properties explicitly before the {{grab()}} in {{GrabAnnotationTransformation.java}} as done in the attached version of the class, it works as expected, but of course is not a proper fix ;) 

The properties are only set by the {{ResolveVisitor}} after the Ivy dependency resolution completed, which is too late for being effective for Grape grabbing dependencies.

This bug is problematic in our enterprise setup where we try to configure proxy settings through a {{@GrabConfig(systemProperties='http.proxyHost=10.0.0.100,...}} annotation.


> Grape's @GrabConfig systemProperties set too late
> -------------------------------------------------
>
>                 Key: GROOVY-9091
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9091
>             Project: Groovy
>          Issue Type: Bug
>          Components: Grape
>    Affects Versions: 2.5.6
>            Reporter: Christian Bach
>            Priority: Major
>         Attachments: Screenshot 2019-04-18 at 19.46.23.png
>
>
> This minimalistic example with {{@GrabConfig(systemProperties='ivy.message.logger.level=3')}} does not cause logging output to be produced, i.e. {{Grape.grab(...)}} does not execute with the additional systemProperties being set.
> {code}
> GrabConfig(systemProperties='ivy.message.logger.level=3')
> @Grab(group='commons-lang', module='commons-lang', version='2.6')
> import org.apache.commons.lang.StringUtils
> assert StringUtils.name == 'org.apache.commons.lang.StringUtils'
> {code}
> On setting properties explicitly before the {{grab()}} in {{GrabAnnotationTransformation.java}} as done in the attached version of the class, it works as expected, but of course is not a proper fix ;) 
> The properties are only set by the {{ResolveVisitor}} after the Ivy dependency resolution completed, which is too late for being effective for Grape grabbing dependencies.
> This bug is problematic in our enterprise setup where we try to configure proxy settings through a {{@GrabConfig(systemProperties='http.proxyHost=10.0.0.100,...}} annotation.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)