Lines 216-222
Link Here
|
216 |
// @PSP's and the like, and PackagingProvider impls, may check project lookup for e.g. NbMavenProject, so init lookup in two stages: |
216 |
// @PSP's and the like, and PackagingProvider impls, may check project lookup for e.g. NbMavenProject, so init lookup in two stages: |
217 |
basicLookup = createBasicLookup(projectState, auxiliary); |
217 |
basicLookup = createBasicLookup(projectState, auxiliary); |
218 |
//here we always load the MavenProject instance because we need to touch the packaging from pom. |
218 |
//here we always load the MavenProject instance because we need to touch the packaging from pom. |
219 |
completeLookup = LookupProviderSupport.createCompositeLookup(basicLookup, new PackagingTypeDependentLookup(watcher)); |
219 |
completeLookup = LookupProviderSupport.createCompositeLookup(LookupProviderSupport.createCompositeLookup(basicLookup, new PackagingTypeDependentLookup(watcher)), new ExcludesIncludesLookup(watcher)); |
220 |
} |
220 |
} |
221 |
|
221 |
|
222 |
public File getPOMFile() { |
222 |
public File getPOMFile() { |
Lines 741-746
Link Here
|
741 |
} |
741 |
} |
742 |
} |
742 |
} |
743 |
} |
743 |
} |
|
|
744 |
|
745 |
private static class ExcludesIncludesLookup extends ProxyLookup implements PropertyChangeListener { |
746 |
|
747 |
private final NbMavenProject watcher; |
748 |
private String[] excludes; |
749 |
private String[] includes; |
750 |
|
751 |
@SuppressWarnings("LeakingThisInConstructor") |
752 |
ExcludesIncludesLookup(NbMavenProject watcher) { |
753 |
this.watcher = watcher; |
754 |
|
755 |
MavenProject mp = watcher.getMavenProject(); |
756 |
|
757 |
excludes = PluginPropertyUtils.getPluginPropertyList(mp, Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_COMPILER, "excludes", "exclude", null); |
758 |
includes = PluginPropertyUtils.getPluginPropertyList(mp, Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_COMPILER, "includes", "include", null); |
759 |
|
760 |
check(); |
761 |
watcher.addPropertyChangeListener(this); |
762 |
} |
763 |
|
764 |
private void check() { |
765 |
MavenProject mp = watcher.getMavenProject(); |
766 |
|
767 |
String[] excludes = PluginPropertyUtils.getPluginPropertyList(mp, Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_COMPILER, "excludes", "exclude", null); |
768 |
String[] includes = PluginPropertyUtils.getPluginPropertyList(mp, Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_COMPILER, "includes", "include", null); |
769 |
|
770 |
if (!Arrays.equals(this.includes, includes) || !Arrays.equals(this.excludes, excludes)) { |
771 |
this.includes = includes; |
772 |
this.excludes = excludes; |
773 |
|
774 |
RELOAD_RP.post(new Runnable() { |
775 |
@Override |
776 |
public void run() { |
777 |
FileObject file = FileUtilities.convertStringToFileObject(watcher.getMavenProject().getBuild().getSourceDirectory()); |
778 |
MavenVisibilityQueryImplementation.visibilityChanged(new FileObject[]{file}); |
779 |
} |
780 |
}); |
781 |
} |
782 |
} |
783 |
|
784 |
public @Override |
785 |
void propertyChange(PropertyChangeEvent evt) { |
786 |
if (NbMavenProjectImpl.PROP_PROJECT.equals(evt.getPropertyName())) { |
787 |
check(); |
788 |
} |
789 |
} |
790 |
} |
744 |
|
791 |
|
745 |
private Lookup createBasicLookup(ProjectState state, M2AuxilaryConfigImpl auxiliary) { |
792 |
private Lookup createBasicLookup(ProjectState state, M2AuxilaryConfigImpl auxiliary) { |
746 |
return Lookups.fixed( |
793 |
return Lookups.fixed( |