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

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

Christian Bach created GROOVY-9091:
--------------------------------------

             Summary: 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
         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.

{{@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.



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