private static final String LIBRARY_NAME_PREFIX = "Ivy_Library_";
@Override
public void update(ProjectPreferences preferences, List<ParsedConfArtifacts> parsedArtifacts) {
URL libraryLocation = preferences.getSharedLibraryLocation();
LibraryManager manager = LibraryManager.forLocation(libraryLocation);
for (ParsedConfArtifacts parsedConfArtifacts : parsedArtifacts) {
try {
String libraryName = getLibraryName(parsedConfArtifacts.getConf());
Library library = manager.getLibrary(libraryName);
Map<String, List<URI>> libraryEntries = convertParsedArtifacts(parsedConfArtifacts);
if (library != null) {
manager.removeLibrary(library);
}
manager.createURILibrary("j2se", libraryName, libraryEntries);
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
}