无法在Android Studio gradle中导入org.tmatesoft

时间:2015-01-21 23:51:09

标签: svn gradle android-studio

这里有各种帖子显示从tmatesoft导入svnkit,如下所示,这在CLI中运行良好,但在Android Studio中,同步和运行都会在import org.tmatesoft.svn.cli.SVN;上生成错误

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
        classpath group: 'org.tmatesoft.svnkit', name: 'svnkit', version: '1.7.11'
    }
}

import org.tmatesoft.svn.cli.SVN;

project.ext.SVN = SVN;

def _disableSystemExitCall = {
    System.setSecurityManager(
            new SecurityManager() {
                @Override public void checkPermission(java.security.Permission perm) {}
                @Override public void checkExit(int status) { throw new SecurityException(); }
            }
    );
};



def _enableSystemExitCall = { System.setSecurityManager(null); };

/* for certain scenarios might be useful to share these closures with build */
project.ext.disableSystemExitCall = _disableSystemExitCall;
project.ext.enableSystemExitCall = _enableSystemExitCall;

project.ext.doSvnMain = { String... aSvnArgs ->
    _disableSystemExitCall(); /* stop SVN.main from doing a System.exit call */
    try {
        SVN.main( aSvnArgs as String[] );
    } finally {
        _enableSystemExitCall();
    }
} ;

task AAAA << {
    doSvnMain( 'info', "mySVNUrl" );
}

使用 Gradle - distributionUrl = https://services.gradle.org/distributions/gradle-2.2.1-all.zip Android Studio - 1.0.2

1 个答案:

答案 0 :(得分:2)

根据this searchorg.tmatesoft.svn.cli.SVN org的任何包中都没有类org.tmatesoft.svnkit

svnkit-cli旧组织org.tmate曾经很久以前拥有它,但不是新版本和新组织。

此外,您使用的artifact-id是错误的,它应该是svnkit-cli。总而言之,这就是依赖声明:

compile 'org.tmatesoft.svnkit:svnkit-cli:1.8.7' //newer version that the one you looked for.

您需要的课程是:

org.tmatesoft.svn.cli.svn.SVNCheckoutCommand
org.tmatesoft.svn.cli.svn.SVNCommandEnvironment
org.tmatesoft.svn.cli.svn.SVNDeleteCommand