Svn 无法在Android Studio gradle中导入org.tmatesoft
这里的各种帖子显示了从tmatesoft导入svnkit,如下所示,在CLI中运行良好,但在Android Studio中,同步和运行都会在Svn 无法在Android Studio gradle中导入org.tmatesoft,svn,gradle,android-studio,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'
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" );
}
buildscript{
存储库{
mavenCentral()
}
依赖关系{
classpath'com.android.tools.build:gradle:1.0.0'
类路径组:“org.tmatesoft.svnkit”,名称:“svnkit”,版本:“1.7.11”
}
}
导入org.tmatesoft.svn.cli.svn;
project.ext.SVN=SVN;
def_disableSystemExitCall={
System.setSecurityManager(
新安全管理器(){
@重写公共void checkPermission(java.security.Permission perm){}
@重写公共void checkExit(int status){throw new SecurityException();}
}
);
};
def _enableSystemExitCall={System.setSecurityManager(null);};
/*在某些情况下,与build共享这些闭包可能很有用*/
project.ext.disableSystemExitCall=\u disableSystemExitCall;
project.ext.enableSystemExitCall=\u enableSystemExitCall;
project.ext.doSvnMain={String…aSvnArgs->
_disableSystemExitCall();/*停止SVN.main执行System.exit调用*/
试一试{
main(aSvnArgs作为字符串[]);
}最后{
_enableSystemExitCall();
}
} ;
任务AAAA根据,在org.tmatesoft.svn
org的任何包中都没有classorg.tmatesoft.svn.cli.svn
svnkit cli
旧组织的org.tmate
很久以前就有了,但新版本和新组织没有
另外,您使用的工件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
我尝试了这些类,但仍然抱怨编辑器中的“tmatesoft”部分和同步时产生错误:错误:(30,0)原因:启动失败:生成文件“…/build.gradle”:30:无法解析类org.tmatesoft.svn.cli.svn.svncommandendervironment@line 30,第1列。导入org.tmatesoft.svn.cli.svn.svncommandendevironment;^1错误
您是否也将依赖项声明名称修复为正确的名称?啊哈!看来已经修好了!感谢您的帮助。由于“tmatesoft”仍有悬停错误,但同步/生成并运行成功。