java - build spring framework source code encounter an error -
i fetched spring framework source code github using git clone
command. when build source code using gradle build
in source code directory,it takes long time download dependencies , compile java code,but failed exception.the output below.
:spring-webmvc-portlet:sourcesjar up-to-date :spring-webmvc-tiles2:javadoc skipped :spring-webmvc-tiles2:javadocjar skipped :spring-webmvc-tiles2:sourcesjar skipped :spring-websocket:javadoc up-to-date :spring-websocket:javadocjar up-to-date :spring-websocket:sourcesjar up-to-date :distzip failure: build failed exception. * went wrong: failed capture snapshot of input files task 'distzip' during up-to-date c heck. see stacktrace details. > java.io.filenotfoundexception: c:\users\yuqing\workspace\spring-framework\buil d\distributions\spring-framework-4.3.0.build-snapshot-schema.zip * try: run --info or --debug option more log output. * exception is: org.gradle.api.uncheckedioexception: failed capture snapshot of input files f or task 'distzip' during up-to-date check. see stacktrace details. @ org.gradle.api.internal.changedetection.rules.taskuptodatestate.<init >(taskuptodatestate.java:60) @ org.gradle.api.internal.changedetection.changes.defaulttaskartifactst aterepository$taskartifactstateimpl.getstates(defaulttaskartifactstaterepository .java:132) @ org.gradle.api.internal.changedetection.changes.defaulttaskartifactst aterepository$taskartifactstateimpl.isuptodate(defaulttaskartifactstaterepositor y.java:70) @ org.gradle.api.internal.tasks.execution.skipuptodatetaskexecuter.exec ute(skipuptodatetaskexecuter.java:52) @ org.gradle.api.internal.tasks.execution.validatingtaskexecuter.execut e(validatingtaskexecuter.java:58) @ org.gradle.api.internal.tasks.execution.skipemptysourcefilestaskexecu ter.execute(skipemptysourcefilestaskexecuter.java:52) @ org.gradle.api.internal.tasks.execution.skiptaskwithnoactionsexecuter .execute(skiptaskwithnoactionsexecuter.java:52) @ org.gradle.api.internal.tasks.execution.skiponlyiftaskexecuter.execut e(skiponlyiftaskexecuter.java:53) @ org.gradle.api.internal.tasks.execution.executeatmostoncetaskexecuter .execute(executeatmostoncetaskexecuter.java:43) @ org.gradle.execution.taskgraph.defaulttaskgraphexecuter$eventfiringta skworker.execute(defaulttaskgraphexecuter.java:203) @ org.gradle.execution.taskgraph.defaulttaskgraphexecuter$eventfiringta skworker.execute(defaulttaskgraphexecuter.java:185) @ org.gradle.execution.taskgraph.abstracttaskplanexecutor$taskexecutorw orker.processtask(abstracttaskplanexecutor.java:66) @ org.gradle.execution.taskgraph.abstracttaskplanexecutor$taskexecutorw orker.run(abstracttaskplanexecutor.java:50) @ org.gradle.execution.taskgraph.defaulttaskplanexecutor.process(defaul ttaskplanexecutor.java:25) @ org.gradle.execution.taskgraph.defaulttaskgraphexecuter.execute(defau lttaskgraphexecuter.java:110) @ org.gradle.execution.selectedtaskexecutionaction.execute(selectedtask executionaction.java:37) @ org.gradle.execution.defaultbuildexecuter.execute(defaultbuildexecute r.java:37) @ org.gradle.execution.defaultbuildexecuter.access$000(defaultbuildexec uter.java:23) @ org.gradle.execution.defaultbuildexecuter$1.proceed(defaultbuildexecu ter.java:43) @ org.gradle.execution.dryrunbuildexecutionaction.execute(dryrunbuildex ecutionaction.java:32) @ org.gradle.execution.defaultbuildexecuter.execute(defaultbuildexecute r.java:37) @ org.gradle.execution.defaultbuildexecuter.execute(defaultbuildexecute r.java:30) @ org.gradle.initialization.defaultgradlelauncher$4.run(defaultgradlela uncher.java:154) @ org.gradle.internal.factories$1.create(factories.java:22) @ org.gradle.internal.progress.defaultbuildoperationexecutor.run(defaul tbuildoperationexecutor.java:90) @ org.gradle.internal.progress.defaultbuildoperationexecutor.run(defaul tbuildoperationexecutor.java:52) @ org.gradle.initialization.defaultgradlelauncher.dobuildstages(default gradlelauncher.java:151) @ org.gradle.initialization.defaultgradlelauncher.access$200(defaultgra dlelauncher.java:32) @ org.gradle.initialization.defaultgradlelauncher$1.create(defaultgradl elauncher.java:99) @ org.gradle.initialization.defaultgradlelauncher$1.create(defaultgradl elauncher.java:93) @ org.gradle.internal.progress.defaultbuildoperationexecutor.run(defaul tbuildoperationexecutor.java:90) @ org.gradle.internal.progress.defaultbuildoperationexecutor.run(defaul tbuildoperationexecutor.java:62) @ org.gradle.initialization.defaultgradlelauncher.dobuild(defaultgradle launcher.java:93) @ org.gradle.initialization.defaultgradlelauncher.run(defaultgradlelaun cher.java:82) @ org.gradle.launcher.exec.inprocessbuildactionexecuter$defaultbuildcon .... caused by: org.gradle.api.uncheckedioexception: java.io.filenotfoundexception: c :\users\yuqing\workspace\spring-framework\build\distributions\spring-framework-4 .3.0.build-snapshot-schema.zip (系统找不到指定的文件。) @ org.gradle.internal.hash.hashutil.createhash(hashutil.java:39) @ org.gradle.api.internal.hash.defaulthasher.hash(defaulthasher.java:24 ) @ org.gradle.api.internal.changedetection.state.cachingfilesnapshotter. snapshot(cachingfilesnapshotter.java:57) @ org.gradle.api.internal.changedetection.state.cachingfilesnapshotter. snapshot(cachingfilesnapshotter.java:46) @ org.gradle.api.internal.changedetection.state.cachingfilesnapshotter. snapshot(cachingfilesnapshotter.java:29) @ org.gradle.api.internal.changedetection.state.defaultfilecollectionsn apshotter$1.run(defaultfilecollectionsnapshotter.java:70) @ org.gradle.internal.factories$1.create(factories.java:22) @ org.gradle.cache.internal.defaultcacheaccess.usecache(defaultcacheacc ess.java:192) @ org.gradle.cache.internal.defaultcacheaccess.usecache(defaultcacheacc ess.java:175) @ org.gradle.cache.internal.defaultpersistentdirectorystore.usecache(de faultpersistentdirectorystore.java:106) @ org.gradle.cache.internal.defaultcachefactory$referencetrackingcache. usecache(defaultcachefactory.java:187) @ org.gradle.api.internal.changedetection.state.defaulttaskartifactstat ecacheaccess.usecache(defaulttaskartifactstatecacheaccess.java:60) @ org.gradle.api.internal.changedetection.state.defaultfilecollectionsn apshotter.snapshot(defaultfilecollectionsnapshotter.java:62) @ org.gradle.api.internal.changedetection.rules.taskuptodatestate.<init >(taskuptodatestate.java:56) ... 57 more caused by: java.io.filenotfoundexception: c:\users\yuqing\workspace\spring-frame work\build\distributions\spring-framework-4.3.0.build-snapshot-schema.zip @ org.gradle.internal.hash.hashutil.createhash(hashutil.java:34) ... 70 more build failed total time: 20.861 secs
the error indicates file spring-framework-4.3.0.build-snapshot-schema.zip
not found.i wondered why file not found,it should created distzip
task doesn't. have googled problem not found question this.
i have resovled problem,the devil path separator.because command runs on windows. modify schemazip task definition from
task schemazip(type: zip) { group = "distribution" basename = "spring-framework" classifier = "schema" description = "builds -${classifier} archive containing " + "xsds deployment @ http://springframework.org/schema." duplicatesstrategy 'exclude' moduleprojects.each { subproject -> def properties schemas = new properties(); subproject.sourcesets.main.resources.find { it.path.endswith("meta-inf/spring.schemas") }?.withinputstream { schemas.load(it) } (def key : schemas.keyset()) { def shortname = key.replaceall(/http.*schema.(.*).spring-.*/, '$1') assert shortname != key file xsdfile = subproject.sourcesets.main.resources.find { it.path.endswith(schemas.get(key)) } assert xsdfile != null (shortname) { xsdfile.path } } } }
to
task schemazip(type: zip) { group = "distribution" basename = "spring-framework" classifier = "schema" description = "builds -${classifier} archive containing " + "xsds deployment @ http://springframework.org/schema." duplicatesstrategy 'exclude' moduleprojects.each { subproject -> def properties schemas = new properties(); subproject.sourcesets.main.resources.find { it.path.endswith("meta-inf\\spring.schemas") }?.withinputstream { schemas.load(it) } (def key : schemas.keyset()) { def shortname = key.replaceall(/http.*schema.(.*).spring-.*/, '$1') assert shortname != key file xsdfile = subproject.sourcesets.main.resources.find { it.path.endswith(schemas.get(key).replaceall('\\/','\\\\')) } assert xsdfile != null (shortname) { xsdfile.path } } } }
Comments
Post a Comment