Java Code Examples for org.netbeans.modules.maven.model.Utilities#saveChanges()
The following examples show how to use
org.netbeans.modules.maven.model.Utilities#saveChanges() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: POMManager.java From netbeans with Apache License 2.0 | 6 votes |
public static void reload(Project project) { NbMavenProject mavenProject = project.getLookup().lookup(NbMavenProject.class); try { FileObject pomFileObject = toFileObject(mavenProject.getMavenProject().getFile()); POMModel model = POMModelFactory.getDefault().getModel(Utilities.createModelSource(pomFileObject)); Utilities.saveChanges(model); } catch (IOException ex) { Exceptions.printStackTrace(ex); } RP.post(() -> { mavenProject.triggerDependencyDownload(); }); SwingUtilities.invokeLater(() -> NbMavenProject.fireMavenProjectReload(project)); }
Example 2
Source File: POMManager.java From jeddict with Apache License 2.0 | 6 votes |
public static void reload(Project project) { NbMavenProject mavenProject = project.getLookup().lookup(NbMavenProject.class); try { FileObject pomFileObject = toFileObject(mavenProject.getMavenProject().getFile()); POMModel model = POMModelFactory.getDefault().getModel(Utilities.createModelSource(pomFileObject)); Utilities.saveChanges(model); } catch (IOException ex) { Exceptions.printStackTrace(ex); } RP.post(() -> { mavenProject.triggerDependencyDownload(); NbMavenProject.fireMavenProjectReload(project); }); SwingUtilities.invokeLater(() -> NbMavenProject.fireMavenProjectReload(project)); }