2012-06-21 213 views
0

我正在运行Grails v2.4.0,我一直在尝试为Web服务安装Grails CXF插件。我下载了插件的.zip文件,然后运行grails install-plugin/path/to/zip。在尝试安装时,它给了我一个错误,它无法找到这个依赖关系:org.apache.cxf:cxf-rt-frontend-jaxws:2.3.0。我下载这个插件的页面提到所有需要的东西都在zip中。我无法使用maven自动下载所需的文件,因为我的工作位置不允许下载任何内容。是否有需要手动安装CXF的文件列表,我可以参考?安装Grails CXF插件

回答

0

因为你不能在下载使用Maven的传递依赖,你应该能够排除它们是这样的:

grails.project.dependency.resolution = { 

plugins { 

    compile ":cxf:0.9.0" { 
     excludes([ group: 'org.apache.cxf', name: 'cxf-rt-frontend-jaxws'] 
     // you may need to exclude quite a few... 
    } 
} 

然后手动下载依赖项并将它们放在lib目录中。例如,从这里下载cxf-rt-frontend-jaxws:http://search.maven.org/#search|ga|1|g%3A%22org.apache.cxf%22%20AND%20a%3A%22cxf-rt-frontend-jaxws%22%20AND%20v%3A%222.3.0%22

0

而不是使用install-plugin您应该添加一个依赖项到您的BuildConfig.groovy的相关部分,并确保mavenCentral()存储库已启用。卸载已安装的zip插件,然后编辑您的BuildConfig:

grails.project.dependency.resolution = { 
    // ... 
    repositories { 
     // other repositories as before 
     mavenCentral() 
    } 

    plugins { 
     // other plugins as before 
     compile ":cxf:0.9.0" 
    } 
} 
+0

我在想mavenCentral是问题:“我不能使用maven自动下载所需的文件,因为我的工作位置不允许任何东西被下载“。 – proflux

+1

当你说“不允许下载任何东西”时,你是如何首先下载插件zip的?如果问题在于你的工作需要所有HTTP流量通过代理,那么你可以通过使用'add-proxy'和'set-proxy'命令来配置Grails以使用该代理(http://grails.org/) DOC /最新/ REF /命令%20LINE /设置proxy.html)。 –