travis-ci中的gradle检查失败

时间:2016-05-10 13:32:46

标签: java gradle travis-ci

我已将travis-ci添加到github project。项目本身是多模块的,由:client:server:shared组成。 在:client sourceSets模块中,我按以下方式组织了sourceSets { main { java { runtimeClasspath += project(":shared").sourceSets.main.java.srcDirs srcDirs += project(":shared").sourceSets.main.java.srcDirs } } }

travis-ci

现在,当gradle check运行$ gradle server:clean server:check FAILURE: Build failed with an exception. * Where: Build file '/home/travis/build/bduisenov/mockserver/client/build.gradle' line: 55 * What went wrong: A problem occurred evaluating project ':client'. > Could not find method main() for arguments [build_ab0sue8nexlysud7wfupu5ddr$_run_closure4_closure12@3fb9a67f] on project ':client'. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 10.05 secs The command "gradle server:clean server:check" exited with 1. 时,build.gradle失败了:

string path = @"C:\work\myxml.XML";
string pathnew = @"C:\work\myxml_new.XML";
//GetFileEncoding(path);
XmlDocument document = new XmlDocument();
XmlDeclaration xmlDeclaration = document.CreateXmlDeclaration("1.0","US-ASCII",null);
//document.CreateXmlDeclaration("1.0", null, null);
document.Load(path);
string x = document.InnerText;
document.Save(pathnew);

虽然在本地运行,但我没有任何问题。

对此有何看法?

1 个答案:

答案 0 :(得分:0)

我认为错误只来自使用旧版本2.0的Travis CI上的gradle版本。如果您首先生成gradle wrapper,那么Travis CI将使用该代替内置版本 - 请参阅https://docs.travis-ci.com/user/languages/java#Projects-Using-Gradle。我确实在本地尝试了你的项目,Gradle 2.12没有问题。