这里的各种帖子都显示了从 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
最佳答案
根据this search ,在org.tmatesoft.svnkit
org的任何包中都没有类org.tmatesoft.svn.cli.SVN
。
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.
您需要的类(class)是:
org.tmatesoft.svn.cli.svn.SVNCheckoutCommand
org.tmatesoft.svn.cli.svn.SVNCommandEnvironment
org.tmatesoft.svn.cli.svn.SVNDeleteCommand
关于svn - 无法在 Android Studio gradle 中导入 org.tmatesoft,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28079047/