spring error during build

前端 未结 9 2172
独厮守ぢ
独厮守ぢ 2020-12-24 14:23

I have to make small website using spring. so i chose spring template project then new spring mvc project whatever i try there

9条回答
  •  悲&欢浪女
    2020-12-24 15:12

    If you don't want to completely remove your local maven repository, use the following to find the broken artifacts and remove them:

    public static void main(String[] args) throws IOException {
        findBrokenZip(Paths.get(System.getProperty("user.home") + "/.m2/repository"));
    }
    
    static void findBrokenZip(Path path) throws IOException {
        try (DirectoryStream stream = Files.newDirectoryStream(path)) {
            for (Path entry : stream) {
                if (Files.isDirectory(entry)) {
                    findBrokenZip(entry);
                } else {
                    if (entry.getFileName().toString().endsWith(".jar")) {
                        try (JarFile zipFile = new JarFile(entry.toFile())) {
                            zipFile.getManifest();
                        } catch (ZipException e) {
                            Files.delete(entry);
                        }
                    }
                }
            }
        }
    }
    

提交回复
热议问题