List<MavenArtifact> (State state) { synchronized (state) { if (state.myUnresolvedExtensionsCache == null) { List<MavenArtifact> result = new ArrayList<>(); for (MavenArtifact each : state.myExtensions) { // Collect only extensions that were attempted to be resolved. // It is because embedder does not even try to resolve extensions that // are not necessary. if (state.myUnresolvedArtifactIds.contains(each.getMavenId()) && !pomFileExists(state.myLocalRepository, each)) { result.add(each); } } state.myUnresolvedExtensionsCache = result; } return state.myUnresolvedExtensionsCache; } }