gradle编译spring源码遇到的错误

来源:互联网 发布:科比历年数据统计 编辑:程序博客网 时间:2024/05/01 14:50

gradle编译spring源码出现 Failed to capture snapshot of input files for task 'distZip' property 'source' d uring up-to-date ch.........的错误



解决方案:打开spring源码中的build.gradle,将


task schemaZip(type: Zip) {        group = "Distribution"        baseName = "spring-framework"        classifier = "schema"        description = "Builds -${classifier} archive containing all " +            "XSDs for deployment at 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) }            for (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                into (shortName) {                    from xsdFile.path                }            }        }    }

替换为

task schemaZip(type: Zip) {        group = "Distribution"        baseName = "spring-framework"        classifier = "schema"        description = "Builds -${classifier} archive containing all " +            "XSDs for deployment at 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) }            for (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                into (shortName) {                    from xsdFile.path                }            }        }    }
0 0
原创粉丝点击