2014-09-02 66 views
1

我在MyEclipse的添加公网罐子的build.gradle文件

import org.apache.commons.net.util.SubnetUtils; 

此行,我必须在构建路径(公网-3.3.jar)导入的JAR文件。我有commons-lang3添加到我的依赖build.gradle,它工作正常,但是当我添加commons-net时,cmd给我一个错误,说它找不到commons-net。这是我在的build.gradle依赖代码片段:

dependencies { 
    testCompile "junit:junit:4.11" 
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2' 
    compile group: 'org.apache.commons', name: 'commons-net', version: '3.3' 
    } 

我有什么改变来解决这个问题?

+0

做一个干净的安装的项目加入线到POM后... – StackFlowed 2014-09-02 20:49:56

+0

我已经尝试过“gradle这个干净的构建”,但它抛出了同样的错误。 – KTF 2014-09-02 20:51:09

+0

在存储库部分,你有回购这个罐子来自哪里? – StackFlowed 2014-09-02 20:52:11

回答

4

在maven中央仓库中,group部分也是commons-net。见here。整个条目应为:

compile 'commons-net:commons-net:3.3'

0

更改编译组:org.apache.commonscommons-net来解决这个问题。 尝试这些: dependencies { compile group: 'commons-net', name: 'commons-net', version: '3.3' }