如何在Grape中设置自定义Maven存储库管理器

时间:2011-02-08 14:54:17

标签: groovy grape

我想使用grape来通过命令行安装库。所以我发出了命令:

grape -V install org.apache.derby derby 10.5.3.0

Grape应该使用位于 http://127.0.0.1:8081/artifactory/webapp/home.html 的Maven存储库。我该如何配置?

启用详细模式后,我会在日志中看到:

:: loading settings :: url = jar:file:/opt/groovy-1.7.2/lib/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
no default ivy user dir defined: set to /home/alexyz/.ivy2                                                           
including url: jar:file:/opt/groovy-1.7.2/lib/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-public.xml       
no default cache defined: set to /home/alexyz/.ivy2/cache                                                            
including url: jar:file:/opt/groovy-1.7.2/lib/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-shared.xml       
including url: jar:file:/opt/groovy-1.7.2/lib/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-local.xml        
including url: jar:file:/opt/groovy-1.7.2/lib/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-main-chain.xml   
including url: jar:file:/opt/groovy-1.7.2/lib/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings-default-chain.xml
settings loaded (89ms)                                                                                                 
        default cache: /home/alexyz/.ivy2/cache                                                                      
        default resolver: default                                                                                      
        -- 5 resolvers:                                                                                                
        shared [file]                                                                                                  
        default [chain] [local, main]                                                                                  
        local [file]                                                                                                   
        public [ibiblio]                                                                                               
        main [chain] [shared, public]                                                                                  
:: resolving dependencies :: caller#all-caller;working                                                                 
        confs: [default]                                                                                               
        validate = false                                                                                               
        refresh = false                                                                                                
resolving dependencies for configuration 'default'                                                                     
== resolving dependencies for caller#all-caller;working [default]                                                      
== resolving dependencies caller#all-caller;working->org.apache.derby#derby;10.5.3.0 [default->default]                
downloadGrapes: Checking cache for: dependency: org.apache.derby#derby;10.5.3.0 {default=[default]}                    
                tried /home/alexyz/.groovy/grapes/org.apache.derby/derby/ivy-10.5.3.0.xml                            
                tried /home/alexyz/.groovy/grapes/org.apache.derby/derby/jars/derby-10.5.3.0.jar                     
        cachedGrapes: no ivy file nor artifact found for org.apache.derby#derby;10.5.3.0                               
                tried http://repository.codehaus.org/org/apache/derby/derby/10.5.3.0/derby-10.5.3.0.pom

所以我尝试更新jar /opt/groovy-1.7.2/lib/ivy-2.1.0.jar中的文件org / apache / ivy / core / settings / ivysettings-public.xml以添加“ root“属性指向上面的存储库,但Grape似乎无法获得更改。

1 个答案:

答案 0 :(得分:7)

只需在您的葡萄之家添加一个grapeConfig.xml Grape-CustomizeIvysettings