Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

379610 : m2e-wtp initial contribution

Signed-off-by: Fred Bricon <fbricon@gmail.com>
  • Loading branch information...
commit 7322f9e00154d4ed231d9298256b029765722645 0 parents
@fbricon fbricon authored
Showing with 16,332 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +3 −0  .settings/org.eclipse.core.resources.prefs
  3. +5 −0 .settings/org.eclipse.m2e.core.prefs
  4. +9 −0 .settings/org.maven.ide.eclipse.prefs
  5. +25 −0 README.md
  6. +1 −0  org.eclipse.m2e.wtp.feature/.gitignore
  7. +23 −0 org.eclipse.m2e.wtp.feature/.project
  8. +3 −0  org.eclipse.m2e.wtp.feature/.settings/org.eclipse.core.resources.prefs
  9. +5 −0 org.eclipse.m2e.wtp.feature/.settings/org.eclipse.m2e.core.prefs
  10. +4 −0 org.eclipse.m2e.wtp.feature/.settings/org.eclipse.mylyn.tasks.ui.prefs
  11. +3 −0  org.eclipse.m2e.wtp.feature/.settings/org.eclipse.mylyn.team.ui.prefs
  12. +9 −0 org.eclipse.m2e.wtp.feature/.settings/org.maven.ide.eclipse.prefs
  13. +2 −0  org.eclipse.m2e.wtp.feature/build.properties
  14. +273 −0 org.eclipse.m2e.wtp.feature/feature.properties
  15. +63 −0 org.eclipse.m2e.wtp.feature/feature.xml
  16. +107 −0 org.eclipse.m2e.wtp.feature/pom.xml
  17. +14 −0 org.eclipse.m2e.wtp.feature/src/main/assembly/assembly.xml
  18. +7 −0 org.eclipse.m2e.wtp.overlay.ui/.classpath
  19. +2 −0  org.eclipse.m2e.wtp.overlay.ui/.gitignore
  20. +34 −0 org.eclipse.m2e.wtp.overlay.ui/.project
  21. +3 −0  org.eclipse.m2e.wtp.overlay.ui/.settings/org.eclipse.core.resources.prefs
  22. +8 −0 org.eclipse.m2e.wtp.overlay.ui/.settings/org.eclipse.jdt.core.prefs
  23. +5 −0 org.eclipse.m2e.wtp.overlay.ui/.settings/org.eclipse.m2e.core.prefs
  24. +17 −0 org.eclipse.m2e.wtp.overlay.ui/META-INF/MANIFEST.MF
  25. +5 −0 org.eclipse.m2e.wtp.overlay.ui/build.properties
  26. +30 −0 org.eclipse.m2e.wtp.overlay.ui/plugin.xml
  27. +23 −0 org.eclipse.m2e.wtp.overlay.ui/pom.xml
  28. +73 −0 org.eclipse.m2e.wtp.overlay.ui/src/org/eclipse/m2e/wtp/overlay/ui/OverlayUIPluginActivator.java
  29. +36 −0 ...ipse.m2e.wtp.overlay.ui/src/org/eclipse/m2e/wtp/overlay/ui/preferences/OverlayPublishingPreferencePage.java
  30. +5 −0 org.eclipse.m2e.wtp.overlay/.gitignore
  31. +29 −0 org.eclipse.m2e.wtp.overlay/META-INF/MANIFEST.MF
  32. +5 −0 org.eclipse.m2e.wtp.overlay/build.properties
  33. +16 −0 org.eclipse.m2e.wtp.overlay/plugin.xml
  34. +23 −0 org.eclipse.m2e.wtp.overlay/pom.xml
  35. +21 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/OverlayConstants.java
  36. +39 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/OverlayPluginActivator.java
  37. +345 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/CompositeVirtualFolder.java
  38. +295 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/DynamicResourceFilter.java
  39. +139 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/FileSystemResourceFilter.java
  40. +17 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/IFilteredVirtualFolder.java
  41. +14 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/IResourceFilter.java
  42. +44 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/OverlaySelfComponent.java
  43. +149 −0 ...pse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/OverlayVirtualArchiveComponent.java
  44. +179 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/OverlayVirtualComponent.java
  45. +154 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/ResourceListVirtualFolder.java
  46. +26 −0 ...pse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/preferences/OverlayPreferencesInitializer.java
  47. +146 −0 ...eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/servers/OverlayResourceChangeListener.java
  48. +120 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/utilities/CompressionUtil.java
  49. +19 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/utilities/PathUtil.java
  50. +38 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/modulecore/IOverlayVirtualComponent.java
  51. +61 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/modulecore/ModuleURIUtil.java
  52. +38 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/modulecore/OverlayComponentCore.java
  53. +184 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/modulecore/OverlayReferenceResolver.java
  54. +79 −0 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/modulecore/UnpackArchiveJob.java
  55. +4 −0 org.eclipse.m2e.wtp.site/.gitignore
  56. +3 −0  org.eclipse.m2e.wtp.site/.settings/org.eclipse.core.resources.prefs
  57. +5 −0 org.eclipse.m2e.wtp.site/.settings/org.eclipse.m2e.core.prefs
  58. +60 −0 org.eclipse.m2e.wtp.site/index.html
  59. +88 −0 org.eclipse.m2e.wtp.site/pom.xml
  60. +11 −0 org.eclipse.m2e.wtp.site/site.xml
  61. +14 −0 org.eclipse.m2e.wtp.site/src/main/assembly/assembly.xml
  62. +12 −0 org.eclipse.m2e.wtp.site/web/site.css
  63. +214 −0 org.eclipse.m2e.wtp.site/web/site.xsl
  64. +2 −0  org.eclipse.m2e.wtp.target-platform/.gitignore
  65. +17 −0 org.eclipse.m2e.wtp.target-platform/.project
  66. +3 −0  org.eclipse.m2e.wtp.target-platform/.settings/org.eclipse.core.resources.prefs
  67. +5 −0 org.eclipse.m2e.wtp.target-platform/.settings/org.eclipse.m2e.core.prefs
  68. +9 −0 org.eclipse.m2e.wtp.target-platform/.settings/org.maven.ide.eclipse.prefs
  69. +89 −0 org.eclipse.m2e.wtp.target-platform/m2e-wtp-e36.target
  70. +58 −0 org.eclipse.m2e.wtp.target-platform/m2e-wtp-e371.target
  71. +56 −0 org.eclipse.m2e.wtp.target-platform/pom.xml
  72. +8 −0 org.eclipse.m2e.wtp/.classpath
  73. +2 −0  org.eclipse.m2e.wtp/.gitignore
  74. +34 −0 org.eclipse.m2e.wtp/.project
  75. +2 −0  org.eclipse.m2e.wtp/.settings/org.eclipse.core.resources.prefs
  76. +377 −0 org.eclipse.m2e.wtp/.settings/org.eclipse.jdt.core.prefs
  77. +10 −0 org.eclipse.m2e.wtp/.settings/org.eclipse.jdt.ui.prefs
  78. +5 −0 org.eclipse.m2e.wtp/.settings/org.eclipse.m2e.core.prefs
  79. +4 −0 org.eclipse.m2e.wtp/.settings/org.eclipse.mylyn.tasks.ui.prefs
  80. +3 −0  org.eclipse.m2e.wtp/.settings/org.eclipse.mylyn.team.ui.prefs
  81. +2 −0  org.eclipse.m2e.wtp/.settings/org.jboss.ide.eclipse.as.core.prefs
  82. +9 −0 org.eclipse.m2e.wtp/.settings/org.maven.ide.eclipse.prefs
  83. +55 −0 org.eclipse.m2e.wtp/META-INF/MANIFEST.MF
  84. +6 −0 org.eclipse.m2e.wtp/NOTICE
  85. +9 −0 org.eclipse.m2e.wtp/build.properties
  86. BIN  org.eclipse.m2e.wtp/icons/ear-resources.gif
  87. BIN  org.eclipse.m2e.wtp/icons/web-resources.gif
  88. BIN  org.eclipse.m2e.wtp/jars/maven-war-plugin-2.1.1.jar
  89. +306 −0 org.eclipse.m2e.wtp/lifecycle-mapping-metadata.xml
  90. +276 −0 org.eclipse.m2e.wtp/plugin.xml
  91. +29 −0 org.eclipse.m2e.wtp/pom.xml
  92. +138 −0 org.eclipse.m2e.wtp/schema/dependencyConfigurators.exsd
  93. +88 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/AbstractDependencyConfigurator.java
  94. +82 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/AbstractFilteringSupportMavenPlugin.java
  95. +412 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/AbstractProjectConfiguratorDelegate.java
  96. +118 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/AcrPluginConfiguration.java
  97. +109 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/AppClientProjectConfiguratorDelegate.java
  98. +128 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/ArtifactHelper.java
  99. +214 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/ConnectorProjectConfiguratorDelegate.java
  100. +143 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/DebugUtilities.java
  101. +27 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/DeploymentDescriptorManagement.java
  102. +75 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/DomUtils.java
  103. +399 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/EarPluginConfiguration.java
  104. +270 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/EarProjectConfiguratorDelegate.java
  105. +86 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/EjbPluginConfiguration.java
  106. +108 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/EjbProjectConfiguratorDelegate.java
  107. +51 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/IMavenPackageFilter.java
  108. +20 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/IPackagingConfiguration.java
  109. +57 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/IProjectConfiguratorDelegate.java
  110. +80 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/JEEPackaging.java
  111. +33 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/MarkedException.java
  112. +262 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/MavenDeploymentDescriptorManagement.java
  113. +136 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/MavenSessionHelper.java
  114. +55 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/MavenWtpConstants.java
  115. +71 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/MavenWtpPlugin.java
  116. +35 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/Messages.java
  117. +189 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/OverlayConfigurator.java
  118. +77 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/PackagingConfiguration.java
  119. +50 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/ProjectConfiguratorDelegateFactory.java
  120. +113 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/ProjectUtils.java
  121. +151 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/RarPluginConfiguration.java
  122. +133 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/ResourceCleaner.java
  123. +119 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/UnsupportedDependencyTypeProjectConfigurator.java
  124. +66 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/UtilityProjectConfigurator.java
  125. +121 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/WTPProjectConfigurator.java
  126. +628 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/WTPProjectsUtil.java
  127. +360 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/WarPluginConfiguration.java
  128. +121 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/WebFragmentProjectConfigurator.java
  129. +447 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/WebProjectConfiguratorDelegate.java
  130. +305 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/AbstractEarModule.java
  131. +49 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/AppClientModule.java
  132. +144 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/ArtifactRepository.java
  133. +169 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/ArtifactTypeMappingService.java
  134. +94 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/EarModule.java
  135. +206 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/EarModuleFactory.java
  136. +56 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/EarPluginException.java
  137. +50 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/EjbClientModule.java
  138. +50 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/EjbModule.java
  139. +50 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/HarModule.java
  140. +73 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/JarModule.java
  141. +31 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/JbossEarModule.java
  142. +50 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/ParModule.java
  143. +50 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/RarModule.java
  144. +50 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/SarModule.java
  145. +79 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/SecurityRoleKey.java
  146. +40 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/UnknownArtifactTypeException.java
  147. +90 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/WebModule.java
  148. +50 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/earmodules/WsrModule.java
  149. +17 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/facets/AppClientUninstallDelegate.java
  150. +78 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/facets/AppClientVersionChangeDelegate.java
  151. +20 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/facets/EarUninstallDelegate.java
  152. +81 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/facets/EarVersionChangeDelegate.java
  153. +19 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/facets/EjbUninstallDelegate.java
  154. +19 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/facets/EjbVersionChangeDelegate.java
  155. +28 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/facets/NoOpUninstallDelegate.java
  156. +19 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/facets/NoOpVersionChangeDelegate.java
  157. +17 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/facets/RarUninstallDelegate.java
  158. +19 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/facets/RarVersionChangeDelegate.java
  159. +61 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/facets/WarUninstallDelegate.java
  160. +127 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/facets/WarVersionChangeDelegate.java
  161. +61 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/filtering/AbstractResourceFilteringConfiguration.java
  162. +69 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/filtering/AppClientResourceFilteringConfiguration.java
  163. +62 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/filtering/EarResourceFilteringConfiguration.java
  164. +475 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/filtering/ResourceFilteringBuildParticipant.java
  165. +49 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/filtering/ResourceFilteringConfiguration.java
  166. +41 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/filtering/ResourceFilteringConfigurationFactory.java
  167. +97 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/filtering/WebResourceFilteringConfiguration.java
  168. +412 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/AntPathMatcher.java
  169. +80 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/ExtensionReader.java
  170. +102 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/StringUtils.java
  171. +105 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/WTPResourcesContentProvider.java
  172. +58 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/WTPResourcesImages.java
  173. +38 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/WTPResourcesLabelProvider.java
  174. +116 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/WTPResourcesNode.java
  175. +51 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/WTPResourcesSorter.java
  176. +74 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/conversion/AbstractWtpProjectConversionParticipant.java
  177. +44 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/conversion/MavenPluginUtils.java
  178. +88 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/conversion/WebProjectConverter.java
  179. +20 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/lifecycle/AcrLifecycleMapping.java
  180. +20 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/lifecycle/EarLifecycleMapping.java
  181. +20 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/lifecycle/EjbLifecycleMapping.java
  182. +20 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/lifecycle/RarLifecycleMapping.java
  183. +21 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/lifecycle/WarLifecycleMapping.java
  184. +33 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/preferences/MavenWtpPreferenceInitializer.java
  185. +343 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/preferences/MavenWtpPreferencePage.java
  186. +98 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/preferences/MavenWtpPreferencesImpl.java
  187. +119 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/preferences/MavenWtpPreferencesManagerImpl.java
  188. +28 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/internal/utilities/PathUtil.java
  189. +36 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/mavenarchiver/AbstractWTPArchiverConfigurator.java
  190. +24 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/mavenarchiver/AcrMavenArchiverConfigurator.java
  191. +37 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/mavenarchiver/EarMavenArchiverConfigurator.java
  192. +25 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/mavenarchiver/EjbMavenArchiverConfigurator.java
  193. +25 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/mavenarchiver/RarMavenArchiverConfigurator.java
  194. +59 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/mavenarchiver/WarMavenArchiverConfigurator.java
  195. +3 −0  org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/messages.properties
  196. +75 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/namemapping/AbstractFileNameMapping.java
  197. +44 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/namemapping/FileNameMapping.java
  198. +103 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/namemapping/FileNameMappingFactory.java
  199. +42 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/namemapping/FullFileNameMapping.java
  200. +41 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/namemapping/NoVersionFileNameMapping.java
  201. +43 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/namemapping/PatternBasedFileNameMapping.java
  202. +42 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/namemapping/StandardFileNameMapping.java
  203. +46 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/preferences/IMavenWtpPreferences.java
  204. +29 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/preferences/IMavenWtpPreferencesManager.java
  205. +37 −0 org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/preferences/MavenWtpPreferencesConstants.java
  206. +146 −0 pom.xml
4 .gitignore
@@ -0,0 +1,4 @@
+/.project
+/.metadata
+/its
+/target
3  .settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Tue Sep 27 17:26:50 CEST 2011
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
5 .settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,5 @@
+#Wed Apr 06 19:19:46 CEST 2011
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
9 .settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Sat Jul 31 16:21:31 CEST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
25 README.md
@@ -0,0 +1,25 @@
+Maven Integration for Eclipse WTP
+=================================
+
+Maven Integration for Eclipse WTP, a.k.a m2e-wtp, aims at providing a tight integration between Maven Integration for Eclipse (a.k.a m2e) and the Eclipse Web Tools Project (WTP) .
+
+m2eclipse-wtp provides a set of m2e connectors used for the configuration of Java EE projects in WTP. It features :
+
+* Support for war projects : adds the Java and Dynamic Web Facets. Support war overlays and on-the-fly resource filtering
+* Support for ejb projects : adds the Java and EJB Facets. Supports deployment descriptor filtering.
+* Support for ear projects : adds the EAR Facet. Supports application.xml and jboss.xml file generation, resource filtering
+* Support for rar projects : adds the Java and Connector Facets.
+* Support for app-client projects : adds the Java and Application Client Facets. Supports deployment descriptor filtering.
+* Support for jar dependency projects : adds the Java and Utility Facets.
+* Support for web-fragment projects : adds the Java and Web Fragment Facets if a web-fragment.xml file is detected in the resource folders.
+
+Note that m2e-wtp requires m2e > 1.0. You must make sure m2e's update site (http://download.eclipse.org/technology/m2e/releases/) is defined in :
+Window > Preferences > Install / Update > Available Software Sites
+Since m2e 1.0 is incompatible with previous versions, you may have to uninstall old m2e and m2e-wtp versions before proceeding with the installation.
+
+[Public source repository](http://git.eclipse.org/c/m2e-wtp/org.eclipse.m2e.wtp.git/)
+
+[Issue tracking](https://bugs.eclipse.org/bugs/enter_bug.cgi?product=M2E-WTP)
+
+[Public wiki](wiki.eclipse.org/M2E-WTP)
+
1  org.eclipse.m2e.wtp.feature/.gitignore
@@ -0,0 +1 @@
+/target
23 org.eclipse.m2e.wtp.feature/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.wtp.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
3  org.eclipse.m2e.wtp.feature/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Tue Sep 27 17:26:51 CEST 2011
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
5 org.eclipse.m2e.wtp.feature/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,5 @@
+#Wed Apr 06 19:19:49 CEST 2011
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
4 org.eclipse.m2e.wtp.feature/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Thu Aug 28 19:43:49 EDT 2008
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
3  org.eclipse.m2e.wtp.feature/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Thu Jan 10 02:40:59 EST 2008
+commit.comment.template=${task.key}\: ${task.description}
+eclipse.preferences.version=1
9 org.eclipse.m2e.wtp.feature/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Thu Feb 04 09:56:35 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
2  org.eclipse.m2e.wtp.feature/build.properties
@@ -0,0 +1,2 @@
+bin.includes = feature.xml,\
+ feature.properties
273 org.eclipse.m2e.wtp.feature/feature.properties
@@ -0,0 +1,273 @@
+###############################################################################
+# Copyright (c) 2008, 2011 Sonatype, Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+###############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=Maven Integration for WTP
+
+# "providerName" property - name of the company that provides the feature
+providerName=Red Hat, Inc.
+
+# "updateSiteName" property - label for the update site
+#updateSiteName=The Eclipse Project Updates
+
+# "description" property - description of the feature
+description=m2e project configurators for Eclipse WTP
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2008-2011 Sonatype, Inc.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors:\n\
+ Sonatype, Inc. - initial API and implementation\n
+ Red Hat - JavaEE configurators\n
+################ end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=http://www.eclipse.org/legal/epl-v10.html
+
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=\
+\n\
+ Eclipse Public License - v 1.0\n\
+\n\
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE\n\
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF\n\
+THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.\n\
+\n\
+*1. DEFINITIONS*\n\
+\n\
+"Contribution" means:\n\
+\n\
+a) in the case of the initial Contributor, the initial code and\n\
+documentation distributed under this Agreement, and\n\
+\n\
+b) in the case of each subsequent Contributor:\n\
+\n\
+i) changes to the Program, and\n\
+\n\
+ii) additions to the Program;\n\
+\n\
+where such changes and/or additions to the Program originate from and\n\
+are distributed by that particular Contributor. A Contribution\n\
+'originates' from a Contributor if it was added to the Program by such\n\
+Contributor itself or anyone acting on such Contributor's behalf.\n\
+Contributions do not include additions to the Program which: (i) are\n\
+separate modules of software distributed in conjunction with the Program\n\
+under their own license agreement, and (ii) are not derivative works of\n\
+the Program.\n\
+\n\
+"Contributor" means any person or entity that distributes the Program.\n\
+\n\
+"Licensed Patents" mean patent claims licensable by a Contributor which\n\
+are necessarily infringed by the use or sale of its Contribution alone\n\
+or when combined with the Program.\n\
+\n\
+"Program" means the Contributions distributed in accordance with this\n\
+Agreement.\n\
+\n\
+"Recipient" means anyone who receives the Program under this Agreement,\n\
+including all Contributors.\n\
+\n\
+*2. GRANT OF RIGHTS*\n\
+\n\
+a) Subject to the terms of this Agreement, each Contributor hereby\n\
+grants Recipient a non-exclusive, worldwide, royalty-free copyright\n\
+license to reproduce, prepare derivative works of, publicly display,\n\
+publicly perform, distribute and sublicense the Contribution of such\n\
+Contributor, if any, and such derivative works, in source code and\n\
+object code form.\n\
+\n\
+b) Subject to the terms of this Agreement, each Contributor hereby\n\
+grants Recipient a non-exclusive, worldwide, royalty-free patent license\n\
+under Licensed Patents to make, use, sell, offer to sell, import and\n\
+otherwise transfer the Contribution of such Contributor, if any, in\n\
+source code and object code form. This patent license shall apply to the\n\
+combination of the Contribution and the Program if, at the time the\n\
+Contribution is added by the Contributor, such addition of the\n\
+Contribution causes such combination to be covered by the Licensed\n\
+Patents. The patent license shall not apply to any other combinations\n\
+which include the Contribution. No hardware per se is licensed hereunder.\n\
+\n\
+c) Recipient understands that although each Contributor grants the\n\
+licenses to its Contributions set forth herein, no assurances are\n\
+provided by any Contributor that the Program does not infringe the\n\
+patent or other intellectual property rights of any other entity. Each\n\
+Contributor disclaims any liability to Recipient for claims brought by\n\
+any other entity based on infringement of intellectual property rights\n\
+or otherwise. As a condition to exercising the rights and licenses\n\
+granted hereunder, each Recipient hereby assumes sole responsibility to\n\
+secure any other intellectual property rights needed, if any. For\n\
+example, if a third party patent license is required to allow Recipient\n\
+to distribute the Program, it is Recipient's responsibility to acquire\n\
+that license before distributing the Program.\n\
+\n\
+d) Each Contributor represents that to its knowledge it has sufficient\n\
+copyright rights in its Contribution, if any, to grant the copyright\n\
+license set forth in this Agreement.\n\
+\n\
+*3. REQUIREMENTS*\n\
+\n\
+A Contributor may choose to distribute the Program in object code form\n\
+under its own license agreement, provided that:\n\
+\n\
+a) it complies with the terms and conditions of this Agreement; and\n\
+\n\
+b) its license agreement:\n\
+\n\
+i) effectively disclaims on behalf of all Contributors all warranties\n\
+and conditions, express and implied, including warranties or conditions\n\
+of title and non-infringement, and implied warranties or conditions of\n\
+merchantability and fitness for a particular purpose;\n\
+\n\
+ii) effectively excludes on behalf of all Contributors all liability for\n\
+damages, including direct, indirect, special, incidental and\n\
+consequential damages, such as lost profits;\n\
+\n\
+iii) states that any provisions which differ from this Agreement are\n\
+offered by that Contributor alone and not by any other party; and\n\
+\n\
+iv) states that source code for the Program is available from such\n\
+Contributor, and informs licensees how to obtain it in a reasonable\n\
+manner on or through a medium customarily used for software exchange.\n\
+\n\
+When the Program is made available in source code form:\n\
+\n\
+a) it must be made available under this Agreement; and\n\
+\n\
+b) a copy of this Agreement must be included with each copy of the Program.\n\
+\n\
+Contributors may not remove or alter any copyright notices contained\n\
+within the Program.\n\
+\n\
+Each Contributor must identify itself as the originator of its\n\
+Contribution, if any, in a manner that reasonably allows subsequent\n\
+Recipients to identify the originator of the Contribution.\n\
+\n\
+*4. COMMERCIAL DISTRIBUTION*\n\
+\n\
+Commercial distributors of software may accept certain responsibilities\n\
+with respect to end users, business partners and the like. While this\n\
+license is intended to facilitate the commercial use of the Program, the\n\
+Contributor who includes the Program in a commercial product offering\n\
+should do so in a manner which does not create potential liability for\n\
+other Contributors. Therefore, if a Contributor includes the Program in\n\
+a commercial product offering, such Contributor ("Commercial\n\
+Contributor") hereby agrees to defend and indemnify every other\n\
+Contributor ("Indemnified Contributor") against any losses, damages and\n\
+costs (collectively "Losses") arising from claims, lawsuits and other\n\
+legal actions brought by a third party against the Indemnified\n\
+Contributor to the extent caused by the acts or omissions of such\n\
+Commercial Contributor in connection with its distribution of the\n\
+Program in a commercial product offering. The obligations in this\n\
+section do not apply to any claims or Losses relating to any actual or\n\
+alleged intellectual property infringement. In order to qualify, an\n\
+Indemnified Contributor must: a) promptly notify the Commercial\n\
+Contributor in writing of such claim, and b) allow the Commercial\n\
+Contributor to control, and cooperate with the Commercial Contributor\n\
+in, the defense and any related settlement negotiations. The Indemnified\n\
+Contributor may participate in any such claim at its own expense.\n\
+\n\
+For example, a Contributor might include the Program in a commercial\n\
+product offering, Product X. That Contributor is then a Commercial\n\
+Contributor. If that Commercial Contributor then makes performance\n\
+claims, or offers warranties related to Product X, those performance\n\
+claims and warranties are such Commercial Contributor's responsibility\n\
+alone. Under this section, the Commercial Contributor would have to\n\
+defend claims against the other Contributors related to those\n\
+performance claims and warranties, and if a court requires any other\n\
+Contributor to pay any damages as a result, the Commercial Contributor\n\
+must pay those damages.\n\
+\n\
+*5. NO WARRANTY*\n\
+\n\
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED\n\
+ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\n\
+EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES\n\
+OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR\n\
+A PARTICULAR PURPOSE. Each Recipient is solely responsible for\n\
+determining the appropriateness of using and distributing the Program\n\
+and assumes all risks associated with its exercise of rights under this\n\
+Agreement , including but not limited to the risks and costs of program\n\
+errors, compliance with applicable laws, damage to or loss of data,\n\
+programs or equipment, and unavailability or interruption of operations.\n\
+\n\
+*6. DISCLAIMER OF LIABILITY*\n\
+\n\
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR\n\
+ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,\n\
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING\n\
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF\n\
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n\
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR\n\
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED\n\
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n\
+\n\
+*7. GENERAL*\n\
+\n\
+If any provision of this Agreement is invalid or unenforceable under\n\
+applicable law, it shall not affect the validity or enforceability of\n\
+the remainder of the terms of this Agreement, and without further action\n\
+by the parties hereto, such provision shall be reformed to the minimum\n\
+extent necessary to make such provision valid and enforceable.\n\
+\n\
+If Recipient institutes patent litigation against any entity (including\n\
+a cross-claim or counterclaim in a lawsuit) alleging that the Program\n\
+itself (excluding combinations of the Program with other software or\n\
+hardware) infringes such Recipient's patent(s), then such Recipient's\n\
+rights granted under Section 2(b) shall terminate as of the date such\n\
+litigation is filed.\n\
+\n\
+All Recipient's rights under this Agreement shall terminate if it fails\n\
+to comply with any of the material terms or conditions of this Agreement\n\
+and does not cure such failure in a reasonable period of time after\n\
+becoming aware of such noncompliance. If all Recipient's rights under\n\
+this Agreement terminate, Recipient agrees to cease use and distribution\n\
+of the Program as soon as reasonably practicable. However, Recipient's\n\
+obligations under this Agreement and any licenses granted by Recipient\n\
+relating to the Program shall continue and survive.\n\
+\n\
+Everyone is permitted to copy and distribute copies of this Agreement,\n\
+but in order to avoid inconsistency the Agreement is copyrighted and may\n\
+only be modified in the following manner. The Agreement Steward reserves\n\
+the right to publish new versions (including revisions) of this\n\
+Agreement from time to time. No one other than the Agreement Steward has\n\
+the right to modify this Agreement. The Eclipse Foundation is the\n\
+initial Agreement Steward. The Eclipse Foundation may assign the\n\
+responsibility to serve as the Agreement Steward to a suitable separate\n\
+entity. Each new version of the Agreement will be given a distinguishing\n\
+version number. The Program (including Contributions) may always be\n\
+distributed subject to the version of the Agreement under which it was\n\
+received. In addition, after a new version of the Agreement is\n\
+published, Contributor may elect to distribute the Program (including\n\
+its Contributions) under the new version. Except as expressly stated in\n\
+Sections 2(a) and 2(b) above, Recipient receives no rights or licenses\n\
+to the intellectual property of any Contributor under this Agreement,\n\
+whether expressly, by implication, estoppel or otherwise. All rights in\n\
+the Program not expressly granted under this Agreement are reserved.\n\
+\n\
+This Agreement is governed by the laws of the State of New York and the\n\
+intellectual property laws of the United States of America. No party to\n\
+this Agreement will bring a legal action under this Agreement more than\n\
+one year after the cause of action arose. Each party waives its rights\n\
+to a jury trial in any resulting litigation.\n\
+\n
+########### end of license property ##########################################
63 org.eclipse.m2e.wtp.feature/feature.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.m2e.wtp.feature"
+ label="%featureName"
+ version="0.16.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.eclipse.m2e.wtp">
+
+ <description url="http://www.eclipse.org/m2e/">
+ %description
+ </description>
+
+ <copyright url="http://sonatype.com/">
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <update label="%featureName" url="http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/"/>
+ </url>
+
+ <requires>
+ <import plugin="org.eclipse.wst.common.frameworks"/>
+ <import plugin="org.eclipse.wst.common.modulecore"/>
+ <import plugin="org.eclipse.wst.common.project.facet.core"/>
+ <import plugin="org.eclipse.jst.common.frameworks"/>
+ <import plugin="org.eclipse.jst.common.project.facet.core"/>
+ <import plugin="org.eclipse.jst.j2ee.web"/>
+ <import plugin="org.eclipse.jst.j2ee"/>
+ <import plugin="org.eclipse.jst.j2ee.core"/>
+ <import feature="org.eclipse.platform" version="3.6.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.rcp" version="3.6.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.jdt" version="3.6.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.m2e.feature" version="1.0.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.wst.web_ui.feature" version="3.2.0" match="greaterOrEqual"/>
+ <import feature="org.sonatype.m2e.mavenarchiver.feature" version="0.14.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.m2e.wtp"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+<plugin
+ id="org.eclipse.m2e.wtp.overlay"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.m2e.wtp.overlay.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
107 org.eclipse.m2e.wtp.feature/pom.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2008 Sonatype, Inc.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.m2e.wtp</groupId>
+ <artifactId>org.eclipse.m2e.wtp.parent</artifactId>
+ <version>0.16.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.wtp.feature</artifactId>
+ <packaging>eclipse-feature</packaging>
+
+ <name>M2E-WTP :: Feature</name>
+ <!--
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-packaging-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <deployableFeature>true</deployableFeature>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <executions>
+ <execution>
+ <id>categorization</id>
+ <phase>package</phase>
+ <goals>
+ <goal>category-p2-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <metadataRepositoryName>Maven Integration for Eclipse WTP</metadataRepositoryName>
+ <artifactRepositoryName>Maven Integration for Eclipse WTP</artifactRepositoryName>
+ <compressRepository>false</compressRepository>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>publish-site</id>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>maven-upload-plugin</artifactId>
+ <version>0.0.1</version>
+ <executions>
+ <execution>
+ <id>publish-site</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>upload-file</goal>
+ </goals>
+ <configuration>
+ <file>${project.build.directory}/${project.artifactId}-${project.version}-site.zip</file>
+
+ <serverId>forge-releases</serverId>
+ <repositoryUrl>${m2e.site-compressed}</repositoryUrl>
+ <repositoryPath>m2eclipse-wtp/${unqualifiedVersion}/N/${unqualifiedVersion}.${buildQualifier}</repositoryPath>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+ -->
+</project>
14 org.eclipse.m2e.wtp.feature/src/main/assembly/assembly.xml
@@ -0,0 +1,14 @@
+<assembly>
+ <id>site</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${project.build.directory}/site</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+ </fileSets>
+
+</assembly>
7 org.eclipse.m2e.wtp.overlay.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
2  org.eclipse.m2e.wtp.overlay.ui/.gitignore
@@ -0,0 +1,2 @@
+/bin
+/target
34 org.eclipse.m2e.wtp.overlay.ui/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.wtp.overlay.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
3  org.eclipse.m2e.wtp.overlay.ui/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Tue Sep 27 17:26:51 CEST 2011
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
8 org.eclipse.m2e.wtp.overlay.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Sun Mar 11 22:55:01 CET 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
5 org.eclipse.m2e.wtp.overlay.ui/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,5 @@
+#Wed Sep 14 15:43:12 CEST 2011
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
17 org.eclipse.m2e.wtp.overlay.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Overlay support for Eclipse WTP - UI
+Bundle-SymbolicName: org.eclipse.m2e.wtp.overlay.ui;singleton:=true
+Bundle-Version: 0.16.0.qualifier
+Bundle-Activator: org.eclipse.m2e.wtp.overlay.ui.OverlayUIPluginActivator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.wst.common.modulecore.ui,
+ org.eclipse.core.resources,
+ org.eclipse.m2e.wtp.overlay
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6,
+ JavaSE-1.7
+Bundle-Vendor: Red Hat, Inc.
5 org.eclipse.m2e.wtp.overlay.ui/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
30 org.eclipse.m2e.wtp.overlay.ui/plugin.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <!--
+ <extension
+ point="org.eclipse.wst.common.modulecore.ui.virtualComponentLabelProvider">
+ <provider
+ class="org.eclipse.m2e.wtp.overlay.ui.VirtualComponentLabelProvider">
+ </provider>
+ </extension>
+ <extension
+ point="org.eclipse.wst.common.modulecore.ui.referenceWizardFragment">
+ <referenceFragment
+ class="org.eclipse.m2e.wtp.overlay.ui.OverlayWizardFragment"
+ hidden="false"
+ id="org.eclipse.m2e.wtp.overlay.ui.referenceFragment"
+ name="Project Overlay">
+ </referenceFragment>
+ </extension>
+ -->
+ <extension point="org.eclipse.ui.preferencePages">
+ <page id="org.eclipse.m2e.wtp.overlay.ui.preferences.OverlayPreferencePage"
+ category="org.eclipse.wst.server.ui.preferencePage"
+ class="org.eclipse.m2e.wtp.overlay.ui.preferences.OverlayPublishingPreferencePage"
+ name="Overlays">
+ <keywordReference id="org.eclipse.wst.server.preferenceKeywords"/>
+ </page>
+ </extension>
+
+</plugin>
23 org.eclipse.m2e.wtp.overlay.ui/pom.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2010 Sonatype, Inc.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.m2e.wtp</groupId>
+ <artifactId>org.eclipse.m2e.wtp.parent</artifactId>
+ <version>0.16.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.wtp.overlay.ui</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>M2E-WTP :: Overlay UI</name>
+
+</project>
73 org.eclipse.m2e.wtp.overlay.ui/src/org/eclipse/m2e/wtp/overlay/ui/OverlayUIPluginActivator.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.m2e.wtp.overlay.ui;
+
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.m2e.wtp.overlay.OverlayConstants;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class OverlayUIPluginActivator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.m2e.wtp.overlay.ui"; //$NON-NLS-1$
+
+ // The shared instance
+ private static OverlayUIPluginActivator plugin;
+
+ private IPreferenceStore preferenceStore;
+
+ /**
+ * The constructor
+ */
+ public OverlayUIPluginActivator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static OverlayUIPluginActivator getDefault() {
+ return plugin;
+ }
+
+ @Override
+ public IPreferenceStore getPreferenceStore() {
+ // Create the preference store lazily.
+ if(preferenceStore == null) {
+ // InstanceScope.INSTANCE added in 3.7
+ preferenceStore = new ScopedPreferenceStore(new InstanceScope(), OverlayConstants.PLUGIN_ID);
+
+ }
+ return preferenceStore;
+ }
+}
36 ...e.m2e.wtp.overlay.ui/src/org/eclipse/m2e/wtp/overlay/ui/preferences/OverlayPublishingPreferencePage.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.m2e.wtp.overlay.ui.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.m2e.wtp.overlay.OverlayConstants;
+import org.eclipse.m2e.wtp.overlay.ui.OverlayUIPluginActivator;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+public class OverlayPublishingPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ public OverlayPublishingPreferencePage() {
+ super(GRID);
+ this.setPreferenceStore(OverlayUIPluginActivator.getDefault().getPreferenceStore());
+ }
+
+ @Override
+ protected void createFieldEditors() {
+ addField(new BooleanFieldEditor(OverlayConstants.P_REPUBLISH_ON_PROJECT_CHANGE,
+ "Automatically republish servers on overlay modifications",
+ getFieldEditorParent()));
+ }
+
+ public void init(IWorkbench workbench) {
+ // Nothing to do
+ }
+
+
+}
5 org.eclipse.m2e.wtp.overlay/.gitignore
@@ -0,0 +1,5 @@
+/bin
+/target
+/.settings
+/.classpath
+/.project
29 org.eclipse.m2e.wtp.overlay/META-INF/MANIFEST.MF
@@ -0,0 +1,29 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Overlay support for Eclipse WTP
+Bundle-SymbolicName: org.eclipse.m2e.wtp.overlay;singleton:=true
+Bundle-Version: 0.16.0.qualifier
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6,
+ JavaSE-1.7
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.wst.common.core,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.emf.common,
+ org.eclipse.emf.ecore,
+ org.eclipse.jst.common.frameworks;bundle-version="1.1.400",
+ org.eclipse.jst.j2ee;bundle-version="1.1.400",
+ org.eclipse.wst.server.core,
+ org.eclipse.wst.common.emfworkbench.integration,
+ org.eclipse.wst.common.emf,
+ org.eclipse.jem.workbench,
+ org.eclipse.jem.util,
+ org.apache.ant,
+ org.eclipse.jface
+Bundle-Vendor: Red Hat, Inc.
+Export-Package: org.eclipse.m2e.wtp.overlay,
+ org.eclipse.m2e.wtp.overlay.internal.modulecore,
+ org.eclipse.m2e.wtp.overlay.modulecore
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.m2e.wtp.overlay.OverlayPluginActivator
5 org.eclipse.m2e.wtp.overlay/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
16 org.eclipse.m2e.wtp.overlay/plugin.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.wst.common.modulecore.referenceResolver">
+ <resolver
+ class="org.eclipse.m2e.wtp.overlay.modulecore.OverlayReferenceResolver"
+ id="org.maven.ide.eclipse.wtp.overlay.modulecore.OverlayReferenceResolver">
+ </resolver>
+ </extension>
+
+ <extension point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.eclipse.m2e.wtp.overlay.internal.preferences.OverlayPreferencesInitializer"/>
+ </extension>
+
+</plugin>
23 org.eclipse.m2e.wtp.overlay/pom.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2010 Sonatype, Inc.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.m2e.wtp</groupId>
+ <artifactId>org.eclipse.m2e.wtp.parent</artifactId>
+ <version>0.16.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.wtp.overlay</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>M2E-WTP :: Overlay Core</name>
+
+</project>
21 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/OverlayConstants.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.m2e.wtp.overlay;
+
+public class OverlayConstants {
+
+ private OverlayConstants(){}
+
+ public static final String PLUGIN_ID = "org.eclipse.m2e.wtp.overlay";
+
+ /**
+ * Republish on server if an overlay dependency changed.
+ */
+ public static final String P_REPUBLISH_ON_PROJECT_CHANGE = "republishOnProjectChange";
+
+}
39 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/OverlayPluginActivator.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.m2e.wtp.overlay;
+
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.m2e.wtp.overlay.internal.servers.OverlayResourceChangeListener;
+import org.osgi.framework.BundleContext;
+
+public class OverlayPluginActivator extends Plugin {
+
+ public static final String PLUGIN_ID = OverlayConstants.PLUGIN_ID;
+
+ IResourceChangeListener overlayresourceChangeListener;
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ overlayresourceChangeListener = new OverlayResourceChangeListener();
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ workspace.addResourceChangeListener(overlayresourceChangeListener);
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ if (overlayresourceChangeListener != null) {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ workspace.removeResourceChangeListener(overlayresourceChangeListener);
+ }
+ super.stop(context);
+ }
+}
345 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/CompositeVirtualFolder.java
@@ -0,0 +1,345 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.m2e.wtp.overlay.internal.modulecore;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent;
+import org.eclipse.wst.common.componentcore.internal.flat.IFlatFile;
+import org.eclipse.wst.common.componentcore.internal.flat.IFlatFolder;
+import org.eclipse.wst.common.componentcore.internal.flat.IFlatResource;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualFile;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualFolder;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualContainer;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
+
+/**
+ * Virtual folder mapping a FlatVirtualComponent
+ *
+ * @author Fred Bricon
+ */
+@SuppressWarnings("restriction")
+public class CompositeVirtualFolder implements IFilteredVirtualFolder {
+
+ private FlatVirtualComponent flatVirtualComponent;
+ private IPath runtimePath;
+ private IProject project;
+ private Set<IVirtualReference> references = new LinkedHashSet<IVirtualReference>();
+ private IVirtualResource[] members;
+ private IResourceFilter filter;
+
+ public CompositeVirtualFolder(FlatVirtualComponent aFlatVirtualComponent, IPath aRuntimePath, IResourceFilter filter) {
+ this.flatVirtualComponent = aFlatVirtualComponent;
+ if (flatVirtualComponent != null && flatVirtualComponent.getComponent() != null) {
+ project = flatVirtualComponent.getComponent().getProject();
+ }
+ this.runtimePath = aRuntimePath;
+ this.filter = filter;
+ try {
+ treeWalk();
+ } catch (CoreException e) {
+ //TODO handle exception
+ e.printStackTrace();
+ }
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public IPath getRuntimePath() {
+ return runtimePath;
+ }
+
+ public IVirtualResource[] members() throws CoreException {
+ if (members == null) {
+ members = new IVirtualResource[0];
+ }
+ return members;
+ }
+
+ public void treeWalk() throws CoreException {
+ IFlatResource[] flatResources = flatVirtualComponent.fetchResources();
+ List<IVirtualResource> membersList = new ArrayList<IVirtualResource>(flatResources.length);
+ for (IFlatResource flatResource : flatResources) {
+ IVirtualResource resource = convert(flatResource);
+ if (resource != null) {
+ membersList.add(resource);
+ }
+ }
+ members = new IVirtualResource[membersList.size()];
+ membersList.toArray(members);
+ }
+
+ private IVirtualResource convert(IFlatResource flatResource) {
+ IVirtualResource virtualResource = null;
+ if (flatResource instanceof IFlatFolder) {
+ virtualResource = convertFolder((IFlatFolder) flatResource);
+ } else if (flatResource instanceof IFlatFile){
+ virtualResource = convertFile((IFlatFile) flatResource);
+ }
+
+ return virtualResource;
+ }
+
+ private IVirtualFolder convertFolder(IFlatFolder flatFolder) {
+ IFlatResource[] flatMembers = flatFolder.members();
+ List<IVirtualResource> membersList = new ArrayList<IVirtualResource>(flatMembers.length);
+ for (IFlatResource flatResource : flatMembers) {
+ IVirtualResource resource = convert(flatResource);
+ if (resource != null) {
+ membersList.add(resource);
+ }
+ }
+ final IVirtualResource[] folderMembers = new IVirtualResource[membersList.size()];
+ membersList.toArray(folderMembers);
+ VirtualFolder vf = new VirtualFolder(project, flatFolder.getModuleRelativePath().append(flatFolder.getName())) {
+ @Override
+ public IVirtualResource[] members() throws CoreException {
+ return folderMembers;
+ }
+ };
+ return vf;
+
+ }
+
+ private IVirtualFile convertFile(IFlatFile flatFile) {
+ IFile f = (IFile)flatFile.getAdapter(IFile.class);
+ VirtualFile vf = null;
+ String filePath = null;
+ if (f == null) {
+ //Not a workspace file, we assume it's an external reference
+ File underlyingFile = (File)flatFile.getAdapter(File.class);
+ if (underlyingFile != null && underlyingFile.exists()) {
+ filePath = flatFile.getModuleRelativePath().toPortableString() + Path.SEPARATOR + underlyingFile.getName();
+ if (filter == null || filter.accepts(filePath, true)) {
+ IVirtualReference reference = createReference(underlyingFile, flatFile.getModuleRelativePath());
+ references.add(reference);
+ }
+ }
+ } else {
+ final String fileName = f.getName();
+ vf = new VirtualFile(project, flatFile.getModuleRelativePath(), f) {
+ public String getName() {
+ return fileName;
+ }
+ };
+
+ filePath = vf.getRuntimePath().toPortableString() + Path.SEPARATOR + fileName;
+ if (filter == null || filter.accepts(filePath, true)) {
+ return vf;
+ }
+
+ }
+ return null;
+ }
+
+ private IVirtualReference createReference(File underlyingFile, IPath path) {
+ VirtualArchiveComponent archive = new VirtualArchiveComponent(project, VirtualArchiveComponent.LIBARCHIVETYPE + Path.SEPARATOR + underlyingFile.getAbsolutePath(), path);
+ IVirtualReference ref = ComponentCore.createReference(flatVirtualComponent.getComponent(), archive);
+ ref.setArchiveName(archive.getArchivePath().lastSegment());
+ ref.setRuntimePath(path);
+ return ref;
+ }
+
+ public void create(int arg0, IProgressMonitor arg1) throws CoreException {
+ // ignore
+ }
+
+ public boolean exists(IPath arg0) {
+ // ignore
+ return false;
+ }
+
+ public IVirtualResource findMember(String arg0) {
+ // ignore
+ return null;
+ }
+
+ public IVirtualResource findMember(IPath arg0) {
+ // ignore
+ return null;
+ }
+
+ public IVirtualResource findMember(String arg0, int arg1) {
+ // ignore
+ return null;
+ }
+
+ public IVirtualResource findMember(IPath arg0, int arg1) {
+ // ignore
+ return null;
+ }
+
+ public IVirtualFile getFile(IPath arg0) {
+ // ignore
+ return null;
+ }
+
+ public IVirtualFile getFile(String arg0) {
+ // ignore
+ return null;
+ }
+
+ public IVirtualFolder getFolder(IPath arg0) {
+ // ignore
+ return null;
+ }
+
+ public IVirtualFolder getFolder(String arg0) {
+ // ignore
+ return null;
+ }
+
+ public IVirtualResource[] getResources(String arg0) {
+ // ignore
+ return null;
+ }
+
+ public IVirtualResource[] members(int arg0) throws CoreException {
+ // ignore
+ return null;
+ }
+
+ public void createLink(IPath arg0, int arg1, IProgressMonitor arg2)
+ throws CoreException {
+ // ignore
+ }
+
+ public void delete(int arg0, IProgressMonitor arg1) throws CoreException {
+ // ignore
+ }
+
+ public boolean exists() {
+ // ignore
+ return false;
+ }
+
+ public IVirtualComponent getComponent() {
+ // ignore
+ return null;
+ }
+
+ public String getFileExtension() {
+ // ignore
+ return null;
+ }
+
+ public String getName() {
+ // ignore
+ return null;
+ }
+
+ public IVirtualContainer getParent() {
+ // ignore
+ return null;
+ }
+
+ public IPath getProjectRelativePath() {
+ // ignore
+ return null;
+ }
+
+ public String getResourceType() {
+ // ignore
+ return null;
+ }
+
+ public int getType() {
+ // ignore
+ return 0;
+ }
+
+ public IResource getUnderlyingResource() {
+ // ignore
+ return null;
+ }
+
+ public IResource[] getUnderlyingResources() {
+ // ignore
+ return null;
+ }
+
+ public IPath getWorkspaceRelativePath() {
+ // ignore
+ return null;
+ }
+
+ public boolean isAccessible() {
+ // ignore
+ return false;
+ }
+
+ public void removeLink(IPath arg0, int arg1, IProgressMonitor arg2)
+ throws CoreException {
+ // ignore
+
+ }
+
+ public void setResourceType(String arg0) {
+ // ignore
+
+ }
+
+ public boolean contains(ISchedulingRule rule) {
+ // ignore
+ return false;
+ }
+
+ public boolean isConflicting(ISchedulingRule rule) {
+ // ignore
+ return false;
+ }
+
+ public Object getAdapter(Class adapter) {
+ // ignore
+ return null;
+ }
+
+ public IContainer getUnderlyingFolder() {
+ // ignore
+ return null;
+ }
+
+ public IContainer[] getUnderlyingFolders() {
+ // ignore
+ return null;
+ }
+
+ public IVirtualReference[] getReferences() {
+ return references.toArray(new IVirtualReference[references.size()]);
+ }
+
+ public IResourceFilter getFilter() {
+ return filter;
+ }
+
+ public void setFilter(IResourceFilter filter) {
+ this.filter = filter;
+ }
+
+}
295 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/DynamicResourceFilter.java
@@ -0,0 +1,295 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.eclipse.m2e.wtp.overlay.internal.modulecore;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.tools.ant.types.selectors.SelectorUtils;
+import org.eclipse.m2e.wtp.overlay.internal.utilities.PathUtil;
+
+/**
+ * Filter resources based on inclusion/exclusion patterns.
+ *
+ * This class is derived from ant's org.apache.tools.ant.DirectoryScanner
+ */
+public class DynamicResourceFilter implements IResourceFilter {
+
+ protected static final String[] DEFAULTEXCLUDES = {
+ // Miscellaneous typical temporary files
+ "**/*~", //$NON-NLS-1$
+ "**/#*#",//$NON-NLS-1$
+ "**/.#*",//$NON-NLS-1$
+ "**/%*%",//$NON-NLS-1$
+ "**/._*",//$NON-NLS-1$
+
+ // CVS
+ "**/CVS",//$NON-NLS-1$
+ "**/CVS/**",//$NON-NLS-1$
+ "**/.cvsignore",//$NON-NLS-1$
+
+ // SCCS
+ "**/SCCS",//$NON-NLS-1$
+ "**/SCCS/**",//$NON-NLS-1$
+
+ // Visual SourceSafe
+ "**/vssver.scc",//$NON-NLS-1$
+
+ // Subversion
+ "**/.svn",//$NON-NLS-1$
+ "**/.svn/**",//$NON-NLS-1$
+
+ // Mac
+ "**/.DS_Store"//$NON-NLS-1$
+ };
+
+ /** The patterns for the files to be included. */
+ protected String[] includes;
+
+ /** The patterns for the files to be excluded. */
+ protected String[] excludes;
+
+ protected boolean isCaseSensitive = true;
+
+ /**
+ * Array of all include patterns that contain wildcards.
+ *
+ * <p>Gets lazily initialized on the first invocation of
+ * isIncluded or isExcluded and cleared at the end of the scan
+ * method (cleared in clearCaches, actually).</p>
+ *
+ * @since Ant 1.6.3
+ */
+ private String[] includePatterns;
+
+ /**
+ * Array of all exclude patterns that contain wildcards.
+ *
+ * <p>Gets lazily initialized on the first invocation of
+ * isIncluded or isExcluded and cleared at the end of the scan
+ * method (cleared in clearCaches, actually).</p>
+ *
+ * @since Ant 1.6.3
+ */
+ private String[] excludePatterns;
+
+ /**
+ * Have the non-pattern sets and pattern arrays for in- and
+ * excludes been initialized?
+ *
+ * @since Ant 1.6.3
+ */
+ private boolean areNonPatternSetsReady = false;
+
+ /**
+ * Set of all include patterns that are full file names and don't
+ * contain any wildcards.
+ *
+ * <p>If this instance is not case sensitive, the file names get
+ * turned to lower case.</p>
+ *
+ * <p>Gets lazily initialized on the first invocation of
+ * isIncluded or isExcluded and cleared at the end of the scan
+ * method (cleared in clearCaches, actually).</p>
+ *
+ * @since Ant 1.6.3
+ */
+ private Set<String> includeNonPatterns = new HashSet<String>();
+
+ /**
+ * Set of all include patterns that are full file names and don't
+ * contain any wildcards.
+ *
+ * <p>If this instance is not case sensitive, the file names get
+ * turned to lower case.</p>
+ *
+ * <p>Gets lazily initialized on the first invocation of
+ * isIncluded or isExcluded and cleared at the end of the scan
+ * method (cleared in clearCaches, actually).</p>
+ *
+ * @since Ant 1.6.3
+ */
+ private Set<String> excludeNonPatterns = new HashSet<String>();
+
+
+ public DynamicResourceFilter(Collection<String> inclusions, Collection<String> exclusions) {
+ if (inclusions != null && !inclusions.isEmpty()) {
+ setIncludes(inclusions.toArray(new String[inclusions.size()]));
+ } else {
+ setIncludes(new String[]{"**/**"});
+ }
+ if (exclusions != null && !exclusions.isEmpty()) {
+ addExcludes(exclusions.toArray(new String[exclusions.size()]));
+ }
+ addExcludes(DEFAULTEXCLUDES);
+ }
+
+ public synchronized void setIncludes(String[] includes) {
+ if (includes == null) {
+ this.includes = null;
+ } else {
+ this.includes = new String[includes.length];
+ for (int i = 0; i < includes.length; i++) {
+ this.includes[i] = normalizePattern(includes[i]);
+ }
+ }
+ }
+
+ public synchronized void setExcludes(String[] excludes) {
+ if (excludes == null) {
+ this.excludes = null;
+ } else {
+ this.excludes = new String[excludes.length];
+ for (int i = 0; i < excludes.length; i++) {
+ this.excludes[i] = normalizePattern(excludes[i]);
+ }
+ }
+ }
+
+ public synchronized void addExcludes(String[] excludes) {
+ if (excludes != null && excludes.length > 0) {
+ if (this.excludes != null && this.excludes.length > 0) {
+ String[] tmp = new String[excludes.length
+ + this.excludes.length];
+ System.arraycopy(this.excludes, 0, tmp, 0,
+ this.excludes.length);
+ for (int i = 0; i < excludes.length; i++) {
+ tmp[this.excludes.length + i] =
+ normalizePattern(excludes[i]);
+ }
+ this.excludes = tmp;
+ } else {
+ setExcludes(excludes);
+ }
+ }
+ }
+
+ private static String normalizePattern(String p) {
+ String pattern = PathUtil.useSystemSeparator(p);
+ if (pattern.endsWith(File.separator)) {
+ pattern += "**";//$NON-NLS-1$
+ }
+ return pattern;
+ }
+
+ /**
+ * Ensure that the in|exclude &quot;patterns&quot;
+ * have been properly divided up.
+ *
+ * @since Ant 1.6.3
+ */
+ private synchronized void ensureNonPatternSetsReady() {
+ if (!areNonPatternSetsReady) {
+ includePatterns = fillNonPatternSet(includeNonPatterns, includes);
+ excludePatterns = fillNonPatternSet(excludeNonPatterns, excludes);
+ areNonPatternSetsReady = true;
+ }
+ }
+
+ /**
+ * Add all patterns that are not real patterns (do not contain
+ * wildcards) to the set and returns the real patterns.
+ *
+ * @param set Set to populate.
+ * @param patterns String[] of patterns.
+ * @since Ant 1.6.3
+ */
+ private String[] fillNonPatternSet(Set<String> set, String[] patterns) {
+ ArrayList<String> al = new ArrayList<String>(patterns.length);
+ for (int i = 0; i < patterns.length; i++) {
+ if (!SelectorUtils.hasWildcards(patterns[i])) {
+ set.add(isCaseSensitive() ? patterns[i]
+ : patterns[i].toUpperCase());
+ } else {
+ al.add(patterns[i]);
+ }
+ }
+ return set.size() == 0 ? patterns
+ : al.toArray(new String[al.size()]);
+ }
+
+ private boolean isCaseSensitive() {
+ return isCaseSensitive;
+ }
+
+ /**
+ * Test whether or not a name matches against at least one exclude
+ * pattern.
+ *
+ * @param name The name to match. Must not be <code>null</code>.
+ * @return <code>true</code> when the name matches against at least one
+ * exclude pattern, or <code>false</code> otherwise.
+ */
+ protected boolean isExcluded(String name) {
+ ensureNonPatternSetsReady();
+
+ if (isCaseSensitive()
+ ? excludeNonPatterns.contains(name)
+ : excludeNonPatterns.contains(name.toUpperCase())) {
+ return true;
+ }
+ for (int i = 0; i < excludePatterns.length; i++) {
+ if (matchPath(excludePatterns[i], name, isCaseSensitive())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Test whether or not a name matches against at least one include
+ * pattern.
+ *
+ * @param name The name to match. Must not be <code>null</code>.
+ * @return <code>true</code> when the name matches against at least one
+ * include pattern, or <code>false</code> otherwise.
+ */
+ protected boolean isIncluded(String name) {
+ ensureNonPatternSetsReady();
+
+ if (isCaseSensitive()
+ ? includeNonPatterns.contains(name)
+ : includeNonPatterns.contains(name.toUpperCase())) {
+ return true;
+ }
+ for (int i = 0; i < includePatterns.length; i++) {
+ if (matchPath(includePatterns[i], name, isCaseSensitive())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ protected static boolean matchPath(String pattern, String str,
+ boolean isCaseSensitive) {
+ return SelectorUtils.matchPath(pattern, str, isCaseSensitive);
+ }
+
+ public boolean accepts(String path, boolean isFile) {
+ if (path == null) return false;
+ path = PathUtil.useSystemSeparator(path);
+ boolean isIncluded = isIncluded(path) && ! isExcluded(path);
+ //System.err.println(path + (isIncluded?" included":" excluded"));
+ return isIncluded;
+ }
+
+}
139 ...clipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/FileSystemResourceFilter.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.m2e.wtp.overlay.internal.modulecore;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.tools.ant.DirectoryScanner;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.m2e.wtp.overlay.internal.utilities.PathUtil;
+
+public class FileSystemResourceFilter implements IResourceFilter {
+
+ private SimpleScanner scanner;
+
+ public FileSystemResourceFilter(Collection<String> inclusions, Collection<String> exclusions, IPath baseDirPath) {
+ scanner = new SimpleScanner(baseDirPath);
+ if (inclusions != null && !inclusions.isEmpty()) {
+ scanner.setIncludes(inclusions.toArray(new String[inclusions.size()]));
+ } else {
+ scanner.setIncludes(new String[]{"**/**"});
+ }
+ if (exclusions != null && !exclusions.isEmpty()) {
+ scanner.addExcludes(exclusions.toArray(new String[exclusions.size()]));
+ }
+ scanner.addDefaultExcludes();
+ scanner.scan();
+ }
+
+ public boolean accepts(String resourcePath, boolean isFile) {
+ return scanner.accepts(resourcePath, isFile);
+ }
+
+ class SimpleScanner extends DirectoryScanner {
+
+ @Override
+ public synchronized void setIncludes(String[] includes) {
+ super.setIncludes(setFileSeparator(includes));
+ }
+
+ @Override
+ public synchronized void setExcludes(String[] excludes) {
+ super.setExcludes(setFileSeparator(excludes));
+ }
+
+ private String[] setFileSeparator(String[] patterns) {
+ if (patterns != null) {
+ for (int i = 0; i < patterns.length ; i++) {
+ patterns[i] = PathUtil.useSystemSeparator(patterns[i]);
+ }
+ }
+ return patterns;
+ }
+
+ private String baseDirAsString;
+ private Set<String> includedFiles;
+ private Set<String> excludedFiles;
+ private Set<String> includedFolders;
+ private Set<String> excludedFolders;
+
+ public SimpleScanner(IPath baseDirPath) {
+ this.baseDirAsString = baseDirPath.toOSString();
+ setBasedir(baseDirAsString);
+ }
+
+ @Override
+ public void scan() throws IllegalStateException {
+ super.scan();
+ //cache the included and excluded files (to avoid several array copies)
+ includedFiles = new HashSet<String>(Arrays.asList(getIncludedFiles()));
+ excludedFiles = new HashSet<String>(Arrays.asList(getExcludedFiles()));
+ includedFolders = new HashSet<String>(Arrays.asList(getIncludedDirectories()));
+ excludedFolders = new HashSet<String>(Arrays.asList(getExcludedDirectories()));
+
+ completeIncludedFolders();
+ //System.out.println(baseDirPath +" includes "+includedFiles.size() +" files");
+ }
+
+ private void completeIncludedFolders() {
+ Set<String> missingParentFolders = new HashSet<String>();
+ for(String folder : includedFolders) {
+ IPath filePath = new Path(folder);
+ IPath parentPath = filePath.removeLastSegments(1);
+ while (parentPath.segmentCount()>0) {
+ String pathAsString = parentPath.toOSString();
+ if (!includedFolders.contains(pathAsString)) {
+ missingParentFolders.add(pathAsString);
+ }
+ parentPath = parentPath.removeLastSegments(1);
+ }
+ }
+ includedFolders.addAll(missingParentFolders);
+
+ for(String file : includedFiles) {
+ //For /some/foo/bar/file.ext, we need to add
+ // /some/foo/bar/
+ // /some/foo/
+ // /some/
+ // as included folders
+
+ IPath filePath = new Path(file);
+ IPath parentPath = filePath.removeLastSegments(1);
+ while (parentPath.segmentCount()>0) {
+ if (includedFolders.add(parentPath.toOSString())) {
+ parentPath = parentPath.removeLastSegments(1);
+ } else {
+ //Parent hierarchy already added
+ break;
+ }
+ }
+ }
+ }
+
+ protected boolean accepts(String name, boolean isFile) {
+
+ name = PathUtil.useSystemSeparator(name);
+ if (name.startsWith(baseDirAsString)) {
+ name = name.substring(baseDirAsString.length()+1);
+ }
+
+ boolean res;
+ if (isFile) {
+ res = includedFiles.contains(name) && !excludedFiles.contains(name);
+ } else {
+ res = includedFolders.contains(name) && !excludedFolders.contains(name);
+ }
+ //System.err.println(name + (res?" included": " excluded"));
+ return res;
+ }
+ }
+}
17 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/IFilteredVirtualFolder.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.m2e.wtp.overlay.internal.modulecore;
+
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+
+public interface IFilteredVirtualFolder extends IVirtualFolder {
+
+ void setFilter(IResourceFilter filter);
+
+ IResourceFilter getFilter();
+}
14 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/IResourceFilter.java
@@ -0,0 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.m2e.wtp.overlay.internal.modulecore;
+
+
+public interface IResourceFilter {
+
+ boolean accepts(String path, boolean isFile);
+}
44 org.eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/OverlaySelfComponent.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.m2e.wtp.overlay.internal.modulecore;
+
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.m2e.wtp.overlay.modulecore.IOverlayVirtualComponent;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+
+/**
+ * Overlay Self Component
+ *
+ * @author Fred Bricon
+ */
+public class OverlaySelfComponent extends OverlayVirtualComponent implements IOverlayVirtualComponent {
+
+ public OverlaySelfComponent(IProject aComponentProject) {
+ super(aComponentProject);
+ }
+
+ public IVirtualFolder getRootFolder() {
+ IVirtualComponent component = ComponentCore.createComponent(getProject());
+ IVirtualFolder root =null;
+ if (component != null) {
+ root = component.getRootFolder();
+ }
+ return root;
+ }
+
+ @Override
+ public IVirtualReference[] getReferences(Map<String, Object> paramMap){
+ return new IVirtualReference[0];
+ }
+}
149 ....m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/OverlayVirtualArchiveComponent.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.m2e.wtp.overlay.internal.modulecore;
+
+import java.io.File;
+import java.util.Set;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.m2e.wtp.overlay.modulecore.IOverlayVirtualComponent;
+import org.eclipse.m2e.wtp.overlay.modulecore.UnpackArchiveJob;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+
+/**
+ * Overlay Virtual Archive Component
+ *
+ * @author Fred Bricon
+ */
+@SuppressWarnings("restriction")
+public class OverlayVirtualArchiveComponent extends VirtualArchiveComponent implements IOverlayVirtualComponent {
+
+ protected IPath unpackDirPath;
+
+ private Set<String> inclusions;
+
+ private Set<String> exclusions;
+
+ public OverlayVirtualArchiveComponent(IProject aComponentProject,
+ String archiveLocation, IPath unpackDirPath, IPath aRuntimePath) {
+ super(aComponentProject, archiveLocation, aRuntimePath);
+ this.unpackDirPath = unpackDirPath;
+ }
+
+ public void setInclusions(Set<String> inclusionPatterns) {
+ this.inclusions = inclusionPatterns;
+ }
+
+ public void setExclusions(Set<String> exclusionPatterns) {
+ this.exclusions = exclusionPatterns;
+ }
+
+ public IVirtualFolder getRootFolder() {
+ IVirtualComponent component = ComponentCore.createComponent(getProject());
+ File archive = getArchive();
+ ResourceListVirtualFolder root =null;
+ if (component != null && archive != null) {
+ IFolder unpackedFolder = getUnpackedArchiveFolder(archive);
+ if (isUnpackNeeded(archive, unpackedFolder)) {
+ new UnpackArchiveJob("Unpacking "+archive.getName(), archive, unpackedFolder).schedule();
+ root = new ResourceListVirtualFolder(getProject(), getRuntimePath(), new IContainer[] {});
+ } else {
+ IContainer[] containers = new IContainer[] {unpackedFolder};
+ root = new ResourceListVirtualFolder(getProject(), getRuntimePath(), containers);
+ root.setFilter(new FileSystemResourceFilter(inclusions, exclusions, unpackedFolder.getLocation()));
+ }
+ }
+ return root;
+ }
+
+ protected IFolder getUnpackedArchiveFolder(File archive) {
+ IFolder overlaysFolder = getProject().getFolder(unpackDirPath);
+ return overlaysFolder.getFolder(archive.getName());
+ }
+
+ private File getArchive() {
+ File archive = (File)getAdapter(File.class);
+ if (archive == null || !archive.exists() || !archive.canRead()) {
+ return null;
+ //TODO should raise an exception // throw new IOException("Unable to read "+ getArchivePath());
+ }
+ return archive;
+ }
+
+ private boolean isUnpackNeeded(File archive, IFolder unpackFolder) {
+ if (!unpackFolder.exists()) {
+ return true;
+ }
+ long lastUnpacked = new File(unpackFolder.getLocation().toOSString()).lastModified();
+ long lastModified = archive.lastModified();
+ return lastModified > lastUnpacked;
+ }
+
+ public IPath getUnpackFolderPath() {
+ return unpackDirPath;
+ }
+
+ public Set<String> getExclusions() {
+ return exclusions;
+ }
+
+ public Set<String> getInclusions() {
+ return inclusions;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result
+ + ((exclusions == null) ? 0 : exclusions.hashCode());
+ result = prime * result
+ + ((inclusions == null) ? 0 : inclusions.hashCode());
+ result = prime * result
+ + ((unpackDirPath == null) ? 0 : unpackDirPath.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ OverlayVirtualArchiveComponent other = (OverlayVirtualArchiveComponent) obj;
+ if (!super.equals(obj)) {
+ return false;
+ }
+ if (exclusions == null) {
+ if (other.exclusions != null)
+ return false;
+ } else if (!exclusions.equals(other.exclusions))
+ return false;
+ if (inclusions == null) {
+ if (other.inclusions != null)
+ return false;
+ } else if (!inclusions.equals(other.inclusions))
+ return false;
+ if (unpackDirPath == null) {
+ if (other.unpackDirPath != null)
+ return false;
+ } else if (!unpackDirPath.equals(other.unpackDirPath))
+ return false;
+ return true;
+ }
+
+}
179 ...eclipse.m2e.wtp.overlay/src/org/eclipse/m2e/wtp/overlay/internal/modulecore/OverlayVirtualComponent.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.m2e.wtp.overlay.internal.modulecore;
+
+import java.util.Arrays;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jst.common.internal.modulecore.AddClasspathFoldersParticipant;
+import org.eclipse.jst.common.internal.modulecore.AddClasspathLibReferencesParticipant;
+import org.eclipse.jst.common.internal.modulecore.AddMappedOutputFoldersParticipant;
+import org.eclipse.jst.common.internal.modulecore.IgnoreJavaInSourceFolderParticipant;
+import org.eclipse.jst.common.internal.modulecore.SingleRootExportParticipant;
+import org.eclipse.jst.j2ee.internal.common.exportmodel.JEEHeirarchyExportParticipant;
+import org.eclipse.jst.j2ee.internal.common.exportmodel.JavaEESingleRootCallback;
+import org.eclipse.m2e.wtp.overlay.modulecore.IOverlayVirtualComponent;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent;
+import org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.FlatComponentTaskModel;
+import org.eclipse.wst.common.componentcore.internal.flat.IChildModuleReference;
+import org.eclipse.wst.common.componentcore.internal.flat.IFlattenParticipant;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+
+/**
+ * Overlay Virtual Component
+ *
+ * @author Fred Bricon
+ */
+@SuppressWarnings("restriction")
+public class OverlayVirtualComponent extends VirtualComponent implements
+ IOverlayVirtualComponent {
+
+ protected IProject project;
+
+ protected Set<String> exclusionPatterns;
+
+ protected Set<String> inclusionPatterns;
+
+ protected Set<IVirtualReference> references;
+
+ private CompositeVirtualFolder cachedRoot;
+
+ private long lastCacheUpdate;
+
+ private static int MAX_CACHE = 1000;
+
+ public OverlayVirtualComponent(IProject project) {
+ super(project, ROOT);
+ this.project = project;
+ }
+
+ public IVirtualFolder getRootFolder() {
+ return getRoot();
+ }
+
+ private CompositeVirtualFolder getRoot() {
+ if (cachedRoot != null && (System.currentTimeMillis() - lastCacheUpdate) < MAX_CACHE){
+ return cachedRoot;
+ }
+
+ //System.err.println("returning new root ");
+ if (project != null) {
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if (component != null) {
+ //FlatVirtualComponent will build the project structure from the definition in .component
+ FlatVirtualComponent flatVirtualComponent = new FlatVirtualComponent(component, getOptions());
+ IResourceFilter filter = new DynamicResourceFilter(getInclusions(), getExclusions());
+ cachedRoot = new CompositeVirtualFolder(flatVirtualComponent, ROOT, filter);
+ }
+ }
+ lastCacheUpdate = System.currentTimeMillis();
+ return cachedRoot;
+ }
+
+ private FlatComponentTaskModel getOptions() {
+ FlatComponentTaskModel options = new FlatComponentTaskModel();
+ //Participants produce IFlatResources[]
+ //TODO Maybe deal with the inclusion/exclusion stuff on the participant level (using an Adapter or a Callback pattern)
+ IFlattenParticipant[] participants = new IFlattenParticipant[] {
+ new SingleRootExportParticipant(new JavaEESingleRootCallback()),
+ new JEEHeirarchyExportParticipant(),
+ new AddClasspathLibReferencesParticipant(),
+ new AddClasspathFoldersParticipant(),
+ new AddMappedOutputFoldersParticipant(),
+ new IgnoreJavaInSourceFolderParticipant()
+ };
+ options.put(FlatVirtualComponent.PARTICIPANT_LIST, Arrays.asList(participants));
+ return options;
+ }
+