int (@NotNull ProjectFileIndex fileIndex) { ApplicationManager.getApplication().assertReadAccessAllowed(); return withReadLock(() -> { final CRC32 crc = new CRC32(); MavenExplicitProfiles profiles = myExplicitProfiles; if (profiles != null) { updateCrc(crc, profiles.hashCode()); } Collection<MavenProject> allProjects = myVirtualFileToProjectMapping.values(); crc.update(allProjects.size() & 0xFF); for (MavenProject mavenProject : allProjects) { VirtualFile pomFile = mavenProject.getFile(); Module module = fileIndex.getModuleForFile(pomFile); if (module == null) continue; if (!Comparing.equal(fileIndex.getContentRootForFile(pomFile), pomFile.getParent())) continue; updateCrc(crc, module.getName()); MavenId mavenId = mavenProject.getMavenId(); updateCrc(crc, mavenId.getGroupId()); updateCrc(crc, mavenId.getArtifactId()); updateCrc(crc, mavenId.getVersion()); MavenId parentId = mavenProject.getParentId(); if (parentId != null) { updateCrc(crc, parentId.getGroupId()); updateCrc(crc, parentId.getArtifactId()); updateCrc(crc, parentId.getVersion()); } updateCrc(crc, mavenProject.getDirectory()); updateCrc(crc, MavenFilteredPropertyPsiReferenceProvider.getDelimitersPattern(mavenProject).pattern()); updateCrc(crc, mavenProject.getModelMap().hashCode()); updateCrc(crc, mavenProject.getResources().hashCode()); updateCrc(crc, mavenProject.getTestResources().hashCode()); updateCrc(crc, getFilterExclusions(mavenProject).hashCode()); updateCrc(crc, mavenProject.getProperties().hashCode()); for (String each : mavenProject.getFilterPropertiesFiles()) { File file = new File(each); updateCrc(crc, file.lastModified()); } XMLOutputter outputter = new XMLOutputter(Format.getCompactFormat()); Writer crcWriter = new Writer() { @Override public void write(char[] cbuf, int off, int len) { for (int i = off, end = off + len; i < end; i++) { crc.update(cbuf[i]); } } @Override public void flush() { } @Override public void close() { } }; try { Element resourcePluginCfg = mavenProject.getPluginConfiguration("org.apache.maven.plugins", "maven-resources-plugin"); if (resourcePluginCfg != null) { outputter.output(resourcePluginCfg, crcWriter); } Element warPluginCfg = mavenProject.getPluginConfiguration("org.apache.maven.plugins", "maven-war-plugin"); if (warPluginCfg != null) { outputter.output(warPluginCfg, crcWriter); } } catch (IOException e) { LOG.error(e); } } return (int)crc.getValue(); }); }