Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.m2e.archetype.common/.classpath16
-rw-r--r--org.eclipse.m2e.archetype.common/.gitignore1
-rw-r--r--org.eclipse.m2e.archetype.common/.project34
-rw-r--r--org.eclipse.m2e.archetype.common/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--org.eclipse.m2e.archetype.common/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.m2e.archetype.common/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--org.eclipse.m2e.archetype.common/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.archetype.common/META-INF/MANIFEST.MF46
-rw-r--r--org.eclipse.m2e.archetype.common/META-INF/plexus/.gitignore0
-rw-r--r--org.eclipse.m2e.archetype.common/OSGI-INF/l10n/bundle.properties3
-rw-r--r--org.eclipse.m2e.archetype.common/build.properties14
-rw-r--r--org.eclipse.m2e.archetype.common/jars/archetype-common-2.0-alpha-4.jarbin0 -> 235251 bytes
-rw-r--r--org.eclipse.m2e.archetype.common/jars/commons-collections-3.2.jarbin0 -> 571259 bytes
-rw-r--r--org.eclipse.m2e.archetype.common/jars/commons-io-1.3.2.jarbin0 -> 87776 bytes
-rw-r--r--org.eclipse.m2e.archetype.common/jars/commons-lang-2.1.jarbin0 -> 207723 bytes
-rw-r--r--org.eclipse.m2e.archetype.common/jars/dom4j-1.6.1.jarbin0 -> 313898 bytes
-rw-r--r--org.eclipse.m2e.archetype.common/jars/jchardet-1.0.jarbin0 -> 26605 bytes
-rw-r--r--org.eclipse.m2e.archetype.common/jars/jdom-1.0.jarbin0 -> 153253 bytes
-rw-r--r--org.eclipse.m2e.archetype.common/jars/oro-2.0.8.jarbin0 -> 65261 bytes
-rw-r--r--org.eclipse.m2e.archetype.common/jars/plexus-velocity-1.1.3.jarbin0 -> 7914 bytes
-rw-r--r--org.eclipse.m2e.archetype.common/jars/velocity-1.5.jarbin0 -> 392124 bytes
-rw-r--r--org.eclipse.m2e.archetype.common/pom.xml90
-rw-r--r--org.eclipse.m2e.core/.classpath7
-rw-r--r--org.eclipse.m2e.core/.fbprefs146
-rw-r--r--org.eclipse.m2e.core/.gitignore2
-rw-r--r--org.eclipse.m2e.core/.options29
-rw-r--r--org.eclipse.m2e.core/.project34
-rw-r--r--org.eclipse.m2e.core/.settings/org.eclipse.jdt.core.prefs359
-rw-r--r--org.eclipse.m2e.core/.settings/org.eclipse.jdt.ui.prefs14
-rw-r--r--org.eclipse.m2e.core/.settings/org.eclipse.mylar.tasklist.prefs4
-rw-r--r--org.eclipse.m2e.core/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.m2e.core/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--org.eclipse.m2e.core/.settings/org.eclipse.pde.core.prefs3
-rw-r--r--org.eclipse.m2e.core/.settings/org.eclipse.pde.prefs23
-rw-r--r--org.eclipse.m2e.core/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.core/META-INF/MANIFEST.MF54
-rw-r--r--org.eclipse.m2e.core/about.html28
-rw-r--r--org.eclipse.m2e.core/about.ini17
-rw-r--r--org.eclipse.m2e.core/build.properties25
-rw-r--r--org.eclipse.m2e.core/icons/add_index.gifbin0 -> 379 bytes
-rw-r--r--org.eclipse.m2e.core/icons/clear.gifbin0 -> 163 bytes
-rw-r--r--org.eclipse.m2e.core/icons/clear_disabled.gifbin0 -> 159 bytes
-rw-r--r--org.eclipse.m2e.core/icons/close.gifbin0 -> 163 bytes
-rw-r--r--org.eclipse.m2e.core/icons/collapseall.gifbin0 -> 157 bytes
-rw-r--r--org.eclipse.m2e.core/icons/copy.gifbin0 -> 607 bytes
-rw-r--r--org.eclipse.m2e.core/icons/debug.gifbin0 -> 581 bytes
-rw-r--r--org.eclipse.m2e.core/icons/import_jar.gifbin0 -> 580 bytes
-rw-r--r--org.eclipse.m2e.core/icons/import_m2_project.gifbin0 -> 247 bytes
-rw-r--r--org.eclipse.m2e.core/icons/import_project.pngbin0 -> 6452 bytes
-rw-r--r--org.eclipse.m2e.core/icons/jar_obj.gifbin0 -> 587 bytes
-rw-r--r--org.eclipse.m2e.core/icons/jar_src_version.gifbin0 -> 323 bytes
-rw-r--r--org.eclipse.m2e.core/icons/jar_version.gifbin0 -> 133 bytes
-rw-r--r--org.eclipse.m2e.core/icons/java_obj.gifbin0 -> 573 bytes
-rw-r--r--org.eclipse.m2e.core/icons/java_src_obj.gifbin0 -> 589 bytes
-rw-r--r--org.eclipse.m2e.core/icons/lock_ovr.gifbin0 -> 310 bytes
-rw-r--r--org.eclipse.m2e.core/icons/m2.gifbin0 -> 222 bytes
-rw-r--r--org.eclipse.m2e.core/icons/m2eclipse48.gifbin0 -> 1795 bytes
-rw-r--r--org.eclipse.m2e.core/icons/main_tab.gifbin0 -> 359 bytes
-rw-r--r--org.eclipse.m2e.core/icons/maven_index.gifbin0 -> 362 bytes
-rw-r--r--org.eclipse.m2e.core/icons/maven_indexes.gifbin0 -> 258 bytes
-rw-r--r--org.eclipse.m2e.core/icons/mjar.gifbin0 -> 258 bytes
-rw-r--r--org.eclipse.m2e.core/icons/mlabel.gifbin0 -> 76 bytes
-rw-r--r--org.eclipse.m2e.core/icons/new_m2_pom.gifbin0 -> 254 bytes
-rw-r--r--org.eclipse.m2e.core/icons/new_m2_project.gifbin0 -> 274 bytes
-rw-r--r--org.eclipse.m2e.core/icons/new_m2_project_wizard.gifbin0 -> 2051 bytes
-rw-r--r--org.eclipse.m2e.core/icons/open_pom.gifbin0 -> 234 bytes
-rw-r--r--org.eclipse.m2e.core/icons/pom_obj.gifbin0 -> 249 bytes
-rw-r--r--org.eclipse.m2e.core/icons/rebuild_index.gifbin0 -> 230 bytes
-rw-r--r--org.eclipse.m2e.core/icons/refresh.gifbin0 -> 327 bytes
-rw-r--r--org.eclipse.m2e.core/icons/stderr.gifbin0 -> 242 bytes
-rw-r--r--org.eclipse.m2e.core/icons/stdout.gifbin0 -> 337 bytes
-rw-r--r--org.eclipse.m2e.core/icons/update_dependencies.gifbin0 -> 244 bytes
-rw-r--r--org.eclipse.m2e.core/icons/update_index.gifbin0 -> 350 bytes
-rw-r--r--org.eclipse.m2e.core/icons/update_source_folders.gifbin0 -> 251 bytes
-rw-r--r--org.eclipse.m2e.core/icons/web.gifbin0 -> 996 bytes
-rw-r--r--org.eclipse.m2e.core/intro/css/overview.css9
-rw-r--r--org.eclipse.m2e.core/intro/css/whatsnew.css9
-rw-r--r--org.eclipse.m2e.core/intro/overview.xml17
-rw-r--r--org.eclipse.m2e.core/intro/whatsnew.xml16
-rw-r--r--org.eclipse.m2e.core/m2eclipse.gifbin0 -> 1694 bytes
-rw-r--r--org.eclipse.m2e.core/plugin.properties111
-rw-r--r--org.eclipse.m2e.core/plugin.xml617
-rw-r--r--org.eclipse.m2e.core/pom.xml38
-rw-r--r--org.eclipse.m2e.core/schema/archetypes.exsd141
-rw-r--r--org.eclipse.m2e.core/schema/indexes.exsd153
-rw-r--r--org.eclipse.m2e.core/schema/lifecycleMappingPropertyPage.exsd122
-rw-r--r--org.eclipse.m2e.core/schema/lifecycleMappings.exsd200
-rw-r--r--org.eclipse.m2e.core/schema/m2menu.exsd122
-rw-r--r--org.eclipse.m2e.core/schema/mavenComponentContributors.exsd102
-rw-r--r--org.eclipse.m2e.core/schema/mavenProjectChangedListeners.exsd102
-rw-r--r--org.eclipse.m2e.core/schema/projectConfigurators.exsd191
-rw-r--r--org.eclipse.m2e.core/schema/scmHandlers.exsd130
-rw-r--r--org.eclipse.m2e.core/schema/scmHandlersUi.exsd104
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenImages.java222
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenPlugin.java564
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/NoSuchComponentException.java29
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AbstractMavenMenuCreator.java99
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AddDependencyAction.java75
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AddPluginAction.java65
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/ChangeNatureAction.java161
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/CheckoutAsMavenAction.java91
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/DisableNatureAction.java81
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/EnableNatureAction.java141
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MaterializeAction.java58
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenActionSupport.java136
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenConsoleRemoveAction.java31
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenDebugOutputAction.java63
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenMenuAction.java157
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenPropertyTester.java52
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/ModuleProjectWizardAction.java61
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/OpenMavenConsoleAction.java29
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/OpenPomAction.java404
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/OpenUrlAction.java230
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/RefreshMavenModelsAction.java114
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/SelectionUtil.java360
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/UpdateConfigurationAction.java160
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogFactory.java185
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogsWriter.java167
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeManager.java117
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/AbstractEclipseBuildContext.java141
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/ChangedFileOutputStream.java104
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/EclipseBuildContext.java75
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/EclipseIncrementalBuildContext.java142
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/ResourceDeltaScanner.java96
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/IMavenConsoleListener.java27
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/IMavenConstants.java87
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/MavenConsole.java41
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/MavenLogger.java59
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/Messages.java55
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/AbstractMavenConfigurationChangeListener.java22
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java148
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactRef.java73
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactRepositoryRef.java69
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ILocalRepositoryListener.java29
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMaven.java224
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfiguration.java66
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfigurationChangeListener.java25
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenLauncherConfiguration.java39
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ISettingsChangeListener.java26
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenConfigurationChangeEvent.java47
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java581
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenRuntime.java44
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenRuntimeManager.java165
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/NearestVersionConflictResolver.java257
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ProjectUpdater.java25
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IIndex.java134
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IMutableIndex.java37
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexListener.java33
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexManager.java53
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexedArtifact.java151
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexedArtifactFile.java104
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/MatchTyped.java27
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/MatchTypedStringSearchExpression.java29
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/SearchExpression.java25
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/SourcedSearchExpression.java23
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/StringSearchExpression.java29
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/UserInputSearchExpression.java23
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java130
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java1024
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/actions/DefaultMavenMenuCreator.java139
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/InternalBuildParticipant.java76
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java302
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenNature.java87
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceScanner.java91
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/console/ConsoleDocument.java95
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/console/MavenConsoleImpl.java404
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/PomFileContentDescriber.java96
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/PomHandler.java166
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/TextContentDescriber.java89
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/XMLContentDescriber.java128
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/AbstractTransferListenerAdapter.java107
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ArtifactTransferListenerAdapter.java59
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSession.java18
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSessionImpl.java153
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/DefaultMavenComponentContributor.java38
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseBuildContext.java25
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseClassRealmManagerDelegate.java88
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseLocalRepositoryMaintainer.java56
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseLogger.java135
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseLoggerManager.java62
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ExtensionModule.java53
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/IMavenComponentContributor.java27
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenConfigurationImpl.java107
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java198
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExternalRuntime.java239
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java1098
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenWorkspaceRuntime.java141
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/WagonTransferListenerAdapter.java118
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/ArtifactScanningMonitor.java67
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/AsyncFetcher.java283
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/CompositeIndex.java118
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/EquinoxLock.java35
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/EquinoxLocker.java41
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexUpdaterJob.java90
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexedArtifactGroup.java57
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexesExtensionReader.java84
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexingTransferListener.java34
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndex.java180
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java1312
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecycle/LifecycleMappingFactory.java238
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties498
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceConstants.java88
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceInitializer.java67
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ArtifactKeyAdapterFactory.java66
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/DependencyResolutionContext.java75
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/EclipseMavenMetadataCache.java91
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/IManagedCache.java31
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/IgnoreMojoProjectConfiguration.java33
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MavenMarkerManager.java713
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MavenProjectImportResult.java37
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MissingLifecycleMapping.java87
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MojoExecutionProjectConfigurator.java93
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MojoExecutionUtils.java29
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java716
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java87
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/AbstractMavenDependencyResolver.java58
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/BasicProjectRegistry.java151
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/Capability.java39
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/DefaultMavenDependencyResolver.java98
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipsePluginDependenciesResolver.java66
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java159
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ILifecycleMapping2.java25
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/IProjectRegistry.java34
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenCapability.java86
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenProjectFacade.java382
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenRequiredCapability.java101
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MutableProjectRegistry.java245
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistry.java117
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java854
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java216
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryRefreshJob.java233
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/RequiredCapability.java50
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/StaleMutableProjectRegistryException.java23
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/VersionlessKey.java65
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/IRepositoryDiscoverer.java29
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/IRepositoryIndexer.java46
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryInfo.java175
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistry.java323
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistryUpdateJob.java65
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/jobs/IBackgroundProcessingQueue.java31
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/messages.properties152
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/AbstractProjectScanner.java55
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenMarkerManager.java54
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectChangedListener.java21
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectFacade.java163
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectImportResult.java32
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectVisitor.java41
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectVisitor2.java29
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IProjectConfigurationManager.java66
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java187
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectChangedEvent.java69
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectInfo.java198
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectManager.java166
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectPomScanner.java219
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectScmInfo.java108
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectUtils.java98
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenUpdateRequest.java124
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ProjectImportConfiguration.java142
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ResolverConfiguration.java56
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractBuildParticipant.java68
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractLifecycleMapping.java219
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java243
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/CustomizableLifecycleMapping.java40
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/DefaultLifecycleMapping.java121
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/ILifecycleMapping.java56
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MavenProjectConfigurator.java120
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MavenResourcesProjectConfigurator.java20
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MojoExecutionBuildParticipant.java61
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/NoopLifecycleMapping.java55
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/PluginExecutionFilter.java81
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/ProjectConfigurationRequest.java72
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/repository/IRepository.java98
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/repository/IRepositoryRegistry.java70
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/MavenCheckoutOperation.java129
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmHandler.java131
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmHandlerFactory.java152
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmHandlerUi.java80
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmTag.java53
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmUrl.java100
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/AbstractMavenDialog.java124
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/AddDependencyDialog.java617
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/EditDependencyDialog.java217
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/InputHistory.java232
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenGoalSelectionDialog.java359
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenMessageDialog.java87
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenPropertyDialog.java192
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenRepositorySearchDialog.java184
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenAdapterFactory.java67
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenConsoleFactory.java32
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenConsolePageParticipant.java108
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenShowConsoleAction.java83
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java112
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/components/TextComboBoxCellEditor.java103
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/AbstractLifecyclePropertyPage.java57
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/AbstractPropertyPageExtensionPoint.java67
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ILifecyclePropertyPage.java60
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ILifecyclePropertyPageExtensionPoint.java55
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/LifecycleMappingPropertyPageFactory.java143
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ProjectConfiguratorsTable.java107
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ProjectConfiguratorsTableContentProvider.java61
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ProjectConfiguratorsTableLabelProvider.java96
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/CustomizableLifecycleMappingPropertyPage.java58
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/EmptyLifecycleMappingPropertyPage.java27
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/GoalsFieldEditor.java196
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java230
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java320
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenGoalSelectionAdapter.java73
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java677
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java104
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectLifecycleMappingPage.java97
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.java167
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java413
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MissingLifecycleMappingPropertyPage.java40
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/ProblemReportingPreferencePage.java57
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java284
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/SimpleLifecycleMappingPropertyPage.java62
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/search/MavenSearchPage.java141
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/search/MavenSearchResult.java76
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/search/MavenSearchResultPage.java80
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java596
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewContentProvider.java86
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewLabelProvider.java97
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractIndexedRepositoryNode.java86
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java77
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/CustomRepositoriesNode.java35
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/GlobalRepositoriesNode.java36
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IArtifactNode.java22
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IMavenRepositoryNode.java28
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactFileNode.java91
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java101
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactNode.java92
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryNode.java38
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java55
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java66
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/RepositoryNode.java56
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/WorkspaceRepositoryNode.java32
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/M2EErrorDialog.java218
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/M2EUtils.java108
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/ProposalUtil.java156
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/Util.java119
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/ArtifactInfo.java78
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/CComboContentAdapter.java96
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/ControlDecoration.java1088
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/IndexSearchEngine.java185
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/MenuDetectEvent.java77
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/MenuDetectListener.java43
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/Packaging.java47
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/SearchEngine.java49
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/SearchException.java29
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/AbstractMavenWizardPage.java218
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/CustomArchetypeDialog.java252
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenArtifactComponent.java270
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenCheckoutLocationPage.java424
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenCheckoutWizard.java180
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenDependenciesWizardPage.java291
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenImportWizard.java113
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenImportWizardPage.java525
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenInstallFileArtifactWizardPage.java390
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenInstallFileRepositoryWizardPage.java149
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenInstallFileWizard.java151
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenLocationComponent.java193
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenMaterializePomWizard.java241
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenModuleWizard.java305
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenModuleWizardParentPage.java310
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenParentComponent.java223
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenPomSelectionComponent.java580
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenPomWizard.java174
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenPomWizardPage.java223
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectCheckoutJob.java256
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectSelectionDialog.java192
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizard.java358
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardArchetypePage.java953
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardArchetypeParametersPage.java617
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardArtifactPage.java364
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardLocationPage.java321
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/ProjectsImportPage.java627
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/ProjectsImportWizard.java48
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/ResolverConfigurationComponent.java156
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/WidthGroup.java53
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/WorkingSetGroup.java271
-rw-r--r--org.eclipse.m2e.editor.xml/.classpath7
-rw-r--r--org.eclipse.m2e.editor.xml/.gitignore1
-rw-r--r--org.eclipse.m2e.editor.xml/.project34
-rw-r--r--org.eclipse.m2e.editor.xml/.settings/org.eclipse.jdt.core.prefs268
-rw-r--r--org.eclipse.m2e.editor.xml/.settings/org.eclipse.jdt.ui.prefs10
-rw-r--r--org.eclipse.m2e.editor.xml/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.m2e.editor.xml/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--org.eclipse.m2e.editor.xml/.settings/org.eclipse.pde.prefs22
-rw-r--r--org.eclipse.m2e.editor.xml/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF27
-rw-r--r--org.eclipse.m2e.editor.xml/OSGI-INF/l10n/bundle.properties66
-rw-r--r--org.eclipse.m2e.editor.xml/about.html28
-rw-r--r--org.eclipse.m2e.editor.xml/build.properties20
-rw-r--r--org.eclipse.m2e.editor.xml/icons/build_obj.gifbin0 -> 115 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/close.gifbin0 -> 163 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/element_obj.gifbin0 -> 82 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/exclude_obj.gifbin0 -> 215 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/execution_obj.gifbin0 -> 318 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/filter_obj.gifbin0 -> 219 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/goal_obj.gifbin0 -> 374 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/include_obj.gifbin0 -> 229 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/jar_obj.gifbin0 -> 587 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/jars_obj.gifbin0 -> 261 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/open_pom.gifbin0 -> 234 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/parameter_obj.gifbin0 -> 204 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/person_obj.gifbin0 -> 214 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/plugin_obj.gifbin0 -> 328 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/plugins_obj.gifbin0 -> 214 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/profile_obj.gifbin0 -> 369 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/profiles_obj.gifbin0 -> 236 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/project_obj.gifbin0 -> 233 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/properties_obj.gifbin0 -> 578 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/property_obj.gifbin0 -> 204 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/report2_obj.gifbin0 -> 356 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/report_obj.gifbin0 -> 581 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/repository_obj.gifbin0 -> 362 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/resource_obj.gifbin0 -> 564 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/resources_obj.gifbin0 -> 236 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/role_obj.gifbin0 -> 129 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/sample.gifbin0 -> 983 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/icons/template_obj.gifbin0 -> 359 bytes
-rw-r--r--org.eclipse.m2e.editor.xml/plugin.xml403
-rw-r--r--org.eclipse.m2e.editor.xml/pom.xml24
-rw-r--r--org.eclipse.m2e.editor.xml/schema/.gitignore0
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java340
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java110
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MavenMarkerResolutionGenerator.java65
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnImages.java107
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnIndexPlugin.java99
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentAssistProcessor.java579
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentOutlineConfiguration.java358
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java729
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomModelHandler.java133
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java678
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomStructuredTextViewConfiguration.java65
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java764
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextType.java32
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java105
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTextHover.java148
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/XMLSchemaMarkerResolution.java75
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/Messages.java156
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/POMMarkerAnnotationModel.java34
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/POMMarkerAnnotationModelFactory.java34
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/messages.properties66
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/preferences/PomTemplatesPreferencePage.java43
-rw-r--r--org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/template/.gitignore0
-rw-r--r--org.eclipse.m2e.editor/.classpath7
-rw-r--r--org.eclipse.m2e.editor/.gitignore2
-rw-r--r--org.eclipse.m2e.editor/.project34
-rw-r--r--org.eclipse.m2e.editor/.settings/org.eclipse.jdt.core.prefs340
-rw-r--r--org.eclipse.m2e.editor/.settings/org.eclipse.jdt.ui.prefs6
-rw-r--r--org.eclipse.m2e.editor/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.m2e.editor/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--org.eclipse.m2e.editor/.settings/org.eclipse.pde.prefs22
-rw-r--r--org.eclipse.m2e.editor/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.editor/META-INF/MANIFEST.MF28
-rw-r--r--org.eclipse.m2e.editor/OSGI-INF/l10n/bundle.properties8
-rw-r--r--org.eclipse.m2e.editor/about.html28
-rw-r--r--org.eclipse.m2e.editor/build.properties21
-rw-r--r--org.eclipse.m2e.editor/icons/advanced_tabs.gifbin0 -> 252 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/clear.gifbin0 -> 163 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/clear_disabled.gifbin0 -> 159 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/collapseall.gifbin0 -> 157 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/copy.gifbin0 -> 607 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/cut.gifbin0 -> 212 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/editor-pom.gifbin0 -> 249 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/effective_pom.gifbin0 -> 254 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/element_obj.gifbin0 -> 82 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/exclude_obj.gifbin0 -> 215 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/execution_obj.gifbin0 -> 318 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/expandall.gifbin0 -> 164 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/filter.gifbin0 -> 219 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/filter_obj.gifbin0 -> 219 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/goal_obj.gifbin0 -> 374 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/group.gifbin0 -> 216 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/hierarchy.gifbin0 -> 201 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/include_obj.gifbin0 -> 229 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/inherited_obj.gifbin0 -> 563 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/jar_obj.gifbin0 -> 587 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/new_jar.gifbin0 -> 269 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/new_plugin.gifbin0 -> 238 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/new_project.gifbin0 -> 274 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/parent_pom.gifbin0 -> 255 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/paste.gifbin0 -> 605 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/person_obj.gifbin0 -> 214 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/plugin_obj.gifbin0 -> 328 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/profile_obj.gifbin0 -> 369 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/project_obj.gifbin0 -> 233 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/property_obj.gifbin0 -> 204 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/refresh.gifbin0 -> 327 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/report2_obj.gifbin0 -> 356 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/report_obj.gifbin0 -> 581 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/repository_obj.gifbin0 -> 362 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/resource_obj.gifbin0 -> 564 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/role_obj.gifbin0 -> 129 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/scope.gifbin0 -> 199 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/scope_obj.gifbin0 -> 199 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/select_jar.gifbin0 -> 243 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/select_maven.gifbin0 -> 234 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/select_plugin.gifbin0 -> 234 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/show_group.gifbin0 -> 572 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/show_group2.gifbin0 -> 218 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/show_inherited_dependencies.gifbin0 -> 200 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/sort.gifbin0 -> 153 bytes
-rw-r--r--org.eclipse.m2e.editor/icons/web.gifbin0 -> 996 bytes
-rw-r--r--org.eclipse.m2e.editor/plugin.xml45
-rw-r--r--org.eclipse.m2e.editor/pom.xml24
-rw-r--r--org.eclipse.m2e.editor/schema/configurationEditorContribution.exsd123
-rw-r--r--org.eclipse.m2e.editor/schema/org.eclipse.m2e.editor.lifecycleMappingEditorContribution.exsd112
-rw-r--r--org.eclipse.m2e.editor/schema/pageFactories.exsd114
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/MavenEditorImages.java137
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/MavenEditorPlugin.java45
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/BuildComposite.java705
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComparator.java80
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java954
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyDetailComposite.java323
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java249
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorComposite.java263
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorContentProvider.java57
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ManageDependencyLabelProvider.java14
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ParentGatherer.java64
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/PluginsComposite.java1377
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ReportingComposite.java885
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/RepositoriesComposite.java1287
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/SectionExpansionAdapter.java44
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/StringLabelProvider.java39
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/TeamComposite.java630
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/TeamLabelProvider.java65
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java527
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/Messages.java30
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/messages.properties7
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/Messages.java578
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/actions/PomEditorMenuCreator.java35
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/actions/ShowDependencyHierarchyAction.java81
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/messages.properties276
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/plugins/DefaultPluginConfigurationEditor.java80
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/plugins/IPluginConfigurationExtension.java23
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/plugins/PluginExtensionDescriptor.java73
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/BuildPage.java604
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependenciesPage.java119
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java1063
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/FormUtils.java252
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/IPomFileChangedListener.java18
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/Matcher.java23
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java1214
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorContributor.java92
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java620
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPageFactory.java23
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ModulesLabelProvider.java45
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/NotificationCommandStack.java130
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java1442
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PluginsPage.java150
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java49
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ProfilesPage.java933
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PropertiesSection.java178
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PropertyPairLabelProvider.java40
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ReportingPage.java110
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/RepositoriesPage.java119
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ScopeArtifactFilter.java85
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/SearchControl.java106
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/SearchMatcher.java37
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/TeamPage.java76
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ValueProvider.java84
-rw-r--r--org.eclipse.m2e.feature/.gitignore1
-rw-r--r--org.eclipse.m2e.feature/.project23
-rw-r--r--org.eclipse.m2e.feature/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.m2e.feature/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--org.eclipse.m2e.feature/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.feature/build.properties18
-rw-r--r--org.eclipse.m2e.feature/epl-v10.html328
-rw-r--r--org.eclipse.m2e.feature/feature.properties170
-rw-r--r--org.eclipse.m2e.feature/feature.xml103
-rw-r--r--org.eclipse.m2e.feature/license.html113
-rw-r--r--org.eclipse.m2e.feature/p2.inf13
-rw-r--r--org.eclipse.m2e.feature/pom.xml24
-rw-r--r--org.eclipse.m2e.jdt/.classpath7
-rw-r--r--org.eclipse.m2e.jdt/.gitignore2
-rw-r--r--org.eclipse.m2e.jdt/.options11
-rw-r--r--org.eclipse.m2e.jdt/.project34
-rw-r--r--org.eclipse.m2e.jdt/.settings/org.eclipse.jdt.core.prefs360
-rw-r--r--org.eclipse.m2e.jdt/.settings/org.eclipse.jdt.ui.prefs14
-rw-r--r--org.eclipse.m2e.jdt/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.m2e.jdt/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--org.eclipse.m2e.jdt/.settings/org.eclipse.pde.core.prefs3
-rw-r--r--org.eclipse.m2e.jdt/.settings/org.eclipse.pde.prefs23
-rw-r--r--org.eclipse.m2e.jdt/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.jdt/META-INF/MANIFEST.MF30
-rw-r--r--org.eclipse.m2e.jdt/about.html28
-rw-r--r--org.eclipse.m2e.jdt/build.properties19
-rw-r--r--org.eclipse.m2e.jdt/icons/javadoc.gifbin0 -> 323 bytes
-rw-r--r--org.eclipse.m2e.jdt/icons/m2.gifbin0 -> 222 bytes
-rw-r--r--org.eclipse.m2e.jdt/plugin.properties26
-rw-r--r--org.eclipse.m2e.jdt/plugin.xml196
-rw-r--r--org.eclipse.m2e.jdt/pom.xml24
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/BuildPathManager.java923
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/DownloadSourcesActionDelegate.java68
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/DownloadSourcesJob.java270
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathDescriptor.java113
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathEntryDescriptor.java115
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathManagerDelegate.java29
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IJavaProjectConfigurator.java39
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/MavenJdtPlugin.java137
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java481
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathDescriptor.java167
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java290
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java134
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JDTCompilationParticipant.java68
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JarLifecycleMapping.java18
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java114
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaProjectConfigurator.java21
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainer.java50
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java90
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerSaveHelper.java199
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathVariableInitializer.java33
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenJdtImages.java69
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/Messages.java120
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/DownloadSourcesAction.java78
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java141
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenLaunchConfigurationListener.java76
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenRuntimeClasspathProvider.java359
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenSourcePathProvider.java51
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/messages.properties45
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/MavenClasspathContainerPage.java92
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/MavenJdtMenuCreator.java110
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/ui/internal/filter/MavenModuleFilter.java70
-rw-r--r--org.eclipse.m2e.launching/.classpath7
-rw-r--r--org.eclipse.m2e.launching/.gitignore1
-rw-r--r--org.eclipse.m2e.launching/.project34
-rw-r--r--org.eclipse.m2e.launching/.settings/org.eclipse.jdt.core.prefs338
-rw-r--r--org.eclipse.m2e.launching/.settings/org.eclipse.jdt.ui.prefs10
-rw-r--r--org.eclipse.m2e.launching/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.m2e.launching/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--org.eclipse.m2e.launching/.settings/org.eclipse.pde.prefs22
-rw-r--r--org.eclipse.m2e.launching/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.launching/META-INF/MANIFEST.MF32
-rw-r--r--org.eclipse.m2e.launching/about.html28
-rw-r--r--org.eclipse.m2e.launching/build.properties22
-rw-r--r--org.eclipse.m2e.launching/icons/m2.gifbin0 -> 222 bytes
-rw-r--r--org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver.jarbin0 -> 4914 bytes
-rw-r--r--org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver30.jarbin0 -> 5614 bytes
-rw-r--r--org.eclipse.m2e.launching/plugin.properties32
-rw-r--r--org.eclipse.m2e.launching/plugin.xml220
-rw-r--r--org.eclipse.m2e.launching/pom.xml24
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java374
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/MavenLaunchConstants.java46
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java281
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenFileEditorInput.java117
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java349
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchPlugin.java27
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java112
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLauncherConfigurationHandler.java94
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourceLocator.java28
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java185
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/Messages.java79
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/messages.properties26
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenBuilderConfigurationTabGroup.java34
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenJRETab.java147
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchConfigurationTabGroup.java34
-rw-r--r--org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java785
-rw-r--r--org.eclipse.m2e.maven.indexer/.classpath10
-rw-r--r--org.eclipse.m2e.maven.indexer/.gitignore1
-rw-r--r--org.eclipse.m2e.maven.indexer/.project34
-rw-r--r--org.eclipse.m2e.maven.indexer/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--org.eclipse.m2e.maven.indexer/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.m2e.maven.indexer/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--org.eclipse.m2e.maven.indexer/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.maven.indexer/META-INF/MANIFEST.MF45
-rw-r--r--org.eclipse.m2e.maven.indexer/META-INF/plexus/.gitignore0
-rw-r--r--org.eclipse.m2e.maven.indexer/OSGI-INF/l10n/bundle.properties3
-rw-r--r--org.eclipse.m2e.maven.indexer/build.properties17
-rw-r--r--org.eclipse.m2e.maven.indexer/jars/indexer-artifact-3.1.0-SNAPSHOT.jarbin0 -> 26750 bytes
-rw-r--r--org.eclipse.m2e.maven.indexer/jars/indexer-core-3.1.0-SNAPSHOT.jarbin0 -> 199520 bytes
-rw-r--r--org.eclipse.m2e.maven.indexer/jars/lucene-core-2.4.1.jarbin0 -> 822794 bytes
-rw-r--r--org.eclipse.m2e.maven.indexer/jars/lucene-highlighter-2.4.1.jarbin0 -> 91156 bytes
-rw-r--r--org.eclipse.m2e.maven.indexer/pom.xml118
-rw-r--r--org.eclipse.m2e.maven.runtime/.classpath51
-rw-r--r--org.eclipse.m2e.maven.runtime/.gitignore1
-rw-r--r--org.eclipse.m2e.maven.runtime/.project34
-rw-r--r--org.eclipse.m2e.maven.runtime/.settings/org.eclipse.jdt.core.prefs9
-rw-r--r--org.eclipse.m2e.maven.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.m2e.maven.runtime/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--org.eclipse.m2e.maven.runtime/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.maven.runtime/META-INF/MANIFEST.MF239
-rw-r--r--org.eclipse.m2e.maven.runtime/META-INF/plexus/.gitignore0
-rw-r--r--org.eclipse.m2e.maven.runtime/build.properties13
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/aether-api-1.7.jarbin0 -> 74176 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/aether-connector-http-1.7.0.jarbin0 -> 48495 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/aether-connector-wagon-1.7.jarbin0 -> 24876 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/aether-impl-1.7.jarbin0 -> 106275 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/aether-spi-1.7.jarbin0 -> 13549 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/aether-util-1.7.jarbin0 -> 107949 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/asm-3.2.jarbin0 -> 43398 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/async-http-client-1.3.4.jarbin0 -> 205005 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/commons-cli-1.2.jarbin0 -> 41123 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/guice-bean-binders-1.4.2.jarbin0 -> 28985 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/guice-bean-converters-1.4.2.jarbin0 -> 4455 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/guice-bean-inject-1.4.2.jarbin0 -> 6667 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/guice-bean-locators-1.4.2.jarbin0 -> 33573 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/guice-bean-reflect-1.4.2.jarbin0 -> 35995 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/guice-bean-scanners-1.4.2.jarbin0 -> 8853 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/guice-plexus-binders-1.4.2.jarbin0 -> 24846 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/guice-plexus-converters-1.4.2.jarbin0 -> 8365 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/guice-plexus-locators-1.4.2.jarbin0 -> 11032 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/guice-plexus-metadata-1.4.2.jarbin0 -> 13433 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/guice-plexus-scanners-1.4.2.jarbin0 -> 18338 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/guice-plexus-shim-1.4.2.jarbin0 -> 113809 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/javax.inject-1.jarbin0 -> 2497 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/maven-aether-provider-3.0.jarbin0 -> 51189 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/maven-artifact-3.0.jarbin0 -> 51908 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/maven-compat-3.0.jarbin0 -> 284889 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/maven-core-3.0.jarbin0 -> 527040 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/maven-embedder-3.0.jarbin0 -> 39561 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/maven-model-3.0.jarbin0 -> 164685 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/maven-model-builder-3.0.jarbin0 -> 147974 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/maven-plugin-api-3.0.jarbin0 -> 48920 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/maven-repository-metadata-3.0.jarbin0 -> 30082 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/maven-settings-3.0.jarbin0 -> 46667 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/maven-settings-builder-3.0.jarbin0 -> 37780 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/netty-3.2.3.Final.jarbin0 -> 786229 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/plexus-build-api-0.0.6.jarbin0 -> 8074 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/plexus-cipher-1.4.jarbin0 -> 13494 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/plexus-classworlds-2.3.jarbin0 -> 46830 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/plexus-component-annotations-1.5.5.jarbin0 -> 4211 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/plexus-interpolation-1.14.jarbin0 -> 61072 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/plexus-sec-dispatcher-1.3.jarbin0 -> 28555 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/plexus-utils-2.0.4.jarbin0 -> 222137 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/sisu-guice-2.1.7-noaop.jarbin0 -> 471737 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/wagon-ahc-1.0.0.jarbin0 -> 25335 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/wagon-file-1.0-beta-6.jarbin0 -> 11040 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/jars/wagon-provider-api-1.0-beta-6.jarbin0 -> 53184 bytes
-rw-r--r--org.eclipse.m2e.maven.runtime/pom.xml24
-rw-r--r--org.eclipse.m2e.maven.runtime/update-jars-pom.xml218
-rw-r--r--org.eclipse.m2e.model.edit/.classpath8
-rw-r--r--org.eclipse.m2e.model.edit/.gitignore2
-rw-r--r--org.eclipse.m2e.model.edit/.project34
-rw-r--r--org.eclipse.m2e.model.edit/.settings/org.eclipse.jdt.core.prefs337
-rw-r--r--org.eclipse.m2e.model.edit/.settings/org.eclipse.jdt.ui.prefs10
-rw-r--r--org.eclipse.m2e.model.edit/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.m2e.model.edit/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--org.eclipse.m2e.model.edit/.settings/org.eclipse.pde.prefs22
-rw-r--r--org.eclipse.m2e.model.edit/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.model.edit/META-INF/MANIFEST.MF25
-rw-r--r--org.eclipse.m2e.model.edit/OSGI-INF/l10n/bundle.properties3
-rw-r--r--org.eclipse.m2e.model.edit/about.html28
-rw-r--r--org.eclipse.m2e.model.edit/build.properties28
-rw-r--r--org.eclipse.m2e.model.edit/icons/full/obj16/PropertyPair.gifbin0 -> 129 bytes
-rw-r--r--org.eclipse.m2e.model.edit/plugin.properties348
-rw-r--r--org.eclipse.m2e.model.edit/plugin.xml42
-rw-r--r--org.eclipse.m2e.model.edit/pom.xml35
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Activation.java326
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationFile.java100
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationOS.java158
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationProperty.java98
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Build.java257
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/BuildBase.java371
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/CiManagement.java144
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Configuration.java57
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Contributor.java305
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Dependency.java429
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DependencyManagement.java91
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DeploymentRepository.java265
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Developer.java330
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DistributionManagement.java382
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DocumentRoot.java134
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Exclusion.java91
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Extension.java121
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/IssueManagement.java96
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/License.java161
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/MailingList.java246
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Model.java1448
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Notifier.java429
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Organization.java88
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Parent.java160
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Plugin.java370
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PluginExecution.java205
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PluginManagement.java60
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PomFactory.java393
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PomPackage.java6917
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Prerequisites.java94
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Profile.java620
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PropertyElement.java93
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Relocation.java152
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ReportPlugin.java266
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ReportSet.java176
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Reporting.java179
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Repository.java320
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/RepositoryPolicy.java165
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Resource.java217
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Scm.java191
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Site.java127
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationFileImpl.java232
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationImpl.java738
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationOSImpl.java346
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationPropertyImpl.java233
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/BuildBaseImpl.java691
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/BuildImpl.java506
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/CiManagementImpl.java315
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ConfigurationImpl.java242
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ContributorImpl.java609
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DependencyImpl.java737
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DependencyManagementImpl.java189
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DeploymentRepositoryImpl.java487
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DeveloperImpl.java665
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DistributionManagementImpl.java894
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DocumentRootImpl.java317
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ExclusionImpl.java233
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ExtensionImpl.java290
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/IssueManagementImpl.java232
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/LicenseImpl.java348
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/MailingListImpl.java472
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ModelImpl.java2791
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/NotifierImpl.java747
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/OrganizationImpl.java232
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ParentImpl.java349
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginExecutionImpl.java444
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginImpl.java695
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginManagementImpl.java165
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PomFactoryImpl.java562
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PomPackageImpl.java4597
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PrerequisitesImpl.java214
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ProfileImpl.java1233
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PropertyElementImpl.java232
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RelocationImpl.java347
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportPluginImpl.java540
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportSetImpl.java383
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportingImpl.java361
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RepositoryImpl.java698
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RepositoryPolicyImpl.java337
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ResourceImpl.java411
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ScmImpl.java385
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/SiteImpl.java285
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationFileItemProvider.java180
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationItemProvider.java236
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationOSItemProvider.java220
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationPropertyItemProvider.java180
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/BuildBaseItemProvider.java297
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/BuildItemProvider.java293
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/CiManagementItemProvider.java227
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ConfigurationItemProvider.java124
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ContributorItemProvider.java313
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DependencyItemProvider.java347
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DependencyManagementItemProvider.java179
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DeploymentRepositoryItemProvider.java241
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DeveloperItemProvider.java327
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DistributionManagementItemProvider.java274
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DocumentRootItemProvider.java178
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ExclusionItemProvider.java178
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ExtensionItemProvider.java197
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/IssueManagementItemProvider.java180
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/LicenseItemProvider.java218
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/MailingListItemProvider.java288
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ModelItemProvider.java495
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/NotifierItemProvider.java304
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/OrganizationItemProvider.java182
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ParentItemProvider.java215
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginExecutionItemProvider.java262
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginItemProvider.java303
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginManagementItemProvider.java179
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PomEditPlugin.java94
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PomItemProviderAdapterFactory.java1243
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PrerequisitesItemProvider.java160
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ProfileItemProvider.java305
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PropertyElementItemProvider.java180
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RelocationItemProvider.java226
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportPluginItemProvider.java285
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportSetItemProvider.java242
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportingItemProvider.java224
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RepositoryItemProvider.java294
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RepositoryPolicyItemProvider.java202
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ResourceItemProvider.java247
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ScmItemProvider.java215
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/SiteItemProvider.java196
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ConfigurationAdapter.java61
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ListAdapter.java230
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ModelObjectAdapter.java326
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/PropertiesAdapter.java235
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/SSESyncResource.java284
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/TranslatorAdapter.java371
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ValueUpdateAdapter.java158
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomAdapterFactory.java904
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomResourceFactoryImpl.java45
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomResourceImpl.java47
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomSwitch.java1060
-rw-r--r--org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomXMLProcessor.java64
-rw-r--r--org.eclipse.m2e.model.edit/src/main/templates/Header.javajetinc7
-rw-r--r--org.eclipse.m2e.model.edit/src/main/templates/emf-merge.xml237
-rw-r--r--org.eclipse.m2e.model.edit/src/main/templates/model/Class.javajet2010
-rw-r--r--org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.ecore2262
-rw-r--r--org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.genmodel291
-rw-r--r--org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.xsd1971
-rw-r--r--org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.xsd2ecore768
-rw-r--r--org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/readme.txt9
-rw-r--r--org.eclipse.m2e.model.edit/xsd/archetype-1.0.0.xsd123
-rw-r--r--org.eclipse.m2e.model.edit/xsd/archetype-catalog-1.0.0.xsd94
-rw-r--r--org.eclipse.m2e.model.edit/xsd/archetype-descriptor-1.0.0.xsd189
-rw-r--r--org.eclipse.m2e.model.edit/xsd/maven-v4_0_0.xsd2217
-rw-r--r--org.eclipse.m2e.model.edit/xsd/profiles-v1_0_0.xsd322
-rw-r--r--org.eclipse.m2e.model.edit/xsd/settings-v1_0_0.xsd715
-rw-r--r--org.eclipse.m2e.parent/.classpath5
-rw-r--r--org.eclipse.m2e.parent/.gitignore1
-rw-r--r--org.eclipse.m2e.parent/.project17
-rw-r--r--org.eclipse.m2e.parent/.settings/org.eclipse.jdt.core.prefs262
-rw-r--r--org.eclipse.m2e.parent/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.m2e.parent/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--org.eclipse.m2e.parent/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.parent/pom.xml454
-rw-r--r--org.eclipse.m2e.parent/run.sh4
-rw-r--r--org.eclipse.m2e.refactoring/.classpath7
-rw-r--r--org.eclipse.m2e.refactoring/.gitignore1
-rw-r--r--org.eclipse.m2e.refactoring/.project34
-rw-r--r--org.eclipse.m2e.refactoring/.settings/org.eclipse.jdt.core.prefs337
-rw-r--r--org.eclipse.m2e.refactoring/.settings/org.eclipse.jdt.ui.prefs10
-rw-r--r--org.eclipse.m2e.refactoring/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.m2e.refactoring/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--org.eclipse.m2e.refactoring/.settings/org.eclipse.pde.prefs22
-rw-r--r--org.eclipse.m2e.refactoring/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.refactoring/META-INF/MANIFEST.MF26
-rw-r--r--org.eclipse.m2e.refactoring/OSGI-INF/l10n/bundle.properties8
-rw-r--r--org.eclipse.m2e.refactoring/about.html28
-rw-r--r--org.eclipse.m2e.refactoring/build.properties18
-rw-r--r--org.eclipse.m2e.refactoring/icons/exclude.gifbin0 -> 215 bytes
-rw-r--r--org.eclipse.m2e.refactoring/icons/m2.gifbin0 -> 222 bytes
-rw-r--r--org.eclipse.m2e.refactoring/plugin.xml80
-rw-r--r--org.eclipse.m2e.refactoring/pom.xml24
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java321
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/ChangeCreator.java187
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/Messages.java68
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/PomRefactoringException.java28
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/PomVisitor.java33
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/RefactoringModelResources.java194
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/DependencyExcludeAction.java112
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeRefactoring.java195
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/MavenExcludeWizard.java32
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/Activator.java63
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringImages.java62
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringMavenMenuCreator.java36
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/SaveDirtyFilesDialog.java166
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/messages.properties20
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/MavenRenameWizard.java40
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/MavenRenameWizardPage.java159
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactAction.java79
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameRefactoring.java332
-rw-r--r--org.eclipse.m2e.sdk.feature/.gitignore1
-rw-r--r--org.eclipse.m2e.sdk.feature/.project23
-rw-r--r--org.eclipse.m2e.sdk.feature/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.sdk.feature/build.properties15
-rw-r--r--org.eclipse.m2e.sdk.feature/epl-v10.html328
-rw-r--r--org.eclipse.m2e.sdk.feature/feature.properties170
-rw-r--r--org.eclipse.m2e.sdk.feature/feature.xml34
-rw-r--r--org.eclipse.m2e.sdk.feature/license.html113
-rw-r--r--org.eclipse.m2e.sdk.feature/pom.xml24
-rw-r--r--org.eclipse.m2e.site/.gitignore1
-rw-r--r--org.eclipse.m2e.site/.project29
-rw-r--r--org.eclipse.m2e.site/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--org.eclipse.m2e.site/build.properties11
-rw-r--r--org.eclipse.m2e.site/category.xml10
-rw-r--r--org.eclipse.m2e.site/feature.xml16
-rw-r--r--org.eclipse.m2e.site/pom.xml107
-rw-r--r--org.eclipse.m2e.site/src/main/assembly/assembly.xml15
-rw-r--r--target-platform/.project23
-rw-r--r--target-platform/.settings/org.maven.ide.eclipse.prefs9
-rw-r--r--target-platform/m2e-e34.target33
-rw-r--r--target-platform/m2e-e35.target31
-rw-r--r--target-platform/m2e-e36.target33
-rw-r--r--target-platform/m2e-e37.target33
-rw-r--r--target-platform/pom.xml55
966 files changed, 154921 insertions, 0 deletions
diff --git a/org.eclipse.m2e.archetype.common/.classpath b/org.eclipse.m2e.archetype.common/.classpath
new file mode 100644
index 00000000..0afc3528
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/.classpath
@@ -0,0 +1,16 @@
+<?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 exported="true" kind="lib" path="jars/jchardet-1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/dom4j-1.6.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/jdom-1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/commons-io-1.3.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/plexus-velocity-1.1.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/commons-collections-3.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/archetype-common-2.0-alpha-4.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/commons-lang-2.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/oro-2.0.8.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/velocity-1.5.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.m2e.archetype.common/.gitignore b/org.eclipse.m2e.archetype.common/.gitignore
new file mode 100644
index 00000000..ea8c4bf7
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/org.eclipse.m2e.archetype.common/.project b/org.eclipse.m2e.archetype.common/.project
new file mode 100644
index 00000000..cf2cd51b
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.archetype.common</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.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.archetype.common/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.archetype.common/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..a413c41a
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Thu Feb 04 10:56:12 EST 2010
+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
diff --git a/org.eclipse.m2e.archetype.common/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.m2e.archetype.common/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 00000000..cbc5af3c
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Thu Aug 28 19:39:02 EDT 2008
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
diff --git a/org.eclipse.m2e.archetype.common/.settings/org.eclipse.mylyn.team.ui.prefs b/org.eclipse.m2e.archetype.common/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 00000000..44987de8
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Thu Aug 28 19:39:02 EDT 2008
+commit.comment.template=${task.key}\: ${task.description}
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.archetype.common/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.archetype.common/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..58e131a1
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:17 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.archetype.common/META-INF/MANIFEST.MF b/org.eclipse.m2e.archetype.common/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..57289d99
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/META-INF/MANIFEST.MF
@@ -0,0 +1,46 @@
+Manifest-Version: 1.0
+Export-Package: META-INF.plexus,
+ org.apache.maven.archetype,
+ org.apache.maven.archetype.catalog,
+ org.apache.maven.archetype.catalog.io.xpp3,
+ org.apache.maven.archetype.common,
+ org.apache.maven.archetype.common.io.xpp3,
+ org.apache.maven.archetype.common.util,
+ org.apache.maven.archetype.creator,
+ org.apache.maven.archetype.creator.olddescriptor,
+ org.apache.maven.archetype.downloader,
+ org.apache.maven.archetype.exception,
+ org.apache.maven.archetype.generator,
+ org.apache.maven.archetype.metadata,
+ org.apache.maven.archetype.metadata.io.xpp3,
+ org.apache.maven.archetype.model,
+ org.apache.maven.archetype.model.io.xpp3,
+ org.apache.maven.archetype.old,
+ org.apache.maven.archetype.old.descriptor,
+ org.apache.maven.archetype.registry,
+ org.apache.maven.archetype.registry.io.xpp3,
+ org.apache.maven.archetype.repositorycrawler,
+ org.apache.maven.archetype.source,
+ org.codehaus.plexus.velocity
+Bundle-ClassPath: jars/jchardet-1.0.jar,
+ jars/dom4j-1.6.1.jar,
+ jars/jdom-1.0.jar,
+ jars/commons-io-1.3.2.jar,
+ jars/plexus-velocity-1.1.3.jar,
+ jars/commons-collections-3.2.jar,
+ jars/archetype-common-2.0-alpha-4.jar,
+ jars/commons-lang-2.1.jar,
+ jars/oro-2.0.8.jar,
+ jars/velocity-1.5.jar
+Bundle-Name: %Bundle-Name
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6
+Require-Bundle: org.eclipse.m2e.maven.runtime;bundle-version="[0.13.0,0.14.0)"
+Bundle-Vendor: %Bundle-Vendor
+MavenArtifact-BaseVersion: 2.0.1.20090526-1230
+Bundle-Version: 0.13.0.qualifier
+MavenArtifact-GroupId: org.eclipse.m2e
+MavenArtifact-ArtifactId: org.eclipse.m2e.archetype.common
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.m2e.archetype.common;singleton:=true
+
diff --git a/org.eclipse.m2e.archetype.common/META-INF/plexus/.gitignore b/org.eclipse.m2e.archetype.common/META-INF/plexus/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/META-INF/plexus/.gitignore
diff --git a/org.eclipse.m2e.archetype.common/OSGI-INF/l10n/bundle.properties b/org.eclipse.m2e.archetype.common/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000..716b225f
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.m2e.archetype_common
+Bundle-Vendor = Eclipse m2e
+Bundle-Name = Maven Archetype Common Bundle \ No newline at end of file
diff --git a/org.eclipse.m2e.archetype.common/build.properties b/org.eclipse.m2e.archetype.common/build.properties
new file mode 100644
index 00000000..13994ad1
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/build.properties
@@ -0,0 +1,14 @@
+#
+# Copyright (c) 2008-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
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
+bin.includes = META-INF/,\
+ jars/,\
+ OSGI-INF/l10n/bundle.properties
diff --git a/org.eclipse.m2e.archetype.common/jars/archetype-common-2.0-alpha-4.jar b/org.eclipse.m2e.archetype.common/jars/archetype-common-2.0-alpha-4.jar
new file mode 100644
index 00000000..32dfddb1
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/jars/archetype-common-2.0-alpha-4.jar
Binary files differ
diff --git a/org.eclipse.m2e.archetype.common/jars/commons-collections-3.2.jar b/org.eclipse.m2e.archetype.common/jars/commons-collections-3.2.jar
new file mode 100644
index 00000000..75580be2
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/jars/commons-collections-3.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.archetype.common/jars/commons-io-1.3.2.jar b/org.eclipse.m2e.archetype.common/jars/commons-io-1.3.2.jar
new file mode 100644
index 00000000..865c9e41
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/jars/commons-io-1.3.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.archetype.common/jars/commons-lang-2.1.jar b/org.eclipse.m2e.archetype.common/jars/commons-lang-2.1.jar
new file mode 100644
index 00000000..87b80ab5
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/jars/commons-lang-2.1.jar
Binary files differ
diff --git a/org.eclipse.m2e.archetype.common/jars/dom4j-1.6.1.jar b/org.eclipse.m2e.archetype.common/jars/dom4j-1.6.1.jar
new file mode 100644
index 00000000..c8c4dbb9
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/jars/dom4j-1.6.1.jar
Binary files differ
diff --git a/org.eclipse.m2e.archetype.common/jars/jchardet-1.0.jar b/org.eclipse.m2e.archetype.common/jars/jchardet-1.0.jar
new file mode 100644
index 00000000..c362d03c
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/jars/jchardet-1.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.archetype.common/jars/jdom-1.0.jar b/org.eclipse.m2e.archetype.common/jars/jdom-1.0.jar
new file mode 100644
index 00000000..288e64cb
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/jars/jdom-1.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.archetype.common/jars/oro-2.0.8.jar b/org.eclipse.m2e.archetype.common/jars/oro-2.0.8.jar
new file mode 100644
index 00000000..23488d26
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/jars/oro-2.0.8.jar
Binary files differ
diff --git a/org.eclipse.m2e.archetype.common/jars/plexus-velocity-1.1.3.jar b/org.eclipse.m2e.archetype.common/jars/plexus-velocity-1.1.3.jar
new file mode 100644
index 00000000..36bac039
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/jars/plexus-velocity-1.1.3.jar
Binary files differ
diff --git a/org.eclipse.m2e.archetype.common/jars/velocity-1.5.jar b/org.eclipse.m2e.archetype.common/jars/velocity-1.5.jar
new file mode 100644
index 00000000..7c7f2c43
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/jars/velocity-1.5.jar
Binary files differ
diff --git a/org.eclipse.m2e.archetype.common/pom.xml b/org.eclipse.m2e.archetype.common/pom.xml
new file mode 100644
index 00000000..1d4afbd2
--- /dev/null
+++ b/org.eclipse.m2e.archetype.common/pom.xml
@@ -0,0 +1,90 @@
+<?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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.archetype.common</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>Maven Archetype Common Bundle</name>
+
+ <profiles>
+ <profile>
+ <id>update-dependencies</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-common</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>jars</directory>
+ <followSymlinks>false</followSymlinks>
+ <includes>
+ <include>**/*.jar</include>
+ </includes>
+ </fileset>
+ <fileset>
+ <directory>META-INF</directory>
+ <followSymlinks>false</followSymlinks>
+ <includes>
+ <include>**/MANIFEST.MF</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-packaging-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>generate-bundle</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <packageSources>false</packageSources>
+ <exportPackages>
+ org.apache.maven.archetype.*
+ </exportPackages>
+ <manifestAttributes>
+ <Bundle-RequiredExecutionEnvironment>J2SE-1.5, JavaSE-1.6</Bundle-RequiredExecutionEnvironment>
+ </manifestAttributes>
+ <requireBundles>
+ <requireBundle>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.maven.runtime</artifactId>
+ <version>${maven_embedder.version}</version>
+ </requireBundle>
+ </requireBundles>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/org.eclipse.m2e.core/.classpath b/org.eclipse.m2e.core/.classpath
new file mode 100644
index 00000000..798048dd
--- /dev/null
+++ b/org.eclipse.m2e.core/.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>
diff --git a/org.eclipse.m2e.core/.fbprefs b/org.eclipse.m2e.core/.fbprefs
new file mode 100644
index 00000000..58a8e910
--- /dev/null
+++ b/org.eclipse.m2e.core/.fbprefs
@@ -0,0 +1,146 @@
+#FindBugs User Preferences
+#Sat Jul 05 12:32:13 EDT 2008
+detectorAppendingToAnObjectOutputStream=AppendingToAnObjectOutputStream|true
+detectorBCPMethodReturnCheck=BCPMethodReturnCheck|false
+detectorBadAppletConstructor=BadAppletConstructor|false
+detectorBadResultSetAccess=BadResultSetAccess|true
+detectorBadSyntaxForRegularExpression=BadSyntaxForRegularExpression|true
+detectorBadUseOfReturnValue=BadUseOfReturnValue|true
+detectorBadlyOverriddenAdapter=BadlyOverriddenAdapter|true
+detectorBooleanReturnNull=BooleanReturnNull|true
+detectorCalledMethods=CalledMethods|true
+detectorCheckCalls=CheckCalls|false
+detectorCheckImmutableAnnotation=CheckImmutableAnnotation|true
+detectorCheckTypeQualifiers=CheckTypeQualifiers|true
+detectorCloneIdiom=CloneIdiom|true
+detectorComparatorIdiom=ComparatorIdiom|true
+detectorConfusedInheritance=ConfusedInheritance|true
+detectorConfusionBetweenInheritedAndOuterMethod=ConfusionBetweenInheritedAndOuterMethod|true
+detectorCrossSiteScripting=CrossSiteScripting|true
+detectorDoInsideDoPrivileged=DoInsideDoPrivileged|true
+detectorDontCatchIllegalMonitorStateException=DontCatchIllegalMonitorStateException|true
+detectorDontUseEnum=DontUseEnum|true
+detectorDroppedException=DroppedException|true
+detectorDumbMethodInvocations=DumbMethodInvocations|true
+detectorDumbMethods=DumbMethods|true
+detectorDuplicateBranches=DuplicateBranches|true
+detectorEmptyZipFileEntry=EmptyZipFileEntry|true
+detectorEqStringTest=EqStringTest|false
+detectorFieldItemSummary=FieldItemSummary|true
+detectorFinalizerNullsFields=FinalizerNullsFields|true
+detectorFindBadCast=FindBadCast|false
+detectorFindBadCast2=FindBadCast2|true
+detectorFindBadEqualsImplementation=FindBadEqualsImplementation|false
+detectorFindBadForLoop=FindBadForLoop|true
+detectorFindBugsSummaryStats=FindBugsSummaryStats|true
+detectorFindCircularDependencies=FindCircularDependencies|true
+detectorFindDeadLocalStores=FindDeadLocalStores|true
+detectorFindDoubleCheck=FindDoubleCheck|true
+detectorFindEmptySynchronizedBlock=FindEmptySynchronizedBlock|true
+detectorFindFieldSelfAssignment=FindFieldSelfAssignment|true
+detectorFindFinalizeInvocations=FindFinalizeInvocations|true
+detectorFindFloatEquality=FindFloatEquality|true
+detectorFindFloatMath=FindFloatMath|false
+detectorFindHEmismatch=FindHEmismatch|true
+detectorFindInconsistentSync2=FindInconsistentSync2|true
+detectorFindJSR166LockMonitorenter=FindJSR166LockMonitorenter|true
+detectorFindLocalSelfAssignment2=FindLocalSelfAssignment2|true
+detectorFindMaskedFields=FindMaskedFields|true
+detectorFindMismatchedWaitOrNotify=FindMismatchedWaitOrNotify|true
+detectorFindNakedNotify=FindNakedNotify|true
+detectorFindNonSerializableStoreIntoSession=FindNonSerializableStoreIntoSession|true
+detectorFindNonSerializableValuePassedToWriteObject=FindNonSerializableValuePassedToWriteObject|true
+detectorFindNonShortCircuit=FindNonShortCircuit|true
+detectorFindNullDeref=FindNullDeref|true
+detectorFindOpenStream=FindOpenStream|true
+detectorFindPuzzlers=FindPuzzlers|true
+detectorFindRefComparison=FindRefComparison|true
+detectorFindReturnRef=FindReturnRef|false
+detectorFindRunInvocations=FindRunInvocations|true
+detectorFindSelfComparison=FindSelfComparison|true
+detectorFindSelfComparison2=FindSelfComparison2|true
+detectorFindSleepWithLockHeld=FindSleepWithLockHeld|true
+detectorFindSpinLoop=FindSpinLoop|true
+detectorFindSqlInjection=FindSqlInjection|true
+detectorFindTwoLockWait=FindTwoLockWait|true
+detectorFindUncalledPrivateMethods=FindUncalledPrivateMethods|true
+detectorFindUnconditionalWait=FindUnconditionalWait|true
+detectorFindUninitializedGet=FindUninitializedGet|true
+detectorFindUnrelatedTypesInGenericContainer=FindUnrelatedTypesInGenericContainer|true
+detectorFindUnreleasedLock=FindUnreleasedLock|true
+detectorFindUnsatisfiedObligation=FindUnsatisfiedObligation|false
+detectorFindUnsyncGet=FindUnsyncGet|true
+detectorFindUselessControlFlow=FindUselessControlFlow|true
+detectorHugeSharedStringConstants=HugeSharedStringConstants|true
+detectorIDivResultCastToDouble=IDivResultCastToDouble|true
+detectorIncompatMask=IncompatMask|true
+detectorInefficientMemberAccess=InefficientMemberAccess|true
+detectorInefficientToArray=InefficientToArray|true
+detectorInfiniteLoop=InfiniteLoop|true
+detectorInfiniteRecursiveLoop=InfiniteRecursiveLoop|true
+detectorInfiniteRecursiveLoop2=InfiniteRecursiveLoop2|true
+detectorInheritanceUnsafeGetResource=InheritanceUnsafeGetResource|true
+detectorInitializationChain=InitializationChain|true
+detectorInstantiateStaticClass=InstantiateStaticClass|true
+detectorInvalidJUnitTest=InvalidJUnitTest|true
+detectorIteratorIdioms=IteratorIdioms|true
+detectorLazyInit=LazyInit|true
+detectorLoadOfKnownNullValue=LoadOfKnownNullValue|true
+detectorLockedFields=LockedFields|false
+detectorMethodReturnCheck=MethodReturnCheck|true
+detectorMethods=Methods|true
+detectorMultithreadedInstanceAccess=MultithreadedInstanceAccess|true
+detectorMutableLock=MutableLock|true
+detectorMutableStaticFields=MutableStaticFields|true
+detectorNaming=Naming|true
+detectorNoteAnnotationRetention=NoteAnnotationRetention|true
+detectorNoteCheckReturnValue=NoteCheckReturnValue|true
+detectorNoteCheckReturnValueAnnotations=NoteCheckReturnValueAnnotations|true
+detectorNoteDirectlyRelevantTypeQualifiers=NoteDirectlyRelevantTypeQualifiers|true
+detectorNoteJCIPAnnotation=NoteJCIPAnnotation|true
+detectorNoteNonNullAnnotations=NoteNonNullAnnotations|true
+detectorNoteNonnullReturnValues=NoteNonnullReturnValues|true
+detectorNoteSuppressedWarnings=NoteSuppressedWarnings|true
+detectorNoteUnconditionalParamDerefs=NoteUnconditionalParamDerefs|true
+detectorNumberConstructor=NumberConstructor|true
+detectorOverridingEqualsNotSymmetrical=OverridingEqualsNotSymmetrical|true
+detectorPreferZeroLengthArrays=PreferZeroLengthArrays|true
+detectorPublicSemaphores=PublicSemaphores|true
+detectorQuestionableBooleanAssignment=QuestionableBooleanAssignment|true
+detectorReadReturnShouldBeChecked=ReadReturnShouldBeChecked|true
+detectorRedundantInterfaces=RedundantInterfaces|true
+detectorReflectiveClasses=ReflectiveClasses|true
+detectorResolveAllReferences=ResolveAllReferences|false
+detectorRuntimeExceptionCapture=RuntimeExceptionCapture|true
+detectorSerializableIdiom=SerializableIdiom|true
+detectorStartInConstructor=StartInConstructor|true
+detectorStaticCalendarDetector=StaticCalendarDetector|true
+detectorStringConcatenation=StringConcatenation|true
+detectorSuperfluousInstanceOf=SuperfluousInstanceOf|true
+detectorSuspiciousThreadInterrupted=SuspiciousThreadInterrupted|true
+detectorSwitchFallthrough=SwitchFallthrough|true
+detectorSynchronizationOnSharedBuiltinConstant=SynchronizationOnSharedBuiltinConstant|true
+detectorSynchronizeAndNullCheckField=SynchronizeAndNullCheckField|true
+detectorSynchronizeOnClassLiteralNotGetClass=SynchronizeOnClassLiteralNotGetClass|true
+detectorSynchronizingOnContentsOfFieldToProtectField=SynchronizingOnContentsOfFieldToProtectField|true
+detectorTestASM=TestASM|false
+detectorTestDataflowAnalysis=TestDataflowAnalysis|false
+detectorTestingGround=TestingGround|false
+detectorTrainFieldStoreTypes=TrainFieldStoreTypes|true
+detectorTrainNonNullAnnotations=TrainNonNullAnnotations|true
+detectorTrainUnconditionalDerefParams=TrainUnconditionalDerefParams|true
+detectorURLProblems=URLProblems|true
+detectorUncallableMethodOfAnonymousClass=UncallableMethodOfAnonymousClass|true
+detectorUnnecessaryMath=UnnecessaryMath|true
+detectorUnreadFields=UnreadFields|true
+detectorUseObjectEquals=UseObjectEquals|true
+detectorUselessSubclassMethod=UselessSubclassMethod|true
+detectorVarArgsProblems=VarArgsProblems|true
+detectorVolatileUsage=VolatileUsage|true
+detectorWaitInLoop=WaitInLoop|true
+detectorWrongMapIterator=WrongMapIterator|true
+detectorXMLFactoryBypass=XMLFactoryBypass|true
+detector_threshold=3
+effort=max
+filter_settings=Low|BAD_PRACTICE,CORRECTNESS,I18N,MALICIOUS_CODE,MT_CORRECTNESS,PERFORMANCE,SECURITY,STYLE|false
+filter_settings_neg=|
diff --git a/org.eclipse.m2e.core/.gitignore b/org.eclipse.m2e.core/.gitignore
new file mode 100644
index 00000000..4dc00917
--- /dev/null
+++ b/org.eclipse.m2e.core/.gitignore
@@ -0,0 +1,2 @@
+/target
+/bin
diff --git a/org.eclipse.m2e.core/.options b/org.eclipse.m2e.core/.options
new file mode 100644
index 00000000..9c79ceb9
--- /dev/null
+++ b/org.eclipse.m2e.core/.options
@@ -0,0 +1,29 @@
+# Debugging options for the org.eclipse.m2e plugin.
+
+# Turn on debugging for the org.eclipse.m2e plugin.
+org.eclipse.m2e/debug=false
+
+# Plugin initialization
+org.eclipse.m2e/debug/initialization=false
+
+# Maven builder
+org.eclipse.m2e/debug/builder=false
+
+# Maven project facade
+org.eclipse.m2e/debug/projectManager=false
+
+
+# legacy options
+
+# plugin
+org.eclipse.m2e/plugin=false
+
+# launcher activity
+org.eclipse.m2e/launcher=false
+
+# actions activity
+org.eclipse.m2e/actions=false
+
+# console activity
+org.eclipse.m2e/console=false
+
diff --git a/org.eclipse.m2e.core/.project b/org.eclipse.m2e.core/.project
new file mode 100644
index 00000000..efc103df
--- /dev/null
+++ b/org.eclipse.m2e.core/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.core</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.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.core/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..f11a2c0a
--- /dev/null
+++ b/org.eclipse.m2e.core/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,359 @@
+#Thu Feb 04 10:56:12 EST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,HIGH
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=2
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=1
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=2
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/org.eclipse.m2e.core/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.m2e.core/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000..fb3a058c
--- /dev/null
+++ b/org.eclipse.m2e.core/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,14 @@
+#Tue Nov 30 18:50:43 EST 2010
+eclipse.preferences.version=1
+formatter_profile=_m2 plugin
+formatter_settings_version=11
+org.eclipse.jdt.ui.exception.name=ex
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;org.w3c;org.xml;org.apache;com;junit;org.eclipse;org.codehaus;org.apache.lucene;org.apache.maven;org.sonatype;org.eclipse.m2e;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.keywordthis=true
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=false
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return Returns the ${bare_field_name}.\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} The ${bare_field_name} to set.\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************&\#13;\n * Copyright (c) 2010 Sonatype, Inc.&\#13;\n * All rights reserved. This program and the accompanying materials&\#13;\n * are made available under the terms of the Eclipse Public License v1.0&\#13;\n * which accompanies this distribution, and is available at&\#13;\n * http\://www.eclipse.org/legal/epl-v10.html&\#13;\n *&\#13;\n * Contributors\:&\#13;\n * Sonatype, Inc. - initial API and implementation&\#13;\n *******************************************************************************/</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * ${type_name}\n *\n * @author ${user}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\nMavenLogger.log(${exception_var});</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method ${enclosing_method}\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\nMavenLogger.log(${exception_var});</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/org.eclipse.m2e.core/.settings/org.eclipse.mylar.tasklist.prefs b/org.eclipse.m2e.core/.settings/org.eclipse.mylar.tasklist.prefs
new file mode 100644
index 00000000..7bf437fe
--- /dev/null
+++ b/org.eclipse.m2e.core/.settings/org.eclipse.mylar.tasklist.prefs
@@ -0,0 +1,4 @@
+#Wed Nov 29 23:26:43 EST 2006
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
diff --git a/org.eclipse.m2e.core/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.m2e.core/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 00000000..221818e3
--- /dev/null
+++ b/org.eclipse.m2e.core/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Thu Aug 28 19:38:53 EDT 2008
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
diff --git a/org.eclipse.m2e.core/.settings/org.eclipse.mylyn.team.ui.prefs b/org.eclipse.m2e.core/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 00000000..a6f9c61e
--- /dev/null
+++ b/org.eclipse.m2e.core/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Sat Nov 17 11:49:52 EST 2007
+commit.comment.template=${task.key}\: ${task.description}
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.core/.settings/org.eclipse.pde.core.prefs b/org.eclipse.m2e.core/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 00000000..da324b13
--- /dev/null
+++ b/org.eclipse.m2e.core/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+#Fri Oct 26 19:41:18 EDT 2007
+eclipse.preferences.version=1
+resolve.requirebundle=false
diff --git a/org.eclipse.m2e.core/.settings/org.eclipse.pde.prefs b/org.eclipse.m2e.core/.settings/org.eclipse.pde.prefs
new file mode 100644
index 00000000..94ae750a
--- /dev/null
+++ b/org.eclipse.m2e.core/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,23 @@
+#Sat Jul 05 10:00:23 EDT 2008
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.deprecated=2
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.core/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.core/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..ac87b894
--- /dev/null
+++ b/org.eclipse.m2e.core/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:18 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.core/META-INF/MANIFEST.MF b/org.eclipse.m2e.core/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..09f4a8fc
--- /dev/null
+++ b/org.eclipse.m2e.core/META-INF/MANIFEST.MF
@@ -0,0 +1,54 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.m2e.core;singleton:=true
+Bundle-Version: 0.13.0.qualifier
+Bundle-Activator: org.eclipse.m2e.core.MavenPlugin
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Localization: plugin
+Require-Bundle:
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.core.variables,
+ org.eclipse.core.expressions,
+ org.eclipse.core.filesystem,
+ org.eclipse.search,
+ org.eclipse.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.console,
+ org.eclipse.ui.forms,
+ org.eclipse.m2e.maven.runtime;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.archetype.common;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.maven.indexer;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.model.edit;bundle-version="[0.13.0,0.14.0)",
+ com.ibm.icu;bundle-version="4.0.1"
+Eclipse-LazyStart: true
+Bundle-ClassPath: .
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6
+Export-Package: org.eclipse.m2e.core,
+ org.eclipse.m2e.core.actions,
+ org.eclipse.m2e.core.archetype,
+ org.eclipse.m2e.core.builder;x-internal:=true,
+ org.eclipse.m2e.core.core,
+ org.eclipse.m2e.core.embedder,
+ org.eclipse.m2e.core.index,
+ org.eclipse.m2e.core.internal;x-friends:="org.eclipse.m2e.core.tests,org.eclipse.m2e.jdt",
+ org.eclipse.m2e.core.internal.embedder;x-friends:="org.eclipse.m2e.core.tests",
+ org.eclipse.m2e.core.internal.index;x-friends:="org.eclipse.m2e.core.tests",
+ org.eclipse.m2e.core.internal.preferences;x-friends:="org.eclipse.m2e.core.tests",
+ org.eclipse.m2e.core.internal.project;x-friends:="org.eclipse.m2e.core.tests",
+ org.eclipse.m2e.core.internal.project.registry;x-friends:="org.eclipse.m2e.core.tests",
+ org.eclipse.m2e.core.internal.repository;x-friends:="org.eclipse.m2e.core.tests",
+ org.eclipse.m2e.core.jobs,
+ org.eclipse.m2e.core.project,
+ org.eclipse.m2e.core.project.configurator,
+ org.eclipse.m2e.core.repository,
+ org.eclipse.m2e.core.scm,
+ org.eclipse.m2e.core.ui.dialogs,
+ org.eclipse.m2e.core.ui.internal.preferences;x-internal:=true,
+ org.eclipse.m2e.core.util,
+ org.eclipse.m2e.core.util.search,
+ org.eclipse.m2e.core.wizards
+MavenArtifact-GroupId: org.eclipse.m2e
+MavenArtifact-ArtifactId: org.eclipse.m2e.core
diff --git a/org.eclipse.m2e.core/about.html b/org.eclipse.m2e.core/about.html
new file mode 100644
index 00000000..70e4b67c
--- /dev/null
+++ b/org.eclipse.m2e.core/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>October 29, 2010</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/org.eclipse.m2e.core/about.ini b/org.eclipse.m2e.core/about.ini
new file mode 100644
index 00000000..3a6b91f9
--- /dev/null
+++ b/org.eclipse.m2e.core/about.ini
@@ -0,0 +1,17 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=m2eclipse.gif
+
+# Property "appName" contains name of the application (translated)
+appName=%featureName
+
+# Property "welcomePage" contains path to welcome page (special XML-based format)
+# welcomePage=$nl$/welcome.xml
diff --git a/org.eclipse.m2e.core/build.properties b/org.eclipse.m2e.core/build.properties
new file mode 100644
index 00000000..b41d4080
--- /dev/null
+++ b/org.eclipse.m2e.core/build.properties
@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2008-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
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
+bin.includes = plugin.xml,\
+ META-INF/,\
+ about.ini,\
+ plugin.properties,\
+ .options,\
+ icons/,\
+ m2eclipse.gif,\
+ .,\
+ intro/,\
+ schema/,\
+ about.html
+jars.compile.order = .
+output.. = target/classes
+source.. = src/
diff --git a/org.eclipse.m2e.core/icons/add_index.gif b/org.eclipse.m2e.core/icons/add_index.gif
new file mode 100644
index 00000000..33f47317
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/add_index.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/clear.gif b/org.eclipse.m2e.core/icons/clear.gif
new file mode 100644
index 00000000..2cd9c544
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/clear.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/clear_disabled.gif b/org.eclipse.m2e.core/icons/clear_disabled.gif
new file mode 100644
index 00000000..559e4629
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/clear_disabled.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/close.gif b/org.eclipse.m2e.core/icons/close.gif
new file mode 100644
index 00000000..2cd9c544
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/close.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/collapseall.gif b/org.eclipse.m2e.core/icons/collapseall.gif
new file mode 100644
index 00000000..a2d80a90
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/collapseall.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/copy.gif b/org.eclipse.m2e.core/icons/copy.gif
new file mode 100644
index 00000000..6d0dd17d
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/copy.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/debug.gif b/org.eclipse.m2e.core/icons/debug.gif
new file mode 100644
index 00000000..518e8660
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/debug.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/import_jar.gif b/org.eclipse.m2e.core/icons/import_jar.gif
new file mode 100644
index 00000000..da5afb91
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/import_jar.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/import_m2_project.gif b/org.eclipse.m2e.core/icons/import_m2_project.gif
new file mode 100644
index 00000000..4edf66db
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/import_m2_project.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/import_project.png b/org.eclipse.m2e.core/icons/import_project.png
new file mode 100644
index 00000000..3a5f3ac6
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/import_project.png
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/jar_obj.gif b/org.eclipse.m2e.core/icons/jar_obj.gif
new file mode 100644
index 00000000..2fa1d777
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/jar_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/jar_src_version.gif b/org.eclipse.m2e.core/icons/jar_src_version.gif
new file mode 100644
index 00000000..26c73738
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/jar_src_version.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/jar_version.gif b/org.eclipse.m2e.core/icons/jar_version.gif
new file mode 100644
index 00000000..908dda8b
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/jar_version.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/java_obj.gif b/org.eclipse.m2e.core/icons/java_obj.gif
new file mode 100644
index 00000000..9a1797d2
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/java_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/java_src_obj.gif b/org.eclipse.m2e.core/icons/java_src_obj.gif
new file mode 100644
index 00000000..307954d2
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/java_src_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/lock_ovr.gif b/org.eclipse.m2e.core/icons/lock_ovr.gif
new file mode 100644
index 00000000..c1facbbe
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/lock_ovr.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/m2.gif b/org.eclipse.m2e.core/icons/m2.gif
new file mode 100644
index 00000000..4b0c0589
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/m2.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/m2eclipse48.gif b/org.eclipse.m2e.core/icons/m2eclipse48.gif
new file mode 100644
index 00000000..84090bc0
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/m2eclipse48.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/main_tab.gif b/org.eclipse.m2e.core/icons/main_tab.gif
new file mode 100644
index 00000000..9b9f79a6
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/main_tab.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/maven_index.gif b/org.eclipse.m2e.core/icons/maven_index.gif
new file mode 100644
index 00000000..6645b64a
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/maven_index.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/maven_indexes.gif b/org.eclipse.m2e.core/icons/maven_indexes.gif
new file mode 100644
index 00000000..c288bfae
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/maven_indexes.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/mjar.gif b/org.eclipse.m2e.core/icons/mjar.gif
new file mode 100644
index 00000000..d6b14677
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/mjar.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/mlabel.gif b/org.eclipse.m2e.core/icons/mlabel.gif
new file mode 100644
index 00000000..b801751b
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/mlabel.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/new_m2_pom.gif b/org.eclipse.m2e.core/icons/new_m2_pom.gif
new file mode 100644
index 00000000..05bab80d
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/new_m2_pom.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/new_m2_project.gif b/org.eclipse.m2e.core/icons/new_m2_project.gif
new file mode 100644
index 00000000..ba5c27b8
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/new_m2_project.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/new_m2_project_wizard.gif b/org.eclipse.m2e.core/icons/new_m2_project_wizard.gif
new file mode 100644
index 00000000..8f18a52b
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/new_m2_project_wizard.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/open_pom.gif b/org.eclipse.m2e.core/icons/open_pom.gif
new file mode 100644
index 00000000..e74037b4
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/open_pom.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/pom_obj.gif b/org.eclipse.m2e.core/icons/pom_obj.gif
new file mode 100644
index 00000000..aa4c32cd
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/pom_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/rebuild_index.gif b/org.eclipse.m2e.core/icons/rebuild_index.gif
new file mode 100644
index 00000000..164abc7b
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/rebuild_index.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/refresh.gif b/org.eclipse.m2e.core/icons/refresh.gif
new file mode 100644
index 00000000..3ca04d06
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/refresh.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/stderr.gif b/org.eclipse.m2e.core/icons/stderr.gif
new file mode 100644
index 00000000..27e7c9dd
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/stderr.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/stdout.gif b/org.eclipse.m2e.core/icons/stdout.gif
new file mode 100644
index 00000000..43d51bc0
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/stdout.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/update_dependencies.gif b/org.eclipse.m2e.core/icons/update_dependencies.gif
new file mode 100644
index 00000000..f760cd32
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/update_dependencies.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/update_index.gif b/org.eclipse.m2e.core/icons/update_index.gif
new file mode 100644
index 00000000..0bdecce8
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/update_index.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/update_source_folders.gif b/org.eclipse.m2e.core/icons/update_source_folders.gif
new file mode 100644
index 00000000..75663483
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/update_source_folders.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/icons/web.gif b/org.eclipse.m2e.core/icons/web.gif
new file mode 100644
index 00000000..09f609d6
--- /dev/null
+++ b/org.eclipse.m2e.core/icons/web.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/intro/css/overview.css b/org.eclipse.m2e.core/intro/css/overview.css
new file mode 100644
index 00000000..66df774c
--- /dev/null
+++ b/org.eclipse.m2e.core/intro/css/overview.css
@@ -0,0 +1,9 @@
+
+a#m2eclipse-overview img {
+ background-image: url(../../icons/m2eclipse48.gif);
+}
+
+a#m2eclipse-overview:hover img {
+ background-image: url(../../icons/m2eclipse48.gif);
+}
+
diff --git a/org.eclipse.m2e.core/intro/css/whatsnew.css b/org.eclipse.m2e.core/intro/css/whatsnew.css
new file mode 100644
index 00000000..d4c06d3d
--- /dev/null
+++ b/org.eclipse.m2e.core/intro/css/whatsnew.css
@@ -0,0 +1,9 @@
+
+a#m2eclipse-noteworthy img {
+ background-image: url(../../icons/m2eclipse48.gif);
+}
+
+a#m2eclipse-noteworthy:hover img {
+ background-image: url(../../icons/m2eclipse48.gif);
+}
+
diff --git a/org.eclipse.m2e.core/intro/overview.xml b/org.eclipse.m2e.core/intro/overview.xml
new file mode 100644
index 00000000..7ef3072c
--- /dev/null
+++ b/org.eclipse.m2e.core/intro/overview.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<introContent>
+ <extensionContent id="org.eclipse.m2e" name="Maven Integration for Eclipse"
+ style="css/overview.css" path="overview/@">
+ <group id="content-group" style-id="content-group">
+ <link id="m2eclipse-overview" style-id="content-link"
+ label="Maven Integration for Eclipse"
+ url="http://www.sonatype.com/book/reference/eclipse.html">
+ <text>See an overview of the features provided by Maven Integration for Eclipse (m2eclipse).</text>
+ </link>
+ <!--
+ url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.m2e.book&amp;class=org.eclipse.m2e.actions.ShowOwerviewAction&amp;id=org.eclipse.m2e.actions.owerview.action">
+ url="http://org.eclipse.ui.intro/showHelpTopic?id=/org.eclipse.m2e.book/book/"
+ -->
+ </group>
+ </extensionContent>
+</introContent>
diff --git a/org.eclipse.m2e.core/intro/whatsnew.xml b/org.eclipse.m2e.core/intro/whatsnew.xml
new file mode 100644
index 00000000..a19dc9f0
--- /dev/null
+++ b/org.eclipse.m2e.core/intro/whatsnew.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<introContent>
+ <extensionContent id="org.eclipse.m2e" name="Maven Integration for Eclipse"
+ style="css/whatsnew.css" path="whatsnew/@">
+ <group id="content-group" style-id="content-group">
+ <link id="m2eclipse-noteworthy" style-id="content-link"
+ label="Maven Integration for Eclipse"
+ url="http://m2eclipse.sonatype.org/new-and-noteworthy.html">
+ <text>
+ See some of the more interesting or significant changes in the
+ Maven Integration for Eclipse.
+ </text>
+ </link>
+ </group>
+ </extensionContent>
+</introContent>
diff --git a/org.eclipse.m2e.core/m2eclipse.gif b/org.eclipse.m2e.core/m2eclipse.gif
new file mode 100644
index 00000000..585a2aba
--- /dev/null
+++ b/org.eclipse.m2e.core/m2eclipse.gif
Binary files differ
diff --git a/org.eclipse.m2e.core/plugin.properties b/org.eclipse.m2e.core/plugin.properties
new file mode 100644
index 00000000..2f0a8819
--- /dev/null
+++ b/org.eclipse.m2e.core/plugin.properties
@@ -0,0 +1,111 @@
+#
+# Copyright (c) 2007, 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
+#
+
+m2.builder.name=Maven Project Builder
+m2.nature.name=Maven Nature
+
+m2.decorator.name=Maven Decorator
+m2.decorator.description=Adds an icon decoration to \
+ projects with Maven dependency management enabled.
+
+m2.decorator.version.name=Maven Version Decorator
+m2.decorator.version.description=Shows version for managed projects.
+
+m2.popup.project.label=Maven
+m2.popup.project.enable.label=Enable Maven Support
+m2.popup.project.disable.label=Disable Maven Support
+m2.popup.project.includeModules.label=Enable Nested Modules
+m2.popup.project.workspaceResolution.label=Enable Workspace Resolution
+m2.popup.project.add-dependency.label=Add Dependency
+m2.popup.project.update-sources.label=Update Source Folders
+
+m2.shortcut.open.pom=Open Maven POM
+
+m2.marker.problem.name=Maven Problem
+m2.marker.problem.pomloading.name=Maven pom Loading Problem
+m2.marker.problem.configuration.name=Maven Configuration Problem
+m2.marker.problem.dependency.name=Maven Dependency Problem
+m2.marker.problem.build.name=Maven Build Problem
+m2.marker.hint.name=Maven Problem
+
+m2.preferences.page.name=Maven
+
+m2.wizard.name=Maven
+m2.wizard.pom.name=Maven POM file
+m2.wizard.project.name=Maven Project
+
+m2.wizard.project.description=Create a Maven Project
+
+m2.wizard.import.name=Existing Maven Projects
+m2.wizard.import.description=Import Existing Maven Projects
+
+m2.wizard.materialize.name=Materialize Maven Projects
+m2.wizard.materialize.description=Materialize Maven Projects
+
+m2.wizard.module.name=Maven Module
+m2.wizard.module.description=Create a Maven module
+
+m2.editor.pom.name=Maven POM Editor
+
+m2.shortcut.addDependency=Add Maven Dependency
+m2.shortcut.addPlugin=Add Maven Plugin
+Bundle-Vendor = Sonatype, Inc.
+Bundle-Name = Maven Integration for Eclipse
+content-type.name = Maven POM XML
+checkoutaction.label = Check out as Maven Project...
+openpomaction.label = Open POM
+openpomaction.label2 = Open POM
+openpomaction.label3 = Open POM
+openpomaction.label4 = Open POM
+openprojectaction.label = Open Project Page
+openprojectaction.label2 = Open Project Page
+openprojectaction.label3 = Open Project Page
+openprojectaction.label4 = Open Project Page
+command.opentype.description = Open Maven Type
+command.adddependency.description = Add Maven Dependency
+command.addplugin.description = Add Maven Plugin
+keyword.label = maven
+page.installations.name = Installations
+page.usersettings.name = User Settings
+page.reporting.name = Problem Reporting
+page.archetypes.name = Archetypes
+wizard.checkout.name = Checkout Maven Projects from SCM
+wizard.checkout.description = Check out Maven Project from SVN
+category.general.name = General
+wizard.checkout2.name = Check out Maven Projects from SCM
+wizard.checkout2.description = Checkout Maven Project from SCM
+wizard.install.name = Install or deploy an artifact to a Maven repository
+wizard.install.description = Install or Deploy an artifact (archive) into a Maven repository
+consoleFactory.label = Maven Console
+actionSet.navigation.label = Maven Navigation
+action.openpom.label = Open Maven POM...
+action.openpom.tooltip = Open Maven POM
+action.updatedeps.label = Update All Maven Dependencies
+action.updatedeps.tooltip = Refresh Maven Models
+actionSet.maven.label = Maven
+action.adddep.label = Add Maven Dependency
+action.adddep.tooltip = Add Maven Dependency
+action.addplugin.label = Add Maven Plugin
+action.add.plugin.tooltip = Add Maven Plugin
+category.maven.name = Maven
+view.repos.name = Maven Repositories
+page.maven.name = Maven
+page.mappings.name = Lifecycle Mapping
+lifecycleMapping.custom.name = Customizable Lifecycle Mapping
+lifecycleMapping.empty.name = Empty Lifecycle Mapping
+extension-point.indexes.name = Maven Indexes
+extension-point.scmhandlers.name = SCM Handlers
+extension-point.scmhandlersui.name = SCM Handlers UI
+extension-point.archetypes.name = Maven Archetypes
+extension-point.configurators.name = Project Configurators
+extension-point.m2menu.name = m2 menu items
+extension-point.lifecyclemappings.name = Maven Lifecycle Mappings
+extension-point.mapping.proppage.name = Maven Lifecycle Mapping Property Page
+extension-point.mappingdefault.name = Default Maven Lifecycle Mappings
+extension-point.component.name = Maven Core Component Contributor
+extension-point.changed.name = mavenProjectChangedListeners \ No newline at end of file
diff --git a/org.eclipse.m2e.core/plugin.xml b/org.eclipse.m2e.core/plugin.xml
new file mode 100644
index 00000000..b49be2c6
--- /dev/null
+++ b/org.eclipse.m2e.core/plugin.xml
@@ -0,0 +1,617 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2007, 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
+-->
+<?eclipse version="3.0"?>
+<plugin>
+ <extension-point id="indexes" name="%extension-point.indexes.name" schema="schema/indexes.exsd"/>
+ <extension-point id="scmHandlers" name="%extension-point.scmhandlers.name" schema="schema/scmHandlers.exsd"/>
+ <extension-point id="scmHandlersUi" name="%extension-point.scmhandlersui.name" schema="schema/scmHandlersUi.exsd"/>
+ <extension-point id="archetypeCatalogs" name="%extension-point.archetypes.name" schema="schema/archetypes.exsd"/>
+ <extension-point id="projectConfigurators" name="%extension-point.configurators.name" schema="schema/projectConfigurators.exsd"/>
+ <extension-point id="m2menu" name="%extension-point.m2menu.name" schema="schema/m2menu.exsd"/>
+ <extension-point id="lifecycleMappings" name="%extension-point.lifecyclemappings.name" schema="schema/lifecycleMappings.exsd"/>
+ <extension-point id="lifecycleMappingPropertyPage" name = "%extension-point.mapping.proppage.name" schema = "schema/lifecycleMappingPropertyPage.exsd"/>
+ <extension-point id="mavenComponentContributors" name="%extension-point.component.name" schema="schema/mavenComponentContributors.exsd"/>
+ <extension-point id="mavenProjectChangedListeners" name="%extension-point.changed.name" schema="schema/mavenProjectChangedListeners.exsd"/>
+ <extension point="org.eclipse.ui.intro.configExtension">
+ <configExtension configId="org.eclipse.ui.intro.universalConfig"
+ content="intro/overview.xml"/>
+ <configExtension configId="org.eclipse.ui.intro.universalConfig"
+ content="intro/whatsnew.xml"/>
+ </extension>
+
+ <extension point="org.eclipse.core.runtime.contentTypes">
+ <content-type id="pomFile" name="%content-type.name"
+ base-type="org.eclipse.core.runtime.xml"
+ priority="normal"
+ default-charset="UTF-8"
+ file-names="pom.xml"
+ file-extensions="pom,xml">
+ <describer class="org.eclipse.m2e.core.internal.content.PomFileContentDescriber"/>
+ </content-type>
+ </extension>
+
+ <extension point="org.eclipse.core.resources.builders"
+ id="maven2Builder"
+ name="%m2.builder.name">
+ <builder hasNature="true" isConfigurable="false">
+ <run class="org.eclipse.m2e.core.internal.builder.MavenBuilder"/>
+ </builder>
+ </extension>
+ <extension point="org.eclipse.core.resources.natures"
+ id="maven2Nature"
+ name="%m2.nature.name">
+ <runtime>
+ <run class="org.eclipse.m2e.core.internal.builder.MavenNature"/>
+ </runtime>
+ <builder id="org.eclipse.m2e.core.maven2Builder"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.decorators">
+ <decorator
+ adaptable="true"
+ icon="icons/mlabel.gif"
+ id="org.eclipse.m2e.core.maven2decorator"
+ label="%m2.decorator.name"
+ lightweight="true"
+ location="TOP_LEFT"
+ state="true">
+ <description>%m2.decorator.description</description>
+ <enablement>
+ <or>
+ <objectState name="nature" value="org.eclipse.m2e.core.maven2Nature"/>
+ <!--objectState name="name" value="pom.xml"/-->
+ <objectState name="label" value="Maven Dependencies"/>
+ </or>
+ </enablement>
+ </decorator>
+
+ <decorator id="org.eclipse.m2e.core.mavenVersionDecorator"
+ adaptable="true"
+ label="%m2.decorator.version.name"
+ lightweight="false"
+ class="org.eclipse.m2e.core.ui.internal.MavenVersionDecorator"
+ state="false">
+ <description>%m2.decorator.version.description</description>
+ <enablement>
+ <or>
+ <objectState name="nature" value="org.eclipse.m2e.core.maven2Nature"/>
+ <!--objectState name="name" value="pom.xml"/-->
+ </or>
+ </enablement>
+ </decorator>
+
+ </extension>
+
+ <extension point="org.eclipse.core.runtime.adapters">
+ <factory adaptableType="org.eclipse.core.runtime.IAdaptable"
+ class="org.eclipse.m2e.core.ui.internal.MavenAdapterFactory">
+ <adapter type="org.eclipse.ui.IActionFilter"/>
+ </factory>
+ <factory adaptableType="org.eclipse.core.resources.IResource"
+ class="org.eclipse.m2e.core.internal.project.ArtifactKeyAdapterFactory">
+ <adapter type="org.eclipse.m2e.core.embedder.ArtifactKey"/>
+ </factory>
+ </extension>
+
+ <!--
+ <extension point="org.eclipse.ui.actionSets">
+ <actionSet id="org.eclipse.m2e.core.actionSet" label="Maven" visible="true">
+ <action id="org.eclipse.m2e.core.mainProjectMenu.action"
+ class="org.eclipse.m2e.core.actions.MavenMenuAction"
+ label="Maven"
+ menubarPath="project/additions"
+ style="pulldown"
+ icon="icons/m2.gif">
+ <enablement>
+ <and>
+ <objectState name="open" value="true"/>
+ <objectClass name="org.eclipse.core.resources.IProject"/>
+ </and>
+ </enablement>
+ </action>
+ </actionSet>
+ </extension>
+ -->
+
+ <extension point="org.eclipse.ui.popupMenus">
+ <objectContribution id="org.eclipse.m2e.core.projectMenu"
+ objectClass="org.eclipse.core.resources.IProject"
+ adaptable="true">
+ <action id="org.eclipse.m2e.core.projectMenu.action"
+ class="org.eclipse.m2e.core.actions.MavenMenuAction"
+ label="%m2.popup.project.label"
+ style="pulldown"
+ menubarPath="additions"
+ enablesFor="+"/>
+ <visibility>
+ <and>
+ <objectState name="open" value="true"/>
+ <objectState name="nature" value="org.eclipse.m2e.core.maven2Nature"/>
+ </and>
+ </visibility>
+ </objectContribution>
+
+ <objectContribution id="org.eclipse.m2e.core.projectMenu"
+ objectClass="org.eclipse.core.resources.IProject"
+ adaptable="true">
+ <action id="org.eclipse.m2e.core.projectMenu.action"
+ class="org.eclipse.m2e.core.actions.MavenMenuAction"
+ label="%m2.popup.project.label"
+ style="pulldown"
+ menubarPath="additions"
+ enablesFor="+"/>
+ <visibility>
+ <and>
+ <objectState name="open" value="true"/>
+ <not>
+ <objectState name="nature" value="org.eclipse.m2e.core.maven2Nature"/>
+ </not>
+ </and>
+ </visibility>
+ </objectContribution>
+
+ <objectContribution id="org.eclipse.m2e.core.fileMenu"
+ objectClass="org.eclipse.core.resources.IFile"
+ adaptable="true">
+ <action id="org.eclipse.m2e.core.fileMenu.action"
+ class="org.eclipse.m2e.core.actions.MavenMenuAction"
+ label="%m2.popup.project.label"
+ style="pulldown"
+ menubarPath="additions"
+ enablesFor="1"/>
+ <visibility>
+ <objectState name="name" value="pom.xml"/>
+ </visibility>
+ </objectContribution>
+
+ <objectContribution id="org.eclipse.m2e.core.workingSetMenu" adaptable="true"
+ objectClass="org.eclipse.ui.IWorkingSet">
+ <action id="org.eclipse.m2e.core.workingSetMenu.action"
+ class="org.eclipse.m2e.core.actions.MavenMenuAction"
+ label="%m2.popup.project.label"
+ style="pulldown"
+ menubarPath="additions"
+ enablesFor="+"/>
+ </objectContribution>
+
+ <objectContribution id="org.eclipse.m2e.core.scmUrl"
+ objectClass="org.eclipse.m2e.core.scm.ScmUrl"
+ adaptable="true">
+ <action id="org.eclipse.m2e.core.ui.checkoutAsMaven"
+ label="%checkoutaction.label"
+ class="org.eclipse.m2e.core.actions.CheckoutAsMavenAction"
+ menubarPath="checkoutGroup"/>
+ </objectContribution>
+
+ <objectContribution id="org.eclipse.m2e.core.openPomArtifact"
+ objectClass="org.apache.maven.artifact.Artifact"
+ adaptable="false">
+ <action id="org.eclipse.m2e.core.ui.openPomArtifact"
+ class="org.eclipse.m2e.core.actions.OpenPomAction"
+ label="%openpomaction.label"
+ enablesFor="1"/>
+ </objectContribution>
+ <objectContribution id="org.eclipse.m2e.core.openPomDependencyNode"
+ objectClass="org.apache.maven.shared.dependency.tree.DependencyNode"
+ adaptable="false">
+ <action id="org.eclipse.m2e.core.ui.openPomDependency"
+ class="org.eclipse.m2e.core.actions.OpenPomAction"
+ label="%openpomaction.label2"
+ enablesFor="1"/>
+ </objectContribution>
+ <objectContribution id="org.eclipse.m2e.core.openAetherPomDependencyNode"
+ objectClass="org.sonatype.aether.graph.DependencyNode"
+ adaptable="false">
+ <action id="org.eclipse.m2e.core.ui.openPomDependency"
+ class="org.eclipse.m2e.core.actions.OpenPomAction"
+ label="%openpomaction.label3"
+ enablesFor="1"/>
+ </objectContribution>
+ <objectContribution id="org.eclipse.m2e.core.openPomDependency"
+ objectClass="org.eclipse.m2e.model.edit.pom.Dependency"
+ adaptable="false">
+ <action id="org.eclipse.m2e.core.ui.openPomDependency"
+ class="org.eclipse.m2e.core.actions.OpenPomAction"
+ label="%openpomaction.label4"
+ enablesFor="1"/>
+ </objectContribution>
+
+ <objectContribution id="org.eclipse.m2e.core.openProjectPageArtifact"
+ objectClass="org.apache.maven.artifact.Artifact"
+ adaptable="false">
+ <action id="org.eclipse.m2e.core.ui.openPomArtifactUrl"
+ class="org.eclipse.m2e.core.actions.OpenUrlAction:org.eclipse.m2e.core.openProjectPage"
+ label="%openprojectaction.label"
+ enablesFor="1"/>
+ </objectContribution>
+ <objectContribution id="org.eclipse.m2e.core.openProjectPageDependencyNode"
+ objectClass="org.apache.maven.shared.dependency.tree.DependencyNode"
+ adaptable="false">
+ <action id="org.eclipse.m2e.core.ui.openPomDependencyUrl"
+ class="org.eclipse.m2e.core.actions.OpenUrlAction:org.eclipse.m2e.core.openProjectPage"
+ label="%openprojectaction.label2"
+ enablesFor="1"/>
+ </objectContribution>
+ <objectContribution id="org.eclipse.m2e.core.openAetherProjectPageDependencyNode"
+ objectClass="org.sonatype.aether.graph.DependencyNode"
+ adaptable="false">
+ <action id="org.eclipse.m2e.core.ui.openPomDependencyUrl"
+ class="org.eclipse.m2e.core.actions.OpenUrlAction:org.eclipse.m2e.core.openProjectPage"
+ label="%openprojectaction.label3"
+ enablesFor="1"/>
+ </objectContribution>
+ <objectContribution id="org.eclipse.m2e.core.openopenProjectPageDependency"
+ objectClass="org.eclipse.m2e.model.edit.pom.Dependency"
+ adaptable="false">
+ <action id="org.eclipse.m2e.core.ui.openPomArtifactUrl"
+ class="org.eclipse.m2e.core.actions.OpenUrlAction:org.eclipse.m2e.core.openProjectPage"
+ label="%openprojectaction.label4"
+ enablesFor="1"/>
+ </objectContribution>
+
+ </extension>
+
+ <extension point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ id="org.eclipse.m2e.core.MavenPropertyTester"
+ class="org.eclipse.m2e.core.actions.MavenPropertyTester"
+ namespace="org.eclipse.m2e"
+ properties="launchable"
+ type="org.eclipse.core.runtime.IAdaptable"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.commands">
+ <command id="org.eclipse.m2e.core.ui.command.openPom"
+ categoryId="org.eclipse.ui.category.navigate"
+ name="%m2.shortcut.open.pom"/>
+ <command
+ categoryId="org.eclipse.ui.category.edit"
+ description="%command.adddependency.description"
+ id="org.eclipse.m2e.core.ui.command.addDependency"
+ name="%m2.shortcut.addDependency">
+ </command>
+ <command
+ categoryId="org.eclipse.ui.category.edit"
+ description="%command.addplugin.description"
+ id="org.eclipse.m2e.core.ui.command.addPlugin"
+ name="%m2.shortcut.addPlugin">
+ </command>
+ </extension>
+
+ <extension point="org.eclipse.core.resources.markers"
+ id="maven2Problem"
+ name="%m2.marker.problem.name">
+ <super type="org.eclipse.core.resources.problemmarker"/>
+ <persistent value="true"/>
+ </extension>
+ <extension point="org.eclipse.core.resources.markers"
+ id="maven2Problem.configuration"
+ name="%m2.marker.problem.configuration.name">
+ <super type="org.eclipse.m2e.core.maven2Problem"/>
+ <persistent value="true"/>
+ </extension>
+ <extension point="org.eclipse.core.resources.markers"
+ id="maven2Problem.pomloading"
+ name="%m2.marker.problem.pomloading.name">
+ <super type="org.eclipse.m2e.core.maven2Problem"/>
+ <persistent value="true"/>
+ </extension>
+ <extension point="org.eclipse.core.resources.markers"
+ id="maven2Problem.dependency"
+ name="%m2.marker.problem.dependency.name">
+ <super type="org.eclipse.m2e.core.maven2Problem"/>
+ <persistent value="true"/>
+ </extension>
+ <extension point="org.eclipse.core.resources.markers"
+ id="maven2Problem.build"
+ name="%m2.marker.problem.build.name">
+ <super type="org.eclipse.m2e.core.maven2Problem"/>
+ <persistent value="true"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.keywords">
+ <keyword id="org.eclipse.m2e.core.maven" label="%keyword.label"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.preferencePages">
+ <page id="org.eclipse.m2e.core.preferences.Maven2PreferencePage"
+ class="org.eclipse.m2e.core.ui.internal.preferences.MavenPreferencePage"
+ name="%m2.preferences.page.name">
+ <keywordReference id="org.eclipse.m2e.core.maven"/>
+ </page>
+ <page id="org.eclipse.m2e.core.preferences.MavenInstallationsPreferencePage"
+ category="org.eclipse.m2e.core.preferences.Maven2PreferencePage"
+ class="org.eclipse.m2e.core.ui.internal.preferences.MavenInstallationsPreferencePage"
+ name="%page.installations.name">
+ <keywordReference id="org.eclipse.m2e.core.maven"/>
+ </page>
+ <page id="org.eclipse.m2e.core.preferences.MavenSettingsPreferencePage"
+ category="org.eclipse.m2e.core.preferences.Maven2PreferencePage"
+ class="org.eclipse.m2e.core.ui.internal.preferences.MavenSettingsPreferencePage"
+ name="%page.usersettings.name">
+ <keywordReference id="org.eclipse.m2e.core.maven"/>
+ </page>
+ <page id="org.eclipse.m2e.core.preferences.ProblemReportingPreferencePage"
+ category="org.eclipse.m2e.core.preferences.Maven2PreferencePage"
+ class="org.eclipse.m2e.core.ui.internal.preferences.ProblemReportingPreferencePage"
+ name="%page.reporting.name">
+ <keywordReference id="org.eclipse.m2e.core.maven"/>
+ </page>
+ <page id="org.eclipse.m2e.core.preferences.MavenArchetypesPreferencePage"
+ category="org.eclipse.m2e.core.preferences.Maven2PreferencePage"
+ class="org.eclipse.m2e.core.ui.internal.preferences.MavenArchetypesPreferencePage"
+ name="%page.archetypes.name">
+ <keywordReference id="org.eclipse.m2e.core.maven"/>
+ </page>
+ </extension>
+
+ <extension point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.eclipse.m2e.core.internal.preferences.MavenPreferenceInitializer"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <category id="org.eclipse.m2e" name="%m2.wizard.name"/>
+
+ <wizard id="org.eclipse.m2e.core.wizards.Maven2PomWizard"
+ category="org.eclipse.m2e"
+ class="org.eclipse.m2e.core.wizards.MavenPomWizard"
+ icon="icons/new_m2_pom.gif"
+ name="%m2.wizard.pom.name">
+ <selection class="org.eclipse.core.resources.IProject"/>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+
+ <wizard id="org.eclipse.m2e.core.wizards.Maven2ProjectWizard"
+ category="org.eclipse.m2e"
+ class="org.eclipse.m2e.core.wizards.MavenProjectWizard"
+ icon="icons/new_m2_project.gif"
+ name="%m2.wizard.project.name"
+ project="true">
+ <description>%m2.wizard.project.description</description>
+ </wizard>
+
+ <wizard id="org.eclipse.m2e.core.wizards.Maven2ModuleWizard"
+ category="org.eclipse.m2e"
+ class="org.eclipse.m2e.core.wizards.MavenModuleWizard"
+ icon="icons/new_m2_project.gif"
+ name="%m2.wizard.module.name"
+ project="true">
+ <description>%m2.wizard.module.description</description>
+ </wizard>
+
+ <wizard id="org.eclipse.m2e.core.wizards.MavenCheckoutWizard"
+ name="%wizard.checkout.name"
+ class="org.eclipse.m2e.core.wizards.MavenCheckoutWizard"
+ category="org.eclipse.m2e"
+ icon="icons/import_m2_project.gif" project="true">
+ <description>%wizard.checkout.description</description>
+ <!--
+ <selection class="org.tigris.subversion.subclipse.core.ISVNRemoteFolder"/>
+ -->
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.importWizards">
+ <category id="org.eclipse.ui.Basic" name="%category.general.name"/>
+ <category id="org.eclipse.m2e" name="%m2.wizard.name"/>
+
+ <wizard id="org.eclipse.m2e.core.wizards.MavenPomCheckoutWizard"
+ class="org.eclipse.m2e.core.wizards.MavenMaterializePomWizard"
+ category="org.eclipse.m2e"
+ name="%m2.wizard.materialize.name"
+ icon="icons/import_m2_project.gif">
+ <description>%m2.wizard.materialize.description</description>
+ </wizard>
+
+ <wizard id="org.eclipse.m2e.core.wizards.MavenCheckoutWizard"
+ class="org.eclipse.m2e.core.wizards.MavenCheckoutWizard"
+ category="org.eclipse.m2e"
+ name="%wizard.checkout2.name"
+ icon="icons/import_m2_project.gif">
+ <description>%wizard.checkout2.description</description>
+ <!--
+ <selection class="org.tigris.subversion.subclipse.core.ISVNRemoteFolder"/>
+ -->
+ </wizard>
+
+ <wizard id="org.eclipse.m2e.core.wizards.MavenInstallFileWizard"
+ class="org.eclipse.m2e.core.wizards.MavenInstallFileWizard"
+ category="org.eclipse.m2e"
+ icon="icons/import_jar.gif"
+ name="%wizard.install.name">
+ <selection class="org.eclipse.core.resources.IFile" name="*.jar"/>
+ <description>%wizard.install.description</description>
+ </wizard>
+
+ <wizard id="org.eclipse.m2e.core.wizards.Maven2ImportWizard"
+ class="org.eclipse.m2e.core.wizards.MavenImportWizard"
+ icon="icons/import_m2_project.gif"
+ category="org.eclipse.m2e"
+ name="%m2.wizard.import.name">
+ <description>%m2.wizard.import.description</description>
+ </wizard>
+
+ </extension>
+
+ <extension point="org.eclipse.ui.console.consoleFactories">
+ <consoleFactory label="%consoleFactory.label" icon="icons/m2.gif"
+ class="org.eclipse.m2e.core.ui.internal.MavenConsoleFactory"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.console.consolePageParticipants">
+ <consolePageParticipant
+ class="org.eclipse.m2e.core.ui.internal.MavenConsolePageParticipant"
+ id="org.eclipse.m2e.core.launch.console.Maven2ConsolePageParticipant">
+ <enablement>
+ <instanceof value="org.eclipse.m2e.core.internal.console.MavenConsoleImpl"/>
+ </enablement>
+ </consolePageParticipant>
+ </extension>
+
+ <extension point="org.eclipse.ui.actionSets">
+ <actionSet id="org.eclipse.m2e.core.ui.navigation"
+ label="%actionSet.navigation.label" visible="true">
+ <action
+ class="org.eclipse.m2e.core.actions.OpenPomAction:artifact"
+ definitionId="org.eclipse.m2e.core.ui.command.openPom"
+ icon="icons/open_pom.gif"
+ id="org.eclipse.m2e.core.ui.open.pom"
+ label="%action.openpom.label"
+ menubarPath="navigate/open.ext"
+ style="push"
+ tooltip="%action.openpom.tooltip"/>
+ <action
+ class="org.eclipse.m2e.core.actions.RefreshMavenModelsAction"
+ icon="icons/update_dependencies.gif"
+ id="org.eclipse.m2e.core.actions.RefreshModels"
+ label="%action.updatedeps.label"
+ menubarPath="project/additions"
+ tooltip="%action.updatedeps.tooltip">
+ </action>
+ </actionSet>
+
+ <actionSet
+ id="org.eclipse.m2e.core.actions.maven"
+ label="%actionSet.maven.label"
+ visible="true">
+ <action
+ class="org.eclipse.m2e.core.actions.AddDependencyAction"
+ definitionId="org.eclipse.m2e.core.ui.command.addDependency"
+ icon="icons/open_pom.gif"
+ id="org.eclipse.m2e.core.actions.add.dependency"
+ label="%action.adddep.label"
+ menubarPath="navigate/open.ext"
+ style="push"
+ tooltip="%action.adddep.tooltip">
+ </action>
+ <action
+ class="org.eclipse.m2e.core.actions.AddPluginAction"
+ definitionId="org.eclipse.m2e.core.ui.command.addPlugin"
+ id="org.eclipse.m2e.core.actions.add.plugin"
+ label="%action.addplugin.label"
+ style="push"
+ tooltip="%action.add.plugin.tooltip">
+ </action>
+ </actionSet>
+ </extension>
+
+ <extension point="org.eclipse.ui.views">
+ <category id="org.eclipse.m2e.core.views.repositories"
+ name="%category.maven.name"/>
+ <view id="org.eclipse.m2e.core.views.MavenRepositoryView"
+ category="org.eclipse.m2e.core.views.repositories"
+ class="org.eclipse.m2e.core.ui.internal.views.MavenRepositoryView"
+ icon="icons/maven_indexes.gif"
+ name="%view.repos.name"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.propertyPages">
+ <page id="org.eclipse.m2e.core.MavenProjectPreferencePage"
+ class="org.eclipse.m2e.core.ui.internal.preferences.MavenProjectPreferencePage"
+ name="%page.maven.name"
+ objectClass="org.eclipse.core.resources.IProject"
+ adaptable="true">
+ <filter name="nature" value="org.eclipse.m2e.core.maven2Nature"/>
+ </page>
+ <page id="org.eclipse.m2e.core.MavenProjectLifecycleMappingPage"
+ class="org.eclipse.m2e.core.ui.internal.preferences.MavenProjectLifecycleMappingPage"
+ name="%page.mappings.name"
+ category="org.eclipse.m2e.core.MavenProjectPreferencePage"
+ objectClass="org.eclipse.core.resources.IProject"
+ adaptable="true">
+ <filter name="nature" value="org.eclipse.m2e.core.maven2Nature"/>
+ </page>
+ </extension>
+
+ <extension
+ point="org.eclipse.m2e.core.lifecycleMappingPropertyPage">
+ <lifecycleMappingPropertyPage
+ class="org.eclipse.m2e.core.ui.internal.preferences.EmptyLifecycleMappingPropertyPage"
+ id = "emptyPropertyPage"
+ lifecycleMappingId = "NULL"
+ name = "Empty Lifecycle Mapping">
+ </lifecycleMappingPropertyPage>
+ <lifecycleMappingPropertyPage
+ class="org.eclipse.m2e.core.ui.internal.preferences.CustomizableLifecycleMappingPropertyPage"
+ id = "customizablePropertyPage"
+ lifecycleMappingId = "customizable"
+ name = "Customizable Lifecycle Mapping">
+ </lifecycleMappingPropertyPage>
+ <lifecycleMappingPropertyPage
+ class="org.eclipse.m2e.core.ui.internal.preferences.MissingLifecycleMappingPropertyPage"
+ id="missingLifecycleMappingPropertyPage"
+ lifecycleMappingId="MISSING"
+ name="Missing Lifecycle Mapping">
+ </lifecycleMappingPropertyPage>
+ </extension>
+
+ <extension
+ point="org.eclipse.m2e.core.lifecycleMappings">
+ <lifecycleMapping
+ class="org.eclipse.m2e.core.project.configurator.CustomizableLifecycleMapping"
+ id="customizable"
+ name="%lifecycleMapping.custom.name">
+ </lifecycleMapping>
+ <lifecycleMapping
+ class="org.eclipse.m2e.core.project.configurator.NoopLifecycleMapping"
+ id="NULL"
+ name="%lifecycleMapping.empty.name">
+ </lifecycleMapping>
+ </extension>
+ <extension
+ point="org.eclipse.m2e.core.mavenComponentContributors">
+ <configurator
+ class="org.eclipse.m2e.core.internal.embedder.DefaultMavenComponentContributor">
+ </configurator>
+ </extension>
+
+ <extension point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.eclipse.m2e.core.ui.command.addDependency"
+ contextId="org.eclipse.core.runtime.xml"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="Ctrl+Shift+D">
+ </key>
+ <key
+ commandId="org.eclipse.m2e.core.ui.command.addPlugin"
+ contextId="org.eclipse.core.runtime.xml"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="Ctrl+Shift+P">
+ </key>
+ </extension>
+
+ <!--
+ <extension point="org.eclipse.search.searchPages">
+ <page id="org.eclipse.m2e.core.MavenSearchPage"
+ class="org.eclipse.m2e.core.ui.internal.search.MavenSearchPage"
+ enabled="true"
+ label="Maven Search"/>
+ </extension>
+ <extension point="org.eclipse.search.searchResultViewPages">
+ <viewPage id="org.eclipse.m2e.core.MavenSearchResultPage"
+ class="org.eclipse.m2e.core.ui.internal.search.MavenSearchResultPage"
+ searchResultClass="org.eclipse.m2e.core.ui.internal.search.MavenSearchResult"/>
+ </extension>
+ -->
+
+ <extension
+ point="org.eclipse.m2e.core.projectConfigurators">
+ <configurator
+ class="org.eclipse.m2e.core.project.configurator.MavenResourcesProjectConfigurator"
+ id="org.eclipse.m2e.core.project.configurator.MavenResourcesProjectConfigurator"
+ name="Maven Resources Project Configurator">
+ <mojo
+ artifactId="maven-resources-plugin"
+ goals="resources,testResources"
+ groupId="org.apache.maven.plugins"
+ versionRange="[2.4,)">
+ </mojo>
+ </configurator>
+ </extension>
+</plugin>
diff --git a/org.eclipse.m2e.core/pom.xml b/org.eclipse.m2e.core/pom.xml
new file mode 100644
index 00000000..fd4cc320
--- /dev/null
+++ b/org.eclipse.m2e.core/pom.xml
@@ -0,0 +1,38 @@
+<?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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+
+ <artifactId>org.eclipse.m2e.core</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>Maven Integration for Eclipse Plug-in</name>
+
+ <build>
+ <sourceDirectory>src</sourceDirectory>
+
+ <resources>
+ <resource>
+ <directory>${basedir}/src</directory>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ </resources>
+ </build>
+
+</project>
diff --git a/org.eclipse.m2e.core/schema/archetypes.exsd b/org.eclipse.m2e.core/schema/archetypes.exsd
new file mode 100644
index 00000000..09d46cff
--- /dev/null
+++ b/org.eclipse.m2e.core/schema/archetypes.exsd
@@ -0,0 +1,141 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2e" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.m2e" id="archetypeCatalogs" name="Maven Archetype Catalogs"/>
+ </appinfo>
+ <documentation>
+ Maven Archetype Catalogs
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <choice>
+ <element ref="local"/>
+ <element ref="remote"/>
+ </choice>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="local">
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ archetype catalog file name inside plugin
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="description" type="string">
+ <annotation>
+ <documentation>
+ archetype catalog description to show in the UI
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="remote">
+ <complexType>
+ <attribute name="url" type="string" use="required">
+ <annotation>
+ <documentation>
+ location url for remote archetype catalog
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="description" type="string">
+ <annotation>
+ <documentation>
+ archetype catalog description to show in the UI
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.9.3
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2007, 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
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/org.eclipse.m2e.core/schema/indexes.exsd b/org.eclipse.m2e.core/schema/indexes.exsd
new file mode 100644
index 00000000..c660c669
--- /dev/null
+++ b/org.eclipse.m2e.core/schema/indexes.exsd
@@ -0,0 +1,153 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2e" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.m2e" id="indexes" name="Maven Indexes"/>
+ </appInfo>
+ <documentation>
+ Maven Indexes
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="index" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="index">
+ <annotation>
+ <appInfo>
+ <meta.element deprecated="true"/>
+ </appInfo>
+ <documentation>
+ This extension point is provided for backward compatibility with m2e 0.9.8 and earlier. It will be either removed completely or replaced with more flexible &quot;repositories&quot; extension point in a future m2e version.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="indexId" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="archive" type="string">
+ <annotation>
+ <documentation>
+ This attribute is ignored. m2e 0.9.9 does not suppot packaged nexus indexes.
+ </documentation>
+ <appInfo>
+ <meta.attribute deprecated="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="repositoryUrl" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="updateUrl" type="string">
+ <annotation>
+ <documentation>
+ This attribute is ignored. m2e 0.9.9 does not support nexus index repository paths.
+ </documentation>
+ <appInfo>
+ <meta.attribute deprecated="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="isShort" type="boolean">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 0.0.13
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2007, 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
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/org.eclipse.m2e.core/schema/lifecycleMappingPropertyPage.exsd b/org.eclipse.m2e.core/schema/lifecycleMappingPropertyPage.exsd
new file mode 100644
index 00000000..83c13887
--- /dev/null
+++ b/org.eclipse.m2e.core/schema/lifecycleMappingPropertyPage.exsd
@@ -0,0 +1,122 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2e" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.m2e" id="lifecycleMappingPropertyPage" name="Maven Lifecycle Mapping Property Page"/>
+ </appInfo>
+ <documentation>
+ Maven Lifecycle Mapping Property Page. This extension point connects a lifecycle mapping strategy (as defined in the lifecycleMapping extension point) with an appropriate project property page.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="lifecycleMappingPropertyPage" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="lifecycleMappingPropertyPage">
+ <complexType>
+ <attribute name="lifecycleMappingId" type="string" use="required">
+ <annotation>
+ <documentation>
+ Id of the lifecycle mapping strategy associated with this property page.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ Id of the property page.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ Name of the property page.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ The name of the class that defines the lifecycle property page. Must implement ILifecyclePropertyPage
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.m2e.lifecycle.ILifecyclePropertyPage"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 0.9.9
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ Example attribute settings: (Note: the lifecycleMappingId must be the id of the extension point defined by lifecycleMapping)
+ class="org.eclipse.m2e.ui.internal.preferences.CustomizableLifecycleMappingPropertyPage"
+ id = "customizablePropertyPage"
+ lifecycleMappingId = "customizable"
+ name = "Customizable Lifecycle Mapping"
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2007 - 2009 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
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/org.eclipse.m2e.core/schema/lifecycleMappings.exsd b/org.eclipse.m2e.core/schema/lifecycleMappings.exsd
new file mode 100644
index 00000000..8b880ad6
--- /dev/null
+++ b/org.eclipse.m2e.core/schema/lifecycleMappings.exsd
@@ -0,0 +1,200 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2e" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.m2e" id="lifecycleMappings" name="Maven Lifecycle Mappings"/>
+ </appinfo>
+ <documentation>
+ Maven Lifecycle Mappings
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="lifecycleMapping" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="lifecycleMapping">
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element ref="mojo"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Unique lifecycle mapping id
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.m2e.project.configurator.AbstractLifecycleMapping:org.eclipse.m2e.project.configurator.IExtensionLifecycleMapping"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ Human readable lifecycle mapping name
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="packaging-type" type="string">
+ <annotation>
+ <documentation>
+ Packaging type this lifecycle mapping applies to. If not specified, lifecycle mapping can only be enabled explicitly in pom.xml.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="mojo">
+ <complexType>
+ <choice>
+ <element ref="configurator"/>
+ <element ref="execute"/>
+ <element ref="ignore"/>
+ </choice>
+ <attribute name="groupId" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="artifactId" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="versionRange" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="goals" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="ignore" type="string">
+ </element>
+
+ <element name="execute" type="string">
+ </element>
+
+ <element name="configurator">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="identifier" basedOn="org.eclipse.m2e.core.projectConfigurators/configurator/@id"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.9.8
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2007, 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
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/org.eclipse.m2e.core/schema/m2menu.exsd b/org.eclipse.m2e.core/schema/m2menu.exsd
new file mode 100644
index 00000000..98135235
--- /dev/null
+++ b/org.eclipse.m2e.core/schema/m2menu.exsd
@@ -0,0 +1,122 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2e" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.m2e" id="m2menu" name="m2 menu item"/>
+ </appinfo>
+ <documentation>
+ Extension point used to add additional entries to the Maven popup menu
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ <documentation>
+ Extension point can be used to contribute additional actions to the Maven popup menu
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="factory" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="factory">
+ <annotation>
+ <documentation>
+ A menu factory used to add actions to the Maven popup menu
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ A menu factory class name
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.m2e.actions.AbstractMavenMenuCreator:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.9.6
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ See
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2007, 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
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/org.eclipse.m2e.core/schema/mavenComponentContributors.exsd b/org.eclipse.m2e.core/schema/mavenComponentContributors.exsd
new file mode 100644
index 00000000..27a308fd
--- /dev/null
+++ b/org.eclipse.m2e.core/schema/mavenComponentContributors.exsd
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2e" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.m2e" id="mavenComponentContributors" name="Maven Core Component Contributors"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="configurator"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="configurator">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.m2e.internal.embedder.IMavenComponentContributor"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/org.eclipse.m2e.core/schema/mavenProjectChangedListeners.exsd b/org.eclipse.m2e.core/schema/mavenProjectChangedListeners.exsd
new file mode 100644
index 00000000..30b825c3
--- /dev/null
+++ b/org.eclipse.m2e.core/schema/mavenProjectChangedListeners.exsd
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2e" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.m2e" id="mavenProjectChangedListeners" name="mavenProjectChangedListeners"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="listener" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="listener">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.m2e.project.IMavenProjectChangedListener"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/org.eclipse.m2e.core/schema/projectConfigurators.exsd b/org.eclipse.m2e.core/schema/projectConfigurators.exsd
new file mode 100644
index 00000000..eb7d1385
--- /dev/null
+++ b/org.eclipse.m2e.core/schema/projectConfigurators.exsd
@@ -0,0 +1,191 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2e" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.m2e" id="projectConfigurators" name="Project Configurators"/>
+ </appinfo>
+ <documentation>
+ Project Configurators
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="configurator"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="configurator">
+ <annotation>
+ <documentation>
+ Project configurator
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element ref="mojo"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Unique configurator id
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Configurator implementation
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.m2e.project.configurator.AbstractProjectConfigurator:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ Configurator name, eg. &quot;JDT&quot;, &quot;PDE&quot;, &quot;AJDT&quot;, &quot;WTP&quot;, etc.
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="priority" type="string">
+ <annotation>
+ <documentation>
+ Priority of given configurator. Smaller number correspond to higher priority, for example, &quot;10&quot; for JDT, &quot;50&quot; - PDE, AJDT and WTP. Tools that build on WTP should use priority bigger then &quot;100&quot;
+
+This attribute is considered for removal from m2e 1.0.
+ </documentation>
+ <appinfo>
+ <meta.attribute deprecated="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="mojo">
+ <annotation>
+ <documentation>
+ mojo element specifies Maven plugin goals the project configurator should be enabled for by default. Maven plugin goals are identified by groupId, artifactId of the Maven plugin, Maven plugin version range using Maven version range syntax and comma separated list of plugin goals.
+
+Project configurators without &lt;mojo/&gt; elements will require explicit enablement in lifecycle mapping configuration in pom.xml.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="groupId" type="string" use="required">
+ <annotation>
+ <documentation>
+ Maven plugin groupId
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="artifactId" type="string" use="required">
+ <annotation>
+ <documentation>
+ Maven plugin artifactId
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="versionRange" type="string" use="required">
+ <annotation>
+ <documentation>
+ Maven plugin version range
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="goals" type="string" use="required">
+ <annotation>
+ <documentation>
+ Comma separated list of Maven plugin goals
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.9.4
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2007, 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
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/org.eclipse.m2e.core/schema/scmHandlers.exsd b/org.eclipse.m2e.core/schema/scmHandlers.exsd
new file mode 100644
index 00000000..20afa37d
--- /dev/null
+++ b/org.eclipse.m2e.core/schema/scmHandlers.exsd
@@ -0,0 +1,130 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2e" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.m2e" id="scmHandlers" name="Maven SCM Handlers"/>
+ </appinfo>
+ <documentation>
+ Maven SCM Handlers
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="handler" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="handler">
+ <annotation>
+ <documentation>
+ SCM Handler
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="type" type="string" use="required">
+ <annotation>
+ <documentation>
+ Supported SCM type
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Java class name for SCM handler implementation
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.m2e.scm.ScmHandler:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="priority" type="string">
+ <annotation>
+ <documentation>
+ Numeric priority used to determine order during handler resolution
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.0.13
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiInfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2007, 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
+
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/org.eclipse.m2e.core/schema/scmHandlersUi.exsd b/org.eclipse.m2e.core/schema/scmHandlersUi.exsd
new file mode 100644
index 00000000..7bb97acb
--- /dev/null
+++ b/org.eclipse.m2e.core/schema/scmHandlersUi.exsd
@@ -0,0 +1,104 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2e" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.m2e" id="scmHandlersUi" name="SCM Handlers UI"/>
+ </appinfo>
+ <documentation>
+ Maven SCM Handlers UI
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="handlerUi"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="handlerUi">
+ <complexType>
+ <attribute name="type" type="string" use="required">
+ <annotation>
+ <documentation>
+ SCM type
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Java class name for SCM handler UI implementation
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.m2e.scm.ScmHandlerUi:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenImages.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenImages.java
new file mode 100644
index 00000000..2c58294d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenImages.java
@@ -0,0 +1,222 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.jface.viewers.DecorationOverlayIcon;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class MavenImages {
+
+ // object images
+
+ public static final Image IMG_CLEAR = createImage("clear.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_CLEAR_DISABLED = createImage("clear_disabled.gif"); //$NON-NLS-1$
+
+ public static final String PATH_JAR = "jar_obj.gif"; //$NON-NLS-1$
+
+ public static final Image IMG_JAR = createImage(PATH_JAR);
+
+ public static final String PATH_LOCK = "lock_ovr.gif"; //$NON-NLS-1$
+
+ public static final String PATH_VERSION = "jar_version.gif"; //$NON-NLS-1$
+
+ public static final Image IMG_VERSION = createImage(PATH_VERSION);
+
+ public static final String PATH_VERSION_SRC = "jar_src_version.gif"; //$NON-NLS-1$
+
+ public static final Image IMG_VERSION_SRC = createImage(PATH_VERSION_SRC);
+
+ public static final Image IMG_JAVA = createImage("java_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_JAVA_SRC = createImage("java_src_obj.gif"); //$NON-NLS-1$
+
+ // public static final Image IMG_M2 = createImage("m2.gif");
+
+ public static final Image IMG_LAUNCH_MAIN = createImage("main_tab.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_INDEX = createImage("maven_index.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_INDEXES = createImage("maven_indexes.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_MAVEN_JAR = createImage("mjar.gif"); //$NON-NLS-1$
+
+ // public static final Image IMG_JAR = createImage("mlabel.gif");
+
+ public static final Image IMG_NEW_POM = createImage("new_m2_pom.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_NEW_PROJECT = createImage("new_m2_project.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_OPEN_POM = createImage("open_pom.gif"); //$NON-NLS-1$
+
+ // public static final Image IMG_POM = createImage("pom_obj.gif");
+
+ public static final Image IMG_UPD_DEPENDENCIES = createImage("update_dependencies.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_UPD_SOURCES = createImage("update_source_folders.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_WEB = createImage("web.gif"); //$NON-NLS-1$
+
+ // wizard images
+
+ public static final ImageDescriptor WIZ_IMPORT_WIZ = createDescriptor("import_project.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor WIZ_NEW_PROJECT = createDescriptor("new_m2_project_wizard.gif"); //$NON-NLS-1$
+
+ // descriptors
+
+ public static final ImageDescriptor M2 = createDescriptor("m2.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor DEBUG = createDescriptor("debug.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor ADD_INDEX = createDescriptor("add_index.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor CLOSE = createDescriptor("close.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor COPY = createDescriptor("copy.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor COLLAPSE_ALL = createDescriptor("collapseall.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor EXPAND_ALL = createDescriptor("expandall.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor NEW_POM = createDescriptor("new_m2_pom.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor REFRESH = createDescriptor("refresh.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor UPD_INDEX = createDescriptor("update_index.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor REBUILD_INDEX = createDescriptor("rebuild_index.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor POM = createDescriptor("pom_obj.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor IMPORT_PROJECT = createDescriptor("import_m2_project.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor SHOW_CONSOLE_ERR = createDescriptor("stderr.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor SHOW_CONSOLE_OUT = createDescriptor("stdout.gif"); //$NON-NLS-1$
+
+ private static ImageDescriptor createDescriptor(String key) {
+ try {
+ ImageRegistry imageRegistry = getImageRegistry();
+ if(imageRegistry != null) {
+ ImageDescriptor imageDescriptor = imageRegistry.getDescriptor(key);
+ if(imageDescriptor==null) {
+ imageDescriptor = doCreateDescriptor(key);
+ imageRegistry.put(key, imageDescriptor);
+ }
+ return imageDescriptor;
+ }
+ } catch(Exception ex) {
+ MavenLogger.log(key, ex);
+ }
+ return null;
+ }
+
+ private static Image createImage(String key) {
+ createDescriptor(key);
+ ImageRegistry imageRegistry = getImageRegistry();
+ return imageRegistry == null ? null : imageRegistry.get(key);
+ }
+
+ private static ImageRegistry getImageRegistry() {
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ return plugin == null ? null : plugin.getImageRegistry();
+ }
+
+ private static ImageDescriptor doCreateDescriptor(String image) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(IMavenConstants.PLUGIN_ID, "icons/" + image); //$NON-NLS-1$
+ }
+
+
+
+ private static ImageDescriptor createImageDescriptor( String key, ImageData imageData )
+ {
+ try
+ {
+ ImageRegistry imageRegistry = getImageRegistry();
+ if ( imageRegistry != null )
+ {
+ ImageDescriptor imageDescriptor = imageRegistry.getDescriptor( key );
+ if ( imageDescriptor != null )
+ {
+ imageRegistry.remove( key );
+ }
+ {
+ imageDescriptor = ImageDescriptor.createFromImageData( imageData );
+ imageRegistry.put( key, imageDescriptor );
+ }
+ return imageDescriptor;
+ }
+ }
+ catch ( Exception ex )
+ {
+ MavenLogger.log(key, ex);
+ }
+ return null;
+ }
+
+ private static ImageDescriptor getOverlayImageDescriptor( String basekey, String overlaykey, int quadrant )
+ {
+ String key = basekey + overlaykey;
+ try
+ {
+ ImageRegistry imageRegistry = getImageRegistry();
+ if ( imageRegistry != null )
+ {
+ ImageDescriptor imageDescriptor = imageRegistry.getDescriptor( key );
+ if ( imageDescriptor == null )
+ {
+ ImageDescriptor base = createDescriptor( basekey );
+ ImageDescriptor overlay = createDescriptor( overlaykey );
+ if ( base == null || overlay == null )
+ {
+ MavenLogger.log( "cannot construct overlay image descriptor for " + basekey + " " + overlaykey );
+ return null;
+ }
+ imageDescriptor = createOverlayDescriptor( base, overlay, quadrant );
+ imageRegistry.put( key, imageDescriptor );
+ }
+ return imageDescriptor;
+ }
+ }
+ catch ( Exception ex )
+ {
+ MavenLogger.log(key, ex);
+ }
+ return null;
+ }
+
+ public static Image getOverlayImage( String base, String overlay, int quadrant )
+ {
+ getOverlayImageDescriptor( base, overlay, quadrant );
+ ImageRegistry imageRegistry = getImageRegistry();
+ return imageRegistry == null ? null : imageRegistry.get( base + overlay );
+ }
+
+
+ private static ImageDescriptor createOverlayDescriptor( ImageDescriptor base, ImageDescriptor overlay, int quadrant )
+ {
+ return new DecorationOverlayIcon( base.createImage(), overlay, quadrant );
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenPlugin.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenPlugin.java
new file mode 100644
index 00000000..07717168
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/MavenPlugin.java
@@ -0,0 +1,564 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Version;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.MessageDialogWithToggle;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IStartup;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.DefaultContainerConfiguration;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.MutablePlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.classworlds.ClassWorld;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+
+import org.apache.maven.archetype.Archetype;
+import org.apache.maven.archetype.common.ArchetypeArtifactManager;
+import org.apache.maven.archetype.source.ArchetypeDataSource;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.manager.WagonManager;
+import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
+import org.apache.maven.artifact.resolver.ArtifactCollector;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.index.ArtifactContextProducer;
+import org.apache.maven.index.NexusIndexer;
+import org.apache.maven.index.updater.IndexUpdater;
+import org.apache.maven.plugin.LegacySupport;
+
+import org.sonatype.aether.RepositorySystem;
+
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory;
+import org.eclipse.m2e.core.archetype.ArchetypeManager;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.embedder.MavenModelManager;
+import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.internal.ExtensionReader;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.console.MavenConsoleImpl;
+import org.eclipse.m2e.core.internal.embedder.MavenConfigurationImpl;
+import org.eclipse.m2e.core.internal.embedder.MavenEmbeddedRuntime;
+import org.eclipse.m2e.core.internal.embedder.MavenImpl;
+import org.eclipse.m2e.core.internal.embedder.MavenWorkspaceRuntime;
+import org.eclipse.m2e.core.internal.index.IndexesExtensionReader;
+import org.eclipse.m2e.core.internal.index.IndexingTransferListener;
+import org.eclipse.m2e.core.internal.index.NexusIndexManager;
+import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+import org.eclipse.m2e.core.internal.project.MavenMarkerManager;
+import org.eclipse.m2e.core.internal.project.ProjectConfigurationManager;
+import org.eclipse.m2e.core.internal.project.WorkspaceStateWriter;
+import org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager;
+import org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob;
+import org.eclipse.m2e.core.internal.repository.RepositoryRegistry;
+import org.eclipse.m2e.core.project.IMavenMarkerManager;
+import org.eclipse.m2e.core.project.IProjectConfigurationManager;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+import org.eclipse.m2e.core.repository.IRepositoryRegistry;
+import org.eclipse.m2e.core.util.search.IndexSearchEngine;
+import org.eclipse.m2e.core.util.search.SearchEngine;
+
+
+/**
+ * MavenPlugin main plug-in class.
+ */
+public class MavenPlugin extends AbstractUIPlugin implements IStartup {
+
+ // preferences
+ private static final String PREFS_ARCHETYPES = "archetypesInfo.xml"; //$NON-NLS-1$
+
+ // The shared instance
+ private static MavenPlugin plugin;
+
+ /**
+ * General purpose plexus container. Contains components from maven embedder and all other bundles visible from this
+ * bundle's classloader.
+ */
+ private MutablePlexusContainer plexus;
+
+ private MavenConsole console;
+
+ private MavenModelManager modelManager;
+
+ private NexusIndexManager indexManager;
+
+ private BundleContext bundleContext;
+
+ private MavenProjectManager projectManager;
+
+ private MavenRuntimeManager runtimeManager;
+
+ private ProjectConfigurationManager configurationManager;
+
+ private ProjectRegistryRefreshJob mavenBackgroundJob;
+
+ private ArchetypeManager archetypeManager;
+
+ private ProjectRegistryManager managerImpl;
+
+ private IMavenMarkerManager mavenMarkerManager;
+
+ private RepositoryRegistry repositoryRegistry;
+
+ private String version = "0.0.0"; //$NON-NLS-1$
+
+ private String qualifiedVersion = "0.0.0.qualifier"; //$NON-NLS-1$
+
+ private IMavenConfiguration mavenConfiguration;
+
+ private MavenImpl maven;
+
+ public MavenPlugin() {
+ plugin = this;
+
+ if(Boolean.parseBoolean(Platform.getDebugOption(IMavenConstants.PLUGIN_ID + "/debug/initialization"))) { //$NON-NLS-1$
+ System.err.println("### executing constructor " + IMavenConstants.PLUGIN_ID); //$NON-NLS-1$
+ new Throwable().printStackTrace();
+ }
+ }
+
+ public IMaven getMaven() {
+ return maven;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(final BundleContext context) throws Exception {
+ super.start(context);
+
+ if(Boolean.parseBoolean(Platform.getDebugOption(IMavenConstants.PLUGIN_ID + "/debug/initialization"))) { //$NON-NLS-1$
+ System.err.println("### executing start() " + IMavenConstants.PLUGIN_ID); //$NON-NLS-1$
+ new Throwable().printStackTrace();
+ }
+
+ this.bundleContext = context;
+
+ try {
+ this.qualifiedVersion = (String) getBundle().getHeaders().get(Constants.BUNDLE_VERSION);
+ Version bundleVersion = Version.parseVersion(this.qualifiedVersion);
+ this.version = bundleVersion.getMajor() + "." + bundleVersion.getMinor() + "." + bundleVersion.getMicro(); //$NON-NLS-1$ //$NON-NLS-2$
+ } catch(IllegalArgumentException e) {
+ // ignored
+ }
+
+ MavenLogger.setLog(getLog());
+
+ try {
+ this.console = new MavenConsoleImpl(MavenImages.M2); //$NON-NLS-1$
+ } catch(RuntimeException ex) {
+ MavenLogger.log(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, "Unable to start console: "
+ + ex.toString(), ex));
+ }
+
+ this.mavenConfiguration = new MavenConfigurationImpl(getPreferenceStore());
+
+ ClassLoader cl = MavenPlugin.class.getClassLoader();
+ ContainerConfiguration cc = new DefaultContainerConfiguration().setClassWorld(new ClassWorld("plexus.core", cl)) //$NON-NLS-1$
+ .setName("plexus"); //$NON-NLS-1$
+ this.plexus = new DefaultPlexusContainer(cc);
+
+ File stateLocationDir = getStateLocation().toFile();
+
+ // TODO this is broken, need to make it lazy, otherwise we'll deadlock or timeout... or both
+ this.archetypeManager = newArchetypeManager(stateLocationDir);
+ try {
+ this.archetypeManager.readCatalogs();
+ } catch(Exception ex) {
+ String msg = "Can't read archetype catalog configuration";
+ this.console.logError(msg + "; " + ex.getMessage()); //$NON-NLS-1$
+ MavenLogger.log(msg, ex);
+ }
+
+ this.mavenMarkerManager = new MavenMarkerManager(console, mavenConfiguration);
+
+ boolean updateProjectsOnStartup = mavenConfiguration.isUpdateProjectsOnStartup();
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////
+
+ this.maven = new MavenImpl(mavenConfiguration, console);
+
+ // TODO eagerly reads workspace state cache
+ this.managerImpl = new ProjectRegistryManager(maven, console, stateLocationDir,
+ !updateProjectsOnStartup /* readState */, mavenMarkerManager);
+
+ this.mavenBackgroundJob = new ProjectRegistryRefreshJob(managerImpl, console, mavenConfiguration);
+
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ workspace.addResourceChangeListener(mavenBackgroundJob, IResourceChangeEvent.POST_CHANGE
+ | IResourceChangeEvent.PRE_CLOSE | IResourceChangeEvent.PRE_DELETE);
+
+ this.projectManager = new MavenProjectManager(managerImpl, mavenBackgroundJob, stateLocationDir);
+ this.projectManager.addMavenProjectChangedListener(new WorkspaceStateWriter(projectManager));
+ if(updateProjectsOnStartup || managerImpl.getProjects().length == 0) {
+ this.projectManager.refresh(new MavenUpdateRequest(workspace.getRoot().getProjects(), //
+ mavenConfiguration.isOffline() /*offline*/, false /* updateSnapshots */));
+ }
+
+ this.modelManager = new MavenModelManager(maven, projectManager, console);
+
+ this.runtimeManager = new MavenRuntimeManager(getPreferenceStore());
+ this.runtimeManager.setEmbeddedRuntime(new MavenEmbeddedRuntime(getBundleContext()));
+ this.runtimeManager.setWorkspaceRuntime(new MavenWorkspaceRuntime(projectManager));
+
+ this.configurationManager = new ProjectConfigurationManager(maven, console, projectManager, modelManager,
+ mavenMarkerManager, mavenConfiguration);
+ this.projectManager.addMavenProjectChangedListener(this.configurationManager);
+
+ //create repository registry
+ this.repositoryRegistry = new RepositoryRegistry(maven, projectManager);
+ this.maven.addSettingsChangeListener(repositoryRegistry);
+ this.projectManager.addMavenProjectChangedListener(repositoryRegistry);
+
+ //create the index manager
+ this.indexManager = new NexusIndexManager(console, projectManager, repositoryRegistry, stateLocationDir);
+ this.projectManager.addMavenProjectChangedListener(indexManager);
+ this.maven.addLocalRepositoryListener(new IndexingTransferListener(indexManager));
+ this.repositoryRegistry.addRepositoryIndexer(indexManager);
+ this.repositoryRegistry.addRepositoryDiscoverer(new IndexesExtensionReader(indexManager));
+
+ // fork repository registry update. must after index manager registered as a listener
+ this.repositoryRegistry.updateRegistry();
+
+ checkJdk();
+ }
+
+ private static ArchetypeManager newArchetypeManager(File stateLocationDir) {
+ ArchetypeManager archetypeManager = new ArchetypeManager(new File(stateLocationDir, PREFS_ARCHETYPES));
+ archetypeManager.addArchetypeCatalogFactory(new ArchetypeCatalogFactory.NexusIndexerCatalogFactory());
+ archetypeManager.addArchetypeCatalogFactory(new ArchetypeCatalogFactory.InternalCatalogFactory());
+ archetypeManager.addArchetypeCatalogFactory(new ArchetypeCatalogFactory.DefaultLocalCatalogFactory());
+ for(ArchetypeCatalogFactory archetypeCatalogFactory : ExtensionReader.readArchetypeExtensions()) {
+ archetypeManager.addArchetypeCatalogFactory(archetypeCatalogFactory);
+ }
+ return archetypeManager;
+ }
+
+ public void earlyStartup() {
+ // nothing to do here, all startup work is done in #start(BundleContext)
+ }
+
+ public PlexusContainer getPlexusContainer() {
+ return plexus;
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+
+ this.mavenBackgroundJob.cancel();
+ try {
+ this.mavenBackgroundJob.join();
+ } catch(InterruptedException ex) {
+ // ignored
+ }
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ workspace.removeResourceChangeListener(this.mavenBackgroundJob);
+ this.mavenBackgroundJob = null;
+
+ this.projectManager.removeMavenProjectChangedListener(this.configurationManager);
+ this.projectManager.removeMavenProjectChangedListener(indexManager);
+ this.projectManager.removeMavenProjectChangedListener(repositoryRegistry);
+ this.projectManager = null;
+
+ this.plexus.dispose();
+ this.maven.disposeContainer();
+
+ this.configurationManager = null;
+
+ if(this.console != null) {
+ this.console.shutdown();
+ }
+
+ plugin = null;
+ }
+
+ private void checkJdk() {
+ if(getPreferenceStore().getBoolean(MavenPreferenceConstants.P_DISABLE_JDK_CHECK)) {
+ return;
+ }
+ // There is no tools.jar on Mac OS X
+ // http://developer.apple.com/documentation/Java/Conceptual/Java14Development/02-JavaDevTools/JavaDevTools.html
+ String osName = System.getProperty("os.name", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ if(osName.toLowerCase().indexOf("mac os") == -1) { //$NON-NLS-1$
+ String javaHome = System.getProperty("java.home"); //$NON-NLS-1$
+ File toolsJar = new File(javaHome, "../lib/tools.jar"); //$NON-NLS-1$
+ if(!toolsJar.exists()) {
+ getConsole().logError("Eclipse is running in a JRE, but a JDK is required\n" //
+ + " Some Maven plugins may not work when importing projects or updating source folders.");
+ if(!getPreferenceStore().getBoolean(MavenPreferenceConstants.P_DISABLE_JDK_WARNING)) {
+ showJdkWarning();
+ }
+ }
+ }
+ }
+
+ private void showJdkWarning() {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
+ MessageDialogWithToggle dialog = new MessageDialogWithToggle(shell, //
+ Messages.MavenPlugin_error_jre_title, //
+ null, Messages.MavenPlugin_error_jre_message, MessageDialog.WARNING, //
+ new String[] {IDialogConstants.OK_LABEL}, //
+ 0, Messages.MavenPlugin_error_warn_again, false) {
+ protected Control createMessageArea(Composite composite) {
+ Image image = getImage();
+ if(image != null) {
+ imageLabel = new Label(composite, SWT.NULL);
+ image.setBackground(imageLabel.getBackground());
+ imageLabel.setImage(image);
+ GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING).applyTo(imageLabel);
+ }
+
+ Link link = new Link(composite, getMessageLabelStyle());
+ link.setText(message);
+ link.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if("eclipse.ini".equals(e.text)) { //$NON-NLS-1$
+// String href = "topic=/org.eclipse.platform.doc.user/tasks/running_eclipse.htm";
+// BaseHelpSystem.getHelpDisplay().displayHelpResource(href, false);
+
+ try {
+ IWebBrowser browser = PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser();
+ // browser.openURL(new URL("http://www.eclipse.org/swt/launcher.html"));
+ browser
+ .openURL(new URL(
+ "http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.user/tasks/running_eclipse.htm")); //$NON-NLS-1$
+ } catch(MalformedURLException ex) {
+ MavenLogger.log("Malformed URL", ex);
+ } catch(PartInitException ex) {
+ MavenLogger.log(ex);
+ }
+ } else {
+ PreferencesUtil.createPreferenceDialogOn(getShell(),
+ "org.eclipse.jdt.debug.ui.preferences.VMPreferencePage", null, null).open(); //$NON-NLS-1$
+ }
+ }
+ });
+
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false)
+ .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT)
+ .applyTo(link);
+
+ return composite;
+ }
+ };
+
+ dialog.setPrefStore(getPreferenceStore());
+ dialog.setPrefKey(MavenPreferenceConstants.P_DISABLE_JDK_WARNING);
+
+ dialog.open();
+
+ getPreferenceStore().setValue(MavenPreferenceConstants.P_DISABLE_JDK_WARNING, dialog.getToggleState());
+ }
+ });
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static MavenPlugin getDefault() {
+ return plugin;
+ }
+
+ public MavenModelManager getMavenModelManager() {
+ return this.modelManager;
+ }
+
+ public MavenProjectManager getMavenProjectManager() {
+ return this.projectManager;
+ }
+
+ public ProjectRegistryManager getMavenProjectManagerImpl() {
+ return this.managerImpl;
+ }
+
+ public IndexManager getIndexManager() {
+ return this.indexManager;
+ }
+
+ public MavenConsole getConsole() {
+ return this.console;
+ }
+
+ public MavenRuntimeManager getMavenRuntimeManager() {
+ return this.runtimeManager;
+ }
+
+ public ArchetypeManager getArchetypeManager() {
+ return this.archetypeManager;
+ }
+
+ public IMavenMarkerManager getMavenMarkerManager() {
+ return this.mavenMarkerManager;
+ }
+
+ public IMavenConfiguration getMavenConfiguration() {
+ return this.mavenConfiguration;
+ }
+
+ /**
+ * Returns an Image for the file at the given relative path.
+ */
+ public static Image getImage(String path) {
+ ImageRegistry registry = getDefault().getImageRegistry();
+ Image image = registry.get(path);
+ if(image == null) {
+ registry.put(path, imageDescriptorFromPlugin(IMavenConstants.PLUGIN_ID, path));
+ image = registry.get(path);
+ }
+ return image;
+ }
+
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(IMavenConstants.PLUGIN_ID, path);
+ }
+
+ public BundleContext getBundleContext() {
+ return this.bundleContext;
+ }
+
+ public IProjectConfigurationManager getProjectConfigurationManager() {
+ return configurationManager;
+ }
+
+ /** for use by unit tests */
+ public ProjectRegistryRefreshJob getProjectManagerRefreshJob() {
+ return mavenBackgroundJob;
+ }
+
+ private <C> C lookup(Class<C> role) {
+ try {
+ return plexus.lookup(role);
+ } catch(ComponentLookupException ex) {
+ throw new NoSuchComponentException(ex);
+ }
+ }
+
+ private <T> T lookup(Class<T> role, String roleHint) {
+ try {
+ return plexus.lookup(role, roleHint);
+ } catch(ComponentLookupException ex) {
+ throw new NoSuchComponentException(ex);
+ }
+ }
+
+ public static String getVersion() {
+ return plugin.version;
+ }
+
+ public static String getQualifiedVersion() {
+ return plugin.qualifiedVersion;
+ }
+
+ public IRepositoryRegistry getRepositoryRegistry() {
+ return repositoryRegistry;
+ }
+
+ public Archetype getArchetype() {
+ return lookup(Archetype.class);
+ }
+
+ public ArchetypeDataSource getArchetypeDataSource(String hint) {
+ return lookup(ArchetypeDataSource.class, hint);
+ }
+
+ public ArchetypeArtifactManager getArchetypeArtifactManager() {
+ return lookup(ArchetypeArtifactManager.class);
+ }
+
+ public IndexUpdater getIndexUpdater() {
+ return lookup(IndexUpdater.class);
+ }
+
+ public WagonManager getWagonManager() {
+ return lookup(WagonManager.class);
+ }
+
+ public NexusIndexer getNexusIndexer() {
+ return lookup(NexusIndexer.class);
+ }
+
+ public ArtifactContextProducer getArtifactContextProducer() {
+ return lookup(ArtifactContextProducer.class);
+ }
+
+ public ArtifactFactory getArtifactFactory() {
+ return lookup(ArtifactFactory.class);
+ }
+
+ public ArtifactMetadataSource getArtifactMetadataSource() {
+ return lookup(ArtifactMetadataSource.class);
+ }
+
+ public ArtifactCollector getArtifactCollector() {
+ return lookup(ArtifactCollector.class);
+ }
+
+ public RepositorySystem getRepositorySystem() {
+ return lookup(RepositorySystem.class);
+ }
+
+ public MavenSession setSession(MavenSession session) {
+ LegacySupport legacy = lookup(LegacySupport.class);
+ MavenSession old = legacy.getSession();
+ legacy.setSession(session);
+ return old;
+ }
+
+ public SearchEngine getSearchEngine(IProject context) throws CoreException {
+ return new IndexSearchEngine(MavenPlugin.getDefault().getIndexManager().getIndex(context));
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/NoSuchComponentException.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/NoSuchComponentException.java
new file mode 100644
index 00000000..b79b7ddf
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/NoSuchComponentException.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core;
+
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+
+/**
+ * NoSuchComponentException
+ *
+ * @author igor
+ */
+public class NoSuchComponentException extends IllegalArgumentException {
+
+ private static final long serialVersionUID = 9184391358528175461L;
+
+ public NoSuchComponentException(ComponentLookupException ex) {
+ super(ex);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AbstractMavenMenuCreator.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AbstractMavenMenuCreator.java
new file mode 100644
index 00000000..92a431a5
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AbstractMavenMenuCreator.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IActionDelegate;
+
+import org.eclipse.m2e.core.MavenPlugin;
+
+
+/**
+ * Abstract Maven menu creator can be used to contribute custom entries to the Maven popup menu.
+ * <p>
+ * Custom items can be added to one of the standard groups {@link #NEW}, {@link #OPEN}, {@link #UPDATE}, {@link #NATURE}
+ * or {@link #IMPORT}.
+ *
+ * @see org.eclipse.m2e.m2menu extension point
+ *
+ * @author Eugene Kuleshov
+ */
+public abstract class AbstractMavenMenuCreator {
+ public static final String NEW = "new"; //$NON-NLS-1$
+ public static final String OPEN = "open"; //$NON-NLS-1$
+ public static final String UPDATE = "update"; //$NON-NLS-1$
+ public static final String NATURE = "nature"; //$NON-NLS-1$
+ public static final String IMPORT = "import"; //$NON-NLS-1$
+
+ protected IStructuredSelection selection;
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
+ }
+ }
+
+ /**
+ * Creates menu items in given menu manager.
+ */
+ public abstract void createMenu(IMenuManager mgr);
+
+ /**
+ * A helper method to create IAction instance from given IActionDelegate.
+ */
+ protected IAction getAction(IActionDelegate delegate, String id, String text) {
+ return getAction(delegate, id, text, (ImageDescriptor) null);
+ }
+
+ /**
+ * A helper method to create IAction instance from given IActionDelegate.
+ */
+ protected IAction getAction(IActionDelegate delegate, String id, String text, String image) {
+ return getAction(delegate, id, text, MavenPlugin.getImageDescriptor(image));
+ }
+
+ protected IAction getAction(IActionDelegate delegate, String id, String text, ImageDescriptor image) {
+ ActionProxy action = new ActionProxy(id, text, delegate);
+ if(image!=null) {
+ action.setImageDescriptor(image);
+ }
+ return action;
+ }
+
+ class ActionProxy extends Action {
+ private IActionDelegate action;
+
+ public ActionProxy(String id, String text, IActionDelegate action) {
+ super(text);
+ this.action = action;
+ setId(id);
+ }
+
+ public ActionProxy(String id, String text, IActionDelegate action, int style) {
+ super(text, style);
+ this.action = action;
+ setId(id);
+ }
+
+ public void run() {
+ action.selectionChanged(this, selection);
+ action.run(this);
+ }
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AddDependencyAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AddDependencyAction.java
new file mode 100644
index 00000000..316b44d5
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AddDependencyAction.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+import org.apache.maven.model.Dependency;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.MavenModelManager;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.ui.dialogs.MavenRepositorySearchDialog;
+
+
+public class AddDependencyAction extends MavenActionSupport implements IWorkbenchWindowActionDelegate {
+
+ public static final String ID = "org.eclipse.m2e.addDependencyAction"; //$NON-NLS-1$
+
+ public void run(IAction action) {
+ IFile file = getPomFileFromPomEditorOrViewSelection();
+
+ if(file == null) {
+ return;
+ }
+
+ MavenPlugin plugin = MavenPlugin.getDefault();
+
+ Set<ArtifactKey> artifacts = getArtifacts(file, plugin);
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getShell(), Messages.AddDependencyAction_searchDialog_title, IIndex.SEARCH_ARTIFACT, artifacts, true);
+ if(dialog.open() == Window.OK) {
+ IndexedArtifactFile indexedArtifactFile = (IndexedArtifactFile) dialog.getFirstResult();
+ if(indexedArtifactFile != null) {
+ try {
+ MavenModelManager modelManager = plugin.getMavenModelManager();
+ Dependency dependency = indexedArtifactFile.getDependency();
+ String selectedScope = dialog.getSelectedScope();
+ dependency.setScope(selectedScope);
+ modelManager.addDependency(file, dependency);
+ } catch(Exception ex) {
+ String msg = NLS.bind(Messages.AddDependencyAction_error_msg, file);
+ MavenLogger.log(msg, ex);
+ MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.AddDependencyAction_error_title, msg);
+ }
+ }
+ }
+ }
+
+ public void dispose() {
+ }
+
+ public void init(IWorkbenchWindow window) {
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AddPluginAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AddPluginAction.java
new file mode 100644
index 00000000..5251d527
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AddPluginAction.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import java.util.Collections;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.window.Window;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.MavenModelManager;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.ui.dialogs.MavenRepositorySearchDialog;
+
+
+public class AddPluginAction extends MavenActionSupport implements IWorkbenchWindowActionDelegate {
+
+ public static final String ID = "org.eclipse.m2e.addPluginAction"; //$NON-NLS-1$
+
+ public void run(IAction action) {
+ IFile file = getPomFileFromPomEditorOrViewSelection();
+
+ if(file == null) {
+ return;
+ }
+
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getShell(), Messages.AddPluginAction_searchDialog_title, IIndex.SEARCH_PLUGIN, Collections.<ArtifactKey> emptySet());
+ if(dialog.open() == Window.OK) {
+ final IndexedArtifactFile indexedArtifactFile = (IndexedArtifactFile) dialog.getFirstResult();
+ if(indexedArtifactFile != null) {
+ try {
+ MavenModelManager modelManager = MavenPlugin.getDefault().getMavenModelManager();
+ modelManager.updateProject(file, new MavenModelManager.PluginAdder( //
+ indexedArtifactFile.group, //
+ indexedArtifactFile.artifact, //
+ indexedArtifactFile.version));
+ } catch(Exception ex) {
+ MavenLogger.log("Can't add dependency to " + file, ex);
+ }
+ }
+ }
+ }
+
+ public void dispose() {
+ }
+
+ public void init(IWorkbenchWindow window) {
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/ChangeNatureAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/ChangeNatureAction.java
new file mode 100644
index 00000000..ef074ace
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/ChangeNatureAction.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.IProjectConfigurationManager;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+
+
+public class ChangeNatureAction implements IObjectActionDelegate {
+
+ public static final String ID_ENABLE_WORKSPACE = "org.eclipse.m2e.enableWorkspaceResolutionAction"; //$NON-NLS-1$
+
+ public static final String ID_DISABLE_WORKSPACE = "org.eclipse.m2e.disableWorkspaceResolutionAction"; //$NON-NLS-1$
+
+ public static final int ENABLE_WORKSPACE = 1;
+
+ public static final int DISABLE_WORKSPACE = 2;
+
+ private ISelection selection;
+
+ private int option;
+
+ public ChangeNatureAction(int option) {
+ this.option = option;
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.selection = selection;
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+ public void run(IAction action) {
+ if(selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ Set<IProject> projects = new LinkedHashSet<IProject>();
+ for(Iterator<?> it = structuredSelection.iterator(); it.hasNext();) {
+ Object element = it.next();
+ IProject project = null;
+ if(element instanceof IProject) {
+ project = (IProject) element;
+ } else if(element instanceof IAdaptable) {
+ project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
+ }
+ if(project != null) {
+ projects.add(project);
+ }
+ }
+
+ new UpdateJob(projects, option).schedule();
+ }
+ }
+
+ static class UpdateJob extends WorkspaceJob {
+ private final Set<IProject> projects;
+ private final int option;
+
+ private final IProjectConfigurationManager importManager;
+ private final MavenProjectManager projectManager;
+ private final IMavenConfiguration mavenConfiguration;
+
+ public UpdateJob(Set<IProject> projects, int option) {
+ super(Messages.ChangeNatureAction_job_changing);
+ this.projects = projects;
+ this.option = option;
+
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ this.importManager = plugin.getProjectConfigurationManager();
+ this.projectManager = plugin.getMavenProjectManager();
+
+ this.mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ }
+
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ MultiStatus status = null;
+ for(IProject project : projects) {
+ if (monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+
+ monitor.subTask(project.getName());
+
+ try {
+ changeNature(project, monitor);
+ } catch (CoreException ex) {
+ if (status == null) {
+ status = new MultiStatus(IMavenConstants.PLUGIN_ID, IStatus.ERROR, Messages.ChangeNatureAction_status_error, null);
+ }
+ status.add(ex.getStatus());
+ }
+ }
+
+ boolean offline = mavenConfiguration.isOffline();
+ boolean updateSnapshots = false;
+ projectManager.refresh(new MavenUpdateRequest(projects.toArray(new IProject[projects.size()]), //
+ offline, updateSnapshots));
+
+ return status != null? status: Status.OK_STATUS;
+ }
+
+ private void changeNature(final IProject project, IProgressMonitor monitor) throws CoreException {
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ MavenProjectManager projectManager = plugin.getMavenProjectManager();
+
+ final ResolverConfiguration configuration = projectManager.getResolverConfiguration(project);
+
+ boolean updateSourceFolders = false;
+
+ switch(option) {
+ case ENABLE_WORKSPACE:
+ configuration.setResolveWorkspaceProjects(true);
+ break;
+ case DISABLE_WORKSPACE:
+ configuration.setResolveWorkspaceProjects(false);
+ break;
+ }
+
+ projectManager.setResolverConfiguration(project, configuration);
+
+ if (updateSourceFolders) {
+ importManager.updateProjectConfiguration(project, configuration, monitor);
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/CheckoutAsMavenAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/CheckoutAsMavenAction.java
new file mode 100644
index 00000000..9431826e
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/CheckoutAsMavenAction.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import java.util.Iterator;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.scm.ScmUrl;
+import org.eclipse.m2e.core.wizards.MavenCheckoutWizard;
+
+
+/**
+ * Checkout as Maven project action
+ *
+ * @author @author Eugene Kuleshov
+ */
+public class CheckoutAsMavenAction implements IObjectActionDelegate {
+
+ private IStructuredSelection selection;
+ private IWorkbenchPart targetPart;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
+ }
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ this.targetPart = targetPart;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ ScmUrl[] urls = null;
+ if(selection != null) {
+ urls = new ScmUrl[selection.size()];
+ int i = 0;
+ for(Iterator<?> it = selection.iterator(); it.hasNext();) {
+ urls[i++] = (ScmUrl) it.next();
+ }
+ }
+
+ MavenCheckoutWizard wizard = new MavenCheckoutWizard(urls);
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
+ dialog.open();
+ }
+
+ protected Shell getShell() {
+ Shell shell = null;
+ if(targetPart != null) {
+ shell = targetPart.getSite().getShell();
+ }
+ if(shell != null) {
+ return shell;
+ }
+
+ IWorkbench workbench = MavenPlugin.getDefault().getWorkbench();
+ if(workbench == null) {
+ return null;
+ }
+
+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+ return window == null ? null : window.getShell();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/DisableNatureAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/DisableNatureAction.java
new file mode 100644
index 00000000..7ae99170
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/DisableNatureAction.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+
+
+public class DisableNatureAction implements IObjectActionDelegate {
+ public static final String ID = "org.eclipse.m2e.disableAction"; //$NON-NLS-1$
+
+ private ISelection selection;
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ if(selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ for(Iterator<?> it = structuredSelection.iterator(); it.hasNext();) {
+ Object element = it.next();
+ IProject project = null;
+ if(element instanceof IProject) {
+ project = (IProject) element;
+ } else if(element instanceof IAdaptable) {
+ project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
+ }
+ if(project != null) {
+ MavenPlugin plugin = MavenPlugin.getDefault();
+
+ try {
+ plugin.getProjectConfigurationManager().disableMavenNature(project, new NullProgressMonitor());
+
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.selection = selection;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction,
+ * org.eclipse.ui.IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/EnableNatureAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/EnableNatureAction.java
new file mode 100644
index 00000000..2dec17c2
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/EnableNatureAction.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPart;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.IProjectConfigurationManager;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+import org.eclipse.m2e.core.wizards.MavenPomWizard;
+
+
+public class EnableNatureAction implements IObjectActionDelegate, IExecutableExtension {
+
+ public static final String ID = "org.eclipse.m2e.enableNatureAction"; //$NON-NLS-1$
+
+ static final String ID_WORKSPACE = "org.eclipse.m2e.enableWorkspaceResolutionAction"; //$NON-NLS-1$
+
+ static final String ID_MODULES = "org.eclipse.m2e.enableModulesAction"; //$NON-NLS-1$
+
+ private boolean workspaceProjects = true;
+
+ private ISelection selection;
+
+ public EnableNatureAction() {
+ }
+
+ public EnableNatureAction(String option) {
+ setInitializationData(null, null, option);
+ }
+
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
+ if(IMavenConstants.NO_WORKSPACE_PROJECTS.equals(data)) {
+ this.workspaceProjects = false;
+ }
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.selection = selection;
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+ public void run(IAction action) {
+ if(selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ for(Iterator<?> it = structuredSelection.iterator(); it.hasNext();) {
+ Object element = it.next();
+ IProject project = null;
+ if(element instanceof IProject) {
+ project = (IProject) element;
+ } else if(element instanceof IAdaptable) {
+ project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
+ }
+ if(project != null) {
+ enableNature(project, structuredSelection.size() == 1);
+ }
+ }
+ }
+ }
+
+ private void enableNature(final IProject project, boolean isSingle) {
+ final MavenPlugin plugin = MavenPlugin.getDefault();
+ IFile pom = project.getFile(IMavenConstants.POM_FILE_NAME);
+ if(isSingle && !pom.exists()) {
+ // XXX move into AbstractProjectConfigurator and use Eclipse project settings
+ IWorkbench workbench = plugin.getWorkbench();
+
+ MavenPomWizard wizard = new MavenPomWizard();
+ wizard.init(workbench, (IStructuredSelection) selection);
+
+ Shell shell = workbench.getActiveWorkbenchWindow().getShell();
+ WizardDialog wizardDialog = new WizardDialog(shell, wizard);
+ wizardDialog.create();
+ wizardDialog.getShell().setText(Messages.EnableNatureAction_wizard_shell);
+ if(wizardDialog.open() == Window.CANCEL) {
+ return;
+ }
+ }
+ Job job = new Job(Messages.EnableNatureAction_job_enable) {
+
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ ResolverConfiguration configuration = new ResolverConfiguration();
+ configuration.setResolveWorkspaceProjects(workspaceProjects);
+ configuration.setActiveProfiles(""); //$NON-NLS-1$
+
+ boolean hasMavenNature = project.hasNature(IMavenConstants.NATURE_ID);
+
+ IProjectConfigurationManager configurationManager = plugin.getProjectConfigurationManager();
+
+ configurationManager.enableMavenNature(project, configuration, new NullProgressMonitor());
+
+ if(!hasMavenNature) {
+ configurationManager.updateProjectConfiguration(project, configuration, monitor);
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ job.schedule();
+
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MaterializeAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MaterializeAction.java
new file mode 100644
index 00000000..fee02f4f
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MaterializeAction.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+
+import org.apache.maven.model.Dependency;
+
+import org.eclipse.m2e.core.wizards.MavenMaterializePomWizard;
+
+
+public class MaterializeAction implements IObjectActionDelegate {
+
+ public static final String ID = "org.eclipse.m2e.materializeAction"; //$NON-NLS-1$
+
+ private IStructuredSelection selection;
+
+ public void run(IAction action) {
+ MavenMaterializePomWizard wizard = new MavenMaterializePomWizard();
+ wizard.init(PlatformUI.getWorkbench(), selection);
+
+ Dependency[] dependencies = wizard.getDependencies();
+ if(dependencies!=null && dependencies.length>0) {
+ WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+ dialog.open();
+ } else {
+ // TODO show info dialog
+ }
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
+ } else {
+ this.selection = null;
+ }
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenActionSupport.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenActionSupport.java
new file mode 100644
index 00000000..9e9ff69c
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenActionSupport.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import java.util.Collections;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.ArtifactRef;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+
+/**
+ *
+ * MavenActionSupport
+ *
+ * @author Jason van Zyl
+ */
+public abstract class MavenActionSupport implements IObjectActionDelegate {
+ protected IStructuredSelection selection;
+
+ protected IWorkbenchPart targetPart;
+
+ protected Set<ArtifactKey> getArtifacts(IFile file, MavenPlugin plugin) {
+ try {
+ MavenProjectManager projectManager = plugin.getMavenProjectManager();
+ IMavenProjectFacade projectFacade = projectManager.create(file, true, new NullProgressMonitor());
+ if(projectFacade != null) {
+ return ArtifactRef.toArtifactKey(projectFacade.getMavenProjectArtifacts());
+ }
+ } catch(Exception ex) {
+ String msg = "Can't read Maven project";
+ MavenLogger.log(msg, ex);
+ plugin.getConsole().logError(msg + "; " + ex.toString());
+ }
+ return Collections.emptySet();
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ this.targetPart = targetPart;
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
+ }
+ }
+
+ protected Shell getShell() {
+ Shell shell = null;
+ if(targetPart != null) {
+ shell = targetPart.getSite().getShell();
+ }
+ if(shell != null) {
+ return shell;
+ }
+
+ IWorkbench workbench = MavenPlugin.getDefault().getWorkbench();
+ if(workbench == null) {
+ return null;
+ }
+
+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+ return window == null ? null : window.getShell();
+ }
+
+ protected IFile getPomFileFromPomEditorOrViewSelection() {
+ IFile file = null;
+ //
+ // If I am in the POM editor I want to get hold of the IFile that is currently in the buffer
+ //
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+
+ if(window != null) {
+ IWorkbenchPage page = window.getActivePage();
+ if(page != null) {
+ IEditorPart editor = page.getActiveEditor();
+ if(editor != null) {
+ IEditorInput input = editor.getEditorInput();
+ if(input instanceof IFileEditorInput) {
+ IFileEditorInput fileInput = (IFileEditorInput) input;
+ file = fileInput.getFile();
+ if(file.getName().equals(IMavenConstants.POM_FILE_NAME)) {
+ return file;
+ }
+ }
+ }
+ }
+ }
+
+ //
+ // Otherwise we will assume a pom.xml file or IProject is being selected in the
+ // package explorer and we'll get the IFile from that. Otherwise we'll bail.
+ //
+ Object o = selection.iterator().next();
+
+ if(o instanceof IProject) {
+ file = ((IProject) o).getFile(IMavenConstants.POM_FILE_NAME);
+ } else if(o instanceof IFile) {
+ file = (IFile) o;
+ } else {
+ file = null;
+ }
+
+ return file;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenConsoleRemoveAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenConsoleRemoveAction.java
new file mode 100644
index 00000000..92aa714d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenConsoleRemoveAction.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import org.eclipse.jface.action.Action;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.internal.Messages;
+
+public class MavenConsoleRemoveAction extends Action {
+
+ public MavenConsoleRemoveAction() {
+ setToolTipText(Messages.MavenConsoleRemoveAction_tooltip);
+ setImageDescriptor(MavenImages.CLOSE);
+ }
+
+ public void run() {
+ MavenPlugin.getDefault().getConsole().closeConsole();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenDebugOutputAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenDebugOutputAction.java
new file mode 100644
index 00000000..c36e5357
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenDebugOutputAction.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class MavenDebugOutputAction extends Action {
+
+ private IPropertyChangeListener listener = new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ if(MavenPreferenceConstants.P_DEBUG_OUTPUT.equals(event.getProperty())) {
+ setChecked(isDebug());
+ }
+ }
+ };
+
+ public MavenDebugOutputAction() {
+ setToolTipText(Messages.MavenDebugOutputAction_0);
+ setImageDescriptor(MavenImages.DEBUG);
+
+ getPreferenceStore().addPropertyChangeListener(listener);
+ setChecked(isDebug());
+ }
+
+ public void run() {
+ getPreferenceStore().setValue(MavenPreferenceConstants.P_DEBUG_OUTPUT, isChecked());
+ }
+
+ public void dispose() {
+ getPreferenceStore().removePropertyChangeListener(listener);
+ }
+
+ IPreferenceStore getPreferenceStore() {
+ return MavenPlugin.getDefault().getPreferenceStore();
+ }
+
+ boolean isDebug() {
+ return getPreferenceStore().getBoolean(MavenPreferenceConstants.P_DEBUG_OUTPUT);
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenMenuAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenMenuAction.java
new file mode 100644
index 00000000..6c67de47
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenMenuAction.java
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.events.MenuAdapter;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.actions.DefaultMavenMenuCreator;
+
+
+/**
+ * Maven menu action
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenMenuAction implements IObjectActionDelegate, IMenuCreator {
+
+ private static final String EXTENSION_MENU_ITEMS = IMavenConstants.PLUGIN_ID + ".m2menu"; //$NON-NLS-1$
+
+ boolean fillMenu;
+
+ IAction delegateAction;
+
+ List<AbstractMavenMenuCreator> creators = null;
+
+ // IObjectActionDelegate
+
+ public void run(IAction action) {
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof IStructuredSelection) {
+ // this.selection = (IStructuredSelection) selection;
+ this.fillMenu = true;
+
+ if(delegateAction != action) {
+ delegateAction = action;
+ delegateAction.setMenuCreator(this);
+ }
+
+ action.setEnabled(!selection.isEmpty());
+
+ for(AbstractMavenMenuCreator creator : getCreators()) {
+ creator.selectionChanged(action, selection);
+ }
+ }
+ }
+
+ // IMenuCreator
+
+ public void dispose() {
+ }
+
+ public Menu getMenu(Control parent) {
+ return null;
+ }
+
+ public Menu getMenu(Menu parent) {
+ Menu menu = new Menu(parent);
+
+ /**
+ * Add listener to re-populate the menu each time it is shown because MenuManager.update(boolean, boolean) doesn't
+ * dispose pull-down ActionContribution items for each popup menu.
+ */
+ menu.addMenuListener(new MenuAdapter() {
+ public void menuShown(MenuEvent e) {
+ if(fillMenu) {
+ Menu m = (Menu) e.widget;
+
+ for(MenuItem item : m.getItems()) {
+ item.dispose();
+ }
+
+ IMenuManager mgr = new MenuManager("#maven"); //$NON-NLS-1$
+ mgr.add(new GroupMarker(AbstractMavenMenuCreator.NEW));
+ mgr.insertAfter(AbstractMavenMenuCreator.NEW, new GroupMarker(AbstractMavenMenuCreator.UPDATE));
+ mgr.insertAfter(AbstractMavenMenuCreator.UPDATE, new GroupMarker(AbstractMavenMenuCreator.OPEN));
+ mgr.insertAfter(AbstractMavenMenuCreator.OPEN, new GroupMarker(AbstractMavenMenuCreator.NATURE));
+ mgr.insertAfter(AbstractMavenMenuCreator.NATURE, new GroupMarker(AbstractMavenMenuCreator.IMPORT));
+
+ for(AbstractMavenMenuCreator creator : getCreators()) {
+ creator.createMenu(mgr);
+ }
+
+ for(IContributionItem item : mgr.getItems()) {
+ item.fill(m, -1);
+ }
+
+ fillMenu = false;
+ }
+ }
+ });
+
+ return menu;
+ }
+
+ List<AbstractMavenMenuCreator> getCreators() {
+ if(creators == null) {
+ creators = new ArrayList<AbstractMavenMenuCreator>();
+ creators.add(new DefaultMavenMenuCreator());
+
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_MENU_ITEMS);
+ if(extensionPoint!=null) {
+ for(IExtension extension : extensionPoint.getExtensions()) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for(IConfigurationElement element : elements) {
+ try {
+ AbstractMavenMenuCreator creator = (AbstractMavenMenuCreator) element.createExecutableExtension("class"); //$NON-NLS-1$
+ creators.add(creator);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+ }
+ return creators;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenPropertyTester.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenPropertyTester.java
new file mode 100644
index 00000000..9bf3586f
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenPropertyTester.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IAdaptable;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+
+/**
+ * Helper IPropertyTester implementation to check if receiver can be launched with Maven.
+ * E.g. it is pom.xml file of folder or project that has pom.xml.
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenPropertyTester extends PropertyTester {
+
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ IAdaptable adaptable = (IAdaptable) receiver;
+
+ IProject projectAdapter = (IProject) adaptable.getAdapter(IProject.class);
+ if(projectAdapter!=null) {
+ return projectAdapter.getFile(IMavenConstants.POM_FILE_NAME).exists();
+ }
+
+ IFolder folderAdapter = (IFolder) adaptable.getAdapter(IFolder.class);
+ if(folderAdapter!=null) {
+ return folderAdapter.getFile(IMavenConstants.POM_FILE_NAME).exists();
+ }
+
+ IFile fileAdapter = (IFile) adaptable.getAdapter(IFile.class);
+ if(fileAdapter!=null) {
+ return fileAdapter.exists() && IMavenConstants.POM_FILE_NAME.equals(fileAdapter.getName());
+ }
+
+ return false;
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/ModuleProjectWizardAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/ModuleProjectWizardAction.java
new file mode 100644
index 00000000..ed7223c9
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/ModuleProjectWizardAction.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+
+import org.eclipse.m2e.core.wizards.MavenModuleWizard;
+
+/**
+ * A module project wizard action.
+ */
+public class ModuleProjectWizardAction implements IObjectActionDelegate {
+
+ /** action id */
+ public static final String ID =
+ "org.eclipse.m2e.actions.moduleProjectWizardAction"; //$NON-NLS-1$
+
+ /** the current selection */
+ private IStructuredSelection selection;
+
+ /** parent shell */
+ private Shell parent;
+
+ /** Runs the action. */
+ public void run( IAction action ) {
+ MavenModuleWizard wizard = new MavenModuleWizard();
+ wizard.init( PlatformUI.getWorkbench(), selection );
+ WizardDialog dialog = new WizardDialog( parent, wizard );
+ dialog.open();
+ }
+
+
+ /** Sets the active workbench part. */
+ public void setActivePart( IAction action, IWorkbenchPart part ) {
+ parent = part.getSite().getShell();
+ }
+
+
+ /** Handles the selection change */
+ public void selectionChanged( IAction action, ISelection selection ) {
+ if( selection instanceof IStructuredSelection ) {
+ this.selection = ( IStructuredSelection ) selection;
+ }
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/OpenMavenConsoleAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/OpenMavenConsoleAction.java
new file mode 100644
index 00000000..47b10f71
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/OpenMavenConsoleAction.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import org.eclipse.jface.action.Action;
+
+import org.eclipse.m2e.core.MavenPlugin;
+
+/**
+ * Open Maven Console Action
+ *
+ * @author Eugene Kuleshov
+ */
+public class OpenMavenConsoleAction extends Action {
+
+ public void run() {
+ MavenPlugin.getDefault().getConsole().showConsole();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/OpenPomAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/OpenPomAction.java
new file mode 100644
index 00000000..700b6c54
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/OpenPomAction.java
@@ -0,0 +1,404 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.core.runtime.content.IContentTypeManager;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorRegistry;
+import org.eclipse.ui.IPathEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionDelegate;
+import org.eclipse.ui.part.FileEditorInput;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.ui.dialogs.MavenRepositorySearchDialog;
+
+
+/**
+ * Open POM Action
+ *
+ * @author Eugene Kuleshov
+ */
+public class OpenPomAction extends ActionDelegate implements IWorkbenchWindowActionDelegate, IExecutableExtension {
+
+ public static final String ID = "org.eclipse.m2e.openPomAction"; //$NON-NLS-1$
+
+ String type = IIndex.SEARCH_ARTIFACT;
+
+ private IStructuredSelection selection;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ */
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
+ if("plugins".equals(data)) { //$NON-NLS-1$
+ this.type = IIndex.SEARCH_PACKAGING;
+ } else {
+ this.type = IIndex.SEARCH_ARTIFACT;
+ }
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
+ } else {
+ this.selection = null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ if(selection != null) {
+ Object element = this.selection.getFirstElement();
+ if(IIndex.SEARCH_ARTIFACT.equals(type) && element != null) {
+ try {
+ final ArtifactKey ak = SelectionUtil.getArtifactKey(element);
+ if(ak != null) {
+ new Job(Messages.OpenPomAction_job_opening) {
+ protected IStatus run(IProgressMonitor monitor) {
+ openEditor(ak.getGroupId(), ak.getArtifactId(), ak.getVersion(), monitor);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ return;
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(), //
+ Messages.OpenPomAction_open_error_title, Messages.OpenPomAction_open_error_message);
+ }
+ });
+ }
+ }
+ }
+
+ String title = Messages.OpenPomAction_title_pom;
+
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(shell, title, type, Collections
+ .<ArtifactKey> emptySet());
+ if(dialog.open() == Window.OK) {
+ final IndexedArtifactFile iaf = (IndexedArtifactFile) dialog.getFirstResult();
+ new Job(Messages.OpenPomAction_job_opening) {
+ protected IStatus run(IProgressMonitor monitor) {
+ if(iaf != null) {
+ openEditor(iaf.group, iaf.artifact, iaf.version, monitor);
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ }
+
+ public static void openEditor(IndexedArtifact ia, IndexedArtifactFile f, IProgressMonitor monitor) {
+ if(f == null || ia.getClassname() == null || ia.getPackageName() == null) {
+ return;
+ }
+
+ String groupId = f.getDependency().getGroupId();
+ String artifactId = f.getDependency().getArtifactId();
+ String version = f.getDependency().getVersion();
+
+ String name = ia.getClassname();
+ String fileName = ia.getPackageName().replace('.', '/') + "/" + ia.getClassname() + ".java"; //$NON-NLS-1$ //$NON-NLS-2$
+ String tooltip = groupId + ":" + artifactId + ":" + version + "/" + fileName; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ try {
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+
+ List<ArtifactRepository> artifactRepositories = maven.getArtifactRepositories();
+
+ Artifact artifact = maven.resolve(groupId, artifactId, version, "java-source", "sources", artifactRepositories, //$NON-NLS-1$ //$NON-NLS-2$
+ monitor);
+
+ final File file = artifact.getFile();
+ if(file == null) {
+ openDialog(NLS.bind(Messages.OpenPomAction_error_download_source, tooltip));
+ return;
+ }
+
+ // that won't work if source archive have subfolders before actual source tree
+ String url = "jar:" + file.toURL().toString() + "!/" + fileName; //$NON-NLS-1$ //$NON-NLS-2$
+ InputStream is = new URL(url).openStream();
+ byte[] buff = readStream(is);
+
+ openEditor(new MavenPathStorageEditorInput(name + ".java", tooltip, url, buff), name + ".java"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ } catch(IOException ex) {
+ String msg = NLS.bind(Messages.OpenPomAction_error_open_editor, name);
+ MavenLogger.log(msg, ex);
+ openDialog(msg + "\n" + ex.toString()); //$NON-NLS-1$
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ openDialog(ex.getMessage() + "\n" + ex.toString()); //$NON-NLS-1$
+ }
+ }
+
+ public static IEditorPart openEditor(String groupId, String artifactId, String version, IProgressMonitor monitor) {
+ if(groupId.length() > 0 && artifactId.length() > 0) {
+ final String name = groupId + ":" + artifactId + ":" + version + ".pom"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ try {
+ MavenPlugin plugin = MavenPlugin.getDefault();
+
+ MavenProjectManager projectManager = plugin.getMavenProjectManager();
+ IMavenProjectFacade projectFacade = projectManager.getMavenProject(groupId, artifactId, version);
+ if(projectFacade != null) {
+ final IFile pomFile = projectFacade.getPom();
+ return openEditor(new FileEditorInput(pomFile), name);
+ }
+
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+
+ List<ArtifactRepository> artifactRepositories = maven.getArtifactRepositories();
+
+ Artifact artifact = maven.resolve(groupId, artifactId, version, "pom", null, artifactRepositories, monitor); //$NON-NLS-1$
+
+ File file = artifact.getFile();
+ if(file != null) {
+ return openEditor(new MavenPathStorageEditorInput(name, name, file.getAbsolutePath(),
+ readStream(new FileInputStream(file))), name);
+ }
+
+ openDialog(NLS.bind(Messages.OpenPomAction_error_download, name));
+
+ } catch(IOException ex) {
+ String msg = NLS.bind(Messages.OpenPomAction_error_open_pom, name);
+ MavenLogger.log(msg, ex);
+ openDialog(msg + "\n" + ex.toString()); //$NON-NLS-1$
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ openDialog(ex.getMessage() + "\n" + ex.toString()); //$NON-NLS-1$
+ }
+ }
+
+ return null;
+ }
+
+ public static IEditorPart openEditor(final IEditorInput editorInput, final String name) {
+ final IEditorPart[] part = new IEditorPart[1];
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ public void run() {
+ IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
+ IContentType contentType = contentTypeManager.findContentTypeFor(name);
+ IEditorRegistry editorRegistry = PlatformUI.getWorkbench().getEditorRegistry();
+ IEditorDescriptor editor = editorRegistry.getDefaultEditor(name, contentType);
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if(window != null) {
+ IWorkbenchPage page = window.getActivePage();
+ if(page != null) {
+ try {
+ part[0] = page.openEditor(editorInput, editor.getId());
+ } catch(PartInitException ex) {
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(), //
+ Messages.OpenPomAction_open_title, NLS.bind(Messages.OpenPomAction_33, editorInput.getName(), ex.toString())); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+ });
+ return part[0];
+ }
+
+ private static void openDialog(final String msg) {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(), //
+ Messages.OpenPomAction_open_title, msg);
+ }
+ });
+ }
+
+ private static byte[] readStream(InputStream is) throws IOException {
+ byte[] b = new byte[is.available()];
+ int len = 0;
+ while(true) {
+ int n = is.read(b, len, b.length - len);
+ if(n == -1) {
+ if(len < b.length) {
+ byte[] c = new byte[len];
+ System.arraycopy(b, 0, c, 0, len);
+ b = c;
+ }
+ return b;
+ }
+ len += n;
+ if(len == b.length) {
+ byte[] c = new byte[b.length + 1000];
+ System.arraycopy(b, 0, c, 0, len);
+ b = c;
+ }
+ }
+ }
+
+ /**
+ * Storage editor input implementation for Maven poms
+ */
+ public static class MavenStorageEditorInput implements IStorageEditorInput {
+
+ private final String name;
+
+ private final String path;
+
+ private final String tooltip;
+
+ private final byte[] content;
+
+ public MavenStorageEditorInput(String name, String tooltip, String path, byte[] content) {
+ this.name = name;
+ this.path = path;
+ this.tooltip = tooltip;
+ this.content = content;
+ }
+
+ // IStorageEditorInput
+
+ public boolean exists() {
+ return true;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public String getToolTipText() {
+ return this.tooltip;
+ }
+
+ public IStorage getStorage() {
+ return new MavenStorage(name, path, content);
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ // IPathEditorInput
+
+ public IPath getPath() {
+ return new Path(path);
+ }
+
+ }
+
+ public static class MavenPathStorageEditorInput extends MavenStorageEditorInput implements IPathEditorInput {
+ public MavenPathStorageEditorInput(String name, String tooltip, String path, byte[] content) {
+ super(name, tooltip, path, content);
+ }
+ }
+
+ private static class MavenStorage implements IStorage {
+ private String name;
+
+ private final String path;
+
+ private final byte[] content;
+
+ public MavenStorage(String name, String path, byte[] content) {
+ this.name = name;
+ this.path = path;
+ this.content = content;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public IPath getFullPath() {
+ return path == null ? null : new Path(path);
+ }
+
+ public InputStream getContents() {
+ return new ByteArrayInputStream(content);
+ }
+
+ public boolean isReadOnly() {
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/OpenUrlAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/OpenUrlAction.java
new file mode 100644
index 00000000..2b81ec4b
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/OpenUrlAction.java
@@ -0,0 +1,230 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionDelegate;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.model.CiManagement;
+import org.apache.maven.model.IssueManagement;
+import org.apache.maven.model.Scm;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+
+/**
+ * Open Url Action
+ *
+ * @author Eugene Kuleshov
+ */
+public class OpenUrlAction extends ActionDelegate implements IWorkbenchWindowActionDelegate, IExecutableExtension {
+
+ public static final String ID_PROJECT = "org.eclipse.m2e.openProjectPage"; //$NON-NLS-1$
+
+ public static final String ID_ISSUES = "org.eclipse.m2e.openIssuesPage"; //$NON-NLS-1$
+
+ public static final String ID_SCM = "org.eclipse.m2e.openScmPage"; //$NON-NLS-1$
+
+ public static final String ID_CI = "org.eclipse.m2e.openCiPage"; //$NON-NLS-1$
+
+ String actionId;
+
+ private IStructuredSelection selection;
+
+ public OpenUrlAction() {
+ }
+
+ public OpenUrlAction(String id) {
+ this.actionId = id;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
+ } else {
+ this.selection = null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ if(selection != null) {
+ try {
+ Object element = this.selection.getFirstElement();
+ final ArtifactKey a = SelectionUtil.getArtifactKey(element);
+ if(a != null) {
+ new Job(Messages.OpenUrlAction_job_browser) {
+ protected IStatus run(IProgressMonitor monitor) {
+ openBrowser(actionId, a.getGroupId(), a.getArtifactId(), a.getVersion(), monitor);
+ return Status.OK_STATUS;
+ }
+
+ }.schedule();
+ return;
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(), //
+ Messages.OpenUrlAction_open_url_title, Messages.OpenUrlAction_open_url_message);
+ }
+ });
+ }
+ }
+ }
+
+ public static void openBrowser(String actionId, String groupId, String artifactId, String version, IProgressMonitor monitor) {
+ try {
+ MavenProject mavenProject = getMavenProject(groupId, artifactId, version, monitor);
+ final String url = getUrl(actionId, mavenProject);
+ if(url!=null) {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
+ IWebBrowser browser = browserSupport.createBrowser(IWorkbenchBrowserSupport.NAVIGATION_BAR
+ | IWorkbenchBrowserSupport.LOCATION_BAR, url, url, url);
+ browser.openURL(new URL(url));
+ } catch(PartInitException ex) {
+ MavenLogger.log(ex);
+ } catch(MalformedURLException ex) {
+ MavenLogger.log("Malformed url " + url, ex);
+ }
+ }
+ });
+ }
+ } catch(Exception ex) {
+ MavenLogger.log("Can't open URL", ex);
+ }
+ }
+
+ private static String getUrl(String actionId, MavenProject mavenProject) {
+ String url = null;
+ if(ID_PROJECT.equals(actionId)) {
+ url = mavenProject.getUrl();
+ if(url == null) {
+ openDialog(Messages.OpenUrlAction_error_no_url);
+ }
+ } else if(ID_ISSUES.equals(actionId)) {
+ IssueManagement issueManagement = mavenProject.getIssueManagement();
+ if(issueManagement != null) {
+ url = issueManagement.getUrl();
+ }
+ if(url == null) {
+ openDialog(Messages.OpenUrlAction_error_no_issues);
+ }
+ } else if(ID_SCM.equals(actionId)) {
+ Scm scm = mavenProject.getScm();
+ if(scm != null) {
+ url = scm.getUrl();
+ }
+ if(url == null) {
+ openDialog(Messages.OpenUrlAction_error_no_scm);
+ }
+ } else if(ID_CI.equals(actionId)) {
+ CiManagement ciManagement = mavenProject.getCiManagement();
+ if(ciManagement != null) {
+ url = ciManagement.getUrl();
+ }
+ if(url == null) {
+ openDialog(Messages.OpenUrlAction_error_no_ci);
+ }
+ }
+ return url;
+ }
+
+ private static MavenProject getMavenProject(String groupId, String artifactId, String version, IProgressMonitor monitor) throws Exception {
+ String name = groupId + ":" + artifactId + ":" + version;
+
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+
+ IMavenProjectFacade projectFacade = plugin.getMavenProjectManager().getMavenProject(groupId, artifactId, version);
+ if(projectFacade != null) {
+ return projectFacade.getMavenProject(monitor);
+ }
+
+ List<ArtifactRepository> artifactRepositories = maven.getArtifactRepositories();
+
+ Artifact a = maven.resolve(groupId, artifactId, version, "pom", null, artifactRepositories, monitor); //$NON-NLS-1$
+
+ File pomFile = a.getFile();
+ if(pomFile == null) {
+ openDialog(NLS.bind(Messages.OpenUrlAction_error_open, name));
+ return null;
+ }
+
+ return maven.readProject(pomFile, monitor);
+ }
+
+ private static void openDialog(final String msg) {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(), //
+ Messages.OpenUrlAction_browser_title, msg);
+ }
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ */
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
+ if(data != null) {
+ actionId = (String) data;
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/RefreshMavenModelsAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/RefreshMavenModelsAction.java
new file mode 100644
index 00000000..5c2fa7fa
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/RefreshMavenModelsAction.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.IWorkingSet;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+
+
+public class RefreshMavenModelsAction implements IWorkbenchWindowActionDelegate, IExecutableExtension {
+
+ public static final String ID = "org.eclipse.m2e.refreshMavenModelsAction"; //$NON-NLS-1$
+
+ public static final String ID_SNAPSHOTS = "org.eclipse.m2e.refreshMavenSnapshotsAction"; //$NON-NLS-1$
+
+ private boolean updateSnapshots = false;
+
+ private boolean offline = false; // should respect global settings
+
+ private IStructuredSelection selection;
+
+ public RefreshMavenModelsAction() {
+ }
+
+ public RefreshMavenModelsAction(boolean updateSnapshots) {
+ this.updateSnapshots = updateSnapshots;
+ }
+
+ // IExecutableExtension
+
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
+ if("snapshots".equals(data)) { //$NON-NLS-1$
+ this.updateSnapshots = true;
+ }
+ }
+
+ // IWorkbenchWindowActionDelegate
+
+ public void run(IAction action) {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ projectManager.refresh(new MavenUpdateRequest(getProjects(), offline, updateSnapshots));
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
+ } else {
+ this.selection = null;
+ }
+ }
+
+ public void dispose() {
+ }
+
+ public void init(IWorkbenchWindow window) {
+ }
+
+ private IProject[] getProjects() {
+ ArrayList<IProject> projectList = new ArrayList<IProject>();
+ if(selection != null) {
+ for(Iterator<?> it = selection.iterator(); it.hasNext();) {
+ Object o = it.next();
+ if(o instanceof IProject) {
+ projectList.add((IProject) o);
+ } else if(o instanceof IWorkingSet) {
+ IWorkingSet workingSet = (IWorkingSet) o;
+ for(IAdaptable adaptable : workingSet.getElements()) {
+ IProject project = (IProject) adaptable.getAdapter(IProject.class);
+ try {
+ if(project != null && project.isAccessible() && project.hasNature(IMavenConstants.NATURE_ID)) {
+ projectList.add(project);
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+ }
+ if(projectList.isEmpty()) {
+ return ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ }
+ return projectList.toArray(new IProject[projectList.size()]);
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/SelectionUtil.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/SelectionUtil.java
new file mode 100644
index 00000000..7955c654
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/SelectionUtil.java
@@ -0,0 +1,360 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkingSet;
+import org.eclipse.ui.IWorkingSetManager;
+import org.eclipse.ui.PlatformUI;
+
+import org.codehaus.plexus.util.IOUtil;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenExecutionResult;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.util.Util;
+import org.eclipse.m2e.core.util.Util.FileStoreEditorInputStub;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+
+
+/**
+ * Helper methods to deal with workspace resources passed as navigator selection to actions and wizards.
+ */
+public class SelectionUtil {
+
+ public static final int UNSUPPORTED = 0;
+
+ public static final int PROJECT_WITH_NATURE = 1;
+
+ public static final int PROJECT_WITHOUT_NATURE = 2;
+
+ public static final int POM_FILE = 4;
+
+ public static final int JAR_FILE = 8;
+
+ public static final int WORKING_SET = 16;
+
+ /** Checks which type the given selection belongs to. */
+ public static int getSelectionType(IStructuredSelection selection) {
+ int type = UNSUPPORTED;
+ if(selection != null) {
+ for(Iterator<?> it = selection.iterator(); it.hasNext();) {
+ int elementType = getElementType(it.next());
+ if(elementType == UNSUPPORTED) {
+ return UNSUPPORTED;
+ }
+ type |= elementType;
+ }
+ }
+ return type;
+ }
+
+ /** Checks which type the given element belongs to. */
+ public static int getElementType(Object element) {
+ IProject project = getType(element, IProject.class);
+ if(project != null) {
+ try {
+ if(project.hasNature(IMavenConstants.NATURE_ID)) {
+ return PROJECT_WITH_NATURE;
+ }
+ return PROJECT_WITHOUT_NATURE;
+ } catch(CoreException e) {
+ // ignored
+ }
+ }
+
+ IFile file = getType(element, IFile.class);
+ if(file != null) {
+ if(IMavenConstants.POM_FILE_NAME.equals(file.getFullPath().lastSegment())) {
+ return POM_FILE;
+ }
+ }
+
+ ArtifactKey artifactKey = getType(element, ArtifactKey.class);
+ if(artifactKey != null) {
+ return JAR_FILE;
+ }
+
+ IWorkingSet workingSet = getType(element, IWorkingSet.class);
+ if(workingSet!=null) {
+ return WORKING_SET;
+ }
+
+ return UNSUPPORTED;
+ }
+
+ /**
+ * Checks if the object belongs to a given type and returns it or a suitable adapter.
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T getType(Object element, Class<T> type) {
+ if(element==null) {
+ return null;
+ }
+ if(type.isInstance(element)) {
+ return (T) element;
+ }
+ if(element instanceof IAdaptable) {
+ T adapter = (T) ((IAdaptable) element).getAdapter(type);
+ if(adapter != null) {
+ return adapter;
+ }
+ }
+ return (T) Platform.getAdapterManager().getAdapter(element, type);
+ }
+
+ public static IPath getSelectedLocation(IStructuredSelection selection) {
+ Object element = selection == null ? null : selection.getFirstElement();
+
+ IPath path = getType(element, IPath.class);
+ if(path != null) {
+ return path;
+ }
+
+ IResource resource = getType(element, IResource.class);
+ if(resource != null) {
+ return resource.getLocation();
+ }
+
+// IPackageFragmentRoot fragment = getType(element, IResource.class);
+// if(fragment != null) {
+// IJavaProject javaProject = fragment.getJavaProject();
+// if(javaProject != null) {
+// IResource resource = getType(javaProject, IResource.class);
+// if(resource != null) {
+// return resource.getProject().getProject().getLocation();
+// }
+// }
+// }
+
+ return null;
+ }
+
+ public static IWorkingSet getSelectedWorkingSet(IStructuredSelection selection) {
+ Object element = selection == null ? null : selection.getFirstElement();
+ {
+ IWorkingSet workingSet = getType(element, IWorkingSet.class);
+ if(workingSet != null) {
+ return workingSet;
+ }
+ }
+ {
+ IResource resource = getType(element, IResource.class);
+ if(resource != null) {
+ return getWorkingSet(resource.getProject());
+ }
+ }
+
+// IResource resource = getType(element, IResource.class);
+// if(resource != null) {
+// return getWorkingSet(resource);
+// }
+
+// IPackageFragmentRoot fragment = getType(element, IPackageFragmentRoot.class);
+// if(fragment != null) {
+// IJavaProject javaProject = fragment.getJavaProject();
+// if(javaProject != null) {
+// IResource resource = getType(javaProject, IResource.class);
+// if(resource != null) {
+// return getWorkingSet(resource.getProject());
+// }
+// }
+// }
+
+ return null;
+ }
+
+ public static IWorkingSet getWorkingSet(Object element) {
+ IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
+ for(IWorkingSet workingSet : workingSetManager.getWorkingSets()) {
+ for(IAdaptable adaptable : workingSet.getElements()) {
+ if(adaptable.getAdapter(IResource.class) == element) {
+ return workingSet;
+ }
+ }
+ }
+ return null;
+ }
+
+ public static IWorkingSet[] getAssignedWorkingSets(Object element) {
+ List<IWorkingSet> list = new ArrayList<IWorkingSet>();
+ IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
+ for(IWorkingSet workingSet : workingSetManager.getWorkingSets()) {
+ for(IAdaptable adaptable : workingSet.getElements()) {
+ if(adaptable.getAdapter(IResource.class) == element) {
+ list.add(workingSet);
+ }
+ }
+ }
+ return list.toArray(new IWorkingSet[list.size()]);
+ }
+
+ public static ArtifactKey getArtifactKey(Object element) throws CoreException {
+ if(element instanceof Artifact) {
+ return new ArtifactKey(((Artifact) element));
+
+ } else if(element instanceof org.sonatype.aether.graph.DependencyNode) {
+ org.sonatype.aether.artifact.Artifact artifact = ((org.sonatype.aether.graph.DependencyNode) element)
+ .getDependency().getArtifact();
+ return new ArtifactKey(artifact);
+
+ } else if(element instanceof Dependency) {
+ Dependency dependency = (Dependency) element;
+ String groupId = dependency.getGroupId();
+ String artifactId = dependency.getArtifactId();
+ String version = dependency.getVersion();
+
+ if(version == null) {
+ //mkleint: this looks scary
+ IEditorPart editor = getActiveEditor();
+ if(editor!=null) {
+ MavenProject mavenProject = getMavenProject(editor.getEditorInput(), null);
+ if(mavenProject!=null) {
+ Artifact a = mavenProject.getArtifactMap().get(groupId + ":" + artifactId); //$NON-NLS-1$
+ version = a.getBaseVersion();
+ }
+ }
+ }
+ return new ArtifactKey(dependency.getGroupId(), dependency.getArtifactId(), version, null);
+ }
+
+ return SelectionUtil.getType(element, ArtifactKey.class);
+ }
+
+ public static MavenProject getMavenProject(IEditorInput editorInput, IProgressMonitor monitor) throws CoreException {
+ if(editorInput instanceof IFileEditorInput) {
+ IFile pomFile = ((IFileEditorInput) editorInput).getFile();
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectFacade facade = projectManager.create(pomFile, true, monitor);
+ if(facade!=null) {
+ return facade.getMavenProject(monitor);
+ }
+
+ } else if(editorInput instanceof IStorageEditorInput) {
+ IStorageEditorInput storageInput = (IStorageEditorInput) editorInput;
+ IStorage storage = storageInput.getStorage();
+ IPath path = storage.getFullPath();
+ if(path == null || !new File(path.toOSString()).exists()) {
+ File tempPomFile = null;
+ InputStream is = null;
+ OutputStream os = null;
+ try {
+ tempPomFile = File.createTempFile("maven-pom", ".pom"); //$NON-NLS-1$ //$NON-NLS-2$
+ os = new FileOutputStream(tempPomFile);
+ is = storage.getContents();
+ IOUtil.copy(is, os);
+ return readMavenProject(tempPomFile, monitor);
+ } catch(IOException ex) {
+ MavenLogger.log("Can't close stream", ex);
+ } finally {
+ IOUtil.close(is);
+ IOUtil.close(os);
+ if(tempPomFile != null) {
+ tempPomFile.delete();
+ }
+ }
+ } else {
+ return readMavenProject(path.toFile(), monitor);
+ }
+
+ } else if(editorInput.getClass().getName().endsWith("FileStoreEditorInput")) { //$NON-NLS-1$
+ return readMavenProject(new File(Util.proxy(editorInput, FileStoreEditorInputStub.class).getURI().getPath()), monitor);
+ }
+
+ return null;
+ }
+
+ private static MavenProject readMavenProject(File pomFile, IProgressMonitor monitor) throws CoreException {
+ if(monitor==null) {
+ monitor = new NullProgressMonitor();
+ }
+
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+
+ MavenExecutionRequest request = maven.createExecutionRequest(monitor);
+ request.setOffline(false);
+ request.setUpdateSnapshots(false);
+ request.setRecursive(false);
+ request.setPom(pomFile);
+
+ MavenExecutionResult result = maven.execute(request, monitor);
+
+ MavenProject project = result.getProject();
+ if(project!=null) {
+ return project;
+ }
+
+ if(result.hasExceptions()) {
+ List<IStatus> statuses = new ArrayList<IStatus>();
+ List<Throwable> exceptions = result.getExceptions();
+ for(Throwable e : exceptions) {
+ statuses.add(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, e.getMessage(), e));
+ }
+
+ throw new CoreException(new MultiStatus(IMavenConstants.PLUGIN_ID, IStatus.ERROR, //
+ statuses.toArray(new IStatus[statuses.size()]), Messages.SelectionUtil_error_cannot_read, null));
+ }
+
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, //
+ Messages.SelectionUtil_error_cannot_read, null));
+ }
+
+ private static IEditorPart getActiveEditor() {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if(window != null) {
+ IWorkbenchPage page = window.getActivePage();
+ if(page != null) {
+ return page.getActiveEditor();
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/UpdateConfigurationAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/UpdateConfigurationAction.java
new file mode 100644
index 00000000..e8adb704
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/UpdateConfigurationAction.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.actions;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkingSet;
+import org.eclipse.ui.progress.IProgressConstants;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.util.M2EUtils;
+
+
+public class UpdateConfigurationAction implements IObjectActionDelegate {
+
+ public static final String ID = "org.eclipse.m2e.updateConfigurationAction"; //$NON-NLS-1$
+
+ private IStructuredSelection selection;
+
+ private Shell shell;
+
+ public UpdateConfigurationAction(Shell shell) {
+ this.shell = shell;
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
+ } else {
+ this.selection = null;
+ }
+ }
+
+ public void run(IAction action) {
+ final Set<IProject> projects = getProjects();
+ final MavenPlugin plugin = MavenPlugin.getDefault();
+ WorkspaceJob job = new WorkspaceJob(Messages.UpdateSourcesAction_job_update_conf) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
+ monitor.beginTask(getName(), projects.size());
+
+ MavenConsole console = plugin.getConsole();
+
+ long l1 = System.currentTimeMillis();
+ console.logMessage("Update started");
+
+ MultiStatus status = null;
+ //project names to the errors encountered when updating them
+ Map<String, Throwable> updateErrors = new HashMap<String, Throwable>();
+
+ for(IProject project : projects) {
+ if(monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+
+ monitor.subTask(project.getName());
+ IMavenProjectFacade projectFacade = plugin.getMavenProjectManager().create(project, monitor);
+ if(projectFacade != null) {
+ try {
+ plugin.getProjectConfigurationManager().updateProjectConfiguration(project, //
+ projectFacade.getResolverConfiguration(), //
+ new SubProgressMonitor(monitor, 1));
+ } catch(CoreException ex) {
+ if(status == null) {
+ status = new MultiStatus(IMavenConstants.PLUGIN_ID, IStatus.ERROR, //
+ Messages.UpdateSourcesAction_error_cannot_update, null);
+ }
+ status.add(ex.getStatus());
+ updateErrors.put(project.getName(), ex);
+ } catch(IllegalArgumentException e) {
+ status = new MultiStatus(IMavenConstants.PLUGIN_ID, IStatus.ERROR, //
+ Messages.UpdateSourcesAction_error_cannot_update, null);
+ updateErrors.put(project.getName(), e);
+ }
+ }
+ }
+ if(updateErrors.size() > 0) {
+ M2EUtils.showErrorsForProjectsDialog(shell, Messages.UpdateSourcesAction_error_title,
+ Messages.UpdateSourcesAction_error_message, updateErrors);
+ }
+ long l2 = System.currentTimeMillis();
+ console.logMessage(NLS.bind("Update completed: {0} sec", ((l2 - l1) / 1000)));
+
+ return status != null ? status : Status.OK_STATUS;
+ }
+ };
+ // We need to grab workspace lock because IJavaProject.setRawClasspath() needs it.
+ job.setRule(plugin.getProjectConfigurationManager().getRule());
+ job.schedule();
+ }
+
+ private Set<IProject> getProjects() {
+ Set<IProject> projects = new LinkedHashSet<IProject>();
+ if(selection != null) {
+ for(Iterator<?> it = selection.iterator(); it.hasNext();) {
+ Object element = it.next();
+ if(element instanceof IProject) {
+ projects.add((IProject) element);
+ } else if(element instanceof IWorkingSet) {
+ IWorkingSet workingSet = (IWorkingSet) element;
+ for(IAdaptable adaptable : workingSet.getElements()) {
+ IProject project = (IProject) adaptable.getAdapter(IProject.class);
+ try {
+ if(project != null && project.isAccessible() && project.hasNature(IMavenConstants.NATURE_ID)) {
+ projects.add(project);
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ } else if(element instanceof IAdaptable) {
+ IProject project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
+ if(project != null) {
+ projects.add(project);
+ }
+ }
+ }
+ }
+ return projects;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogFactory.java
new file mode 100644
index 00000000..8b9331bd
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogFactory.java
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.archetype;
+
+import java.util.Properties;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+
+import org.apache.maven.archetype.Archetype;
+import org.apache.maven.archetype.catalog.ArchetypeCatalog;
+import org.apache.maven.archetype.source.ArchetypeDataSource;
+import org.apache.maven.archetype.source.ArchetypeDataSourceException;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.Messages;
+
+
+/**
+ * Abstract ArchetypeCatalog factory
+ */
+public abstract class ArchetypeCatalogFactory {
+ private final String id;
+
+ private final String description;
+
+ private final boolean editable;
+
+ public ArchetypeCatalogFactory(String id, String description, boolean editable) {
+ this.id = id;
+ this.description = description;
+ this.editable = editable;
+ }
+
+ public String getId() {
+ return this.id;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public boolean isEditable() {
+ return editable;
+ }
+
+ public abstract ArchetypeCatalog getArchetypeCatalog() throws CoreException;
+
+ public String toString() {
+ return getId();
+ }
+
+ protected Archetype getArchetyper() {
+ return MavenPlugin.getDefault().getArchetype();
+ }
+
+ /**
+ * Factory for Nexus Indexer ArchetypeCatalog
+ */
+ public static class NexusIndexerCatalogFactory extends ArchetypeCatalogFactory {
+ public static final String ID = "nexusIndexer"; //$NON-NLS-1$
+
+ public NexusIndexerCatalogFactory() {
+ super(ID, Messages.ArchetypeCatalogFactory_indexer_catalog, false);
+ }
+
+ public ArchetypeCatalog getArchetypeCatalog() throws CoreException {
+ try {
+ ArchetypeDataSource source = MavenPlugin.getDefault().getArchetypeDataSource("nexus"); //$NON-NLS-1$
+ return source.getArchetypeCatalog(new Properties());
+ } catch(ArchetypeDataSourceException ex) {
+ String msg = NLS.bind(Messages.ArchetypeCatalogFactory_error_missing_catalog, ex.getMessage());
+ MavenLogger.log(msg, ex);
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg, ex));
+ }
+ }
+
+ }
+
+ /**
+ * Factory for internal ArchetypeCatalog
+ */
+ public static class InternalCatalogFactory extends ArchetypeCatalogFactory {
+ public static final String ID = "internal"; //$NON-NLS-1$
+
+ public InternalCatalogFactory() {
+ super(ID, Messages.ArchetypeCatalogFactory_internal, false);
+ }
+
+ public ArchetypeCatalog getArchetypeCatalog() {
+ return getArchetyper().getInternalCatalog();
+ }
+ }
+
+ /**
+ * Factory for default local ArchetypeCatalog
+ */
+ public static class DefaultLocalCatalogFactory extends ArchetypeCatalogFactory {
+ public static final String ID = "defaultLocal"; //$NON-NLS-1$
+
+ public DefaultLocalCatalogFactory() {
+ super(ID, Messages.ArchetypeCatalogFactory_default_local, false);
+ }
+
+ public ArchetypeCatalog getArchetypeCatalog() {
+ return getArchetyper().getDefaultLocalCatalog();
+ }
+ }
+
+ /**
+ * Factory for local ArchetypeCatalog
+ */
+ public static class LocalCatalogFactory extends ArchetypeCatalogFactory {
+
+ public LocalCatalogFactory(String path, String description, boolean editable) {
+ super(path, description == null || description.trim().length() == 0 ? NLS.bind(Messages.ArchetypeCatalogFactory_local, path) : description, editable);
+ }
+
+ public ArchetypeCatalog getArchetypeCatalog() {
+ return getArchetyper().getLocalCatalog(getId());
+ }
+ }
+
+ /**
+ * Factory for remote ArchetypeCatalog
+ */
+ public static class RemoteCatalogFactory extends ArchetypeCatalogFactory {
+
+ private String repositoryUrl = null;
+
+ public RemoteCatalogFactory(String url, String description, boolean editable) {
+ super(url, description == null || description.trim().length() == 0 ? NLS.bind(Messages.ArchetypeCatalogFactory_remote, url) : description, editable);
+ repositoryUrl = parseCatalogUrl(url);
+ }
+
+ /**
+ * @param url
+ * @return
+
+ */
+ private String parseCatalogUrl(String url) {
+ if (url == null) {
+ return null;
+ }
+ int length = url.length();
+ if (length > 1 && url.endsWith("/")) //$NON-NLS-1$
+ {
+ return url.substring(0, url.length()-1);
+ }
+ int idx = url.lastIndexOf("/"); //$NON-NLS-1$
+ idx = (idx>0)?idx:0;
+ if (url.lastIndexOf(".") >= idx) { //$NON-NLS-1$
+ //Assume last fragment of the url is a file, let's keep its parent folder
+ return url.substring(0, idx);
+ }
+ return url;
+ }
+
+ public ArchetypeCatalog getArchetypeCatalog() {
+ return getArchetyper().getRemoteCatalog(getId());
+ }
+
+
+ /**
+ * @return the url of the remote repository hosting the catalog
+ */
+ public String getRepositoryUrl() {
+ return repositoryUrl;
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogsWriter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogsWriter.java
new file mode 100644
index 00000000..aecc0a6d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeCatalogsWriter.java
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.archetype;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import org.eclipse.osgi.util.NLS;
+
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory.LocalCatalogFactory;
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.Messages;
+
+
+/**
+ * Archetype catalogs writer
+ *
+ * @author Eugene Kuleshov
+ */
+public class ArchetypeCatalogsWriter {
+
+ private static final String ELEMENT_CATALOGS = "archetypeCatalogs"; //$NON-NLS-1$
+
+ private static final String ELEMENT_CATALOG = "catalog"; //$NON-NLS-1$
+
+ private static final String ATT_CATALOG_TYPE = "type"; //$NON-NLS-1$
+
+ private static final String ATT_CATALOG_LOCATION = "location"; //$NON-NLS-1$
+
+ public static final String ATT_CATALOG_DESCRIPTION = "description"; //$NON-NLS-1$
+
+ private static final String TYPE_LOCAL = "local"; //$NON-NLS-1$
+
+ private static final String TYPE_REMOTE = "remote"; //$NON-NLS-1$
+
+
+ public Collection<ArchetypeCatalogFactory> readArchetypeCatalogs(InputStream is) throws IOException {
+ Collection<ArchetypeCatalogFactory> catalogs = new ArrayList<ArchetypeCatalogFactory>();
+ try {
+ SAXParserFactory parserFactory = SAXParserFactory.newInstance();
+ SAXParser parser = parserFactory.newSAXParser();
+ parser.parse(is, new ArchetypeCatalogsContentHandler(catalogs));
+ } catch(SAXException ex) {
+ String msg = Messages.ArchetypeCatalogsWriter_error_parse;
+ MavenLogger.log(msg, ex);
+ throw new IOException(NLS.bind(msg, ex.getMessage()));
+ } catch(ParserConfigurationException ex) {
+ String msg = Messages.ArchetypeCatalogsWriter_error_parse;
+ MavenLogger.log(msg, ex);
+ throw new IOException(NLS.bind(msg, ex.getMessage()));
+ }
+ return catalogs;
+ }
+
+ public void writeArchetypeCatalogs(final Collection<ArchetypeCatalogFactory> catalogs, OutputStream os) throws IOException {
+ try {
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.transform(new SAXSource(new XMLArchetypeCatalogsWriter(catalogs), new InputSource()), new StreamResult(os));
+
+ } catch(TransformerFactoryConfigurationError ex) {
+ throw new IOException(NLS.bind(Messages.ArchetypeCatalogsWriter_error_write, ex.getMessage()));
+
+ } catch(TransformerException ex) {
+ throw new IOException(NLS.bind(Messages.ArchetypeCatalogsWriter_error_write, ex.getMessage()));
+
+ }
+ }
+
+ static class XMLArchetypeCatalogsWriter extends XMLFilterImpl {
+
+ private final Collection<ArchetypeCatalogFactory> catalogs;
+
+ public XMLArchetypeCatalogsWriter(Collection<ArchetypeCatalogFactory> catalogs) {
+ this.catalogs = catalogs;
+ }
+
+ public void parse(InputSource input) throws SAXException {
+ ContentHandler handler = getContentHandler();
+ handler.startDocument();
+ handler.startElement(null, ELEMENT_CATALOGS, ELEMENT_CATALOGS, new AttributesImpl());
+
+ for(ArchetypeCatalogFactory factory : this.catalogs) {
+ if(factory.isEditable()) {
+ if(factory instanceof LocalCatalogFactory) {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute(null, ATT_CATALOG_TYPE, ATT_CATALOG_TYPE, null, TYPE_LOCAL);
+ attrs.addAttribute(null, ATT_CATALOG_LOCATION, ATT_CATALOG_LOCATION, null, factory.getId());
+ attrs.addAttribute(null, ATT_CATALOG_DESCRIPTION, ATT_CATALOG_DESCRIPTION, null, factory.getDescription());
+ handler.startElement(null, ELEMENT_CATALOG, ELEMENT_CATALOG, attrs);
+ handler.endElement(null, ELEMENT_CATALOG, ELEMENT_CATALOG);
+ } else if(factory instanceof RemoteCatalogFactory) {
+ AttributesImpl attrs = new AttributesImpl();
+ attrs.addAttribute(null, ATT_CATALOG_TYPE, ATT_CATALOG_TYPE, null, TYPE_REMOTE);
+ attrs.addAttribute(null, ATT_CATALOG_LOCATION, ATT_CATALOG_LOCATION, null, factory.getId());
+ attrs.addAttribute(null, ATT_CATALOG_DESCRIPTION, ATT_CATALOG_DESCRIPTION, null, factory.getDescription());
+ handler.startElement(null, ELEMENT_CATALOG, ELEMENT_CATALOG, attrs);
+ handler.endElement(null, ELEMENT_CATALOG, ELEMENT_CATALOG);
+ }
+ }
+ }
+
+ handler.endElement(null, ELEMENT_CATALOGS, ELEMENT_CATALOGS);
+ handler.endDocument();
+ }
+ }
+
+ static class ArchetypeCatalogsContentHandler extends DefaultHandler {
+
+ private Collection<ArchetypeCatalogFactory> catalogs;
+
+ public ArchetypeCatalogsContentHandler(Collection<ArchetypeCatalogFactory> catalogs) {
+ this.catalogs = catalogs;
+ }
+
+ public void startElement(String uri, String localName, String qName, Attributes attributes) {
+ if(ELEMENT_CATALOG.equals(qName) && attributes != null) {
+ String type = attributes.getValue(ATT_CATALOG_TYPE);
+ if(TYPE_LOCAL.equals(type)) {
+ String path = attributes.getValue(ATT_CATALOG_LOCATION);
+ if(path!=null) {
+ String description = attributes.getValue(ATT_CATALOG_DESCRIPTION);
+ catalogs.add(new LocalCatalogFactory(path, description, true));
+ }
+ } else if(TYPE_REMOTE.equals(type)) {
+ String url = attributes.getValue(ATT_CATALOG_LOCATION);
+ if(url!=null) {
+ String description = attributes.getValue(ATT_CATALOG_DESCRIPTION);
+ catalogs.add(new RemoteCatalogFactory(url, description, true));
+ }
+ }
+ }
+ }
+
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeManager.java
new file mode 100644
index 00000000..e447e2de
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/archetype/ArchetypeManager.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.archetype;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+
+import org.codehaus.plexus.util.IOUtil;
+
+import org.apache.maven.archetype.catalog.Archetype;
+
+
+
+
+/**
+ * Archetype Manager
+ *
+ * @author Eugene Kuleshov
+ */
+public class ArchetypeManager {
+
+ private final Map<String, ArchetypeCatalogFactory> catalogs = new LinkedHashMap<String, ArchetypeCatalogFactory>();
+
+ private final File configFile;
+
+ private final ArchetypeCatalogsWriter writer;
+
+ public ArchetypeManager(File configFile) {
+ this.configFile = configFile;
+ this.writer = new ArchetypeCatalogsWriter();
+ }
+
+ /**
+ * @return Collection of ArchetypeCatalogFactory
+ */
+ public Collection<ArchetypeCatalogFactory> getArchetypeCatalogs() {
+ return new ArrayList<ArchetypeCatalogFactory>(catalogs.values());
+ }
+
+ public void addArchetypeCatalogFactory(ArchetypeCatalogFactory factory) {
+ if(factory != null) {
+ catalogs.put(factory.getId(), factory);
+ }
+ }
+
+ public void removeArchetypeCatalogFactory(String catalogId) {
+ catalogs.remove(catalogId);
+ }
+
+ public ArchetypeCatalogFactory getArchetypeCatalogFactory(String catalogId) {
+ return catalogs.get(catalogId);
+ }
+
+ public void readCatalogs() throws IOException {
+ if(configFile.exists()) {
+ InputStream is = null;
+ try {
+ is = new FileInputStream(configFile);
+ Collection<ArchetypeCatalogFactory> catalogs = writer.readArchetypeCatalogs(is);
+ for(Iterator<ArchetypeCatalogFactory> it = catalogs.iterator(); it.hasNext();) {
+ addArchetypeCatalogFactory(it.next());
+ }
+ } finally {
+ IOUtil.close(is);
+ }
+ }
+ }
+
+ public void saveCatalogs() throws IOException {
+ OutputStream os = null;
+ try {
+ os = new FileOutputStream(configFile);
+ writer.writeArchetypeCatalogs(getArchetypeCatalogs(), os);
+ } finally {
+ IOUtil.close(os);
+ }
+ }
+
+ /**
+ * @return the archetypeCatalogFactory containing the archetype parameter, null if none was found.
+ */
+ public <T extends ArchetypeCatalogFactory> T findParentCatalogFactory(Archetype a, Class<T> type) throws CoreException {
+ if (a!=null){
+ for (ArchetypeCatalogFactory factory : getArchetypeCatalogs()) {
+ if ((type.isAssignableFrom(factory.getClass()))
+ //temporary hack to get around https://issues.sonatype.org/browse/MNGECLIPSE-1792
+ //cf. MavenProjectWizardArchetypePage.getAllArchetypes
+ && !(factory.getDescription() != null && factory.getDescription().startsWith("Test")) //$NON-NLS-1$
+ && factory.getArchetypeCatalog().getArchetypes().contains(a)) {
+ return (T)factory;
+ }
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/AbstractEclipseBuildContext.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/AbstractEclipseBuildContext.java
new file mode 100644
index 00000000..df3a519d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/AbstractEclipseBuildContext.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.builder;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+import org.sonatype.plexus.build.incremental.BuildContext;
+
+
+/**
+ * AbstractEclipseBuildContext
+ *
+ * @author igor
+ */
+public abstract class AbstractEclipseBuildContext implements BuildContext {
+
+ public static class Message {
+ public final File file;
+
+ public final int line;
+
+ public final int column;
+
+ public final String message;
+
+ public final Throwable cause;
+
+ Message(File file, int line, int column, String message, Throwable cause) {
+ this.file = file;
+ this.line = line;
+ this.column = column;
+ this.message = message;
+ this.cause = cause;
+ }
+ }
+
+ private final Set<File> refresh = new HashSet<File>();
+
+ protected final Map<String, Object> context;
+
+ private final ArrayList<Message> errorMessages = new ArrayList<Message>();
+
+ private final ArrayList<Message> warningMessages = new ArrayList<Message>();
+
+ protected AbstractEclipseBuildContext(Map<String, Object> context) {
+ this.context = context;
+ }
+
+ public void refresh(File file) {
+ refresh.add(file);
+ }
+
+ public Set<File> getFiles() {
+ return refresh;
+ }
+
+ public OutputStream newFileOutputStream(File file) throws IOException {
+ return new ChangedFileOutputStream(file, this);
+ }
+
+ /**
+ * Returns path relative to delta resource location.
+ */
+ protected IPath getRelativePath(File file) {
+ IPath basepath = getBaseResource().getLocation();
+ IPath path = Path.fromOSString(file.getAbsolutePath());
+
+ if(!basepath.isPrefixOf(path)) {
+ return null;
+ }
+
+ return path.removeFirstSegments(basepath.segmentCount());
+ }
+
+ protected IResource getResource(File file) {
+ IPath relpath = getRelativePath(file);
+ if (relpath == null) {
+ return null;
+ }
+ IResource baseResource = getBaseResource();
+ if (baseResource instanceof IContainer) {
+ return ((IContainer) baseResource).findMember(relpath);
+ }
+ return null;
+ }
+
+ protected abstract IResource getBaseResource();
+
+ public void setValue(String key, Object value) {
+ context.put(key, value);
+ }
+
+ public Object getValue(String key) {
+ return context.get(key);
+ }
+
+ public void addError(File file, int line, int column, String message, Throwable cause) {
+ errorMessages.add(new Message(file, line, column, message, cause));
+ }
+
+ public void addWarning(File file, int line, int column, String message, Throwable cause) {
+ warningMessages.add(new Message(file, line, column, message, cause));
+ }
+
+ public List<Message> getErrorMessages() {
+ return errorMessages;
+ }
+
+ public List<Message> getWarningMessages() {
+ return warningMessages;
+ }
+
+ public boolean isUptodate(File target, File source) {
+ IResource targetResource = getResource(target);
+ IResource sourceResource = getResource(source);
+ return targetResource != null && targetResource.isAccessible() && !hasDelta(target)
+ && sourceResource != null && sourceResource.isAccessible() && !hasDelta(source)
+ && targetResource.getLocalTimeStamp() >= sourceResource.getLocalTimeStamp();
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/ChangedFileOutputStream.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/ChangedFileOutputStream.java
new file mode 100644
index 00000000..51aa0093
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/ChangedFileOutputStream.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.builder;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.sonatype.plexus.build.incremental.BuildContext;
+
+/**
+ * Writes to the file only if content of the file is different.
+ *
+ * TODO. Current implementation defers actual writing to the output file until
+ * invocation of {@link #close()} method. This results in missed/ignored IOExceptions
+ * in some cases. First, {@link #flush()} method does not actually flush buffer to the disk.
+ * Second, any problems writing to the file will be reported as IOException
+ * thrown by {@link #close()}, which are generally ignored.
+ */
+public class ChangedFileOutputStream extends OutputStream {
+
+ private final File file;
+ private final BuildContext buildContext;
+ private final OutputStream os;
+
+ private ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+
+ public ChangedFileOutputStream(File file) throws FileNotFoundException {
+ this(file, null);
+ }
+
+ public ChangedFileOutputStream(File file, BuildContext buildContext) throws FileNotFoundException {
+ this.file = file;
+ this.buildContext = buildContext;
+ this.os = new BufferedOutputStream(new FileOutputStream(file));
+ }
+
+ public void write(int b) {
+ buffer.write(b);
+ }
+
+ public void write(byte[] b, int off, int len) {
+ buffer.write(b, off, len);
+ }
+
+ public void close() throws IOException {
+ try {
+ writeIfNewOrChanged();
+ } finally {
+ os.close();
+ }
+ }
+
+ protected void writeIfNewOrChanged() throws IOException {
+ byte[] bytes = buffer.toByteArray();
+
+ boolean needToWrite = false;
+
+ // XXX harden
+ if (file.exists()) {
+ BufferedInputStream is = new BufferedInputStream(new FileInputStream(file));
+ try {
+ for (int i = 0; i < bytes.length; i++) {
+ if (bytes[i] != is.read()) {
+ needToWrite = true;
+ break;
+ }
+ }
+ } finally {
+ try {
+ is.close();
+ } catch (IOException e) {
+
+ }
+ }
+ } else {
+ // file does not exist
+ needToWrite = true;
+ }
+
+ if (needToWrite) {
+ if (buildContext != null) {
+ buildContext.refresh(file);
+ }
+
+ os.write(bytes);
+ }
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/EclipseBuildContext.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/EclipseBuildContext.java
new file mode 100644
index 00000000..c5161f7d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/EclipseBuildContext.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.builder;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+
+import org.codehaus.plexus.util.Scanner;
+
+import org.sonatype.plexus.build.incremental.EmptyScanner;
+
+import org.eclipse.m2e.core.internal.builder.ResourceScanner;
+
+/**
+ * EclipseBuildContext
+ *
+ * @author igor
+ */
+public class EclipseBuildContext extends AbstractEclipseBuildContext {
+
+ protected final IProject project;
+
+ public EclipseBuildContext(IProject project, Map<String, Object> context) {
+ super(context);
+ this.project = project;
+ }
+
+ public boolean hasDelta(String relpath) {
+ return true;
+ }
+
+ @SuppressWarnings("rawtypes")
+ public boolean hasDelta(List relpath) {
+ return true;
+ }
+
+ public boolean hasDelta(File file) {
+ return true;
+ }
+
+ public Scanner newDeleteScanner(File basedir) {
+ return new EmptyScanner(basedir);
+ }
+
+ public Scanner newScanner(File basedir) {
+ IPath relpath = getRelativePath(basedir);
+ return new ResourceScanner(project.findMember(relpath));
+ }
+
+ public Scanner newScanner(File basedir, boolean ignoreDelta) {
+ return newScanner(basedir);
+ }
+
+ protected IProject getBaseResource() {
+ return project;
+ }
+
+ public boolean isIncremental() {
+ return false;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/EclipseIncrementalBuildContext.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/EclipseIncrementalBuildContext.java
new file mode 100644
index 00000000..e5f039fb
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/EclipseIncrementalBuildContext.java
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.builder;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+import org.codehaus.plexus.util.DirectoryScanner;
+import org.codehaus.plexus.util.Scanner;
+
+import org.sonatype.plexus.build.incremental.EmptyScanner;
+
+public class EclipseIncrementalBuildContext extends AbstractEclipseBuildContext {
+
+ private final IResourceDelta delta;
+
+ public EclipseIncrementalBuildContext(IResourceDelta delta, Map<String, Object> context) {
+ super(context);
+ this.delta = delta;
+ }
+
+ public boolean hasDelta(String relPath) {
+ IPath path = new Path(relPath);
+ return hasDelta(path);
+ }
+
+ protected boolean hasDelta(IPath path) {
+ return delta == null || path == null || delta.findMember(path) != null;
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ public boolean hasDelta(List relPaths) {
+ for (String relPath : (List<String>) relPaths) {
+ if (hasDelta(relPath)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean hasDelta(File file) {
+ return hasDelta(getRelativePath(file));
+ }
+
+ public Scanner newDeleteScanner(File basedir) {
+ IResourceDelta reldelta = getDelta(basedir);
+
+ if (reldelta == null || !isRemove(reldelta)) {
+ return new EmptyScanner(basedir);
+ }
+
+ return new ResourceDeltaScanner(reldelta, true);
+ }
+
+ public Scanner newScanner(File basedir) {
+ return newScanner(basedir, false);
+ }
+
+ public Scanner newScanner(File basedir, boolean ignoreDelta) {
+ if (!ignoreDelta) {
+ IResourceDelta reldelta = getDelta(basedir);
+
+ if (reldelta == null || !isContentChange(reldelta)) {
+ return new EmptyScanner(basedir);
+ }
+
+ return new ResourceDeltaScanner(reldelta, false);
+ }
+
+ DirectoryScanner ds = new DirectoryScanner();
+ ds.setBasedir(basedir);
+ return ds;
+ }
+
+ private IResourceDelta getDelta(File file) {
+ IPath relpath = getRelativePath(file);
+ if (relpath == null) {
+ return null;
+ }
+ return delta.findMember(relpath);
+ }
+
+ static boolean isContentChange(IResourceDelta delta) {
+ int kind = delta.getKind();
+ if (IResourceDelta.ADDED == kind) {
+ return true;
+ }
+
+ if (IResourceDelta.CHANGED == kind) {
+ if (delta.getResource() instanceof IContainer) {
+ return true;
+ }
+
+ int flags = delta.getFlags();
+
+ return (flags & IResourceDelta.CONTENT) != 0;
+ }
+
+ return false;
+ }
+
+ static boolean isRemove(IResourceDelta delta) {
+ int kind = delta.getKind();
+
+ if (IResourceDelta.REMOVED == kind) {
+ return true;
+ }
+
+ if (IResourceDelta.CHANGED == kind && delta.getResource() instanceof IContainer) {
+ return true;
+ }
+
+ return false;
+ }
+
+
+ @Override
+ protected IResource getBaseResource() {
+ return delta.getResource();
+ }
+
+ public boolean isIncremental() {
+ return true;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/ResourceDeltaScanner.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/ResourceDeltaScanner.java
new file mode 100644
index 00000000..092d419d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/builder/ResourceDeltaScanner.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.builder;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.runtime.CoreException;
+
+import org.codehaus.plexus.util.AbstractScanner;
+
+public class ResourceDeltaScanner extends AbstractScanner {
+
+ protected final IResourceDelta delta;
+
+ protected final List<String> includedDirectories = new ArrayList<String>();
+
+ protected final List<String> includedFiles = new ArrayList<String>();
+
+ protected final boolean deleted;
+
+ public ResourceDeltaScanner(IResourceDelta delta, boolean deleted) {
+ this.delta = delta;
+ this.deleted = deleted;
+ }
+
+ public String[] getIncludedDirectories() {
+ return includedDirectories.toArray(new String[includedDirectories.size()]);
+ }
+
+ public String[] getIncludedFiles() {
+ return includedFiles.toArray(new String[includedFiles.size()]);
+ }
+
+ public void scan() {
+ try {
+ setupDefaultFilters();
+ scanDelta();
+ } catch(CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ private void scanDelta() throws CoreException {
+ delta.accept(new IResourceDeltaVisitor() {
+
+ @SuppressWarnings("synthetic-access")
+ public boolean visit(IResourceDelta delta) {
+ String relpath = getRelativePath(delta);
+ if (isInteresting(delta) && isIncluded(relpath) && !isExcluded(relpath)) {
+ IResource resource = delta.getResource();
+ if (resource instanceof IContainer) {
+ includedDirectories.add(relpath);
+ } else {
+ includedFiles.add(relpath);
+ }
+ return true;
+ } else if (delta.getResource() instanceof IFolder) {
+ return couldHoldIncluded(relpath);
+ }
+
+ return false;
+ }
+
+ });
+ }
+
+ protected boolean isInteresting(IResourceDelta delta) {
+ return deleted? EclipseIncrementalBuildContext.isRemove(delta): EclipseIncrementalBuildContext.isContentChange(delta);
+ }
+
+ protected String getRelativePath(IResourceDelta delta) {
+ return delta.getFullPath().removeFirstSegments(this.delta.getFullPath().segmentCount()).toOSString();
+ }
+
+ public File getBasedir() {
+ return delta.getResource().getLocation().toFile();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/IMavenConsoleListener.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/IMavenConsoleListener.java
new file mode 100644
index 00000000..1d1a7b93
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/IMavenConsoleListener.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.core;
+
+import java.util.EventListener;
+
+/**
+ * A console listener is notified of output to the Maven console.
+ *
+ * @author Benjamin Bentmann
+ */
+public interface IMavenConsoleListener extends EventListener {
+
+ void loggingMessage(String msg);
+
+ void loggingError(String msg);
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/IMavenConstants.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/IMavenConstants.java
new file mode 100644
index 00000000..fb9562d1
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/IMavenConstants.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.core;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+/**
+ * Maven Constants
+ *
+ * @author Eugene Kuleshov
+ */
+public interface IMavenConstants {
+
+ public static final String PLUGIN_ID = "org.eclipse.m2e.core"; //$NON-NLS-1$
+
+ public static final String NATURE_ID = PLUGIN_ID + ".maven2Nature"; //$NON-NLS-1$
+
+ public static final String BUILDER_ID = PLUGIN_ID + ".maven2Builder"; //$NON-NLS-1$
+
+ public static final String MARKER_ID = PLUGIN_ID + ".maven2Problem"; //$NON-NLS-1$
+
+ public static final String MARKER_POM_LOADING_ID = MARKER_ID + ".pomloading"; //$NON-NLS-1$
+
+ public static final String MARKER_CONFIGURATION_ID = MARKER_ID + ".configuration"; //$NON-NLS-1$
+
+ public static final String MARKER_DEPENDENCY_ID = MARKER_ID + ".dependency"; //$NON-NLS-1$
+
+ public static final String MARKER_BUILD_ID = MARKER_ID + ".build"; //$NON-NLS-1$
+
+ /**
+ * string that gets included in pom.xml file comments and makes the marker manager to ignore
+ * the managed version override marker
+ */
+ public static final String MARKER_IGNORE_MANAGED = "$NO-MVN-MAN-VER$";//$NON-NLS-1$
+
+ public static final String MAVEN_COMPONENT_CONTRIBUTORS_XPT = PLUGIN_ID + ".mavenComponentContributors"; //$NON-NLS-1$
+
+ public static final String POM_FILE_NAME = "pom.xml"; //$NON-NLS-1$
+
+ public static final String PREFERENCE_PAGE_ID = PLUGIN_ID + ".MavenProjectPreferencePage"; //$NON-NLS-1$
+
+ public static final String NO_WORKSPACE_PROJECTS = "noworkspace"; //$NON-NLS-1$
+
+ public static final String ACTIVE_PROFILES = "profiles"; //$NON-NLS-1$
+
+ public static final String FILTER_RESOURCES = "filterresources"; //$NON-NLS-1$
+
+ public static final String JAVADOC_CLASSIFIER = "javadoc"; //$NON-NLS-1$
+
+ public static final String SOURCES_CLASSIFIER = "sources"; //$NON-NLS-1$
+
+
+ /**
+ * Session property key used to indicate that full maven build was requested for a project.
+ * It is not intended to be used by clients directly.
+ */
+ public static final QualifiedName FULL_MAVEN_BUILD = new QualifiedName(PLUGIN_ID, "fullBuild"); //$NON-NLS-1$
+
+ /**
+ * The name of the folder containing metadata information for the workspace.
+ */
+ public static final String METADATA_FOLDER = ".metadata"; //$NON-NLS-1$
+
+ public static final String INDEX_UPDATE_PROP = "indexUpdate"; //$NON-NLS-1$
+
+ public static final String MARKER_ATTR_EDITOR_HINT = "editor_hint";
+
+ public static final String EDITOR_HINT_PARENT_GROUP_ID = "parent_groupid";
+
+ public static final String EDITOR_HINT_PARENT_VERSION = "parent_version";
+
+ public static final String EDITOR_HINT_MANAGED_DEPENDENCY_OVERRIDE = "managed_dependency_override";
+
+ public static final String EDITOR_HINT_MANAGED_PLUGIN_OVERRIDE = "managed_plugin_override";
+
+ public static final String EDITOR_HINT_MISSING_SCHEMA = "missing_schema";
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/MavenConsole.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/MavenConsole.java
new file mode 100644
index 00000000..a6196d0f
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/MavenConsole.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.core;
+
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleListener;
+
+/**
+ * Maven Console
+ *
+ * @author Eugene Kuleshov
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface MavenConsole extends IConsole {
+
+ void logMessage(String msg);
+
+ void logError(String msg);
+
+ IConsoleListener newLifecycle();
+
+ void shutdown();
+
+ void showConsole();
+
+ void closeConsole();
+
+ void addMavenConsoleListener(IMavenConsoleListener listener);
+
+ void removeMavenConsoleListener(IMavenConsoleListener listener);
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/MavenLogger.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/MavenLogger.java
new file mode 100644
index 00000000..2cef32db
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/MavenLogger.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.core;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+
+/**
+ * Maven Logger
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenLogger {
+
+ private static ILog LOG;
+
+ public static void setLog(ILog log) {
+ LOG = log;
+ }
+
+ public static void log(IStatus status) {
+ LOG.log(status);
+ }
+
+ public static void log(CoreException ex) {
+ IStatus s = ex.getStatus();
+ if(s.getException() == null) {
+ int n = s.getSeverity();
+ log(new Status(n == IStatus.CANCEL || n == IStatus.ERROR || n == IStatus.INFO //
+ || n == IStatus.WARNING || n == IStatus.OK ? n : IStatus.ERROR, //
+ s.getPlugin() == null ? IMavenConstants.PLUGIN_ID : s.getPlugin(), //
+ s.getCode(), //
+ s.getMessage() == null ? s.toString() : s.getMessage(), //
+ ex));
+ } else {
+ log(s);
+ }
+ }
+
+ public static void log(String msg, Throwable t) {
+ log(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, msg, t));
+ }
+
+ public static void log(String msg) {
+ log(new Status(IStatus.OK, IMavenConstants.PLUGIN_ID, msg));
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/Messages.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/Messages.java
new file mode 100644
index 00000000..854797f1
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/core/Messages.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.core;
+
+import java.util.MissingResourceException;
+
+import com.ibm.icu.text.MessageFormat;
+import com.ibm.icu.util.ULocale;
+import com.ibm.icu.util.UResourceBundle;
+
+//mkleint: this class looks like not following the default eclipse way of i18n and resides in public packages
+
+public class Messages {
+ private static final String BUNDLE_NAME = IMavenConstants.PLUGIN_ID + ".messages"; //$NON-NLS-1$
+
+ private static final UResourceBundle RESOURCE_BUNDLE = UResourceBundle.getBundleInstance(BUNDLE_NAME,
+ ULocale.getDefault(), Messages.class.getClassLoader());
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch(MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+
+ public static String getString( String key, Object[] args ) {
+ try {
+ return MessageFormat.format(
+ RESOURCE_BUNDLE.getString( key ), args );
+ } catch( MissingResourceException e ) {
+ return '!' + key + '!';
+ }
+ }
+
+ public static String getString( String key, Object arg ) {
+ return getString( key, new Object[]{ arg } );
+ }
+
+ public static String getString( String key, int arg ) {
+ return getString( key, new Object[]{ String.valueOf(arg) } );
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/AbstractMavenConfigurationChangeListener.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/AbstractMavenConfigurationChangeListener.java
new file mode 100644
index 00000000..88d2538c
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/AbstractMavenConfigurationChangeListener.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+/**
+ * AbstractMavenConfigurationChangeListener
+ *
+ * @author igor
+ */
+public abstract class AbstractMavenConfigurationChangeListener implements IMavenConfigurationChangeListener {
+
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java
new file mode 100644
index 00000000..d0697c1f
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactKey.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import java.io.Serializable;
+
+import org.eclipse.osgi.util.NLS;
+
+import org.apache.maven.artifact.Artifact;
+
+public class ArtifactKey implements Serializable {
+ private static final long serialVersionUID = -8984509272834024387L;
+
+ private final String groupId;
+ private final String artifactId;
+ private final String version;
+ private final String classifier;
+
+ /**
+ * Note that this constructor uses Artifact.getBaseVersion
+ */
+ public ArtifactKey(Artifact a) {
+ this(a.getGroupId(), a.getArtifactId(), a.getBaseVersion(), null);
+ }
+
+ public ArtifactKey(org.sonatype.aether.artifact.Artifact a) {
+ this(a.getGroupId(), a.getArtifactId(), a.getBaseVersion(), null);
+ }
+
+ public ArtifactKey(String groupId, String artifactId, String version, String classifier) {
+ this.groupId = groupId;
+ this.artifactId = artifactId;
+ this.version = version;
+ this.classifier = classifier;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o instanceof ArtifactKey) {
+ ArtifactKey other = (ArtifactKey) o;
+ return equals(groupId, other.groupId)
+ && equals(artifactId, other.artifactId)
+ && equals(version, other.version)
+ && equals(classifier, other.classifier);
+ }
+ return false;
+ }
+
+ public int hashCode() {
+ int hash = 17;
+ hash = hash * 31 + (groupId != null? groupId.hashCode(): 0);
+ hash = hash * 31 + (artifactId != null? artifactId.hashCode(): 0);
+ hash = hash * 31 + (version != null? version.hashCode(): 0);
+ hash = hash * 31 + (classifier != null? classifier.hashCode(): 0);
+ return hash;
+ }
+
+ private static boolean equals(Object o1, Object o2) {
+ return o1 == null? o2 == null: o1.equals(o2);
+ }
+
+ // XXX this method does not belong here, it compares versions, while ArtifactKey baseVersions
+ public static boolean equals(Artifact a1, Artifact a2) {
+ if (a1 == null) {
+ return a2 == null;
+ }
+ if (a2 == null) {
+ return false;
+ }
+ return equals(a1.getGroupId(), a2.getGroupId())
+ && equals(a1.getArtifactId(), a2.getArtifactId())
+ && equals(a1.getVersion(), a2.getVersion())
+ && equals(a1.getClassifier(), a2.getClassifier());
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append(groupId).append(':').append(artifactId).append(':').append(version);
+ if(classifier != null) {
+ sb.append(':').append(classifier);
+ }
+ return sb.toString();
+ }
+
+ public static ArtifactKey fromPortableString(String str) {
+ int p, c;
+
+ p = 0; c = nextColonIndex(str, p);
+ String groupId = substring(str, p, c);
+
+ p = c + 1; c = nextColonIndex(str, p);
+ String artifactId = substring(str, p, c);
+
+ p = c + 1; c = nextColonIndex(str, p);
+ String version = substring(str, p, c);
+
+ p = c + 1; c = nextColonIndex(str, p);
+ String classifier = substring(str, p, c);
+
+ return new ArtifactKey(groupId, artifactId, version, classifier);
+ }
+
+ private static String substring(String str, int start, int end) {
+ String substring = str.substring(start, end);
+ return "".equals(substring)? null: substring; //$NON-NLS-1$
+ }
+
+ private static int nextColonIndex(String str, int pos) {
+ int idx = str.indexOf(':', pos);
+ if (idx < 0) throw new IllegalArgumentException(NLS.bind("Invalid portable string: {0}", str));
+ return idx;
+ }
+
+ public String toPortableString() {
+ StringBuilder sb = new StringBuilder();
+ if (groupId != null) sb.append(groupId); sb.append(':');
+ if (artifactId != null) sb.append(artifactId); sb.append(':');
+ if (version != null) sb.append(version); sb.append(':');
+ if (classifier != null) sb.append(classifier); sb.append(':');
+ return sb.toString();
+ }
+
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public String getClassifier() {
+ return classifier;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactRef.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactRef.java
new file mode 100644
index 00000000..5d5ecb88
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactRef.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import java.io.Serializable;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+
+/**
+ * @author Igor Fedorenko
+ */
+public class ArtifactRef implements Serializable {
+ private static final long serialVersionUID = -7560496230862532267L;
+
+ private final ArtifactKey artifactKey;
+ private final String scope;
+
+ public ArtifactRef(Artifact artifact) {
+ this.artifactKey = new ArtifactKey(artifact);
+ this.scope = artifact.getScope();
+ }
+
+ public ArtifactKey getArtifactKey() {
+ return artifactKey;
+ }
+
+ public String getGroupId() {
+ return artifactKey.getGroupId();
+ }
+
+ public String getArtifactId() {
+ return artifactKey.getArtifactId();
+ }
+
+ public String getVersion() {
+ return artifactKey.getVersion();
+ }
+
+ public String getClassifier() {
+ return artifactKey.getClassifier();
+ }
+
+ public String getScope() {
+ return scope;
+ }
+
+ public static Set<ArtifactKey> toArtifactKey(Set<ArtifactRef> refs) {
+ LinkedHashSet<ArtifactKey> keys = new LinkedHashSet<ArtifactKey>(refs.size());
+ for (ArtifactRef ref : refs) {
+ keys.add(ref.getArtifactKey());
+ }
+ return keys;
+ }
+
+ public static Set<ArtifactRef> fromArtifact(Set<Artifact> artifacts) {
+ LinkedHashSet<ArtifactRef> refs = new LinkedHashSet<ArtifactRef>(artifacts.size());
+ for (Artifact artifact : artifacts) {
+ refs.add(new ArtifactRef(artifact));
+ }
+ return refs;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactRepositoryRef.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactRepositoryRef.java
new file mode 100644
index 00000000..d5a458ac
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ArtifactRepositoryRef.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import java.io.Serializable;
+
+import org.apache.maven.artifact.repository.ArtifactRepository;
+
+
+public class ArtifactRepositoryRef implements Serializable {
+
+ private static final long serialVersionUID = 8859289246547259912L;
+
+ private final String id;
+
+ private final String url;
+
+ private final String username;
+
+ public ArtifactRepositoryRef(ArtifactRepository repository) {
+ this.id = repository.getId();
+ this.url = repository.getUrl();
+ this.username = repository.getAuthentication() != null? repository.getAuthentication().getUsername(): null;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public int hashCode() {
+ int hash = 17;
+ hash = hash * 31 + (id != null ? id.hashCode() : 0);
+ hash = hash * 31 + (url != null ? url.hashCode() : 0);
+ hash = hash * 31 + (username != null ? username.hashCode() : 0);
+ return hash;
+ }
+
+ public boolean equals(Object o) {
+ if(o == this) {
+ return true;
+ }
+ if(!(o instanceof ArtifactRepositoryRef)) {
+ return false;
+ }
+ ArtifactRepositoryRef other = (ArtifactRepositoryRef) o;
+ return eq(id, other.id) && eq(url, other.url) && eq(username, other.username);
+ }
+
+ private static <T> boolean eq(T a, T b) {
+ return a != null? a.equals(b): b == null;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ILocalRepositoryListener.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ILocalRepositoryListener.java
new file mode 100644
index 00000000..5a7d7211
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ILocalRepositoryListener.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import java.io.File;
+
+/**
+ * ILocalRepositoryListener
+ *
+ * @author igor
+ *
+ * @provisional This interface is provisional and can be changed or removed without notice
+ */
+public interface ILocalRepositoryListener {
+
+ /**
+ * New artifact has been downloaded or installed to maven local repository
+ */
+ public void artifactInstalled(File repositoryBasedir, ArtifactKey artifact, File artifactFile);
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMaven.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMaven.java
new file mode 100644
index 00000000..651cf9a8
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMaven.java
@@ -0,0 +1,224 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import java.io.File;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenExecutionResult;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.lifecycle.MavenExecutionPlan;
+import org.apache.maven.model.ConfigurationContainer;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.plugin.MojoExecution;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.settings.Mirror;
+import org.apache.maven.settings.Server;
+import org.apache.maven.settings.Settings;
+import org.apache.maven.settings.building.SettingsProblem;
+import org.apache.maven.wagon.events.TransferListener;
+import org.apache.maven.wagon.proxy.ProxyInfo;
+
+/**
+ * Entry point for all Maven functionality in m2e. Note that this component does not directly support workspace artifact
+ * resolution.
+ *
+ * @author igor
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IMaven {
+
+ /**
+ * Creates new Maven execution request. This method is not long running, but created execution request is configured
+ * to report progress to provided progress monitor. Monitor can be null.
+ */
+ public MavenExecutionRequest createExecutionRequest(IProgressMonitor monitor) throws CoreException;
+
+ // POM Model read/write operations
+
+ public Model readModel(InputStream in) throws CoreException;
+
+ public Model readModel(File pomFile) throws CoreException;
+
+ public void writeModel(Model model, OutputStream out) throws CoreException;
+
+ // artifact resolution
+
+ /**
+ * Resolves specified artifact from specified remote repositories.
+ * @return Artifact resolved artifact
+ * @throws CoreException if the artifact cannot be resolved.
+ */
+ public Artifact resolve(String groupId, String artifactId, String version, String type, String classifier,
+ List<ArtifactRepository> artifactRepositories, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Returns path of the specified artifact relative to repository baseDir. Can use used to access local repository
+ * files bypassing maven resolution logic.
+ */
+ public String getArtifactPath(ArtifactRepository repository, String groupId, String artifactId, String version,
+ String type, String classifier) throws CoreException;
+
+ /**
+ * Returns true if the artifact does NOT exist in the local repository and
+ * known to be UNavailable from all specified repositories.
+ */
+ public boolean isUnavailable(String groupId, String artifactId, String version, String type, String classifier,
+ List<ArtifactRepository> repositories) throws CoreException;
+
+ // read MavenProject
+
+ public MavenProject readProject(File pomFile, IProgressMonitor monitor) throws CoreException;
+
+ public MavenExecutionResult readProject(MavenExecutionRequest request, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Makes MavenProject instances returned by #readProject methods suitable for caching and reuse with other
+ * MavenSession instances.<br/>
+ * Do note that MavenProject.getParentProject() cannot be used for detached MavenProject instances,
+ * #resolveParentProject to read parent project instance.
+ */
+ public void detachFromSession(MavenProject project) throws CoreException;
+
+ public MavenProject resolveParentProject(MavenExecutionRequest request, MavenProject project, IProgressMonitor monitor)
+ throws CoreException;
+
+ // execution
+
+ public MavenExecutionResult execute(MavenExecutionRequest request, IProgressMonitor monitor);
+
+ public MavenSession createSession(MavenExecutionRequest request, MavenProject project);
+
+ public void execute(MavenSession session, MojoExecution execution, IProgressMonitor monitor);
+
+ public MavenExecutionPlan calculateExecutionPlan(MavenExecutionRequest request, MavenProject project,
+ IProgressMonitor monitor) throws CoreException;
+
+ public <T> T getMojoParameterValue(MavenSession session, MojoExecution mojoExecution, String parameter,
+ Class<T> asType) throws CoreException;
+
+ public <T> T getMojoParameterValue(String parameter, Class<T> type, MavenSession session, Plugin plugin,
+ ConfigurationContainer configuration, String goal) throws CoreException;
+
+ // configuration
+
+ /**
+ * TODO should we expose Settings or provide access to servers and proxies instead?
+ */
+ public Settings getSettings() throws CoreException;
+
+ public String getLocalRepositoryPath();
+
+ public ArtifactRepository getLocalRepository() throws CoreException;
+
+ public void populateDefaults(MavenExecutionRequest request) throws CoreException;
+
+ public ArtifactRepository createArtifactRepository(String id, String url) throws CoreException;
+
+ /**
+ * Convenience method, fully equivalent to getArtifactRepositories(true)
+ */
+ public List<ArtifactRepository> getArtifactRepositories() throws CoreException;
+
+ /**
+ * Returns list of remote artifact repositories configured in settings.xml. Only profiles active by default are
+ * considered when calculating the list.
+ *
+ * If injectSettings=true, mirrors, authentication and proxy info will be injected.
+ *
+ * If injectSettings=false, raw repository definition will be used.
+ */
+ public List<ArtifactRepository> getArtifactRepositories(boolean injectSettings) throws CoreException;
+
+ public List<ArtifactRepository> getPluginArtifactRepositories() throws CoreException;
+
+ public List<ArtifactRepository> getPluginArtifactRepositories(boolean injectSettings) throws CoreException;
+
+ public Settings buildSettings(String globalSettings, String userSettings) throws CoreException;
+
+ public void writeSettings(Settings settings, OutputStream out) throws CoreException;
+
+ public List<SettingsProblem> validateSettings(String settings);
+
+ public List<Mirror> getMirrors() throws CoreException;
+
+ public Mirror getMirror(ArtifactRepository repo) throws CoreException;
+
+ public void addSettingsChangeListener(ISettingsChangeListener listener);
+
+ public void removeSettingsChangeListener(ISettingsChangeListener listener);
+
+ public void reloadSettings() throws CoreException;
+
+ public Server decryptPassword(Server server) throws CoreException;
+
+ /**
+ * Temporary solution/workaround for http://jira.codehaus.org/browse/MNG-4194. Extensions realm is created each time
+ * MavenProject instance is built, so we have to remove unused extensions realms to avoid OOME.
+ */
+ @Deprecated
+ public void xxxRemoveExtensionsRealm(MavenProject project);
+
+ /** @provisional */
+ public void addLocalRepositoryListener(ILocalRepositoryListener listener);
+
+ /** @provisional */
+ public void removeLocalRepositoryListener(ILocalRepositoryListener listener);
+
+ /**
+ * Creates wagon TransferListener that can be used with Archetype, NexusIndexer
+ * and other components that use wagon API directly. The listener will adopt
+ * wagon transfer events to corresponding calls to IProgressMonitor and all
+ * registered ILocalRepositoryListeners.
+ *
+ * @deprecated IMaven API should not expose maven.repository.ArtifactTransferListener
+ */
+ public TransferListener createTransferListener(IProgressMonitor monitor);
+
+ public ProxyInfo getProxyInfo(String protocol) throws CoreException;
+
+ /**
+ * Sort projects by build order
+ */
+ public List<MavenProject> getSortedProjects(List<MavenProject> projects) throws CoreException;
+
+ public String resolvePluginVersion(String groupId, String artifactId, MavenSession session) throws CoreException;
+
+ /**
+ * Returns new mojo instances configured according to provided mojoExecution. Caller must release returned mojo with
+ * {@link #releaseMojo(Object, MojoExecution)}. This method is intended to allow introspection of mojo configuration
+ * parameters, use {@link #execute(MavenSession, MojoExecution, IProgressMonitor)} to execute mojo.
+ */
+ public <T> T getConfiguredMojo(MavenSession session, MojoExecution mojoExecution, Class<T> clazz) throws CoreException;
+
+ /**
+ * Releases resources used by Mojo acquired with {@link #getConfiguredMojo(MavenSession, MojoExecution, Class)}
+ */
+ void releaseMojo(Object mojo, MojoExecution mojoExecution) throws CoreException;
+
+ /**
+ * Gets class realm of the specified project.
+ *
+ * @return The class realm of the specified project.
+ */
+ ClassLoader getProjectRealm(MavenProject project);
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfiguration.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfiguration.java
new file mode 100644
index 00000000..1aed83b1
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfiguration.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+
+
+/**
+ * IMavenConfiguration
+ *
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IMavenConfiguration {
+
+ // listeners
+
+ public void addConfigurationChangeListener(IMavenConfigurationChangeListener listener);
+
+ //
+
+ public boolean isOffline();
+
+ public String getGlobalSettingsFile();
+
+ //settable for embedded maven
+ public void setGlobalSettingsFile(String absolutePath);
+
+ public String getUserSettingsFile();
+
+ public void setUserSettingsFile(String absolutePath);
+
+ // resolution
+
+ public boolean isDownloadSources();
+
+ public boolean isDownloadJavaDoc();
+
+ // problem reporting
+
+ public String getJiraUsername();
+
+ public String getJiraPassword();
+
+ // maven execution
+
+ public boolean isDebugOutput();
+
+ //
+
+ public boolean isUpdateProjectsOnStartup();
+
+ public boolean isUpdateIndexesOnStartup();
+
+ // new experimental preferences
+
+ public boolean isHideFoldersOfNestedProjects();
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfigurationChangeListener.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfigurationChangeListener.java
new file mode 100644
index 00000000..c23eeb22
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenConfigurationChangeListener.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * IMavenConfigurationChangeListener
+ *
+ * @author igor
+ */
+public interface IMavenConfigurationChangeListener {
+
+ public void mavenConfigutationChange(MavenConfigurationChangeEvent event) throws CoreException;
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenLauncherConfiguration.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenLauncherConfiguration.java
new file mode 100644
index 00000000..7b6526ec
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/IMavenLauncherConfiguration.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import org.eclipse.core.runtime.CoreException;
+
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+/**
+ * Receive notification of content of plexus configuration.
+ *
+ * @author Igor Fedorenko
+ *
+ * @see MavenRuntime#createLauncherConfiguration
+ */
+public interface IMavenLauncherConfiguration {
+
+ /**
+ * Special realm name used for launcher classpath entries.
+ */
+ public static final String LAUNCHER_REALM = "]laucnher"; //$NON-NLS-1$
+
+ public void setMainType(String type, String realm);
+
+ public void addRealm(String realm);
+
+ public void addProjectEntry(IMavenProjectFacade facade);
+
+ public void addArchiveEntry(String entry) throws CoreException;
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ISettingsChangeListener.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ISettingsChangeListener.java
new file mode 100644
index 00000000..1fb0af01
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ISettingsChangeListener.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import org.eclipse.core.runtime.CoreException;
+
+import org.apache.maven.settings.Settings;
+
+/**
+ * ISettingsChangeListener
+ *
+ * @author igor
+ */
+public interface ISettingsChangeListener {
+
+ public void settingsChanged(Settings settings) throws CoreException;
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenConfigurationChangeEvent.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenConfigurationChangeEvent.java
new file mode 100644
index 00000000..323a53a5
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenConfigurationChangeEvent.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+
+/**
+ * MavenConfigurationChangeEvent
+ *
+ * @author igor
+ */
+public class MavenConfigurationChangeEvent implements MavenPreferenceConstants {
+
+ public static final String P_USER_SETTINGS_FILE = MavenPreferenceConstants.P_USER_SETTINGS_FILE;
+
+ private final String key;
+ private final Object newValue;
+ private final Object oldValue;
+
+ public MavenConfigurationChangeEvent(String key, Object newValue, Object oldValue) {
+ this.key = key;
+ // TODO Auto-generated constructor stub
+ this.newValue = newValue;
+ this.oldValue = oldValue;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public Object getNewValue() {
+ return newValue;
+ }
+
+ public Object getOldValue() {
+ return oldValue;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java
new file mode 100644
index 00000000..100d0716
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenModelManager.java
@@ -0,0 +1,581 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.osgi.util.NLS;
+
+import org.apache.maven.RepositoryUtils;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.model.DependencyManagement;
+import org.apache.maven.project.MavenProject;
+
+import org.sonatype.aether.artifact.ArtifactTypeRegistry;
+import org.sonatype.aether.collection.CollectRequest;
+import org.sonatype.aether.collection.DependencyCollectionException;
+import org.sonatype.aether.collection.DependencyGraphTransformer;
+import org.sonatype.aether.graph.DependencyNode;
+import org.sonatype.aether.util.DefaultRepositorySystemSession;
+import org.sonatype.aether.util.filter.ScopeDependencyFilter;
+import org.sonatype.aether.util.graph.CloningDependencyVisitor;
+import org.sonatype.aether.util.graph.FilteringDependencyVisitor;
+import org.sonatype.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
+import org.sonatype.aether.util.graph.transformer.JavaEffectiveScopeCalculator;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.model.edit.pom.Build;
+import org.eclipse.m2e.model.edit.pom.Configuration;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.Exclusion;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.Plugin;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.util.PomResourceFactoryImpl;
+import org.eclipse.m2e.model.edit.pom.util.PomResourceImpl;
+
+
+/**
+ * Model manager used to read and and modify Maven models
+ *
+ * @author Eugene Kuleshov
+ *
+ * XXX fix circular dependency
+ */
+public class MavenModelManager {
+
+ static final PomFactory POM_FACTORY = PomFactory.eINSTANCE;
+
+ private final MavenProjectManager projectManager;
+
+ private final MavenConsole console;
+
+ private final IMaven maven;
+
+ public MavenModelManager(IMaven maven, MavenProjectManager projectManager, MavenConsole console) {
+ this.maven = maven;
+ this.projectManager = projectManager;
+ this.console = console;
+ }
+
+ public PomResourceImpl loadResource(IFile pomFile) throws CoreException {
+ String path = pomFile.getFullPath().toOSString();
+ URI uri = URI.createPlatformResourceURI(path, true);
+
+ try {
+ Resource resource = new PomResourceFactoryImpl().createResource(uri);
+ resource.load(new HashMap());
+ return (PomResourceImpl)resource;
+
+ } catch(Exception ex) {
+ String msg = NLS.bind(Messages.MavenModelManager_error_cannot_load, pomFile);
+ MavenLogger.log(msg, ex);
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg, ex));
+ }
+ }
+
+ public org.apache.maven.model.Model readMavenModel(InputStream reader) throws CoreException {
+ return maven.readModel(reader);
+ }
+
+ public org.apache.maven.model.Model readMavenModel(File pomFile) throws CoreException {
+ return maven.readModel(pomFile);
+ }
+
+ public org.apache.maven.model.Model readMavenModel(IFile pomFile) throws CoreException {
+ return maven.readModel(pomFile.getLocation().toFile());
+ }
+
+ public void createMavenModel(IFile pomFile, org.apache.maven.model.Model model) throws CoreException {
+ String pomFileName = pomFile.getLocation().toString();
+ if(pomFile.exists()) {
+ String msg = NLS.bind(Messages.MavenModelManager_error_pom_exists, pomFileName);
+ console.logError(msg);
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg, null));
+ }
+
+ try {
+ ByteArrayOutputStream buf = new ByteArrayOutputStream();
+
+ maven.writeModel(model, buf);
+
+ // XXX MNGECLIPSE-495
+ DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+ documentBuilderFactory.setNamespaceAware(false);
+ DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
+
+ Document document = documentBuilder.parse(new ByteArrayInputStream(buf.toByteArray()));
+ Element documentElement = document.getDocumentElement();
+
+ NamedNodeMap attributes = documentElement.getAttributes();
+
+ if(attributes == null || attributes.getNamedItem("xmlns") == null) { //$NON-NLS-1$
+ Attr attr = document.createAttribute("xmlns"); //$NON-NLS-1$
+ attr.setTextContent("http://maven.apache.org/POM/4.0.0"); //$NON-NLS-1$
+ documentElement.setAttributeNode(attr);
+ }
+
+ if(attributes == null || attributes.getNamedItem("xmlns:xsi") == null) { //$NON-NLS-1$
+ Attr attr = document.createAttribute("xmlns:xsi"); //$NON-NLS-1$
+ attr.setTextContent("http://www.w3.org/2001/XMLSchema-instance"); //$NON-NLS-1$
+ documentElement.setAttributeNode(attr);
+ }
+
+ if(attributes == null || attributes.getNamedItem("xsi:schemaLocation") == null) { //$NON-NLS-1$
+ Attr attr = document.createAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation"); //$NON-NLS-1$ //$NON-NLS-2$
+ attr.setTextContent("http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"); //$NON-NLS-1$
+ documentElement.setAttributeNode(attr);
+ }
+
+ TransformerFactory transfac = TransformerFactory.newInstance();
+ Transformer trans = transfac.newTransformer();
+ trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); //$NON-NLS-1$
+
+ buf.reset();
+ trans.transform(new DOMSource(document), new StreamResult(buf));
+
+ pomFile.create(new ByteArrayInputStream(buf.toByteArray()), true, new NullProgressMonitor());
+
+ } catch(RuntimeException ex) {
+ String msg = NLS.bind(Messages.MavenModelManager_error_create, pomFileName, ex.toString());
+ console.logError(msg);
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg, ex));
+ } catch(Exception ex) {
+ String msg = NLS.bind(Messages.MavenModelManager_error_create, pomFileName, ex.toString());
+ console.logError(msg);
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg, ex));
+ }
+ }
+
+ public synchronized DependencyNode readDependencyTree(IFile file, String classpath,
+ IProgressMonitor monitor) throws CoreException {
+ monitor.setTaskName(Messages.MavenModelManager_monitor_reading);
+ MavenProject mavenProject = readMavenProject(file, monitor);
+
+ return readDependencyTree(mavenProject, classpath, monitor);
+ }
+
+ public synchronized DependencyNode readDependencyTree(MavenProject mavenProject,
+ String classpath, IProgressMonitor monitor) throws CoreException {
+ monitor.setTaskName(Messages.MavenModelManager_monitor_building);
+
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+ DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(maven.createSession(
+ maven.createExecutionRequest(monitor), mavenProject).getRepositorySession());
+
+ DependencyGraphTransformer transformer = new ChainedDependencyGraphTransformer(new JavaEffectiveScopeCalculator(),
+ new NearestVersionConflictResolver());
+ session.setDependencyGraphTransformer(transformer);
+
+ ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(maven.getProjectRealm(mavenProject));
+
+ ArtifactTypeRegistry stereotypes = session.getArtifactTypeRegistry();
+
+ CollectRequest request = new CollectRequest();
+ request.setRequestContext("project"); //$NON-NLS-1$
+ request.setRepositories(mavenProject.getRemoteProjectRepositories());
+
+ for(org.apache.maven.model.Dependency dependency : mavenProject.getDependencies()) {
+ request.addDependency(RepositoryUtils.toDependency(dependency, stereotypes));
+ }
+
+ DependencyManagement depMngt = mavenProject.getDependencyManagement();
+ if(depMngt != null) {
+ for(org.apache.maven.model.Dependency dependency : depMngt.getDependencies()) {
+ request.addManagedDependency(RepositoryUtils.toDependency(dependency, stereotypes));
+ }
+ }
+
+ DependencyNode node;
+ try {
+ node = MavenPlugin.getDefault().getRepositorySystem().collectDependencies(session, request).getRoot();
+ } catch(DependencyCollectionException ex) {
+ String msg = Messages.MavenModelManager_error_read;
+ MavenLogger.log(msg, ex);
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg, ex));
+ }
+
+ Collection<String> scopes = new HashSet<String>();
+ Collections.addAll(scopes, Artifact.SCOPE_SYSTEM, Artifact.SCOPE_COMPILE, Artifact.SCOPE_PROVIDED,
+ Artifact.SCOPE_RUNTIME, Artifact.SCOPE_TEST);
+ if(Artifact.SCOPE_COMPILE.equals(classpath)) {
+ scopes.remove(Artifact.SCOPE_COMPILE);
+ scopes.remove(Artifact.SCOPE_SYSTEM);
+ scopes.remove(Artifact.SCOPE_PROVIDED);
+ } else if(Artifact.SCOPE_RUNTIME.equals(classpath)) {
+ scopes.remove(Artifact.SCOPE_COMPILE);
+ scopes.remove(Artifact.SCOPE_RUNTIME);
+ } else if(Artifact.SCOPE_COMPILE_PLUS_RUNTIME.equals(classpath)) {
+ scopes.remove(Artifact.SCOPE_COMPILE);
+ scopes.remove(Artifact.SCOPE_SYSTEM);
+ scopes.remove(Artifact.SCOPE_PROVIDED);
+ scopes.remove(Artifact.SCOPE_RUNTIME);
+ } else {
+ scopes.clear();
+ }
+
+ CloningDependencyVisitor cloner = new CloningDependencyVisitor();
+ node.accept(new FilteringDependencyVisitor(cloner, new ScopeDependencyFilter(null, scopes)));
+ node = cloner.getRootNode();
+
+ return node;
+ } finally {
+ Thread.currentThread().setContextClassLoader(oldClassLoader);
+ }
+ }
+
+ public MavenProject readMavenProject(IFile file, IProgressMonitor monitor) throws CoreException {
+ IMavenProjectFacade projectFacade = projectManager.create(file, true, monitor);
+ MavenProject mavenProject = projectFacade.getMavenProject(monitor);
+ return mavenProject;
+ }
+
+// public ProjectDocument readProjectDocument(IFile pomFile) throws CoreException {
+// String name = pomFile.getProject().getName() + "/" + pomFile.getProjectRelativePath();
+// try {
+// return ProjectDocument.Factory.parse(pomFile.getLocation().toFile(), getXmlOptions());
+// } catch(XmlException ex) {
+// String msg = "Unable to parse " + name;
+// console.logError(msg + "; " + ex.toString());
+// throw new CoreException(new Status(IStatus.ERROR, MavenPlugin.PLUGIN_ID, -1, msg, ex));
+// } catch(IOException ex) {
+// String msg = "Unable to read " + name;
+// console.logError(msg + "; " + ex.toString());
+// throw new CoreException(new Status(IStatus.ERROR, MavenPlugin.PLUGIN_ID, -1, msg, ex));
+// }
+// }
+//
+// public ProjectDocument readProjectDocument(File pom) throws CoreException {
+// try {
+// return ProjectDocument.Factory.parse(pom, getXmlOptions());
+// } catch(XmlException ex) {
+// String msg = "Unable to parse " + pom.getAbsolutePath();
+// console.logError(msg + "; " + ex.toString());
+// throw new CoreException(new Status(IStatus.ERROR, MavenPlugin.PLUGIN_ID, -1, msg, ex));
+// } catch(IOException ex) {
+// String msg = "Unable to read " + pom.getAbsolutePath();
+// console.logError(msg + "; " + ex.toString());
+// throw new CoreException(new Status(IStatus.ERROR, MavenPlugin.PLUGIN_ID, -1, msg, ex));
+// }
+// }
+
+ public void updateProject(IFile pomFile, ProjectUpdater updater) {
+ File pom = pomFile.getLocation().toFile();
+ PomResourceImpl resource = null;
+ try {
+ resource = loadResource(pomFile);
+ updater.update(resource.getModel());
+ resource.save(Collections.EMPTY_MAP);
+ } catch(Exception ex) {
+ String msg = "Unable to update " + pom;
+ console.logError(msg + "; " + ex.getMessage()); //$NON-NLS-1$
+ MavenLogger.log(msg, ex);
+ } finally {
+ if (resource != null) {
+ resource.unload();
+ }
+ }
+ }
+
+ public void addDependency(IFile pomFile, org.apache.maven.model.Dependency dependency) {
+ updateProject(pomFile, new DependencyAdder(dependency));
+ }
+
+ public void addModule(IFile pomFile, final String moduleName) {
+ updateProject(pomFile, new ModuleAdder(moduleName));
+ }
+
+// /**
+// * Project updater for adding Maven namespace declaration
+// */
+// public static class NamespaceAdder extends ProjectUpdater {
+//
+// public void update(Model model) {
+// DocumentRoot documentRoot = PomFactory.eINSTANCE.createDocumentRoot();
+// EMap<String, String> prefixMap = documentRoot.getXMLNSPrefixMap();
+// EMap<String, String> schemaLocation = documentRoot.getXSISchemaLocation();
+//
+// // 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"
+//
+//// XmlCursor cursor = project.newCursor();
+//// cursor.toNextToken();
+//// if(!cursor.toFirstAttribute()) {
+//// cursor.toNextToken();
+//// }
+////
+//// String uri = ProjectDocument.type.getDocumentElementName().getNamespaceURI();
+//// cursor.insertNamespace("", uri);
+//// cursor.insertNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
+//// cursor.insertAttributeWithValue( //
+//// new QName("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation", "xsi"), uri
+//// + " http://maven.apache.org/xsd/maven-4.0.0.xsd");
+// }
+//
+// }
+
+ /**
+ * Project updater for adding dependencies
+ */
+ public static class DependencyAdder extends ProjectUpdater {
+
+ private final org.apache.maven.model.Dependency dependency;
+
+ public DependencyAdder(org.apache.maven.model.Dependency dependency) {
+ this.dependency = dependency;
+ }
+
+ public void update(org.eclipse.m2e.model.edit.pom.Model model) {
+ Dependency dependency = POM_FACTORY.createDependency();
+
+ dependency.setGroupId(this.dependency.getGroupId());
+ dependency.setArtifactId(this.dependency.getArtifactId());
+
+ if(this.dependency.getVersion()!=null) {
+ dependency.setVersion(this.dependency.getVersion());
+ }
+
+ if(this.dependency.getClassifier() != null) {
+ dependency.setClassifier(this.dependency.getClassifier());
+ }
+
+ if(this.dependency.getType() != null //
+ && !"jar".equals(this.dependency.getType()) // //$NON-NLS-1$
+ && !"null".equals(this.dependency.getType())) { // guard against MNGECLIPSE-622 //$NON-NLS-1$
+ dependency.setType(this.dependency.getType());
+ }
+
+ if(this.dependency.getScope() != null && !"compile".equals(this.dependency.getScope())) { //$NON-NLS-1$
+ dependency.setScope(this.dependency.getScope());
+ }
+
+ if(this.dependency.getSystemPath() != null) {
+ dependency.setSystemPath(this.dependency.getSystemPath());
+ }
+
+ if(this.dependency.isOptional()) {
+ dependency.setOptional("true"); //$NON-NLS-1$
+ }
+
+ if(!this.dependency.getExclusions().isEmpty()) {
+
+ Iterator<org.apache.maven.model.Exclusion> it = this.dependency.getExclusions().iterator();
+ while(it.hasNext()) {
+ org.apache.maven.model.Exclusion e = it.next();
+ Exclusion exclusion = POM_FACTORY.createExclusion();
+ exclusion.setGroupId(e.getGroupId());
+ exclusion.setArtifactId(e.getArtifactId());
+ dependency.getExclusions().add(exclusion);
+ }
+ }
+
+ // search for dependency with same GAC and remove if found
+ Iterator<Dependency> it = model.getDependencies().iterator();
+ boolean mergeScope = false;
+ String oldScope = Artifact.SCOPE_COMPILE;
+ while (it.hasNext()) {
+ Dependency dep = it.next();
+ if (dep.getGroupId().equals(dependency.getGroupId()) &&
+ dep.getArtifactId().equals(dependency.getArtifactId()) &&
+ compareNulls(dep.getClassifier(), dependency.getClassifier())) {
+ oldScope = dep.getScope();
+ it.remove();
+ mergeScope = true;
+ }
+ }
+
+ if (mergeScope) {
+ // merge scopes
+ if (oldScope == null) {
+ oldScope = Artifact.SCOPE_COMPILE;
+ }
+
+ String newScope = this.dependency.getScope();
+ if (newScope == null) {
+ newScope = Artifact.SCOPE_COMPILE;
+ }
+
+ if (!oldScope.equals(newScope)) {
+ boolean systemScope = false;
+ boolean providedScope = false;
+ boolean compileScope = false;
+ boolean runtimeScope = false;
+ boolean testScope = false;
+
+ // test old scope
+ if ( Artifact.SCOPE_COMPILE.equals( oldScope ) ) {
+ systemScope = true;
+ providedScope = true;
+ compileScope = true;
+ runtimeScope = false;
+ testScope = false;
+ } else if ( Artifact.SCOPE_RUNTIME.equals( oldScope ) ) {
+ systemScope = false;
+ providedScope = false;
+ compileScope = true;
+ runtimeScope = true;
+ testScope = false;
+ } else if ( Artifact.SCOPE_TEST.equals( oldScope ) ) {
+ systemScope = true;
+ providedScope = true;
+ compileScope = true;
+ runtimeScope = true;
+ testScope = true;
+ }
+
+ // merge with new one
+ if ( Artifact.SCOPE_COMPILE.equals( newScope ) ) {
+ systemScope = systemScope || true;
+ providedScope = providedScope || true;
+ compileScope = compileScope || true;
+ runtimeScope = runtimeScope || false;
+ testScope = testScope || false;
+ } else if ( Artifact.SCOPE_RUNTIME.equals( newScope ) ) {
+ systemScope = systemScope || false;
+ providedScope = providedScope || false;
+ compileScope = compileScope || true;
+ runtimeScope = runtimeScope || true;
+ testScope = testScope || false;
+ } else if ( Artifact.SCOPE_TEST.equals( newScope ) ) {
+ systemScope = systemScope || true;
+ providedScope = providedScope || true;
+ compileScope = compileScope || true;
+ runtimeScope = runtimeScope || true;
+ testScope = testScope || true;
+ }
+
+ if (testScope) {
+ newScope = Artifact.SCOPE_TEST;
+ } else if (runtimeScope) {
+ newScope = Artifact.SCOPE_RUNTIME;
+ } else if (compileScope) {
+ newScope = Artifact.SCOPE_COMPILE;
+ } else {
+ // unchanged
+ }
+
+ dependency.setScope(newScope);
+ }
+ }
+
+ model.getDependencies().add(dependency);
+ }
+
+ @SuppressWarnings("null")
+ private boolean compareNulls(String s1, String s2) {
+ if (s1 == null && s2 == null) {
+ return true;
+ }
+ if ((s1 == null && s2 != null) || (s2 == null && s1 != null)) {
+ return false;
+ }
+ return s1.equals(s2);
+ }
+ }
+
+
+ /**
+ * Project updater for adding modules
+ */
+ public static class ModuleAdder extends ProjectUpdater {
+
+ private final String moduleName;
+
+ public ModuleAdder(String moduleName) {
+ this.moduleName = moduleName;
+ }
+
+ public void update(Model model) {
+ model.getModules().add(moduleName);
+ }
+ }
+
+ /**
+ * Project updater for adding plugins
+ */
+ public static class PluginAdder extends ProjectUpdater {
+
+ private final String groupId;
+ private final String artifactId;
+ private final String version;
+
+ public PluginAdder(String groupId, String artifactId, String version) {
+ this.groupId = groupId;
+ this.artifactId = artifactId;
+ this.version = version;
+ }
+
+ public void update(Model model) {
+ Build build = model.getBuild();
+ if(build==null) {
+ build = POM_FACTORY.createBuild();
+ model.setBuild(build);
+ }
+
+ Plugin plugin = POM_FACTORY.createPlugin();
+
+ if(!"org.apache.maven.plugins".equals(this.groupId)) { //$NON-NLS-1$
+ plugin.setGroupId(this.groupId);
+ }
+
+ plugin.setArtifactId(this.artifactId);
+
+ if(this.version != null) {
+ plugin.setVersion(this.version);
+ }
+
+ Configuration configuration = POM_FACTORY.createConfiguration();
+ plugin.setConfiguration(configuration);
+
+ build.getPlugins().add(plugin);
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenRuntime.java
new file mode 100644
index 00000000..31940164
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenRuntime.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+ * Maven runtime
+ *
+ * @author Eugene Kuleshov
+ * @author Igor Fedorenko
+ *
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface MavenRuntime {
+
+ public abstract boolean isEditable();
+
+ /**
+ * Reads m2.conf file and notifies configuration collector of the logical content of plexus configuration.
+ *
+ * Collector callback methods are invoked in the order corresponding
+ * configuration elements are present in m2.conf file.
+ */
+ public abstract void createLauncherConfiguration(IMavenLauncherConfiguration collector, IProgressMonitor monitor) throws CoreException;
+
+ public abstract String getLocation();
+
+ public abstract String getSettings();
+
+ public abstract boolean isAvailable();
+
+ public String getVersion();
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenRuntimeManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenRuntimeManager.java
new file mode 100644
index 00000000..0fd11501
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/MavenRuntimeManager.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+
+import org.eclipse.m2e.core.internal.embedder.MavenEmbeddedRuntime;
+import org.eclipse.m2e.core.internal.embedder.MavenExternalRuntime;
+import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+
+/**
+ * Maven runtime manager
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenRuntimeManager {
+
+ public static final String DEFAULT = "DEFAULT"; //$NON-NLS-1$
+
+ public static final String EMBEDDED = "EMBEDDED"; //$NON-NLS-1$
+
+ public static final String WORKSPACE = "WORKSPACE"; //$NON-NLS-1$
+
+ private final IPreferenceStore preferenceStore;
+
+ private Map<String, MavenRuntime> runtimes = new LinkedHashMap<String, MavenRuntime>();
+
+ private MavenRuntime embeddedRuntime;
+
+ private MavenRuntime workspaceRuntime;
+
+ private MavenRuntime defaultRuntime;
+
+
+ public MavenRuntimeManager(IPreferenceStore preferenceStore) {
+ this.preferenceStore = preferenceStore;
+ initRuntimes();
+ }
+
+ public void setEmbeddedRuntime(MavenRuntime embeddedRuntime) {
+ this.embeddedRuntime = embeddedRuntime;
+ }
+
+ public void setWorkspaceRuntime(MavenRuntime workspaceRuntime) {
+ this.workspaceRuntime = workspaceRuntime;
+ }
+
+ public MavenRuntime getDefaultRuntime() {
+ if(defaultRuntime == null || !defaultRuntime.isAvailable()) {
+ return embeddedRuntime;
+ }
+ return this.defaultRuntime;
+ }
+
+ public MavenRuntime getRuntime(String location) {
+ if(location==null || location.length()==0 || DEFAULT.equals(location)) {
+ return getDefaultRuntime();
+ }
+ if(EMBEDDED.equals(location)) {
+ return embeddedRuntime;
+ }
+ if(WORKSPACE.equals(location)) {
+ return workspaceRuntime;
+ }
+ return runtimes.get(location);
+ }
+
+ public List<MavenRuntime> getMavenRuntimes() {
+ ArrayList<MavenRuntime> runtimes = new ArrayList<MavenRuntime>();
+
+ runtimes.add(embeddedRuntime);
+
+ if(workspaceRuntime != null && workspaceRuntime.isAvailable()) {
+ runtimes.add(workspaceRuntime);
+ }
+
+ for(MavenRuntime runtime : this.runtimes.values()) {
+ if(runtime.isAvailable()) {
+ runtimes.add(runtime);
+ }
+ }
+ return runtimes;
+ }
+
+ public void reset() {
+ preferenceStore.setToDefault(MavenPreferenceConstants.P_RUNTIMES);
+ preferenceStore.setToDefault(MavenPreferenceConstants.P_DEFAULT_RUNTIME);
+
+ initRuntimes();
+ }
+
+ public void setDefaultRuntime(MavenRuntime runtime) {
+ this.defaultRuntime = runtime;
+
+ if(runtime == null) {
+ preferenceStore.setToDefault(MavenPreferenceConstants.P_DEFAULT_RUNTIME);
+ } else {
+ preferenceStore.setValue(MavenPreferenceConstants.P_DEFAULT_RUNTIME, runtime.getLocation());
+ }
+ }
+
+ public void setRuntimes(List<MavenRuntime> runtimes) {
+ this.runtimes.clear();
+
+ String separator = ""; //$NON-NLS-1$
+ StringBuffer sb = new StringBuffer();
+ for(MavenRuntime runtime : runtimes) {
+ if(runtime.isEditable()) {
+ this.runtimes.put(runtime.getLocation(), runtime);
+ sb.append(separator).append(runtime.getLocation());
+ separator = "|"; //$NON-NLS-1$
+ }
+ }
+ preferenceStore.setValue(MavenPreferenceConstants.P_RUNTIMES, sb.toString());
+ }
+
+ private void initRuntimes() {
+ runtimes.clear();
+
+ defaultRuntime = null;
+
+ String selected = preferenceStore.getString(MavenPreferenceConstants.P_DEFAULT_RUNTIME);
+
+ String runtimesPreference = preferenceStore.getString(MavenPreferenceConstants.P_RUNTIMES);
+ if(runtimesPreference!=null && runtimesPreference.length()>0) {
+ String[] locations = runtimesPreference.split("\\|"); //$NON-NLS-1$
+ for(int i = 0; i < locations.length; i++ ) {
+ MavenRuntime runtime = createExternalRuntime(locations[i]);
+ runtimes.put(runtime.getLocation(), runtime);
+ if(runtime.getLocation().equals(selected)) {
+ defaultRuntime = runtime;
+ }
+ }
+ }
+ }
+
+ public static MavenRuntime createExternalRuntime(String location) {
+ return new MavenExternalRuntime(location);
+ }
+
+ public String getGlobalSettingsFile() {
+ //only return the preference store value for the global settings file if its an embedded runtime
+ if(defaultRuntime == null || defaultRuntime instanceof MavenEmbeddedRuntime){
+ String globalSettings = preferenceStore.getString(MavenPreferenceConstants.P_GLOBAL_SETTINGS_FILE);
+ return globalSettings.trim().length()==0 ? null : globalSettings;
+ }
+ return defaultRuntime == null ? null : defaultRuntime.getSettings();
+ }
+
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/NearestVersionConflictResolver.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/NearestVersionConflictResolver.java
new file mode 100644
index 00000000..4e24efe3
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/NearestVersionConflictResolver.java
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.IdentityHashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+
+import org.sonatype.aether.RepositoryException;
+import org.sonatype.aether.collection.DependencyGraphTransformationContext;
+import org.sonatype.aether.collection.DependencyGraphTransformer;
+import org.sonatype.aether.collection.UnsolvableVersionConflictException;
+import org.sonatype.aether.graph.DependencyNode;
+import org.sonatype.aether.util.graph.DefaultDependencyNode;
+import org.sonatype.aether.util.graph.transformer.ConflictIdSorter;
+import org.sonatype.aether.util.graph.transformer.TransformationContextKeys;
+import org.sonatype.aether.version.Version;
+import org.sonatype.aether.version.VersionConstraint;
+
+
+class NearestVersionConflictResolver implements DependencyGraphTransformer {
+
+ public DependencyNode transformGraph(DependencyNode node, DependencyGraphTransformationContext context)
+ throws RepositoryException {
+ List<?> sortedConflictIds = (List<?>) context.get(TransformationContextKeys.SORTED_CONFLICT_IDS);
+ if(sortedConflictIds == null) {
+ ConflictIdSorter sorter = new ConflictIdSorter();
+ sorter.transformGraph(node, context);
+
+ sortedConflictIds = (List<?>) context.get(TransformationContextKeys.SORTED_CONFLICT_IDS);
+ }
+
+ Map<?, ?> conflictIds = (Map<?, ?>) context.get(TransformationContextKeys.CONFLICT_IDS);
+ if(conflictIds == null) {
+ throw new RepositoryException("conflict groups have not been identified");
+ }
+
+ Map<DependencyNode, Integer> depths = new IdentityHashMap<DependencyNode, Integer>(conflictIds.size());
+ for(Object key : sortedConflictIds) {
+ ConflictGroup group = new ConflictGroup(key);
+ depths.clear();
+ selectVersion(node, null, 0, depths, group, conflictIds);
+ pruneNonSelectedVersions(group, conflictIds);
+ }
+
+ return node;
+ }
+
+ private void selectVersion(DependencyNode node, DependencyNode parent, int depth,
+ Map<DependencyNode, Integer> depths, ConflictGroup group, Map<?, ?> conflictIds) throws RepositoryException {
+ Integer smallestDepth = depths.get(node);
+ if(smallestDepth == null || smallestDepth.intValue() > depth) {
+ depths.put(node, Integer.valueOf(depth));
+ } else {
+ return;
+ }
+
+ Object key = conflictIds.get(node);
+ if(group.key.equals(key)) {
+ Position pos = new Position(parent, depth);
+ if(parent != null) {
+ group.positions.add(pos);
+ }
+
+ if(!group.isAcceptable(node.getVersion())) {
+ return;
+ }
+
+ group.candidates.put(node, pos);
+
+ if(!node.getVersionConstraint().getRanges().isEmpty()) {
+ group.constraints.add(node.getVersionConstraint());
+ }
+
+ if(group.version == null || isNearer(pos, node.getVersion(), group.position, group.version)) {
+ group.winner = node;
+ group.version = node.getVersion();
+ group.position = pos;
+ }
+
+ if(!group.isAcceptable(group.version)) {
+ group.winner = null;
+ group.version = null;
+
+ for(Iterator<Map.Entry<DependencyNode, Position>> it = group.candidates.entrySet().iterator(); it.hasNext();) {
+ Map.Entry<DependencyNode, Position> entry = it.next();
+ Version version = entry.getKey().getVersion();
+ pos = entry.getValue();
+
+ if(!group.isAcceptable(version)) {
+ it.remove();
+ } else if(group.version == null || isNearer(pos, version, group.position, group.version)) {
+ group.winner = entry.getKey();
+ group.version = version;
+ group.position = pos;
+ }
+ }
+
+ if(group.version == null) {
+ Collection<String> versions = new LinkedHashSet<String>();
+ for(VersionConstraint constraint : group.constraints) {
+ versions.add(constraint.toString());
+ }
+ throw new UnsolvableVersionConflictException(group.key, versions);
+ }
+ }
+ }
+
+ depth++ ;
+
+ for(DependencyNode child : node.getChildren()) {
+ selectVersion(child, node, depth, depths, group, conflictIds);
+ }
+ }
+
+ private boolean isNearer(Position pos1, Version ver1, Position pos2, Version ver2) {
+ if(pos1.depth < pos2.depth) {
+ return true;
+ } else if(pos1.depth == pos2.depth && pos1.parent == pos2.parent && ver1.compareTo(ver2) > 0) {
+ return true;
+ }
+ return false;
+ }
+
+ private void pruneNonSelectedVersions(ConflictGroup group, Map<?, ?> conflictIds) {
+ for(Position pos : group.positions) {
+ ConflictNode conflictNode = null;
+
+ for(ListIterator<DependencyNode> it = pos.parent.getChildren().listIterator(); it.hasNext();) {
+ DependencyNode child = it.next();
+
+ Object key = conflictIds.get(child);
+
+ if(group.key.equals(key)) {
+ if(!group.pruned && group.position.depth == pos.depth && group.version.equals(child.getVersion())) {
+ group.pruned = true;
+ } else if(pos.equals(group.position)) {
+ it.remove();
+ } else if(conflictNode == null) {
+ conflictNode = new ConflictNode(child, group.winner);
+ it.set(conflictNode);
+ } else {
+ it.remove();
+
+ if(conflictNode.getVersion().compareTo(child.getVersion()) < 0) {
+ conflictNode.setDependency(child.getDependency());
+ conflictNode.setVersion(child.getVersion());
+ conflictNode.setVersionConstraint(child.getVersionConstraint());
+ conflictNode.setPremanagedVersion(child.getPremanagedVersion());
+ conflictNode.setRelocations(child.getRelocations());
+ }
+ }
+ }
+ }
+ }
+ }
+
+ static final class ConflictGroup {
+
+ final Object key;
+
+ final Collection<VersionConstraint> constraints = new HashSet<VersionConstraint>();
+
+ final Map<DependencyNode, Position> candidates = new IdentityHashMap<DependencyNode, Position>(32);
+
+ DependencyNode winner;
+
+ Version version;
+
+ Position position;
+
+ final Collection<Position> positions = new LinkedHashSet<Position>();
+
+ boolean pruned;
+
+ public ConflictGroup(Object key) {
+ this.key = key;
+ this.position = new Position(null, Integer.MAX_VALUE);
+ }
+
+ boolean isAcceptable(Version version) {
+ for(VersionConstraint constraint : constraints) {
+ if(!constraint.containsVersion(version)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return key + " > " + version; //$NON-NLS-1$
+ }
+
+ }
+
+ static final class Position {
+
+ final DependencyNode parent;
+
+ final int depth;
+
+ final int hash;
+
+ public Position(DependencyNode parent, int depth) {
+ this.parent = parent;
+ this.depth = depth;
+ hash = 31 * System.identityHashCode(parent) + depth;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if(this == obj) {
+ return true;
+ } else if(!(obj instanceof Position)) {
+ return false;
+ }
+ Position that = (Position) obj;
+ return this.parent == that.parent && this.depth == that.depth;
+ }
+
+ @Override
+ public int hashCode() {
+ return hash;
+ }
+
+ @Override
+ public String toString() {
+ return depth + " > " + parent; //$NON-NLS-1$
+ }
+
+ }
+
+ static final class ConflictNode extends DefaultDependencyNode {
+
+ public ConflictNode(DependencyNode node, DependencyNode related) {
+ super(node);
+ setAliases(Collections.singletonList(related.getDependency().getArtifact()));
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ProjectUpdater.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ProjectUpdater.java
new file mode 100644
index 00000000..42fbf301
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/embedder/ProjectUpdater.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.embedder;
+
+import org.eclipse.m2e.model.edit.pom.Model;
+
+/**
+ * Project updater
+ *
+ * @author Eugene Kuleshov
+ */
+public abstract class ProjectUpdater {
+
+ public abstract void update(Model model);
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IIndex.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IIndex.java
new file mode 100644
index 00000000..0add0fd5
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IIndex.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.index;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+
+
+/**
+ * @author igor
+ */
+public interface IIndex {
+
+ // search keys
+
+ public static final String SEARCH_GROUP = "groupId"; //$NON-NLS-1$
+
+ public static final String SEARCH_ARTIFACT = "artifact"; //$NON-NLS-1$
+
+ public static final String SEARCH_PLUGIN = "plugin"; //$NON-NLS-1$
+
+ public static final String SEARCH_ARCHETYPE = "archetype"; //$NON-NLS-1$
+
+ public static final String SEARCH_PACKAGING = "packaging"; //$NON-NLS-1$
+
+ public static final String SEARCH_SHA1 = "sha1"; //$NON-NLS-1$
+
+ /**
+ * like SEARCH_ARTIFACT but will only return artifacts with packaging == pom
+ */
+ public static final String SEARCH_PARENTS = "parents"; //$NON-NLS-1$
+
+ // search classifiers
+
+// public enum SearchClassifiers {
+// JARS,
+//
+// JAVADOCS,
+//
+// SOURCES,
+//
+// TESTS
+// }
+//
+// public Set<SearchClassifiers> ALL_CLASSIFIERS = new HashSet<IIndex.SearchClassifiers>(Arrays.asList(SearchClassifiers
+// .values()));
+
+ //
+
+ public static final int SEARCH_JARS = 1 << 0;
+
+ public static final int SEARCH_JAVADOCS = 1 << 1;
+
+ public static final int SEARCH_SOURCES = 1 << 2;
+
+ public static final int SEARCH_TESTS = 1 << 3;
+
+ public static final int SEARCH_ALL = 15;
+
+ // availability flags
+
+ public static final int PRESENT = 1;
+
+ public static final int NOT_PRESENT = 0;
+
+ public static final int NOT_AVAILABLE = 2;
+
+ // index queries
+
+ public IndexedArtifactFile getIndexedArtifactFile(ArtifactKey artifact) throws CoreException;
+
+ public IndexedArtifactFile identify(File file) throws CoreException;
+
+ /**
+ * Performs a search for artifacts with given parameters.
+ *
+ * @param groupId
+ * @param artifactId
+ * @param version
+ * @param packaging
+ * @return
+ * @throws CoreException
+ */
+ public Collection<IndexedArtifact> find(SearchExpression groupId, SearchExpression artifactId,
+ SearchExpression version, SearchExpression packaging) throws CoreException;
+
+ /**
+ * Performs a search for artifacts with given parameters. Similar to
+ * {@link IIndex#find(SearchExpression, SearchExpression, SearchExpression, SearchExpression)}, but here you are able
+ * to pass in multiple values for all searches. All elements of collections will form an "OR" of one query.
+ *
+ * @param groupId
+ * @param artifactId
+ * @param version
+ * @param packaging
+ * @return
+ * @throws CoreException
+ */
+ public Collection<IndexedArtifact> find(Collection<SearchExpression> groupId,
+ Collection<SearchExpression> artifactId, Collection<SearchExpression> version,
+ Collection<SearchExpression> packaging) throws CoreException;
+
+ /**
+ * Convenience method to search in all indexes enabled for repositories defined in settings.xml. This method always
+ * performs "scored" search.
+ */
+ public Map<String, IndexedArtifact> search(SearchExpression expression, String searchType) throws CoreException;
+
+ /**
+ * Convenience method to search in all indexes enabled for repositories defined in settings.xml. This method always
+ * performs "scored" search.
+ *
+ * @param term - search term
+ * @param searchType - query type. Should be one of the SEARCH_* values.
+ * @param classifier - the type of classifiers to search for, SEARCH_ALL, SEARCH_JAVADOCS, SEARCH_SOURCES,
+ * SEARCH_TESTS
+ */
+ public Map<String, IndexedArtifact> search(SearchExpression expression, String searchType, int classifier)
+ throws CoreException;
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IMutableIndex.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IMutableIndex.java
new file mode 100644
index 00000000..c6d11b3f
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IMutableIndex.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.index;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+
+
+/**
+ * @author igor
+ */
+public interface IMutableIndex extends IIndex {
+
+ // index content manipulation
+
+ public void addArtifact(File pomFile, ArtifactKey artifactKey);
+
+ public void removeArtifact(File pomFile, ArtifactKey artifactKey);
+
+ // reindexing
+
+ public void updateIndex(boolean force, IProgressMonitor monitor) throws CoreException;
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexListener.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexListener.java
new file mode 100644
index 00000000..27ac3473
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexListener.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.index;
+
+import org.eclipse.m2e.core.repository.IRepository;
+
+
+
+/**
+ * IndexListener
+ *
+ * @author Eugene Kuleshov
+ */
+public interface IndexListener {
+
+ public void indexAdded(IRepository repository);
+
+ public void indexRemoved(IRepository repository);
+
+ public void indexChanged(IRepository repository);
+
+ public void indexUpdating(IRepository repository);
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexManager.java
new file mode 100644
index 00000000..0dbf701a
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexManager.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.index;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+
+
+public interface IndexManager {
+
+ // well-known indexes
+
+ String LOCAL_INDEX = "local"; //$NON-NLS-1$
+
+ String WORKSPACE_INDEX = "workspace"; //$NON-NLS-1$
+
+ //
+
+ IMutableIndex getWorkspaceIndex();
+
+ IMutableIndex getLocalIndex();
+
+ /**
+ * For Maven projects, returns index of all repositories configured for the project. Index includes repositories
+ * defined in the project pom.xml, inherited from parent projects and defined in enabled profiles in settings.xml. If
+ * project is null or is not a maven project, returns index that includes repositories defined in profiles enabled by
+ * default in settings.xml.
+ */
+ IIndex getIndex(IProject project) throws CoreException;
+
+ /**
+ * Returns index aggregating all indexes enabled for repositories defined in settings.xml
+ *
+ * @return
+ * @throws CoreException
+ */
+ IIndex getAllIndexes() throws CoreException;
+
+ //
+
+ void removeIndexListener(IndexListener listener);
+
+ void addIndexListener(IndexListener listener);
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexedArtifact.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexedArtifact.java
new file mode 100644
index 00000000..756bcfb8
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexedArtifact.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.index;
+
+import java.util.Comparator;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.maven.artifact.versioning.ArtifactVersion;
+
+
+public class IndexedArtifact{
+
+ public static final Comparator<IndexedArtifactFile> FILE_INFO_COMPARATOR = new Comparator<IndexedArtifactFile>() {
+
+ @SuppressWarnings("unchecked")
+ public int compare(IndexedArtifactFile f1, IndexedArtifactFile f2) {
+ ArtifactVersion v1 = f1.getArtifactVersion();
+ ArtifactVersion v2 = f2.getArtifactVersion();
+ int r = -v1.compareTo(v2);
+ if(r!=0) {
+ return r;
+ }
+
+ String c1 = f1.classifier;
+ String c2 = f2.classifier;
+ if(c1 == null) {
+ return c2 == null ? 0 : -1;
+ }
+ if(c2 == null) {
+ return 1;
+ }
+ return c1.compareTo(c2);
+ }
+
+ };
+
+ private final String group;
+
+ private final String artifact;
+
+ private final String packageName;
+
+ private final String className;
+
+ private final String packaging;
+
+ //a non-zero odd-prime hash seed
+ private static final int SEED = 17;
+
+ /**
+ * Set<IndexedArtifactFile>
+ */
+ private final Set<IndexedArtifactFile> files = new TreeSet<IndexedArtifactFile>(FILE_INFO_COMPARATOR);
+
+ public IndexedArtifact(String group, String artifact, String packageName, String className, String packaging) {
+ this.group = group;
+ this.artifact = artifact;
+ this.packageName = packageName;
+ this.className = className;
+ this.packaging = packaging;
+ }
+
+ public void addFile(IndexedArtifactFile indexedArtifactFile) {
+ getFiles().add(indexedArtifactFile);
+ }
+
+ public String getPackageName(){
+ if(packageName != null && packageName.startsWith(".") && packageName.length()>1){ //$NON-NLS-1$
+ return packageName.substring(1);
+ }
+ return packageName;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer("\n" + getClassname() + " " + packageName + " " + getGroupId() + " : " + getArtifactId()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ return sb.toString();
+ }
+
+ public String getGroupId() {
+ return group;
+ }
+
+ public String getArtifactId() {
+ return artifact;
+ }
+
+ public String getPackaging() {
+ return packaging;
+ }
+
+ public String getClassname() {
+ return className;
+ }
+
+ public Set<IndexedArtifactFile> getFiles() {
+ return files;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ public int hashCode() {
+ int result = SEED;
+ result *= fieldHash(getGroupId());
+ result *= fieldHash(getArtifactId());
+ result *= fieldHash(getPackaging());
+ result *= fieldHash(getClassname());
+ result *= fieldHash(getPackageName());
+ return result;
+ }
+
+ private int fieldHash(Object field){
+ if(field == null){
+ return SEED;
+ }
+ return field.hashCode();
+ }
+
+ /**
+ * Assumes all the fields are important for equals.
+ */
+ public boolean equals(Object artifact){
+ if(this == artifact){
+ return true;
+ } else if(!(artifact instanceof IndexedArtifact)){
+ return false;
+ } else {
+ IndexedArtifact other = (IndexedArtifact)artifact;
+ return fieldsEqual(this.getGroupId(), other.getGroupId()) &&
+ fieldsEqual(this.getArtifactId(), other.getArtifactId()) &&
+ fieldsEqual(this.getPackageName(), other.getPackageName()) &&
+ fieldsEqual(this.getPackaging(), other.getPackaging()) &&
+ fieldsEqual(this.getClassname(), other.getClassname());
+ }
+ }
+
+ private boolean fieldsEqual(Object field1, Object field2){
+ return field1 == null ? field2 == null : field1.equals(field2);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexedArtifactFile.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexedArtifactFile.java
new file mode 100644
index 00000000..46c60100
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/IndexedArtifactFile.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.index;
+
+import java.util.Date;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+
+import org.apache.maven.artifact.versioning.ArtifactVersion;
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
+import org.apache.maven.model.Dependency;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+
+public class IndexedArtifactFile implements IAdaptable {
+
+ public final String repository;
+
+ public final String group;
+
+ public final String artifact;
+
+ public final String fname;
+
+ public final String version;
+
+ private ArtifactVersion artifactVersion;
+
+ public final String type;
+
+ public final String classifier;
+
+ public final long size;
+
+ public final Date date;
+
+ public final int sourcesExists;
+
+ public final int javadocExists;
+
+ public final String prefix;
+
+ public final List<String> goals;
+
+ public IndexedArtifactFile(String repository, String group, String artifact, String version, String type,
+ String classifier, String fname, long size, Date date, int sourcesExists, int javadocExists, String prefix,
+ List<String> goals) {
+ this.repository = repository;
+ this.group = group;
+ this.artifact = artifact;
+ this.version = version;
+ this.type = type;
+ this.classifier = classifier;
+ this.fname = fname;
+ this.size = size;
+ this.date = date == null ? null : new Date(date.getTime());
+ this.sourcesExists = sourcesExists;
+ this.javadocExists = javadocExists;
+ this.prefix = prefix;
+ this.goals = goals;
+ }
+
+ public ArtifactVersion getArtifactVersion() {
+ if (artifactVersion == null) {
+ artifactVersion = new DefaultArtifactVersion(version);
+ }
+ return artifactVersion;
+ }
+
+ public Dependency getDependency() {
+ Dependency dependency = new Dependency();
+ dependency.setArtifactId(artifact);
+ dependency.setGroupId(group);
+ dependency.setVersion(version);
+ dependency.setClassifier(classifier);
+ dependency.setType(type); // TODO: investigate difference between packaging and type
+ //http://docs.codehaus.org/display/MAVEN/Packaging+vs+Type+-+Derived+and+Attached+Artifacts
+ return dependency;
+ }
+
+ public ArtifactKey getArtifactKey() {
+ return new ArtifactKey(group, artifact, version, classifier);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if(adapter==ArtifactKey.class) {
+ return getArtifactKey();
+ }
+ return null;
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/MatchTyped.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/MatchTyped.java
new file mode 100644
index 00000000..e3c9363b
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/MatchTyped.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.index;
+
+/**
+ * MatchTyped is a interface that describes the wanted match type to be used.
+ *
+ * @author cstamas
+ */
+public interface MatchTyped {
+
+ public enum MatchType {
+ /** Exact match wanted */
+ EXACT,
+ /** Partial match wanted, like prefix, contains, etc. */
+ PARTIAL;
+ };
+
+ MatchType getMatchType();
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/MatchTypedStringSearchExpression.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/MatchTypedStringSearchExpression.java
new file mode 100644
index 00000000..23050079
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/MatchTypedStringSearchExpression.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.index;
+
+/**
+ * MatchTypedStringSearchExpression
+ *
+ * @author cstamas
+ */
+public class MatchTypedStringSearchExpression extends StringSearchExpression implements MatchTyped {
+
+ private final MatchType matchType;
+
+ public MatchTypedStringSearchExpression(final String expression, final MatchType matchType) {
+ super(expression);
+ this.matchType = matchType;
+ }
+
+ public MatchType getMatchType() {
+ return matchType;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/SearchExpression.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/SearchExpression.java
new file mode 100644
index 00000000..8b4592b2
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/SearchExpression.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.index;
+
+/**
+ * SearchExpression is a wrapper interface for expressions representable as plain strings to be used within searches.
+ *
+ * @author cstamas
+ */
+public interface SearchExpression {
+
+ /**
+ * Returns the expression value as plain java String.
+ *
+ * @return
+ */
+ String getStringValue();
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/SourcedSearchExpression.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/SourcedSearchExpression.java
new file mode 100644
index 00000000..f9932d03
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/SourcedSearchExpression.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.index;
+
+/**
+ * SourcedSearchExpression is a search expression usually "sourced" from some programmatic source, and we already know
+ * it is complete, exact value that we want to search for. Indexer will try to match exactly the provided string value,
+ * no more no less.
+ *
+ * @author cstamas
+ */
+public class SourcedSearchExpression extends MatchTypedStringSearchExpression {
+
+ public SourcedSearchExpression(String expression) {
+ super(expression, MatchType.EXACT);
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/StringSearchExpression.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/StringSearchExpression.java
new file mode 100644
index 00000000..901d0c37
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/StringSearchExpression.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.index;
+
+/**
+ * StringSearchExpression is a SearchExpression that has String value.
+ *
+ * @author cstamas
+ */
+public class StringSearchExpression implements SearchExpression {
+
+ private final String expression;
+
+ public StringSearchExpression(String expression) {
+ assert expression != null && expression.trim().length() > 0 : "The expression cannot be empty!";
+ this.expression = expression;
+ }
+
+ public String getStringValue() {
+ return expression;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/UserInputSearchExpression.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/UserInputSearchExpression.java
new file mode 100644
index 00000000..dfa7ea7b
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/index/UserInputSearchExpression.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.index;
+
+/**
+ * UserInputSearchExpression is a search expression usually coming from user input (like some UI dialogue, element or
+ * CLI). It will be normalized and tokenized and then a search will happen against it. Search expressions of this type
+ * will always provide "broader" results, since it defaults to prefix searches.
+ *
+ * @author cstamas
+ */
+public class UserInputSearchExpression extends MatchTypedStringSearchExpression {
+
+ public UserInputSearchExpression(String expression) {
+ super(expression, MatchType.PARTIAL);
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java
new file mode 100644
index 00000000..c0c542e6
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.osgi.framework.Bundle;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IContributor;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
+
+
+/**
+ * Extension reader
+ *
+ * @author Eugene Kuleshov
+ */
+public class ExtensionReader {
+
+ public static final String EXTENSION_ARCHETYPES = IMavenConstants.PLUGIN_ID + ".archetypeCatalogs"; //$NON-NLS-1$
+
+ public static final String EXTENSION_PROJECT_CHANGED_EVENT_LISTENERS = IMavenConstants.PLUGIN_ID + ".mavenProjectChangedListeners"; //$NON-NLS-1$
+
+ private static final String ELEMENT_LOCAL_ARCHETYPE = "local"; //$NON-NLS-1$
+
+ private static final String ELEMENT_REMOTE_ARCHETYPE = "remote"; //$NON-NLS-1$
+
+ private static final String ATTR_NAME = "name"; //$NON-NLS-1$
+
+ private static final String ATTR_URL = "url"; //$NON-NLS-1$
+
+ private static final String ATTR_DESCRIPTION = "description"; //$NON-NLS-1$
+
+ private static final String ELEMENT_LISTENER = "listener"; //$NON-NLS-1$
+
+ public static List<ArchetypeCatalogFactory> readArchetypeExtensions() {
+ List<ArchetypeCatalogFactory> archetypeCatalogs = new ArrayList<ArchetypeCatalogFactory>();
+
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint archetypesExtensionPoint = registry.getExtensionPoint(EXTENSION_ARCHETYPES);
+ if(archetypesExtensionPoint != null) {
+ IExtension[] archetypesExtensions = archetypesExtensionPoint.getExtensions();
+ for(IExtension extension : archetypesExtensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ IContributor contributor = extension.getContributor();
+ for(IConfigurationElement element : elements) {
+ ArchetypeCatalogFactory factory = readArchetypeCatalogs(element, contributor);
+ // archetypeManager.addArchetypeCatalogFactory(factory);
+ archetypeCatalogs.add(factory);
+ }
+ }
+ }
+ return archetypeCatalogs;
+ }
+
+ private static ArchetypeCatalogFactory readArchetypeCatalogs(IConfigurationElement element, IContributor contributor) {
+ if(ELEMENT_LOCAL_ARCHETYPE.equals(element.getName())) {
+ String name = element.getAttribute(ATTR_NAME);
+ if(name != null) {
+ Bundle[] bundles = Platform.getBundles(contributor.getName(), null);
+ URL catalogUrl = null;
+ for(int i = 0; i < bundles.length; i++ ) {
+ Bundle bundle = bundles[i];
+ catalogUrl = bundle.getEntry(name);
+ if(catalogUrl != null) {
+ String description = element.getAttribute(ATTR_DESCRIPTION);
+ String url = catalogUrl.toString();
+ // XXX ARCHETYPE-161: RemoteCatalogArchetypeDataSource don't allow to download arbitrary urls
+ return new ArchetypeCatalogFactory.RemoteCatalogFactory(url.substring(0, url.lastIndexOf("/")), //$NON-NLS-1$
+ description, false);
+ }
+ }
+ MavenLogger.log("Unable to find Archetype catalog " + name + " in " + contributor.getName(), null);
+ }
+ } else if(ELEMENT_REMOTE_ARCHETYPE.equals(element.getName())) {
+ String url = element.getAttribute(ATTR_URL);
+ if(url != null) {
+ String description = element.getAttribute(ATTR_DESCRIPTION);
+ return new ArchetypeCatalogFactory.RemoteCatalogFactory(url, description, false);
+ }
+ }
+ return null;
+ }
+
+ public static List<IMavenProjectChangedListener> readProjectChangedEventListenerExtentions() {
+ ArrayList<IMavenProjectChangedListener> listeners = new ArrayList<IMavenProjectChangedListener>();
+
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint mappingsExtensionPoint = registry.getExtensionPoint(EXTENSION_PROJECT_CHANGED_EVENT_LISTENERS);
+ if(mappingsExtensionPoint != null) {
+ IExtension[] mappingsExtensions = mappingsExtensionPoint.getExtensions();
+ for(IExtension extension : mappingsExtensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for(IConfigurationElement element : elements) {
+ if(element.getName().equals(ELEMENT_LISTENER)) {
+ try {
+ listeners.add( (IMavenProjectChangedListener) element.createExecutableExtension("class") ); //$NON-NLS-1$
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+ }
+
+ return listeners;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java
new file mode 100644
index 00000000..68a155d7
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java
@@ -0,0 +1,1024 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+
+/**
+ * Messages
+ *
+ * @author mkleint
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.m2e.core.internal.messages"; //$NON-NLS-1$
+
+ public static String AbstractProjectConfigurator_error_missing_nature;
+
+ public static String AbstractTransferListenerAdapter_4;
+
+ public static String AbstractTransferListenerAdapter_byte;
+
+ public static String AbstractTransferListenerAdapter_cancelled;
+
+ public static String AbstractTransferListenerAdapter_kb;
+
+ public static String AbstractTransferListenerAdapter_mb;
+
+ public static String AbstractTransferListenerAdapter_subtask;
+
+ public static String AddDependencyAction_error_msg;
+
+ public static String AddDependencyAction_error_title;
+
+ public static String AddDependencyAction_searchDialog_title;
+
+ public static String AddDependencyDialog_artifactId_label;
+
+ public static String AddDependencyDialog_groupId_label;
+
+ public static String AddDependencyDialog_info_label;
+
+ public static String AddDependencyDialog_info_transitive;
+
+ public static String AddDependencyDialog_itemsSelected;
+ public static String AddDependencyDialog_itemSelected;
+
+ public static String AddDependencyDialog_multipleValuesSelected;
+
+ public static String AddDependencyDialog_results_label;
+
+ public static String AddDependencyDialog_scope_label;
+
+ public static String AddDependencyDialog_search_label;
+
+ public static String AddDependencyDialog_search_message;
+
+ public static String AddDependencyDialog_searchDone;
+
+ public static String AddDependencyDialog_searchError;
+
+ public static String AddDependencyDialog_searching;
+
+ public static String AddDependencyDialog_searchingFor;
+
+ public static String AddDependencyDialog_title;
+
+ public static String AddDependencyDialog_tooManyResults;
+
+ public static String AddDependencyDialog_transitive_dependency;
+
+ public static String AddDependencyDialog_version_label;
+
+ public static String AddPluginAction_searchDialog_title;
+
+ public static String ArchetypeCatalogFactory_default_local;
+
+ public static String ArchetypeCatalogFactory_error_missing_catalog;
+
+ public static String ArchetypeCatalogFactory_indexer_catalog;
+
+ public static String ArchetypeCatalogFactory_internal;
+
+ public static String ArchetypeCatalogFactory_local;
+
+ public static String ArchetypeCatalogFactory_remote;
+
+ public static String ArchetypeCatalogsWriter_error_parse;
+
+ public static String ArchetypeCatalogsWriter_error_write;
+
+ public static String AsyncFetcher_error_cancelled;
+
+ public static String AsyncFetcher_error_server;
+
+ public static String AsyncFetcher_task_fetching;
+
+ public static String AsyncFetcher_task_fetching2;
+
+ public static String ChangeNatureAction_job_changing;
+
+ public static String ChangeNatureAction_status_error;
+
+ public static String CustomArchetypeDialog_error_artid;
+
+ public static String CustomArchetypeDialog_error_grid;
+
+ public static String CustomArchetypeDialog_error_version;
+
+ public static String CustomArchetypeDialog_lblArchetypeartifactid;
+
+ public static String CustomArchetypeDialog_lblArchetypegroupId;
+
+ public static String CustomArchetypeDialog_lblArchetypeversion;
+
+ public static String CustomArchetypeDialog_lblRepo;
+
+ public static String CustomArchetypeDialog_message;
+
+ public static String CustomizableLifecycleMappingPropertyPage_message;
+
+ public static String CustomRepositoriesNode_name;
+
+ public static String DefaultMavenMenuCreator_action_ci;
+
+ public static String DefaultMavenMenuCreator_action_dependency;
+
+ public static String DefaultMavenMenuCreator_action_disable_management;
+
+ public static String DefaultMavenMenuCreator_action_disable_workspace;
+
+ public static String DefaultMavenMenuCreator_action_enable_dm;
+
+ public static String DefaultMavenMenuCreator_action_enable_workspace;
+
+ public static String DefaultMavenMenuCreator_action_issues;
+
+ public static String DefaultMavenMenuCreator_action_open_pom;
+
+ public static String DefaultMavenMenuCreator_action_plugin;
+
+ public static String DefaultMavenMenuCreator_action_project;
+
+ public static String DefaultMavenMenuCreator_action_project_page;
+
+ public static String DefaultMavenMenuCreator_action_scm;
+
+ public static String DefaultMavenMenuCreator_action_update_config;
+
+ public static String DefaultMavenMenuCreator_action_update_deps;
+
+ public static String DefaultMavenMenuCreator_action_update_snapshots;
+
+ public static String EclipseLogger_debug1;
+
+ public static String EclipseLogger_debug2;
+
+ public static String EclipseLogger_error1;
+
+ public static String EclipseLogger_error2;
+
+ public static String EclipseLogger_fatal1;
+
+ public static String EclipseLogger_fatal2;
+
+ public static String EclipseLogger_info1;
+
+ public static String EclipseLogger_info2;
+
+ public static String EclipseLogger_name;
+
+ public static String EclipseLogger_warn1;
+
+ public static String EclipseLogger_warn2;
+
+ public static String EditDependencyDialog_artifactId_label;
+
+ public static String EditDependencyDialog_classifier_label;
+
+ public static String EditDependencyDialog_groupId_label;
+
+ public static String EditDependencyDialog_optional_checkbox;
+
+ public static String EditDependencyDialog_scope_label;
+
+ public static String EditDependencyDialog_systemPath_label;
+
+ public static String EditDependencyDialog_title;
+
+ public static String EditDependencyDialog_type_label;
+
+ public static String EditDependencyDialog_version_label;
+
+ public static String EmptyLifecycleMappingPropertyPage_title;
+
+ public static String EnableNatureAction_job_enable;
+
+ public static String EnableNatureAction_wizard_shell;
+
+ public static String ExtensionReader_foundLifecycleMapping;
+
+ public static String GlobalRepositoriesNode_name;
+
+ public static String IndexedArtifactNode_no_pack;
+
+ public static String IndexUpdaterJob_title;
+
+ public static String LifecycleConfigurationMojoExecutionNotCovered;
+
+ public static String LifecycleMissing;
+
+ public static String LocalArchetypeCatalogDialog_btnBrowse;
+
+ public static String LocalArchetypeCatalogDialog_dialog_title;
+
+ public static String LocalArchetypeCatalogDialog_error_empty;
+
+ public static String LocalArchetypeCatalogDialog_error_exist;
+
+ public static String LocalArchetypeCatalogDialog_error_no_location;
+
+ public static String LocalArchetypeCatalogDialog_lblCatalog;
+
+ public static String LocalArchetypeCatalogDialog_lblDesc;
+
+ public static String LocalArchetypeCatalogDialog_message;
+
+ public static String LocalArchetypeCatalogDialog_title;
+
+ public static String LocalProjectScanner_task_scanning;
+
+ public static String LocalRepositoryNode_local;
+
+ public static String LocalRepositoryRootNode_name;
+
+ public static String M2EErrorDialog_column_error;
+
+ public static String M2EErrorDialog_column_name;
+
+ public static String MavenArchetypesPreferencePage_btnAddLocal;
+
+ public static String MavenArchetypesPreferencePage_btnAddRemote;
+
+ public static String MavenArchetypesPreferencePage_btnEdit;
+
+ public static String MavenArchetypesPreferencePage_btnRemove;
+
+ public static String MavenArchetypesPreferencePage_error;
+
+ public static String MavenArchetypesPreferencePage_link;
+
+ public static String MavenArchetypesPreferencePage_local;
+
+ public static String MavenArchetypesPreferencePage_packaged;
+
+ public static String MavenArchetypesPreferencePage_remote;
+
+ public static String MavenArchetypesPreferencePage_title;
+
+ public static String MavenCheckoutLocationPage_btnBrowse;
+
+ public static String MavenCheckoutLocationPage_btnCheckout;
+
+ public static String MavenCheckoutLocationPage_btnHead;
+
+ public static String MavenCheckoutLocationPage_btnRevSelect;
+
+ public static String MavenCheckoutLocationPage_description;
+
+ public static String MavenCheckoutLocationPage_error_empty;
+
+ public static String MavenCheckoutLocationPage_error_empty_url;
+
+ public static String MavenCheckoutLocationPage_error_scm_empty;
+
+ public static String MavenCheckoutLocationPage_error_scm_invalid;
+
+ public static String MavenCheckoutLocationPage_error_url_empty;
+
+ public static String MavenCheckoutLocationPage_lblRevision;
+
+ public static String MavenCheckoutLocationPage_lblurl;
+
+ public static String MavenCheckoutLocationPage_title;
+
+ public static String MavenCheckoutOperation_task_checking;
+
+ public static String MavenCheckoutOperation_task_scanning;
+
+ public static String MavenCheckoutWizard_location1;
+
+ public static String MavenCheckoutWizard_location2;
+
+ public static String MavenCheckoutWizard_title;
+
+ public static String MavenConsoleImpl_title;
+
+ public static String MavenConsolePageParticipant_any;
+
+ public static String MavenConsolePageParticipant_error;
+
+ public static String MavenConsoleRemoveAction_tooltip;
+
+ public static String MavenDebugOutputAction_0;
+
+ public static String MavenDependenciesWizardPage_lblArtifacts;
+
+ public static String MavenDependenciesWizardPage_searchDialog_title;
+
+ public static String MavenExternalRuntime_error_cannot_parse;
+
+ public static String MavenExternalRuntime_exc_unsupported;
+
+ public static String MavenExternalRuntime_unknown;
+
+ public static String MavenEmbeddedRuntime_unknown;
+
+ public static String MavenGoalSelectionDialog_btnQualified;
+
+ public static String MavenGoalSelectionDialog_error;
+
+ public static String MavenGoalSelectionDialog_lblSelect;
+
+ public static String MavenGoalSelectionDialog_message;
+
+ public static String MavenImpl_error_calc_build_plan;
+
+ public static String MavenImpl_error_create_repo;
+
+ public static String MavenImpl_error_init_maven;
+
+ public static String MavenImpl_error_lookup;
+
+ public static String MavenImpl_error_missing;
+
+ public static String MavenImpl_error_mojo;
+
+ public static String MavenImpl_error_no_exec_req;
+
+ public static String MavenImpl_error_param;
+
+ public static String MavenImpl_error_read_config;
+
+ public static String MavenImpl_error_read_lastUpdated;
+
+ public static String MavenImpl_error_read_pom;
+
+ public static String MavenImpl_error_read_project;
+
+ public static String MavenImpl_error_read_settings;
+
+ public static String MavenImpl_error_read_settings2;
+
+ public static String MavenImpl_error_resolve;
+
+ public static String MavenImpl_error_sort;
+
+ public static String MavenImpl_error_write_lastUpdated;
+
+ public static String MavenImpl_error_write_pom;
+
+ public static String MavenImpl_error_write_settings;
+
+ public static String MavenImportWizard_job;
+
+ public static String MavenImportWizard_title;
+
+ public static String MavenImportWizardPage_desc;
+
+ public static String MavenImportWizardPage_inherited;
+
+ public static String MavenImportWizardPage_title;
+
+ public static String MavenInstallationsPreferencePage_btnAdd;
+
+ public static String MavenInstallationsPreferencePage_btnEdit;
+
+ public static String MavenInstallationsPreferencePage_btnGlobalBrowse;
+
+ public static String MavenInstallationsPreferencePage_btnRemove;
+
+ public static String MavenInstallationsPreferencePage_dialog_install_message;
+
+ public static String MavenInstallationsPreferencePage_dialog_install_title;
+
+ public static String MavenInstallationsPreferencePage_dialog_message;
+
+ public static String MavenInstallationsPreferencePage_dialog_title;
+
+ public static String MavenInstallationsPreferencePage_error_global_missing;
+
+ public static String MavenInstallationsPreferencePage_error_global_parse;
+
+ public static String MavenInstallationsPreferencePage_error_message;
+
+ public static String MavenInstallationsPreferencePage_error_title;
+
+ public static String MavenInstallationsPreferencePage_error2_message;
+
+ public static String MavenInstallationsPreferencePage_error3_message;
+
+ public static String MavenInstallationsPreferencePage_error4_message;
+
+ public static String MavenInstallationsPreferencePage_job_updating;
+
+ public static String MavenInstallationsPreferencePage_lblNote1;
+
+ public static String MavenInstallationsPreferencePage_lblNote2;
+
+ public static String MavenInstallationsPreferencePage_link;
+
+ public static String MavenInstallationsPreferencePage_link_global;
+
+ public static String MavenInstallationsPreferencePage_link_open;
+
+ public static String MavenInstallationsPreferencePage_settings;
+
+ public static String MavenInstallationsPreferencePage_settings_install;
+
+ public static String MavenInstallationsPreferencePage_title;
+
+ public static String MavenInstallFileArtifactWizardPage_btnChecksum;
+
+ public static String MavenInstallFileArtifactWizardPage_btnFilename;
+
+ public static String MavenInstallFileArtifactWizardPage_btnGenerate;
+
+ public static String MavenInstallFileArtifactWizardPage_btnPom;
+
+ public static String MavenInstallFileArtifactWizardPage_desc;
+
+ public static String MavenInstallFileArtifactWizardPage_error_artifactid;
+
+ public static String MavenInstallFileArtifactWizardPage_error_groupid;
+
+ public static String MavenInstallFileArtifactWizardPage_error_missing;
+
+ public static String MavenInstallFileArtifactWizardPage_error_missingpom;
+
+ public static String MavenInstallFileArtifactWizardPage_error_no_name;
+
+ public static String MavenInstallFileArtifactWizardPage_error_packaging;
+
+ public static String MavenInstallFileArtifactWizardPage_error_version;
+
+ public static String MavenInstallFileArtifactWizardPage_file_title;
+
+ public static String MavenInstallFileArtifactWizardPage_lblArtifact;
+
+ public static String MavenInstallFileArtifactWizardPage_lblClassifier;
+
+ public static String MavenInstallFileArtifactWizardPage_lblFileName;
+
+ public static String MavenInstallFileArtifactWizardPage_lblgroupid;
+
+ public static String MavenInstallFileArtifactWizardPage_lblPackaging;
+
+ public static String MavenInstallFileArtifactWizardPage_lblPom;
+
+ public static String MavenInstallFileArtifactWizardPage_lblVersion;
+
+ public static String MavenInstallFileArtifactWizardPage_message;
+
+ public static String MavenInstallFileArtifactWizardPage_title;
+
+ public static String MavenInstallFileWizard_error;
+
+ public static String MavenInstallFileWizard_job;
+
+ public static String MavenInstallFileWizard_title;
+
+ public static String MavenMarkerManager_duplicate_groupid;
+
+ public static String MavenMarkerManager_duplicate_version;
+
+ public static String MavenMarkerManager_error_artifact;
+
+ public static String MavenMarkerManager_error_missing;
+
+ public static String MavenMarkerManager_error_noschema;
+
+ public static String MavenMarkerManager_error_offline;
+
+ public static String MavenMarkerManager_managed_title;
+
+ public static String MavenMarkerManager_metadata_resolution;
+
+ public static String MavenMaterializePomWizard_btnCheckout;
+
+ public static String MavenMaterializePomWizard_btnDev;
+
+ public static String MavenMaterializePomWizard_dialog_message;
+
+ public static String MavenMaterializePomWizard_dialog_title;
+
+ public static String MavenMaterializePomWizard_location_message;
+
+ public static String MavenMaterializePomWizard_location_title;
+
+ public static String MavenMaterializePomWizard_title;
+
+ public static String MavenModelManager_error_cannot_load;
+
+ public static String MavenModelManager_error_create;
+
+ public static String MavenModelManager_error_pom_exists;
+
+ public static String MavenModelManager_error_read;
+
+ public static String MavenModelManager_monitor_building;
+
+ public static String MavenModelManager_monitor_reading;
+
+ public static String MavenModuleWizardParentPage_error;
+
+ public static String MavenPlugin_error_jre_message;
+
+ public static String MavenPlugin_error_jre_title;
+
+ public static String MavenPlugin_error_warn_again;
+
+ public static String MavenPomSelectionComponent_btnJavadoc;
+
+ public static String MavenPomSelectionComponent_btnSource;
+
+ public static String MavenPomSelectionComponent_btnTests;
+
+ public static String MavenPomSelectionComponent_detail1;
+
+ public static String MavenPomSelectionComponent_details2;
+
+ public static String MavenPomSelectionComponent_error;
+
+ public static String MavenPomSelectionComponent_lblResults;
+
+ public static String MavenPomSelectionComponent_managed_decoration;
+
+ public static String MavenPomSelectionComponent_nosel;
+
+ public static String MavenPomSelectionComponent_results;
+
+ public static String MavenPomSelectionComponent_search_title;
+
+ public static String MavenPomSelectionComponent_searching;
+
+ public static String MavenPomSelectionComponent_searchJob;
+
+ public static String MavenPomSelectionComponent_selected;
+
+ public static String MavenPomSelectionComponent_toomany;
+
+ public static String MavenPomSelectionComponent_tooshort;
+
+ public static String MavenPomWizard_error_exists;
+
+ public static String MavenPomWizard_error_title;
+
+ public static String MavenPomWizard_status_not_exists;
+
+ public static String MavenPomWizard_task;
+
+ public static String MavenPomWizard_title;
+
+ public static String MavenPomWizardPage_btnBrowse;
+
+ public static String MavenPomWizardPage_desc;
+
+ public static String MavenPomWizardPage_dialog_title;
+
+ public static String MavenPomWizardPage_error_artid;
+
+ public static String MavenPomWizardPage_error_folder;
+
+ public static String MavenPomWizardPage_error_folder_write;
+
+ public static String MavenPomWizardPage_error_folder2;
+
+ public static String MavenPomWizardPage_error_grid;
+
+ public static String MavenPomWizardPage_error_pack;
+
+ public static String MavenPomWizardPage_error_version;
+
+ public static String MavenPomWizardPage_lblProject;
+
+ public static String MavenPomWizardPage_title;
+
+ public static String MavenPreferencePage_download;
+
+ public static String MavenPreferencePage_hide;
+
+ public static String MavenPreferencePage_select;
+
+ public static String MavenPreferencePage_select2;
+
+ public static String MavenPreferencePage_update;
+
+ public static String MavenProjectCheckoutJob_confirm_message;
+
+ public static String MavenProjectCheckoutJob_confirm_title;
+
+ public static String MavenProjectCheckoutJob_confirm2_message;
+
+ public static String MavenProjectCheckoutJob_confirm2_title;
+
+ public static String MavenProjectCheckoutJob_job;
+
+ public static String MavenProjectCheckoutJob_title;
+
+ public static String MavenProjectFacade_error;
+
+ public static String MavenProjectLifecycleMappingPage_error_no_page;
+
+ public static String MavenProjectLifecycleMappingPage_error_no_strategy;
+
+ public static String MavenProjectLifecycleMappingPage_error_page_error;
+
+ public static String MavenProjectPomScanner_23;
+
+ public static String MavenProjectPomScanner_task_resolving;
+
+ public static String MavenProjectPreferencePage_btnResolve;
+
+ public static String MavenProjectPreferencePage_dialog_message;
+
+ public static String MavenProjectPreferencePage_dialog_title;
+
+ public static String MavenProjectPreferencePage_job;
+
+ public static String MavenProjectPreferencePage_lblProfiles;
+
+ public static String MavenProjectPreferencePage_title;
+
+ public static String MavenProjectWizardArchetypePage_add_title;
+
+ public static String MavenProjectWizardArchetypePage_all;
+
+ public static String MavenProjectWizardArchetypePage_btnAdd;
+
+ public static String MavenProjectWizardArchetypePage_btnConfigure;
+
+ public static String MavenProjectWizardArchetypePage_btnLast;
+
+ public static String MavenProjectWizardArchetypePage_btnSnapshots;
+
+ public static String MavenProjectWizardArchetypePage_error_no;
+
+ public static String MavenProjectWizardArchetypePage_error_read;
+
+ public static String MavenProjectWizardArchetypePage_error_resolve;
+
+ public static String MavenProjectWizardArchetypePage_error_resolve2;
+
+ public static String MavenProjectWizardArchetypePage_lblCatalog;
+
+ public static String MavenProjectWizardArchetypePage_lblFilter;
+
+ public static String MavenProjectWizardArchetypePage_task_downloading;
+
+ public static String MavenProjectWizardArchetypePage_task_indexing;
+
+ public static String MavenProjectWizardArchetypePage_task_reading;
+
+ public static String MavenProjectWizardArchetypePage_task_resolving;
+
+ public static String MavenProjectWizardArchetypePage_task_resolving2;
+
+ public static String MavenProjectWizardArchetypeParametersPage_btnAdd;
+
+ public static String MavenProjectWizardArchetypeParametersPage_btnRemove;
+
+ public static String MavenProjectWizardArchetypeParametersPage_columnName;
+
+ public static String MavenProjectWizardArchetypeParametersPage_columnValue;
+
+ public static String MavenProjectWizardArchetypeParametersPage_error_download;
+
+ public static String MavenProjectWizardArchetypeParametersPage_error_package;
+
+ public static String MavenProjectWizardArchetypeParametersPage_lblProps;
+
+ public static String MavenProjectWizardArchetypeParametersPage_task;
+
+ public static String MavenProjectWizardArtifactPage_searchDialog_title;
+
+ public static String MavenProjectWizardLocationPage_btnLocation;
+
+ public static String MavenProjectWizardLocationPage_btnUserDefault;
+
+ public static String MavenProjectWizardLocationPage_dialog_location;
+
+ public static String MavenProjectWizardLocationPage_lblLocation;
+
+ public static String MavenRepositorySearchDialog_7;
+
+ public static String MavenRepositorySearchDialog_lblScope;
+
+ public static String MavenRepositoryView_action_copy;
+
+ public static String MavenRepositoryView_action_copy_tooltip;
+
+ public static String MavenRepositoryView_action_disable_tooltip;
+
+ public static String MavenRepositoryView_action_enable_tooltip;
+
+ public static String MavenRepositoryView_action_enableFull_tooltip;
+
+ public static String MavenRepositoryView_action_materialize;
+
+ public static String MavenRepositoryView_action_open;
+
+ public static String MavenRepositoryView_action_open_tooltip;
+
+ public static String MavenRepositoryView_action_rebuild;
+
+ public static String MavenRepositoryView_action_rebuild_tooltip;
+
+ public static String MavenRepositoryView_action_reload;
+
+ public static String MavenRepositoryView_action_update;
+
+ public static String MavenRepositoryView_btnCollapse;
+
+ public static String MavenRepositoryView_btnCollapse_tooltip;
+
+ public static String MavenRepositoryView_btnUpdate_tooltip;
+
+ public static String MavenRepositoryView_details_disabled;
+
+ public static String MavenRepositoryView_disable_details;
+
+ public static String MavenRepositoryView_enable_full;
+
+ public static String MavenRepositoryView_enable_minimum;
+
+ public static String MavenRepositoryView_enabled_full;
+
+ public static String MavenRepositoryView_error_message;
+
+ public static String MavenRepositoryView_error_title;
+
+ public static String MavenRepositoryView_job_reloading;
+
+ public static String MavenRepositoryView_minimum_enabled;
+
+ public static String MavenRepositoryView_rebuild_many;
+
+ public static String MavenRepositoryView_rebuild_msg;
+
+ public static String MavenRepositoryView_rebuild_msg2;
+
+ public static String MavenRepositoryView_rebuild_one;
+
+ public static String MavenRepositoryView_rebuild_title;
+
+ public static String MavenRepositoryView_rebuild_title2;
+
+ public static String MavenRepositoryView_reload_msg;
+
+ public static String MavenRepositoryView_reload_title;
+
+ public static String MavenRepositoryView_update_more;
+
+ public static String MavenRepositoryView_update_one;
+
+ public static String MavenSearchPage_btnBrowse;
+
+ public static String MavenSearchPage_btnSelect;
+
+ public static String MavenSearchPage_btnUnselect;
+
+ public static String MavenSearchPage_lblArtifactid;
+
+ public static String MavenSearchPage_lblClass;
+
+ public static String MavenSearchPage_lblGroupid;
+
+ public static String MavenSearchPage_lblPackaging;
+
+ public static String MavenSearchPage_lblRepos;
+
+ public static String MavenSearchPage_lblSha;
+
+ public static String MavenSearchPage_lblVersion;
+
+ public static String MavenSearchPage_separator;
+
+ public static String MavenSettingsPreferencePage_btnBrowse;
+
+ public static String MavenSettingsPreferencePage_btnUpdate;
+
+ public static String MavenSettingsPreferencePage_error_missing;
+
+ public static String MavenSettingsPreferencePage_error_parse;
+
+ public static String MavenSettingsPreferencePage_job_indexing;
+
+ public static String MavenSettingsPreferencePage_job_updating;
+
+ public static String MavenSettingsPreferencePage_lblLocal;
+
+ public static String MavenSettingsPreferencePage_link_tooltip;
+
+ public static String MavenSettingsPreferencePage_link1;
+
+ public static String MavenSettingsPreferencePage_link2;
+
+ public static String MavenSettingsPreferencePage_task_updating;
+
+ public static String MavenSettingsPreferencePage_title;
+
+ public static String MissingLifecycleMapping_name;
+ public static String MissingLifecycleMappingPropertyPage_error;
+
+ public static String MissingLifecycleMappingPropertyPage_title;
+
+ public static String NexusIndexManager_78;
+
+ public static String NexusIndexManager_error_add_repo;
+
+ public static String NexusIndexManager_error_read_index;
+
+ public static String NexusIndexManager_error_reindexing;
+
+ public static String NexusIndexManager_error_root_grp;
+
+ public static String NexusIndexManager_error_search;
+
+ public static String NexusIndexManager_error_unexpected;
+
+ public static String NexusIndexManager_error_write_index;
+
+ public static String NexusIndexManager_inherited;
+
+ public static String NexusIndexManager_task_updating;
+
+ public static String OpenPomAction_33;
+
+ public static String OpenPomAction_error_download;
+
+ public static String OpenPomAction_error_download_source;
+
+ public static String OpenPomAction_error_open_editor;
+
+ public static String OpenPomAction_error_open_pom;
+
+ public static String OpenPomAction_job_opening;
+
+ public static String OpenPomAction_open_error_message;
+
+ public static String OpenPomAction_open_error_title;
+
+ public static String OpenPomAction_open_title;
+
+ public static String OpenPomAction_title_pom;
+
+ public static String OpenUrlAction_browser_title;
+
+ public static String OpenUrlAction_error_no_ci;
+
+ public static String OpenUrlAction_error_no_issues;
+
+ public static String OpenUrlAction_error_no_scm;
+
+ public static String OpenUrlAction_error_no_url;
+
+ public static String OpenUrlAction_error_open;
+
+ public static String OpenUrlAction_job_browser;
+
+ public static String OpenUrlAction_open_url_message;
+
+ public static String OpenUrlAction_open_url_title;
+
+ public static String PomFileContentDescriber_error;
+
+ public static String ProjectConfigurationManager_0;
+
+ public static String ProjectConfigurationManager_error_failed;
+
+ public static String ProjectConfigurationManager_error_rename;
+
+ public static String ProjectConfigurationManager_error_resolve;
+
+ public static String ProjectConfigurationManager_error_resolve2;
+
+ public static String ProjectConfigurationManager_error_targetDir;
+
+ public static String ProjectConfigurationManager_error_unable_archetype;
+
+ public static String ProjectConfigurationManager_task_configuring;
+
+ public static String ProjectConfigurationManager_task_creating;
+
+ public static String ProjectConfigurationManager_task_creating_folders;
+
+ public static String ProjectConfigurationManager_task_creating_pom;
+
+ public static String ProjectConfigurationManager_task_creating_project;
+
+ public static String ProjectConfigurationManager_task_creating_project1;
+
+ public static String ProjectConfigurationManager_task_creating_workspace;
+
+ public static String ProjectConfigurationManager_task_disable_nature;
+
+ public static String ProjectConfigurationManager_task_enable_nature;
+
+ public static String ProjectConfigurationManager_task_executing_archetype;
+
+ public static String ProjectConfigurationManager_task_importing;
+
+ public static String ProjectConfigurationManager_task_importing2;
+
+ public static String ProjectConfigurationManager_task_refreshing;
+
+ public static String ProjectConfigurationManager_task_updating;
+
+ public static String ProjectConfiguratorsTable_column_id;
+
+ public static String ProjectConfiguratorsTable_column_name;
+
+ public static String ProjectConfiguratorsTableContentProvider_no_configs;
+
+ public static String ProjectRegistryManager_task_project;
+
+ public static String ProjectRegistryManager_task_refreshing;
+
+ public static String ProjectRegistryRefreshJob_task_refreshing;
+
+ public static String ProjectRegistryRefreshJob_title;
+
+ public static String ProjectRepositoriesNode_name;
+
+ public static String ProjectsImportPage_btnDeselect;
+
+ public static String ProjectsImportPage_btnRefresh;
+
+ public static String ProjectsImportPage_btnSelect;
+
+ public static String ProjectsImportPage_desc;
+
+ public static String ProjectsImportPage_dialog_title;
+
+ public static String ProjectsImportPage_error_creation;
+
+ public static String ProjectsImportPage_lstProjects;
+
+ public static String ProjectsImportPage_message;
+
+ public static String ProjectsImportPage_overwrite;
+
+ public static String ProjectsImportPage_overwrite2;
+
+ public static String ProjectsImportPage_task_checking;
+
+ public static String ProjectsImportPage_task_creating;
+
+ public static String ProjectsImportPage_task_processing;
+
+ public static String ProjectsImportPage_task_search;
+
+ public static String ProjectsImportPage_title;
+
+ public static String ProjectsImportWizard_title;
+
+ public static String RemoteArchetypeCatalogDialog_btnVerify;
+
+ public static String RemoteArchetypeCatalogDialog_error_empty;
+
+ public static String RemoteArchetypeCatalogDialog_error_read;
+
+ public static String RemoteArchetypeCatalogDialog_error_required;
+
+ public static String RemoteArchetypeCatalogDialog_job_download;
+
+ public static String RemoteArchetypeCatalogDialog_lblCatalog;
+
+ public static String RemoteArchetypeCatalogDialog_lblDesc;
+
+ public static String RemoteArchetypeCatalogDialog_message;
+
+ public static String RemoteArchetypeCatalogDialog_message_found;
+
+ public static String RemoteArchetypeCatalogDialog_title;
+
+ public static String RepositoryNode_updating;
+
+ public static String RepositoryRegistryUpdateJob_title;
+
+ public static String ScmUrl_error;
+
+ public static String SelectionUtil_error_cannot_read;
+ public static String UpdateSourcesAction_error_cannot_update;
+
+ public static String UpdateSourcesAction_error_message;
+
+ public static String UpdateSourcesAction_error_title;
+
+ public static String UpdateSourcesAction_job_update_conf;
+
+ public static String WorkingSetGroup_btnAddSet;
+
+ public static String WorkingSetGroup_btnMore;
+
+ public static String WorkingSetGroup_lblSet;
+
+ public static String WorkspaceRepositoryNode_name;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/actions/DefaultMavenMenuCreator.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/actions/DefaultMavenMenuCreator.java
new file mode 100644
index 00000000..40221b63
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/actions/DefaultMavenMenuCreator.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.actions;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.ui.PlatformUI;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.AbstractMavenMenuCreator;
+import org.eclipse.m2e.core.actions.AddDependencyAction;
+import org.eclipse.m2e.core.actions.AddPluginAction;
+import org.eclipse.m2e.core.actions.ChangeNatureAction;
+import org.eclipse.m2e.core.actions.DisableNatureAction;
+import org.eclipse.m2e.core.actions.EnableNatureAction;
+import org.eclipse.m2e.core.actions.ModuleProjectWizardAction;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.actions.OpenUrlAction;
+import org.eclipse.m2e.core.actions.RefreshMavenModelsAction;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.core.actions.UpdateConfigurationAction;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+
+
+/**
+ * Default Maven menu creator
+ *
+ * @author Eugene Kuleshov
+ */
+public class DefaultMavenMenuCreator extends AbstractMavenMenuCreator {
+
+ public void createMenu(IMenuManager mgr) {
+ int selectionType = SelectionUtil.getSelectionType(selection);
+ if(selectionType == SelectionUtil.UNSUPPORTED) {
+ return;
+ }
+
+ if(selection.size() == 1 && selectionType == SelectionUtil.POM_FILE) {
+ mgr.appendToGroup(NEW, getAction(new AddDependencyAction(), //
+ AddDependencyAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_dependency));
+ mgr.appendToGroup(NEW, getAction(new AddPluginAction(), AddPluginAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_plugin));
+ mgr.appendToGroup(NEW, getAction(new ModuleProjectWizardAction(), //
+ ModuleProjectWizardAction.ID, Messages.getString("action.moduleProjectWizardAction"))); //$NON-NLS-1$
+
+ mgr.prependToGroup(OPEN, new Separator());
+ mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_PROJECT), //
+ OpenUrlAction.ID_PROJECT, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_project_page));
+ mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_ISSUES), //
+ OpenUrlAction.ID_ISSUES, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_issues));
+ mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_SCM), //
+ OpenUrlAction.ID_SCM, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_scm));
+ mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_CI), //
+ OpenUrlAction.ID_CI, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_ci));
+ }
+
+ if(selectionType == SelectionUtil.PROJECT_WITHOUT_NATURE) {
+ mgr.appendToGroup(NATURE, getAction(new EnableNatureAction(), //
+ EnableNatureAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_enable_dm));
+ }
+
+ if(selectionType == SelectionUtil.PROJECT_WITH_NATURE) {
+ if(selection.size() == 1) {
+ mgr.appendToGroup(NEW, getAction(new AddDependencyAction(), AddDependencyAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_dependency));
+ mgr.appendToGroup(NEW, getAction(new AddPluginAction(), AddPluginAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_plugin));
+ mgr.appendToGroup(NEW, getAction(new ModuleProjectWizardAction(), //
+ ModuleProjectWizardAction.ID, Messages.getString("action.moduleProjectWizardAction"))); //$NON-NLS-1$
+ mgr.prependToGroup(UPDATE, new Separator());
+ }
+
+
+ mgr.appendToGroup(UPDATE, getAction(new RefreshMavenModelsAction(), RefreshMavenModelsAction.ID,
+ org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_update_deps, "icons/update_dependencies.gif")); //$NON-NLS-2$
+ mgr.appendToGroup(UPDATE, getAction(new RefreshMavenModelsAction(true), RefreshMavenModelsAction.ID_SNAPSHOTS,
+ org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_update_snapshots));
+ mgr.appendToGroup(UPDATE, getAction(new UpdateConfigurationAction(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()), //
+ UpdateConfigurationAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_update_config, "icons/update_source_folders.gif")); //$NON-NLS-2$
+
+ mgr.prependToGroup(OPEN, new Separator());
+ mgr.appendToGroup(OPEN, getAction(new OpenPomAction(), OpenPomAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_open_pom));
+ mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_PROJECT), //
+ OpenUrlAction.ID_PROJECT, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_project));
+ mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_ISSUES), OpenUrlAction.ID_ISSUES,
+ org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_issues));
+ mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_SCM), OpenUrlAction.ID_SCM,
+ org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_scm));
+ mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_CI), OpenUrlAction.ID_CI,
+ org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_ci));
+
+ boolean enableWorkspaceResolution = true;
+ if(selection.size() == 1) {
+ IProject project = SelectionUtil.getType(selection.getFirstElement(), IProject.class);
+ if(project != null) {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectFacade projectFacade = projectManager.create(project, new NullProgressMonitor());
+ if(projectFacade != null) {
+ ResolverConfiguration configuration = projectFacade.getResolverConfiguration();
+ enableWorkspaceResolution = !configuration.shouldResolveWorkspaceProjects();
+ }
+ }
+ }
+
+ mgr.prependToGroup(NATURE, new Separator());
+ if(enableWorkspaceResolution) {
+ mgr.appendToGroup(NATURE, getAction(new ChangeNatureAction(ChangeNatureAction.ENABLE_WORKSPACE),
+ ChangeNatureAction.ID_ENABLE_WORKSPACE, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_enable_workspace));
+ } else {
+ mgr.appendToGroup(NATURE, getAction(new ChangeNatureAction(ChangeNatureAction.DISABLE_WORKSPACE),
+ ChangeNatureAction.ID_DISABLE_WORKSPACE, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_disable_workspace));
+ }
+
+ mgr.appendToGroup(NATURE, getAction(new DisableNatureAction(), //
+ DisableNatureAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_disable_management));
+ }
+
+ if(selectionType == SelectionUtil.WORKING_SET) {
+ mgr.appendToGroup(UPDATE, getAction(new RefreshMavenModelsAction(), RefreshMavenModelsAction.ID,
+ org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_update_deps, "icons/update_dependencies.gif")); //$NON-NLS-2$
+ mgr.appendToGroup(UPDATE, getAction(new RefreshMavenModelsAction(true), RefreshMavenModelsAction.ID_SNAPSHOTS,
+ org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_update_snapshots));
+ mgr.appendToGroup(UPDATE, getAction(new UpdateConfigurationAction(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()), //
+ UpdateConfigurationAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_update_config, "icons/update_source_folders.gif")); //$NON-NLS-2$
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/InternalBuildParticipant.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/InternalBuildParticipant.java
new file mode 100644
index 00000000..7a78ff52
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/InternalBuildParticipant.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.builder;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.execution.MavenSession;
+
+import org.sonatype.plexus.build.incremental.BuildContext;
+
+import org.eclipse.m2e.core.builder.AbstractEclipseBuildContext;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+public abstract class InternalBuildParticipant {
+
+ private IMavenProjectFacade facade;
+ private MavenBuilder.GetDeltaCallback getDeltaCallback;
+// private BuildContext buildContext;
+ private MavenSession session;
+ private AbstractEclipseBuildContext buildContext;
+
+ protected IMavenProjectFacade getMavenProjectFacade() {
+ return facade;
+ }
+
+ void setMavenProjectFacade(IMavenProjectFacade facade) {
+ this.facade = facade;
+ }
+
+ protected IResourceDelta getDelta(IProject project) {
+ return getDeltaCallback.getDelta(project);
+ }
+
+ void setGetDeltaCallback(MavenBuilder.GetDeltaCallback getDeltaCallback) {
+ this.getDeltaCallback = getDeltaCallback;
+ }
+
+ protected MavenSession getSession() {
+ return session;
+ }
+
+ void setSession(MavenSession session) {
+ this.session = session;
+ }
+
+ public abstract Set<IProject> build(int kind, IProgressMonitor monitor) throws Exception;
+
+ @SuppressWarnings("unused")
+ public void clean(IProgressMonitor monitor) throws CoreException {
+ // default implementation does nothing
+ }
+
+ public abstract boolean callOnEmptyDelta();
+
+ void setBuildContext(AbstractEclipseBuildContext buildContext) {
+ this.buildContext = buildContext;
+ }
+
+ protected BuildContext getBuildContext() {
+ return buildContext;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java
new file mode 100644
index 00000000..0e13bd10
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilder.java
@@ -0,0 +1,302 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.builder;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+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.Platform;
+import org.eclipse.core.runtime.QualifiedName;
+
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenExecutionResult;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.project.MavenProject;
+
+import org.sonatype.plexus.build.incremental.ThreadBuildContext;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.builder.AbstractEclipseBuildContext;
+import org.eclipse.m2e.core.builder.EclipseBuildContext;
+import org.eclipse.m2e.core.builder.EclipseIncrementalBuildContext;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.project.IMavenMarkerManager;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.IProjectConfigurationManager;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+import org.eclipse.m2e.core.project.configurator.AbstractBuildParticipant;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+import org.eclipse.m2e.core.util.M2EUtils;
+
+
+public class MavenBuilder extends IncrementalProjectBuilder {
+
+ public static boolean DEBUG = MavenPlugin.getDefault().isDebugging()
+ & Boolean.parseBoolean(Platform.getDebugOption(IMavenConstants.PLUGIN_ID + "/debug/builder")); //$NON-NLS-1$
+
+ public static QualifiedName BUILD_CONTEXT_KEY = new QualifiedName(IMavenConstants.PLUGIN_ID, "BuildContext"); //$NON-NLS-1$
+
+ static interface GetDeltaCallback {
+ public IResourceDelta getDelta(IProject project);
+ }
+
+ private GetDeltaCallback getDeltaCallback = new GetDeltaCallback() {
+ public IResourceDelta getDelta(IProject project) {
+ return MavenBuilder.this.getDelta(project);
+ }
+ };
+
+ /*
+ * @see org.eclipse.core.internal.events.InternalBuilder#build(int,
+ * java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @SuppressWarnings("unchecked")
+ protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ MavenConsole console = plugin.getConsole();
+ MavenProjectManager projectManager = plugin.getMavenProjectManager();
+ IProjectConfigurationManager configurationManager = plugin.getProjectConfigurationManager();
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ IMavenMarkerManager markerManager = plugin.getMavenMarkerManager();
+
+ IProject project = getProject();
+ markerManager.deleteMarkers(project, IMavenConstants.MARKER_BUILD_ID);
+
+ if(project.hasNature(IMavenConstants.NATURE_ID)) {
+ IFile pomResource = project.getFile(IMavenConstants.POM_FILE_NAME);
+ if(pomResource == null) {
+ console.logError("Project " + project.getName() + " does not have pom.xml");
+ return null;
+ }
+
+ IMavenProjectFacade projectFacade = projectManager.create(getProject(), monitor);
+ if(projectFacade == null) {
+ // XXX is this really possible? should we warn the user?
+ return null;
+ }
+
+ if (projectFacade.isStale()) {
+ MavenUpdateRequest updateRequest = new MavenUpdateRequest(project, mavenConfiguration.isOffline() /*offline*/, false /*updateSnapshots*/);
+ projectManager.refresh(updateRequest, monitor);
+ IMavenProjectFacade facade = projectManager.create(project, monitor);
+ if(facade == null){
+ // error marker should have been created
+ return null;
+ }
+ }
+
+ IResourceDelta delta = getDelta(project);
+ AbstractEclipseBuildContext buildContext;
+ Map<String, Object> contextState = (Map<String, Object>) project.getSessionProperty(BUILD_CONTEXT_KEY);
+ if(contextState != null && (INCREMENTAL_BUILD == kind || AUTO_BUILD == kind)) {
+ buildContext = new EclipseIncrementalBuildContext(delta, contextState);
+ } else {
+ // must be full build
+ contextState = new HashMap<String, Object>();
+ project.setSessionProperty(BUILD_CONTEXT_KEY, contextState);
+ buildContext = new EclipseBuildContext(project, contextState);
+ }
+
+ Set<IProject> dependencies = new HashSet<IProject>();
+
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+ MavenExecutionRequest request = projectManager.createExecutionRequest(pomResource, projectFacade.getResolverConfiguration(), monitor);
+
+ MavenProject mavenProject = null;
+ try{
+ mavenProject = projectFacade.getMavenProject(monitor);
+ } catch(CoreException ce){
+ //unable to read the project facade
+ addErrorMarker(ce);
+ monitor.done();
+ return null;
+ }
+ MavenSession session = maven.createSession(request, mavenProject);
+ ILifecycleMapping lifecycleMapping = configurationManager.getLifecycleMapping(projectFacade, monitor);
+
+ ThreadBuildContext.setThreadBuildContext(buildContext);
+ try {
+ if(projectFacade.hasValidConfiguration()) {
+ List<AbstractBuildParticipant> participants = lifecycleMapping.getBuildParticipants(projectFacade, monitor);
+ for(InternalBuildParticipant participant : participants) {
+ participant.setMavenProjectFacade(projectFacade);
+ participant.setGetDeltaCallback(getDeltaCallback);
+ participant.setSession(session);
+ participant.setBuildContext(buildContext);
+ try {
+ if(FULL_BUILD == kind || delta != null || participant.callOnEmptyDelta()) {
+ Set<IProject> sub = participant.build(kind, monitor);
+ if(sub != null) {
+ dependencies.addAll(sub);
+ }
+ }
+ } catch(Exception e) {
+ MavenLogger.log("Exception in build participant", e);
+ } finally {
+ participant.setMavenProjectFacade(null);
+ participant.setGetDeltaCallback(null);
+ participant.setSession(null);
+ participant.setBuildContext(null);
+ }
+ }
+ }
+ } catch (CoreException e) {
+ addErrorMarker(e);
+ } finally {
+ ThreadBuildContext.setThreadBuildContext(null);
+ }
+
+ for(File file : buildContext.getFiles()) {
+ IPath path = getProjectRelativePath(project, file);
+ if(path == null) {
+ continue; // odd
+ }
+
+ if(!file.exists()) {
+ IResource resource = project.findMember(path);
+ if (resource != null) {
+ resource.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ }
+ } else if(file.isDirectory()) {
+ IFolder ifolder = project.getFolder(path);
+ ifolder.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ } else {
+ IFile ifile = project.getFile(path);
+ ifile.refreshLocal(IResource.DEPTH_ZERO, monitor);
+ }
+ }
+
+ MavenExecutionResult result = session.getResult();
+ if (result.hasExceptions()) {
+ markerManager.addMarkers(pomResource, IMavenConstants.MARKER_BUILD_ID, result);
+ }
+
+ return !dependencies.isEmpty() ? dependencies.toArray(new IProject[dependencies.size()]) : null;
+ }
+ return null;
+ }
+
+ private void addErrorMarker(Exception e) {
+ String msg = e.getMessage();
+ String rootCause = M2EUtils.getRootCauseMessage(e);
+ if(!e.equals(msg)){
+ msg = msg+": "+rootCause; //$NON-NLS-1$
+ }
+
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ IMavenMarkerManager markerManager = plugin.getMavenMarkerManager();
+ markerManager.addMarker(getProject(), IMavenConstants.MARKER_BUILD_ID, msg, 1, IMarker.SEVERITY_ERROR);
+ }
+
+ public static IPath getProjectRelativePath(IProject project, File file) {
+ if(project == null || file == null) {
+ return null;
+ }
+
+ IPath projectPath = project.getLocation();
+ if(projectPath == null) {
+ return null;
+ }
+
+ IPath filePath = new Path(file.getAbsolutePath());
+ if(!projectPath.isPrefixOf(filePath)) {
+ return null;
+ }
+
+ return filePath.removeFirstSegments(projectPath.segmentCount());
+ }
+
+ protected void clean(IProgressMonitor monitor) throws CoreException{
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ MavenProjectManager projectManager = plugin.getMavenProjectManager();
+ IProjectConfigurationManager configurationManager = plugin.getProjectConfigurationManager();
+
+ IProject project = getProject();
+ IMavenMarkerManager markerManager = plugin.getMavenMarkerManager();
+ markerManager.deleteMarkers(project, IMavenConstants.MARKER_BUILD_ID);
+
+ if(project.hasNature(IMavenConstants.NATURE_ID)) {
+ IFile pomResource = project.getFile(IMavenConstants.POM_FILE_NAME);
+ if(pomResource == null) {
+ return;
+ }
+
+ IMavenProjectFacade projectFacade = projectManager.create(getProject(), monitor);
+ if(projectFacade == null) {
+ return;
+ }
+
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+
+ // TODO flush relevant caches
+
+ project.setSessionProperty(BUILD_CONTEXT_KEY, null); // clean context state
+ Map<String, Object> contextState = new HashMap<String, Object>();
+ EclipseBuildContext buildContext = new EclipseBuildContext(project, contextState);
+
+ MavenExecutionRequest request = projectManager.createExecutionRequest(pomResource, projectFacade.getResolverConfiguration(), monitor);
+ MavenSession session = null;
+ try{
+ session = maven.createSession(request, projectFacade.getMavenProject(monitor));
+ } catch(CoreException ce){
+ //the pom cannot be read. don't fill the log full of junk, just add an error marker
+ addErrorMarker(ce);
+ return;
+ }
+ ILifecycleMapping lifecycleMapping = configurationManager.getLifecycleMapping(projectFacade, monitor);
+
+ ThreadBuildContext.setThreadBuildContext(buildContext);
+ try {
+ for (InternalBuildParticipant participant : lifecycleMapping.getBuildParticipants(projectFacade, monitor)) {
+ participant.setMavenProjectFacade(projectFacade);
+ participant.setGetDeltaCallback(getDeltaCallback);
+ participant.setSession(session);
+ try {
+ participant.clean(monitor);
+ } catch (Exception ex) {
+ // TODO Auto-generated catch block
+ MavenLogger.log("Totoally unexpected exception", ex);
+ } finally {
+ participant.setMavenProjectFacade(null);
+ participant.setGetDeltaCallback(null);
+ participant.setSession(null);
+ }
+ }
+ } catch (CoreException e) {
+ addErrorMarker(e);
+ } finally {
+ ThreadBuildContext.setThreadBuildContext(null);
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenNature.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenNature.java
new file mode 100644
index 00000000..b3f38f3c
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenNature.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.builder;
+
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.runtime.CoreException;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+
+
+public class MavenNature implements IProjectNature {
+ private IProject project;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.resources.IProjectNature#configure()
+ */
+ public void configure() throws CoreException {
+ IProjectDescription desc = project.getDescription();
+ ICommand[] commands = desc.getBuildSpec();
+
+ for(int i = 0; i < commands.length; ++i) {
+ if(commands[i].getBuilderName().equals(IMavenConstants.BUILDER_ID)) {
+ return;
+ }
+ }
+
+ ICommand[] newCommands = new ICommand[commands.length + 1];
+ System.arraycopy(commands, 0, newCommands, 0, commands.length);
+ ICommand command = desc.newCommand();
+ command.setBuilderName(IMavenConstants.BUILDER_ID);
+ newCommands[commands.length] = command;
+ desc.setBuildSpec(newCommands);
+ project.setDescription(desc, null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.resources.IProjectNature#deconfigure()
+ */
+ public void deconfigure() throws CoreException {
+ IProjectDescription description = getProject().getDescription();
+ ICommand[] commands = description.getBuildSpec();
+ for(int i = 0; i < commands.length; ++i) {
+ if(commands[i].getBuilderName().equals(IMavenConstants.BUILDER_ID)) {
+ ICommand[] newCommands = new ICommand[commands.length - 1];
+ System.arraycopy(commands, 0, newCommands, 0, i);
+ System.arraycopy(commands, i + 1, newCommands, i, commands.length - i - 1);
+ description.setBuildSpec(newCommands);
+ return;
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.resources.IProjectNature#getProject()
+ */
+ public IProject getProject() {
+ return project;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject)
+ */
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceScanner.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceScanner.java
new file mode 100644
index 00000000..eff507d3
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/ResourceScanner.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.builder;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.runtime.CoreException;
+
+import org.codehaus.plexus.util.AbstractScanner;
+
+/**
+ * WorkspaceScanner
+ *
+ * @author igor
+ */
+public class ResourceScanner extends AbstractScanner {
+
+ protected final IResource resource;
+
+ protected final List<String> includedDirectories = new ArrayList<String>();
+
+ protected final List<String> includedFiles = new ArrayList<String>();
+
+ public ResourceScanner(IResource resource) {
+ this.resource = resource;
+ }
+
+ public String[] getIncludedDirectories() {
+ return includedDirectories.toArray(new String[includedDirectories.size()]);
+ }
+
+ public String[] getIncludedFiles() {
+ return includedFiles.toArray(new String[includedFiles.size()]);
+ }
+
+ public void scan() {
+ try {
+ setupDefaultFilters();
+ scanResource();
+ } catch(CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ private void scanResource() throws CoreException {
+ resource.accept(new IResourceVisitor() {
+
+ public boolean visit(IResource resource) {
+ String relpath = getRelativePath(resource);
+ if (isIncluded(relpath) && !isExcluded(relpath)) {
+ if (resource instanceof IContainer) {
+ includedDirectories.add(relpath);
+ } else {
+ includedFiles.add(relpath);
+ }
+ return true;
+ } else if (resource instanceof IFolder) {
+ return couldHoldIncluded(relpath);
+ }
+
+ return false;
+ }
+
+ });
+ }
+
+ protected String getRelativePath(IResource resource) {
+ return resource.getFullPath().removeFirstSegments(this.resource.getFullPath().segmentCount()).toOSString();
+ }
+
+ public File getBasedir() {
+ return resource.getLocation().toFile();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/console/ConsoleDocument.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/console/ConsoleDocument.java
new file mode 100644
index 00000000..77ccfa1b
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/console/ConsoleDocument.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.console;
+
+/**
+ * Simple circular buffer that stores a fix number of lines.
+ */
+// TODO consider use standard ConsoleDocument
+public class ConsoleDocument {
+ public static final int COMMAND = 0; // command text
+ public static final int MESSAGE = 1; // message received
+ public static final int ERROR = 2; // error received
+ public static final int STATUS = 3; // status text
+ public static final int DELIMITER = 4; // delimiter text between runs
+
+ private int[] lineTypes;
+ private String[] lines;
+
+ private int writeIndex = 0;
+ private int readIndex = 0;
+
+ private static final int BUFFER_SIZE = 200;
+
+ protected static class ConsoleLine {
+ public String line;
+ public int type;
+ ConsoleLine(String line, int type) {
+ this.line = line;
+ this.type = type;
+ }
+ }
+
+ /**
+ * Creates an empty console document.
+ */
+ public ConsoleDocument() {
+ }
+
+ /**
+ * Clears the console document.
+ */
+ public void clear() {
+ lineTypes = null;
+ lines = null;
+ writeIndex = 0;
+ readIndex = 0;
+ }
+
+ /**
+ * Appends a line of the specified type to the end of the console.
+ */
+ public void appendConsoleLine(int type, String line) {
+ if(lines == null) {
+ lines = new String[BUFFER_SIZE];
+ lineTypes = new int[BUFFER_SIZE];
+ }
+ lines[writeIndex] = line;
+ lineTypes[writeIndex] = type;
+
+ if(++writeIndex >= BUFFER_SIZE) {
+ writeIndex = 0;
+ }
+ if(writeIndex == readIndex) {
+ if(++readIndex >= BUFFER_SIZE) {
+ readIndex = 0;
+ }
+ }
+ }
+
+ public ConsoleLine[] getLines() {
+ if(isEmpty()) return new ConsoleLine[0];
+ ConsoleLine[] docLines = new ConsoleLine[readIndex > writeIndex ? BUFFER_SIZE : writeIndex];
+ int index = readIndex;
+ for (int i = 0; i < docLines.length; i++) {
+ docLines[i] = new ConsoleLine(lines[index], lineTypes[index]);
+ if (++index >= BUFFER_SIZE) {
+ index = 0;
+ }
+ }
+ return docLines;
+ }
+
+ public boolean isEmpty() {
+ return writeIndex == readIndex;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/console/MavenConsoleImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/console/MavenConsoleImpl.java
new file mode 100644
index 00000000..0b28a509
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/console/MavenConsoleImpl.java
@@ -0,0 +1,404 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.console;
+
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import com.ibm.icu.text.DateFormat;
+import com.ibm.icu.util.ULocale;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleListener;
+import org.eclipse.ui.console.IConsoleManager;
+import org.eclipse.ui.console.IOConsole;
+import org.eclipse.ui.console.IOConsoleOutputStream;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConsoleListener;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+
+
+/**
+ * Maven Console implementation
+ *
+ * @author Dmitri Maximovich
+ */
+public class MavenConsoleImpl extends IOConsole implements MavenConsole, IPropertyChangeListener {
+
+ private boolean initialized = false;
+
+ // console is visible in the Console view
+ private boolean visible = false;
+
+ private ConsoleDocument consoleDocument;
+
+ // created colors for each line type - must be disposed at shutdown
+ private Color commandColor;
+
+ private Color messageColor;
+
+ private Color errorColor;
+
+ // streams for each command type - each stream has its own color
+ private IOConsoleOutputStream commandStream;
+
+ private IOConsoleOutputStream messageStream;
+
+ private IOConsoleOutputStream errorStream;
+ private static final String TITLE = Messages.MavenConsoleImpl_title;
+
+ private List<IMavenConsoleListener> listeners = new CopyOnWriteArrayList<IMavenConsoleListener>();
+
+ public MavenConsoleImpl(ImageDescriptor imageDescriptor) {
+ super(TITLE, imageDescriptor);
+ this.setConsoleDocument(new ConsoleDocument());
+ }
+
+ protected void init() {
+ super.init();
+
+ // Ensure that initialization occurs in the UI thread
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ JFaceResources.getFontRegistry().addListener(MavenConsoleImpl.this);
+ initializeConsoleStreams(Display.getDefault());
+ dumpConsole();
+ }
+ });
+ }
+
+ /*
+ * Initialize three streams of the console. Must be called from the UI thread, so synchronization is unnecessary.
+ */
+ protected void initializeConsoleStreams(Display display) {
+ if(!initialized) {
+ setCommandStream(newOutputStream());
+ setErrorStream(newOutputStream());
+ setMessageStream(newOutputStream());
+
+ // TODO convert this to use themes
+ // install colors
+ commandColor = new Color(display, new RGB(0, 0, 0));
+ messageColor = new Color(display, new RGB(0, 0, 255));
+ errorColor = new Color(display, new RGB(255, 0, 0));
+
+ getCommandStream().setColor(commandColor);
+ getMessageStream().setColor(messageColor);
+ getErrorStream().setColor(errorColor);
+
+ // install font
+ setFont(JFaceResources.getFontRegistry().get("pref_console_font")); //$NON-NLS-1$
+
+ initialized = true;
+ }
+ }
+
+ /**
+ * Is always called from main thread, so synchronization not necessary
+ */
+ protected void dumpConsole() {
+ setVisible(true);
+ ConsoleDocument.ConsoleLine[] lines = getConsoleDocument().getLines();
+ for(int i = 0; i < lines.length; i++ ) {
+ ConsoleDocument.ConsoleLine line = lines[i];
+ appendLine(line.type, line.line);
+ }
+ getConsoleDocument().clear();
+ }
+
+ private void appendLine(final int type, final String line) {
+ show(false);
+ //the synchronization here caused a deadlock. since the writes are simply appending to the output stream
+ //or the document, just doing it on the main thread to avoid deadlocks and or corruption of the
+ //document or output stream
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run(){
+ if(isVisible()) {
+ try {
+ switch(type) {
+ case ConsoleDocument.COMMAND:
+ getCommandStream().write(line);
+ getCommandStream().write('\n');
+ break;
+ case ConsoleDocument.MESSAGE:
+ getMessageStream().write(line);
+ getMessageStream().write('\n');
+ break;
+ case ConsoleDocument.ERROR:
+ getErrorStream().write(line);
+ getErrorStream().write('\n');
+ break;
+ }
+ } catch(IOException ex) {
+ MavenLogger.log("Console error", ex);
+ }
+ } else {
+ getConsoleDocument().appendConsoleLine(type, line);
+ }
+ }
+ });
+ }
+
+ /**
+ * Show the console.
+ *
+ * @param showNoMatterWhat ignore preferences if <code>true</code>
+ */
+ public void show(boolean showNoMatterWhat) {
+ if(showNoMatterWhat) {
+ if(!isVisible()) {
+ showConsole();
+ } else {
+ ConsolePlugin.getDefault().getConsoleManager().showConsoleView(this);
+ }
+ }
+ }
+
+ public void showConsole() {
+ boolean exists = false;
+ IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
+ for(IConsole element : manager.getConsoles()) {
+ if(this == element) {
+ exists = true;
+ }
+ }
+ if(!exists) {
+ manager.addConsoles(new IConsole[] {this});
+ }
+ manager.showConsoleView(this);
+ }
+
+ public void closeConsole() {
+ IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
+ manager.removeConsoles(new IConsole[] {this});
+ ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(this.newLifecycle());
+ }
+
+
+ public void propertyChange(PropertyChangeEvent event) {
+ // font changed
+ setFont(JFaceResources.getFontRegistry().get("pref_console_font")); //$NON-NLS-1$
+ }
+
+ private void bringConsoleToFront() {
+ if(PlatformUI.isWorkbenchRunning()) {
+ IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
+ if(!isVisible()) {
+ manager.addConsoles(new IConsole[] {this});
+ }
+ manager.showConsoleView(this);
+ }
+ }
+
+ // Called when console is removed from the console view
+ protected void dispose() {
+ // Here we can't call super.dispose() because we actually want the partitioner to remain
+ // connected, but we won't show lines until the console is added to the console manager
+ // again.
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run(){
+ setVisible(false);
+ JFaceResources.getFontRegistry().removeListener(MavenConsoleImpl.this);
+ }
+ });
+ }
+
+ public void shutdown() {
+ // Call super dispose because we want the partitioner to be
+ // disconnected.
+ super.dispose();
+ if(commandColor != null) {
+ commandColor.dispose();
+ }
+ if(messageColor != null) {
+ messageColor.dispose();
+ }
+ if(errorColor != null) {
+ errorColor.dispose();
+ }
+ }
+
+ private DateFormat getDateFormat() {
+ return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.LONG, ULocale.getDefault());
+ }
+
+ // MavenConsole
+
+ public void logMessage(String message) {
+ if(showConsoleOnOutput()){
+ bringConsoleToFront();
+ }
+ appendLine(ConsoleDocument.MESSAGE, getDateFormat().format(new Date()) + ": " + message);
+
+ for(IMavenConsoleListener listener : listeners) {
+ try {
+ listener.loggingMessage(message);
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void logError(String message) {
+ if(showConsoleOnError()){
+ bringConsoleToFront();
+ }
+ appendLine(ConsoleDocument.ERROR, getDateFormat().format(new Date()) + ": " + message); //$NON-NLS-1$
+
+ for(IMavenConsoleListener listener : listeners) {
+ try {
+ listener.loggingError(message);
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public boolean showConsoleOnError(){
+ return MavenPlugin.getDefault().getPreferenceStore().getBoolean(MavenPreferenceConstants.P_SHOW_CONSOLE_ON_ERR);
+ }
+
+ public boolean showConsoleOnOutput(){
+ return MavenPlugin.getDefault().getPreferenceStore().getBoolean(MavenPreferenceConstants.P_SHOW_CONSOLE_ON_OUTPUT);
+ }
+ public IConsoleListener newLifecycle() {
+ return new MavenConsoleLifecycle();
+ }
+
+ /**
+ * @param commandStream The commandStream to set.
+ */
+ protected void setCommandStream(IOConsoleOutputStream commandStream) {
+ this.commandStream = commandStream;
+ }
+
+ /**
+ * @return Returns the commandStream.
+ */
+ protected IOConsoleOutputStream getCommandStream() {
+ return commandStream;
+ }
+
+ /**
+ * @param messageStream The messageStream to set.
+ */
+ protected void setMessageStream(IOConsoleOutputStream messageStream) {
+ this.messageStream = messageStream;
+ }
+
+ /**
+ * @return Returns the messageStream.
+ */
+ protected IOConsoleOutputStream getMessageStream() {
+ return messageStream;
+ }
+
+ /**
+ * @param errorStream The errorStream to set.
+ */
+ protected void setErrorStream(IOConsoleOutputStream errorStream) {
+ this.errorStream = errorStream;
+ }
+
+ /**
+ * @return Returns the errorStream.
+ */
+ protected IOConsoleOutputStream getErrorStream() {
+ return errorStream;
+ }
+
+ /**
+ * @param visible The visible to set.
+ */
+ protected void setVisible(boolean visible) {
+ this.visible = visible;
+ }
+
+ /**
+ * @return Returns the visible.
+ */
+ protected boolean isVisible() {
+ return visible;
+ }
+
+ /**
+ * @param consoleDocument The consoleDocument to set.
+ */
+ private void setConsoleDocument(ConsoleDocument consoleDocument) {
+ this.consoleDocument = consoleDocument;
+ }
+
+ /**
+ * @return Returns the consoleDocument.
+ */
+ protected ConsoleDocument getConsoleDocument() {
+ return consoleDocument;
+ }
+
+ /**
+ * Used to notify this console of lifecycle methods <code>init()</code> and <code>dispose()</code>.
+ */
+ public class MavenConsoleLifecycle implements org.eclipse.ui.console.IConsoleListener {
+
+ public void consolesAdded(IConsole[] consoles) {
+ for(int i = 0; i < consoles.length; i++ ) {
+ IConsole console = consoles[i];
+ if(console == MavenConsoleImpl.this) {
+ init();
+ }
+ }
+
+ }
+
+ public void consolesRemoved(IConsole[] consoles) {
+ for(int i = 0; i < consoles.length; i++ ) {
+ IConsole console = consoles[i];
+ if(console == MavenConsoleImpl.this) {
+ ConsolePlugin.getDefault().getConsoleManager().removeConsoleListener(this);
+ dispose();
+ }
+ }
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.core.MavenConsole#addMavenConsoleListener(org.eclipse.m2e.core.IMavenConsoleListener)
+ */
+ public void addMavenConsoleListener(IMavenConsoleListener listener) {
+ listeners.remove(listener);
+ listeners.add(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.core.MavenConsole#removeMavenConsoleListener(org.eclipse.m2e.core.IMavenConsoleListener)
+ */
+ public void removeMavenConsoleListener(IMavenConsoleListener listener) {
+ listeners.remove(listener);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/PomFileContentDescriber.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/PomFileContentDescriber.java
new file mode 100644
index 00000000..49c9a868
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/PomFileContentDescriber.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.content;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import org.eclipse.core.runtime.content.IContentDescription;
+
+import org.eclipse.m2e.core.internal.Messages;
+
+
+/**
+ * A content describer for POM files.
+ *
+ * @see org.eclipse.ant.internal.core.contentDescriber.AntBuildfileContentDescriber
+ * @author Herve Boutemy
+ * @since 0.9.6
+ */
+public final class PomFileContentDescriber extends XMLContentDescriber {
+ /**
+ * Determines the validation status for the given contents.
+ *
+ * @param contents the contents to be evaluated
+ * @return one of the following:<ul>
+ * <li><code>VALID</code></li>,
+ * <li><code>INVALID</code></li>,
+ * <li><code>INDETERMINATE</code></li>
+ * </ul>
+ * @throws IOException
+ */
+ private int checkCriteria(InputSource contents) throws IOException {
+ PomHandler pomHandler = new PomHandler();
+ try {
+ if(!pomHandler.parseContents(contents)) {
+ return INDETERMINATE;
+ }
+ } catch(SAXException e) {
+ // we may be handed any kind of contents... it is normal we fail to parse
+ return INDETERMINATE;
+ } catch(ParserConfigurationException e) {
+ // some bad thing happened - force this describer to be disabled
+ throw new RuntimeException(Messages.PomFileContentDescriber_error);
+ }
+
+ // Check to see if we matched our criteria.
+ if(pomHandler.hasRootProjectElement()) {
+ if(pomHandler.hasArtifactIdElement()) {
+ //project and artifactId element
+ return VALID;
+ }
+ //only a top level project element: maybe a POM file, but maybe an Ant buildfile, a site descriptor, ...
+ return INDETERMINATE;
+ }
+ return INDETERMINATE;
+ }
+
+ @Override
+ public int describe(InputStream contents, IContentDescription description) throws IOException {
+ // call the basic XML describer to do basic recognition
+ if(super.describe(contents, description) == INVALID) {
+ return INVALID;
+ }
+ // super.describe will have consumed some chars, need to rewind
+ contents.reset();
+ // Check to see if we matched our criteria.
+ return checkCriteria(new InputSource(contents));
+ }
+
+ @Override
+ public int describe(Reader contents, IContentDescription description) throws IOException {
+ // call the basic XML describer to do basic recognition
+ if(super.describe(contents, description) == INVALID) {
+ return INVALID;
+ }
+ // super.describe will have consumed some chars, need to rewind
+ contents.reset();
+ // Check to see if we matched our criteria.
+ return checkCriteria(new InputSource(contents));
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/PomHandler.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/PomHandler.java
new file mode 100644
index 00000000..3ff2db65
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/PomHandler.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.content;
+
+import java.io.IOException;
+import java.io.StringReader;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+
+/**
+ * An xml event handler for detecting the project top-level element in a POM file. Also records whether a default
+ * attribute is present for the project and if any typical Maven elements are present.
+ *
+ * @see org.eclipse.ant.internal.core.contentDescriber.AntHandler
+ * @author Herve Boutemy
+ * @since 0.9.6
+ */
+public final class PomHandler extends DefaultHandler {
+ /**
+ * An exception indicating that the parsing should stop.
+ */
+ private class StopParsingException extends SAXException {
+ /**
+ * All serializable objects should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructs an instance of <code>StopParsingException</code> with a <code>null</code> detail message.
+ */
+ public StopParsingException() {
+ super((String) null);
+ }
+ }
+
+ private static final String PROJECT = "project"; //$NON-NLS-1$
+
+ private static final String ARTIFACTID = "artifactId"; //$NON-NLS-1$
+
+ /**
+ * This is the name of the top-level element found in the XML file. This member variable is <code>null</code> unless
+ * the file has been parsed successful to the point of finding the top-level element.
+ */
+ private String fTopElementFound = null;
+
+ private SAXParserFactory fFactory;
+
+ private boolean fArtifactIdFound = false;
+
+ private int fLevel = -1;
+
+ /**
+ * Creates a new SAX parser for use within this instance.
+ *
+ * @return The newly created parser.
+ * @throws ParserConfigurationException If a parser of the given configuration cannot be created.
+ * @throws SAXException If something in general goes wrong when creating the parser.
+ */
+ private final SAXParser createParser(SAXParserFactory parserFactory) throws ParserConfigurationException,
+ SAXException, SAXNotRecognizedException, SAXNotSupportedException {
+ // Initialize the parser.
+ final SAXParser parser = parserFactory.newSAXParser();
+ final XMLReader reader = parser.getXMLReader();
+ // disable DTD validation
+ try {
+ // be sure validation is "off" or the feature to ignore DTD's will not apply
+ reader.setFeature("http://xml.org/sax/features/validation", false); //$NON-NLS-1$
+ reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); //$NON-NLS-1$
+ } catch(SAXNotRecognizedException e) {
+ // not a big deal if the parser does not recognize the features
+ } catch(SAXNotSupportedException e) {
+ // not a big deal if the parser does not support the features
+ }
+ return parser;
+ }
+
+ private SAXParserFactory getFactory() {
+ synchronized(this) {
+ if(fFactory != null) {
+ return fFactory;
+ }
+ fFactory = SAXParserFactory.newInstance();
+ fFactory.setNamespaceAware(true);
+ }
+ return fFactory;
+ }
+
+ protected boolean parseContents(InputSource contents) throws IOException, ParserConfigurationException, SAXException {
+ // Parse the file into we have what we need (or an error occurs).
+ try {
+ fFactory = getFactory();
+ if(fFactory == null) {
+ return false;
+ }
+ final SAXParser parser = createParser(fFactory);
+ // to support external entities specified as relative URIs (see bug 63298)
+ contents.setSystemId("/"); //$NON-NLS-1$
+ parser.parse(contents, this);
+ } catch(StopParsingException e) {
+ // Abort the parsing normally. Fall through...
+ }
+ return true;
+ }
+
+ /*
+ * Resolve external entity definitions to an empty string. This is to speed
+ * up processing of files with external DTDs. Not resolving the contents
+ * of the DTD is ok, as only the System ID of the DTD declaration is used.
+ * @see org.xml.sax.helpers.DefaultHandler#resolveEntity(java.lang.String, java.lang.String)
+ */
+ @Override
+ public InputSource resolveEntity(String publicId, String systemId) {
+ return new InputSource(new StringReader("")); //$NON-NLS-1$
+ }
+
+
+ @Override
+ public final void startElement(final String uri, final String elementName, final String qualifiedName,
+ final Attributes attributes) throws SAXException {
+ fLevel++ ;
+ if(fTopElementFound == null) {
+ fTopElementFound = elementName;
+ if(!hasRootProjectElement()) {
+ throw new StopParsingException();
+ }
+ }
+ if(fLevel == 1 && ARTIFACTID.equals(elementName)) {
+ fArtifactIdFound = true;
+ throw new StopParsingException();
+ }
+ }
+
+ @Override
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ super.endElement(uri, localName, qName);
+ fLevel-- ;
+ }
+
+ protected boolean hasRootProjectElement() {
+ return PROJECT.equals(fTopElementFound);
+ }
+
+ protected boolean hasArtifactIdElement() {
+ return fArtifactIdFound;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/TextContentDescriber.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/TextContentDescriber.java
new file mode 100644
index 00000000..bfe4da15
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/TextContentDescriber.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.content;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.ITextContentDescriber;
+
+/**
+ * A copy of org.eclipse.core.internal.content.TextContentDescriber to avoid internal API use.
+ *
+ * This class provides internal basis for text-based content describers.
+ *
+ * <p>
+ * Note: do not add protected/public members to this class if you don't intend to
+ * make them public API.
+ * </p>
+ *
+ * @see org.eclipse.core.runtime.content.XMLRootElementContentDescriber2
+ * @since 3.0
+ */
+class TextContentDescriber implements ITextContentDescriber {
+
+ private final static QualifiedName[] SUPPORTED_OPTIONS = {IContentDescription.BYTE_ORDER_MARK};
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.content.ITextContentDescriber#describe(java.io.Reader, org.eclipse.core.runtime.content.IContentDescription)
+ */
+ @SuppressWarnings("unused")
+ public int describe(Reader contents, IContentDescription description) throws IOException {
+ // we want to be pretty loose on detecting the text content type
+ return INDETERMINATE;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.content.IContentDescriber#describe(java.io.InputStream, org.eclipse.core.runtime.content.IContentDescription)
+ */
+ public int describe(InputStream contents, IContentDescription description) throws IOException {
+ if (description == null || !description.isRequested(IContentDescription.BYTE_ORDER_MARK))
+ return INDETERMINATE;
+ byte[] bom = getByteOrderMark(contents);
+ if (bom != null)
+ description.setProperty(IContentDescription.BYTE_ORDER_MARK, bom);
+ // we want to be pretty loose on detecting the text content type
+ return INDETERMINATE;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.content.IContentDescriber#getSupportedOptions()
+ */
+ public QualifiedName[] getSupportedOptions() {
+ return SUPPORTED_OPTIONS;
+ }
+
+ byte[] getByteOrderMark(InputStream input) throws IOException {
+ int first = input.read();
+ if (first == 0xEF) {
+ //look for the UTF-8 Byte Order Mark (BOM)
+ int second = input.read();
+ int third = input.read();
+ if (second == 0xBB && third == 0xBF)
+ return IContentDescription.BOM_UTF_8;
+ } else if (first == 0xFE) {
+ //look for the UTF-16 BOM
+ if (input.read() == 0xFF)
+ return IContentDescription.BOM_UTF_16BE;
+ } else if (first == 0xFF) {
+ if (input.read() == 0xFE)
+ return IContentDescription.BOM_UTF_16LE;
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/XMLContentDescriber.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/XMLContentDescriber.java
new file mode 100644
index 00000000..ed115a0a
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/content/XMLContentDescriber.java
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.content;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.core.runtime.content.ITextContentDescriber;
+
+/**
+ * A copy of org.eclipse.core.internal.content.XMLContentDescriber to avoid internal API use.
+ *
+ * A content interpreter for XML files.
+ * This class provides internal basis for XML-based content describers.
+ * <p>
+ * Note: do not add protected/public members to this class if you don't intend to
+ * make them public API.
+ * </p>
+ *
+ * @see org.eclipse.core.runtime.content.XMLRootElementContentDescriber2
+ * @see "http://www.w3.org/TR/REC-xml *"
+ */
+class XMLContentDescriber extends TextContentDescriber implements ITextContentDescriber {
+ private static final QualifiedName[] SUPPORTED_OPTIONS = new QualifiedName[] {IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK};
+ private static final String ENCODING = "encoding="; //$NON-NLS-1$
+ private static final String XML_PREFIX = "<?xml "; //$NON-NLS-1$
+
+ public int describe(InputStream input, IContentDescription description) throws IOException {
+ byte[] bom = getByteOrderMark(input);
+ String xmlDeclEncoding = "UTF-8"; //$NON-NLS-1$
+ input.reset();
+ if (bom != null) {
+ if (bom == IContentDescription.BOM_UTF_16BE)
+ xmlDeclEncoding = "UTF-16BE"; //$NON-NLS-1$
+ else if (bom == IContentDescription.BOM_UTF_16LE)
+ xmlDeclEncoding = "UTF-16LE"; //$NON-NLS-1$
+ // skip BOM to make comparison simpler
+ input.skip(bom.length);
+ // set the BOM in the description if requested
+ if (description != null && description.isRequested(IContentDescription.BYTE_ORDER_MARK))
+ description.setProperty(IContentDescription.BYTE_ORDER_MARK, bom);
+ }
+ byte[] xmlPrefixBytes = XML_PREFIX.getBytes(xmlDeclEncoding);
+ byte[] prefix = new byte[xmlPrefixBytes.length];
+ if (input.read(prefix) < prefix.length)
+ // there is not enough info to say anything
+ return INDETERMINATE;
+ for (int i = 0; i < prefix.length; i++)
+ if (prefix[i] != xmlPrefixBytes[i])
+ // we don't have a XMLDecl... there is not enough info to say anything
+ return INDETERMINATE;
+ if (description == null)
+ return VALID;
+ // describe charset if requested
+ if (description.isRequested(IContentDescription.CHARSET)) {
+ String fullXMLDecl = readFullXMLDecl(input, xmlDeclEncoding);
+ if (fullXMLDecl != null) {
+ String charset = getCharset(fullXMLDecl);
+ if (charset != null && !"UTF-8".equalsIgnoreCase(charset)) //$NON-NLS-1$
+ // only set property if value is not default (avoid using a non-default content description)
+ description.setProperty(IContentDescription.CHARSET, getCharset(fullXMLDecl));
+ }
+ }
+ return VALID;
+ }
+
+ private String readFullXMLDecl(InputStream input, String unicodeEncoding) throws IOException {
+ byte[] xmlDecl = new byte[100];
+ int c = 0;
+ // looks for XMLDecl ending char (?)
+ int read = 0;
+ while (read < xmlDecl.length && (c = input.read()) != -1 && c != '?')
+ xmlDecl[read++] = (byte) c;
+ return c == '?' ? new String(xmlDecl, 0, read, unicodeEncoding) : null;
+ }
+
+ public int describe(Reader input, IContentDescription description) throws IOException {
+ BufferedReader reader = new BufferedReader(input);
+ String line = reader.readLine();
+ // end of stream
+ if (line == null)
+ return INDETERMINATE;
+ // XMLDecl should be the first string (no blanks allowed)
+ if (!line.startsWith(XML_PREFIX))
+ return INDETERMINATE;
+ if (description == null)
+ return VALID;
+ // describe charset if requested
+ if ((description.isRequested(IContentDescription.CHARSET)))
+ description.setProperty(IContentDescription.CHARSET, getCharset(line));
+ return VALID;
+ }
+
+ private String getCharset(String firstLine) {
+ int encodingPos = firstLine.indexOf(ENCODING);
+ if (encodingPos == -1)
+ return null;
+ char quoteChar = '"';
+ int firstQuote = firstLine.indexOf(quoteChar, encodingPos);
+ if (firstQuote == -1) {
+ quoteChar = '\'';
+ firstQuote = firstLine.indexOf(quoteChar, encodingPos);
+ }
+ if (firstQuote == -1 || firstLine.length() == firstQuote - 1)
+ return null;
+ int secondQuote = firstLine.indexOf(quoteChar, firstQuote + 1);
+ if (secondQuote == -1)
+ return null;
+ return firstLine.substring(firstQuote + 1, secondQuote);
+ }
+
+ public QualifiedName[] getSupportedOptions() {
+ return SUPPORTED_OPTIONS;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/AbstractTransferListenerAdapter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/AbstractTransferListenerAdapter.java
new file mode 100644
index 00000000..22d1f714
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/AbstractTransferListenerAdapter.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.osgi.util.NLS;
+
+import org.apache.maven.wagon.WagonConstants;
+
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.internal.Messages;
+
+
+/**
+ * AbstractTransferListenerAdapter
+ *
+ * @author igor
+ */
+abstract class AbstractTransferListenerAdapter {
+
+ protected final MavenImpl maven;
+
+ protected final IProgressMonitor monitor;
+
+ protected final MavenConsole console;
+
+ protected long complete = 0;
+
+ private static final String[] units = {Messages.AbstractTransferListenerAdapter_byte, Messages.AbstractTransferListenerAdapter_kb, Messages.AbstractTransferListenerAdapter_mb};
+
+ protected AbstractTransferListenerAdapter(MavenImpl maven, IProgressMonitor monitor, MavenConsole console) {
+ this.maven = maven;
+ this.monitor = monitor == null ? new NullProgressMonitor() : monitor;
+ this.console = console;
+ }
+
+ protected void formatBytes(long n, StringBuffer sb) {
+ int i = 0;
+ while(n >= 1024 && ++i < units.length)
+ n >>= 10;
+
+ sb.append(n);
+ sb.append(units[i]);
+ }
+
+ protected void transferInitiated(String artifactUrl) {
+ this.complete = 0;
+
+ if (artifactUrl != null) {
+ monitor.subTask(artifactUrl);
+ }
+ }
+
+ protected void transferStarted(String artifactUrl) {
+ console.logMessage(NLS.bind("Downloading {0}", artifactUrl));
+ // monitor.beginTask("0% "+e.getWagon().getRepository()+"/"+e.getResource().getName(), IProgressMonitor.UNKNOWN);
+ monitor.subTask(Messages.AbstractTransferListenerAdapter_4 + artifactUrl);
+ }
+
+ protected void transferProgress(String artifactUrl, long total, int length) {
+ if(monitor.isCanceled()) {
+ throw new OperationCanceledException(Messages.AbstractTransferListenerAdapter_cancelled);
+ }
+
+ complete += length;
+
+ StringBuffer sb = new StringBuffer();
+
+ formatBytes(complete, sb);
+ if(total != WagonConstants.UNKNOWN_LENGTH) {
+ sb.append('/');
+ formatBytes(total, sb);
+ if (total > 0) {
+ sb.append(" (");
+ sb.append(100l * complete / total);
+ sb.append("%)");
+ }
+ }
+ sb.append(' ');
+
+ monitor.subTask(sb.toString() + artifactUrl);
+ }
+
+ protected void transferCompleted(String artifactUrl) {
+ console.logMessage(NLS.bind("Downloaded {0}", artifactUrl));
+
+ // monitor.subTask("100% "+e.getWagon().getRepository()+"/"+e.getResource().getName());
+ monitor.subTask(""); //$NON-NLS-1$
+ }
+
+ protected void transferError(String artifactUrl, Exception exception) {
+ console.logMessage(NLS.bind("Unable to download {0} : {1}", artifactUrl, exception));
+ monitor.subTask(NLS.bind(Messages.AbstractTransferListenerAdapter_subtask, artifactUrl));
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ArtifactTransferListenerAdapter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ArtifactTransferListenerAdapter.java
new file mode 100644
index 00000000..9562cb9c
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ArtifactTransferListenerAdapter.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.sonatype.aether.transfer.TransferEvent;
+import org.sonatype.aether.transfer.TransferListener;
+
+import org.eclipse.m2e.core.core.MavenConsole;
+
+/**
+ * ArtifactTransferListenerAdapter
+ *
+ * @author igor
+ */
+public class ArtifactTransferListenerAdapter extends AbstractTransferListenerAdapter implements
+ TransferListener {
+
+ ArtifactTransferListenerAdapter(MavenImpl maven, IProgressMonitor monitor, MavenConsole console) {
+ super(maven, monitor, console);
+ }
+
+ public void transferInitiated(TransferEvent event) {
+ transferInitiated(event.getResource().getRepositoryUrl() + event.getResource().getResourceName());
+ }
+
+ public void transferProgressed(TransferEvent event) {
+ long total = event.getResource().getContentLength();
+ String artifactUrl = event.getResource().getRepositoryUrl() + event.getResource().getResourceName();
+
+ transferProgress(artifactUrl, total, event.getDataBuffer().remaining());
+ }
+
+ public void transferStarted(TransferEvent event) {
+ transferStarted(event.getResource().getRepositoryUrl() + event.getResource().getResourceName());
+ }
+
+ public void transferCorrupted(TransferEvent event) {
+ }
+
+ public void transferSucceeded(TransferEvent event) {
+ transferCompleted(event.getResource().getRepositoryUrl() + event.getResource().getResourceName());
+ }
+
+ public void transferFailed(TransferEvent event) {
+ transferCompleted(event.getResource().getRepositoryUrl() + event.getResource().getResourceName());
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSession.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSession.java
new file mode 100644
index 00000000..7ac41337
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSession.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import org.sonatype.aether.RepositorySystemSession;
+
+public interface ContextRepositorySystemSession extends RepositorySystemSession {
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSessionImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSessionImpl.java
new file mode 100644
index 00000000..840e1938
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSessionImpl.java
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import java.util.Map;
+
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
+
+import org.apache.maven.plugin.LegacySupport;
+
+import org.sonatype.aether.RepositoryCache;
+import org.sonatype.aether.RepositoryListener;
+import org.sonatype.aether.RepositorySystemSession;
+import org.sonatype.aether.SessionData;
+import org.sonatype.aether.artifact.ArtifactTypeRegistry;
+import org.sonatype.aether.collection.DependencyGraphTransformer;
+import org.sonatype.aether.collection.DependencyManager;
+import org.sonatype.aether.collection.DependencySelector;
+import org.sonatype.aether.collection.DependencyTraverser;
+import org.sonatype.aether.repository.AuthenticationSelector;
+import org.sonatype.aether.repository.LocalRepository;
+import org.sonatype.aether.repository.LocalRepositoryManager;
+import org.sonatype.aether.repository.MirrorSelector;
+import org.sonatype.aether.repository.ProxySelector;
+import org.sonatype.aether.repository.WorkspaceReader;
+import org.sonatype.aether.transfer.TransferListener;
+
+
+@Component(role = ContextRepositorySystemSession.class)
+public class ContextRepositorySystemSessionImpl implements ContextRepositorySystemSession {
+
+ @Requirement
+ private LegacySupport context;
+
+ private RepositorySystemSession getSession() {
+ RepositorySystemSession session = context.getRepositorySession();
+ if(session == null) {
+ throw new IllegalStateException("no context maven session"); //$NON-NLS-1$
+ }
+ return session;
+ }
+
+ public ArtifactTypeRegistry getArtifactTypeRegistry() {
+ return getSession().getArtifactTypeRegistry();
+ }
+
+ public AuthenticationSelector getAuthenticationSelector() {
+ return getSession().getAuthenticationSelector();
+ }
+
+ public RepositoryCache getCache() {
+ return getSession().getCache();
+ }
+
+ public String getChecksumPolicy() {
+ return getSession().getChecksumPolicy();
+ }
+
+ public Map<String, Object> getConfigProperties() {
+ return getSession().getConfigProperties();
+ }
+
+ public SessionData getData() {
+ return getSession().getData();
+ }
+
+ public DependencyGraphTransformer getDependencyGraphTransformer() {
+ return getSession().getDependencyGraphTransformer();
+ }
+
+ public DependencyManager getDependencyManager() {
+ return getSession().getDependencyManager();
+ }
+
+ public DependencySelector getDependencySelector() {
+ return getSession().getDependencySelector();
+ }
+
+ public DependencyTraverser getDependencyTraverser() {
+ return getSession().getDependencyTraverser();
+ }
+
+ public LocalRepository getLocalRepository() {
+ return getSession().getLocalRepository();
+ }
+
+ public LocalRepositoryManager getLocalRepositoryManager() {
+ return getSession().getLocalRepositoryManager();
+ }
+
+ public MirrorSelector getMirrorSelector() {
+ return getSession().getMirrorSelector();
+ }
+
+ public ProxySelector getProxySelector() {
+ return getSession().getProxySelector();
+ }
+
+ public RepositoryListener getRepositoryListener() {
+ return getSession().getRepositoryListener();
+ }
+
+ public Map<String, String> getSystemProperties() {
+ return getSession().getSystemProperties();
+ }
+
+ public TransferListener getTransferListener() {
+ return getSession().getTransferListener();
+ }
+
+ public String getUpdatePolicy() {
+ return getSession().getUpdatePolicy();
+ }
+
+ public Map<String, String> getUserProperties() {
+ return getSession().getUserProperties();
+ }
+
+ public WorkspaceReader getWorkspaceReader() {
+ return getSession().getWorkspaceReader();
+ }
+
+ public boolean isIgnoreInvalidArtifactDescriptor() {
+ return getSession().isIgnoreInvalidArtifactDescriptor();
+ }
+
+ public boolean isIgnoreMissingArtifactDescriptor() {
+ return getSession().isIgnoreMissingArtifactDescriptor();
+ }
+
+ public boolean isNotFoundCachingEnabled() {
+ return getSession().isNotFoundCachingEnabled();
+ }
+
+ public boolean isOffline() {
+ return getSession().isOffline();
+ }
+
+ public boolean isTransferErrorCachingEnabled() {
+ return getSession().isTransferErrorCachingEnabled();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/DefaultMavenComponentContributor.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/DefaultMavenComponentContributor.java
new file mode 100644
index 00000000..038d1452
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/DefaultMavenComponentContributor.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import org.apache.maven.classrealm.ClassRealmManagerDelegate;
+import org.apache.maven.plugin.internal.PluginDependenciesResolver;
+import org.apache.maven.project.artifact.MavenMetadataCache;
+
+import org.sonatype.aether.impl.LocalRepositoryMaintainer;
+import org.sonatype.plexus.build.incremental.BuildContext;
+
+import org.eclipse.m2e.core.internal.project.EclipseMavenMetadataCache;
+import org.eclipse.m2e.core.internal.project.registry.EclipsePluginDependenciesResolver;
+
+
+/**
+ */
+public class DefaultMavenComponentContributor implements IMavenComponentContributor {
+
+ public void contribute(IMavenComponentBinder binder) {
+ binder.bind(MavenMetadataCache.class, EclipseMavenMetadataCache.class, null);
+ binder.bind(PluginDependenciesResolver.class, EclipsePluginDependenciesResolver.class, null);
+ binder.bind(BuildContext.class, EclipseBuildContext.class, null);
+ binder.bind(ClassRealmManagerDelegate.class, EclipseClassRealmManagerDelegate.class, EclipseClassRealmManagerDelegate.ROLE_HINT);
+ binder.bind(LocalRepositoryMaintainer.class, EclipseLocalRepositoryMaintainer.class, EclipseLocalRepositoryMaintainer.ROLE_HINT);
+ binder.bind(ContextRepositorySystemSession.class, ContextRepositorySystemSessionImpl.class, null);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseBuildContext.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseBuildContext.java
new file mode 100644
index 00000000..52cfc528
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseBuildContext.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import org.codehaus.plexus.component.annotations.Component;
+
+import org.sonatype.plexus.build.incremental.BuildContext;
+import org.sonatype.plexus.build.incremental.ThreadBuildContext;
+
+
+/**
+ * Incremental build context.
+ */
+@Component(role = BuildContext.class)
+public class EclipseBuildContext extends ThreadBuildContext {
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseClassRealmManagerDelegate.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseClassRealmManagerDelegate.java
new file mode 100644
index 00000000..b623d1ec
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseClassRealmManagerDelegate.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.classworlds.realm.ClassRealm;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
+
+import org.apache.maven.artifact.versioning.ArtifactVersion;
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
+import org.apache.maven.classrealm.ClassRealmConstituent;
+import org.apache.maven.classrealm.ClassRealmManagerDelegate;
+import org.apache.maven.classrealm.ClassRealmRequest;
+
+
+/**
+ * EclipseArtifactFilterManager
+ *
+ * @author igor
+ */
+@Component(role = ClassRealmManagerDelegate.class)
+public class EclipseClassRealmManagerDelegate implements ClassRealmManagerDelegate {
+
+ public static final String ROLE_HINT = EclipseClassRealmManagerDelegate.class.getName();
+
+ @Requirement
+ private PlexusContainer plexus;
+
+ private final ArtifactVersion currentBuildApiVersion;
+
+ public EclipseClassRealmManagerDelegate() {
+ Properties props = new Properties();
+ InputStream is = getClass().getResourceAsStream("/org/sonatype/plexus/build/incremental/version.properties"); //$NON-NLS-1$
+ if(is != null) {
+ try {
+ props.load(is);
+ } catch(IOException e) {
+ e.printStackTrace();
+ }
+ }
+ currentBuildApiVersion = new DefaultArtifactVersion(props.getProperty("api.version", "0.0.5")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void setupRealm(ClassRealm realm, ClassRealmRequest request) {
+ if(supportsBuildApi(request.getConstituents())) {
+ ClassRealm coreRealm = plexus.getContainerRealm();
+
+ realm.importFrom(coreRealm, "org.codehaus.plexus.util.AbstractScanner"); //$NON-NLS-1$
+ realm.importFrom(coreRealm, "org.codehaus.plexus.util.Scanner"); //$NON-NLS-1$
+
+ realm.importFrom(coreRealm, "org.sonatype.plexus.build.incremental"); //$NON-NLS-1$
+ }
+ }
+
+ private boolean supportsBuildApi(List<ClassRealmConstituent> constituents) {
+ for(Iterator<ClassRealmConstituent> it = constituents.iterator(); it.hasNext();) {
+ ClassRealmConstituent constituent = it.next();
+ if("org.sonatype.plexus".equals(constituent.getGroupId()) //$NON-NLS-1$
+ && "plexus-build-api".equals(constituent.getArtifactId())) { //$NON-NLS-1$
+ ArtifactVersion version = new DefaultArtifactVersion(constituent.getVersion());
+ boolean compatible = currentBuildApiVersion.compareTo(version) >= 0;
+ if(compatible) {
+ // removing the JAR from the plugin realm to prevent discovery of the DefaultBuildContext
+ it.remove();
+ }
+ return compatible;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseLocalRepositoryMaintainer.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseLocalRepositoryMaintainer.java
new file mode 100644
index 00000000..77ce63c7
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseLocalRepositoryMaintainer.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import java.io.File;
+
+import org.codehaus.plexus.component.annotations.Component;
+
+import org.sonatype.aether.artifact.Artifact;
+import org.sonatype.aether.impl.LocalRepositoryEvent;
+import org.sonatype.aether.impl.LocalRepositoryMaintainer;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.ILocalRepositoryListener;
+
+/**
+ * EclipseLocalRepositoryMaintainer
+ *
+ * @author igor
+ */
+@Component(role = LocalRepositoryMaintainer.class)
+public class EclipseLocalRepositoryMaintainer implements LocalRepositoryMaintainer {
+
+ public static final String ROLE_HINT = EclipseLocalRepositoryMaintainer.class.getName();
+
+ public void artifactDownloaded(LocalRepositoryEvent event) {
+ notifyListeners(event);
+ }
+
+ public void artifactInstalled(LocalRepositoryEvent event) {
+ notifyListeners(event);
+ }
+
+ private void notifyListeners(LocalRepositoryEvent event) {
+ MavenImpl maven = (MavenImpl) MavenPlugin.getDefault().getMaven();
+
+ File basedir = event.getRepository().getBasedir();
+ Artifact artifact = event.getArtifact();
+ ArtifactKey key = new ArtifactKey(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
+ artifact.getClassifier());
+ for(ILocalRepositoryListener listener : maven.getLocalRepositoryListeners()) {
+ listener.artifactInstalled(basedir, key, event.getFile());
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseLogger.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseLogger.java
new file mode 100644
index 00000000..16cbe8b6
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseLogger.java
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import org.eclipse.osgi.util.NLS;
+
+import org.codehaus.plexus.logging.Logger;
+
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.internal.Messages;
+
+class EclipseLogger implements Logger {
+ private MavenConsole console;
+ private final IMavenConfiguration mavenConfiguration;
+
+ public EclipseLogger(MavenConsole console, IMavenConfiguration mavenConfiguration) {
+ this.console = console;
+ this.mavenConfiguration = mavenConfiguration;
+ }
+
+ private void out(String s) {
+ console.logMessage(s);
+ }
+
+ private void outError(String s) {
+ console.logError(s);
+ }
+
+ public void debug( String msg ) {
+ if (isDebugEnabled()) {
+ out(NLS.bind(Messages.EclipseLogger_debug1,msg));
+ }
+ }
+
+ public void debug( String msg, Throwable t) {
+ if (isDebugEnabled()) {
+ out( NLS.bind(Messages.EclipseLogger_debug2, msg, t.getMessage()));
+ }
+ }
+
+ public void info( String msg ) {
+ if (isInfoEnabled()) {
+ out( NLS.bind(Messages.EclipseLogger_info1, msg));
+ }
+ }
+
+ public void info( String msg, Throwable t ) {
+ if (isInfoEnabled()) {
+ out( NLS.bind(Messages.EclipseLogger_info2, msg, t.getMessage()));
+ }
+ }
+
+ public void warn( String msg ) {
+ if (isWarnEnabled()) {
+ out(NLS.bind(Messages.EclipseLogger_warn1, msg));
+ }
+ }
+
+ public void warn( String msg, Throwable t ) {
+ if (isWarnEnabled()) {
+ out( NLS.bind(Messages.EclipseLogger_warn2, msg, t.getMessage()));
+ }
+ }
+
+ public void fatalError( String msg ) {
+ if (isFatalErrorEnabled()) {
+ outError(NLS.bind(Messages.EclipseLogger_fatal1, msg));
+ }
+ }
+
+ public void fatalError( String msg, Throwable t ) {
+ if (isFatalErrorEnabled()) {
+ outError( NLS.bind(Messages.EclipseLogger_fatal2, msg, t.getMessage()));
+ }
+ }
+
+ public void error( String msg ) {
+ if (isErrorEnabled()) {
+ outError(NLS.bind(Messages.EclipseLogger_error1, msg));
+ }
+ }
+
+ public void error( String msg, Throwable t ) {
+ if (isErrorEnabled()) {
+ outError( NLS.bind(Messages.EclipseLogger_error2, msg, t.getMessage()));
+ }
+ }
+
+ public boolean isDebugEnabled() {
+ return mavenConfiguration.isDebugOutput();
+ }
+
+ public boolean isInfoEnabled() {
+ return true;
+ }
+
+ public boolean isWarnEnabled() {
+ return true;
+ }
+
+ public boolean isErrorEnabled() {
+ return true;
+ }
+
+ public boolean isFatalErrorEnabled() {
+ return true;
+ }
+
+ public void setThreshold( int treshold ) {
+ }
+
+ public int getThreshold() {
+ return LEVEL_DEBUG;
+ }
+
+ public Logger getChildLogger(String name) {
+ return this;
+ }
+
+ public String getName() {
+ return Messages.EclipseLogger_name;
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseLoggerManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseLoggerManager.java
new file mode 100644
index 00000000..2e6c4dd4
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/EclipseLoggerManager.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import org.codehaus.plexus.logging.AbstractLoggerManager;
+import org.codehaus.plexus.logging.Logger;
+
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+
+
+/**
+ * EclipseLoggerManager
+ *
+ * @author igor
+ */
+public class EclipseLoggerManager extends AbstractLoggerManager {
+
+ private EclipseLogger logger;
+
+ public EclipseLoggerManager(MavenConsole console, IMavenConfiguration mavenConfiguration) {
+ this.logger = new EclipseLogger(console, mavenConfiguration);
+ }
+
+ public int getActiveLoggerCount() {
+ return 1;
+ }
+
+ public Logger getLoggerForComponent(String arg0, String arg1) {
+ return logger;
+ }
+
+ public int getThreshold() {
+ return Logger.LEVEL_DEBUG;
+ }
+
+ public int getThreshold(String arg0, String arg1) {
+ return Logger.LEVEL_DEBUG;
+ }
+
+ public void returnComponentLogger(String arg0, String arg1) {
+ }
+
+ public void setThreshold(int arg0) {
+ }
+
+ public void setThreshold(String arg0, String arg1, int arg2) {
+ }
+
+ public void setThresholds(int arg0) {
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ExtensionModule.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ExtensionModule.java
new file mode 100644
index 00000000..ddf309c1
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ExtensionModule.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.name.Names;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+
+
+/**
+ * A custom Guice module that picks the components contributed by extensions.
+ */
+class ExtensionModule extends AbstractModule implements IMavenComponentContributor.IMavenComponentBinder {
+
+ public <T> void bind(Class<T> role, Class<? extends T> impl, String hint) {
+ if(hint == null || hint.length() <= 0 || "default".equals(hint)) { //$NON-NLS-1$
+ bind(role).to(impl);
+ } else {
+ bind(role).annotatedWith(Names.named(hint)).to(impl);
+ }
+ }
+
+ protected void configure() {
+ IExtensionRegistry r = Platform.getExtensionRegistry();
+ for(IConfigurationElement c : r.getConfigurationElementsFor(IMavenConstants.MAVEN_COMPONENT_CONTRIBUTORS_XPT)) {
+ if("configurator".equals(c.getName())) { //$NON-NLS-1$
+ try {
+ IMavenComponentContributor contributor = (IMavenComponentContributor) c.createExecutableExtension("class"); //$NON-NLS-1$
+ contributor.contribute(this);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/IMavenComponentContributor.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/IMavenComponentContributor.java
new file mode 100644
index 00000000..fd4963cc
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/IMavenComponentContributor.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+/**
+ * Allows extensions to contribute components to the Maven core container.
+ */
+public interface IMavenComponentContributor {
+
+ void contribute(IMavenComponentBinder binder);
+
+ public interface IMavenComponentBinder {
+
+ <T> void bind(Class<T> role, Class<? extends T> impl, String hint);
+
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenConfigurationImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenConfigurationImpl.java
new file mode 100644
index 00000000..fd786884
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenConfigurationImpl.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.embedder.IMavenConfigurationChangeListener;
+import org.eclipse.m2e.core.embedder.MavenConfigurationChangeEvent;
+import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+
+
+public class MavenConfigurationImpl implements IMavenConfiguration, IPropertyChangeListener {
+
+ private final IPreferenceStore preferenceStore;
+ private final ListenerList listeners = new ListenerList(ListenerList.IDENTITY);
+
+ public MavenConfigurationImpl(IPreferenceStore preferenceStore) {
+ this.preferenceStore = preferenceStore;
+ preferenceStore.addPropertyChangeListener(this);
+ }
+
+ public String getGlobalSettingsFile() {
+ return preferenceStore.getString(MavenPreferenceConstants.P_GLOBAL_SETTINGS_FILE);
+ }
+
+ public String getJiraPassword() {
+ return preferenceStore.getString(MavenPreferenceConstants.P_JIRA_PASSWORD);
+ }
+
+ public String getJiraUsername() {
+ return preferenceStore.getString(MavenPreferenceConstants.P_JIRA_USERNAME);
+ }
+
+ public String getUserSettingsFile() {
+ return preferenceStore.getString(MavenPreferenceConstants.P_USER_SETTINGS_FILE);
+ }
+
+ public boolean isDebugOutput() {
+ return preferenceStore.getBoolean(MavenPreferenceConstants.P_DEBUG_OUTPUT);
+ }
+
+ public boolean isDownloadJavaDoc() {
+ return preferenceStore.getBoolean(MavenPreferenceConstants.P_DOWNLOAD_JAVADOC);
+ }
+
+ public boolean isDownloadSources() {
+ return preferenceStore.getBoolean(MavenPreferenceConstants.P_DOWNLOAD_SOURCES);
+ }
+
+ public boolean isHideFoldersOfNestedProjects() {
+ return preferenceStore.getBoolean(MavenPreferenceConstants.P_HIDE_FOLDERS_OF_NESTED_PROJECTS);
+ }
+
+ public boolean isOffline() {
+ return preferenceStore.getBoolean(MavenPreferenceConstants.P_OFFLINE);
+ }
+
+ public void setUserSettingsFile(String settingsFile) {
+ preferenceStore.setValue(MavenPreferenceConstants.P_USER_SETTINGS_FILE, nvl(settingsFile));
+ }
+
+ public void setGlobalSettingsFile(String globalSettingsFile){
+ preferenceStore.setValue(MavenPreferenceConstants.P_GLOBAL_SETTINGS_FILE, nvl(globalSettingsFile));
+ }
+
+ private static String nvl(String s) {
+ return s == null ? "" : s; //$NON-NLS-1$
+ }
+
+ public boolean isUpdateProjectsOnStartup() {
+ return preferenceStore.getBoolean(MavenPreferenceConstants.P_UPDATE_PROJECTS);
+ }
+
+ public boolean isUpdateIndexesOnStartup() {
+ return preferenceStore.getBoolean(MavenPreferenceConstants.P_UPDATE_INDEXES);
+ }
+
+ public synchronized void addConfigurationChangeListener(IMavenConfigurationChangeListener listener) {
+ this.listeners.add(listener);
+ }
+
+ public void propertyChange(PropertyChangeEvent event) {
+ MavenConfigurationChangeEvent mavenEvent = new MavenConfigurationChangeEvent(event.getProperty(), event.getNewValue(), event.getOldValue());
+ for (Object listener : listeners.getListeners()) {
+ try {
+ ((IMavenConfigurationChangeListener) listener).mavenConfigutationChange(mavenEvent);
+ } catch (Exception e) {
+ MavenLogger.log("Could not deliver maven configuration change event", e);
+ }
+ }
+
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java
new file mode 100644
index 00000000..e9142b62
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
+import org.eclipse.m2e.core.embedder.MavenRuntime;
+import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
+import org.eclipse.m2e.core.internal.Messages;
+
+/**
+ * Embedded Maven runtime
+ *
+ * @author Eugene Kuleshov
+ * @author Igor Fedorenko
+ */
+public class MavenEmbeddedRuntime implements MavenRuntime {
+
+ private static final String MAVEN_MAVEN_EMBEDDER_BUNDLE_ID = "org.eclipse.m2e.maven.runtime"; //$NON-NLS-1$
+
+ private static final String MAVEN_EXECUTOR_CLASS = org.apache.maven.cli.MavenCli.class.getName();
+
+ public static final String PLEXUS_CLASSWORLD_NAME = "plexus.core"; //$NON-NLS-1$
+
+ private static String[] LAUNCHER_CLASSPATH;
+ private static String[] CLASSPATH;
+
+ private static volatile String mavenVersion;
+
+ private BundleContext bundleContext;
+
+ public MavenEmbeddedRuntime(BundleContext bundleContext) {
+ this.bundleContext = bundleContext;
+ }
+
+ public boolean isEditable() {
+ return false;
+ }
+
+ public String getLocation() {
+ return MavenRuntimeManager.EMBEDDED;
+ }
+
+ public String getSettings() {
+ return null;
+ }
+
+ public boolean isAvailable() {
+ return true;
+ }
+
+ public void createLauncherConfiguration(IMavenLauncherConfiguration collector, IProgressMonitor monitor) throws CoreException {
+ collector.setMainType(MAVEN_EXECUTOR_CLASS, PLEXUS_CLASSWORLD_NAME);
+
+ initClasspath(findMavenEmbedderBundle());
+
+ collector.addRealm(IMavenLauncherConfiguration.LAUNCHER_REALM);
+ for(String entry : LAUNCHER_CLASSPATH) {
+ collector.addArchiveEntry(entry);
+ }
+
+ collector.addRealm(PLEXUS_CLASSWORLD_NAME);
+ for(String entry : CLASSPATH) {
+ // https://issues.sonatype.org/browse/MNGECLIPSE-2507
+ if(!entry.contains("plexus-build-api")) {
+ collector.addArchiveEntry(entry);
+ }
+ }
+ }
+
+ private static synchronized void initClasspath(Bundle bundle) {
+ if(CLASSPATH == null) {
+ List<String> cp = new ArrayList<String>();
+ List<String> lcp = new ArrayList<String>();
+
+ @SuppressWarnings("unchecked")
+ Enumeration<URL> entries = bundle.findEntries("/", "*", true); //$NON-NLS-1$ //$NON-NLS-2$
+ while(entries.hasMoreElements()) {
+ URL url = entries.nextElement();
+ String path = url.getPath();
+ if(path.endsWith(".jar") || path.endsWith("bin/")) { //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ String file = FileLocator.toFileURL(url).getFile();
+ if (file.contains("plexus-classworlds")) { //$NON-NLS-1$
+ lcp.add(file);
+ } else {
+ cp.add(file);
+ }
+ } catch(IOException ex) {
+ MavenLogger.log("Error adding classpath entry " + url.toString(), ex);
+ }
+ }
+ }
+
+ CLASSPATH = cp.toArray(new String[cp.size()]);
+ LAUNCHER_CLASSPATH = lcp.toArray(new String[lcp.size()]);
+ }
+ }
+
+ private Bundle findMavenEmbedderBundle() {
+ Bundle bundle = null;
+ Bundle[] bundles = bundleContext.getBundles();
+ for(int i = 0; i < bundles.length; i++ ) {
+ if(MAVEN_MAVEN_EMBEDDER_BUNDLE_ID.equals(bundles[i].getSymbolicName())) {
+ bundle = bundles[i];
+ break;
+ }
+ }
+ return bundle;
+ }
+
+ public String toString() {
+ Bundle embedder = Platform.getBundle(MAVEN_MAVEN_EMBEDDER_BUNDLE_ID);
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("Embedded (").append(getVersion()); //$NON-NLS-1$
+ if (embedder != null) {
+ String version = (String) embedder.getHeaders().get(Constants.BUNDLE_VERSION);
+ sb.append('/').append(version);
+ }
+ sb.append(')');
+
+ return sb.toString();
+ }
+
+ private static synchronized String getVersion(Bundle bundle) {
+ if(mavenVersion != null) {
+ return mavenVersion;
+ }
+ initClasspath(bundle);
+ try {
+ String mavenCoreJarPath = null;
+ for(String path : CLASSPATH) {
+ if(path.contains("maven-core") && path.endsWith(".jar")) {
+ mavenCoreJarPath = path;
+ break;
+ }
+ }
+
+ if(mavenCoreJarPath == null) {
+ throw new RuntimeException("Could not find maven core jar file");
+ }
+
+ ZipFile zip = new ZipFile(mavenCoreJarPath);
+ try {
+ ZipEntry zipEntry = zip.getEntry("META-INF/maven/org.apache.maven/maven-core/pom.properties"); //$NON-NLS-1$
+ if(zipEntry != null) {
+ Properties pomProperties = new Properties();
+ pomProperties.load(zip.getInputStream(zipEntry));
+
+ String version = pomProperties.getProperty("version"); //$NON-NLS-1$
+ if(version != null) {
+ mavenVersion = version;
+ return mavenVersion;
+ }
+ }
+ } finally {
+ zip.close();
+ }
+ } catch(Exception e) {
+ MavenLogger.log("Could not determine embedded maven version", e);
+ }
+
+ return Messages.MavenEmbeddedRuntime_unknown;
+ }
+
+ public String getVersion() {
+ Bundle bundle = findMavenEmbedderBundle();
+ return getVersion(bundle);
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExternalRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExternalRuntime.java
new file mode 100644
index 00000000..e11f84b1
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenExternalRuntime.java
@@ -0,0 +1,239 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.net.URL;
+import java.util.Properties;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+import org.codehaus.plexus.classworlds.launcher.ConfigurationHandler;
+import org.codehaus.plexus.classworlds.launcher.ConfigurationParser;
+import org.codehaus.plexus.util.DirectoryScanner;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
+import org.eclipse.m2e.core.embedder.MavenRuntime;
+import org.eclipse.m2e.core.internal.Messages;
+
+/**
+ * Maven external runtime using ClassWorlds launcher
+ *
+ * @author Eugene Kuleshov
+ * @author Igor Fedorenko
+ *
+ */
+public class MavenExternalRuntime implements MavenRuntime {
+
+ private static final String PROPERTY_MAVEN_HOME = "maven.home"; //$NON-NLS-1$
+
+ private final String location;
+
+
+ public MavenExternalRuntime(String location) {
+ this.location = location;
+ }
+
+ public boolean isEditable() {
+ return true;
+ }
+
+ public boolean isAvailable() {
+ return new File(location, "bin").exists() && getLauncherClasspath() != null; //$NON-NLS-1$
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getSettings() {
+ return location + File.separator + "conf" + File.separator + "settings.xml"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public String getMainTypeName() {
+ return "org.codehaus.classworlds.Launcher"; //$NON-NLS-1$
+ }
+
+ private File getLauncherConfigurationFile() {
+ return new File(location, "bin/m2.conf"); //$NON-NLS-1$
+ }
+
+ public void createLauncherConfiguration(final IMavenLauncherConfiguration collector, IProgressMonitor monitor) throws CoreException {
+
+ collector.addRealm(IMavenLauncherConfiguration.LAUNCHER_REALM);
+ collector.addArchiveEntry(getLauncherClasspath());
+
+ ConfigurationHandler handler = new ConfigurationHandler() {
+ public void addImportFrom(String relamName, String importSpec) {
+ throw new UnsupportedOperationException(Messages.MavenExternalRuntime_exc_unsupported);
+ }
+ public void addLoadFile(File file) {
+ try {
+ collector.addArchiveEntry(file.getAbsolutePath());
+ } catch(CoreException ex) {
+ throw new ExceptionWrapper(ex);
+ }
+ }
+ public void addLoadURL(URL url) {
+ try {
+ collector.addArchiveEntry(url.toExternalForm());
+ } catch(CoreException ex) {
+ throw new ExceptionWrapper(ex);
+ }
+ }
+ public void addRealm(String realmName) {
+ collector.addRealm(realmName);
+ }
+ public void setAppMain(String mainClassName, String mainRealmName) {
+ collector.setMainType(mainClassName, mainRealmName);
+ }
+ };
+
+ Properties properties = new Properties();
+ properties.put(PROPERTY_MAVEN_HOME, location);
+
+ ConfigurationParser parser = new ConfigurationParser(handler, properties);
+
+ try {
+ FileInputStream is = new FileInputStream(getLauncherConfigurationFile());
+ try {
+ parser.parse(is);
+ } finally {
+ is.close();
+ }
+ } catch (Exception e) {
+ if (e instanceof ExceptionWrapper && e.getCause() instanceof CoreException) {
+ throw (CoreException) e.getCause();
+ }
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenExternalRuntime_error_cannot_parse, e));
+ }
+
+ // XXX show error dialog and fail launch
+ }
+
+ public boolean equals(Object o) {
+ if(o instanceof MavenExternalRuntime) {
+ return location.equals(((MavenExternalRuntime) o).location);
+ }
+ return false;
+ }
+
+ public int hashCode() {
+ return location.hashCode();
+ }
+
+ public String toString() {
+ return "External" + " " + location + " (" + getVersion() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+
+ private static class ExceptionWrapper extends RuntimeException {
+ private static final long serialVersionUID = 8815818826909815028L;
+ public ExceptionWrapper(Exception cause) {
+ super(cause);
+ }
+ }
+
+ private String getLauncherClasspath() {
+ File mavenHome = new File(location);
+ DirectoryScanner ds = new DirectoryScanner();
+ ds.setBasedir(mavenHome);
+ ds.setIncludes(new String[] {
+ "core/boot/classworlds*.jar", // 2.0.4 //$NON-NLS-1$
+ "boot/classworlds*.jar", // 2.0.7 //$NON-NLS-1$
+ "boot/plexus-classworlds*.jar", // 2.1 as of 2008-03-27 //$NON-NLS-1$
+ });
+ ds.scan();
+ String[] includedFiles = ds.getIncludedFiles();
+
+ if (includedFiles.length == 1) {
+ return new File(mavenHome, includedFiles[0]).getAbsolutePath();
+ }
+
+ return null;
+ }
+
+ public String getVersion() {
+
+ class VersionHandler implements ConfigurationHandler {
+ File mavenCore;
+ File uber;
+ public void addImportFrom(String relamName, String importSpec) {
+ }
+ public void addLoadFile(File file) {
+ if (file.getName().contains("maven-core")) { //$NON-NLS-1$
+ mavenCore = file;
+ } else if (file.getName().endsWith("uber.jar")) { //$NON-NLS-1$
+ uber = file;
+ }
+ }
+ public void addLoadURL(URL url) {
+ }
+ public void addRealm(String realmName) {
+ }
+ public void setAppMain(String mainClassName, String mainRealmName) {
+ }
+ };
+ VersionHandler handler = new VersionHandler();
+
+ Properties properties = new Properties();
+ properties.put(PROPERTY_MAVEN_HOME, location);
+
+ ConfigurationParser parser = new ConfigurationParser(handler, properties);
+
+ try {
+ FileInputStream is = new FileInputStream(getLauncherConfigurationFile());
+ try {
+ parser.parse(is);
+ } finally {
+ is.close();
+ }
+
+ ZipFile zip = null;
+ if (handler.mavenCore != null) {
+ zip = new ZipFile(handler.mavenCore);
+ } else if (handler.uber != null) {
+ zip = new ZipFile(handler.uber);
+ }
+ if (zip != null) {
+ try {
+ ZipEntry zipEntry = zip.getEntry("META-INF/maven/org.apache.maven/maven-core/pom.properties"); //$NON-NLS-1$
+ if (zipEntry != null) {
+ Properties pomProperties = new Properties();
+ pomProperties.load(zip.getInputStream(zipEntry));
+
+ String version = pomProperties.getProperty("version"); //$NON-NLS-1$
+ if (version != null) {
+ return version;
+ }
+ }
+ } finally {
+ zip.close();
+ }
+ }
+
+ } catch (Exception e) {
+ // most likely a bad location, but who knows
+ MavenLogger.log("Could not parse classwords configuration file", e);
+ }
+
+
+ return Messages.MavenExternalRuntime_unknown;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
new file mode 100644
index 00000000..6d4fb2a4
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
@@ -0,0 +1,1098 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.DefaultContainerConfiguration;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.MutablePlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.PlexusContainerException;
+import org.codehaus.plexus.classworlds.ClassWorld;
+import org.codehaus.plexus.classworlds.realm.ClassRealm;
+import org.codehaus.plexus.classworlds.realm.NoSuchRealmException;
+import org.codehaus.plexus.component.configurator.ComponentConfigurationException;
+import org.codehaus.plexus.component.configurator.converters.ConfigurationConverter;
+import org.codehaus.plexus.component.configurator.converters.lookup.ConverterLookup;
+import org.codehaus.plexus.component.configurator.converters.lookup.DefaultConverterLookup;
+import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.configuration.PlexusConfiguration;
+import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.dag.CycleDetectedException;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+
+import org.apache.maven.DefaultMaven;
+import org.apache.maven.Maven;
+import org.apache.maven.RepositoryUtils;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.InvalidRepositoryException;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.execution.DefaultMavenExecutionRequest;
+import org.apache.maven.execution.DefaultMavenExecutionResult;
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenExecutionRequestPopulationException;
+import org.apache.maven.execution.MavenExecutionRequestPopulator;
+import org.apache.maven.execution.MavenExecutionResult;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.lifecycle.LifecycleExecutor;
+import org.apache.maven.lifecycle.MavenExecutionPlan;
+import org.apache.maven.model.ConfigurationContainer;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.Profile;
+import org.apache.maven.model.Repository;
+import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.io.ModelReader;
+import org.apache.maven.model.io.ModelWriter;
+import org.apache.maven.plugin.BuildPluginManager;
+import org.apache.maven.plugin.InvalidPluginDescriptorException;
+import org.apache.maven.plugin.MavenPluginManager;
+import org.apache.maven.plugin.Mojo;
+import org.apache.maven.plugin.MojoExecution;
+import org.apache.maven.plugin.MojoNotFoundException;
+import org.apache.maven.plugin.PluginConfigurationException;
+import org.apache.maven.plugin.PluginContainerException;
+import org.apache.maven.plugin.PluginDescriptorParsingException;
+import org.apache.maven.plugin.PluginManagerException;
+import org.apache.maven.plugin.PluginNotFoundException;
+import org.apache.maven.plugin.PluginParameterExpressionEvaluator;
+import org.apache.maven.plugin.PluginResolutionException;
+import org.apache.maven.plugin.descriptor.MojoDescriptor;
+import org.apache.maven.plugin.version.DefaultPluginVersionRequest;
+import org.apache.maven.plugin.version.PluginVersionRequest;
+import org.apache.maven.plugin.version.PluginVersionResolutionException;
+import org.apache.maven.plugin.version.PluginVersionResolver;
+import org.apache.maven.project.DuplicateProjectException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuilder;
+import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.ProjectBuildingRequest;
+import org.apache.maven.project.ProjectBuildingResult;
+import org.apache.maven.project.ProjectSorter;
+import org.apache.maven.repository.RepositorySystem;
+import org.apache.maven.repository.internal.MavenRepositorySystemSession;
+import org.apache.maven.settings.Mirror;
+import org.apache.maven.settings.Proxy;
+import org.apache.maven.settings.Server;
+import org.apache.maven.settings.Settings;
+import org.apache.maven.settings.SettingsUtils;
+import org.apache.maven.settings.building.DefaultSettingsBuildingRequest;
+import org.apache.maven.settings.building.DefaultSettingsProblem;
+import org.apache.maven.settings.building.SettingsBuilder;
+import org.apache.maven.settings.building.SettingsBuildingException;
+import org.apache.maven.settings.building.SettingsBuildingRequest;
+import org.apache.maven.settings.building.SettingsProblem;
+import org.apache.maven.settings.building.SettingsProblem.Severity;
+import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest;
+import org.apache.maven.settings.crypto.SettingsDecrypter;
+import org.apache.maven.settings.crypto.SettingsDecryptionRequest;
+import org.apache.maven.settings.crypto.SettingsDecryptionResult;
+import org.apache.maven.settings.io.SettingsWriter;
+import org.apache.maven.wagon.proxy.ProxyInfo;
+
+import org.sonatype.aether.RepositorySystemSession;
+import org.sonatype.aether.repository.LocalRepository;
+import org.sonatype.aether.resolution.ArtifactRequest;
+import org.sonatype.aether.resolution.ArtifactResolutionException;
+import org.sonatype.aether.resolution.ArtifactResult;
+import org.sonatype.aether.transfer.ArtifactNotFoundException;
+import org.sonatype.aether.transfer.TransferListener;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ILocalRepositoryListener;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.embedder.IMavenConfigurationChangeListener;
+import org.eclipse.m2e.core.embedder.ISettingsChangeListener;
+import org.eclipse.m2e.core.embedder.MavenConfigurationChangeEvent;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+
+
+public class MavenImpl implements IMaven, IMavenConfigurationChangeListener {
+
+ /**
+ * Id of maven core class realm
+ */
+ public static final String MAVEN_CORE_REALM_ID = "plexus.core"; //$NON-NLS-1$
+
+
+ private DefaultPlexusContainer plexus;
+
+ private final IMavenConfiguration mavenConfiguration;
+
+ private final ConverterLookup converterLookup = new DefaultConverterLookup();
+
+ private final MavenConsole console;
+
+ private final ArrayList<ISettingsChangeListener> settingsListeners = new ArrayList<ISettingsChangeListener>();
+
+ private final ArrayList<ILocalRepositoryListener> localRepositoryListeners = new ArrayList<ILocalRepositoryListener>();
+
+ public MavenImpl(IMavenConfiguration mavenConfiguration, MavenConsole console) {
+ this.console = console;
+ this.mavenConfiguration = mavenConfiguration;
+ mavenConfiguration.addConfigurationChangeListener(this);
+ }
+
+ public MavenExecutionRequest createExecutionRequest(IProgressMonitor monitor) throws CoreException {
+ MavenExecutionRequest request = new DefaultMavenExecutionRequest();
+ if(mavenConfiguration.getGlobalSettingsFile() != null) {
+ request.setGlobalSettingsFile(new File(mavenConfiguration.getGlobalSettingsFile()));
+ }
+ if(mavenConfiguration.getUserSettingsFile() != null) {
+ request.setUserSettingsFile(new File(mavenConfiguration.getUserSettingsFile()));
+ }
+
+ try {
+ lookup(MavenExecutionRequestPopulator.class).populateFromSettings(request, getSettings());
+ } catch(MavenExecutionRequestPopulationException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_no_exec_req, ex));
+ }
+
+ ArtifactRepository localRepository = getLocalRepository();
+ request.setLocalRepository(localRepository);
+ request.setLocalRepositoryPath(localRepository.getBasedir());
+ request.setOffline(mavenConfiguration.isOffline());
+
+ // logging
+ request.setTransferListener(createArtifactTransferListener(monitor));
+
+ request.getUserProperties().put("m2e.version", MavenPlugin.getVersion()); //$NON-NLS-1$
+
+ request.setCacheNotFound(true);
+ request.setCacheTransferError(true);
+
+ // the right way to disable snapshot update
+ // request.setUpdateSnapshots(false);
+ return request;
+ }
+
+ public String getLocalRepositoryPath() {
+ String path = null;
+ try {
+ Settings settings = getSettings();
+ path = settings.getLocalRepository();
+ } catch(CoreException ex) {
+ // fall through
+ }
+ if(path == null) {
+ path = RepositorySystem.defaultUserLocalRepository.getAbsolutePath();
+ }
+ return path;
+ }
+
+ public MavenExecutionResult execute(MavenExecutionRequest request, IProgressMonitor monitor) {
+ // XXX is there a way to set per-request log level?
+
+ MavenExecutionResult result;
+ try {
+ lookup(MavenExecutionRequestPopulator.class).populateDefaults(request);
+ result = lookup(Maven.class).execute(request);
+ } catch(MavenExecutionRequestPopulationException ex) {
+ result = new DefaultMavenExecutionResult();
+ result.addException(ex);
+ } catch(Exception e) {
+ result = new DefaultMavenExecutionResult();
+ result.addException(e);
+ }
+ return result;
+ }
+
+ public MavenSession createSession(MavenExecutionRequest request, MavenProject project) {
+ RepositorySystemSession repoSession = createRepositorySession(request);
+ MavenExecutionResult result = new DefaultMavenExecutionResult();
+ MavenSession mavenSession = new MavenSession(plexus, repoSession, request, result);
+ if(project != null) {
+ mavenSession.setProjects(Collections.singletonList(project));
+ }
+ return mavenSession;
+ }
+
+ private RepositorySystemSession createRepositorySession(MavenExecutionRequest request) {
+ try {
+ return ((DefaultMaven) lookup(Maven.class)).newRepositorySession(request);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ throw new IllegalStateException("Could not look up Maven embedder", ex);
+ }
+ }
+
+ public void execute(MavenSession session, MojoExecution execution, IProgressMonitor monitor) {
+ try {
+ lookup(BuildPluginManager.class).executeMojo(session, execution);
+ } catch(Exception ex) {
+ session.getResult().addException(ex);
+ }
+ }
+
+ public <T> T getConfiguredMojo(MavenSession session, MojoExecution mojoExecution, Class<T> clazz)
+ throws CoreException {
+ try {
+ MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor();
+ // getPluginRealm creates plugin realm and populates pluginDescriptor.classRealm field
+ lookup(BuildPluginManager.class).getPluginRealm(session, mojoDescriptor.getPluginDescriptor());
+ return clazz.cast(lookup(MavenPluginManager.class).getConfiguredMojo(Mojo.class, session, mojoExecution));
+ } catch(PluginContainerException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ NLS.bind(Messages.MavenImpl_error_mojo, mojoExecution), ex));
+ } catch(PluginConfigurationException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ NLS.bind(Messages.MavenImpl_error_mojo, mojoExecution), ex));
+ } catch(ClassCastException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ NLS.bind(Messages.MavenImpl_error_mojo, mojoExecution), ex));
+ } catch(PluginResolutionException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ NLS.bind(Messages.MavenImpl_error_mojo, mojoExecution), ex));
+ } catch(PluginManagerException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ NLS.bind(Messages.MavenImpl_error_mojo, mojoExecution), ex));
+ }
+ }
+
+ public void releaseMojo(Object mojo, MojoExecution mojoExecution) throws CoreException {
+ lookup(MavenPluginManager.class).releaseMojo(mojo, mojoExecution);
+ }
+
+ public MavenExecutionPlan calculateExecutionPlan(MavenExecutionRequest request, MavenProject project,
+ IProgressMonitor monitor) throws CoreException {
+ MavenSession session = createSession(request, project);
+ try {
+ List<String> goals = request.getGoals();
+ return lookup(LifecycleExecutor.class).calculateExecutionPlan(session, goals.toArray(new String[goals.size()]));
+ } catch(Exception ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_calc_build_plan, ex));
+ }
+ }
+
+ public ArtifactRepository getLocalRepository() throws CoreException {
+ try {
+ String localRepositoryPath = getLocalRepositoryPath();
+ if(localRepositoryPath != null) {
+ return lookup(RepositorySystem.class).createLocalRepository(new File(localRepositoryPath));
+ }
+ return lookup(RepositorySystem.class).createLocalRepository(RepositorySystem.defaultUserLocalRepository);
+ } catch(InvalidRepositoryException ex) {
+ // can't happen
+ throw new IllegalStateException(ex);
+ }
+ }
+
+ public Settings getSettings() throws CoreException {
+ // MUST NOT use createRequest!
+
+ // TODO: Can't that delegate to buildSettings()?
+ SettingsBuildingRequest request = new DefaultSettingsBuildingRequest();
+ request.setSystemProperties(System.getProperties());
+ if(mavenConfiguration.getGlobalSettingsFile() != null) {
+ request.setGlobalSettingsFile(new File(mavenConfiguration.getGlobalSettingsFile()));
+ }
+ if(mavenConfiguration.getUserSettingsFile() != null) {
+ request.setUserSettingsFile(new File(mavenConfiguration.getUserSettingsFile()));
+ }
+ try {
+ return lookup(SettingsBuilder.class).build(request).getEffectiveSettings();
+ } catch(SettingsBuildingException ex) {
+ String msg = "Could not read settings.xml, assuming default values";
+ MavenPlugin.getDefault().getConsole().logError(msg);
+ MavenLogger.log(msg, ex);
+ /*
+ * NOTE: This method provides input for various other core functions, just bailing out would make m2e highly
+ * unusuable. Instead, we fail gracefully and just ignore the broken settings, using defaults.
+ */
+ return new Settings();
+ }
+ }
+
+ public Settings buildSettings(String globalSettings, String userSettings) throws CoreException {
+ SettingsBuildingRequest request = new DefaultSettingsBuildingRequest();
+ request.setGlobalSettingsFile(globalSettings != null ? new File(globalSettings) : null);
+ request.setUserSettingsFile(userSettings != null ? new File(userSettings) : null);
+ try {
+ return lookup(SettingsBuilder.class).build(request).getEffectiveSettings();
+ } catch(SettingsBuildingException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_settings,
+ ex));
+ }
+ }
+
+ public void writeSettings(Settings settings, OutputStream out) throws CoreException {
+ try {
+ lookup(SettingsWriter.class).write(out, null, settings);
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_write_settings,
+ ex));
+ }
+ }
+
+ public List<SettingsProblem> validateSettings(String settings) {
+ List<SettingsProblem> problems = new ArrayList<SettingsProblem>();
+ if(settings != null) {
+ File settingsFile = new File(settings);
+ if(settingsFile.canRead()) {
+ SettingsBuildingRequest request = new DefaultSettingsBuildingRequest();
+ request.setUserSettingsFile(settingsFile);
+ try {
+ lookup(SettingsBuilder.class).build(request);
+ } catch(SettingsBuildingException ex) {
+ problems.addAll(ex.getProblems());
+ } catch(CoreException ex) {
+ problems.add(new DefaultSettingsProblem(ex.getMessage(), Severity.FATAL, settings, -1, -1, ex));
+ }
+ } else {
+ problems.add(new DefaultSettingsProblem(NLS.bind(Messages.MavenImpl_error_read_settings2, settings),
+ SettingsProblem.Severity.ERROR, settings, -1, -1, null));
+ }
+ }
+
+ return problems;
+ }
+
+ public void reloadSettings() throws CoreException {
+ // TODO do something more meaningful
+ Settings settings = getSettings();
+ for(ISettingsChangeListener listener : settingsListeners) {
+ try {
+ listener.settingsChanged(settings);
+ } catch(CoreException e) {
+ MavenLogger.log(e);
+ }
+ }
+ }
+
+ public Server decryptPassword(Server server) throws CoreException {
+ SettingsDecryptionRequest request = new DefaultSettingsDecryptionRequest(server);
+ SettingsDecryptionResult result = lookup(SettingsDecrypter.class).decrypt(request);
+ for(SettingsProblem problem : result.getProblems()) {
+ MavenLogger.log(new Status(IStatus.WARNING, IMavenConstants.PLUGIN_ID, -1, problem.getMessage(), problem
+ .getException()));
+ }
+ return result.getServer();
+ }
+
+ public void mavenConfigutationChange(MavenConfigurationChangeEvent event) throws CoreException {
+ if(MavenConfigurationChangeEvent.P_USER_SETTINGS_FILE.equals(event.getKey())
+ || MavenPreferenceConstants.P_GLOBAL_SETTINGS_FILE.equals(event.getKey())) {
+ reloadSettings();
+ }
+ }
+
+ public Model readModel(InputStream in) throws CoreException {
+ try {
+ return lookup(ModelReader.class).read(in, null);
+ } catch(IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_pom, e));
+ }
+ }
+
+ public Model readModel(File pomFile) throws CoreException {
+ try {
+ BufferedInputStream is = new BufferedInputStream(new FileInputStream(pomFile));
+ try {
+ return readModel(is);
+ } finally {
+ IOUtil.close(is);
+ }
+ } catch(IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_pom, e));
+ }
+ }
+
+ public void writeModel(Model model, OutputStream out) throws CoreException {
+ try {
+ lookup(ModelWriter.class).write(out, null, model);
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_write_pom, ex));
+ }
+ }
+
+ public MavenProject readProject(File pomFile, IProgressMonitor monitor) throws CoreException {
+ try {
+ MavenExecutionRequest request = createExecutionRequest(monitor);
+ lookup(MavenExecutionRequestPopulator.class).populateDefaults(request);
+ ProjectBuildingRequest configuration = request.getProjectBuildingRequest();
+ configuration.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL);
+ configuration.setRepositorySession(createRepositorySession(request));
+ return lookup(ProjectBuilder.class).build(pomFile, configuration).getProject();
+ } catch(ProjectBuildingException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_project,
+ ex));
+ } catch(MavenExecutionRequestPopulationException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_project,
+ ex));
+ }
+ }
+
+ public MavenExecutionResult readProject(MavenExecutionRequest request, IProgressMonitor monitor) throws CoreException {
+ File pomFile = request.getPom();
+ MavenExecutionResult result = new DefaultMavenExecutionResult();
+ try {
+ lookup(MavenExecutionRequestPopulator.class).populateDefaults(request);
+ ProjectBuildingRequest configuration = request.getProjectBuildingRequest();
+ configuration.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL);
+ configuration.setRepositorySession(createRepositorySession(request));
+ ProjectBuildingResult projectBuildingResult = lookup(ProjectBuilder.class).build(pomFile, configuration);
+ result.setProject(projectBuildingResult.getProject());
+ result.setDependencyResolutionResult(projectBuildingResult.getDependencyResolutionResult());
+ } catch(ProjectBuildingException ex) {
+ //don't add the exception here. this should come out as a build marker, not fill
+ //the error logs with msgs
+ return result.addException(ex);
+ } catch(MavenExecutionRequestPopulationException ex) {
+ return result.addException(ex);
+ }
+ return result;
+ }
+
+ /**
+ * Makes MavenProject instances returned by #readProject methods suitable for caching and reuse with other
+ * MavenSession instances.<br/>
+ * Do note that MavenProject.getParentProject() cannot be used for detached MavenProject instances. Use
+ * #resolveParentProject to resolve parent project instance.
+ */
+ public void detachFromSession(MavenProject project) throws CoreException {
+ try {
+ // TODO remove reflection when we have embedder 3.0.1 or better
+ Field f = project.getClass().getDeclaredField("projectBuilderConfiguration"); //$NON-NLS-1$
+ f.setAccessible(true);
+ ProjectBuildingRequest request;
+ request = (ProjectBuildingRequest) f.get(project);
+ request.setRepositorySession(lookup(ContextRepositorySystemSession.class));
+ } catch(NoSuchFieldException ex) {
+ MavenLogger.log(ex.getMessage(), ex);
+ } catch(IllegalAccessException ex) {
+ MavenLogger.log(ex.getMessage(), ex);
+ }
+ }
+
+ public MavenProject resolveParentProject(MavenExecutionRequest request, MavenProject child, IProgressMonitor monitor)
+ throws CoreException {
+ ProjectBuildingRequest configuration = request.getProjectBuildingRequest();
+ configuration.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL);
+ configuration.setRepositorySession(createRepositorySession(request));
+
+ try {
+ configuration.setRemoteRepositories(child.getRemoteArtifactRepositories());
+
+ File parentFile = child.getParentFile();
+ if(parentFile != null) {
+ return lookup(ProjectBuilder.class).build(parentFile, configuration).getProject();
+ }
+
+ Artifact parentArtifact = child.getParentArtifact();
+ if(parentArtifact != null) {
+ return lookup(ProjectBuilder.class).build(parentArtifact, configuration).getProject();
+ }
+ } catch(ProjectBuildingException ex) {
+ MavenLogger.log("Could not read parent project", ex);
+ }
+
+ return null;
+ }
+
+ public Artifact resolve(String groupId, String artifactId, String version, String type, String classifier,
+ List<ArtifactRepository> remoteRepositories, IProgressMonitor monitor) throws CoreException {
+ Artifact artifact = lookup(RepositorySystem.class).createArtifactWithClassifier(groupId, artifactId, version, type,
+ classifier);
+
+ if(remoteRepositories == null) {
+ try {
+ remoteRepositories = getArtifactRepositories();
+ } catch(CoreException e) {
+ // we've tried
+ remoteRepositories = Collections.emptyList();
+ }
+ }
+
+ ArtifactRepository localRepository = getLocalRepository();
+
+ org.sonatype.aether.RepositorySystem repoSystem = lookup(org.sonatype.aether.RepositorySystem.class);
+
+ MavenRepositorySystemSession session = new MavenRepositorySystemSession();
+ session.setLocalRepositoryManager(repoSystem.newLocalRepositoryManager(new LocalRepository(localRepository
+ .getBasedir())));
+ session.setTransferListener(createArtifactTransferListener(monitor));
+
+ ArtifactRequest request = new ArtifactRequest();
+ request.setArtifact(RepositoryUtils.toArtifact(artifact));
+ request.setRepositories(RepositoryUtils.toRepos(remoteRepositories));
+
+ ArtifactResult result;
+ try {
+ result = repoSystem.resolveArtifact(session, request);
+ } catch(ArtifactResolutionException ex) {
+ result = ex.getResults().get(0);
+ }
+
+ setLastUpdated(localRepository, remoteRepositories, artifact);
+
+ if(result.isResolved()) {
+ artifact.selectVersion(result.getArtifact().getVersion());
+ artifact.setFile(result.getArtifact().getFile());
+ artifact.setResolved(true);
+ } else {
+ ArrayList<IStatus> members = new ArrayList<IStatus>();
+ for(Exception e : result.getExceptions()) {
+ if(!(e instanceof ArtifactNotFoundException)) {
+ members.add(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, e.getMessage(), e));
+ }
+ }
+ if(members.isEmpty()) {
+ members.add(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, NLS.bind(Messages.MavenImpl_error_missing, artifact), null));
+ }
+ IStatus[] newMembers = members.toArray(new IStatus[members.size()]);
+ throw new CoreException(new MultiStatus(IMavenConstants.PLUGIN_ID, -1, newMembers, Messages.MavenImpl_error_resolve,
+ null));
+ }
+
+ return artifact;
+ }
+
+ public String getArtifactPath(ArtifactRepository repository, String groupId, String artifactId, String version,
+ String type, String classifier) throws CoreException {
+ Artifact artifact = lookup(RepositorySystem.class).createArtifactWithClassifier(groupId, artifactId, version, type,
+ classifier);
+ return repository.pathOf(artifact);
+ }
+
+ private void setLastUpdated(ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories,
+ Artifact artifact) throws CoreException {
+
+ Properties lastUpdated = loadLastUpdated(localRepository, artifact);
+
+ String timestamp = Long.toString(System.currentTimeMillis());
+
+ for(ArtifactRepository repository : remoteRepositories) {
+ lastUpdated.setProperty(getLastUpdatedKey(repository, artifact), timestamp);
+ }
+
+ File lastUpdatedFile = getLastUpdatedFile(localRepository, artifact);
+ try {
+ lastUpdatedFile.getParentFile().mkdirs();
+ BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(lastUpdatedFile));
+ try {
+ lastUpdated.store(os, null);
+ } finally {
+ IOUtil.close(os);
+ }
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_write_lastUpdated, ex));
+ }
+ }
+
+ /**
+ * This is a temporary implementation that only works for artifacts resolved using #resolve.
+ */
+ public boolean isUnavailable(String groupId, String artifactId, String version, String type, String classifier,
+ List<ArtifactRepository> remoteRepositories) throws CoreException {
+ Artifact artifact = lookup(RepositorySystem.class).createArtifactWithClassifier(groupId, artifactId, version, type,
+ classifier);
+
+ ArtifactRepository localRepository = getLocalRepository();
+
+ File artifactFile = new File(localRepository.getBasedir(), localRepository.pathOf(artifact));
+
+ if(artifactFile.canRead()) {
+ // artifact is available locally
+ return false;
+ }
+
+ if(remoteRepositories == null || remoteRepositories.isEmpty()) {
+ // no remote repositories
+ return true;
+ }
+
+ // now is the hard part
+ Properties lastUpdated = loadLastUpdated(localRepository, artifact);
+
+ for(ArtifactRepository repository : remoteRepositories) {
+ String timestamp = lastUpdated.getProperty(getLastUpdatedKey(repository, artifact));
+ if(timestamp == null) {
+ // availability of the artifact from this repository has not been checked yet
+ return false;
+ }
+ }
+
+ // artifact is not available locally and all remote repositories have been checked in the past
+ return true;
+ }
+
+ private String getLastUpdatedKey(ArtifactRepository repository, Artifact artifact) {
+ StringBuilder key = new StringBuilder();
+
+ // repository part
+ key.append(repository.getId());
+ if(repository.getAuthentication() != null) {
+ key.append('|').append(repository.getAuthentication().getUsername());
+ }
+ key.append('|').append(repository.getUrl());
+
+ // artifact part
+ key.append('|').append(artifact.getClassifier());
+
+ return key.toString();
+ }
+
+ private Properties loadLastUpdated(ArtifactRepository localRepository, Artifact artifact) throws CoreException {
+ Properties lastUpdated = new Properties();
+ File lastUpdatedFile = getLastUpdatedFile(localRepository, artifact);
+ try {
+ BufferedInputStream is = new BufferedInputStream(new FileInputStream(lastUpdatedFile));
+ try {
+ lastUpdated.load(is);
+ } finally {
+ IOUtil.close(is);
+ }
+ } catch(FileNotFoundException ex) {
+ // that's okay
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_read_lastUpdated, ex));
+ }
+ return lastUpdated;
+ }
+
+ private File getLastUpdatedFile(ArtifactRepository localRepository, Artifact artifact) {
+ return new File(localRepository.getBasedir(), basePathOf(localRepository, artifact) + "/" //$NON-NLS-1$
+ + "m2e-lastUpdated.properties"); //$NON-NLS-1$
+ }
+
+ private static final char PATH_SEPARATOR = '/';
+
+ private static final char GROUP_SEPARATOR = '.';
+
+ private String basePathOf(ArtifactRepository repository, Artifact artifact) {
+ StringBuilder path = new StringBuilder(128);
+
+ path.append(formatAsDirectory(artifact.getGroupId())).append(PATH_SEPARATOR);
+ path.append(artifact.getArtifactId()).append(PATH_SEPARATOR);
+ path.append(artifact.getBaseVersion()).append(PATH_SEPARATOR);
+
+ return path.toString();
+ }
+
+ private String formatAsDirectory(String directory) {
+ return directory.replace(GROUP_SEPARATOR, PATH_SEPARATOR);
+ }
+
+ public <T> T getMojoParameterValue(MavenSession session, MojoExecution mojoExecution, String parameter,
+ Class<T> asType) throws CoreException {
+
+ try {
+ MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor();
+
+ ClassRealm pluginRealm = lookup(BuildPluginManager.class).getPluginRealm(session,
+ mojoDescriptor.getPluginDescriptor());
+
+ ExpressionEvaluator expressionEvaluator = new PluginParameterExpressionEvaluator(session, mojoExecution);
+
+ ConfigurationConverter typeConverter = converterLookup.lookupConverterForType(asType);
+
+ Xpp3Dom dom = mojoExecution.getConfiguration();
+
+ if(dom == null) {
+ return null;
+ }
+
+ PlexusConfiguration pomConfiguration = new XmlPlexusConfiguration(dom);
+
+ PlexusConfiguration configuration = pomConfiguration.getChild(parameter);
+
+ if(configuration == null) {
+ return null;
+ }
+
+ Object value = typeConverter.fromConfiguration(converterLookup, configuration, asType,
+ mojoDescriptor.getImplementationClass(), pluginRealm, expressionEvaluator, null);
+ return asType.cast(value);
+ } catch(ComponentConfigurationException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_param, ex));
+ } catch(PluginManagerException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_param, ex));
+ } catch(PluginResolutionException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_param, ex));
+ }
+ }
+
+ public <T> T getMojoParameterValue(String parameter, Class<T> type, MavenSession session, Plugin plugin,
+ ConfigurationContainer configuration, String goal) throws CoreException {
+ Xpp3Dom config = (Xpp3Dom) configuration.getConfiguration();
+ config = (config != null) ? config.getChild(parameter) : null;
+
+ PlexusConfiguration paramConfig = null;
+
+ if(config == null) {
+ MojoDescriptor mojoDescriptor;
+
+ try {
+ mojoDescriptor = lookup(BuildPluginManager.class).getMojoDescriptor(plugin, goal,
+ session.getCurrentProject().getRemotePluginRepositories(), session.getRepositorySession());
+ } catch(PluginNotFoundException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_param, ex));
+ } catch(PluginResolutionException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_param, ex));
+ } catch(PluginDescriptorParsingException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_param, ex));
+ } catch(MojoNotFoundException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_param, ex));
+ } catch(InvalidPluginDescriptorException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_param, ex));
+ }
+
+ PlexusConfiguration defaultConfig = mojoDescriptor.getMojoConfiguration();
+ if(defaultConfig != null) {
+ paramConfig = defaultConfig.getChild(parameter, false);
+ }
+ } else {
+ paramConfig = new XmlPlexusConfiguration(config);
+ }
+
+ if(paramConfig == null) {
+ return null;
+ }
+
+ try {
+ MojoExecution mojoExecution = new MojoExecution(plugin, goal, "default"); //$NON-NLS-1$
+
+ ExpressionEvaluator expressionEvaluator = new PluginParameterExpressionEvaluator(session, mojoExecution);
+
+ ConfigurationConverter typeConverter = converterLookup.lookupConverterForType(type);
+
+ Object value = typeConverter.fromConfiguration(converterLookup, paramConfig, type, Object.class,
+ plexus.getContainerRealm(), expressionEvaluator, null);
+ return type.cast(value);
+ } catch(ComponentConfigurationException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_param, ex));
+ } catch(ClassCastException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_param, ex));
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ public void xxxRemoveExtensionsRealm(MavenProject project) {
+ ClassRealm realm = project.getClassRealm();
+ if(realm != null && realm != plexus.getContainerRealm()) {
+ ClassWorld world = ((MutablePlexusContainer) plexus).getClassWorld();
+ try {
+ world.disposeRealm(realm.getId());
+ } catch(NoSuchRealmException ex) {
+ MavenLogger.log("Could not dispose of project extensions class realm", ex);
+ }
+ }
+ }
+
+ public ArtifactRepository createArtifactRepository(String id, String url) throws CoreException {
+ Repository repository = new Repository();
+ repository.setId(id);
+ repository.setUrl(url);
+ repository.setLayout("default"); //$NON-NLS-1$
+
+ ArtifactRepository repo;
+ try {
+ repo = lookup(RepositorySystem.class).buildArtifactRepository(repository);
+ ArrayList<ArtifactRepository> repos = new ArrayList<ArtifactRepository>(Arrays.asList(repo));
+ injectSettings(repos);
+ } catch(InvalidRepositoryException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_create_repo, ex));
+ }
+ return repo;
+ }
+
+ public List<ArtifactRepository> getArtifactRepositories() throws CoreException {
+ return getArtifactRepositories(true);
+ }
+
+ public List<ArtifactRepository> getArtifactRepositories(boolean injectSettings) throws CoreException {
+ ArrayList<ArtifactRepository> repositories = new ArrayList<ArtifactRepository>();
+ for(Profile profile : getActiveProfiles()) {
+ addArtifactRepositories(repositories, profile.getRepositories());
+ }
+
+ addDefaultRepository(repositories);
+
+ if(injectSettings) {
+ injectSettings(repositories);
+ }
+
+ return removeDuplicateRepositories(repositories);
+ }
+
+ private List<ArtifactRepository> removeDuplicateRepositories(ArrayList<ArtifactRepository> repositories) {
+ ArrayList<ArtifactRepository> result = new ArrayList<ArtifactRepository>();
+
+ HashSet<String> keys = new HashSet<String>();
+ for(ArtifactRepository repository : repositories) {
+ StringBuilder key = new StringBuilder();
+ if(repository.getId() != null) {
+ key.append(repository.getId());
+ }
+ key.append(':').append(repository.getUrl()).append(':');
+ if(repository.getAuthentication() != null && repository.getAuthentication().getUsername() != null) {
+ key.append(repository.getAuthentication().getUsername());
+ }
+ if(keys.add(key.toString())) {
+ result.add(repository);
+ }
+ }
+ return result;
+ }
+
+ private void injectSettings(ArrayList<ArtifactRepository> repositories) throws CoreException {
+ Settings settings = getSettings();
+
+ lookup(RepositorySystem.class).injectMirror(repositories, getMirrors());
+ lookup(RepositorySystem.class).injectProxy(repositories, settings.getProxies());
+ lookup(RepositorySystem.class).injectAuthentication(repositories, settings.getServers());
+ }
+
+ private void addDefaultRepository(ArrayList<ArtifactRepository> repositories) throws CoreException {
+ for(ArtifactRepository repository : repositories) {
+ if(RepositorySystem.DEFAULT_REMOTE_REPO_ID.equals(repository.getId())) {
+ return;
+ }
+ }
+ try {
+ repositories.add(0, lookup(RepositorySystem.class).createDefaultRemoteRepository());
+ } catch(InvalidRepositoryException ex) {
+ MavenLogger.log("Unexpected exception", ex);
+ }
+ }
+
+ private void addArtifactRepositories(ArrayList<ArtifactRepository> artifactRepositories, List<Repository> repositories)
+ throws CoreException {
+ for(Repository repository : repositories) {
+ try {
+ ArtifactRepository artifactRepository = lookup(RepositorySystem.class).buildArtifactRepository(repository);
+ artifactRepositories.add(artifactRepository);
+ } catch(InvalidRepositoryException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenImpl_error_read_settings,
+ ex));
+ }
+ }
+ }
+
+ private List<Profile> getActiveProfiles() throws CoreException {
+ Settings settings = getSettings();
+ List<String> activeProfilesIds = settings.getActiveProfiles();
+ ArrayList<Profile> activeProfiles = new ArrayList<Profile>();
+ for(org.apache.maven.settings.Profile settingsProfile : settings.getProfiles()) {
+ if((settingsProfile.getActivation() != null && settingsProfile.getActivation().isActiveByDefault())
+ || activeProfilesIds.contains(settingsProfile.getId())) {
+ Profile profile = SettingsUtils.convertFromSettingsProfile(settingsProfile);
+ activeProfiles.add(profile);
+ }
+ }
+ return activeProfiles;
+ }
+
+ public List<ArtifactRepository> getPluginArtifactRepositories() throws CoreException {
+ return getPluginArtifactRepositories(true);
+ }
+
+ public List<ArtifactRepository> getPluginArtifactRepositories(boolean injectSettings) throws CoreException {
+ ArrayList<ArtifactRepository> repositories = new ArrayList<ArtifactRepository>();
+ for(Profile profile : getActiveProfiles()) {
+ addArtifactRepositories(repositories, profile.getPluginRepositories());
+ }
+ addDefaultRepository(repositories);
+
+ if(injectSettings) {
+ injectSettings(repositories);
+ }
+
+ return removeDuplicateRepositories(repositories);
+ }
+
+ public Mirror getMirror(ArtifactRepository repo) throws CoreException {
+ MavenExecutionRequest request = createExecutionRequest(new NullProgressMonitor());
+ populateDefaults(request);
+ return lookup(RepositorySystem.class).getMirror(repo, request.getMirrors());
+ };
+
+ public void populateDefaults(MavenExecutionRequest request) throws CoreException {
+ try {
+ lookup(MavenExecutionRequestPopulator.class).populateDefaults(request);
+ } catch(MavenExecutionRequestPopulationException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_read_config, ex));
+ }
+ }
+
+ public List<Mirror> getMirrors() throws CoreException {
+ MavenExecutionRequest request = createExecutionRequest(null);
+ populateDefaults(request);
+ return request.getMirrors();
+ }
+
+ public void addSettingsChangeListener(ISettingsChangeListener listener) {
+ settingsListeners.add(listener);
+ }
+
+ public void removeSettingsChangeListener(ISettingsChangeListener listener) {
+ settingsListeners.remove(listener);
+ }
+
+ public void addLocalRepositoryListener(ILocalRepositoryListener listener) {
+ localRepositoryListeners.add(listener);
+ }
+
+ public void removeLocalRepositoryListener(ILocalRepositoryListener listener) {
+ localRepositoryListeners.remove(listener);
+ }
+
+ public List<ILocalRepositoryListener> getLocalRepositoryListeners() {
+ return localRepositoryListeners;
+ }
+
+ @SuppressWarnings("deprecation")
+ public WagonTransferListenerAdapter createTransferListener(IProgressMonitor monitor) {
+ return new WagonTransferListenerAdapter(this, monitor, console);
+ }
+
+ public TransferListener createArtifactTransferListener(IProgressMonitor monitor) {
+ return new ArtifactTransferListenerAdapter(this, monitor, console);
+ }
+
+ public synchronized PlexusContainer getPlexusContainer() throws CoreException {
+ if(plexus == null) {
+ try {
+ plexus = newPlexusContainer();
+ plexus.setLoggerManager(new EclipseLoggerManager(console, mavenConfiguration));
+ } catch(PlexusContainerException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_init_maven, ex));
+ }
+ }
+ return plexus;
+ }
+
+ public ProxyInfo getProxyInfo(String protocol) throws CoreException {
+ Settings settings = getSettings();
+
+ for(Proxy proxy : settings.getProxies()) {
+ if(proxy.isActive() && protocol.equalsIgnoreCase(proxy.getProtocol())) {
+ ProxyInfo proxyInfo = new ProxyInfo();
+ proxyInfo.setType(proxy.getProtocol());
+ proxyInfo.setHost(proxy.getHost());
+ proxyInfo.setPort(proxy.getPort());
+ proxyInfo.setNonProxyHosts(proxy.getNonProxyHosts());
+ proxyInfo.setUserName(proxy.getUsername());
+ proxyInfo.setPassword(proxy.getPassword());
+ return proxyInfo;
+ }
+ }
+
+ return null;
+ }
+
+ public List<MavenProject> getSortedProjects(List<MavenProject> projects) throws CoreException {
+ try {
+ ProjectSorter rm = new ProjectSorter(projects);
+ return rm.getSortedProjects();
+ } catch(CycleDetectedException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, Messages.MavenImpl_error_sort, ex));
+ } catch(DuplicateProjectException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, Messages.MavenImpl_error_sort, ex));
+ }
+ }
+
+ public String resolvePluginVersion(String groupId, String artifactId, MavenSession session) throws CoreException {
+ Plugin plugin = new Plugin();
+ plugin.setGroupId(groupId);
+ plugin.setArtifactId(artifactId);
+ PluginVersionRequest request = new DefaultPluginVersionRequest(plugin, session);
+ try {
+ return lookup(PluginVersionResolver.class).resolve(request).getVersion();
+ } catch(PluginVersionResolutionException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, ex.getMessage(), ex));
+ }
+ }
+
+ private <T> T lookup(Class<T> clazz) throws CoreException {
+ try {
+ return getPlexusContainer().lookup(clazz);
+ } catch(ComponentLookupException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.MavenImpl_error_lookup, ex));
+ }
+ }
+
+ private static DefaultPlexusContainer newPlexusContainer() throws PlexusContainerException {
+ ContainerConfiguration mavenCoreCC = new DefaultContainerConfiguration().setClassWorld(
+ new ClassWorld(MAVEN_CORE_REALM_ID, ClassWorld.class.getClassLoader())).setName(
+ "mavenCore"); //$NON-NLS-1$
+
+ mavenCoreCC.setAutoWiring(true);
+
+ return new DefaultPlexusContainer(mavenCoreCC, new ExtensionModule());
+ }
+
+ public synchronized void disposeContainer() {
+ if(plexus != null) {
+ plexus.dispose();
+ }
+ }
+
+ public ClassLoader getProjectRealm(MavenProject project) {
+ ClassLoader classLoader = project.getClassRealm();
+ if(classLoader == null) {
+ classLoader = plexus.getContainerRealm();
+ }
+ return classLoader;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenWorkspaceRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenWorkspaceRuntime.java
new file mode 100644
index 00000000..f7db67ec
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenWorkspaceRuntime.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import java.io.File;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
+import org.eclipse.m2e.core.embedder.MavenRuntime;
+import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+
+/**
+ * Maven 3.0-SNAPSHOT runtime loaded from the Eclipse Workspace
+ *
+ * @author Eugene Kuleshov
+ * @author Igor Fedorenko
+ */
+public class MavenWorkspaceRuntime implements MavenRuntime {
+
+ private static final ArtifactKey MAVEN_DISTRIBUTION = new ArtifactKey("org.apache.maven", "apache-maven", "3.0", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ private static final ArtifactKey PLEXUS_CLASSWORLDS = new ArtifactKey("org.codehaus.plexus", "plexus-classworlds", null, null); //$NON-NLS-1$ //$NON-NLS-2$
+
+ private static final String MAVEN_EXECUTOR_CLASS = "org.apache.maven.cli.MavenCli"; //$NON-NLS-1$
+
+ private static final String PLEXUS_CLASSWORLD_NAME = "plexus.core"; //$NON-NLS-1$
+
+ private MavenProjectManager projectManager;
+
+ public MavenWorkspaceRuntime(MavenProjectManager projectManager) {
+ this.projectManager = projectManager;
+ }
+
+ public String getLocation() {
+ return MavenRuntimeManager.WORKSPACE;
+ }
+
+ public String getSettings() {
+ return null;
+ }
+
+ public boolean isEditable() {
+ return false;
+ }
+
+ public boolean isAvailable() {
+ return getMavenDistribution() != null;
+ }
+
+ private IMavenProjectFacade getMavenDistribution() {
+ for (IMavenProjectFacade facade : projectManager.getProjects()) {
+ ArtifactKey artifactKey = facade.getArtifactKey();
+ if (MAVEN_DISTRIBUTION.getGroupId().equals(artifactKey.getGroupId()) //
+ && MAVEN_DISTRIBUTION.getArtifactId().equals(artifactKey.getArtifactId())//
+ && artifactKey.getVersion().startsWith(MAVEN_DISTRIBUTION.getVersion())) {
+ return facade;
+ }
+ }
+ return null;
+ }
+
+ public void createLauncherConfiguration(IMavenLauncherConfiguration collector, IProgressMonitor monitor) throws CoreException {
+ IMavenProjectFacade maven = getMavenDistribution();
+ if (maven != null) {
+ MavenProject mavenProject = maven.getMavenProject(monitor);
+
+ collector.setMainType(MAVEN_EXECUTOR_CLASS, PLEXUS_CLASSWORLD_NAME);
+
+ collector.addRealm(PLEXUS_CLASSWORLD_NAME);
+
+ Set<Artifact> artifacts = mavenProject.getArtifacts();
+
+ Artifact launcherArtifact = null;
+
+ for (Artifact artifact : artifacts) {
+ if (Artifact.SCOPE_TEST.equals(artifact.getScope())) {
+ continue;
+ }
+
+ if (PLEXUS_CLASSWORLDS.getGroupId().equals(artifact.getGroupId()) && PLEXUS_CLASSWORLDS.getArtifactId().equals(artifact.getArtifactId())) {
+ launcherArtifact = artifact;
+ continue;
+ }
+
+ addArtifact(collector, artifact);
+ }
+
+ if (launcherArtifact != null) {
+ collector.addRealm(IMavenLauncherConfiguration.LAUNCHER_REALM);
+ addArtifact(collector, launcherArtifact);
+ }
+ }
+
+ // XXX throw something at the caller!
+ }
+
+ private void addArtifact(IMavenLauncherConfiguration collector, Artifact artifact) throws CoreException {
+ IMavenProjectFacade facade = projectManager.getMavenProject(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion());
+
+ if (facade != null) {
+ collector.addProjectEntry(facade);
+ } else {
+ File file = artifact.getFile();
+ if (file != null) {
+ collector.addArchiveEntry(file.getAbsolutePath());
+ }
+ }
+ }
+
+ public String toString() {
+ return "Workspace (" + getVersion() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public String getVersion() {
+ IMavenProjectFacade maven = getMavenDistribution();
+ if (maven != null) {
+ return maven.getArtifactKey().getVersion();
+ }
+ return MAVEN_DISTRIBUTION.getVersion();
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/WagonTransferListenerAdapter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/WagonTransferListenerAdapter.java
new file mode 100644
index 00000000..7d5b19c5
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/WagonTransferListenerAdapter.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.embedder;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
+import org.apache.maven.index.artifact.Gav;
+import org.apache.maven.index.artifact.GavCalculator;
+import org.apache.maven.index.artifact.M2GavCalculator;
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.events.TransferEvent;
+import org.apache.maven.wagon.events.TransferListener;
+import org.apache.maven.wagon.repository.Repository;
+
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.ILocalRepositoryListener;
+
+/**
+ * @author Eugene Kuleshov
+ */
+final class WagonTransferListenerAdapter extends AbstractTransferListenerAdapter implements TransferListener {
+ // TODO this is just wrong!
+ private final GavCalculator gavCalculator = new M2GavCalculator();
+
+ WagonTransferListenerAdapter(MavenImpl maven, IProgressMonitor monitor, MavenConsole console) {
+ super(maven, monitor, console);
+ }
+
+ public void transferInitiated(TransferEvent e) {
+ // System.err.println( "init "+e.getWagon().getRepository()+"/"+e.getResource().getName());
+ transferInitiated((String) null);
+ }
+
+ public void transferStarted(TransferEvent e) {
+ StringBuilder sb = new StringBuilder();
+ if(e.getWagon() != null && e.getWagon().getRepository() != null) {
+ Wagon wagon = e.getWagon();
+ Repository repository = wagon.getRepository();
+ String repositoryId = repository.getId();
+ sb.append(repositoryId).append(" : "); //$NON-NLS-1$
+ }
+ sb.append(e.getResource().getName());
+ transferStarted(sb.toString());
+ }
+
+ public void transferProgress(TransferEvent e, byte[] buffer, int length) {
+ long total = e.getResource().getContentLength();
+ String artifactUrl = e.getWagon().getRepository() + "/" + e.getResource().getName(); //$NON-NLS-1$
+
+ transferProgress(artifactUrl, total, length);
+ }
+
+ public void transferCompleted(TransferEvent e) {
+ String artifactUrl = e.getWagon().getRepository() + "/" + e.getResource().getName(); //$NON-NLS-1$
+ transferCompleted(artifactUrl);
+
+ notifyLocalRepositoryListeners(e);
+ }
+
+ public void transferError(TransferEvent e) {
+ transferError(e.getWagon().getRepository() + "/" + e.getResource().getName(), e.getException()); //$NON-NLS-1$
+ }
+
+ public void debug(String message) {
+ // System.err.println( "debug "+message);
+ }
+
+ private void notifyLocalRepositoryListeners(TransferEvent e) {
+ try {
+ ArtifactRepository localRepository = maven.getLocalRepository();
+
+ if (!(localRepository.getLayout() instanceof DefaultRepositoryLayout)) {
+ return;
+ }
+
+ String repoBasepath = new File(localRepository.getBasedir()).getCanonicalPath();
+
+ File artifactFile = e.getLocalFile();
+
+ if (artifactFile == null) {
+ return;
+ }
+
+ String artifactPath = artifactFile.getCanonicalPath();
+ if (!artifactPath.startsWith(repoBasepath)) {
+ return;
+ }
+
+ artifactPath = artifactPath.substring(repoBasepath.length());
+ Gav gav = gavCalculator.pathToGav(artifactPath);
+ ArtifactKey artifactKey = new ArtifactKey(gav.getGroupId(), gav.getArtifactId(), gav.getVersion(), gav.getClassifier());
+
+ File repoBasedir = new File(localRepository.getBasedir()).getCanonicalFile();
+
+ for (ILocalRepositoryListener listener : maven.getLocalRepositoryListeners()) {
+ listener.artifactInstalled(repoBasedir, artifactKey, artifactFile);
+ }
+ } catch (Exception ex) {
+ MavenLogger.log("Could not notify local repository listeners", ex);
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/ArtifactScanningMonitor.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/ArtifactScanningMonitor.java
new file mode 100644
index 00000000..adf3f0de
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/ArtifactScanningMonitor.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.index;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.index.ArtifactContext;
+import org.apache.maven.index.ArtifactScanningListener;
+import org.apache.maven.index.ScanningResult;
+import org.apache.maven.index.context.IndexingContext;
+
+import org.eclipse.m2e.core.core.MavenConsole;
+
+class ArtifactScanningMonitor implements ArtifactScanningListener {
+
+ private static final long THRESHOLD = 1 * 1000L;
+
+ //private final IndexInfo indexInfo;
+
+ private final IProgressMonitor monitor;
+
+ private final MavenConsole console;
+
+ private long timestamp = System.currentTimeMillis();
+
+ private File repositoryDir;
+
+ ArtifactScanningMonitor(File repositoryDir, IProgressMonitor monitor, MavenConsole console) {
+ //this.indexInfo = indexInfo;
+ this.repositoryDir = repositoryDir;
+ this.monitor = monitor;
+ this.console = console;
+ }
+
+ public void scanningStarted(IndexingContext ctx) {
+ }
+
+ public void scanningFinished(IndexingContext ctx, ScanningResult result) {
+ }
+
+ public void artifactDiscovered(ArtifactContext ac) {
+ long current = System.currentTimeMillis();
+ if((current - timestamp) > THRESHOLD) {
+ // String id = info.groupId + ":" + info.artifactId + ":" + info.version;
+ String id = ac.getPom().getAbsolutePath().substring(
+ this.repositoryDir.getAbsolutePath().length());
+ this.monitor.setTaskName(id);
+ this.timestamp = current;
+ }
+ }
+
+ public void artifactError(ArtifactContext ac, Exception e) {
+ String id = ac.getPom().getAbsolutePath().substring(repositoryDir.getAbsolutePath().length());
+ console.logError(id + " " + e.getMessage()); //$NON-NLS-1$
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/AsyncFetcher.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/AsyncFetcher.java
new file mode 100644
index 00000000..458df72d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/AsyncFetcher.java
@@ -0,0 +1,283 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.index;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PipedInputStream;
+import java.io.PipedOutputStream;
+import java.net.HttpURLConnection;
+
+import com.ning.http.client.AsyncHandler;
+import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
+import com.ning.http.client.HttpResponseBodyPart;
+import com.ning.http.client.HttpResponseHeaders;
+import com.ning.http.client.HttpResponseStatus;
+import com.ning.http.client.ProxyServer;
+import com.ning.http.client.Realm;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.osgi.util.NLS;
+
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.io.RawInputStreamFacade;
+
+import org.apache.maven.index.updater.AbstractResourceFetcher;
+import org.apache.maven.wagon.authentication.AuthenticationInfo;
+import org.apache.maven.wagon.proxy.ProxyInfo;
+import org.apache.maven.wagon.proxy.ProxyUtils;
+import org.apache.maven.wagon.repository.Repository;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.internal.Messages;
+
+
+/**
+ * A resource fetcher using Async HTTP Client.
+ *
+ * @author Benjamin Bentmann
+ */
+class AsyncFetcher extends AbstractResourceFetcher {
+
+ private final AuthenticationInfo authInfo;
+
+ private final ProxyInfo proxyInfo;
+
+ final IProgressMonitor monitor;
+
+ private AsyncHttpClient httpClient;
+
+ private Realm authRealm;
+
+ private ProxyServer proxyServer;
+
+ private String baseUrl;
+
+ public AsyncFetcher(final AuthenticationInfo authInfo, final ProxyInfo proxyInfo, final IProgressMonitor monitor) {
+ this.authInfo = authInfo;
+ this.proxyInfo = proxyInfo;
+ this.monitor = (monitor != null) ? monitor : new NullProgressMonitor();
+ }
+
+ private static Realm toRealm(AuthenticationInfo authInfo) {
+ Realm realm = null;
+
+ if(authInfo != null && authInfo.getUserName() != null && authInfo.getUserName().length() > 0) {
+ realm = new Realm.RealmBuilder().setPrincipal(authInfo.getUserName()).setPassword(authInfo.getPassword())
+ .setUsePreemptiveAuth(false).build();
+ }
+
+ return realm;
+ }
+
+ private static ProxyServer toProxyServer(ProxyInfo proxyInfo) {
+ ProxyServer proxyServer = null;
+
+ if(proxyInfo != null) {
+ ProxyServer.Protocol protocol = "https".equalsIgnoreCase(proxyInfo.getType()) ? ProxyServer.Protocol.HTTPS //$NON-NLS-1$
+ : ProxyServer.Protocol.HTTP;
+ proxyServer = new ProxyServer(protocol, proxyInfo.getHost(), proxyInfo.getPort(), proxyInfo.getUserName(),
+ proxyInfo.getPassword());
+ }
+
+ return proxyServer;
+ }
+
+ private ProxyServer getProxyServer(ProxyInfo proxyInfo, String url) {
+ if(proxyInfo != null) {
+ Repository repo = new Repository("id", url); //$NON-NLS-1$
+ if(!ProxyUtils.validateNonProxyHosts(proxyInfo, repo.getHost())) {
+ return toProxyServer(proxyInfo);
+ }
+ }
+ return null;
+ }
+
+ public void connect(String id, String url) {
+ AsyncHttpClientConfig.Builder configBuilder = new AsyncHttpClientConfig.Builder();
+ configBuilder.setUserAgent("M2Eclipse/" + MavenPlugin.getQualifiedVersion()); //$NON-NLS-1$
+ configBuilder.setConnectionTimeoutInMs(15 * 1000);
+ configBuilder.setRequestTimeoutInMs(60 * 1000);
+ configBuilder.setCompressionEnabled(true);
+ configBuilder.setFollowRedirects(true);
+
+ httpClient = new AsyncHttpClient(configBuilder.build());
+
+ baseUrl = url.endsWith("/") ? url : (url + '/'); //$NON-NLS-1$
+ authRealm = toRealm(authInfo);
+ proxyServer = getProxyServer(proxyInfo, url);
+ }
+
+ public void disconnect() {
+ authRealm = null;
+ proxyServer = null;
+ baseUrl = null;
+ if(httpClient != null) {
+ httpClient.close();
+ }
+ httpClient = null;
+ }
+
+ @SuppressWarnings("deprecation")
+ public void retrieve(String name, File targetFile) throws IOException, FileNotFoundException {
+ InputStream is = retrieve(name);
+ try {
+ FileUtils.copyStreamToFile(new RawInputStreamFacade(is), targetFile);
+ } finally {
+ IOUtil.close(is);
+ }
+ }
+
+ public InputStream retrieve(String name) throws IOException, FileNotFoundException {
+ String url = buildUrl(baseUrl, name);
+
+ monitor.subTask(NLS.bind(Messages.AsyncFetcher_task_fetching, url));
+
+ PipedErrorInputStream pis = new PipedErrorInputStream();
+
+ httpClient.prepareGet(url).setRealm(authRealm).setProxyServer(proxyServer).execute(new RequestHandler(url, pis));
+
+ return pis;
+ }
+
+ private static String buildUrl(String baseUrl, String resourceName) {
+ String url = baseUrl;
+
+ if(resourceName.startsWith("/")) { //$NON-NLS-1$
+ url += resourceName.substring(1);
+ } else {
+ url += resourceName;
+ }
+
+ return url;
+ }
+
+ static final class PipedErrorInputStream extends PipedInputStream {
+
+ private volatile Throwable error;
+
+ public PipedErrorInputStream() {
+ buffer = new byte[1024 * 128];
+ }
+
+ public void setError(Throwable t) {
+ if(error == null) {
+ error = t;
+ }
+ }
+
+ private void checkError() throws IOException {
+ if(error != null) {
+ throw (IOException) new IOException(error.getMessage()).initCause(error);
+ }
+ }
+
+ public synchronized int read() throws IOException {
+ checkError();
+ int b = super.read();
+ checkError();
+ return b;
+ }
+ }
+
+ final class RequestHandler implements AsyncHandler<String> {
+
+ private final String url;
+
+ private final PipedErrorInputStream pis;
+
+ private PipedOutputStream pos;
+
+ private long total = -1;
+
+ private long transferred;
+
+ public RequestHandler(String url, PipedErrorInputStream pis) throws IOException {
+ this.url = url;
+ this.pis = pis;
+ pos = new PipedOutputStream(pis);
+ }
+
+ private void finish(Throwable exception) {
+ pis.setError(exception);
+ if(pos != null) {
+ try {
+ pos.close();
+ } catch(IOException ex) {
+ // tried it
+ }
+ pos = null;
+ }
+ }
+
+ private STATE checkCancel() {
+ if(monitor.isCanceled()) {
+ finish(new IOException(Messages.AsyncFetcher_error_cancelled));
+ return STATE.ABORT;
+ }
+ return STATE.CONTINUE;
+ }
+
+ public STATE onBodyPartReceived(HttpResponseBodyPart content) throws Exception {
+ if(checkCancel() == STATE.ABORT || pos == null) {
+ return STATE.ABORT;
+ }
+ int bytes = content.getBodyByteBuffer().remaining();
+ content.writeTo(pos);
+ if(total > 0) {
+ transferred += bytes;
+ monitor.subTask(NLS.bind(Messages.AsyncFetcher_task_fetching2,url, transferred * 100 / total));
+ }
+ return STATE.CONTINUE;
+ }
+
+ public STATE onHeadersReceived(HttpResponseHeaders headers) throws Exception {
+ if(checkCancel() == STATE.ABORT) {
+ return STATE.ABORT;
+ }
+ try {
+ total = Long.parseLong(headers.getHeaders().getFirstValue("Content-Length")); //$NON-NLS-1$
+ } catch(Exception e) {
+ total = -1;
+ }
+ return STATE.CONTINUE;
+ }
+
+ public STATE onStatusReceived(HttpResponseStatus status) throws Exception {
+ if(status.getStatusCode() != HttpURLConnection.HTTP_OK) {
+ finish(new IOException(NLS.bind(Messages.AsyncFetcher_error_server, status.getStatusCode(), status.getStatusText())));
+ return STATE.ABORT;
+ }
+ if(checkCancel() == STATE.ABORT) {
+ return STATE.ABORT;
+ }
+ return STATE.CONTINUE;
+ }
+
+ public String onCompleted() throws Exception {
+ monitor.subTask(""); //$NON-NLS-1$
+ finish(null);
+ return ""; //$NON-NLS-1$
+ }
+
+ public void onThrowable(Throwable t) {
+ finish(t);
+ }
+
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/CompositeIndex.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/CompositeIndex.java
new file mode 100644
index 00000000..1d934310
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/CompositeIndex.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.index;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.index.SearchExpression;
+
+
+/**
+ * CompositeIndex
+ *
+ * @author igor
+ */
+public class CompositeIndex implements IIndex {
+
+ private List<IIndex> indexes;
+
+ public CompositeIndex(List<IIndex> indexes) {
+ this.indexes = indexes;
+ }
+
+ public IndexedArtifactFile getIndexedArtifactFile(ArtifactKey artifact) throws CoreException {
+ for(IIndex index : indexes) {
+ IndexedArtifactFile aif = index.getIndexedArtifactFile(artifact);
+ if(aif != null) {
+ // first one wins
+ return aif;
+ }
+ }
+
+ // did not find anything
+ return null;
+ }
+
+ public IndexedArtifactFile identify(File file) throws CoreException {
+ for(IIndex index : indexes) {
+ IndexedArtifactFile aif = index.identify(file);
+ if(aif != null) {
+ // first one wins
+ return aif;
+ }
+ }
+
+ // did not find anything
+ return null;
+ }
+
+ public Collection<IndexedArtifact> find(SearchExpression groupId, SearchExpression artifactId,
+ SearchExpression version, SearchExpression packaging) throws CoreException {
+ Set<IndexedArtifact> result = new LinkedHashSet<IndexedArtifact>();
+ for(IIndex index : indexes) {
+ Collection<IndexedArtifact> findResults = index.find(groupId, artifactId, version, packaging);
+ if(findResults != null) {
+ result.addAll(findResults);
+ }
+ }
+ return result;
+ }
+
+ public Collection<IndexedArtifact> find(Collection<SearchExpression> groupId,
+ Collection<SearchExpression> artifactId, Collection<SearchExpression> version,
+ Collection<SearchExpression> packaging) throws CoreException {
+ Set<IndexedArtifact> result = new LinkedHashSet<IndexedArtifact>();
+ for(IIndex index : indexes) {
+ Collection<IndexedArtifact> findResults = index.find(groupId, artifactId, version, packaging);
+ if(findResults != null) {
+ result.addAll(findResults);
+ }
+ }
+ return result;
+ }
+
+ public Map<String, IndexedArtifact> search(SearchExpression term, String searchType) throws CoreException {
+ Map<String, IndexedArtifact> result = new HashMap<String, IndexedArtifact>();
+ for(IIndex index : indexes) {
+ Map<String, IndexedArtifact> iresult = index.search(term, searchType);
+ if(iresult != null) {
+ result.putAll(iresult);
+ }
+ }
+ return result;
+ }
+
+ public Map<String, IndexedArtifact> search(SearchExpression term, String searchType, int classifier)
+ throws CoreException {
+ Map<String, IndexedArtifact> result = new HashMap<String, IndexedArtifact>();
+ for(IIndex index : indexes) {
+ Map<String, IndexedArtifact> iresult = index.search(term, searchType, classifier);
+ if(iresult != null) {
+ result.putAll(iresult);
+ }
+ }
+ return result;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/EquinoxLock.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/EquinoxLock.java
new file mode 100644
index 00000000..4aa82f6e
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/EquinoxLock.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.index;
+
+import org.eclipse.core.runtime.internal.adaptor.Locker;
+
+import org.apache.maven.index.fs.Lock;
+
+@SuppressWarnings("restriction")
+public class EquinoxLock
+ implements Lock
+{
+
+ private final Locker lock;
+
+ public EquinoxLock( Locker lock )
+ {
+ this.lock = lock;
+ }
+
+ public void release()
+ {
+ lock.release();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/EquinoxLocker.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/EquinoxLocker.java
new file mode 100644
index 00000000..e88c7e0c
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/EquinoxLocker.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.index;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.core.runtime.internal.adaptor.BasicLocation;
+import org.eclipse.osgi.util.NLS;
+
+import org.apache.maven.index.fs.Lock;
+import org.apache.maven.index.fs.Locker;
+
+@SuppressWarnings("restriction")
+public class EquinoxLocker
+ implements Locker
+{
+
+ public Lock lock( File directory )
+ throws IOException
+ {
+ org.eclipse.core.runtime.internal.adaptor.Locker lock = BasicLocation.createLocker(new File( directory, LOCK_FILE ), null );
+
+ if ( lock.lock() )
+ {
+ return new EquinoxLock( lock );
+ }
+
+ throw new IOException( NLS.bind("Could not acquire lock on directory {0}", directory ));
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexUpdaterJob.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexUpdaterJob.java
new file mode 100644
index 00000000..a14760f6
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexUpdaterJob.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.index;
+
+import java.util.ArrayList;
+import java.util.Stack;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.ui.progress.IProgressConstants;
+
+import org.eclipse.m2e.core.actions.OpenMavenConsoleAction;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.jobs.IBackgroundProcessingQueue;
+
+class IndexUpdaterJob extends Job implements IBackgroundProcessingQueue {
+
+ public static class IndexUpdaterRule implements ISchedulingRule {
+
+ public boolean contains(ISchedulingRule rule) {
+ return rule == this;
+ }
+
+ public boolean isConflicting(ISchedulingRule rule) {
+ return rule == this;
+ }
+
+ }
+
+ public interface IndexCommand {
+ abstract void run(IProgressMonitor monitor) throws CoreException;
+ }
+
+ private final Stack<IndexUpdaterJob.IndexCommand> updateQueue = new Stack<IndexUpdaterJob.IndexCommand>();
+
+ public IndexUpdaterJob(NexusIndexManager indexManager, MavenConsole console) {
+ super(Messages.IndexUpdaterJob_title);
+ setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
+ setRule(new IndexUpdaterRule());
+ }
+
+ public void addCommand(IndexUpdaterJob.IndexCommand indexCommand) {
+ updateQueue.add(indexCommand);
+ }
+
+ public IStatus run(IProgressMonitor monitor) {
+ monitor.beginTask(getName(), IProgressMonitor.UNKNOWN);
+
+ ArrayList<IStatus> problems = new ArrayList<IStatus>();
+
+ while(!updateQueue.isEmpty()) {
+ if (monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+
+ IndexUpdaterJob.IndexCommand command = updateQueue.pop();
+ try {
+ command.run(monitor);
+ } catch(CoreException ex) {
+ problems.add(ex.getStatus());
+ }
+ }
+
+ monitor.done();
+
+ return problems.isEmpty()? Status.OK_STATUS: new MultiStatus(IMavenConstants.PLUGIN_ID, -1, problems.toArray(new IStatus[problems.size()]), null, null);
+ }
+
+ public boolean isEmpty() {
+ return updateQueue.isEmpty();
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexedArtifactGroup.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexedArtifactGroup.java
new file mode 100644
index 00000000..96dc8e65
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexedArtifactGroup.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.index;
+
+import java.util.LinkedHashMap;
+
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.repository.IRepository;
+
+
+public class IndexedArtifactGroup implements Comparable<IndexedArtifactGroup>{
+ private final IRepository repository;
+ private final String prefix;
+ private final LinkedHashMap<String, IndexedArtifactGroup> nodes = new LinkedHashMap<String, IndexedArtifactGroup>();
+ private final LinkedHashMap<String, IndexedArtifact> files = new LinkedHashMap<String, IndexedArtifact>();
+
+ public IndexedArtifactGroup(IRepository repository, String prefix) {
+ this.repository = repository;
+ this.prefix = prefix;
+ }
+
+ public LinkedHashMap<String, IndexedArtifactGroup> getNodes() {
+ return nodes;
+ }
+
+ public LinkedHashMap<String, IndexedArtifact> getFiles() {
+ return files;
+ }
+
+ public String getPrefix() {
+ return prefix;
+ }
+
+ public IRepository getRepository() {
+ return this.repository;
+ }
+
+ /*
+ * Compare the groups by prefix
+ */
+ public int compareTo(IndexedArtifactGroup o) {
+ if(o == null){
+ return -1;
+ }
+ return getPrefix().compareToIgnoreCase(o.getPrefix());
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexesExtensionReader.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexesExtensionReader.java
new file mode 100644
index 00000000..3e5bd76e
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexesExtensionReader.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.index;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.internal.repository.IRepositoryDiscoverer;
+import org.eclipse.m2e.core.internal.repository.RepositoryInfo;
+import org.eclipse.m2e.core.internal.repository.RepositoryRegistry;
+import org.eclipse.m2e.core.repository.IRepositoryRegistry;
+
+/**
+ * IndexesExtensionReader
+ *
+ * @author igor
+ */
+public class IndexesExtensionReader implements IRepositoryDiscoverer {
+
+ private static final String EXTENSION_INDEXES = IMavenConstants.PLUGIN_ID + ".indexes"; //$NON-NLS-1$
+
+ private static final String ELEMENT_INDEX = "index"; //$NON-NLS-1$
+
+ private static final String ATTR_INDEX_ID = "indexId"; //$NON-NLS-1$
+
+// private static final String ATTR_INDEX_ARCHIVE = "archive";
+
+ private static final String ATTR_REPOSITORY_URL = "repositoryUrl"; //$NON-NLS-1$
+
+// private static final String ATTR_UPDATE_URL = "updateUrl";
+
+ private static final String ATTR_IS_SHORT = "isShort"; //$NON-NLS-1$
+
+ private final NexusIndexManager indexManager;
+
+ public IndexesExtensionReader(NexusIndexManager indexManager) {
+ this.indexManager = indexManager;
+ }
+
+ public void addRepositories(RepositoryRegistry registry, IProgressMonitor monitor) throws CoreException {
+ IExtensionPoint indexesExtensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_INDEXES);
+ if(indexesExtensionPoint != null) {
+ IExtension[] indexesExtensions = indexesExtensionPoint.getExtensions();
+ for(IExtension extension : indexesExtensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for(IConfigurationElement element : elements) {
+ if(element.getName().equals(ELEMENT_INDEX)) {
+ processIndexElement(registry, element, monitor);
+ }
+ }
+ }
+ }
+ }
+
+ private void processIndexElement(RepositoryRegistry registry, IConfigurationElement element, IProgressMonitor monitor) throws CoreException {
+ String indexId = element.getAttribute(ATTR_INDEX_ID);
+ String repositoryUrl = element.getAttribute(ATTR_REPOSITORY_URL);
+ boolean isShort = Boolean.valueOf(element.getAttribute(ATTR_IS_SHORT)).booleanValue();
+
+// String indexUpdateUrl = element.getAttribute(ATTR_UPDATE_URL);
+// String archive = element.getAttribute(ATTR_INDEX_ARCHIVE);
+
+ RepositoryInfo repository = new RepositoryInfo(indexId, repositoryUrl, IRepositoryRegistry.SCOPE_UNKNOWN, null);
+ registry.addRepository(repository, monitor);
+
+ // for consistency, always process indexes using our background thread
+ indexManager.setIndexDetails(repository, isShort? NexusIndex.DETAILS_MIN: NexusIndex.DETAILS_FULL, null/*async*/);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexingTransferListener.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexingTransferListener.java
new file mode 100644
index 00000000..538eeeed
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/IndexingTransferListener.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.index;
+
+import java.io.File;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.ILocalRepositoryListener;
+
+public class IndexingTransferListener implements ILocalRepositoryListener {
+
+ private final NexusIndexManager indexManager;
+
+ public IndexingTransferListener(NexusIndexManager indexManager) {
+ this.indexManager = indexManager;
+ }
+
+ public void artifactInstalled(File repositoryBasedir, ArtifactKey artifact, File artifactFile) {
+ NexusIndex localIndex = indexManager.getLocalIndex();
+ if(artifactFile.getName().endsWith(".jar")) { //$NON-NLS-1$
+ localIndex.addArtifact(artifactFile, artifact);
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndex.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndex.java
new file mode 100644
index 00000000..35b8a23e
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndex.java
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.index;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.search.BooleanQuery;
+
+import org.apache.maven.index.Field;
+import org.apache.maven.index.MAVEN;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IMutableIndex;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.index.SearchExpression;
+import org.eclipse.m2e.core.repository.IRepository;
+
+
+/**
+ * NexusIndex
+ *
+ * @author igor
+ */
+public class NexusIndex implements IIndex, IMutableIndex {
+
+ /**
+ * Repository index is disabled.
+ */
+ public static final String DETAILS_DISABLED = "off"; //$NON-NLS-1$
+
+ /**
+ * Only artifact index information is used. Classname index is disabled.
+ */
+ public static final String DETAILS_MIN = "min"; //$NON-NLS-1$
+
+ /**
+ * Both artifact and classname indexes are used.
+ */
+ public static final String DETAILS_FULL = "full"; //$NON-NLS-1$
+
+ private final NexusIndexManager indexManager;
+
+ private final IRepository repository;
+
+ private final String indexDetails;
+
+ NexusIndex(NexusIndexManager indexManager, IRepository repository, String indexDetails) {
+ this.indexManager = indexManager;
+ this.repository = repository;
+ this.indexDetails = indexDetails;
+ }
+
+ public String getRepositoryUrl() {
+ return this.repository.getUrl();
+ }
+
+ public String getIndexDetails() {
+ return this.indexDetails;
+ }
+
+ public void addArtifact(File pomFile, ArtifactKey artifactKey) {
+ indexManager.addDocument(repository, pomFile, artifactKey);
+ }
+
+ public void removeArtifact(File pomFile, ArtifactKey artifactKey) {
+ indexManager.removeDocument(repository, pomFile, artifactKey, null);
+ }
+
+ public Collection<IndexedArtifact> find(SearchExpression groupId, SearchExpression artifactId,
+ SearchExpression version, SearchExpression packaging) throws CoreException {
+ return find(wrapIfNotNull(groupId), wrapIfNotNull(artifactId), wrapIfNotNull(version), wrapIfNotNull(packaging));
+ }
+
+ /**
+ * Method wrapping one SearchExpression into a collection, if it is not null.
+ *
+ * @param sex
+ * @return
+ */
+ private Collection<SearchExpression> wrapIfNotNull(SearchExpression se) {
+ if(se == null) {
+ return null;
+ }
+ return Collections.singleton(se);
+ }
+
+ public Collection<IndexedArtifact> find(Collection<SearchExpression> groupId,
+ Collection<SearchExpression> artifactId, Collection<SearchExpression> version,
+ Collection<SearchExpression> packaging) throws CoreException {
+ BooleanQuery query = new BooleanQuery();
+
+ addQueryFromSearchExpressionCollection(query, MAVEN.PACKAGING, packaging);
+
+ addQueryFromSearchExpressionCollection(query, MAVEN.GROUP_ID, groupId);
+
+ addQueryFromSearchExpressionCollection(query, MAVEN.ARTIFACT_ID, artifactId);
+
+ addQueryFromSearchExpressionCollection(query, MAVEN.VERSION, version);
+
+ return indexManager.search(repository, query).values();
+ }
+
+ private void addQueryFromSearchExpressionCollection(final BooleanQuery query, final Field field,
+ final Collection<SearchExpression> sec) {
+ if(sec != null && !sec.isEmpty()) {
+ if(sec.size() > 1) {
+ BooleanQuery q = new BooleanQuery();
+ for(SearchExpression se : sec) {
+ q.add(indexManager.constructQuery(field, se), Occur.SHOULD);
+ }
+ query.add(q, Occur.MUST);
+ } else {
+ query.add(indexManager.constructQuery(field, sec.iterator().next()), Occur.MUST);
+ }
+ }
+ }
+
+ public IndexedArtifactFile getIndexedArtifactFile(ArtifactKey artifact) throws CoreException {
+ return indexManager.getIndexedArtifactFile(repository, artifact);
+ }
+
+ public IndexedArtifactFile identify(File file) throws CoreException {
+ return indexManager.identify(repository, file);
+ }
+
+ public void updateIndex(boolean force, IProgressMonitor monitor) throws CoreException {
+ indexManager.updateIndex(repository, force, monitor);
+ }
+
+ public void scheduleIndexUpdate(boolean force) {
+ indexManager.scheduleIndexUpdate(repository, force);
+ }
+
+ public IndexedArtifactGroup[] getRootIndexedArtifactGroups() throws CoreException {
+ return indexManager.getRootIndexedArtifactGroups(repository);
+ }
+
+ public boolean isUpdating() {
+ return indexManager.isUpdatingIndex(repository);
+ }
+
+ public IRepository getRepository() {
+ return repository;
+ }
+
+ public boolean isEnabled() {
+ return DETAILS_MIN.equals(indexDetails) || DETAILS_FULL.equals(indexDetails);
+ }
+
+ public void setIndexDetails(String details) throws CoreException {
+ indexManager.setIndexDetails(repository, details, null/*async*/);
+ }
+
+ public Map<String, IndexedArtifact> search(SearchExpression term, String searchType) throws CoreException {
+ return indexManager.search(getRepository(), term, searchType);
+ }
+
+ public Map<String, IndexedArtifact> search(SearchExpression term, String searchType, int classifier)
+ throws CoreException {
+ return indexManager.search(getRepository(), term, searchType, classifier);
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java
new file mode 100644
index 00000000..d41af33b
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/NexusIndexManager.java
@@ -0,0 +1,1312 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.index;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.WeakHashMap;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osgi.util.NLS;
+
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
+
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanClause.Occur;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.FilteredQuery;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.search.QueryWrapperFilter;
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
+
+import org.apache.maven.index.ArtifactContext;
+import org.apache.maven.index.ArtifactContextProducer;
+import org.apache.maven.index.ArtifactInfo;
+import org.apache.maven.index.Field;
+import org.apache.maven.index.IteratorSearchRequest;
+import org.apache.maven.index.IteratorSearchResponse;
+import org.apache.maven.index.MAVEN;
+import org.apache.maven.index.NexusIndexer;
+import org.apache.maven.index.SearchType;
+import org.apache.maven.index.artifact.Gav;
+import org.apache.maven.index.artifact.IllegalArtifactCoordinateException;
+import org.apache.maven.index.context.IndexCreator;
+import org.apache.maven.index.context.IndexingContext;
+import org.apache.maven.index.creator.JarFileContentsIndexCreator;
+import org.apache.maven.index.creator.MavenArchetypeArtifactInfoIndexCreator;
+import org.apache.maven.index.creator.MavenPluginArtifactInfoIndexCreator;
+import org.apache.maven.index.creator.MinimalArtifactInfoIndexCreator;
+import org.apache.maven.index.fs.Lock;
+import org.apache.maven.index.updater.IndexUpdateRequest;
+import org.apache.maven.index.updater.IndexUpdateResult;
+import org.apache.maven.index.updater.IndexUpdater;
+import org.apache.maven.wagon.authentication.AuthenticationInfo;
+import org.apache.maven.wagon.proxy.ProxyInfo;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.ArtifactRepositoryRef;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexListener;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.index.MatchTyped;
+import org.eclipse.m2e.core.index.MatchTyped.MatchType;
+import org.eclipse.m2e.core.index.SearchExpression;
+import org.eclipse.m2e.core.index.SourcedSearchExpression;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.index.IndexUpdaterJob.IndexCommand;
+import org.eclipse.m2e.core.internal.repository.IRepositoryIndexer;
+import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.repository.IRepository;
+import org.eclipse.m2e.core.repository.IRepositoryRegistry;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class NexusIndexManager implements IndexManager, IMavenProjectChangedListener, IRepositoryIndexer {
+
+ public static final int MIN_CLASS_QUERY_LENGTH = 6;
+
+ /**
+ * Lazy instantiated nexus indexer instance.
+ */
+ private NexusIndexer indexer;
+
+ /**
+ * Lazy instantiated nexus indexer's contextProducer.
+ */
+ private ArtifactContextProducer artifactContextProducer;
+
+ /**
+ * Lock guarding lazy instantiation of indexerLock instance
+ */
+ private final Object indexerLock = new Object();
+
+ /**
+ * Lock guarding lazy instantiation of contextProducer instance
+ */
+ private final Object contextProducerLock = new Object();
+
+ private IMaven maven;
+
+ private MavenProjectManager projectManager;
+
+ private IRepositoryRegistry repositoryRegistry;
+
+ private ArrayList<IndexCreator> fullCreators = null;
+
+ private ArrayList<IndexCreator> minCreators = null;
+
+ private final MavenConsole console;
+
+ private final File baseIndexDir;
+
+ private final List<IndexListener> indexListeners = new ArrayList<IndexListener>();
+
+ private NexusIndex localIndex;
+
+ private final NexusIndex workspaceIndex;
+
+ private final IndexUpdaterJob updaterJob;
+
+ private Properties indexDetails = new Properties();
+
+ private Set<String> updatingIndexes = new HashSet<String>();
+
+ private IndexUpdater indexUpdater;
+
+ private static final EquinoxLocker locker = new EquinoxLocker();
+
+ /**
+ * Maps repository UID to the lock object associated with the repository. Entries are only added but never directly
+ * removed from the map, although jvm garbage collector may remove otherwise unused entries to reclaim the little
+ * memory they use. Never access this map directly. #getIndexLock must be used to get repository lock object.
+ */
+ private final Map<String, Object> indexLocks = new WeakHashMap<String, Object>();
+
+ public NexusIndexManager(MavenConsole console, MavenProjectManager projectManager,
+ IRepositoryRegistry repositoryRegistry, File stateDir) {
+ this.console = console;
+ this.projectManager = projectManager;
+ this.repositoryRegistry = repositoryRegistry;
+ this.baseIndexDir = new File(stateDir, "nexus"); //$NON-NLS-1$
+
+ this.maven = MavenPlugin.getDefault().getMaven();
+ this.indexUpdater = MavenPlugin.getDefault().getIndexUpdater();
+
+ this.updaterJob = new IndexUpdaterJob(this, console);
+
+ this.workspaceIndex = new NexusIndex(this, repositoryRegistry.getWorkspaceRepository(), NexusIndex.DETAILS_MIN);
+ }
+
+ private NexusIndex newLocalIndex(IRepository localRepository) {
+ return new NexusIndex(this, localRepository, NexusIndex.DETAILS_FULL);
+ }
+
+ private ArrayList<IndexCreator> getFullCreator() {
+ if(fullCreators == null) {
+ try {
+ PlexusContainer container = MavenPlugin.getDefault().getPlexusContainer();
+ IndexCreator min = container.lookup(IndexCreator.class, MinimalArtifactInfoIndexCreator.ID);
+ IndexCreator mavenPlugin = container.lookup(IndexCreator.class, MavenPluginArtifactInfoIndexCreator.ID);
+ IndexCreator mavenArchetype = container.lookup(IndexCreator.class, MavenArchetypeArtifactInfoIndexCreator.ID);
+ IndexCreator jar = container.lookup(IndexCreator.class, JarFileContentsIndexCreator.ID);
+
+ fullCreators = new ArrayList<IndexCreator>();
+ fullCreators.add(min);
+ fullCreators.add(jar);
+ fullCreators.add(mavenPlugin);
+ fullCreators.add(mavenArchetype);
+ } catch(ComponentLookupException ce) {
+ String msg = "Error looking up component ";
+ console.logError(msg + "; " + ce.getMessage()); //$NON-NLS-1$
+ MavenLogger.log(msg, ce);
+
+ }
+ }
+ return fullCreators;
+ }
+
+ private ArrayList<IndexCreator> getMinCreator() {
+ if(minCreators == null) {
+ try {
+ PlexusContainer container = MavenPlugin.getDefault().getPlexusContainer();
+ IndexCreator min = container.lookup(IndexCreator.class, MinimalArtifactInfoIndexCreator.ID);
+ IndexCreator mavenArchetype = container.lookup(IndexCreator.class, MavenArchetypeArtifactInfoIndexCreator.ID);
+ minCreators = new ArrayList<IndexCreator>();
+ minCreators.add(min);
+ minCreators.add(mavenArchetype);
+ } catch(ComponentLookupException ce) {
+ String msg = "Error looking up component ";
+ MavenLogger.log(msg, ce);
+ }
+
+ }
+ return minCreators;
+ }
+
+ /** for Unit test */
+ public IndexedArtifactFile getIndexedArtifactFile(IRepository repository, ArtifactKey gav) throws CoreException {
+
+ try {
+ BooleanQuery query = new BooleanQuery();
+ query.add(constructQuery(MAVEN.GROUP_ID, gav.getGroupId(), SearchType.EXACT), BooleanClause.Occur.MUST);
+ query.add(constructQuery(MAVEN.ARTIFACT_ID, gav.getArtifactId(), SearchType.EXACT), BooleanClause.Occur.MUST);
+ query.add(constructQuery(MAVEN.VERSION, gav.getVersion(), SearchType.EXACT), BooleanClause.Occur.MUST);
+
+ if(gav.getClassifier() != null) {
+ query.add(constructQuery(MAVEN.CLASSIFIER, gav.getClassifier(), SearchType.EXACT), BooleanClause.Occur.MUST);
+ }
+
+ synchronized(getIndexLock(repository)) {
+ ArtifactInfo artifactInfo = getIndexer().identify(query, Collections.singleton(getIndexingContext(repository)));
+ if(artifactInfo != null) {
+ return getIndexedArtifactFile(artifactInfo);
+ }
+ }
+ } catch(Exception ex) {
+ String msg = "Illegal artifact coordinate " + ex.getMessage();
+ MavenLogger.log(msg, ex);
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.NexusIndexManager_error_search, ex));
+ }
+ return null;
+ }
+
+ /** for Unit test */
+ public IndexedArtifactFile getIndexedArtifactFile(ArtifactInfo artifactInfo) {
+ String groupId = artifactInfo.groupId;
+ String artifactId = artifactInfo.artifactId;
+ String repository = artifactInfo.repository;
+ String version = artifactInfo.version;
+ String classifier = artifactInfo.classifier;
+ String packaging = artifactInfo.packaging;
+ String fname = artifactInfo.fname;
+ if(fname == null) {
+ fname = artifactId + '-' + version
+ + (classifier != null ? '-' + classifier : "") + (packaging != null ? ('.' + packaging) : ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ long size = artifactInfo.size;
+ Date date = new Date(artifactInfo.lastModified);
+
+ int sourcesExists = artifactInfo.sourcesExists.ordinal();
+ int javadocExists = artifactInfo.javadocExists.ordinal();
+
+ String prefix = artifactInfo.prefix;
+ List<String> goals = artifactInfo.goals;
+
+ return new IndexedArtifactFile(repository, groupId, artifactId, version, packaging, classifier, fname, size, date,
+ sourcesExists, javadocExists, prefix, goals);
+ }
+
+ public IndexedArtifactFile identify(File file) throws CoreException {
+ try {
+ ArtifactInfo artifactInfo = getIndexer().identify(file);
+ return artifactInfo == null ? null : getIndexedArtifactFile(artifactInfo);
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.NexusIndexManager_error_search, ex));
+ }
+ }
+
+ protected IndexedArtifactFile identify(IRepository repository, File file) throws CoreException {
+ try {
+ IndexingContext context = getIndexingContext(repository);
+ ArtifactInfo artifactInfo = identify(file, Collections.singleton(context));
+ return artifactInfo == null ? null : getIndexedArtifactFile(artifactInfo);
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.NexusIndexManager_error_search, ex));
+ }
+ }
+
+ /**
+ * Method to construct Lucene Queries without need to actually know the structure and details (field names, analyze
+ * details, etc) of the underlying index. Also, using this methods makes you "future proof". Naturally, at caller
+ * level you can still combine these queries using BooleanQuery to suit your needs.
+ *
+ * @param field
+ * @param query
+ * @param type
+ * @return
+ */
+ public Query constructQuery(Field field, SearchExpression query) {
+ // let the default be "scored" search
+ SearchType st = SearchType.SCORED;
+
+ if(query instanceof MatchTyped) {
+ MatchType mt = ((MatchTyped) query).getMatchType();
+
+ if(MatchType.EXACT.equals(mt)) {
+ st = SearchType.EXACT;
+ }
+ }
+
+ return constructQuery(field, query.getStringValue(), st);
+ }
+
+ private Query constructQuery(Field field, String query, SearchType searchType) {
+ return getIndexer().constructQuery(field, query, searchType);
+ }
+
+ public Map<String, IndexedArtifact> search(SearchExpression term, String type) throws CoreException {
+ return search(null, term, type, IIndex.SEARCH_ALL);
+ }
+
+ public Map<String, IndexedArtifact> search(SearchExpression term, String type, int classifier) throws CoreException {
+ return search(null, term, type, classifier);
+ }
+
+ private void addClassifiersToQuery(BooleanQuery bq, int classifier) {
+ boolean includeJavaDocs = (classifier & IIndex.SEARCH_JAVADOCS) > 0;
+ Query tq = null;
+ if(!includeJavaDocs) {
+ tq = constructQuery(MAVEN.CLASSIFIER, "javadoc", SearchType.EXACT); //$NON-NLS-1$
+ bq.add(tq, Occur.MUST_NOT);
+ }
+ boolean includeSources = (classifier & IIndex.SEARCH_SOURCES) > 0;
+ if(!includeSources) {
+ tq = constructQuery(MAVEN.CLASSIFIER, "sources", SearchType.EXACT); //$NON-NLS-1$
+ bq.add(tq, Occur.MUST_NOT);
+ }
+ boolean includeTests = (classifier & IIndex.SEARCH_TESTS) > 0;
+ if(!includeTests) {
+ tq = constructQuery(MAVEN.CLASSIFIER, "tests", SearchType.EXACT); //$NON-NLS-1$
+ bq.add(tq, Occur.MUST_NOT);
+ }
+ }
+
+ /**
+ * @return Map<String, IndexedArtifact>
+ */
+ protected Map<String, IndexedArtifact> search(IRepository repository, SearchExpression term, String type,
+ int classifier) throws CoreException {
+ Query query;
+ if(IIndex.SEARCH_GROUP.equals(type)) {
+ query = constructQuery(MAVEN.GROUP_ID, term);
+ // query = new TermQuery(new Term(ArtifactInfo.GROUP_ID, term));
+ // query = new PrefixQuery(new Term(ArtifactInfo.GROUP_ID, term));
+ } else if(IIndex.SEARCH_ARTIFACT.equals(type)) {
+ BooleanQuery bq = new BooleanQuery();
+ bq.add(constructQuery(MAVEN.GROUP_ID, term), Occur.SHOULD); //$NON-NLS-1$
+ bq.add(constructQuery(MAVEN.ARTIFACT_ID, term), Occur.SHOULD); //$NON-NLS-1$
+ bq.add(
+ constructQuery(MAVEN.SHA1, term.getStringValue(), term.getStringValue().length() == 40 ? SearchType.EXACT
+ : SearchType.SCORED), Occur.SHOULD);
+ addClassifiersToQuery(bq, classifier);
+ query = bq;
+
+ } else if(IIndex.SEARCH_PARENTS.equals(type)) {
+ if(term == null) { //$NON-NLS-1$ //$NON-NLS-2$
+ query = constructQuery(MAVEN.PACKAGING, "pom", SearchType.EXACT); //$NON-NLS-1$
+ } else {
+ BooleanQuery bq = new BooleanQuery();
+ bq.add(constructQuery(MAVEN.GROUP_ID, term), Occur.SHOULD); //$NON-NLS-1$
+ bq.add(constructQuery(MAVEN.ARTIFACT_ID, term), Occur.SHOULD); //$NON-NLS-1$
+ bq.add(
+ constructQuery(MAVEN.SHA1, term.getStringValue(), term.getStringValue().length() == 40 ? SearchType.EXACT
+ : SearchType.SCORED), Occur.SHOULD);
+ Query tq = constructQuery(MAVEN.PACKAGING, "pom", SearchType.EXACT); //$NON-NLS-1$
+ query = new FilteredQuery(tq, new QueryWrapperFilter(bq));
+ }
+
+ } else if(IIndex.SEARCH_PLUGIN.equals(type)) {
+ if(term == null) { //$NON-NLS-1$
+ query = constructQuery(MAVEN.PACKAGING, "maven-plugin", SearchType.EXACT); //$NON-NLS-1$
+ } else {
+ BooleanQuery bq = new BooleanQuery();
+ bq.add(constructQuery(MAVEN.GROUP_ID, term), Occur.SHOULD); //$NON-NLS-1$
+ bq.add(constructQuery(MAVEN.ARTIFACT_ID, term), Occur.SHOULD); //$NON-NLS-1$
+ Query tq = constructQuery(MAVEN.PACKAGING, "maven-plugin", SearchType.EXACT); //$NON-NLS-1$
+ query = new FilteredQuery(tq, new QueryWrapperFilter(bq));
+ }
+
+ } else if(IIndex.SEARCH_ARCHETYPE.equals(type)) {
+ BooleanQuery bq = new BooleanQuery();
+ bq.add(constructQuery(MAVEN.GROUP_ID, term), Occur.SHOULD); //$NON-NLS-1$
+ bq.add(constructQuery(MAVEN.ARTIFACT_ID, term), Occur.SHOULD); //$NON-NLS-1$
+ Query tq = constructQuery(MAVEN.PACKAGING, "maven-archetype", SearchType.EXACT); //$NON-NLS-1$
+ query = new FilteredQuery(tq, new QueryWrapperFilter(bq));
+
+ } else if(IIndex.SEARCH_PACKAGING.equals(type)) {
+ query = constructQuery(MAVEN.PACKAGING, term);
+ } else if(IIndex.SEARCH_SHA1.equals(type)) {
+ // if hash is 40 chars, it is "complete", otherwise assume prefix
+ query = constructQuery(MAVEN.SHA1, term.getStringValue(), term.getStringValue().length() == 40 ? SearchType.EXACT
+ : SearchType.SCORED);
+ } else {
+ return Collections.emptyMap();
+ }
+
+ Map<String, IndexedArtifact> result = new TreeMap<String, IndexedArtifact>();
+
+ try {
+ IteratorSearchResponse response;
+
+ synchronized(getIndexLock(repository)) {
+ IndexingContext context = getIndexingContext(repository);
+ if(context == null) {
+ response = getIndexer().searchIterator(new IteratorSearchRequest(query));
+ } else {
+ response = getIndexer().searchIterator(new IteratorSearchRequest(query, context));
+ }
+
+ for(ArtifactInfo artifactInfo : response.getResults()) {
+ addArtifactFile(result, getIndexedArtifactFile(artifactInfo), null, null, artifactInfo.packaging);
+ }
+
+ // https://issues.sonatype.org/browse/MNGECLIPSE-1630
+ // lucene can't handle prefix queries that match many index entries.
+ // to workaround, use term query to locate group artifacts and manually
+ // match subgroups
+ if(IIndex.SEARCH_GROUP.equals(type) && context != null) {
+ Set<String> groups = context.getAllGroups();
+ for(String group : groups) {
+ if(term == null || group.startsWith(term.getStringValue()) && !group.equals(term.getStringValue())) {
+ String key = getArtifactFileKey(group, group, null, null);
+ result.put(key, new IndexedArtifact(group, group, null, null, null));
+ }
+ }
+ }
+ }
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.NexusIndexManager_error_search, ex));
+ }
+
+ return result;
+ }
+
+ /**
+ * @return Map<String, IndexedArtifact>
+ */
+ protected Map<String, IndexedArtifact> search(IRepository repository, SearchExpression term, String type)
+ throws CoreException {
+ return search(repository, term, type, IIndex.SEARCH_ALL);
+ }
+
+ /**
+ * @return Map<String, IndexedArtifact>
+ */
+ protected Map<String, IndexedArtifact> search(IRepository repository, Query query) throws CoreException {
+ Map<String, IndexedArtifact> result = new TreeMap<String, IndexedArtifact>();
+ try {
+ IteratorSearchResponse response;
+
+ synchronized(getIndexLock(repository)) {
+ IndexingContext context = getIndexingContext(repository);
+ if(context == null) {
+ response = getIndexer().searchIterator(new IteratorSearchRequest(query));
+ } else {
+ response = getIndexer().searchIterator(new IteratorSearchRequest(query, context));
+ }
+ }
+
+ for(ArtifactInfo artifactInfo : response.getResults()) {
+ IndexedArtifactFile af = getIndexedArtifactFile(artifactInfo);
+ addArtifactFile(result, af, null, null, artifactInfo.packaging);
+ }
+
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.NexusIndexManager_error_search, ex));
+ }
+ return result;
+ }
+
+ private void addArtifactFile(Map<String, IndexedArtifact> result, IndexedArtifactFile af, String className,
+ String packageName, String packaging) {
+ String group = af.group;
+ String artifact = af.artifact;
+ String key = getArtifactFileKey(group, artifact, packageName, className);
+ IndexedArtifact indexedArtifact = result.get(key);
+ if(indexedArtifact == null) {
+ indexedArtifact = new IndexedArtifact(group, artifact, packageName, className, packaging);
+ result.put(key, indexedArtifact);
+ }
+ indexedArtifact.addFile(af);
+ }
+
+ protected String getArtifactFileKey(String group, String artifact, String packageName, String className) {
+ return className + " : " + packageName + " : " + group + " : " + artifact; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ private void purgeCurrentIndex(IndexingContext context) throws IOException {
+ context.purge();
+ }
+
+ private void reindexLocalRepository(IRepository repository, boolean force, final IProgressMonitor monitor)
+ throws CoreException {
+ try {
+ fireIndexUpdating(repository);
+ //IndexInfo indexInfo = getIndexInfo(indexName);
+ IndexingContext context = getIndexingContext(repository);
+ if(force) {
+ purgeCurrentIndex(context);
+ }
+ if(context.getRepository().isDirectory()) {
+ getIndexer().scan(context, new ArtifactScanningMonitor(context.getRepository(), monitor, console), false);
+ }
+ fireIndexChanged(repository);
+ console.logMessage("Updated local repository index");
+ } catch(Exception ex) {
+ MavenLogger.log("Unable to re-index " + repository.toString(), ex);
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.NexusIndexManager_error_reindexing, ex));
+ } finally {
+ fireIndexChanged(repository);
+ }
+ }
+
+ private void reindexWorkspace(boolean force, IProgressMonitor monitor) throws CoreException {
+ IRepository workspaceRepository = repositoryRegistry.getWorkspaceRepository();
+ try {
+ IndexingContext context = getIndexingContext(workspaceRepository);
+ if(force) {
+ purgeCurrentIndex(context);
+ }
+ for(IMavenProjectFacade facade : projectManager.getProjects()) {
+ addDocument(workspaceRepository, facade.getPomFile(), //
+ facade.getArtifactKey());
+ }
+ } catch(Exception ex) {
+ MavenLogger.log("Unable to re-index " + workspaceRepository.toString(), ex);
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.NexusIndexManager_error_reindexing, ex));
+ } finally {
+ fireIndexChanged(workspaceRepository);
+ }
+ }
+
+ protected void addDocument(IRepository repository, File file, ArtifactKey key) {
+ synchronized(getIndexLock(repository)) {
+ IndexingContext context = getIndexingContext(repository);
+ if(context == null) {
+ // TODO log
+ return;
+ }
+ try {
+ ArtifactContext artifactContext;
+ if(repository.isScope(IRepositoryRegistry.SCOPE_WORKSPACE)) {
+ IMavenProjectFacade facade = getProjectByArtifactKey(key);
+ artifactContext = getWorkspaceArtifactContext(facade, context);
+ } else {
+ artifactContext = getArtifactContext(file, context);
+ }
+ getIndexer().addArtifactToIndex(artifactContext, context);
+ } catch(Exception ex) {
+ String msg = "Unable to add " + getDocumentKey(key);
+ console.logError(msg + "; " + ex.getMessage()); //$NON-NLS-1$
+ MavenLogger.log(msg, ex);
+ }
+ }
+ }
+
+ private IMavenProjectFacade getProjectByArtifactKey(ArtifactKey artifactKey) throws CoreException {
+ for(IMavenProjectFacade facade : projectManager.getProjects()) {
+ if(facade.getArtifactKey().equals(artifactKey)) {
+ return facade;
+ }
+ }
+
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.NexusIndexManager_error_unexpected, new IllegalArgumentException(String.format(
+ "Workspace project with key %s not found!", new Object[] {artifactKey})))); //$NON-NLS-1$
+ }
+
+ protected void removeDocument(IRepository repository, File file, ArtifactKey key, IMavenProjectFacade facade) {
+ synchronized(getIndexLock(repository)) {
+ try {
+ IndexingContext context = getIndexingContext(repository);
+ if(context == null) {
+ String msg = "Unable to find document to remove" + getDocumentKey(key);
+ MavenLogger.log(new Status(IStatus.ERROR, "org.eclipse.m2e", msg)); //$NON-NLS-1$
+ return;
+ }
+ ArtifactContext artifactContext;
+ if(repository.isScope(IRepositoryRegistry.SCOPE_WORKSPACE)) {
+ if(facade == null) {
+ // try to get one, but you MUST have facade in case of project deletion, see mavenProjectChanged()
+ facade = getProjectByArtifactKey(key);
+ }
+ artifactContext = getWorkspaceArtifactContext(facade, context);
+ } else {
+ artifactContext = getArtifactContext(file, context);
+ }
+ getIndexer().deleteArtifactFromIndex(artifactContext, context);
+ } catch(Exception ex) {
+ String msg = "Unable to remove " + getDocumentKey(key);
+ console.logError(msg + "; " + ex.getMessage()); //$NON-NLS-1$
+ MavenLogger.log(msg, ex);
+ }
+ }
+
+ fireIndexChanged(repository);
+ }
+
+ private ArtifactContext getArtifactContext(File file, IndexingContext context)
+ throws IllegalArtifactCoordinateException {
+ return getArtifactContextProducer().getArtifactContext(context, file);
+ }
+
+ private ArtifactContext getWorkspaceArtifactContext(IMavenProjectFacade facade, IndexingContext context)
+ throws CoreException {
+ IRepository workspaceRepository = repositoryRegistry.getWorkspaceRepository();
+ ArtifactKey key = facade.getArtifactKey();
+ ArtifactInfo ai = new ArtifactInfo(workspaceRepository.getUid(), key.getGroupId(), key.getArtifactId(),
+ key.getVersion(), null);
+ ai.packaging = facade.getPackaging();
+ File pomFile = facade.getPomFile();
+ File artifactFile = (pomFile != null) ? pomFile.getParentFile() : null;
+ try {
+ Gav gav = new Gav(key.getGroupId(), key.getArtifactId(), key.getVersion());
+ return new ArtifactContext(pomFile, artifactFile, null, ai, gav);
+ } catch(IllegalArtifactCoordinateException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.NexusIndexManager_error_unexpected, ex));
+ }
+ }
+
+ protected void scheduleIndexUpdate(final IRepository repository, final boolean force) {
+ if(repository != null) {
+ IndexCommand command = new IndexUpdaterJob.IndexCommand() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ updateIndex(repository, force, monitor);
+ }
+ };
+ updaterJob.addCommand(command);
+ updaterJob.schedule(1000L);
+ }
+ }
+
+ protected Set<String> getRootGroups(IRepository repository) throws CoreException {
+ synchronized(getIndexLock(repository)) {
+ IndexingContext context = getIndexingContext(repository);
+ if(context != null) {
+ try {
+ Set<String> rootGroups = context.getRootGroups();
+ return rootGroups;
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, //
+ NLS.bind(Messages.NexusIndexManager_error_root_grp, repository.toString()), ex));
+ }
+ }
+ return Collections.emptySet();
+ }
+ }
+
+ /** for unit tests */
+ public IndexedArtifactGroup[] getRootIndexedArtifactGroups(IRepository repository) throws CoreException {
+ synchronized(getIndexLock(repository)) {
+ IndexingContext context = getIndexingContext(repository);
+ if(context != null) {
+ try {
+ Set<String> rootGroups = context.getRootGroups();
+ IndexedArtifactGroup[] groups = new IndexedArtifactGroup[rootGroups.size()];
+ int i = 0;
+ for(String group : rootGroups) {
+ groups[i++ ] = new IndexedArtifactGroup(repository, group);
+ }
+ return groups;
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, //
+ NLS.bind(Messages.NexusIndexManager_error_root_grp, repository.toString()), ex));
+ }
+ }
+ return new IndexedArtifactGroup[0];
+ }
+ }
+
+ /** public for unit tests only! */
+ public IndexingContext getIndexingContext(IRepository repository) {
+ return repository == null ? null : getIndexer().getIndexingContexts().get(repository.getUid());
+ }
+
+ private NexusIndexer getIndexer() {
+ synchronized(indexerLock) {
+ if(indexer == null) {
+ indexer = MavenPlugin.getDefault().getNexusIndexer();
+ }
+ }
+ return indexer;
+ }
+
+ private ArtifactContextProducer getArtifactContextProducer() {
+ synchronized(contextProducerLock) {
+ if(artifactContextProducer == null) {
+ artifactContextProducer = MavenPlugin.getDefault().getArtifactContextProducer();
+ }
+ }
+ return artifactContextProducer;
+ }
+
+ public static String getDocumentKey(ArtifactKey artifact) {
+ String groupId = artifact.getGroupId();
+ if(groupId == null) {
+ groupId = Messages.NexusIndexManager_inherited;
+ }
+
+ String artifactId = artifact.getArtifactId();
+
+ String version = artifact.getVersion();
+ if(version == null) {
+ version = Messages.NexusIndexManager_inherited;
+ }
+
+ String key = groupId.replace('.', '/') + '/' + artifactId + '/' + version + '/' + artifactId + "-" + version; //$NON-NLS-1$
+
+ String classifier = artifact.getClassifier();
+ if(classifier != null) {
+ key += "-" + classifier; //$NON-NLS-1$
+ }
+
+ // TODO use artifact handler to retrieve extension
+ // cstamas: will not work since ArtifactKey misses type
+ // either get packaging from POM or store/honor extension
+ return key + ".pom"; //$NON-NLS-1$
+ }
+
+ public void mavenProjectChanged(MavenProjectChangedEvent[] events, IProgressMonitor monitor) {
+ /*
+ * This method is called while holding workspace lock. Avoid long-running operations if possible.
+ */
+
+ synchronized(getIndexLock(repositoryRegistry.getWorkspaceRepository())) {
+ IndexingContext context = getIndexingContext(repositoryRegistry.getWorkspaceRepository());
+
+ if(context != null) {
+ // workspace indexing context can by null during startup due to MNGECLIPSE-1633
+ for(MavenProjectChangedEvent event : events) {
+ IMavenProjectFacade oldFacade = event.getOldMavenProject();
+ if(oldFacade != null) {
+ removeDocument(repositoryRegistry.getWorkspaceRepository(), oldFacade.getPomFile(),
+ oldFacade.getArtifactKey(), oldFacade);
+ fireIndexRemoved(repositoryRegistry.getWorkspaceRepository());
+ }
+ IMavenProjectFacade facade = event.getMavenProject();
+ if(facade != null) {
+ addDocument(repositoryRegistry.getWorkspaceRepository(), facade.getPomFile(), facade.getArtifactKey());
+ fireIndexAdded(repositoryRegistry.getWorkspaceRepository());
+ }
+ }
+ }
+ }
+ }
+
+ public NexusIndex getWorkspaceIndex() {
+ return workspaceIndex;
+ }
+
+ public NexusIndex getLocalIndex() {
+ IRepository localRepository = repositoryRegistry.getLocalRepository();
+ synchronized(getIndexLock(localRepository)) {
+ if(localIndex == null) {
+ localIndex = newLocalIndex(localRepository);
+ }
+ }
+ return localIndex;
+ }
+
+ public IIndex getIndex(IProject project) {
+ IMavenProjectFacade projectFacade = project != null ? projectManager.getProject(project) : null;
+
+ ArrayList<IIndex> indexes = new ArrayList<IIndex>();
+ indexes.add(getWorkspaceIndex());
+ indexes.add(getLocalIndex());
+
+ if(projectFacade != null) {
+ LinkedHashSet<ArtifactRepositoryRef> repositories = new LinkedHashSet<ArtifactRepositoryRef>();
+ repositories.addAll(projectFacade.getArtifactRepositoryRefs());
+ repositories.addAll(projectFacade.getPluginArtifactRepositoryRefs());
+
+ for(ArtifactRepositoryRef repositoryRef : repositories) {
+ IRepository repository = repositoryRegistry.getRepository(repositoryRef);
+ indexes.add(getIndex(repository));
+ }
+ } else {
+ for(IRepository repository : repositoryRegistry.getRepositories(IRepositoryRegistry.SCOPE_SETTINGS)) {
+ indexes.add(getIndex(repository));
+ }
+ }
+
+ return new CompositeIndex(indexes);
+ }
+
+ public IIndex getAllIndexes() {
+ ArrayList<IIndex> indexes = new ArrayList<IIndex>();
+ indexes.add(getWorkspaceIndex());
+ indexes.add(getLocalIndex());
+
+ for(IMavenProjectFacade facade : projectManager.getProjects()) {
+ LinkedHashSet<ArtifactRepositoryRef> repositories = new LinkedHashSet<ArtifactRepositoryRef>();
+ repositories.addAll(facade.getArtifactRepositoryRefs());
+ repositories.addAll(facade.getPluginArtifactRepositoryRefs());
+
+ for(ArtifactRepositoryRef repositoryRef : repositories) {
+ IRepository repository = repositoryRegistry.getRepository(repositoryRef);
+ indexes.add(getIndex(repository));
+ }
+ }
+
+ return new CompositeIndex(indexes);
+ }
+
+ public NexusIndex getIndex(IRepository repository) {
+ String details = getIndexDetails(repository);
+ return new NexusIndex(this, repository, details);
+ }
+
+ protected File getIndexDirectoryFile(IRepository repository) {
+ return new File(baseIndexDir, repository.getUid());
+ }
+
+ protected Directory getIndexDirectory(IRepository repository) throws IOException {
+ return FSDirectory.getDirectory(getIndexDirectoryFile(repository));
+ }
+
+ public IndexedArtifactGroup resolveGroup(IndexedArtifactGroup group) {
+ IRepository repository = group.getRepository();
+ String prefix = group.getPrefix();
+ try {
+ IndexedArtifactGroup g = new IndexedArtifactGroup(repository, prefix);
+ for(IndexedArtifact a : search(repository, new SourcedSearchExpression(prefix), IIndex.SEARCH_GROUP).values()) {
+ String groupId = a.getGroupId();
+ if(groupId.equals(prefix)) {
+ g.getFiles().put(a.getArtifactId(), a);
+ } else if(groupId.startsWith(prefix + ".")) { //$NON-NLS-1$
+ int start = prefix.length() + 1;
+ int end = groupId.indexOf('.', start);
+ String key = end > -1 ? groupId.substring(0, end) : groupId;
+ g.getNodes().put(key, new IndexedArtifactGroup(repository, key));
+ }
+ }
+
+ return g;
+
+ } catch(CoreException ex) {
+ MavenLogger.log("Can't retrieve groups for " + repository.toString() + ":" + prefix, ex); //$NON-NLS-2$
+ return group;
+ }
+ }
+
+ public void repositoryAdded(IRepository repository, IProgressMonitor monitor) throws CoreException {
+ String details = getIndexDetails(repository);
+
+ // for consistency, always process indexes using our background thread
+ setIndexDetails(repository, null, details, null/*async*/);
+ }
+
+ /** For tests only */
+ public String getIndexDetails(IRepository repository) {
+ String details = indexDetails.getProperty(repository.getUid());
+
+ if(details == null) {
+ if(repository.isScope(IRepositoryRegistry.SCOPE_SETTINGS) && repository.getMirrorId() == null) {
+ details = NexusIndex.DETAILS_MIN;
+ } else if(repository.isScope(IRepositoryRegistry.SCOPE_LOCAL)) {
+ details = NexusIndex.DETAILS_MIN;
+ } else if(repository.isScope(IRepositoryRegistry.SCOPE_WORKSPACE)) {
+ details = NexusIndex.DETAILS_MIN;
+ } else {
+ details = NexusIndex.DETAILS_DISABLED;
+ }
+ }
+
+ return details;
+ }
+
+ /**
+ * Updates index synchronously if monitor!=null. Schedules index update otherwise. ... and yes, I know this ain't
+ * kosher. Public for unit tests only!
+ */
+ public void setIndexDetails(IRepository repository, String details, IProgressMonitor monitor) throws CoreException {
+ setIndexDetails(repository, details, details, monitor);
+ }
+
+ private void setIndexDetails(IRepository repository, String details, String defaultDetails, IProgressMonitor monitor)
+ throws CoreException {
+ if(details != null) {
+ indexDetails.setProperty(repository.getUid(), details);
+
+ writeIndexDetails();
+ } else {
+ details = defaultDetails;
+ }
+
+ synchronized(getIndexLock(repository)) {
+ IndexingContext indexingContext = getIndexingContext(repository);
+
+ try {
+ if(NexusIndex.DETAILS_DISABLED.equals(details)) {
+ if(indexingContext != null) {
+ getIndexer().removeIndexingContext(indexingContext, false /*removeFiles*/);
+ fireIndexRemoved(repository);
+ }
+ } else {
+ if(indexingContext != null) {
+ getIndexer().removeIndexingContext(indexingContext, false);
+ }
+
+ createIndexingContext(repository, details);
+
+ fireIndexAdded(repository);
+
+ if(monitor != null) {
+ updateIndex(repository, false, monitor);
+ } else {
+ scheduleIndexUpdate(repository, false);
+ }
+ }
+ } catch(IOException ex) {
+ String msg = "Error changing index details " + repository.toString();
+ console.logError(msg + "; " + ex.getMessage()); //$NON-NLS-1$
+ MavenLogger.log(msg, ex);
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.NexusIndexManager_error_add_repo, ex));
+ }
+
+ if(repository.isScope(IRepositoryRegistry.SCOPE_LOCAL)) {
+ // note that we are still synchronized on repository lock at this point
+ this.localIndex = newLocalIndex(repositoryRegistry.getLocalRepository());
+ }
+ }
+ }
+
+ protected IndexingContext createIndexingContext(IRepository repository, String details) throws IOException {
+ IndexingContext indexingContext;
+ Directory directory = getIndexDirectory(repository);
+
+ File repositoryPath = null;
+ if(repository.getBasedir() != null) {
+ repositoryPath = repository.getBasedir().getCanonicalFile();
+ }
+
+ ArrayList<IndexCreator> indexers = getIndexers(details);
+
+ indexingContext = getIndexer().addIndexingContextForced(repository.getUid(), //
+ repository.getUrl(), //
+ repositoryPath, //
+ directory, //
+ repository.getUrl(), null, //
+ indexers);
+
+ indexingContext.setSearchable(false);
+
+ return indexingContext;
+ }
+
+ protected ArrayList<IndexCreator> getIndexers(String details) {
+ boolean fullIndex = NexusIndex.DETAILS_FULL.equals(details);
+ ArrayList<IndexCreator> indexers = fullIndex ? getFullCreator() : getMinCreator();
+ return indexers;
+ }
+
+ public void repositoryRemoved(IRepository repository, IProgressMonitor monitor) {
+ synchronized(getIndexLock(repository)) {
+ try {
+ IndexingContext context = getIndexingContext(repository);
+ if(context == null) {
+ return;
+ }
+ getIndexer().removeIndexingContext(context, false);
+ } catch(IOException ie) {
+ String msg = "Unable to delete files for index";
+ MavenLogger.log(msg, ie);
+ }
+ }
+
+ fireIndexRemoved(repository);
+ }
+
+ protected void fireIndexAdded(IRepository repository) {
+ synchronized(indexListeners) {
+ for(IndexListener listener : indexListeners) {
+ listener.indexAdded(repository);
+ }
+ }
+ }
+
+ protected void fireIndexRemoved(IRepository repository) {
+ synchronized(updatingIndexes) {
+ if(repository != null) {
+ //since workspace index can be null at startup, guard against nulls
+ updatingIndexes.remove(repository.getUid());
+ }
+ }
+ synchronized(indexListeners) {
+ for(IndexListener listener : indexListeners) {
+ listener.indexRemoved(repository);
+ }
+ }
+ }
+
+ protected boolean isUpdatingIndex(IRepository repository) {
+ synchronized(updatingIndexes) {
+ return updatingIndexes.contains(repository.getUid());
+ }
+ }
+
+ protected void fireIndexUpdating(IRepository repository) {
+ synchronized(updatingIndexes) {
+ if(repository != null) {
+ //since workspace index can be null at startup, guard against nulls
+ updatingIndexes.add(repository.getUid());
+ }
+ }
+ synchronized(indexListeners) {
+ for(IndexListener listener : indexListeners) {
+ listener.indexUpdating(repository);
+ }
+ }
+ }
+
+ protected void fireIndexChanged(IRepository repository) {
+ synchronized(updatingIndexes) {
+ if(repository != null) {
+ //since workspace index can be null at startup, guard against nulls
+ updatingIndexes.remove(repository.getUid());
+ }
+
+ }
+ synchronized(indexListeners) {
+ for(IndexListener listener : indexListeners) {
+ listener.indexChanged(repository);
+ }
+ }
+ }
+
+ public void removeIndexListener(IndexListener listener) {
+ synchronized(indexListeners) {
+ indexListeners.remove(listener);
+ }
+ }
+
+ public void addIndexListener(IndexListener listener) {
+ synchronized(indexListeners) {
+ if(!indexListeners.contains(listener)) {
+ indexListeners.add(listener);
+ }
+ }
+ }
+
+ //Public for testing purpose.
+ public void updateIndex(IRepository repository, boolean force, IProgressMonitor monitor) throws CoreException {
+ synchronized(getIndexLock(repository)) {
+ if(repository.isScope(IRepositoryRegistry.SCOPE_WORKSPACE)) {
+ reindexWorkspace(force, monitor);
+ } else {
+ IndexingContext context = getIndexingContext(repository);
+ if(context != null) {
+ if(context.getRepository() != null) {
+ reindexLocalRepository(repository, force, monitor);
+ } else {
+ if(!force) {
+ //if 'force' is not set, then only do the remote update if this value is set
+ IMavenConfiguration mavenConfig = MavenPlugin.getDefault().getMavenConfiguration();
+ if(mavenConfig.isUpdateIndexesOnStartup()) {
+ updateRemoteIndex(repository, force, monitor);
+ }
+ } else {
+ updateRemoteIndex(repository, force, monitor);
+ }
+ }
+ }
+ }
+ IndexingContext context = getIndexingContext(repository);
+ if(context != null) {
+ context.setSearchable(true);
+ }
+ }
+ }
+
+ /*
+ * Callers must hold repository access synchronisation lock
+ */
+ private void updateRemoteIndex(IRepository repository, boolean force, IProgressMonitor monitor) {
+ if(repository == null) {
+ return;
+ }
+
+ if(monitor != null) {
+ monitor.setTaskName(NLS.bind(Messages.NexusIndexManager_task_updating, repository.toString()));
+ }
+ console.logMessage("Updating index " + repository.toString());
+ try {
+ fireIndexUpdating(repository);
+
+ IndexingContext context = getIndexingContext(repository);
+
+ if(context != null) {
+ IndexUpdateRequest request = newIndexUpdateRequest(repository, context, monitor);
+ request.setForceFullUpdate(force);
+
+ Lock cacheLock = locker.lock(request.getLocalIndexCacheDir());
+ try {
+ boolean updated;
+
+ request.setCacheOnly(true);
+ IndexUpdateResult result = indexUpdater.fetchAndUpdateIndex(request);
+ if(result.isFullUpdate() || !context.isSearchable()) {
+ // need to fully recreate index
+
+ // 1. process index gz into cached/shared lucene index. this can be a noop if cache is uptodate
+ String details = getIndexDetails(repository);
+ String id = repository.getUid() + "-cache"; //$NON-NLS-1$
+ File luceneCache = new File(request.getLocalIndexCacheDir(), details);
+ Directory directory = FSDirectory.getDirectory(luceneCache);
+ IndexingContext cacheCtx = getIndexer().addIndexingContextForced(id, id, null, directory, null, null,
+ getIndexers(details));
+ request = newIndexUpdateRequest(repository, cacheCtx, monitor);
+ request.setOffline(true);
+ indexUpdater.fetchAndUpdateIndex(request);
+
+ // 2. copy cached/shared (this is not very elegant, oh well)
+ getIndexer().removeIndexingContext(context, true); // nuke workspace index files
+ getIndexer().removeIndexingContext(cacheCtx, false); // keep the cache!
+ FileUtils.cleanDirectory(context.getIndexDirectoryFile());
+ FileUtils.copyDirectory(luceneCache, context.getIndexDirectoryFile()); // copy cached lucene index
+ context = createIndexingContext(repository, details); // re-create indexing context
+
+ updated = true;
+ } else {
+ // incremental change
+ request = newIndexUpdateRequest(repository, context, monitor);
+ request.setOffline(true); // local cache is already uptodate, no need to
+ result = indexUpdater.fetchAndUpdateIndex(request);
+ updated = result.getTimestamp() != null;
+ }
+
+ if(updated) {
+ console.logMessage("Updated index for " + repository.toString());
+ } else {
+ console.logMessage("No index update available for " + repository.toString());
+ }
+
+ } finally {
+ cacheLock.release();
+ }
+ }
+ } catch(FileNotFoundException e) {
+ String msg = "Unable to update index for " + repository.toString() + ": " + e.getMessage(); //$NON-NLS-2$
+ console.logError(msg);
+ } catch(Exception ie) {
+ String msg = "Unable to update index for " + repository.toString();
+ MavenLogger.log(msg, ie);
+ console.logError(msg);
+ } finally {
+ fireIndexChanged(repository);
+ }
+ }
+
+ protected IndexUpdateRequest newIndexUpdateRequest(IRepository repository, IndexingContext context,
+ IProgressMonitor monitor) throws IOException, CoreException {
+ ProxyInfo proxyInfo = maven.getProxyInfo(repository.getProtocol());
+ AuthenticationInfo authenticationInfo = repository.getAuthenticationInfo();
+
+ IndexUpdateRequest request = new IndexUpdateRequest(context, new AsyncFetcher(authenticationInfo, proxyInfo,
+ monitor));
+ File localRepo = repositoryRegistry.getLocalRepository().getBasedir();
+ File indexCacheBasedir = new File(localRepo, ".cache/m2e/" + MavenPlugin.getVersion()).getCanonicalFile(); //$NON-NLS-1$
+ File indexCacheDir = new File(indexCacheBasedir, repository.getUid());
+ indexCacheDir.mkdirs();
+ request.setLocalIndexCacheDir(indexCacheDir);
+ return request;
+ }
+
+ public void initialize(IProgressMonitor monitor) throws CoreException {
+ try {
+ BufferedInputStream is = new BufferedInputStream(new FileInputStream(getIndexDetailsFile()));
+ try {
+ indexDetails.load(is);
+ } finally {
+ is.close();
+ }
+ } catch(FileNotFoundException e) {
+ // that's quite alright
+ } catch(IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.NexusIndexManager_error_read_index, e));
+ }
+ }
+
+ protected void writeIndexDetails() throws CoreException {
+ try {
+ File indexDetailsFile = getIndexDetailsFile();
+ indexDetailsFile.getParentFile().mkdirs();
+ BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(indexDetailsFile));
+ try {
+ indexDetails.store(os, null);
+ } finally {
+ os.close();
+ }
+ } catch(IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.NexusIndexManager_error_write_index, e));
+ }
+ }
+
+ private File getIndexDetailsFile() {
+ return new File(baseIndexDir, "indexDetails.properties"); //$NON-NLS-1$
+ }
+
+ /** for unit tests only */
+ public Job getIndexUpdateJob() {
+ return updaterJob;
+ }
+
+ public String getIndexerId() {
+ return Messages.NexusIndexManager_78;
+ }
+
+ private Object getIndexLock(IRepository repository) {
+ if(repository == null) {
+ return new Object();
+ }
+ // NOTE: We ultimately want to prevent concurrent access to the IndexingContext so we sync on the repo UID and not on the repo instance.
+ synchronized(indexLocks) {
+ Object lock = indexLocks.get(repository.getUid());
+ if(lock == null) {
+ lock = new Object();
+ indexLocks.put(repository.getUid(), lock);
+ }
+ return lock;
+ }
+ }
+
+ /// REMOVE THIS BELOW ONCE Maven Indexer upgraded to 3.2.0-SNAPSHOT
+ /// In that moment this code becomes duplicated and already in place, this method added
+
+ protected ArtifactInfo identify(File artifact, Collection<IndexingContext> contexts) throws IOException {
+
+ FileInputStream is = null;
+
+ try {
+ MessageDigest sha1 = MessageDigest.getInstance("SHA-1");
+
+ is = new FileInputStream(artifact);
+
+ byte[] buff = new byte[4096];
+
+ int n;
+
+ while((n = is.read(buff)) > -1) {
+ sha1.update(buff, 0, n);
+ }
+
+ byte[] digest = sha1.digest();
+
+ Query q = getIndexer().constructQuery(MAVEN.SHA1, encode(digest), SearchType.EXACT);
+
+ return getIndexer().identify(q, contexts);
+
+ } catch(NoSuchAlgorithmException ex) {
+ throw new IOException("Unable to calculate digest");
+ } finally {
+ IOUtil.close(is);
+ }
+
+ }
+
+ private static final char[] DIGITS = "0123456789abcdef".toCharArray();
+
+ private static String encode(byte[] digest) {
+ char[] buff = new char[digest.length * 2];
+
+ int n = 0;
+
+ for(byte b : digest) {
+ buff[n++ ] = DIGITS[(0xF0 & b) >> 4];
+ buff[n++ ] = DIGITS[0x0F & b];
+ }
+
+ return new String(buff);
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecycle/LifecycleMappingFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecycle/LifecycleMappingFactory.java
new file mode 100644
index 00000000..78c43fe7
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecycle/LifecycleMappingFactory.java
@@ -0,0 +1,238 @@
+/*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.lifecycle;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+
+import org.apache.maven.plugin.MojoExecution;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.project.IgnoreMojoProjectConfiguration;
+import org.eclipse.m2e.core.internal.project.MojoExecutionProjectConfigurator;
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+import org.eclipse.m2e.core.project.configurator.CustomizableLifecycleMapping;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+import org.eclipse.m2e.core.project.configurator.PluginExecutionFilter;
+
+
+/**
+ * LifecycleMappingFactory
+ *
+ * @author igor
+ */
+public class LifecycleMappingFactory {
+
+ public static final String EXTENSION_LIFECYCLE_MAPPINGS = IMavenConstants.PLUGIN_ID + ".lifecycleMappings"; //$NON-NLS-1$
+
+ public static final String EXTENSION_PROJECT_CONFIGURATORS = IMavenConstants.PLUGIN_ID + ".projectConfigurators"; //$NON-NLS-1$
+
+ private static final String ELEMENT_LIFECYCLE_MAPPING = "lifecycleMapping"; //$NON-NLS-1$
+
+ private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
+
+ private static final String ATTR_PACKAGING_TYPE = "packaging-type"; //$NON-NLS-1$
+
+ private static final String ATTR_ID = "id"; //$NON-NLS-1$
+
+ private static final String ELEMENT_CONFIGURATOR = "configurator"; //$NON-NLS-1$
+
+ private static final String ELEMENT_MOJO = "mojo"; //$NON-NLS-1$
+
+ private static final String ELEMENT_IGNORE = "ignore"; //$NON-NLS-1$
+
+ private static final String ELEMENT_EXECUTE = "execute";
+
+ private static final String ATTR_GROUPID = "groupId";
+
+ private static final String ATTR_ARTIFACTID = "artifactId";
+
+ private static final String ATTR_VERSIONRANGE = "versionRange";
+
+ private static final String ATTR_GOALS = "goals";
+
+ /**
+ * Returns default lifecycle mapping for specified packaging type or null if no such lifecycle mapping
+ */
+ public static ILifecycleMapping getLifecycleMappingFor(String packagingType) {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint configuratorsExtensionPoint = registry.getExtensionPoint(EXTENSION_LIFECYCLE_MAPPINGS);
+ if(configuratorsExtensionPoint != null) {
+ IExtension[] configuratorExtensions = configuratorsExtensionPoint.getExtensions();
+ for(IExtension extension : configuratorExtensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for(IConfigurationElement element : elements) {
+ if(element.getName().equals(ELEMENT_LIFECYCLE_MAPPING)) {
+ if(packagingType.equals(element.getAttribute(ATTR_PACKAGING_TYPE))) {
+ return createLifecycleMapping(element);
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ protected static ILifecycleMapping createLifecycleMapping(IConfigurationElement element) {
+ try {
+ ILifecycleMapping mapping = (ILifecycleMapping) element.createExecutableExtension(ATTR_CLASS);
+ if(mapping instanceof CustomizableLifecycleMapping) {
+ CustomizableLifecycleMapping customizable = (CustomizableLifecycleMapping) mapping;
+ for(IConfigurationElement mojo : element.getChildren(ELEMENT_MOJO)) {
+ AbstractProjectConfigurator configurator = null;
+ if(mojo.getChildren(ELEMENT_IGNORE).length > 0) {
+ configurator = new IgnoreMojoProjectConfiguration();
+ } else if(mojo.getChildren(ELEMENT_EXECUTE).length > 0) {
+ configurator = createMojoExecution(mojo.getChildren(ELEMENT_EXECUTE)[0]);
+ } else if(mojo.getChildren(ELEMENT_CONFIGURATOR).length > 0) {
+ String configuratorId = mojo.getChildren(ELEMENT_CONFIGURATOR)[0].getAttribute(ATTR_ID);
+ configurator = createProjectConfigurator(configuratorId, true/*bare*/);
+ } else {
+ MavenLogger.log("Invalid lifecycle mapping configuration element: " + mojo.toString());
+ }
+ if(configurator != null) {
+ configurator.addPluginExecutionFilter(createPluginExecutionFilter(mojo));
+ customizable.addConfigurator(configurator);
+ }
+ }
+ }
+ return mapping;
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ return null;
+ }
+
+ private static AbstractProjectConfigurator createMojoExecution(IConfigurationElement configuration) {
+ boolean runOnIncremental = true; // TODO
+ return new MojoExecutionProjectConfigurator(runOnIncremental);
+ }
+
+ private static PluginExecutionFilter createPluginExecutionFilter(IConfigurationElement configuration) {
+ String groupId = configuration.getAttribute(ATTR_GROUPID);
+ String artifactId = configuration.getAttribute(ATTR_ARTIFACTID);
+ String versionRange = configuration.getAttribute(ATTR_VERSIONRANGE);
+ String goals = configuration.getAttribute(ATTR_GOALS);
+ return new PluginExecutionFilter(groupId, artifactId, versionRange, goals);
+ }
+
+ public static ILifecycleMapping getLifecycleMapping(String mappingId) {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint configuratorsExtensionPoint = registry.getExtensionPoint(EXTENSION_LIFECYCLE_MAPPINGS);
+ if(configuratorsExtensionPoint != null) {
+ IExtension[] configuratorExtensions = configuratorsExtensionPoint.getExtensions();
+ for(IExtension extension : configuratorExtensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for(IConfigurationElement element : elements) {
+ if(element.getName().equals(ELEMENT_LIFECYCLE_MAPPING)) {
+ if(mappingId.equals(element.getAttribute(ATTR_ID)))
+ return createLifecycleMapping(element);
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public static AbstractProjectConfigurator getProjectConfigurator(String configuratorId) {
+ return createProjectConfigurator(configuratorId, false/*bare*/);
+ }
+
+ protected static AbstractProjectConfigurator createProjectConfigurator(String configuratorId, boolean bare) {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint configuratorsExtensionPoint = registry.getExtensionPoint(EXTENSION_PROJECT_CONFIGURATORS);
+ if(configuratorsExtensionPoint != null) {
+ IExtension[] configuratorExtensions = configuratorsExtensionPoint.getExtensions();
+ for(IExtension extension : configuratorExtensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for(IConfigurationElement element : elements) {
+ if(element.getName().equals(ELEMENT_CONFIGURATOR)) {
+ if(configuratorId.equals(element.getAttribute(AbstractProjectConfigurator.ATTR_ID))) {
+ try {
+ AbstractProjectConfigurator configurator = (AbstractProjectConfigurator) element
+ .createExecutableExtension(AbstractProjectConfigurator.ATTR_CLASS);
+
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ configurator.setProjectManager(plugin.getMavenProjectManager());
+ configurator.setMavenConfiguration(plugin.getMavenConfiguration());
+ configurator.setMarkerManager(plugin.getMavenMarkerManager());
+ configurator.setConsole(plugin.getConsole());
+
+ if(!bare) {
+ for(IConfigurationElement mojo : element.getChildren(ELEMENT_MOJO)) {
+ configurator.addPluginExecutionFilter(createPluginExecutionFilter(mojo));
+ }
+ }
+
+ return configurator;
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public static AbstractProjectConfigurator createProjectConfiguratorFor(MojoExecution execution) {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint configuratorsExtensionPoint = registry.getExtensionPoint(EXTENSION_PROJECT_CONFIGURATORS);
+ if(configuratorsExtensionPoint != null) {
+ IExtension[] configuratorExtensions = configuratorsExtensionPoint.getExtensions();
+ for(IExtension extension : configuratorExtensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for(IConfigurationElement element : elements) {
+ if(element.getName().equals(ELEMENT_CONFIGURATOR)) {
+ if(isConfiguratorEnabledFor(element, execution)) {
+ try {
+ AbstractProjectConfigurator configurator = (AbstractProjectConfigurator) element
+ .createExecutableExtension(AbstractProjectConfigurator.ATTR_CLASS);
+
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ configurator.setProjectManager(plugin.getMavenProjectManager());
+ configurator.setMavenConfiguration(plugin.getMavenConfiguration());
+ configurator.setMarkerManager(plugin.getMavenMarkerManager());
+ configurator.setConsole(plugin.getConsole());
+
+ for(IConfigurationElement mojo : element.getChildren(ELEMENT_MOJO)) {
+ configurator.addPluginExecutionFilter(createPluginExecutionFilter(mojo));
+ }
+
+ return configurator;
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static boolean isConfiguratorEnabledFor(IConfigurationElement configuration, MojoExecution execution) {
+ for(IConfigurationElement mojo : configuration.getChildren(ELEMENT_MOJO)) {
+ if(createPluginExecutionFilter(mojo).match(execution)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties
new file mode 100644
index 00000000..4c740352
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties
@@ -0,0 +1,498 @@
+AbstractProjectConfigurator_error_missing_nature=Project does not have required nature
+AbstractTransferListenerAdapter_4=0% {0}
+AbstractTransferListenerAdapter_byte=B
+AbstractTransferListenerAdapter_cancelled=Transfer is canceled
+AbstractTransferListenerAdapter_kb=KB
+AbstractTransferListenerAdapter_mb=MB
+AbstractTransferListenerAdapter_subtask=error {0}
+AddDependencyAction_error_msg=Can't add dependency to {0}
+AddDependencyAction_error_title=Add Dependency
+AddDependencyAction_searchDialog_title=Add Dependency
+AddDependencyDialog_artifactId_label=Artifact Id:
+AddDependencyDialog_groupId_label=Group Id:
+AddDependencyDialog_info_label=Info:
+AddDependencyDialog_info_transitive={0}-{1}-{2} is already a transitive dependency.\n
+AddDependencyDialog_itemsSelected={0} items selected.
+AddDependencyDialog_itemSelected={0} item selected.
+AddDependencyDialog_multipleValuesSelected=(multiple values selected)
+AddDependencyDialog_results_label=Search Results:
+AddDependencyDialog_scope_label=Scope:
+AddDependencyDialog_search_label=Enter coordinate, sha1 prefix, project name..
+AddDependencyDialog_search_message=(coordinate, sha1 prefix, project name)
+AddDependencyDialog_searchDone=Done. {0} results found.
+AddDependencyDialog_searchError=Error while searching: {0}
+AddDependencyDialog_searching=Searching...
+AddDependencyDialog_searchingFor=Searching for {0}...
+AddDependencyDialog_title=Add Dependency
+AddDependencyDialog_tooManyResults=Too many results. Please refine your search.
+AddDependencyDialog_transitive_dependency=\ \ + {0}-{1}-{2} is already a transitive dependency.\n
+AddDependencyDialog_version_label=Version:
+AddPluginAction_searchDialog_title=Add Plugin
+ArchetypeCatalogFactory_default_local=Default Local
+ArchetypeCatalogFactory_error_missing_catalog=Error looking up archetype catalog; {0}
+ArchetypeCatalogFactory_indexer_catalog=Nexus Indexer
+ArchetypeCatalogFactory_internal=Internal
+ArchetypeCatalogFactory_local=Local {0}
+ArchetypeCatalogFactory_remote=Remote {0}
+ArchetypeCatalogsWriter_error_parse=Unable to parse Archetype catalogs list; {0}
+ArchetypeCatalogsWriter_error_write=Unable to write Archetype catalogs; {0}
+AsyncFetcher_error_cancelled=transfer has been cancelled by user
+AsyncFetcher_error_server=Server returned status code {0}: {1}
+AsyncFetcher_task_fetching=Fetching {0}
+AsyncFetcher_task_fetching2=Fetching {0} ({1}%)
+ChangeNatureAction_job_changing=Changing nature
+ChangeNatureAction_status_error=Can't change nature
+CustomArchetypeDialog_error_artid=Archetype Artifact Id is required
+CustomArchetypeDialog_error_grid=Archetype Group Id is required
+CustomArchetypeDialog_error_version=Archetype Version is required
+CustomArchetypeDialog_lblArchetypeartifactid=Archetype Artifact Id:
+CustomArchetypeDialog_lblArchetypegroupId=Archetype Group Id:
+CustomArchetypeDialog_lblArchetypeversion=Archetype Version:
+CustomArchetypeDialog_lblRepo=Repository URL:
+CustomArchetypeDialog_message=Specify Archetype and Maven repository URL
+CustomizableLifecycleMappingPropertyPage_message=Customizable Lifecycle Mapping
+CustomRepositoriesNode_name=Custom Repositories
+DefaultMavenMenuCreator_action_ci=Open Continuous Integration
+DefaultMavenMenuCreator_action_dependency=Add Dependency
+DefaultMavenMenuCreator_action_disable_management=Disable Dependency Management
+DefaultMavenMenuCreator_action_disable_workspace=Disable Workspace Resolution
+DefaultMavenMenuCreator_action_enable_dm=Enable Dependency Management
+DefaultMavenMenuCreator_action_enable_workspace=Enable Workspace Resolution
+DefaultMavenMenuCreator_action_issues=Open Issue Tracker
+DefaultMavenMenuCreator_action_open_pom=Open POM
+DefaultMavenMenuCreator_action_plugin=Add Plugin
+DefaultMavenMenuCreator_action_project=Open Project Page
+DefaultMavenMenuCreator_action_project_page=Open Project Page
+DefaultMavenMenuCreator_action_scm=Open Source Control
+DefaultMavenMenuCreator_action_update_config=Update Project Configuration
+DefaultMavenMenuCreator_action_update_deps=Update Dependencies
+DefaultMavenMenuCreator_action_update_snapshots=Update Snapshots
+EclipseLogger_debug1=[DEBUG] {0}
+EclipseLogger_debug2=[DEBUG] {0} {1}
+EclipseLogger_error1=[ERROR] {0}
+EclipseLogger_error2=[ERROR] {0} {1}
+EclipseLogger_fatal1=[FATAL ERROR] {0}
+EclipseLogger_fatal2=[FATAL ERROR] {0} {1}
+EclipseLogger_info1=[INFO] {0}
+EclipseLogger_info2=[INFO] {0} {1}
+EclipseLogger_name=m2e console logger
+EclipseLogger_warn1=[WARN] {0}
+EclipseLogger_warn2=[WARN] {0} {1}
+EditDependencyDialog_artifactId_label=Artifact Id:
+EditDependencyDialog_classifier_label=Classifier:
+EditDependencyDialog_groupId_label=Group Id:
+EditDependencyDialog_optional_checkbox=Optional
+EditDependencyDialog_scope_label=Scope:
+EditDependencyDialog_systemPath_label=System Path:
+EditDependencyDialog_title=Dependency Properties
+EditDependencyDialog_type_label=Type:
+EditDependencyDialog_version_label=Version:
+EmptyLifecycleMappingPropertyPage_title=No lifecycle mapping info to display for the Empty Lifecycle Mapping
+ExtensionReader_foundLifecycleMapping=Found lifecycle mapping id="{0}", name="{1}".
+EnableNatureAction_job_enable=Enabling Maven Dependency Management
+EnableNatureAction_wizard_shell=Create new POM
+GlobalRepositoriesNode_name=Global Repositories
+IndexedArtifactNode_no_pack=[No Packaging]
+IndexUpdaterJob_title=Updating indexes
+LifecycleConfigurationMojoExecutionNotCovered=Mojo execution not covered by lifecycle configuration: {0} (maven lifecycle phase: {1})
+LifecycleMissing=Unknown or missing lifecycle mapping with id="{0}" (project packaging type="{1}")
+LocalArchetypeCatalogDialog_btnBrowse=&Browse...
+LocalArchetypeCatalogDialog_dialog_title=Select Archetype catalog
+LocalArchetypeCatalogDialog_error_empty=Archetype catalog is empty
+LocalArchetypeCatalogDialog_error_exist=Archetype catalog does not exist
+LocalArchetypeCatalogDialog_error_no_location=Archetype catalog location is required
+LocalArchetypeCatalogDialog_lblCatalog=&Catalog File:
+LocalArchetypeCatalogDialog_lblDesc=Description:
+LocalArchetypeCatalogDialog_message=Specify catalog location and description
+LocalArchetypeCatalogDialog_title=Local Archetype Catalog
+LocalProjectScanner_task_scanning=Scanning folders
+LocalRepositoryNode_local=Local Repository
+LocalRepositoryRootNode_name=Local Repositories
+M2EErrorDialog_column_error=Error
+M2EErrorDialog_column_name=Project Name
+MavenArchetypesPreferencePage_btnAddLocal=Add &Local Catalog...
+MavenArchetypesPreferencePage_btnAddRemote=Add &Remote Catalog...
+MavenArchetypesPreferencePage_btnEdit=&Edit...
+MavenArchetypesPreferencePage_btnRemove=&Remove
+MavenArchetypesPreferencePage_error=Can't save archetype catalog configuration\n{0}
+MavenArchetypesPreferencePage_link=Add, remove or edit <a href="\#">Maven Archetype catalogs</a>:
+MavenArchetypesPreferencePage_local=Local: {0}
+MavenArchetypesPreferencePage_packaged=Packaged: {0}
+MavenArchetypesPreferencePage_remote=Remote: {0}
+MavenArchetypesPreferencePage_title=Maven Archetype Catalogs
+MavenCheckoutLocationPage_btnBrowse=&Browse...
+MavenCheckoutLocationPage_btnCheckout=Check out &All projects
+MavenCheckoutLocationPage_btnHead=Check out &Head Revision
+MavenCheckoutLocationPage_btnRevSelect=&Select...
+MavenCheckoutLocationPage_description=Select target location and revision
+MavenCheckoutLocationPage_error_empty=Select SCM type and URL
+MavenCheckoutLocationPage_error_empty_url=SCM URL field is required
+MavenCheckoutLocationPage_error_scm_empty=SCM revision fied is required
+MavenCheckoutLocationPage_error_scm_invalid=SCM revision is invalid
+MavenCheckoutLocationPage_error_url_empty=SCM URL is invalid
+MavenCheckoutLocationPage_lblRevision=&Revision:
+MavenCheckoutLocationPage_lblurl=SCM &URL:
+MavenCheckoutLocationPage_title=Target Location
+MavenCheckoutOperation_task_checking=Checking out {0} {1}
+MavenCheckoutOperation_task_scanning=Scanning {0} {1}
+MavenCheckoutWizard_location1=Select Project Location
+MavenCheckoutWizard_location2=Select project location and working set
+MavenCheckoutWizard_title=Checkout as Maven project from SCM
+MavenConsoleImpl_title=Maven Console
+MavenConsolePageParticipant_any=Show Console on Any Output
+MavenConsolePageParticipant_error=Show Console on Error
+MavenConsoleRemoveAction_tooltip=Close Maven2 Console
+MavenDebugOutputAction_0=Debug Output
+MavenDependenciesWizardPage_lblArtifacts=Maven Artifacts:
+MavenDependenciesWizardPage_searchDialog_title=Add Dependency
+MavenExternalRuntime_error_cannot_parse=Can't parse m2.conf
+MavenExternalRuntime_exc_unsupported=Unsupported m2.conf element
+MavenExternalRuntime_unknown=UNKNOWN
+MavenEmbeddedRuntime_unknown=UNKNOWN
+MavenGoalSelectionDialog_btnQualified=Use &Qualified Name
+MavenGoalSelectionDialog_error=Should select at least one goal
+MavenGoalSelectionDialog_lblSelect=&Select Goal:
+MavenGoalSelectionDialog_message=Select goal:
+MavenImpl_error_calc_build_plan=Could not calculate build plan
+MavenImpl_error_create_repo=Could not create artifact repository
+MavenImpl_error_init_maven=Could not initialize embedded maven runtime
+MavenImpl_error_lookup=Could not lookup required component
+MavenImpl_error_missing=Missing {0}
+MavenImpl_error_mojo=Could not get configured mojo for {0}
+MavenImpl_error_no_exec_req=Could not create maven execution request
+MavenImpl_error_param=Could not get mojo execution paramater value
+MavenImpl_error_read_config=Could not read Maven configuration
+MavenImpl_error_read_lastUpdated=Could not read artifact lastUpdated status
+MavenImpl_error_read_pom=Could not read pom.xml
+MavenImpl_error_read_project=Could not read maven project
+MavenImpl_error_read_settings=Could not read settings.xml
+MavenImpl_error_read_settings2=Can not read settings file {0}
+MavenImpl_error_resolve=Could not resolve artifact
+MavenImpl_error_sort=unable to sort projects
+MavenImpl_error_write_lastUpdated=Could not write artifact lastUpdated status
+MavenImpl_error_write_pom=Could not write pom.xml
+MavenImpl_error_write_settings=Could not write settings.xml
+MavenImportWizard_job=Importing Maven projects
+MavenImportWizard_title=Import Maven projects
+MavenImportWizardPage_desc=Select Maven projects
+MavenImportWizardPage_inherited=[inherited]
+MavenImportWizardPage_title=Maven Projects
+MavenInstallationsPreferencePage_btnAdd=&Add...
+MavenInstallationsPreferencePage_btnEdit=&Edit...
+MavenInstallationsPreferencePage_btnGlobalBrowse=&Browse...
+MavenInstallationsPreferencePage_btnRemove=&Remove
+MavenInstallationsPreferencePage_dialog_install_message=Select Maven installation directory
+MavenInstallationsPreferencePage_dialog_install_title=Maven Installation
+MavenInstallationsPreferencePage_dialog_message=Select Maven installation directory
+MavenInstallationsPreferencePage_dialog_title=Maven Installation
+MavenInstallationsPreferencePage_error_global_missing=Global settings file doesn't exist
+MavenInstallationsPreferencePage_error_global_parse=Unable to parse global settings file;
+MavenInstallationsPreferencePage_error_message=Select the directory where Maven is installed.
+MavenInstallationsPreferencePage_error_title=Maven Install
+MavenInstallationsPreferencePage_error2_message=The selected directory is not a valid Maven directory.
+MavenInstallationsPreferencePage_error3_message=The selected Maven install is already registered.
+MavenInstallationsPreferencePage_error4_message=Selected Maven install is already registered
+MavenInstallationsPreferencePage_job_updating=Updating Maven installation settings
+MavenInstallationsPreferencePage_lblNote1=Note: Embedded runtime is always used for dependency resolution, but
+MavenInstallationsPreferencePage_lblNote2=does not use global settings when it is used to launch Maven. To learn more, visit the <a href="http://maven.apache.org/">maven</a> web page.
+MavenInstallationsPreferencePage_link=Select the installation used to launch maven:
+MavenInstallationsPreferencePage_link_global=Open editor for global settings
+MavenInstallationsPreferencePage_link_open=\ (<a href="\#">open file</a>):
+MavenInstallationsPreferencePage_settings=Global settings
+MavenInstallationsPreferencePage_settings_install=Global settings from installation directory
+MavenInstallationsPreferencePage_title=Maven Installations
+MavenInstallFileArtifactWizardPage_btnChecksum=Create C&hecksum
+MavenInstallFileArtifactWizardPage_btnFilename=&Browse...
+MavenInstallFileArtifactWizardPage_btnGenerate=Gen&erate POM
+MavenInstallFileArtifactWizardPage_btnPom=B&rowse...
+MavenInstallFileArtifactWizardPage_desc=Install file in local repository
+MavenInstallFileArtifactWizardPage_error_artifactid=Artifact Id must be specified
+MavenInstallFileArtifactWizardPage_error_groupid=Group Id must be specified
+MavenInstallFileArtifactWizardPage_error_missing=Artifact file does not exist
+MavenInstallFileArtifactWizardPage_error_missingpom=POM file does not exist
+MavenInstallFileArtifactWizardPage_error_no_name=Artifact file name must be specified
+MavenInstallFileArtifactWizardPage_error_packaging=Packaging must be specified
+MavenInstallFileArtifactWizardPage_error_version=Version must be specified
+MavenInstallFileArtifactWizardPage_file_title=Select file
+MavenInstallFileArtifactWizardPage_lblArtifact=&Artifact Id:
+MavenInstallFileArtifactWizardPage_lblClassifier=&Classifier:
+MavenInstallFileArtifactWizardPage_lblFileName=Artifact &file:
+MavenInstallFileArtifactWizardPage_lblgroupid=&Group Id:
+MavenInstallFileArtifactWizardPage_lblPackaging=&Packaging:
+MavenInstallFileArtifactWizardPage_lblPom=&POM file:
+MavenInstallFileArtifactWizardPage_lblVersion=&Version:
+MavenInstallFileArtifactWizardPage_message=Selected artifact corresponds to {0}
+MavenInstallFileArtifactWizardPage_title=Install file in local repository
+MavenInstallFileWizard_error=Execution error
+MavenInstallFileWizard_job=Installing artifact
+MavenInstallFileWizard_title=Install artifact
+MavenMarkerManager_duplicate_groupid=GroupId is duplicate of parent groupId
+MavenMarkerManager_duplicate_version=Version is duplicate of parent version
+MavenMarkerManager_error_artifact=Artifact error
+MavenMarkerManager_error_missing=Missing artifact {0}
+MavenMarkerManager_error_noschema=There is no schema defined for this pom.xml.
+MavenMarkerManager_error_offline=Offline / {0}
+MavenMarkerManager_managed_title=Overriding managed version {0} for {1}
+MavenMarkerManager_metadata_resolution=Metadata resolution error
+MavenMaterializePomWizard_btnCheckout=&Check out All projects
+MavenMaterializePomWizard_btnDev=Use &Developer connection
+MavenMaterializePomWizard_dialog_message=Select Maven artifacts to import
+MavenMaterializePomWizard_dialog_title=Select Maven artifacts
+MavenMaterializePomWizard_location_message=Select project location and working set
+MavenMaterializePomWizard_location_title=Select project location
+MavenMaterializePomWizard_title=Import Maven Projects
+MavenModelManager_error_cannot_load=Can't load model {0}
+MavenModelManager_error_create=Can't create model {0}; {1}
+MavenModelManager_error_pom_exists=POM {0} already exists
+MavenModelManager_error_read=Project read error
+MavenModelManager_monitor_building=Building dependency tree
+MavenModelManager_monitor_reading=Reading project
+MavenModuleWizardParentPage_error=The parent project must have a packaging type of POM
+MavenPlugin_error_jre_message=The Maven Integration requires that Eclipse be running in a JDK, because a number of Maven core plugins are using jars from the JDK.\n\nPlease make sure the -vm option in <a>eclipse.ini</a> is pointing to a JDK and verify that <a>Installed JREs</a> are also using JDK installs.
+MavenPlugin_error_jre_title=Maven Integration for Eclipse JDK Warning
+MavenPlugin_error_warn_again=Do not warn again
+MavenPomSelectionComponent_btnJavadoc=Include Javadocs
+MavenPomSelectionComponent_btnSource=Include Sources
+MavenPomSelectionComponent_btnTests=Include Tests
+MavenPomSelectionComponent_detail1={0} ({1})
+MavenPomSelectionComponent_details2={0}, size: {1} b
+MavenPomSelectionComponent_error=Search error: {0}
+MavenPomSelectionComponent_lblResults=&Search Results:
+MavenPomSelectionComponent_managed_decoration=\ \ (managed)
+MavenPomSelectionComponent_nosel=No selection
+MavenPomSelectionComponent_results=Results for ''{0}'' ({1})
+MavenPomSelectionComponent_search_title=&Enter groupId, artifactId or sha1 prefix or pattern (*):
+MavenPomSelectionComponent_searching=Searching ''{0}''...
+MavenPomSelectionComponent_searchJob=Repository search
+MavenPomSelectionComponent_selected=Selected {0}
+MavenPomSelectionComponent_toomany=Too many results to display. Enter a more specific search term.
+MavenPomSelectionComponent_tooshort=Query ''{0}'' is too short
+MavenPomWizard_error_exists=POM already exists
+MavenPomWizard_error_title=Error
+MavenPomWizard_status_not_exists=Folder "{0}" does not exist.
+MavenPomWizard_task=Creating POM
+MavenPomWizard_title=Maven POM wizard
+MavenPomWizardPage_btnBrowse=Browse...
+MavenPomWizardPage_desc=This wizard creates a new POM (pom.xml) descriptor for Maven2.
+MavenPomWizardPage_dialog_title=Select project
+MavenPomWizardPage_error_artid=Artifact Id must be specified
+MavenPomWizardPage_error_folder=Project or folder must be specified
+MavenPomWizardPage_error_folder_write=Folder must be writable
+MavenPomWizardPage_error_folder2=Folder must exist
+MavenPomWizardPage_error_grid=Group Id must be specified
+MavenPomWizardPage_error_pack=Packaging must be specified
+MavenPomWizardPage_error_version=Version must be specified
+MavenPomWizardPage_lblProject=&Project:
+MavenPomWizardPage_title=Maven2 POM
+MavenPreferencePage_download=Download repository index updates on startup
+MavenPreferencePage_hide=Hide folders of physically nested modules (experimental)
+MavenPreferencePage_select=&Select...
+MavenPreferencePage_select2=S&elect...
+MavenPreferencePage_update=Update Maven projects on startup
+MavenProjectCheckoutJob_confirm_message=No Maven projects found, but there is Eclipse projects configuration avaialble.\nDo you want to select and import Eclipse projects?
+MavenProjectCheckoutJob_confirm_title=Project Import
+MavenProjectCheckoutJob_confirm2_message=No Maven projects found. Do you want to create project using new project wizard?\nCheck out location will be copied into clipboard.
+MavenProjectCheckoutJob_confirm2_title=Project Import
+MavenProjectCheckoutJob_job=Importing Maven projects
+MavenProjectCheckoutJob_title=Checking out Maven projects
+MavenProjectFacade_error=Could not read maven project
+MavenProjectLifecycleMappingPage_error_no_page=No lifecycle mapping property page found.
+MavenProjectLifecycleMappingPage_error_no_strategy=No lifecycle mapping strategy found.
+MavenProjectLifecycleMappingPage_error_page_error=Unable to load the lifecycle mapping property page.
+MavenProjectPomScanner_23=Reading model {0}:{1}:{2}
+MavenProjectPomScanner_task_resolving=Resolving artifact {0}:{1}:{2}
+MavenProjectPreferencePage_btnResolve=Resolve dependencies from &Workspace projects
+MavenProjectPreferencePage_dialog_message=Maven settings has changed. Do you want to update project configuration?
+MavenProjectPreferencePage_dialog_title=Maven Settings
+MavenProjectPreferencePage_job=Updating {0} Sources
+MavenProjectPreferencePage_lblProfiles=Active Maven &Profiles (comma separated):
+MavenProjectPreferencePage_title=Maven
+MavenProjectWizardArchetypePage_add_title=Add Archetype
+MavenProjectWizardArchetypePage_all=All Catalogs
+MavenProjectWizardArchetypePage_btnAdd=&Add Archetype...
+MavenProjectWizardArchetypePage_btnConfigure=Con&figure...
+MavenProjectWizardArchetypePage_btnLast=&Show the last version of Archetype only
+MavenProjectWizardArchetypePage_btnSnapshots=&Include snapshot archetypes
+MavenProjectWizardArchetypePage_error_no=No archetypes currently available. The archetype list will refresh when the indexes finish updating.
+MavenProjectWizardArchetypePage_error_read=Unable to read catalog factory.
+MavenProjectWizardArchetypePage_error_resolve=The archetype {0} could not be resolved.
+MavenProjectWizardArchetypePage_error_resolve2=Can't resolve Archetype {0}
+MavenProjectWizardArchetypePage_lblCatalog=C&atalog:
+MavenProjectWizardArchetypePage_lblFilter=&Filter:
+MavenProjectWizardArchetypePage_task_downloading=Downloading Archetype
+MavenProjectWizardArchetypePage_task_indexing=indexing...
+MavenProjectWizardArchetypePage_task_reading=reading project...
+MavenProjectWizardArchetypePage_task_resolving=resolving POM...
+MavenProjectWizardArchetypePage_task_resolving2=resolving JAR...
+MavenProjectWizardArchetypeParametersPage_btnAdd=&Add...
+MavenProjectWizardArchetypeParametersPage_btnRemove=&Remove
+MavenProjectWizardArchetypeParametersPage_columnName=Name
+MavenProjectWizardArchetypeParametersPage_columnValue=Value
+MavenProjectWizardArchetypeParametersPage_error_download=Error downloading archetype {0}
+MavenProjectWizardArchetypeParametersPage_error_package=Invalid package name
+MavenProjectWizardArchetypeParametersPage_lblProps=Properties available from archetype:
+MavenProjectWizardArchetypeParametersPage_task=Downloading Archetype {0}
+MavenProjectWizardArtifactPage_searchDialog_title=Select Parent Artifact
+MavenProjectWizardLocationPage_btnLocation=Brows&e...
+MavenProjectWizardLocationPage_btnUserDefault=Use default &Workspace location
+MavenProjectWizardLocationPage_dialog_location=Select Location
+MavenProjectWizardLocationPage_lblLocation=&Location:
+MavenRepositorySearchDialog_7=compile
+MavenRepositorySearchDialog_lblScope=Scope:
+MavenRepositoryView_action_copy=Copy URL
+MavenRepositoryView_action_copy_tooltip=Copy URL to Clipboard
+MavenRepositoryView_action_disable_tooltip=Disable repository index
+MavenRepositoryView_action_enable_tooltip=Enable minimal repository index
+MavenRepositoryView_action_enableFull_tooltip=Enable full repository index
+MavenRepositoryView_action_materialize=Materialize Projects
+MavenRepositoryView_action_open=Open POM
+MavenRepositoryView_action_open_tooltip=Open Maven POM
+MavenRepositoryView_action_rebuild=Rebuild Index
+MavenRepositoryView_action_rebuild_tooltip=Force a rebuild of the maven index
+MavenRepositoryView_action_reload=Reload settings.xml
+MavenRepositoryView_action_update=Update Index
+MavenRepositoryView_btnCollapse=Collapse All
+MavenRepositoryView_btnCollapse_tooltip=Collapse All
+MavenRepositoryView_btnUpdate_tooltip=Update repository index
+MavenRepositoryView_details_disabled=Index Details Disabled
+MavenRepositoryView_disable_details=Disable Index Details
+MavenRepositoryView_enable_full=Enable Full Index
+MavenRepositoryView_enable_minimum=Enable Minimum Index
+MavenRepositoryView_enabled_full=Full Index Enabled
+MavenRepositoryView_error_message=Unable to set the index details due to the following error:\n
+MavenRepositoryView_error_title=Error Setting Index Details
+MavenRepositoryView_job_reloading=Reloading settings.xml
+MavenRepositoryView_minimum_enabled=Minimum Index Enabled
+MavenRepositoryView_rebuild_many=Rebuild Indexes
+MavenRepositoryView_rebuild_msg=Are you sure you want to rebuild the index ''{0}''
+MavenRepositoryView_rebuild_msg2=Are you sure you want to rebuild the selected indexes?
+MavenRepositoryView_rebuild_one=Rebuild Index
+MavenRepositoryView_rebuild_title=Rebuild Index
+MavenRepositoryView_rebuild_title2=Rebuild Indexes
+MavenRepositoryView_reload_msg=This will reload the settings.xml and rebuild the indexes for the repositories. Are you sure you want to reload the settings?
+MavenRepositoryView_reload_title=Reload settings.xml
+MavenRepositoryView_update_more=Update Indexes
+MavenRepositoryView_update_one=Update Index
+MavenSearchPage_btnBrowse=Browse...
+MavenSearchPage_btnSelect=Select All
+MavenSearchPage_btnUnselect=Deselect All
+MavenSearchPage_lblArtifactid=Artifact Id:
+MavenSearchPage_lblClass=Class Name:
+MavenSearchPage_lblGroupid=Group Id:
+MavenSearchPage_lblPackaging=Packaging:
+MavenSearchPage_lblRepos=Repositories:
+MavenSearchPage_lblSha=SHA1:
+MavenSearchPage_lblVersion=Version:
+MavenSearchPage_separator=Label
+MavenSettingsPreferencePage_btnBrowse=&Browse...
+MavenSettingsPreferencePage_btnUpdate=Update Settings
+MavenSettingsPreferencePage_error_missing=User settings file doesn't exist
+MavenSettingsPreferencePage_error_parse=Unable to parse user settings file; {0}
+MavenSettingsPreferencePage_job_indexing=Indexing Local Repository...
+MavenSettingsPreferencePage_job_updating=Updating Maven settings
+MavenSettingsPreferencePage_lblLocal=Local Repository (From merged user and global settings):
+MavenSettingsPreferencePage_link_tooltip=Open editor for user settings
+MavenSettingsPreferencePage_link1=User &Settings:
+MavenSettingsPreferencePage_link2=User &Settings (<a href="\#">open file</a>):
+MavenSettingsPreferencePage_task_updating=Updating progress for {0}
+MavenSettingsPreferencePage_title=Maven User Settings
+MissingLifecycleMapping_name=Unknown or missing lifecycle mapping
+MissingLifecycleMappingPropertyPage_error=Unknown or missing lifecycle mapping with id=`{0}'. \nCheck the spelling and/or install required Eclipse plugins.
+MissingLifecycleMappingPropertyPage_title=Missing lifecycle mapping
+NexusIndexManager_78=nexus-indexer
+NexusIndexManager_error_add_repo=Could not add repository index
+NexusIndexManager_error_read_index=Could not read index details file
+NexusIndexManager_error_reindexing=Reindexing error
+NexusIndexManager_error_root_grp=Can't get root groups for {0}
+NexusIndexManager_error_search=Search error
+NexusIndexManager_error_unexpected=Unexpected exception
+NexusIndexManager_error_write_index=Could not write index details file
+NexusIndexManager_inherited=[inherited]
+NexusIndexManager_task_updating=Updating index {0}
+OpenPomAction_33=Can't open editor for {0}\n{1}
+OpenPomAction_error_download=Can't download {0}
+OpenPomAction_error_download_source=Can't download sources for {0}
+OpenPomAction_error_open_editor=Can't open editor for {0}
+OpenPomAction_error_open_pom=Can't open pom file for {0}
+OpenPomAction_job_opening=Opening POM
+OpenPomAction_open_error_message=Unable to read Maven project
+OpenPomAction_open_error_title=Open POM
+OpenPomAction_open_title=Open Maven POM
+OpenPomAction_title_pom=Search Maven POM
+OpenUrlAction_browser_title=Open Browser
+OpenUrlAction_error_no_ci=Project does't specify Continuous Integration URL
+OpenUrlAction_error_no_issues=Project does't specify issue management URL
+OpenUrlAction_error_no_scm=Project does't specify SCM URL
+OpenUrlAction_error_no_url=Project does't specify project URL
+OpenUrlAction_error_open=Can't download {0} POM
+OpenUrlAction_job_browser=Opening Browser
+OpenUrlAction_open_url_message=Unable to read Maven project
+OpenUrlAction_open_url_title=Open URL
+PomFileContentDescriber_error=Internal Error: XML parser configuration error during content description for Maven POM files
+ProjectConfigurationManager_0=Can't get canonical file for {0}
+ProjectConfigurationManager_error_failed=Failed to create project.
+ProjectConfigurationManager_error_rename=Can't rename {0}
+ProjectConfigurationManager_error_resolve=Could not resolve archetype
+ProjectConfigurationManager_error_resolve2=\ from any of the configured repositories.
+ProjectConfigurationManager_error_targetDir=\ Target directory {0} already exists.
+ProjectConfigurationManager_error_unable_archetype=Unable to create project from archetype {0}
+ProjectConfigurationManager_task_configuring=Configuring Maven projects
+ProjectConfigurationManager_task_creating=Creating project {0}
+ProjectConfigurationManager_task_creating_folders=Creating project folders...
+ProjectConfigurationManager_task_creating_pom=Creating the POM file...
+ProjectConfigurationManager_task_creating_project=Configuring project...
+ProjectConfigurationManager_task_creating_project1=Creating project {0}
+ProjectConfigurationManager_task_creating_workspace=Creating workspace project...
+ProjectConfigurationManager_task_disable_nature=Disable Maven nature
+ProjectConfigurationManager_task_enable_nature=Enable Maven nature
+ProjectConfigurationManager_task_executing_archetype=Executing Archetype {0}:{1}
+ProjectConfigurationManager_task_importing=Importing Maven projects
+ProjectConfigurationManager_task_importing2=Importing project {0}
+ProjectConfigurationManager_task_refreshing=Refreshing projects
+ProjectConfigurationManager_task_updating=Updating configuration for {0}
+ProjectConfiguratorsTable_column_id=Id
+ProjectConfiguratorsTable_column_name=Name
+ProjectConfiguratorsTableContentProvider_no_configs=No Project Configurators
+ProjectRegistryManager_task_project=project {0}
+ProjectRegistryManager_task_refreshing=Refreshing projects
+ProjectRegistryRefreshJob_task_refreshing=Refreshing Maven model
+ProjectRegistryRefreshJob_title=Updating Maven Dependencies
+ProjectRepositoriesNode_name=Project Repositories
+ProjectsImportPage_btnDeselect=&Deselect All
+ProjectsImportPage_btnRefresh=R&efresh
+ProjectsImportPage_btnSelect=&Select All
+ProjectsImportPage_desc=Select non-Maven projects to import
+ProjectsImportPage_dialog_title=Question
+ProjectsImportPage_error_creation=Creation Problems
+ProjectsImportPage_lstProjects=&Projects:
+ProjectsImportPage_message=Some projects were hidden because they exist in the workspace directory
+ProjectsImportPage_overwrite=''{0}'' already exists. Would you like to overwrite it?
+ProjectsImportPage_overwrite2=Overwrite ''{0}'' in folder ''{1}''?
+ProjectsImportPage_task_checking=Checking: {0}
+ProjectsImportPage_task_creating=Creating Projects
+ProjectsImportPage_task_processing=Processing results
+ProjectsImportPage_task_search=Searching for projects
+ProjectsImportPage_title=Import Projects
+ProjectsImportWizard_title=Import
+RemoteArchetypeCatalogDialog_btnVerify=&Verify...
+RemoteArchetypeCatalogDialog_error_empty=Remote catalog is empty
+RemoteArchetypeCatalogDialog_error_read=Unable to read remote catalog;\n{0}
+RemoteArchetypeCatalogDialog_error_required=Archetype catalog url is required
+RemoteArchetypeCatalogDialog_job_download=Downloading remote catalog
+RemoteArchetypeCatalogDialog_lblCatalog=&Catalog File:
+RemoteArchetypeCatalogDialog_lblDesc=Description:
+RemoteArchetypeCatalogDialog_message=Specify catalog url and description
+RemoteArchetypeCatalogDialog_message_found=Found {0} archetype(s)
+RemoteArchetypeCatalogDialog_title=Remote Archetype Catalog
+RepositoryNode_updating=\ [updating]
+RepositoryRegistryUpdateJob_title=Repository registry initialization
+ScmUrl_error=Invalid SCM url {0}
+SelectionUtil_error_cannot_read=Can't read Maven project
+UpdateSourcesAction_error_cannot_update=Unable to update Maven configuration
+UpdateSourcesAction_error_message=Unable to update maven configuration for the following projects:
+UpdateSourcesAction_error_title=Error Updating Maven Configuration
+UpdateSourcesAction_job_update_conf=Updating Maven Configuration
+WorkingSetGroup_btnAddSet=&Add project(s) to working set
+WorkingSetGroup_btnMore=Mor&e...
+WorkingSetGroup_lblSet=Wo&rking set:
+WorkspaceRepositoryNode_name=Workspace Projects
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceConstants.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceConstants.java
new file mode 100644
index 00000000..46dfeae0
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceConstants.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.preferences;
+
+
+/**
+ * Maven preferences constants
+ */
+public interface MavenPreferenceConstants {
+
+ static final String PREFIX = "eclipse.m2."; //$NON-NLS-1$
+
+ /** String */
+ // public static final String P_LOCAL_REPOSITORY_DIR = PREFIX+"localRepositoryDirectory";
+
+ /** true or false */
+ // public static final String P_CHECK_LATEST_PLUGIN_VERSION = PREFIX+"checkLatestPluginVersion";
+
+ /** String ??? */
+ // public static final String P_GLOBAL_CHECKSUM_POLICY = PREFIX+"globalChecksumPolicy";
+
+ /** boolean */
+ public static final String P_OFFLINE = PREFIX + "offline"; //$NON-NLS-1$
+
+ /** boolean */
+ // public static final String P_UPDATE_SNAPSHOTS = PREFIX+"updateSnapshots";
+
+ /** boolean */
+ public static final String P_DEBUG_OUTPUT = PREFIX + "debugOutput"; //$NON-NLS-1$
+
+ /** boolean */
+ public static final String P_DOWNLOAD_SOURCES = PREFIX + "downloadSources"; //$NON-NLS-1$
+
+ /** boolean */
+ public static final String P_DOWNLOAD_JAVADOC = PREFIX + "downloadJavadoc"; //$NON-NLS-1$
+
+ /** String */
+ public static final String P_GLOBAL_SETTINGS_FILE = PREFIX + "globalSettingsFile"; //$NON-NLS-1$
+
+ /** String */
+ public static final String P_USER_SETTINGS_FILE = PREFIX + "userSettingsFile"; //$NON-NLS-1$
+
+ /** String */
+ public static final String P_OUTPUT_FOLDER = PREFIX + "outputFolder"; //$NON-NLS-1$
+
+ /** boolean */
+ public static final String P_DISABLE_JDK_WARNING = PREFIX + "disableJdkwarning"; //$NON-NLS-1$
+
+ /** boolean */
+ public static final String P_DISABLE_JDK_CHECK = PREFIX + "disableJdkCheck"; //$NON-NLS-1$
+
+ /** String */
+ public static final String P_RUNTIMES = PREFIX + "runtimes"; //$NON-NLS-1$
+
+ /** String */
+ public static final String P_DEFAULT_RUNTIME = PREFIX + "defaultRuntime"; //$NON-NLS-1$
+
+ /** boolean */
+ public static final String P_UPDATE_INDEXES = PREFIX + "updateIndexes"; //$NON-NLS-1$
+
+ /** boolean */
+ public static final String P_UPDATE_PROJECTS = PREFIX + "updateProjects"; //$NON-NLS-1$
+
+ /** String */
+ public static final String P_JIRA_USERNAME = PREFIX + "jiraUsername"; //$NON-NLS-1$
+
+ /** String */
+ public static final String P_JIRA_PASSWORD = PREFIX + "jiraPassword"; //$NON-NLS-1$
+
+ /** boolean */
+ public static final String P_HIDE_FOLDERS_OF_NESTED_PROJECTS = PREFIX + "hideFoldersOfNestedProjects"; //$NON-NLS-1$
+
+ public static final String P_SHOW_CONSOLE_ON_ERR = PREFIX+"showConsoleOnErr"; //$NON-NLS-1$
+
+ public static final String P_SHOW_CONSOLE_ON_OUTPUT = PREFIX+"showConsoleOnOutput"; //$NON-NLS-1$
+
+ /** boolean */
+ public static final String P_FULL_INDEX= PREFIX+"fullIndex"; //$NON-NLS-1$
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceInitializer.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceInitializer.java
new file mode 100644
index 00000000..b9ade3d4
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/preferences/MavenPreferenceInitializer.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+import org.apache.maven.cli.MavenCli;
+
+import org.eclipse.m2e.core.MavenPlugin;
+
+
+/**
+ * Maven preferences initializer.
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenPreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = MavenPlugin.getDefault().getPreferenceStore();
+
+ store.setDefault(MavenPreferenceConstants.P_USER_SETTINGS_FILE, //
+ MavenCli.DEFAULT_USER_SETTINGS_FILE.getAbsolutePath());
+
+ store.setDefault(MavenPreferenceConstants.P_GLOBAL_SETTINGS_FILE, ""); //$NON-NLS-1$
+
+ store.setDefault(MavenPreferenceConstants.P_DEBUG_OUTPUT, false);
+
+ store.setDefault(MavenPreferenceConstants.P_OFFLINE, false);
+
+ store.setDefault(MavenPreferenceConstants.P_DOWNLOAD_SOURCES, false);
+ store.setDefault(MavenPreferenceConstants.P_DOWNLOAD_JAVADOC, false);
+
+ // store.setDefault( MavenPreferenceConstants.P_GLOBAL_CHECKSUM_POLICY, ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN);
+ // store.setDefault( MavenPreferenceConstants.P_UPDATE_SNAPSHOTS, false);
+ // store.setDefault( MavenPreferenceConstants.P_CHECK_LATEST_PLUGIN_VERSION, false);
+
+ store.setDefault(MavenPreferenceConstants.P_OUTPUT_FOLDER, "target-eclipse"); //$NON-NLS-1$
+
+ store.setDefault(MavenPreferenceConstants.P_RUNTIMES, ""); //$NON-NLS-1$
+ store.setDefault(MavenPreferenceConstants.P_DEFAULT_RUNTIME, ""); //$NON-NLS-1$
+
+ store.setDefault(MavenPreferenceConstants.P_UPDATE_INDEXES, true);
+ store.setDefault(MavenPreferenceConstants.P_UPDATE_PROJECTS, false);
+
+ store.setDefault(MavenPreferenceConstants.P_HIDE_FOLDERS_OF_NESTED_PROJECTS, false);
+
+ store.setDefault(MavenPreferenceConstants.P_SHOW_CONSOLE_ON_ERR, true);
+ store.setDefault(MavenPreferenceConstants.P_SHOW_CONSOLE_ON_OUTPUT, false);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ArtifactKeyAdapterFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ArtifactKeyAdapterFactory.java
new file mode 100644
index 00000000..aff02f61
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ArtifactKeyAdapterFactory.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+
+
+/**
+ * Adapter factory for ArtifactKey
+ *
+ * @author Igor Fedorenko
+ */
+@SuppressWarnings("unchecked")
+public class ArtifactKeyAdapterFactory implements IAdapterFactory {
+
+ private static final Class[] ADAPTER_LIST = new Class[] {ArtifactKey.class,};
+
+ public Object getAdapter(Object adaptable, Class adapterType) {
+ if(!ArtifactKey.class.equals(adapterType)) {
+ return null;
+ }
+
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ if(adaptable instanceof IProject) {
+ IProject project = (IProject) adaptable;
+ IMavenProjectFacade facade = projectManager.create(project, new NullProgressMonitor());
+ if(facade != null) {
+ return facade.getArtifactKey();
+ }
+ } else if(adaptable instanceof IFile) {
+ IFile file = (IFile) adaptable;
+ if(IMavenConstants.POM_FILE_NAME.equals(file.getName())) {
+ IMavenProjectFacade facade = projectManager.create(file, true, new NullProgressMonitor());
+ if(facade != null) {
+ return facade.getArtifactKey();
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public Class[] getAdapterList() {
+ // target type
+ return ADAPTER_LIST;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/DependencyResolutionContext.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/DependencyResolutionContext.java
new file mode 100644
index 00000000..71031ae3
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/DependencyResolutionContext.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+
+import org.apache.maven.execution.MavenExecutionRequest;
+
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+
+/**
+ * @author igor
+ */
+public class DependencyResolutionContext {
+
+ /** Original update request */
+ private final MavenUpdateRequest request;
+
+ /** Set of all pom files to resolve */
+ private final Set<IFile> pomFiles = new LinkedHashSet<IFile>();
+
+ /** Set of pom files to resolve regardless of their isStale() state */
+ private final Set<IFile> forcedPomFiles = new HashSet<IFile>();
+
+ /** The template request for invocations of Maven */
+ private MavenExecutionRequest executionRequest;
+
+ public DependencyResolutionContext(MavenUpdateRequest request, MavenExecutionRequest executionRequest) {
+ this.request = request;
+ this.pomFiles.addAll(request.getPomFiles());
+ this.executionRequest = executionRequest;
+ }
+
+ public boolean isEmpty() {
+ return pomFiles.isEmpty();
+ }
+
+ public void forcePomFiles(Set<IFile> pomFiles) {
+ this.pomFiles.addAll(pomFiles);
+ this.forcedPomFiles.addAll(pomFiles);
+ }
+
+ public MavenUpdateRequest getRequest() {
+ return request;
+ }
+
+ public MavenExecutionRequest getExecutionRequest() {
+ return executionRequest;
+ }
+
+ public boolean isForce(IFile pom) {
+ return request.isForce() || forcedPomFiles.contains(pom);
+ }
+
+ public IFile pop() {
+ Iterator<IFile> i = pomFiles.iterator();
+ IFile pom = i.next();
+ i.remove();
+ return pom;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/EclipseMavenMetadataCache.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/EclipseMavenMetadataCache.java
new file mode 100644
index 00000000..292a9137
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/EclipseMavenMetadataCache.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map.Entry;
+
+import org.eclipse.core.resources.IFile;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.metadata.ResolutionGroup;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.project.artifact.DefaultMavenMetadataCache;
+import org.apache.maven.project.artifact.MavenMetadataCache;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+
+
+/**
+ * EclipseMavenMetadataCache
+ *
+ * @author igor
+ */
+public class EclipseMavenMetadataCache extends DefaultMavenMetadataCache implements MavenMetadataCache, IManagedCache {
+
+ public void put(Artifact artifact, boolean resolveManagedVersions, ArtifactRepository localRepository,
+ List<ArtifactRepository> remoteRepositories, ResolutionGroup result) {
+
+ ArtifactKey gav = new ArtifactKey(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), null);
+
+ if ("pom".equals(artifact.getType()) ) { //$NON-NLS-1$
+ // new project pom, remove any existing project entries
+ removeProject(gav);
+ }
+
+ super.put(artifact, resolveManagedVersions, localRepository, remoteRepositories, result);
+ }
+
+ public void removeProject(IFile pom, ArtifactKey key) {
+ removeProject(key);
+ }
+
+ private void removeProject(ArtifactKey key) {
+ if(key == null) {
+ return;
+ }
+
+ Iterator<Entry<CacheKey, CacheRecord>> iter = cache.entrySet().iterator();
+
+ while(iter.hasNext()) {
+ Entry<CacheKey, CacheRecord> entry = iter.next();
+ CacheRecord record = entry.getValue();
+
+ if(equals(record.getArtifact(), key) || contains(record.getArtifacts(), key)) {
+ iter.remove();
+ }
+ }
+ }
+
+ private boolean contains(List<Artifact> artifacts, ArtifactKey key) {
+ for(Artifact artifact : artifacts) {
+ if(equals(artifact, key)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean equals(Artifact artifact, ArtifactKey key) {
+ /*
+ * maybe too conservative, but purge anything that matches GAbV (bV==baseVersion)
+ */
+ return eq(key.getGroupId(), artifact.getGroupId()) //
+ && eq(key.getArtifactId(), artifact.getArtifactId()) //
+ && eq(key.getVersion(), artifact.getBaseVersion());
+ }
+
+ private static <T> boolean eq(T a, T b) {
+ return a != null ? a.equals(b) : b == null;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/IManagedCache.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/IManagedCache.java
new file mode 100644
index 00000000..6eb2d41c
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/IManagedCache.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project;
+
+import org.eclipse.core.resources.IFile;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+
+/**
+ * IManagedCache
+ *
+ * @author igor
+ */
+public interface IManagedCache {
+
+ /**
+ * @param pom
+ * @param mavenProject
+ */
+ void removeProject(IFile pom, ArtifactKey mavenProject);
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/IgnoreMojoProjectConfiguration.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/IgnoreMojoProjectConfiguration.java
new file mode 100644
index 00000000..b8090934
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/IgnoreMojoProjectConfiguration.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
+
+
+/**
+ * IgnoreMojoProjectConfiguration
+ *
+ * @author igor
+ */
+public class IgnoreMojoProjectConfiguration extends AbstractProjectConfigurator {
+
+ public IgnoreMojoProjectConfiguration() {
+ }
+
+ public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) {
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MavenMarkerManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MavenMarkerManager.java
new file mode 100644
index 00000000..cc1c98a7
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MavenMarkerManager.java
@@ -0,0 +1,713 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.w3c.dom.Comment;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.xml.core.internal.parser.regions.TagNameRegion;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.resolver.AbstractArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.execution.MavenExecutionResult;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.DependencyManagement;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.PluginManagement;
+import org.apache.maven.model.building.ModelBuildingException;
+import org.apache.maven.model.building.ModelProblem;
+import org.apache.maven.model.building.ModelProblem.Severity;
+import org.apache.maven.project.DependencyResolutionResult;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuildingException;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.project.IMavenMarkerManager;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+
+@SuppressWarnings("restriction")
+public class MavenMarkerManager implements IMavenMarkerManager {
+ private static final String XSI_SCHEMA_LOCATION = "xsi:schemaLocation"; //$NON-NLS-1$
+
+ private static final String PROJECT_NODE = "project"; //$NON-NLS-1$
+ public static final String OFFSET = "offset"; //$NON-NLS-1$
+
+ private final MavenConsole console;
+ private final IMavenConfiguration mavenConfiguration;
+
+ public MavenMarkerManager(MavenConsole console, IMavenConfiguration mavenConfiguration) {
+ this.console = console;
+ this.mavenConfiguration = mavenConfiguration;
+ }
+
+ public void addMarkers(IResource pomFile, String type, MavenExecutionResult result) {
+ List<Throwable> exceptions = result.getExceptions();
+
+ for(Throwable ex : exceptions) {
+ if(ex instanceof ProjectBuildingException) {
+ handleProjectBuildingException(pomFile, type, (ProjectBuildingException) ex);
+ } else if(ex instanceof AbstractArtifactResolutionException) {
+ AbstractArtifactResolutionException rex = (AbstractArtifactResolutionException) ex;
+ String errorMessage = getArtifactId(rex) + " " + getErrorMessage(ex); //$NON-NLS-1$
+ addMarker(pomFile, type, errorMessage, 1, IMarker.SEVERITY_ERROR);
+ } else {
+ handleBuildException(pomFile, type, ex);
+ }
+ }
+
+ DependencyResolutionResult resolutionResult = result.getDependencyResolutionResult();
+ if(resolutionResult != null) {
+ // @see also addMissingArtifactMarkers
+ addErrorMarkers(pomFile, type, org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_metadata_resolution,
+ resolutionResult.getCollectionErrors());
+ for(org.sonatype.aether.graph.Dependency dependency : resolutionResult.getUnresolvedDependencies()) {
+ addErrorMarkers(pomFile, type, org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_error_artifact,
+ resolutionResult.getResolutionErrors(dependency));
+ }
+ }
+
+ MavenProject mavenProject = result.getProject();
+ if (mavenProject != null) {
+ addMissingArtifactMarkers(pomFile, type, mavenProject);
+ }
+ }
+
+ public void addEditorHintMarkers(IResource pomFile, String type) {
+ checkForSchema(pomFile, type);
+ //mkleint: adding here but I'm sort of not entirely clear what the usage patter of this class is.
+ checkVarious(pomFile, type);
+ }
+
+ /**
+ * @param pomFile
+ */
+ private void checkVarious(IResource pomFile, String type) {
+ IDOMModel domModel = null;
+ try {
+ if(!(pomFile instanceof IFile)) {
+ return;
+ }
+ domModel = (IDOMModel) StructuredModelManager.getModelManager().getModelForRead((IFile) pomFile);
+ IStructuredDocument document = domModel.getStructuredDocument();
+ Element root = domModel.getDocument().getDocumentElement();
+
+ if(root.getNodeName().equals("project")) { //$NON-NLS-1$
+ //now check parent version and groupid against the current project's ones..
+ checkParentMatchingGroupIdVersion(root, pomFile, type, document);
+ checkManagedDependencies(root, pomFile, type, document);
+ checkManagedPlugins(root, pomFile, type, document);
+ }
+ } catch(Exception t) {
+ MavenLogger.log("Error checking for warnings", t); //$NON-NLS-1$
+ } finally {
+ if(domModel != null) {
+ domModel.releaseFromRead();
+ }
+ }
+ }
+
+ private void checkManagedDependencies(Element root, IResource pomFile, String type, IStructuredDocument document)
+ throws CoreException {
+ IProject prj = pomFile.getProject();
+ //the project returned is in a way unrelated to nested child poms that don't have an opened project,
+ //in that case we pass along a wrong parent/aggregator
+ if (prj == null || pomFile.getProjectRelativePath().segmentCount() != 1) {
+ //if the project were the pom's project, the relative path would be just "pom.xml", if it's not just throw it out of the window..
+ return;
+ }
+ IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectManager().getProject(prj);
+ if (facade == null) {
+ return;
+ }
+ MavenProject mavenproject = facade.getMavenProject();
+ if (mavenproject == null) {
+ //we only work with cached instances here, never loading ourselves..
+ return;
+ }
+ List<Element> candidates = new ArrayList<Element>();
+
+ Element dependencies = findChildElement(root, "dependencies"); //$NON-NLS-1$
+ if (dependencies != null) {
+ for (Element el : findChildElements(dependencies, "dependency")) { //$NON-NLS-1$
+ Element version = findChildElement(el, "version"); //$NON-NLS-1$
+ if (version != null) {
+ candidates.add(el);
+ }
+ }
+ }
+ //we should also consider <dependencies> section in the profiles, but profile are optional and so is their
+ // dependencyManagement section.. that makes handling our markers more complex.
+ // see MavenProject.getInjectedProfileIds() for a list of currently active profiles in effective pom
+ String currentProjectKey = mavenproject.getGroupId() + ":" + mavenproject.getArtifactId() + ":" + mavenproject.getVersion(); //$NON-NLS-1$ //$NON-NLS-2$
+ List<String> activeprofiles = mavenproject.getInjectedProfileIds().get(currentProjectKey);
+ //remember what profile we found the dependency in.
+ Map<Element, String> candidateProfile = new HashMap<Element, String>();
+ Element profiles = findChildElement(root, "profiles"); //$NON-NLS-1$
+ if (profiles != null) {
+ for (Element profile : findChildElements(profiles, "profile")) { //$NON-NLS-1$
+ String idString = getElementTextValue(findChildElement(profile, "id")); //$NON-NLS-1$
+ if (idString != null && activeprofiles.contains(idString)) {
+ dependencies = findChildElement(profile, "dependencies"); //$NON-NLS-1$
+ if (dependencies != null) {
+ for (Element el : findChildElements(dependencies, "dependency")) { //$NON-NLS-1$
+ Element version = findChildElement(el, "version"); //$NON-NLS-1$
+ if (version != null) {
+ candidates.add(el);
+ candidateProfile.put(el, idString);
+ }
+ }
+ }
+ }
+ }
+ }
+ //collect the managed dep ids
+ Map<String, String> managed = new HashMap<String, String>();
+ DependencyManagement dm = mavenproject.getDependencyManagement();
+ if (dm != null) {
+ List<Dependency> deps = dm.getDependencies();
+ if (deps != null) {
+ for (Dependency dep : deps) {
+ //shall we be using geManagementkey() here? but it contains also the type, not only the gr+art ids..
+ managed.put(dep.getGroupId() + ":" + dep.getArtifactId(), dep.getVersion()); //$NON-NLS-1$
+ }
+ }
+ }
+
+ //now we have all the candidates, match them against the effective managed set
+ for(Element dep : candidates) {
+ Element version = findChildElement(dep, "version"); //$NON-NLS-1$
+ String grpString = getElementTextValue(findChildElement(dep, "groupId")); //$NON-NLS-1$
+ String artString = getElementTextValue(findChildElement(dep, "artifactId")); //$NON-NLS-1$
+ String versionString = getElementTextValue(version);
+ if(grpString != null && artString != null && versionString != null) {
+ String id = grpString + ":" + artString; //$NON-NLS-1$
+ if(managed.containsKey(id)) {
+ String managedVersion = managed.get(id);
+ if(version instanceof IndexedRegion) {
+ IndexedRegion off = (IndexedRegion) version;
+ if(lookForIgnoreMarker(document, version, off, IMavenConstants.MARKER_IGNORE_MANAGED)) {
+ continue;
+ }
+
+ IMarker mark = addMarker(pomFile, type, NLS.bind(
+ org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_managed_title, managedVersion, artString),
+ document.getLineOfOffset(off.getStartOffset()) + 1, IMarker.SEVERITY_WARNING, false /*isTransient*/);
+ mark.setAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT,
+ IMavenConstants.EDITOR_HINT_MANAGED_DEPENDENCY_OVERRIDE);
+ mark.setAttribute(IMarker.CHAR_START, off.getStartOffset());
+ mark.setAttribute(IMarker.CHAR_END, off.getEndOffset());
+ mark.setAttribute("problemType", "pomhint"); //only imporant in case we enable the generic xml quick fixes //$NON-NLS-1$ //$NON-NLS-2$
+ //add these attributes to easily and deterministicaly find the declaration in question
+ mark.setAttribute("groupId", grpString); //$NON-NLS-1$
+ mark.setAttribute("artifactId", artString); //$NON-NLS-1$
+ String profile = candidateProfile.get(dep);
+ if(profile != null) {
+ mark.setAttribute("profile", profile); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+ }
+ }
+
+ static boolean lookForIgnoreMarker(IStructuredDocument document, Element version, IndexedRegion off, String ignoreString) {
+ Node reg = version;
+ int line = document.getLineOfOffset(off.getStartOffset());
+ try {
+ int lineend = document.getLineOffset(line) + document.getLineLength(line) - 1;
+ int start = off.getStartOffset();
+ while (reg != null && start < lineend) {
+ reg = reg.getNextSibling();
+ if (reg != null && reg instanceof Comment) {
+ Comment comm = (Comment)reg;
+ String data =comm.getData();
+ if (data != null && data.contains(ignoreString)) {
+ return true;
+ }
+ }
+ if (reg != null) {
+ start = ((IndexedRegion)reg).getStartOffset();
+ }
+ }
+ } catch(BadLocationException ex) {
+ //not possible IMHO we ask for line offset of line we know is in the document.
+ }
+ return false;
+ }
+
+ private void checkManagedPlugins(Element root, IResource pomFile, String type, IStructuredDocument document)
+ throws CoreException {
+ IProject prj = pomFile.getProject();
+ //the project returned is in a way unrelated to nested child poms that don't have an opened project,
+ //in that case we pass along a wrong parent/aggregator
+ if (prj == null || pomFile.getProjectRelativePath().segmentCount() != 1) {
+ //if the project were the pom's project, the relative path would be just "pom.xml", if it's not just throw it out of the window..
+ return;
+ }
+ IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectManager().getProject(prj);
+ if (facade == null) {
+ return;
+ }
+ MavenProject mavenproject = facade.getMavenProject();
+ if (mavenproject == null) {
+ //we only work with cached instances here, never loading ourselves..
+ return;
+ }
+ List<Element> candidates = new ArrayList<Element>();
+ Element build = findChildElement(root, "build"); //$NON-NLS-1$
+ if (build == null) {
+ return;
+ }
+ Element plugins = findChildElement(build, "plugins"); //$NON-NLS-1$
+ if (plugins != null) {
+ for (Element el : findChildElements(plugins, "plugin")) { //$NON-NLS-1$
+ Element version = findChildElement(el, "version"); //$NON-NLS-1$
+ if (version != null) {
+ candidates.add(el);
+ }
+ }
+ }
+ //we should also consider <plugins> section in the profiles, but profile are optional and so is their
+ // pluginManagement section.. that makes handling our markers more complex.
+ // see MavenProject.getInjectedProfileIds() for a list of currently active profiles in effective pom
+ String currentProjectKey = mavenproject.getGroupId() + ":" + mavenproject.getArtifactId() + ":" + mavenproject.getVersion(); //$NON-NLS-1$ //$NON-NLS-2$
+ List<String> activeprofiles = mavenproject.getInjectedProfileIds().get(currentProjectKey);
+ //remember what profile we found the dependency in.
+ Map<Element, String> candidateProfile = new HashMap<Element, String>();
+ Element profiles = findChildElement(root, "profiles"); //$NON-NLS-1$
+ if (profiles != null) {
+ for (Element profile : findChildElements(profiles, "profile")) { //$NON-NLS-1$
+ String idString = getElementTextValue(findChildElement(profile, "id")); //$NON-NLS-1$
+ if (idString != null && activeprofiles.contains(idString)) {
+ build = findChildElement(profile, "build"); //$NON-NLS-1$
+ if (build == null) {
+ continue;
+ }
+ plugins = findChildElement(build, "plugins"); //$NON-NLS-1$
+ if (plugins != null) {
+ for (Element el : findChildElements(plugins, "plugin")) { //$NON-NLS-1$
+ Element version = findChildElement(el, "version"); //$NON-NLS-1$
+ if (version != null) {
+ candidates.add(el);
+ candidateProfile.put(el, idString);
+ }
+ }
+ }
+ }
+ }
+ }
+ //collect the managed plugin ids
+ Map<String, String> managed = new HashMap<String, String>();
+ PluginManagement pm = mavenproject.getPluginManagement();
+ if (pm != null) {
+ List<Plugin> plgs = pm.getPlugins();
+ if (plgs != null) {
+ for (Plugin plg : plgs) {
+ managed.put(plg.getKey(), plg.getVersion());
+ }
+ }
+ }
+
+ //now we have all the candidates, match them against the effective managed set
+ for(Element dep : candidates) {
+ String grpString = getElementTextValue(findChildElement(dep, "groupId")); //$NON-NLS-1$
+ if (grpString == null) {
+ grpString = "org.apache.maven.plugins"; //$NON-NLS-1$
+ }
+ String artString = getElementTextValue(findChildElement(dep, "artifactId")); //$NON-NLS-1$
+ Element version = findChildElement(dep, "version"); //$NON-NLS-1$
+ String versionString = getElementTextValue(version);
+ if(grpString != null && artString != null && versionString != null) {
+ String id = Plugin.constructKey(grpString, artString);
+ if(managed.containsKey(id)) {
+ String managedVersion = managed.get(id);
+ if(version instanceof IndexedRegion) {
+ IndexedRegion off = (IndexedRegion) version;
+ if(lookForIgnoreMarker(document, version, off, IMavenConstants.MARKER_IGNORE_MANAGED)) {
+ continue;
+ }
+
+ IMarker mark = addMarker(pomFile, type, NLS.bind(
+ org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_managed_title, managedVersion, artString),
+ document.getLineOfOffset(off.getStartOffset()) + 1, IMarker.SEVERITY_WARNING, false /*isTransient*/);
+ mark.setAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT,
+ IMavenConstants.EDITOR_HINT_MANAGED_PLUGIN_OVERRIDE);
+ mark.setAttribute(IMarker.CHAR_START, off.getStartOffset());
+ mark.setAttribute(IMarker.CHAR_END, off.getEndOffset());
+ mark.setAttribute("problemType", "pomhint"); //only imporant in case we enable the generic xml quick fixes //$NON-NLS-1$ //$NON-NLS-2$
+ //add these attributes to easily and deterministicaly find the declaration in question
+ mark.setAttribute("groupId", grpString); //$NON-NLS-1$
+ mark.setAttribute("artifactId", artString); //$NON-NLS-1$
+ String profile = candidateProfile.get(dep);
+ if(profile != null) {
+ mark.setAttribute("profile", profile); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void checkParentMatchingGroupIdVersion(Element root, IResource pomFile, String type,
+ IStructuredDocument document) throws CoreException {
+ Element parent = findChildElement(root, "parent"); //$NON-NLS-1$
+ Element groupId = findChildElement(root, "groupId"); //$NON-NLS-1$
+ if(parent != null && groupId != null) {
+ //now compare the values of parent and project groupid..
+ String parentString = getElementTextValue(findChildElement(parent, "groupId")); //$NON-NLS-1$
+ String childString = getElementTextValue(groupId);
+ if(parentString != null && parentString.equals(childString)) {
+ //now figure out the offset
+ if(groupId instanceof IndexedRegion) {
+ IndexedRegion off = (IndexedRegion) groupId;
+ IMarker mark = addMarker(pomFile, type,
+ org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_duplicate_groupid,
+ document.getLineOfOffset(off.getStartOffset()) + 1, IMarker.SEVERITY_WARNING, false /*isTransient*/);
+ mark.setAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, IMavenConstants.EDITOR_HINT_PARENT_GROUP_ID);
+ mark.setAttribute(IMarker.CHAR_START, off.getStartOffset());
+ mark.setAttribute(IMarker.CHAR_END, off.getEndOffset());
+ mark.setAttribute("problemType", "pomhint"); //only important in case we enable the generic xml quick fixes //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+ Element version = findChildElement(root, "version"); //$NON-NLS-1$
+ if(parent != null && version != null) {
+ //now compare the values of parent and project version..
+ String parentString = getElementTextValue(findChildElement(parent, "version")); //$NON-NLS-1$
+ String childString = getElementTextValue(version);
+ if(parentString != null && parentString.equals(childString)) {
+ //now figure out the offset
+ if(version instanceof IndexedRegion) {
+ IndexedRegion off = (IndexedRegion) version;
+ IMarker mark = addMarker(pomFile, type,
+ org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_duplicate_version,
+ document.getLineOfOffset(off.getStartOffset()) + 1, IMarker.SEVERITY_WARNING, false);
+ mark.setAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, IMavenConstants.EDITOR_HINT_PARENT_VERSION);
+ mark.setAttribute(IMarker.CHAR_START, off.getStartOffset());
+ mark.setAttribute(IMarker.CHAR_END, off.getEndOffset());
+ mark.setAttribute("problemType", "pomhint"); //only important in case we enable the generic xml quick fixes //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+ }
+
+ public static Element findChildElement(Element parent, String name) {
+ NodeList rootList = parent.getChildNodes();
+ for (int i = 0; i < rootList.getLength(); i++) {
+ Node nd = rootList.item(i);
+ if (nd instanceof Element) {
+ Element el = (Element)nd;
+ if (name.equals(el.getNodeName())) {
+ return el;
+ }
+ }
+ }
+ return null;
+ }
+ public static List<Element> findChildElements(Element parent, String name) {
+ NodeList rootList = parent.getChildNodes();
+ List<Element> toRet = new ArrayList<Element>();
+ for (int i = 0; i < rootList.getLength(); i++) {
+ Node nd = rootList.item(i);
+ if (nd instanceof Element) {
+ Element el = (Element)nd;
+ if (name.equals(el.getNodeName())) {
+ toRet.add(el);
+ }
+ }
+ }
+ return toRet;
+ }
+
+ /**
+ * gets the element text value, accepts null as parameter
+ * @param element
+ * @return
+ */
+ public static String getElementTextValue(Node element) {
+ if (element == null) return null;
+ StringBuffer buff = new StringBuffer();
+ NodeList list = element.getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node child = list.item(i);
+ if (child instanceof Text) {
+ Text text = (Text)child;
+ buff.append(text.getData());
+ }
+ }
+ return buff.toString();
+ }
+
+ /**
+ * The xsi:schema info is not part of the model, it is stored in the xml only. Need to open the DOM
+ * and look for the project node to see if it has this schema defined
+ * @param pomFile
+ */
+ protected void checkForSchema(IResource pomFile, String type) {
+ IDOMModel domModel = null;
+ try{
+ if(!(pomFile instanceof IFile)){
+ return;
+ }
+ domModel = (IDOMModel)StructuredModelManager.getModelManager().getModelForRead((IFile)pomFile);
+ IStructuredDocument document = domModel.getStructuredDocument();
+
+ // iterate through document regions
+ documentLoop:for(IStructuredDocumentRegion documentRegion : document.getStructuredDocumentRegions()) {
+ // only check tag regions
+ if (DOMRegionContext.XML_TAG_NAME.equals(documentRegion.getType())){
+ for(ITextRegion textRegion: documentRegion.getRegions().toArray()){
+ // find a project tag
+ if(textRegion instanceof TagNameRegion && PROJECT_NODE.equals(documentRegion.getText(textRegion))){
+ // check if schema is missing
+ if (documentRegion.getText().lastIndexOf(XSI_SCHEMA_LOCATION) == -1) {
+ int offset = documentRegion.getStartOffset();
+ int lineNumber = document.getLineOfOffset(offset) + 1;
+ IMarker marker = addMarker(pomFile, type,
+ org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_error_noschema, lineNumber,
+ IMarker.SEVERITY_WARNING, false /*isTransient*/);
+ //the quick fix in the marker view needs to know the offset, since it doesn't have access to the
+ //editor/source viewer
+ if(marker != null){
+ marker.setAttribute(OFFSET, offset);
+ marker.setAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT,
+ IMavenConstants.EDITOR_HINT_MISSING_SCHEMA);
+ marker.setAttribute(IMarker.CHAR_START, documentRegion.getStartOffset());
+ marker.setAttribute(IMarker.CHAR_END, documentRegion.getEndOffset());
+ marker.setAttribute("problemType", "pomhint"); //only imporant in case we enable the generic xml quick fixes //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ // there could only be one project tag
+ break documentLoop;
+ }
+ }
+ }
+ }
+ } catch(Exception ex) {
+ MavenLogger.log("Error checking for schema", ex); //$NON-NLS-1$
+ }
+ finally {
+ if ( domModel != null ) {
+ domModel.releaseFromRead();
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.core.project.IMavenMarkerManager#addMarker(org.eclipse.core.resources.IResource, java.lang.String, int, int)
+ */
+ //just here to satisfy the IMavenMarkerManager contract.
+ public IMarker addMarker(IResource resource, String type, String message, int lineNumber, int severity) {
+ return addMarker(resource, type, message, lineNumber, severity, false /*isTransient*/);
+ }
+
+ private IMarker addMarker(IResource resource, String type, String message, int lineNumber, int severity, boolean isTransient) {
+ IMarker marker = null;
+ try {
+ if(resource.isAccessible()) {
+ marker = findMarker(resource, type, message, lineNumber, severity, isTransient);
+ if(marker != null) {
+ // This marker already exists
+ return marker;
+ }
+ marker= resource.createMarker(type);
+ marker.setAttribute(IMarker.MESSAGE, message);
+ marker.setAttribute(IMarker.SEVERITY, severity);
+ marker.setAttribute(IMarker.TRANSIENT, isTransient);
+
+ if(lineNumber == -1) {
+ lineNumber = 1;
+ }
+ marker.setAttribute(IMarker.LINE_NUMBER, lineNumber);
+ }
+ } catch(CoreException ex) {
+ console.logError("Unable to add marker; " + ex.toString()); //$NON-NLS-1$
+ }
+ return marker;
+ }
+
+ private static <T> boolean eq(T a, T b) {
+ if(a == null) {
+ if(b == null) {
+ return true;
+ }
+ return false;
+ }
+ return a.equals(b);
+ }
+
+ private IMarker findMarker(IResource resource, String type, String message, int lineNumber, int severity,
+ boolean isTransient) throws CoreException {
+ IMarker[] markers = resource.findMarkers(type, false /*includeSubtypes*/, IResource.DEPTH_ZERO);
+ if(markers == null || markers.length == 0) {
+ return null;
+ }
+ for(IMarker marker : markers) {
+ if(eq(message, marker.getAttribute(IMarker.MESSAGE)) && eq(lineNumber, marker.getAttribute(IMarker.LINE_NUMBER))
+ && eq(severity, marker.getAttribute(IMarker.SEVERITY))
+ && eq(isTransient, marker.getAttribute(IMarker.TRANSIENT))) {
+ return marker;
+ }
+ }
+ return null;
+ }
+
+ private void handleProjectBuildingException(IResource pomFile, String type, ProjectBuildingException ex) {
+ Throwable cause = ex.getCause();
+ if(cause instanceof ModelBuildingException) {
+ ModelBuildingException mbe = (ModelBuildingException) cause;
+ for (ModelProblem problem : mbe.getProblems()) {
+ String msg = Messages.getString("plugin.markerBuildError", problem.getMessage()); //$NON-NLS-1$
+// console.logError(msg);
+ int severity = (Severity.WARNING == problem.getSeverity())? IMarker.SEVERITY_WARNING: IMarker.SEVERITY_ERROR;
+ addMarker(pomFile, type, msg, 1, severity);
+ }
+ } else {
+ handleBuildException(pomFile, type, ex);
+ }
+ }
+
+ private void handleBuildException(IResource pomFile, String type, Throwable ex) {
+ Throwable cause = getRootCause(ex);
+ // String msg = Messages.getString("plugin.markerBuildError", cause.getMessage()); //$NON-NLS-1$
+ String msg = cause.getMessage();
+ addMarker(pomFile, type, msg, 1, IMarker.SEVERITY_ERROR);
+// console.logError(msg);
+ }
+
+ private String getArtifactId(AbstractArtifactResolutionException rex) {
+ String id = rex.getGroupId() + ":" + rex.getArtifactId() + ":" + rex.getVersion(); //$NON-NLS-1$ //$NON-NLS-2$
+ if(rex.getClassifier() != null) {
+ id += ":" + rex.getClassifier(); //$NON-NLS-1$
+ }
+ if(rex.getType() != null) {
+ id += ":" + rex.getType(); //$NON-NLS-1$
+ }
+ return id;
+ }
+
+ private String getErrorMessage(Throwable ex) {
+ return getRootCause(ex).getMessage();
+ }
+
+ private Throwable getRootCause(Throwable ex) {
+ Throwable lastCause = ex;
+ Throwable cause = lastCause.getCause();
+ while(cause != null && cause != lastCause) {
+ if(cause instanceof ArtifactNotFoundException) {
+ cause = null;
+ } else {
+ lastCause = cause;
+ cause = cause.getCause();
+ }
+ }
+ return cause == null ? lastCause : cause;
+ }
+
+
+ private void addErrorMarkers(IResource pomFile, String type, String msg, List<? extends Exception> exceptions) {
+ if(exceptions != null) {
+ for(Exception ex : exceptions) {
+ if(ex instanceof org.sonatype.aether.transfer.ArtifactNotFoundException) {
+ // ignored here, handled by addMissingArtifactMarkers
+ } else if(ex instanceof AbstractArtifactResolutionException) {
+ AbstractArtifactResolutionException rex = (AbstractArtifactResolutionException) ex;
+ String errorMessage = getArtifactId(rex) + " " + getErrorMessage(ex); //$NON-NLS-1$
+ addMarker(pomFile, type, errorMessage, 1, IMarker.SEVERITY_ERROR);
+// console.logError(errorMessage);
+
+ } else {
+ addMarker(pomFile, type, ex.getMessage(), 1, IMarker.SEVERITY_ERROR);
+// console.logError(msg + "; " + ex.toString());
+ }
+ }
+ }
+ }
+
+ public void deleteMarkers(IResource resource, String type) throws CoreException {
+ if (resource != null && resource.exists()) {
+ resource.deleteMarkers(type, true, IResource.DEPTH_INFINITE);
+ }
+ }
+
+ private void addMissingArtifactMarkers(IResource pomFile, String type, MavenProject mavenProject) {
+// Set<Artifact> directDependencies = mavenProject.getDependencyArtifacts();
+ Set<Artifact> artifacts = mavenProject.getArtifacts();
+ for(Artifact artifact : artifacts) {
+ if (!artifact.isResolved()) {
+ String errorMessage;
+// if (directDependencies.contains(artifact)) {
+ errorMessage = NLS.bind(org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_error_missing, artifact.toString());
+// } else {
+// errorMessage = "Missing indirectly referenced artifact " + artifact.toString();
+// }
+
+ if(mavenConfiguration.isOffline()) {
+ errorMessage = NLS.bind(org.eclipse.m2e.core.internal.Messages.MavenMarkerManager_error_offline, errorMessage);
+ }
+
+ addMarker(pomFile, type, errorMessage, 1, IMarker.SEVERITY_ERROR);
+ console.logError(errorMessage);
+ }
+ }
+ }
+
+ public void addErrorMarkers(IResource resource, String type, Exception ex) {
+ Throwable cause = getRootCause(ex);
+ if(cause instanceof CoreException) {
+ CoreException cex = (CoreException) cause;
+ IStatus status = cex.getStatus();
+ if(status != null) {
+ addMarker(resource, type, status.getMessage(), 1, IMarker.SEVERITY_ERROR, false /*isTransient*/); //$NON-NLS-1$
+ IStatus[] children = status.getChildren();
+ if(children != null) {
+ for(IStatus childStatus : children) {
+ addMarker(resource, type, childStatus.getMessage(), 1, IMarker.SEVERITY_ERROR, false /*isTransient*/); //$NON-NLS-1$
+ }
+ }
+ }
+ } else {
+ addMarker(resource, type, cause.getMessage(), 1, IMarker.SEVERITY_ERROR, false /*isTransient*/); //$NON-NLS-1$
+ }
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MavenProjectImportResult.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MavenProjectImportResult.java
new file mode 100644
index 00000000..68d6a628
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MavenProjectImportResult.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project;
+
+import org.eclipse.core.resources.IProject;
+
+import org.eclipse.m2e.core.project.IMavenProjectImportResult;
+import org.eclipse.m2e.core.project.MavenProjectInfo;
+
+public class MavenProjectImportResult implements IMavenProjectImportResult {
+
+ private final IProject project;
+ private final MavenProjectInfo projectInfo;
+
+ public MavenProjectImportResult(MavenProjectInfo projectInfo, IProject project) {
+ this.projectInfo = projectInfo;
+ this.project = project;
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public MavenProjectInfo getMavenProjectInfo() {
+ return projectInfo;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MissingLifecycleMapping.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MissingLifecycleMapping.java
new file mode 100644
index 00000000..cff8e77a
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MissingLifecycleMapping.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.plugin.MojoExecution;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.configurator.AbstractBuildParticipant;
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
+
+
+/**
+ * MissingLifecycleMapping
+ *
+ * @author igor
+ */
+public class MissingLifecycleMapping implements ILifecycleMapping {
+
+ /**
+ * Lifecycle mapping id. Must match id of properties page defined in plugin.xml
+ */
+ public static final String ID = "MISSING"; //$NON-NLS-1$
+
+ private final String missingMappingId;
+
+ public MissingLifecycleMapping(String mappingId) {
+ this.missingMappingId = mappingId;
+ }
+
+ public String getId() {
+ return ID;
+ }
+
+ public String getName() {
+ return Messages.MissingLifecycleMapping_name;
+ }
+
+ public List<String> getPotentialMojoExecutionsForBuildKind(IMavenProjectFacade projectFacade, int kind,
+ IProgressMonitor progressMonitor) {
+ return Collections.emptyList();
+ }
+
+ public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) {
+ }
+
+ public void unconfigure(ProjectConfigurationRequest request, IProgressMonitor monitor) {
+ }
+
+ public List<AbstractBuildParticipant> getBuildParticipants(IMavenProjectFacade facade, IProgressMonitor monitor) {
+ return Collections.emptyList();
+ }
+
+ public List<AbstractProjectConfigurator> getProjectConfigurators(IMavenProjectFacade facade, IProgressMonitor monitor) {
+ return Collections.emptyList();
+ }
+
+ public String getMissingMappingId() {
+ return missingMappingId;
+ }
+
+ public List<MojoExecution> getNotCoveredMojoExecutions(IMavenProjectFacade mavenProjectFacade,
+ IProgressMonitor monitor) throws CoreException {
+ return Collections.emptyList();
+ }
+
+ public boolean isInterestingPhase(String phase) {
+ return false;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MojoExecutionProjectConfigurator.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MojoExecutionProjectConfigurator.java
new file mode 100644
index 00000000..b71b4108
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MojoExecutionProjectConfigurator.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.plugin.MojoExecution;
+
+import org.eclipse.m2e.core.project.configurator.AbstractBuildParticipant;
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+import org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant;
+import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
+
+
+/**
+ * MojoExecutionProjectConfigurator
+ *
+ * @author igor
+ */
+public class MojoExecutionProjectConfigurator extends AbstractProjectConfigurator {
+
+ private final boolean runOnIncremental;
+
+ public MojoExecutionProjectConfigurator(boolean runOnIncremental) {
+ this.runOnIncremental = runOnIncremental;
+ }
+
+ protected MojoExecutionProjectConfigurator(String groupId, String artifactId, String versionRange, String goals,
+ boolean runOnIncremental) {
+ this.runOnIncremental = runOnIncremental;
+
+ addPluginExecutionFilter(groupId, artifactId, versionRange, goals);
+ }
+
+ public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) {
+ // do nothing
+ }
+
+ public AbstractBuildParticipant getBuildParticipant(MojoExecution execution) {
+ return new MojoExecutionBuildParticipant(execution, runOnIncremental);
+ }
+
+ public static MojoExecutionProjectConfigurator fromString(String str, boolean runOnIncremental) {
+ if(str == null || str.trim().length() <= 0) {
+ return null;
+ }
+
+ int p, c;
+
+ p = 0;
+ c = nextColonIndex(str, p);
+ String groupId = substring(str, p, c);
+
+ p = c + 1;
+ c = nextColonIndex(str, p);
+ String artifactId = substring(str, p, c);
+
+ p = c + 1;
+ c = nextColonIndex(str, p);
+ String versionRange = substring(str, p, c);
+
+ p = c + 1;
+ String goals = substring(str, p, str.length());
+
+ return new MojoExecutionProjectConfigurator(groupId, artifactId, versionRange, goals, runOnIncremental);
+ }
+
+ private static String substring(String str, int start, int end) {
+ String substring = str.substring(start, end);
+ return "".equals(substring) ? null : substring; //$NON-NLS-1$
+ }
+
+ private static int nextColonIndex(String str, int pos) {
+ int idx = str.indexOf(':', pos);
+ if(idx < 0) {
+ throw new IllegalArgumentException("Invalid mojo execution template: " + str);
+ }
+ return idx;
+ }
+
+ public String getName() {
+ return "execute";
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MojoExecutionUtils.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MojoExecutionUtils.java
new file mode 100644
index 00000000..d6a5bda5
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/MojoExecutionUtils.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project;
+
+import org.apache.maven.plugin.MojoExecution;
+
+/**
+ * MavenExecutionUtils
+ *
+ * @author mpoindexter
+ */
+public class MojoExecutionUtils {
+ public static String getExecutionKey(MojoExecution execution) {
+ return nvl(execution.getGroupId()) + ":" + nvl(execution.getArtifactId()) + ":" + nvl(execution.getVersion()) + ":" + nvl(execution.getGoal()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ private static String nvl(String s) {
+ return s == null ? "" : s; //$NON-NLS-1$
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
new file mode 100644
index 00000000..1c48f23b
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java
@@ -0,0 +1,716 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Version;
+
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IWorkingSet;
+
+import org.codehaus.plexus.util.StringUtils;
+
+import org.apache.maven.archetype.ArchetypeGenerationRequest;
+import org.apache.maven.archetype.ArchetypeGenerationResult;
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.model.Model;
+import org.apache.maven.plugin.MojoExecution;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory;
+import org.eclipse.m2e.core.archetype.ArchetypeManager;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.embedder.MavenModelManager;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.IMavenMarkerManager;
+import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.IMavenProjectImportResult;
+import org.eclipse.m2e.core.project.IProjectConfigurationManager;
+import org.eclipse.m2e.core.project.LocalProjectScanner;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+import org.eclipse.m2e.core.project.MavenProjectInfo;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
+import org.eclipse.m2e.core.util.Util;
+
+/**
+ * import Maven projects
+ * update project configuration from Maven
+ * enable Maven nature
+ * create new project
+ *
+ * @author igor
+ */
+public class ProjectConfigurationManager implements IProjectConfigurationManager, IMavenProjectChangedListener {
+
+ final MavenConsole console;
+
+ final MavenProjectManager projectManager;
+
+ final MavenModelManager mavenModelManager;
+
+ final IMavenMarkerManager mavenMarkerManager;
+
+ final IMaven maven;
+
+ final IMavenConfiguration mavenConfiguration;
+
+ public ProjectConfigurationManager(IMaven maven, MavenConsole console, MavenProjectManager projectManager,
+ MavenModelManager mavenModelManager, IMavenMarkerManager mavenMarkerManager, IMavenConfiguration mavenConfiguration) {
+ this.console = console;
+ this.projectManager = projectManager;
+ this.mavenModelManager = mavenModelManager;
+ this.mavenMarkerManager = mavenMarkerManager;
+ this.maven = maven;
+ this.mavenConfiguration = mavenConfiguration;
+ }
+
+ public List<IMavenProjectImportResult> importProjects(Collection<MavenProjectInfo> projectInfos, ProjectImportConfiguration configuration, IProgressMonitor monitor) throws CoreException {
+ long t1 = System.currentTimeMillis();
+
+ SubMonitor progress = SubMonitor.convert(monitor, Messages.ProjectConfigurationManager_task_importing, 100);
+
+ ArrayList<IMavenProjectImportResult> result = new ArrayList<IMavenProjectImportResult>();
+ ArrayList<IProject> projects = new ArrayList<IProject>();
+
+ SubMonitor subProgress =
+ SubMonitor.convert( progress.newChild( 10 ), projectInfos.size() * 100 );
+
+ // first, create all projects with basic configuration
+ for(MavenProjectInfo projectInfo : projectInfos) {
+ if(monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+
+ IProject project = create(projectInfo, configuration, subProgress.newChild(100));
+
+ result.add(new MavenProjectImportResult(projectInfo, project));
+
+ if (project != null) {
+ projects.add(project);
+
+ addToWorkingSets(project, configuration.getWorkingSets());
+ }
+ }
+
+ hideNestedProjectsFromParents(projects);
+ // then configure maven for all projects
+ configureNewMavenProject(projects, progress.newChild(90));
+
+ long t2 = System.currentTimeMillis();
+ console.logMessage("Project import completed " + ((t2 - t1) / 1000) + " sec");
+
+ return result;
+ }
+
+
+ private void setHidden(IResource resource) {
+ // Invoke IResource.setHidden() through reflection since it is only avaiable in Eclispe 3.4 & later
+ try {
+ Method m = IResource.class.getMethod("setHidden", boolean.class); //$NON-NLS-1$
+ m.invoke(resource, Boolean.TRUE);
+ } catch (Exception ex) {
+ MavenLogger.log("Failed to hide resource; " + resource.getLocation().toOSString(), ex);
+ }
+ }
+
+ private void hideNestedProjectsFromParents(List<IProject> projects) {
+
+ if (!MavenPlugin.getDefault().getMavenConfiguration().isHideFoldersOfNestedProjects()) {
+ return;
+ }
+ // Prevent child project folders from showing up in parent project folders.
+
+ Bundle bundle = ResourcesPlugin.getPlugin().getBundle();
+ String version = (String) bundle.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
+ Version currentVersion = org.osgi.framework.Version.parseVersion(version);
+ Version e34Version = new Version(3,4,0);
+ if (currentVersion.compareTo(e34Version) < 0) {
+ return; // IResource.setHidden doesn't exist in Eclipse prior to version 3.4
+ }
+ HashMap<File, IProject> projectFileMap = new HashMap<File, IProject>();
+
+ for (IProject project: projects) {
+ projectFileMap.put(project.getLocation().toFile(), project);
+ }
+ for (IProject project: projects) {
+ File projectFile = project.getLocation().toFile();
+ IProject physicalParentProject = projectFileMap.get(projectFile.getParentFile());
+ if (physicalParentProject == null) {
+ continue;
+ }
+ IFolder folder = physicalParentProject.getFolder(projectFile.getName());
+ if (folder.exists()) {
+ setHidden(folder);
+ }
+ }
+ }
+
+ private void configureNewMavenProject(List<IProject> projects, IProgressMonitor monitor)
+ throws CoreException {
+ SubMonitor progress = SubMonitor.convert(monitor, Messages.ProjectConfigurationManager_task_configuring, 100);
+
+ //SubProgressMonitor sub = new SubProgressMonitor(monitor, projects.size()+1);
+
+ // first, resolve maven dependencies for all projects
+ MavenUpdateRequest updateRequest = new MavenUpdateRequest(mavenConfiguration.isOffline(), false);
+ for(IProject project : projects) {
+ updateRequest.addPomFile(project);
+ }
+ progress.subTask(Messages.ProjectConfigurationManager_task_refreshing);
+ projectManager.refresh(updateRequest, progress.newChild(75));
+
+ // TODO this emits project change events, which may be premature at this point
+
+ //Creating maven facades
+ SubMonitor subProgress = SubMonitor.convert(progress.newChild(5), projects.size() * 100);
+ List<IMavenProjectFacade> facades = new ArrayList<IMavenProjectFacade>(projects.size());
+ for(IProject project : projects) {
+ if(progress.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+ IMavenProjectFacade facade = projectManager.create(project, subProgress.newChild(100));
+ if (facade != null) {
+ facades.add(facade);
+ }
+ }
+
+ //MNGECLIPSE-1028 : Sort projects by build order here,
+ //as dependent projects need to be configured before depending projects (in WTP integration for ex.)
+ sortProjects(facades, progress.newChild(5));
+ //Then, perform detailed project configuration
+ subProgress = SubMonitor.convert(progress.newChild(15), facades.size() * 100);
+ for(IMavenProjectFacade facade : facades) {
+ if(progress.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+ progress.subTask(NLS.bind(Messages.ProjectConfigurationManager_task_updating, facade.getProject().getName()));
+ MavenProject mavenProject = facade.getMavenProject(subProgress.newChild(5));
+ MavenSession mavenSession = createMavenSession(facade, subProgress.newChild(5));
+ ProjectConfigurationRequest request = new ProjectConfigurationRequest(facade, mavenProject, mavenSession, false /*updateSources*/);
+ updateProjectConfiguration(request, subProgress.newChild(90));
+ }
+ }
+
+ private MavenSession createMavenSession(IMavenProjectFacade facade, IProgressMonitor monitor) throws CoreException {
+ MavenExecutionRequest request = projectManager.createExecutionRequest(facade.getPom(), facade.getResolverConfiguration(), monitor);
+ return maven.createSession(request, facade.getMavenProject(monitor));
+ }
+
+ public void sortProjects(List<IMavenProjectFacade> facades, IProgressMonitor monitor) throws CoreException {
+ HashMap<MavenProject, IMavenProjectFacade> mavenProjectToFacadeMap = new HashMap<MavenProject, IMavenProjectFacade>(facades.size());
+ for(IMavenProjectFacade facade:facades) {
+ mavenProjectToFacadeMap.put(facade.getMavenProject(monitor), facade);
+ }
+ facades.clear();
+ for(MavenProject mavenProject: maven.getSortedProjects(new ArrayList<MavenProject>(mavenProjectToFacadeMap.keySet()))) {
+ facades.add(mavenProjectToFacadeMap.get(mavenProject));
+ }
+ }
+
+ // PlatformUI.getWorkbench().getWorkingSetManager().addToWorkingSets(project, new IWorkingSet[] {workingSet});
+ private void addToWorkingSets(IProject project, IWorkingSet[] workingSets) {
+ if (workingSets != null && workingSets.length > 0) {
+ // IAdaptable[] elements = workingSet.adaptElements(new IAdaptable[] {project});
+ // if(elements.length == 1) {
+ for (IWorkingSet workingSet : workingSets) {
+ IAdaptable[] oldElements = workingSet.getElements();
+ IAdaptable[] newElements = new IAdaptable[oldElements.length + 1];
+ System.arraycopy(oldElements, 0, newElements, 0, oldElements.length);
+ newElements[oldElements.length] = project;
+
+ // Eclipse 3.2 compatibility
+ workingSet.setElements(Util.proxy(workingSet, A.class).adaptElements(newElements));
+ // }
+ }
+ }
+ }
+
+ /**
+ * A compatibility proxy stub
+ */
+ private static interface A {
+ public IAdaptable[] adaptElements(IAdaptable[] objects);
+ }
+
+ public void updateProjectConfiguration(IProject project, ResolverConfiguration configuration, IProgressMonitor monitor) throws CoreException {
+ IFile pom = project.getFile(IMavenConstants.POM_FILE_NAME);
+ if (pom.isAccessible()) {
+ projectManager.refresh(new MavenUpdateRequest(project, mavenConfiguration.isOffline(), false), monitor);
+ IMavenProjectFacade facade = projectManager.create(pom, false, monitor);
+ if (facade != null) { // facade is null if pom.xml cannot be read
+ ProjectConfigurationRequest request = new ProjectConfigurationRequest(facade, facade.getMavenProject(monitor), createMavenSession(facade, monitor), true /*updateSources*/);
+ updateProjectConfiguration(request, monitor);
+ }
+ }
+ }
+
+ private void updateProjectConfiguration(ProjectConfigurationRequest request,
+ IProgressMonitor monitor) throws CoreException {
+ IProject project = request.getProject();
+ addMavenNature(project, monitor);
+
+ IMavenProjectFacade mavenProjectFacade = request.getMavenProjectFacade();
+ validateProjectConfiguration(mavenProjectFacade, monitor);
+
+ ILifecycleMapping lifecycleMapping = getLifecycleMapping(mavenProjectFacade, monitor);
+ lifecycleMapping.configure(request, monitor);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.core.project.IProjectConfigurationManager#validateProjectConfiguration(org.eclipse.m2e.core.project.IMavenProjectFacade, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public boolean validateProjectConfiguration(IMavenProjectFacade mavenProjectFacade, IProgressMonitor monitor) {
+ try {
+ mavenProjectFacade.setHasValidConfiguration(false);
+ mavenMarkerManager.deleteMarkers(mavenProjectFacade.getPom(), IMavenConstants.MARKER_CONFIGURATION_ID);
+
+ ILifecycleMapping lifecycleMapping = getLifecycleMapping(mavenProjectFacade, monitor);
+ if(lifecycleMapping == null || lifecycleMapping instanceof MissingLifecycleMapping) {
+ String lifecycleId = null;
+ if(lifecycleMapping != null) {
+ lifecycleId = lifecycleMapping.getId();
+ }
+ mavenMarkerManager.addMarker(mavenProjectFacade.getPom(), IMavenConstants.MARKER_CONFIGURATION_ID,
+ NLS.bind(Messages.LifecycleMissing, lifecycleId, mavenProjectFacade.getPackaging()), 1 /*lineNumber*/,
+ IMarker.SEVERITY_ERROR);
+ return false;
+ }
+
+ List<MojoExecution> notCoveredMojoExecutions = lifecycleMapping.getNotCoveredMojoExecutions(mavenProjectFacade,
+ monitor);
+ if(notCoveredMojoExecutions != null && notCoveredMojoExecutions.size() != 0) {
+ for(MojoExecution mojoExecution : notCoveredMojoExecutions) {
+ mavenMarkerManager.addMarker(
+ mavenProjectFacade.getPom(),
+ IMavenConstants.MARKER_CONFIGURATION_ID,
+ NLS.bind(Messages.LifecycleConfigurationMojoExecutionNotCovered, mojoExecution.toString(),
+ mojoExecution.getLifecyclePhase()), 1 /*lineNumber*/, IMarker.SEVERITY_ERROR);
+ }
+ return false;
+ }
+ mavenProjectFacade.setHasValidConfiguration(true);
+ return true;
+ } catch(CoreException e) {
+ mavenMarkerManager.addErrorMarkers(mavenProjectFacade.getPom(), IMavenConstants.MARKER_CONFIGURATION_ID, e);
+ return false;
+ }
+ }
+
+ public void enableMavenNature(IProject project, ResolverConfiguration configuration, IProgressMonitor monitor)
+ throws CoreException {
+ monitor.subTask(Messages.ProjectConfigurationManager_task_enable_nature);
+ enableBasicMavenNature(project, configuration, monitor);
+
+ ArrayList<IProject> projects = new ArrayList<IProject>();
+ projects.add(project);
+ configureNewMavenProject(projects, monitor);
+ }
+
+ private void enableBasicMavenNature(IProject project, ResolverConfiguration configuration, IProgressMonitor monitor)
+ throws CoreException {
+ projectManager.setResolverConfiguration(project, configuration);
+
+ // add maven nature even for projects without valid pom.xml file
+ addMavenNature(project, monitor);
+ }
+
+ private void addMavenNature(IProject project, IProgressMonitor monitor) throws CoreException {
+ if (!project.hasNature(IMavenConstants.NATURE_ID)) {
+ IProjectDescription description = project.getDescription();
+ String[] prevNatures = description.getNatureIds();
+ String[] newNatures = new String[prevNatures.length + 1];
+ System.arraycopy(prevNatures, 0, newNatures, 1, prevNatures.length);
+ newNatures[0] = IMavenConstants.NATURE_ID;
+ description.setNatureIds(newNatures);
+ project.setDescription(description, monitor);
+ }
+ }
+
+ public void disableMavenNature(IProject project, IProgressMonitor monitor) throws CoreException {
+ monitor.subTask(Messages.ProjectConfigurationManager_task_disable_nature);
+
+ IMavenProjectFacade facade = projectManager.create(project, monitor);
+ if(facade!=null) {
+ ILifecycleMapping lifecycleMapping = getLifecycleMapping(facade, monitor);
+ ProjectConfigurationRequest request = new ProjectConfigurationRequest(facade, facade.getMavenProject(monitor), createMavenSession(facade, monitor), false /*updateSources*/);
+ lifecycleMapping.unconfigure(request, monitor);
+ }
+
+ project.deleteMarkers(IMavenConstants.MARKER_ID, true, IResource.DEPTH_INFINITE);
+
+ IProjectDescription description = project.getDescription();
+ ArrayList<String> newNatures = new ArrayList<String>();
+ for(String natureId : description.getNatureIds()) {
+ if(!IMavenConstants.NATURE_ID.equals(natureId)) {
+ newNatures.add(natureId);
+ }
+ }
+ description.setNatureIds(newNatures.toArray(new String[newNatures.size()]));
+ ArrayList<ICommand> newCommands = new ArrayList<ICommand>();
+ for (ICommand command : description.getBuildSpec()) {
+ if (!IMavenConstants.BUILDER_ID.equals(command.getBuilderName())) {
+ newCommands.add(command);
+ }
+ }
+ description.setBuildSpec(newCommands.toArray(new ICommand[newCommands.size()]));
+ project.setDescription(description, null);
+ }
+
+ // project creation
+
+ /**
+ * Creates simple Maven project
+ * <p>
+ * The following steps are executed in the given order:
+ * <ul>
+ * <li>Creates the workspace project</li>
+ * <li>Adds project to working set</li>
+ * <li>Creates the required folders</li>
+ * <li>Creates the POM</li>
+ * <li>Configures project</li>
+ * </ul>
+ * </p>
+ */
+ // XXX should use Maven plugin configurations instead of manually specifying folders
+ public void createSimpleProject(IProject project, IPath location, Model model, String[] directories,
+ ProjectImportConfiguration configuration, IProgressMonitor monitor) throws CoreException {
+ String projectName = project.getName();
+ monitor.beginTask(NLS.bind(Messages.ProjectConfigurationManager_task_creating, projectName), 5);
+
+ monitor.subTask(Messages.ProjectConfigurationManager_task_creating_workspace);
+ IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(projectName);
+ description.setLocation(location);
+ project.create(description, monitor);
+ project.open(monitor);
+ monitor.worked(1);
+
+ addToWorkingSets(project, configuration.getWorkingSets());
+ monitor.worked(1);
+
+ monitor.subTask(Messages.ProjectConfigurationManager_task_creating_pom);
+ IFile pomFile = project.getFile(IMavenConstants.POM_FILE_NAME);
+ mavenModelManager.createMavenModel(pomFile, model);
+ monitor.worked(1);
+
+ monitor.subTask(Messages.ProjectConfigurationManager_task_creating_folders);
+ for(int i = 0; i < directories.length; i++ ) {
+ Util.createFolder(project.getFolder(directories[i]), false);
+ }
+ monitor.worked(1);
+
+ monitor.subTask(Messages.ProjectConfigurationManager_task_creating_project);
+ enableMavenNature(project, configuration.getResolverConfiguration(), monitor);
+ monitor.worked(1);
+ }
+
+ /**
+ * Creates project structure using Archetype and then imports created project
+ */
+ public void createArchetypeProject(IProject project, IPath location, Archetype archetype, String groupId,
+ String artifactId, String version, String javaPackage, Properties properties,
+ ProjectImportConfiguration configuration, IProgressMonitor monitor) throws CoreException {
+ monitor.beginTask(NLS.bind(Messages.ProjectConfigurationManager_task_creating_project1, project.getName()), 2);
+
+ IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+
+ monitor.subTask(NLS.bind(Messages.ProjectConfigurationManager_task_executing_archetype, archetype.getGroupId(), archetype.getArtifactId()));
+ if(location == null) {
+ // if the project should be created in the workspace, figure out the path
+ location = workspaceRoot.getLocation();
+ }
+
+ try {
+
+
+
+ Artifact artifact = resolveArchetype(archetype, monitor);
+
+ ArchetypeGenerationRequest request = new ArchetypeGenerationRequest() //
+ .setTransferListener(maven.createTransferListener(monitor)) //
+ .setArchetypeGroupId(artifact.getGroupId()) //
+ .setArchetypeArtifactId(artifact.getArtifactId()) //
+ .setArchetypeVersion(artifact.getVersion()) //
+ .setArchetypeRepository(archetype.getRepository()) //
+ .setGroupId(groupId) //
+ .setArtifactId(artifactId) //
+ .setVersion(version) //
+ .setPackage(javaPackage) // the model does not have a package field
+ .setLocalRepository(maven.getLocalRepository()) //
+ .setRemoteArtifactRepositories(maven.getArtifactRepositories(true))
+ .setProperties(properties).setOutputDirectory(location.toPortableString());
+
+ MavenSession session = maven.createSession(maven.createExecutionRequest(monitor), null);
+
+ MavenSession oldSession = MavenPlugin.getDefault().setSession(session);
+
+ ArchetypeGenerationResult result;
+ try {
+ result = getArchetyper().generateProjectFromArchetype(request);
+ } finally {
+ MavenPlugin.getDefault().setSession(oldSession);
+ }
+
+ Exception cause = result.getCause();
+ if(cause != null) {
+ String msg = NLS.bind(Messages.ProjectConfigurationManager_error_unable_archetype, archetype.toString());
+ MavenLogger.log(msg, cause);
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg, cause));
+ }
+ monitor.worked(1);
+
+ // XXX Archetyper don't allow to specify project folder
+ String projectFolder = location.append(artifactId).toFile().getAbsolutePath();
+
+ LocalProjectScanner scanner = new LocalProjectScanner(workspaceRoot.getLocation().toFile(), //
+ projectFolder, true, mavenModelManager, console);
+ scanner.run(monitor);
+
+ Set<MavenProjectInfo> projectSet = collectProjects(scanner.getProjects());
+
+ importProjects(projectSet, configuration, monitor);
+
+ monitor.worked(1);
+ } catch (CoreException e) {
+ throw e;
+ } catch (InterruptedException e) {
+ throw new CoreException(Status.CANCEL_STATUS);
+ } catch (Exception ex) {
+ throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.m2e", Messages.ProjectConfigurationManager_error_failed, ex)); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Apparently, Archetype#generateProjectFromArchetype 2.0-alpha-4 does not attempt to resolve archetype
+ * from configured remote repositories. To compensate, we populate local repo with archetype pom/jar.
+ */
+ private Artifact resolveArchetype(Archetype a, IProgressMonitor monitor) throws CoreException {
+ ArrayList<ArtifactRepository> repos = new ArrayList<ArtifactRepository>();
+ repos.addAll(maven.getArtifactRepositories()); // see org.apache.maven.archetype.downloader.DefaultDownloader#download
+
+ //MNGECLIPSE-1399 use archetype repository too, not just the default ones
+ String artifactRemoteRepository = a.getRepository();
+
+ try {
+
+ if (StringUtils.isBlank(artifactRemoteRepository)){
+
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ if (!mavenConfiguration.isOffline()){
+ //Try to find the repository from remote catalog if needed
+ final ArchetypeManager archetypeManager = MavenPlugin.getDefault().getArchetypeManager();
+ RemoteCatalogFactory factory = archetypeManager.findParentCatalogFactory(a, RemoteCatalogFactory.class);
+ if (factory != null) {
+ //Grab the computed remote repository url
+ artifactRemoteRepository = factory.getRepositoryUrl();
+ a.setRepository(artifactRemoteRepository);//Hopefully will prevent further lookups for the same archetype
+ }
+ }
+ }
+
+ if (StringUtils.isNotBlank(artifactRemoteRepository)) {
+ ArtifactRepository archetypeRepository = maven.createArtifactRepository("archetype", a.getRepository().trim()); //$NON-NLS-1$
+ repos.add(0,archetypeRepository);//If the archetype doesn't exist locally, this will be the first remote repo to be searched.
+ }
+
+ maven.resolve(a.getGroupId(), a.getArtifactId(),a.getVersion(), "pom", null, repos, monitor); //$NON-NLS-1$
+ return maven.resolve(a.getGroupId(), a.getArtifactId(),a.getVersion(), "jar", null, repos, monitor); //$NON-NLS-1$
+ } catch (CoreException e) {
+ StringBuilder sb = new StringBuilder();
+ sb.append(Messages.ProjectConfigurationManager_error_resolve).append(a.getGroupId()).append(':').append(a.getArtifactId()).append(':').append(a.getVersion());
+ sb.append(Messages.ProjectConfigurationManager_error_resolve2);
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, sb.toString(), e));
+ }
+ }
+
+ private org.apache.maven.archetype.Archetype getArchetyper() {
+ return MavenPlugin.getDefault().getArchetype();
+ }
+
+ public Set<MavenProjectInfo> collectProjects(Collection<MavenProjectInfo> projects) {
+
+ // TODO what does this do?
+ return new LinkedHashSet<MavenProjectInfo>() {
+ private static final long serialVersionUID = 1L;
+
+ public Set<MavenProjectInfo> collectProjects(Collection<MavenProjectInfo> projects) {
+ for(MavenProjectInfo projectInfo : projects) {
+ console.logMessage("Collecting project info " + projectInfo);
+ add(projectInfo);
+ collectProjects(projectInfo.getProjects());
+ }
+ return this;
+ }
+ }.collectProjects(projects);
+ }
+
+ public ISchedulingRule getRule() {
+ return ResourcesPlugin.getWorkspace().getRuleFactory().buildRule();
+ }
+
+ private IProject create(MavenProjectInfo projectInfo, ProjectImportConfiguration configuration, IProgressMonitor monitor) throws CoreException {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ IWorkspaceRoot root = workspace.getRoot();
+
+ File pomFile = projectInfo.getPomFile();
+ Model model = projectInfo.getModel();
+ if(model == null) {
+ model = maven.readModel(pomFile);
+ projectInfo.setModel(model);
+ }
+
+ String projectName = configuration.getProjectName(model);
+
+ File projectDir = pomFile.getParentFile();
+ String projectParent = projectDir.getParentFile().getAbsolutePath();
+
+ if (projectInfo.getBasedirRename() == MavenProjectInfo.RENAME_REQUIRED) {
+ File newProject = new File(projectDir.getParent(), projectName);
+ if(!projectDir.equals(newProject)) {
+ boolean renamed = projectDir.renameTo(newProject);
+ if(!renamed) {
+ StringBuilder msg = new StringBuilder();
+ msg.append(NLS.bind(Messages.ProjectConfigurationManager_error_rename, projectDir.getAbsolutePath())).append('.');
+ if (newProject.exists()) {
+ msg.append(NLS.bind(Messages.ProjectConfigurationManager_error_targetDir, newProject.getAbsolutePath()));
+ }
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg.toString(), null));
+ }
+ projectInfo.setPomFile(getCanonicalPomFile(newProject));
+ projectDir = newProject;
+ }
+ } else {
+ if(projectParent.equals(root.getLocation().toFile().getAbsolutePath())) {
+ // immediately under workspace root, project name must match filesystem directory name
+ projectName = projectDir.getName();
+ }
+ }
+
+ monitor.subTask(NLS.bind(Messages.ProjectConfigurationManager_task_importing2, projectName));
+
+ IProject project = root.getProject(projectName);
+ if(project.exists()) {
+ console.logError("Project " + projectName + " already exists");
+ return null;
+ }
+
+ if(projectDir.equals(root.getLocation().toFile())) {
+ console.logError("Can't create project " + projectName + " at Workspace folder");
+ return null;
+ }
+
+ if(projectParent.equals(root.getLocation().toFile().getAbsolutePath())) {
+ project.create(monitor);
+ } else {
+ IProjectDescription description = workspace.newProjectDescription(projectName);
+ description.setLocation(new Path(projectDir.getAbsolutePath()));
+ project.create(description, monitor);
+ }
+
+ if(!project.isOpen()) {
+ project.open(monitor);
+ }
+
+ ResolverConfiguration resolverConfiguration = configuration.getResolverConfiguration();
+ enableBasicMavenNature(project, resolverConfiguration, monitor);
+
+ return project;
+ }
+
+ private File getCanonicalPomFile(File projectDir) throws CoreException {
+ try {
+ return new File(projectDir.getCanonicalFile(), IMavenConstants.POM_FILE_NAME);
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, //
+ NLS.bind(Messages.ProjectConfigurationManager_0, projectDir.getAbsolutePath()), null));
+ }
+ }
+
+ public void mavenProjectChanged(MavenProjectChangedEvent[] events, IProgressMonitor monitor) {
+ for(MavenProjectChangedEvent event : events) {
+ try {
+ ILifecycleMapping lifecycleMapping = getLifecycleMapping(event.getMavenProject(), monitor);
+ if(lifecycleMapping != null) {
+ for(AbstractProjectConfigurator configurator : lifecycleMapping.getProjectConfigurators(event.getMavenProject(), monitor)) {
+ //MNGECLIPSE-2004 : only send the relevant event to the configurator
+ configurator.mavenProjectChanged(event, monitor);
+ }
+ }
+ } catch (CoreException e) {
+ MavenLogger.log(e);
+ }
+ }
+ }
+
+ public ILifecycleMapping getLifecycleMapping(IMavenProjectFacade projectFacade, IProgressMonitor monitor) throws CoreException {
+ if (projectFacade==null) {
+ return null;
+ }
+
+ return projectFacade.getLifecycleMapping(monitor);
+ }
+
+ public ILifecycleMapping getDefaultLifecycleMapping(IMavenProjectFacade projectFacade, IProgressMonitor monitor)
+ throws CoreException {
+ if(projectFacade == null) {
+ return null;
+ }
+
+ return projectFacade.getLifecycleMapping(monitor);
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java
new file mode 100644
index 00000000..a2f84921
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/WorkspaceStateWriter.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.artifact.Artifact;
+
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+
+/**
+ * Maintains map file of maven artifacts present in workspace.
+ */
+public class WorkspaceStateWriter implements IMavenProjectChangedListener {
+
+ private MavenProjectManager projectManager;
+
+ public WorkspaceStateWriter(MavenProjectManager projectManager) {
+ this.projectManager = projectManager;
+ }
+
+ public void mavenProjectChanged(MavenProjectChangedEvent[] events, IProgressMonitor monitor) {
+ try {
+ Properties state = new Properties();
+
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ for(IMavenProjectFacade projectFacade : projectManager.getProjects()) {
+ try {
+ Artifact artifact = projectFacade.getMavenProject(monitor).getArtifact();
+ IFile pomFile = projectFacade.getPom();
+ IPath location = pomFile.getLocation();
+ if(location != null) {
+ File pom = location.toFile();
+ if(pom.canRead()) {
+ String key = artifact.getGroupId() + ":" + artifact.getArtifactId() + ":pom:" + artifact.getBaseVersion(); //$NON-NLS-1$ //$NON-NLS-2$
+ state.put(key, pom.getCanonicalPath());
+ }
+ }
+ IResource outputLocation = root.findMember(projectFacade.getOutputLocation());
+ if (!"pom".equals(artifact.getType()) && outputLocation != null && outputLocation.exists()) { //$NON-NLS-1$
+ String key = artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getType() + ":" + artifact.getBaseVersion(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ state.put(key, outputLocation.getLocation().toFile().getCanonicalPath());
+ }
+ } catch (CoreException ex) {
+ MavenLogger.log("Error writing workspace state file", ex);
+ }
+ }
+
+ OutputStream buf = new BufferedOutputStream(new FileOutputStream(projectManager.getWorkspaceStateFile()));
+ try {
+ state.store(buf, null);
+ } finally {
+ buf.close();
+ }
+
+ } catch(IOException ex) {
+ MavenLogger.log("Error writing workspace state file", ex);
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/AbstractMavenDependencyResolver.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/AbstractMavenDependencyResolver.java
new file mode 100644
index 00000000..819fd46a
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/AbstractMavenDependencyResolver.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.execution.MavenExecutionRequest;
+
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+
+/**
+ * AbstractMavenDependencyResolver
+ *
+ * @author igor
+ */
+public abstract class AbstractMavenDependencyResolver {
+
+ private ProjectRegistryManager manager;
+ private MutableProjectRegistry contextRegistry;
+
+ protected IMaven getMaven() {
+ return manager.getMaven();
+ }
+
+ final void setManager(ProjectRegistryManager manager) {
+ this.manager = manager;
+ }
+
+ protected ProjectRegistryManager getManager() {
+ return manager;
+ }
+
+ public abstract void resolveProjectDependencies(IMavenProjectFacade facade, MavenExecutionRequest mavenRequest, Set<Capability> capabilities, Set<RequiredCapability> requirements, IProgressMonitor monitor) throws CoreException;
+
+ void setContextProjectRegistry(MutableProjectRegistry contextRegistry) {
+ this.contextRegistry = contextRegistry;
+ }
+
+ protected List<MavenProjectFacade> getProjects() {
+ return Arrays.asList(contextRegistry.getProjects());
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/BasicProjectRegistry.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/BasicProjectRegistry.java
new file mode 100644
index 00000000..5ab82a63
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/BasicProjectRegistry.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+
+
+/**
+ * Registry of all workspace projects and their dependencies.
+ *
+ * @author igor
+ */
+abstract class BasicProjectRegistry implements Serializable {
+
+ private static final long serialVersionUID = 5542512601401896748L;
+
+ private final String m2e_version = MavenPlugin.getQualifiedVersion();
+
+ /**
+ * Map<ArtifactKey, IPath> Maps ArtifactKey to full workspace IPath of the POM file that defines this artifact.
+ */
+ protected final Map<ArtifactKey, IFile> workspaceArtifacts = new HashMap<ArtifactKey, IFile>();
+
+ /**
+ * Maps full pom IPath to MavenProjectFacade
+ */
+ protected final Map<IFile, MavenProjectFacade> workspacePoms = new HashMap<IFile, MavenProjectFacade>();
+
+ /**
+ * Maps required capabilities to projects that require them.
+ */
+ protected final Map<VersionlessKey, Map<RequiredCapability, Set<IFile>>> requiredCapabilities = new HashMap<VersionlessKey, Map<RequiredCapability, Set<IFile>>>();
+
+ /**
+ * Maps project pom.xml file to the capabilities provided by the project
+ */
+ protected final Map<IFile, Set<Capability>> projectCapabilities = new HashMap<IFile, Set<Capability>>();
+
+ /**
+ * Maps project pom.xml file to the capabilities required by the project
+ */
+ protected final Map<IFile, Set<RequiredCapability>> projectRequirements = new HashMap<IFile, Set<RequiredCapability>>();
+
+ protected BasicProjectRegistry() {
+ }
+
+ protected BasicProjectRegistry(BasicProjectRegistry other) {
+ replaceWith(other);
+ }
+
+ protected final void replaceWith(BasicProjectRegistry other) {
+ clear();
+
+ copy(other.workspaceArtifacts, workspaceArtifacts);
+ copy(other.workspacePoms, workspacePoms);
+ copy(other.projectCapabilities, projectCapabilities);
+ copy(other.projectRequirements, projectRequirements);
+ copy(other.requiredCapabilities, requiredCapabilities);
+ }
+
+ /**
+ * THIS IS NOT A GENERIC DEEP COPY IMPLEMENTATION!
+ */
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ private static void copy(Map from, Map to) {
+ for(Map.Entry entry : (Set<Map.Entry>) from.entrySet()) {
+ Object value = entry.getValue();
+ if(value instanceof Map) {
+ Map map = new HashMap();
+ copy((Map) value, map);
+ value = map;
+ } else if(value instanceof Set) {
+ Set set = new HashSet((Set) value);
+ value = set;
+ }
+ to.put(entry.getKey(), value);
+ }
+ }
+
+ public MavenProjectFacade getProjectFacade(IFile pom) {
+ return workspacePoms.get(pom);
+ }
+
+ public MavenProjectFacade getProjectFacade(String groupId, String artifactId, String version) {
+ IFile path = workspaceArtifacts.get(new ArtifactKey(groupId, artifactId, version, null));
+ if(path == null) {
+ return null;
+ }
+ return workspacePoms.get(path);
+ }
+
+ /**
+ * @TODO return a List
+ */
+ public MavenProjectFacade[] getProjects() {
+ return workspacePoms.values().toArray(new MavenProjectFacade[workspacePoms.size()]);
+ }
+
+ public IFile getWorkspaceArtifact(ArtifactKey key) {
+ return workspaceArtifacts.get(key);
+ }
+
+ protected void clear() {
+ workspaceArtifacts.clear();
+ workspacePoms.clear();
+ requiredCapabilities.clear();
+ projectCapabilities.clear();
+ projectRequirements.clear();
+ }
+
+ public boolean isValid() {
+ return MavenPlugin.getQualifiedVersion().equals(m2e_version) //
+ && workspaceArtifacts != null //
+ && workspacePoms != null //
+ && requiredCapabilities != null //
+ && projectCapabilities != null //
+ && projectRequirements != null //
+ && areFacadesValid();
+ }
+
+ private boolean areFacadesValid() {
+ for(MavenProjectFacade facade : workspacePoms.values()) {
+ if(facade == null || facade.getPom() == null || facade.getPom().getLocation() == null) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ protected Set<RequiredCapability> getProjectRequirements(IFile pom) {
+ return projectRequirements.get(pom);
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/Capability.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/Capability.java
new file mode 100644
index 00000000..6b7f767f
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/Capability.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.io.Serializable;
+
+
+/**
+ * Capability
+ *
+ * @author igor
+ */
+public abstract class Capability implements Serializable {
+
+ private static final long serialVersionUID = 6057170997402911788L;
+
+ private final VersionlessKey versionlessKey;
+
+ public Capability(String namespace, String id) {
+ if(namespace == null || id == null) {
+ throw new NullPointerException();
+ }
+ this.versionlessKey = new VersionlessKey(namespace, id);
+ }
+
+ public VersionlessKey getVersionlessKey() {
+ return versionlessKey;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/DefaultMavenDependencyResolver.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/DefaultMavenDependencyResolver.java
new file mode 100644
index 00000000..c27b325b
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/DefaultMavenDependencyResolver.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenExecutionResult;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.project.DependencyResolutionResult;
+import org.apache.maven.project.MavenProject;
+
+import org.sonatype.aether.graph.Dependency;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.project.IMavenMarkerManager;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+
+/**
+ * DefaultMavenDependencyResolver
+ *
+ * @author igor
+ */
+public class DefaultMavenDependencyResolver extends AbstractMavenDependencyResolver {
+ private final IMavenMarkerManager markerManager;
+
+ public DefaultMavenDependencyResolver(ProjectRegistryManager manager, IMavenMarkerManager markerManager) {
+ setManager(manager);
+ this.markerManager = markerManager;
+ }
+
+ public void resolveProjectDependencies(IMavenProjectFacade facade, MavenExecutionRequest mavenRequest,
+ Set<Capability> capabilities, Set<RequiredCapability> requirements, IProgressMonitor monitor)
+ throws CoreException {
+ markerManager.deleteMarkers(facade.getPom(), IMavenConstants.MARKER_DEPENDENCY_ID);
+
+ MavenExecutionResult mavenResult = getMaven().readProject(mavenRequest, monitor);
+
+ markerManager.addMarkers(facade.getPom(), IMavenConstants.MARKER_DEPENDENCY_ID, mavenResult);
+
+ if(!facade.getResolverConfiguration().shouldResolveWorkspaceProjects()) {
+ return;
+ }
+
+ MavenProject mavenProject = facade.getMavenProject();
+
+ // dependencies
+
+ // parent
+ Artifact parentArtifact = mavenProject.getParentArtifact();
+ if(parentArtifact != null) {
+ requirements.add(MavenRequiredCapability.createMavenParent(new ArtifactKey(parentArtifact)));
+ }
+
+ // resolved dependencies
+ for(Artifact artifact : mavenProject.getArtifacts()) {
+ requirements.add(MavenRequiredCapability.createMaven(new ArtifactKey(artifact), artifact.getScope(),
+ artifact.isOptional()));
+ }
+
+ // extension plugins (affect packaging type calculation)
+ for(Plugin plugin : mavenProject.getBuildPlugins()) {
+ if(plugin.isExtensions()) {
+ ArtifactKey artifactKey = new ArtifactKey(plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion(),
+ null);
+ requirements.add(MavenRequiredCapability.createMaven(artifactKey, "plugin", false)); //$NON-NLS-1$
+ }
+ }
+
+ // missing dependencies
+ DependencyResolutionResult resolutionResult = mavenResult.getDependencyResolutionResult();
+ if(resolutionResult != null && resolutionResult.getUnresolvedDependencies() != null) {
+ for(Dependency dependency : resolutionResult.getUnresolvedDependencies()) {
+ org.sonatype.aether.artifact.Artifact artifact = dependency.getArtifact();
+ ArtifactKey dependencyKey = new ArtifactKey(artifact.getGroupId(), artifact.getArtifactId(),
+ artifact.getVersion(), null);
+ requirements.add(MavenRequiredCapability.createMaven(dependencyKey, dependency.getScope(),
+ dependency.isOptional()));
+ }
+ }
+
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipsePluginDependenciesResolver.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipsePluginDependenciesResolver.java
new file mode 100644
index 00000000..db507922
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipsePluginDependenciesResolver.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.util.List;
+
+import org.codehaus.plexus.component.annotations.Component;
+
+import org.apache.maven.model.Plugin;
+import org.apache.maven.plugin.PluginResolutionException;
+import org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver;
+import org.apache.maven.plugin.internal.PluginDependenciesResolver;
+
+import org.sonatype.aether.RepositorySystemSession;
+import org.sonatype.aether.artifact.Artifact;
+import org.sonatype.aether.graph.DependencyFilter;
+import org.sonatype.aether.graph.DependencyNode;
+import org.sonatype.aether.repository.RemoteRepository;
+
+
+@Component(role = PluginDependenciesResolver.class)
+public class EclipsePluginDependenciesResolver extends DefaultPluginDependenciesResolver {
+
+ /*
+ * Plugin realms are cached and there is currently no way to purge cached
+ * realms due to http://jira.codehaus.org/browse/MNG-4194.
+ *
+ * Workspace plugins cannot be cached, so we disable this until MNG-4194 is fixed.
+ *
+ * Corresponding m2e JIRA https://issues.sonatype.org/browse/MNGECLIPSE-1448
+ */
+
+ @Override
+ public Artifact resolve(Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session)
+ throws PluginResolutionException {
+ boolean disabled = EclipseWorkspaceArtifactRepository.isDisabled();
+ EclipseWorkspaceArtifactRepository.setDisabled(true);
+ try {
+ return super.resolve(plugin, repositories, session);
+ } finally {
+ EclipseWorkspaceArtifactRepository.setDisabled(disabled);
+ }
+ }
+
+ @Override
+ public DependencyNode resolve(Plugin plugin, Artifact pluginArtifact, DependencyFilter dependencyFilter,
+ List<RemoteRepository> repositories, RepositorySystemSession session) throws PluginResolutionException {
+ boolean disabled = EclipseWorkspaceArtifactRepository.isDisabled();
+ EclipseWorkspaceArtifactRepository.setDisabled(true);
+ try {
+ return super.resolve(plugin, pluginArtifact, dependencyFilter, repositories, session);
+ } finally {
+ EclipseWorkspaceArtifactRepository.setDisabled(disabled);
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java
new file mode 100644
index 00000000..c38a1c89
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/EclipseWorkspaceArtifactRepository.java
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+
+import org.apache.maven.repository.LocalArtifactRepository;
+
+import org.sonatype.aether.artifact.Artifact;
+import org.sonatype.aether.repository.WorkspaceReader;
+import org.sonatype.aether.repository.WorkspaceRepository;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+
+
+public final class EclipseWorkspaceArtifactRepository extends LocalArtifactRepository implements WorkspaceReader {
+
+ private static final long serialVersionUID = 1018465082844566543L;
+
+ private final transient ProjectRegistryManager.Context context;
+
+ private static final ThreadLocal<Boolean> disabled = new ThreadLocal<Boolean>();
+
+ private WorkspaceRepository workspaceRepository;
+
+ public EclipseWorkspaceArtifactRepository(ProjectRegistryManager.Context context) {
+ this.context = context;
+ this.workspaceRepository = new WorkspaceRepository("ide", getClass()); //$NON-NLS-1$
+ }
+
+ protected File resolveAsEclipseProject(String groupId, String artifactId, String baseVersion, String classifier, String extension) {
+ if (isDisabled()) {
+ return null;
+ }
+
+ if(context == null) { // XXX this is actually a bug
+ return null;
+ }
+
+ // check in the workspace, note that workspace artifacts never have classifiers
+ ArtifactKey key = new ArtifactKey(groupId, artifactId, baseVersion, null);
+ IFile pom = context.state.getWorkspaceArtifact(key);
+ if(pom == null || !pom.isAccessible()) {
+ return null;
+ }
+ if(context.pom != null && pom.equals(context.pom)) {
+ return null;
+ }
+
+// if(!"pom".equals(artifact.getType())) {
+// return false;
+// }
+
+ if(context.resolverConfiguration.shouldResolveWorkspaceProjects()) {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IPath file = pom.getLocation();
+ if (!"pom".equals(extension)) { //$NON-NLS-1$
+ MavenProjectFacade facade = context.state.getProjectFacade(pom);
+ IFolder outputLocation = root.getFolder(facade.getOutputLocation());
+ if (outputLocation.exists()) {
+ file = outputLocation.getLocation();
+ }
+ }
+
+ return file.toFile();
+ }
+
+ return null;
+ }
+
+ public File findArtifact(Artifact artifact) {
+ return resolveAsEclipseProject(artifact.getGroupId(), artifact.getArtifactId(), artifact.getBaseVersion(),
+ artifact.getClassifier(), artifact.getExtension());
+ }
+
+ public org.apache.maven.artifact.Artifact find(org.apache.maven.artifact.Artifact artifact) {
+ File file = resolveAsEclipseProject(artifact.getGroupId(), artifact.getArtifactId(), artifact.getBaseVersion(),
+ artifact.getClassifier(), artifact.getType());
+
+ if(file != null) {
+ artifact.setFile(file);
+ artifact.setResolved(true);
+ }
+
+ return artifact;
+ }
+
+ public boolean hasLocalMetadata() {
+ return false; // XXX
+ }
+
+ public static void setDisabled(boolean disable) {
+ disabled.set(disable? Boolean.TRUE: null);
+ }
+
+ public static boolean isDisabled() {
+ return Boolean.TRUE.equals(disabled.get());
+ }
+
+ public int hashCode() {
+ return 0; // no state
+ }
+
+ public boolean equals(Object obj) {
+ return obj instanceof EclipseWorkspaceArtifactRepository;
+ }
+
+ public List<String> findVersions(Artifact artifact) {
+ return findVersions(artifact.getGroupId(), artifact.getArtifactId());
+ }
+
+ @Override
+ public List<String> findVersions(org.apache.maven.artifact.Artifact artifact) {
+ return findVersions(artifact.getGroupId(), artifact.getArtifactId());
+ }
+
+ private List<String> findVersions(String groupId, String artifactId) {
+ ArrayList<String> versions = new ArrayList<String>();
+
+ if (isDisabled()) {
+ return versions;
+ }
+
+ if(context == null) { // XXX this is actually a bug
+ return versions;
+ }
+
+ for (MavenProjectFacade facade : context.state.getProjects()) {
+ ArtifactKey artifactKey = facade.getArtifactKey();
+ if (groupId.equals(artifactKey.getGroupId()) && artifactId.equals(artifactKey.getArtifactId())) {
+ versions.add(artifactKey.getVersion());
+ }
+ }
+
+ return versions;
+ }
+
+ public WorkspaceRepository getRepository() {
+ return workspaceRepository;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ILifecycleMapping2.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ILifecycleMapping2.java
new file mode 100644
index 00000000..2b3d1960
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ILifecycleMapping2.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+
+/**
+ * ILifecycleMapping2
+ *
+ * @author igor
+ */
+public interface ILifecycleMapping2 extends ILifecycleMapping {
+ public AbstractMavenDependencyResolver getDependencyResolver(IProgressMonitor monitor);
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/IProjectRegistry.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/IProjectRegistry.java
new file mode 100644
index 00000000..dc4c605d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/IProjectRegistry.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import org.eclipse.core.resources.IFile;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+
+
+/**
+ * Registry of all known workspace maven projects.
+ *
+ * @author igor
+ */
+public interface IProjectRegistry {
+
+ public MavenProjectFacade getProjectFacade(IFile pom);
+
+ public MavenProjectFacade getProjectFacade(String groupId, String artifactId, String version);
+
+ public MavenProjectFacade[] getProjects();
+
+ public IFile getWorkspaceArtifact(ArtifactKey key);
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenCapability.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenCapability.java
new file mode 100644
index 00000000..445fb35e
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenCapability.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+
+
+/**
+ * MavenCapability
+ *
+ * @author igor
+ */
+public class MavenCapability extends Capability {
+
+ private static final long serialVersionUID = 8930981127331238566L;
+
+ /**
+ * Regular Maven dependency as defined in <dependency/> pom.xml element.
+ */
+ public static final String NS_MAVEN_ARTIFACT = "maven-artifact"; //$NON-NLS-1$
+
+ /**
+ * Maven parent dependency as defined in <parent/> pom.xml element.
+ */
+ public static final String NS_MAVEN_PARENT = "maven-parent"; //$NON-NLS-1$
+
+ private final String version;
+
+ private MavenCapability(String namespace, String id, String version) {
+ super(namespace, id);
+ this.version = version;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public String toString() {
+ return getVersionlessKey().toString() + "/" + version; //$NON-NLS-1$
+ }
+
+ public int hashCode() {
+ int hash = getVersionlessKey().hashCode();
+ hash = hash * 17 + version.hashCode();
+ return hash;
+ }
+
+ public boolean equals(Object obj) {
+ if(this == obj) {
+ return true;
+ }
+ if(!(obj instanceof MavenCapability)) {
+ return false;
+ }
+ MavenCapability other = (MavenCapability) obj;
+ return getVersionlessKey().equals(other.getVersionlessKey()) && version.equals(other.version);
+ }
+
+ public static MavenCapability createMaven(ArtifactKey key) {
+ return new MavenCapability(NS_MAVEN_ARTIFACT, getId(key), key.getVersion());
+ }
+
+ public static MavenCapability createMavenParent(ArtifactKey key) {
+ return new MavenCapability(NS_MAVEN_PARENT, getId(key), key.getVersion());
+ }
+
+ static String getId(ArtifactKey key) {
+ StringBuilder sb = new StringBuilder();
+ sb.append(key.getGroupId());
+ sb.append(':').append(key.getArtifactId());
+ if(key.getClassifier() != null) {
+ sb.append(':').append(key.getClassifier());
+ }
+ return sb.toString();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenProjectFacade.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenProjectFacade.java
new file mode 100644
index 00000000..28dbf8f3
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenProjectFacade.java
@@ -0,0 +1,382 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.io.File;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.execution.MavenExecutionResult;
+import org.apache.maven.lifecycle.MavenExecutionPlan;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.ArtifactRef;
+import org.eclipse.m2e.core.embedder.ArtifactRepositoryRef;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.IMavenProjectVisitor;
+import org.eclipse.m2e.core.project.IMavenProjectVisitor2;
+import org.eclipse.m2e.core.project.MavenProjectUtils;
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+
+
+/**
+ * MavenProject facade
+ */
+public class MavenProjectFacade implements IMavenProjectFacade, Serializable {
+
+ private static final long serialVersionUID = 707484407691175077L;
+
+ private final ProjectRegistryManager manager;
+
+ private final IFile pom;
+
+ private final File pomFile;
+
+ private transient MavenProject mavenProject;
+ private transient MavenExecutionPlan executionPlan;
+
+ private transient Map<String, Object> sessionProperties;
+
+ private boolean hasValidConfiguration = false;
+
+ // XXX make final, there should be no need to change it
+ private ResolverConfiguration resolverConfiguration;
+
+ private final long[] timestamp = new long[ProjectRegistryManager.METADATA_PATH.size() + 1];
+
+ // cached values from mavenProject
+ private ArtifactKey artifactKey;
+ private List<String> modules;
+ private String packaging;
+ private IPath[] resourceLocations;
+ private IPath[] testResourceLocations;
+ private IPath[] compileSourceLocations;
+ private IPath[] testCompileSourceLocations;
+ private IPath outputLocation;
+ private IPath testOutputLocation;
+ private Set<ArtifactRef> artifacts;
+ private Set<ArtifactRepositoryRef> artifactRepositories;
+ private Set<ArtifactRepositoryRef> pluginArtifactRepositories;
+
+ private transient ILifecycleMapping lifecycleMapping;
+
+ public MavenProjectFacade(ProjectRegistryManager manager, IFile pom, MavenProject mavenProject,
+ ResolverConfiguration resolverConfiguration, ILifecycleMapping lifecycleMapping) {
+ this.manager = manager;
+ this.pom = pom;
+ IPath location = pom.getLocation();
+ this.pomFile = location == null ? null : location.toFile(); // save pom file
+ this.resolverConfiguration = resolverConfiguration;
+ setMavenProject(mavenProject);
+ updateTimestamp();
+ }
+
+ private void setMavenProject(MavenProject mavenProject) {
+ this.mavenProject = mavenProject;
+
+ this.artifactKey = new ArtifactKey(mavenProject.getArtifact());
+ this.packaging = mavenProject.getPackaging();
+ this.modules = mavenProject.getModules();
+
+ this.resourceLocations = MavenProjectUtils.getResourceLocations(getProject(), mavenProject.getResources());
+ this.testResourceLocations = MavenProjectUtils.getResourceLocations(getProject(), mavenProject.getTestResources());
+ this.compileSourceLocations = MavenProjectUtils.getSourceLocations(getProject(), mavenProject.getCompileSourceRoots());
+ this.testCompileSourceLocations = MavenProjectUtils.getSourceLocations(getProject(),mavenProject.getTestCompileSourceRoots());
+
+ IPath fullPath = getProject().getFullPath();
+
+ IPath path = getProjectRelativePath(mavenProject.getBuild().getOutputDirectory());
+ this.outputLocation = (path != null) ? fullPath.append(path) : null;
+
+ path = getProjectRelativePath(mavenProject.getBuild().getTestOutputDirectory());
+ this.testOutputLocation = path != null ? fullPath.append(path) : null;
+
+ setMavenProjectArtifacts();
+
+ this.artifactRepositories = new LinkedHashSet<ArtifactRepositoryRef>();
+ for(ArtifactRepository repository : mavenProject.getRemoteArtifactRepositories()) {
+ this.artifactRepositories.add(new ArtifactRepositoryRef(repository));
+ }
+
+ this.pluginArtifactRepositories = new LinkedHashSet<ArtifactRepositoryRef>();
+ for(ArtifactRepository repository : mavenProject.getPluginArtifactRepositories()) {
+ this.pluginArtifactRepositories.add(new ArtifactRepositoryRef(repository));
+ }
+ }
+
+ public void setMavenProject() {
+ setMavenProject(mavenProject);
+ }
+
+ /**
+ * Returns project relative paths of resource directories
+ */
+ public IPath[] getResourceLocations() {
+ return resourceLocations;
+ }
+
+ /**
+ * Returns project relative paths of test resource directories
+ */
+ public IPath[] getTestResourceLocations() {
+ return testResourceLocations;
+ }
+
+ public IPath[] getCompileSourceLocations() {
+ return compileSourceLocations;
+ }
+
+ public IPath[] getTestCompileSourceLocations() {
+ return testCompileSourceLocations;
+ }
+
+ /**
+ * Returns project resource for given file system location or null the location is outside of project.
+ *
+ * @param resourceLocation absolute file system location
+ * @return IPath the full, absolute workspace path resourceLocation
+ */
+ public IPath getProjectRelativePath(String resourceLocation) {
+ return MavenProjectUtils.getProjectRelativePath(getProject(), resourceLocation);
+ }
+
+ /**
+ * Returns the full, absolute path of this project maven build output directory relative to the workspace or null if
+ * maven build output directory cannot be determined or outside of the workspace.
+ */
+ public IPath getOutputLocation() {
+ return outputLocation;
+ }
+
+ /**
+ * Returns the full, absolute path of this project maven build test output directory relative to the workspace or null
+ * if maven build output directory cannot be determined or outside of the workspace.
+ */
+ public IPath getTestOutputLocation() {
+ return testOutputLocation;
+ }
+
+ public IPath getFullPath() {
+ return getProject().getFullPath();
+ }
+
+ /**
+ * Lazy load and cache MavenProject instance
+ */
+ public synchronized MavenProject getMavenProject(IProgressMonitor monitor) throws CoreException {
+ if (mavenProject == null) {
+ //this used to just pass in 'true' for 'offline'. when the local repo was removed or
+ //corrupted, though, the project wouldn't load correctly
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ boolean isOffline = mavenConfiguration.isOffline();
+ MavenExecutionResult result = manager.readProjectWithDependencies(pom, resolverConfiguration, //
+ new MavenUpdateRequest(isOffline, false /* updateSnapshots */), monitor);
+ mavenProject = result.getProject();
+ if (mavenProject == null) {
+ MultiStatus status = new MultiStatus(IMavenConstants.PLUGIN_ID, 0, Messages.MavenProjectFacade_error, null);
+ List<Throwable> exceptions = result.getExceptions();
+ for (Throwable e : exceptions) {
+ status.add(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, 0, e.getMessage(), e));
+ }
+ throw new CoreException(status);
+ }
+ }
+ return mavenProject;
+ }
+
+ public synchronized MavenExecutionPlan getExecutionPlan(IProgressMonitor monitor) throws CoreException {
+ if (executionPlan == null) {
+ executionPlan = manager.calculateExecutionPlan(this, monitor);
+ }
+ return executionPlan;
+ }
+
+ public String getPackaging() {
+ return packaging;
+ }
+
+ public IProject getProject() {
+ return pom.getProject();
+ }
+
+ public IFile getPom() {
+ return pom;
+ }
+
+ public File getPomFile() {
+ return pomFile;
+ }
+
+ /**
+ * Returns the full, absolute path of the given file relative to the workspace. Returns null if the file does not
+ * exist or is not a member of this project.
+ */
+ public IPath getFullPath(File file) {
+ return MavenProjectUtils.getFullPath(getProject(), file);
+ }
+
+ /**
+ * Visits trough Maven project artifacts and modules
+ *
+ * @param visitor a project visitor used to visit Maven project
+ * @param flags flags to specify visiting behavior. See {@link IMavenProjectVisitor#LOAD},
+ * {@link IMavenProjectVisitor#NESTED_MODULES}.
+ */
+ public void accept(IMavenProjectVisitor visitor, int flags) throws CoreException {
+ acceptImpl(visitor, flags, null);
+ }
+
+ public void accept(IMavenProjectVisitor2 visitor, int flags, IProgressMonitor monitor) throws CoreException {
+ acceptImpl(visitor, flags, monitor);
+ }
+
+ private void acceptImpl(IMavenProjectVisitor visitor, int flags, IProgressMonitor monitor) throws CoreException {
+ if(visitor.visit(this)) {
+ if (visitor instanceof IMavenProjectVisitor2 && monitor != null) {
+ MavenProject mavenProject = ((flags & IMavenProjectVisitor.LOAD) > 0)? getMavenProject(monitor): getMavenProject();
+ if (mavenProject != null) {
+ for(Artifact artifact : mavenProject.getArtifacts()) {
+ ((IMavenProjectVisitor2) visitor).visit(this, artifact);
+ }
+ }
+ }
+ }
+ }
+
+ public List<String> getMavenProjectModules() {
+ return modules;
+ }
+
+ public Set<ArtifactRef> getMavenProjectArtifacts() {
+ return artifacts;
+ }
+
+ void setMavenProjectArtifacts() {
+ this.artifacts = ArtifactRef.fromArtifact(mavenProject.getArtifacts());
+ }
+
+ public ResolverConfiguration getResolverConfiguration() {
+ return resolverConfiguration;
+ }
+
+ public void setResolverConfiguration(ResolverConfiguration configuration) {
+ resolverConfiguration = configuration;
+ }
+
+ /**
+ * @return true if maven project needs to be re-read from disk
+ */
+ public boolean isStale() {
+ IProject project = getProject();
+ int i = 0;
+ for(IPath path : ProjectRegistryManager.METADATA_PATH) {
+ if (timestamp[i] != getModificationStamp(project.getFile(path))) {
+ return true;
+ }
+ i++;
+ }
+ return timestamp[timestamp.length - 1] != getModificationStamp(pom);
+ }
+
+ private void updateTimestamp() {
+ IProject project = getProject();
+ int i = 0;
+ for(IPath path : ProjectRegistryManager.METADATA_PATH) {
+ timestamp[i] = getModificationStamp(project.getFile(path));
+ i++;
+ }
+ timestamp[timestamp.length - 1] = getModificationStamp(pom);
+ }
+
+ private static long getModificationStamp(IFile file) {
+ /*
+ * this implementation misses update in the following scenario
+ *
+ * 1. two files, A and B, with different content were created with same localTimeStamp
+ * 2. original A was deleted and B moved to A
+ *
+ * See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=160728
+ */
+ return file.getLocalTimeStamp() + file.getModificationStamp();
+ }
+
+ public ArtifactKey getArtifactKey() {
+ return artifactKey;
+ }
+
+ public MavenProject getMavenProject() {
+ return mavenProject;
+ }
+
+ public synchronized void setSessionProperty(String key, Object value) {
+ if (sessionProperties == null) {
+ sessionProperties = new HashMap<String, Object>();
+ }
+ if (value != null) {
+ sessionProperties.put(key, value);
+ } else {
+ sessionProperties.remove(key);
+ }
+ }
+
+ public synchronized Object getSessionProperty(String key) {
+ return sessionProperties != null? sessionProperties.get(key): null;
+ }
+
+ public Set<ArtifactRepositoryRef> getArtifactRepositoryRefs() {
+ return artifactRepositories;
+ }
+
+ public Set<ArtifactRepositoryRef> getPluginArtifactRepositoryRefs() {
+ return pluginArtifactRepositories;
+ }
+
+ public ILifecycleMapping getLifecycleMapping(IProgressMonitor monitor) throws CoreException {
+ if ( lifecycleMapping == null ) {
+ lifecycleMapping = manager.getLifecycleMapping(pom, getMavenProject(monitor), getResolverConfiguration(), monitor);
+ }
+ return lifecycleMapping;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.core.project.IMavenProjectFacade#hasValidConfiguration()
+ */
+ public boolean hasValidConfiguration() {
+ return hasValidConfiguration;
+ }
+
+ public void setHasValidConfiguration(boolean hasValidConfiguration) {
+ this.hasValidConfiguration = hasValidConfiguration;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenRequiredCapability.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenRequiredCapability.java
new file mode 100644
index 00000000..1f0c3dbe
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MavenRequiredCapability.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import org.apache.maven.artifact.versioning.ArtifactVersion;
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+
+
+public class MavenRequiredCapability extends RequiredCapability {
+
+ private static final long serialVersionUID = 3254716937353332553L;
+
+ private final String versionRange;
+
+ private final String scope;
+
+ private final boolean optional;
+
+ private MavenRequiredCapability(String namespace, String id, String versionRange, String scope, boolean optional) {
+ super(namespace, id);
+
+ if(versionRange == null) {
+ throw new NullPointerException();
+ }
+
+ this.versionRange = versionRange;
+ this.scope = scope;
+ this.optional = optional;
+ }
+
+ public static MavenRequiredCapability createMaven(ArtifactKey key, String scope, boolean optional) {
+ return new MavenRequiredCapability(MavenCapability.NS_MAVEN_ARTIFACT, MavenCapability.getId(key), key.getVersion(),
+ scope, optional);
+ }
+
+ public static MavenRequiredCapability createMavenParent(ArtifactKey key) {
+ return new MavenRequiredCapability(MavenCapability.NS_MAVEN_PARENT, MavenCapability.getId(key), key.getVersion(),
+ null, false);
+ }
+
+ public boolean isPotentialMatch(Capability capability) {
+ if(capability instanceof MavenCapability && getVersionlessKey().equals(capability.getVersionlessKey())) {
+ try {
+ // TODO may need to cache parsed version and versionRange for performance reasons
+ ArtifactVersion version = new DefaultArtifactVersion(((MavenCapability) capability).getVersion());
+ VersionRange range = VersionRange.createFromVersionSpec(versionRange);
+ return range.containsVersion(version);
+ } catch(InvalidVersionSpecificationException ex) {
+ return true; // better safe than sorry
+ }
+ }
+ return false;
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(getVersionlessKey().toString());
+ if(scope != null) {
+ sb.append(':').append(scope);
+ }
+ sb.append('/').append(versionRange);
+ if(optional) {
+ sb.append("(optional)"); //$NON-NLS-1$
+ }
+ return sb.toString();
+ }
+
+ public int hashCode() {
+ int hash = getVersionlessKey().hashCode();
+ hash = hash * 17 + versionRange.hashCode();
+ hash = hash * 17 + (scope != null ? scope.hashCode() : 0);
+ hash = hash * 17 + (optional ? 1 : 0);
+ return hash;
+ }
+
+ public boolean equals(Object obj) {
+ if(this == obj) {
+ return true;
+ }
+ if(!(obj instanceof MavenRequiredCapability)) {
+ return false;
+ }
+ MavenRequiredCapability other = (MavenRequiredCapability) obj;
+ return getVersionlessKey().equals(other.getVersionlessKey()) && versionRange.equals(other.versionRange)
+ && eq(scope, other.scope) && optional == other.optional;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MutableProjectRegistry.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MutableProjectRegistry.java
new file mode 100644
index 00000000..a2526c98
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/MutableProjectRegistry.java
@@ -0,0 +1,245 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+
+
+/**
+ * WorkspaceStateDelta
+ *
+ * @author igor
+ */
+public class MutableProjectRegistry extends BasicProjectRegistry implements IProjectRegistry {
+
+ private static final long serialVersionUID = -4106047696261024741L;
+
+ private final ProjectRegistry parent;
+
+ private final int parentVersion;
+
+ private boolean closed;
+
+ public MutableProjectRegistry(ProjectRegistry state) {
+ super(state);
+ this.parent = state;
+ this.parentVersion = state.getVersion();
+ }
+
+ private void assertNotClosed() {
+ if(closed) {
+ throw new IllegalStateException("Can't modify closed MutableProjectRegistry"); //$NON-NLS-1$
+ }
+ }
+
+ public void setProject(IFile pom, MavenProjectFacade facade) {
+ assertNotClosed();
+
+ // remove
+ MavenProjectFacade oldFacade = workspacePoms.remove(pom);
+ if(oldFacade != null) {
+ workspaceArtifacts.remove(oldFacade.getArtifactKey());
+ }
+ if(facade != null) {
+ // Add the project to workspaceProjects map
+ workspacePoms.put(pom, facade);
+
+ // Add the project to workspaceArtifacts map
+ workspaceArtifacts.put(facade.getArtifactKey(), pom);
+ }
+ }
+
+ public void removeProject(IFile pom, ArtifactKey mavenProject) {
+ assertNotClosed();
+
+ // remove project from requiredCapabilities map
+ removeRequiredCapabilities(pom);
+
+ // Remove the project from workspaceProjects, projectRequirements and projectCapabilities maps
+ workspacePoms.remove(pom);
+ projectRequirements.remove(pom);
+ projectCapabilities.remove(pom);
+
+ // Remove the project from workspaceArtifacts map
+ if(mavenProject != null) {
+ workspaceArtifacts.remove(mavenProject);
+ }
+ }
+
+ static boolean isSameProject(IResource r1, IResource r2) {
+ if(r1 == null || r2 == null) {
+ return false;
+ }
+ return r1.getProject().equals(r2.getProject());
+ }
+
+ public Set<IFile> removeWorkspaceModules(IFile pom, ArtifactKey mavenProject) {
+ assertNotClosed();
+
+ return getDependents(MavenCapability.createMavenParent(mavenProject), true);
+ }
+
+ public boolean isStale() {
+ return parentVersion != parent.getVersion();
+ }
+
+ public void close() {
+ this.closed = true;
+
+ clear();
+ }
+
+ private boolean isClosed() {
+ return closed;
+ }
+
+ // IProjectRegistry
+
+ public MavenProjectFacade getProjectFacade(IFile pom) {
+ if(isClosed()) {
+ return parent.getProjectFacade(pom);
+ }
+ return super.getProjectFacade(pom);
+ }
+
+ public MavenProjectFacade getProjectFacade(String groupId, String artifactId, String version) {
+ if(isClosed()) {
+ return parent.getProjectFacade(groupId, artifactId, version);
+ }
+ return super.getProjectFacade(groupId, artifactId, version);
+ }
+
+ public MavenProjectFacade[] getProjects() {
+ if(isClosed()) {
+ return parent.getProjects();
+ }
+ return super.getProjects();
+ }
+
+ public IFile getWorkspaceArtifact(ArtifactKey key) {
+ if(isClosed()) {
+ return parent.getWorkspaceArtifact(key);
+ }
+ return super.getWorkspaceArtifact(key);
+ }
+
+ // low level access and manipulation
+
+ /**
+ * Returns all workspace projects that require given Capability.
+ */
+ public Set<IFile> getDependents(Capability capability, boolean remove) {
+ Map<RequiredCapability, Set<IFile>> rs = requiredCapabilities.get(capability.getVersionlessKey());
+ if(rs == null) {
+ return Collections.emptySet();
+ }
+ Set<IFile> result = new LinkedHashSet<IFile>();
+ Iterator<Entry<RequiredCapability, Set<IFile>>> iter = rs.entrySet().iterator();
+ while(iter.hasNext()) {
+ Entry<RequiredCapability, Set<IFile>> entry = iter.next();
+ if(entry.getKey().isPotentialMatch(capability)) {
+ result.addAll(entry.getValue());
+ if(remove) {
+ iter.remove();
+ }
+ }
+ }
+ if(remove && rs.isEmpty()) {
+ requiredCapabilities.remove(capability.getVersionlessKey());
+ }
+ return result;
+ }
+
+ /**
+ * Returns all workspace projects that require given versionless Capability.
+ */
+ public Set<IFile> getDependents(VersionlessKey capability, boolean remove) {
+ Map<RequiredCapability, Set<IFile>> rs;
+ if(remove) {
+ rs = requiredCapabilities.remove(capability);
+ } else {
+ rs = requiredCapabilities.get(capability);
+ }
+ if(rs == null) {
+ return Collections.emptySet();
+ }
+ Set<IFile> result = new LinkedHashSet<IFile>();
+ for(Set<IFile> dependents : rs.values()) {
+ result.addAll(dependents);
+ }
+ return result;
+ }
+
+ private void addRequiredCapability(IFile pom, RequiredCapability req) {
+ Map<RequiredCapability, Set<IFile>> keyEntry = requiredCapabilities.get(req.getVersionlessKey());
+ if(keyEntry == null) {
+ keyEntry = new HashMap<RequiredCapability, Set<IFile>>();
+ requiredCapabilities.put(req.getVersionlessKey(), keyEntry);
+ }
+ Set<IFile> poms = keyEntry.get(req);
+ if(poms == null) {
+ poms = new HashSet<IFile>();
+ keyEntry.put(req, poms);
+ }
+ poms.add(pom);
+ }
+
+ public Set<Capability> setCapabilities(IFile pom, Set<Capability> capabilities) {
+ return capabilities != null ? projectCapabilities.put(pom, capabilities) : projectCapabilities.remove(pom);
+ }
+
+ public Set<RequiredCapability> setRequirements(IFile pom, Set<RequiredCapability> requirements) {
+ removeRequiredCapabilities(pom);
+ if(requirements != null) {
+ for(RequiredCapability requirement : requirements) {
+ addRequiredCapability(pom, requirement);
+ }
+ return projectRequirements.put(pom, requirements);
+ }
+ return projectRequirements.remove(pom);
+ }
+
+ private void removeRequiredCapabilities(IFile pom) {
+ // TODO likely too slow
+ Iterator<Entry<VersionlessKey, Map<RequiredCapability, Set<IFile>>>> keysIter = requiredCapabilities.entrySet()
+ .iterator();
+ while(keysIter.hasNext()) {
+ Entry<VersionlessKey, Map<RequiredCapability, Set<IFile>>> keysEntry = keysIter.next();
+ Iterator<Entry<RequiredCapability, Set<IFile>>> requirementsIter = keysEntry.getValue().entrySet().iterator();
+ while(requirementsIter.hasNext()) {
+ Entry<RequiredCapability, Set<IFile>> requirementsEntry = requirementsIter.next();
+ requirementsEntry.getValue().remove(pom);
+ if(requirementsEntry.getValue().isEmpty()) {
+ // was last project that required this capability
+ requirementsIter.remove();
+ }
+ }
+ if(keysEntry.getValue().isEmpty()) {
+ // was last project that required this capability versionless key
+ keysIter.remove();
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistry.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistry.java
new file mode 100644
index 00000000..0ea78e23
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistry.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+
+
+/**
+ * Registry of all Maven workspace projects and their inter-dependencies. Dependencies are modelled as generic
+ * requirement/capability match and can represent any dependencies, not just Maven. The only way to change registry
+ * contents is via {@link #apply(MutableProjectRegistry)} call. This class is thread safe.
+ *
+ * @author Igor Fedorenko
+ */
+public class ProjectRegistry extends BasicProjectRegistry implements Serializable, IProjectRegistry {
+
+ private static final long serialVersionUID = -5813062417528479711L;
+
+ private transient int version;
+
+ public synchronized MavenProjectFacade getProjectFacade(IFile pom) {
+ return super.getProjectFacade(pom);
+ }
+
+ public synchronized MavenProjectFacade getProjectFacade(String groupId, String artifactId, String version) {
+ return super.getProjectFacade(groupId, artifactId, version);
+ }
+
+ public synchronized MavenProjectFacade[] getProjects() {
+ return super.getProjects();
+ }
+
+ public synchronized IFile getWorkspaceArtifact(ArtifactKey key) {
+ return super.getWorkspaceArtifact(key);
+ }
+
+ public synchronized List<MavenProjectChangedEvent> apply(MutableProjectRegistry newState)
+ throws StaleMutableProjectRegistryException {
+ if(newState.isStale()) {
+ throw new StaleMutableProjectRegistryException();
+ }
+
+ ArrayList<MavenProjectChangedEvent> events = new ArrayList<MavenProjectChangedEvent>();
+
+ // removed projects
+ for(MavenProjectFacade facade : workspacePoms.values()) {
+ if(!newState.workspacePoms.containsKey(facade.getPom())) {
+ MavenProjectChangedEvent event = new MavenProjectChangedEvent( //
+ facade.getPom(), //
+ MavenProjectChangedEvent.KIND_REMOVED, //
+ MavenProjectChangedEvent.FLAG_NONE, //
+ facade /*old*/, //
+ null /*new*/);
+ events.add(event);
+ }
+ }
+
+ // changed and new projects
+ for(MavenProjectFacade facade : newState.workspacePoms.values()) {
+ MavenProjectFacade old = workspacePoms.get(facade.getPom());
+ if(facade != old) { // not the same instance!
+ MavenProjectChangedEvent event;
+ if(old != null) {
+ int flags = hasDependencyChange(old.getPom(), newState) ? MavenProjectChangedEvent.FLAG_DEPENDENCIES
+ : MavenProjectChangedEvent.FLAG_NONE;
+ event = new MavenProjectChangedEvent(facade.getPom(), //
+ MavenProjectChangedEvent.KIND_CHANGED, //
+ flags, //
+ old /*old*/, //
+ facade /*new*/);
+
+ } else {
+ event = new MavenProjectChangedEvent(facade.getPom(), //
+ MavenProjectChangedEvent.KIND_ADDED, //
+ MavenProjectChangedEvent.FLAG_NONE, //
+ null /*old*/, //
+ facade /*new*/);
+ }
+ events.add(event);
+ }
+ }
+
+ replaceWith(newState);
+
+ version++ ;
+
+ return events;
+ }
+
+ public synchronized int getVersion() {
+ return version;
+ }
+
+ private boolean hasDependencyChange(IFile pom, MutableProjectRegistry newState) {
+ Set<RequiredCapability> oldRequirements = getProjectRequirements(pom);
+ Set<RequiredCapability> requirements = newState.getProjectRequirements(pom);
+
+ return ProjectRegistryManager.hasDiff(oldRequirements, requirements);
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
new file mode 100644
index 00000000..d1d708b1
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryManager.java
@@ -0,0 +1,854 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.osgi.service.prefs.BackingStoreException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.osgi.util.NLS;
+
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+
+import org.apache.maven.artifact.repository.MavenArtifactRepository;
+import org.apache.maven.execution.DefaultMavenExecutionRequest;
+import org.apache.maven.execution.DefaultMavenExecutionResult;
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenExecutionResult;
+import org.apache.maven.lifecycle.MavenExecutionPlan;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.artifact.MavenMetadataCache;
+import org.apache.maven.properties.internal.EnvironmentUtils;
+import org.apache.maven.repository.DelegatingLocalArtifactRepository;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.internal.ExtensionReader;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.embedder.MavenImpl;
+import org.eclipse.m2e.core.internal.lifecycle.LifecycleMappingFactory;
+import org.eclipse.m2e.core.internal.project.DependencyResolutionContext;
+import org.eclipse.m2e.core.internal.project.IManagedCache;
+import org.eclipse.m2e.core.internal.project.MissingLifecycleMapping;
+import org.eclipse.m2e.core.internal.project.MojoExecutionProjectConfigurator;
+import org.eclipse.m2e.core.project.IMavenMarkerManager;
+import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+import org.eclipse.m2e.core.project.configurator.CustomizableLifecycleMapping;
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+import org.eclipse.m2e.core.project.configurator.NoopLifecycleMapping;
+
+/**
+ * This class keeps track of all maven projects present in the workspace and
+ * provides mapping between Maven and the workspace.
+ */
+public class ProjectRegistryManager {
+
+ public static boolean DEBUG = MavenPlugin.getDefault().isDebugging()
+ & Boolean.parseBoolean(Platform.getDebugOption(IMavenConstants.PLUGIN_ID + "/debug/projectManager")); //$NON-NLS-1$
+
+ static final String ARTIFACT_TYPE_POM = "pom"; //$NON-NLS-1$
+ static final String ARTIFACT_TYPE_JAR = "jar"; //$NON-NLS-1$
+ public static final String ARTIFACT_TYPE_JAVA_SOURCE = "java-source"; //$NON-NLS-1$
+ public static final String ARTIFACT_TYPE_JAVADOC = "javadoc"; //$NON-NLS-1$
+
+ private static final String P_VERSION = "version"; //$NON-NLS-1$
+ private static final String P_RESOLVE_WORKSPACE_PROJECTS = "resolveWorkspaceProjects"; //$NON-NLS-1$
+ private static final String P_ACTIVE_PROFILES = "activeProfiles"; //$NON-NLS-1$
+
+ private static final String VERSION = "1"; //$NON-NLS-1$
+
+ /**
+ * Path of project metadata files, relative to the project. These
+ * files are used to determine if project dependencies need to be
+ * updated.
+ *
+ * Note that path of pom.xml varies for nested projects and pom.xml
+ * are treated separately.
+ */
+ public static final List<? extends IPath> METADATA_PATH = Arrays.asList( //
+ new Path(".project"), // //$NON-NLS-1$
+ new Path(".classpath"), // //$NON-NLS-1$
+ new Path(".settings/org.eclipse.m2e.prefs")); // dirty trick! //$NON-NLS-1$
+
+ private final ProjectRegistry projectRegistry;
+
+ private final MavenConsole console;
+ private final MavenImpl maven;
+
+ private final IMavenMarkerManager markerManager;
+
+ private final ProjectRegistryReader stateReader;
+
+ private final Set<IMavenProjectChangedListener> projectChangeListeners = new LinkedHashSet<IMavenProjectChangedListener>();
+
+ private volatile Thread syncRefreshThread;
+
+ public ProjectRegistryManager(MavenImpl maven, MavenConsole console, File stateLocationDir, boolean readState,
+ IMavenMarkerManager mavenMarkerManager) {
+ this.console = console;
+ this.markerManager = mavenMarkerManager;
+ this.maven = maven;
+
+ this.stateReader = new ProjectRegistryReader(stateLocationDir);
+
+ ProjectRegistry state = readState && stateReader != null ? stateReader.readWorkspaceState(this) : null;
+ this.projectRegistry = (state != null && state.isValid()) ? state : new ProjectRegistry();
+ }
+
+ /**
+ * Creates or returns cached MavenProjectFacade for the given project.
+ *
+ * This method will not block if called from IMavenProjectChangedListener#mavenProjectChanged
+ */
+ public MavenProjectFacade create(IProject project, IProgressMonitor monitor) {
+ return create(getPom(project), false, monitor);
+ }
+
+ /**
+ * Returns MavenProjectFacade corresponding to the pom.
+ *
+ * This method first looks in the project cache, then attempts to load
+ * the pom if the pom is not found in the cache. In the latter case,
+ * workspace resolution is assumed to be enabled for the pom but the pom
+ * will not be added to the cache.
+ */
+ public MavenProjectFacade create(IFile pom, boolean load, IProgressMonitor monitor) {
+ if(pom == null) {
+ return null;
+ }
+
+ // MavenProjectFacade projectFacade = (MavenProjectFacade) workspacePoms.get(pom.getFullPath());
+ MavenProjectFacade projectFacade = projectRegistry.getProjectFacade(pom);
+ if(projectFacade == null && load) {
+ ResolverConfiguration configuration = readResolverConfiguration(pom.getProject());
+ //this used to just pass in 'true' for 'offline'. when the local repo was removed or
+ //corrupted, though, the project wouldn't load correctly
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ boolean isOffline = mavenConfiguration.isOffline();
+ MavenExecutionResult executionResult = readProjectWithDependencies(projectRegistry, pom, configuration, //
+ new MavenUpdateRequest(isOffline, false /* updateSnapshots */),
+ monitor);
+ MavenProject mavenProject = executionResult.getProject();
+ if(mavenProject != null) {
+ projectFacade = new MavenProjectFacade(this, pom, mavenProject, configuration, null);
+ } else {
+ List<Throwable> exceptions = executionResult.getExceptions();
+ if (exceptions != null) {
+ for(Throwable ex : exceptions) {
+ String msg = "Failed to read Maven project";
+ console.logError(msg);
+ console.logError(ex.toString());
+ MavenLogger.log(msg, ex);
+ }
+ }
+ }
+ }
+ return projectFacade;
+ }
+
+ public boolean saveResolverConfiguration(IProject project, ResolverConfiguration configuration) {
+ IScopeContext projectScope = new ProjectScope(project);
+ IEclipsePreferences projectNode = projectScope.getNode(IMavenConstants.PLUGIN_ID);
+ if(projectNode != null) {
+ projectNode.put(P_VERSION, VERSION);
+
+ projectNode.putBoolean(P_RESOLVE_WORKSPACE_PROJECTS, configuration.shouldResolveWorkspaceProjects());
+
+ projectNode.put(P_ACTIVE_PROFILES, configuration.getActiveProfiles());
+
+ try {
+ projectNode.flush();
+ return true;
+ } catch(BackingStoreException ex) {
+ MavenLogger.log("Failed to save resolver configuration", ex);
+ }
+ }
+
+ return false;
+ }
+
+ public ResolverConfiguration readResolverConfiguration(IProject project) {
+ IScopeContext projectScope = new ProjectScope(project);
+ IEclipsePreferences projectNode = projectScope.getNode(IMavenConstants.PLUGIN_ID);
+ if(projectNode==null) {
+ return new ResolverConfiguration();
+ }
+
+ String version = projectNode.get(P_VERSION, null);
+ if(version == null) { // migrate from old config
+ // return LegacyBuildPathManager.getResolverConfiguration(project);
+ return new ResolverConfiguration();
+ }
+
+ ResolverConfiguration configuration = new ResolverConfiguration();
+ configuration.setResolveWorkspaceProjects(projectNode.getBoolean(P_RESOLVE_WORKSPACE_PROJECTS, false));
+
+ configuration.setActiveProfiles(projectNode.get(P_ACTIVE_PROFILES, "")); //$NON-NLS-1$
+ return configuration;
+ }
+
+ IFile getPom(IProject project) {
+ if (project == null || !project.isAccessible()) {
+ // XXX sensible handling
+ return null;
+ }
+ return project.getFile(IMavenConstants.POM_FILE_NAME);
+ }
+
+ /**
+ * Removes specified poms from the cache.
+ * Adds dependent poms to pomSet but does not directly refresh dependent poms.
+ * Recursively removes all nested modules if appropriate.
+ *
+ * @return a {@link Set} of {@link IFile} affected poms
+ */
+ public Set<IFile> remove(MutableProjectRegistry state, Set<IFile> poms, boolean force) {
+ Set<IFile> pomSet = new LinkedHashSet<IFile>();
+ for (Iterator<IFile> it = poms.iterator(); it.hasNext(); ) {
+ IFile pom = it.next();
+ MavenProjectFacade facade = state.getProjectFacade(pom);
+ if (force || facade == null || facade.isStale()) {
+ pomSet.addAll(remove(state, pom));
+ }
+ }
+ return pomSet;
+ }
+
+ /**
+ * Removes the pom from the cache.
+ * Adds dependent poms to pomSet but does not directly refresh dependent poms.
+ * Recursively removes all nested modules if appropriate.
+ *
+ * @return a {@link Set} of {@link IFile} affected poms
+ */
+ public Set<IFile> remove(MutableProjectRegistry state, IFile pom) {
+ MavenProjectFacade facade = state.getProjectFacade(pom);
+ ArtifactKey mavenProject = facade != null ? facade.getArtifactKey() : null;
+
+ flushCaches(pom, facade);
+
+ if (mavenProject == null) {
+ state.removeProject(pom, null);
+ return Collections.emptySet();
+ }
+
+ Set<IFile> pomSet = new LinkedHashSet<IFile>();
+
+ pomSet.addAll(state.getDependents(MavenCapability.createMaven(mavenProject), false));
+ pomSet.addAll(state.getDependents(MavenCapability.createMavenParent(mavenProject), false)); // TODO check packaging
+ state.removeProject(pom, mavenProject);
+
+ pomSet.addAll(refreshWorkspaceModules(state, pom, mavenProject));
+
+ pomSet.remove(pom);
+
+ return pomSet;
+ }
+
+ private void flushCaches(IFile pom, MavenProjectFacade facade) {
+ ArtifactKey key = null;
+ MavenProject project = null;
+
+ if (facade != null) {
+ key = facade.getArtifactKey();
+ project = facade.getMavenProject();
+ }
+ try {
+ IManagedCache cache = (IManagedCache) maven.getPlexusContainer().lookup(MavenMetadataCache.class);
+ cache.removeProject(pom, key);
+ } catch(ComponentLookupException ex) {
+ // can't really happen
+ } catch(CoreException ex) {
+ // can't really happen
+ }
+ if (project != null) {
+ getMaven().xxxRemoveExtensionsRealm(project);
+ }
+ }
+
+ /**
+ * This method acquires workspace root's lock and sends project change events.
+ * It is meant for synchronous registry updates.
+ */
+ public void refresh(MavenUpdateRequest request, IProgressMonitor monitor) throws CoreException {
+ SubMonitor progress = SubMonitor.convert(monitor, Messages.ProjectRegistryManager_task_refreshing, 100);
+ ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRoot();
+ Job.getJobManager().beginRule(rule, progress);
+ try {
+ syncRefreshThread = Thread.currentThread();
+
+ MutableProjectRegistry newState = newMutableProjectRegistry();
+ try {
+ refresh(newState, request, progress.newChild(95));
+
+ applyMutableProjectRegistry(newState, progress.newChild(5));
+ } finally {
+ newState.close();
+ }
+ } finally {
+ syncRefreshThread = null;
+ Job.getJobManager().endRule(rule);
+ }
+ }
+
+ void refresh(MutableProjectRegistry newState, MavenUpdateRequest updateRequest, IProgressMonitor monitor) throws CoreException {
+ MavenExecutionRequest executionRequest = getMaven().createExecutionRequest(monitor);
+
+ DependencyResolutionContext context = new DependencyResolutionContext(updateRequest, executionRequest);
+
+ refresh(newState, context, monitor);
+ }
+
+ protected void refresh(MutableProjectRegistry newState, DependencyResolutionContext context, IProgressMonitor monitor)
+ throws CoreException {
+ while(!context.isEmpty()) {
+ Map<IFile, MavenProjectFacade> newFacades = new LinkedHashMap<IFile, MavenProjectFacade>();
+
+ // phase 1: build projects without dependencies and populate workspace with known projects
+ while(!context.isEmpty()) {
+ if(monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+
+ if(newState.isStale() || (syncRefreshThread != null && syncRefreshThread != Thread.currentThread())) {
+ throw new StaleMutableProjectRegistryException();
+ }
+
+ IFile pom = context.pop();
+
+ monitor.subTask(NLS.bind(Messages.ProjectRegistryManager_task_project, pom.getProject().getName()));
+ MavenProjectFacade newFacade = null;
+ if(pom.isAccessible() && pom.getProject().hasNature(IMavenConstants.NATURE_ID)) {
+ MavenProjectFacade oldFacade = newState.getProjectFacade(pom);
+
+ if(!context.isForce(pom) && oldFacade != null && !oldFacade.isStale()) {
+ // skip refresh if not forced and up-to-date facade
+ continue;
+ }
+
+ flushCaches(pom, oldFacade);
+
+ newFacade = readMavenProject(pom, context, newState, monitor);
+ }
+
+ newState.setProject(pom, newFacade);
+
+ // at this point project facade and project capabilities/requirements are inconsistent in the state
+ // this will be reconciled during the second phase
+
+ newFacades.put(pom, newFacade); // stash work for the second phase
+ }
+
+ // TODO theoretically, there is no need to re-read projects during second resolution phase
+ // only re-resolve dependencies.
+
+ // phase 2: resolve project dependencies
+ for(Map.Entry<IFile, MavenProjectFacade> entry : newFacades.entrySet()) {
+ if(monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+
+ if(newState.isStale() || (syncRefreshThread != null && syncRefreshThread != Thread.currentThread())) {
+ throw new StaleMutableProjectRegistryException();
+ }
+
+ IFile pom = entry.getKey();
+ MavenProjectFacade newFacade = entry.getValue();
+
+ Set<Capability> capabilities = null;
+ Set<RequiredCapability> requirements = null;
+ if(newFacade != null) {
+ monitor.subTask(NLS.bind(Messages.ProjectRegistryManager_task_project,newFacade.getProject().getName()));
+
+ // TODO is this expansive?
+ MavenExecutionRequest mavenRequest = getConfiguredExecutionRequest(context, newState, newFacade.getPom(),
+ newFacade.getResolverConfiguration());
+ mavenRequest.getProjectBuildingRequest().setProject(newFacade.getMavenProject());
+ mavenRequest.getProjectBuildingRequest().setResolveDependencies(true);
+
+ capabilities = new LinkedHashSet<Capability>();
+ requirements = new LinkedHashSet<RequiredCapability>();
+
+ Capability mavenParentCapability = MavenCapability.createMavenParent(newFacade.getArtifactKey());
+
+ // maven projects always have these capabilities
+ capabilities.add(MavenCapability.createMaven(newFacade.getArtifactKey()));
+ capabilities.add(mavenParentCapability); // TODO consider packaging
+
+ AbstractMavenDependencyResolver resolver = getMavenDependencyResolver(newFacade, monitor);
+ resolver.setContextProjectRegistry(newState);
+ try {
+ resolver.resolveProjectDependencies(newFacade, mavenRequest, capabilities, requirements, monitor);
+ } finally {
+ resolver.setContextProjectRegistry(null);
+ }
+
+ newFacade.setMavenProjectArtifacts();
+
+ // always refresh child modules
+ context.forcePomFiles(newState.getDependents(mavenParentCapability, true));
+ } else {
+ if(pom.isAccessible() && pom.getProject().hasNature(IMavenConstants.NATURE_ID)) {
+ try {
+ // MNGECLIPSE-605 embedder is not able to resolve the project due to missing configuration in the parent
+ Model model = getMaven().readModel(pom.getLocation().toFile());
+ if(model != null && model.getParent() != null) {
+ Parent parent = model.getParent();
+ if(parent.getGroupId() != null && parent.getArtifactId() != null && parent.getVersion() != null) {
+ ArtifactKey parentKey = new ArtifactKey(parent.getGroupId(), parent.getArtifactId(),
+ parent.getVersion(), null);
+ requirements = new HashSet<RequiredCapability>();
+ requirements.add(MavenRequiredCapability.createMavenParent(parentKey));
+ }
+ }
+ } catch(Exception ex) {
+ // we've tried our best, there is nothing else we can do
+ }
+ }
+ }
+
+ Set<Capability> oldCapabilities = newState.setCapabilities(pom, capabilities);
+ // if our capabilities changed, recalculate everyone who depends on new/changed/removed capabilities
+ Set<Capability> changedCapabilities = diff(oldCapabilities, capabilities);
+ for(Capability capability : changedCapabilities) {
+ context.forcePomFiles(newState.getDependents(capability, true));
+ }
+
+ Set<RequiredCapability> oldRequirements = newState.setRequirements(pom, requirements);
+ // if our dependencies changed, recalculate everyone who depends on us
+ // this is needed to deal with transitive dependency resolution in maven
+ if(oldCapabilities != null && hasDiff(oldRequirements, requirements)) {
+ for(Capability capability : oldCapabilities) {
+ context.forcePomFiles(newState.getDependents(capability.getVersionlessKey(), true));
+ }
+ }
+
+ monitor.worked(1);
+ }
+ }
+ }
+
+ static <T> Set<T> diff(Set<T> a, Set<T> b) {
+ if(a == null || a.isEmpty()) {
+ if(b == null || b.isEmpty()) {
+ return Collections.emptySet();
+ }
+ return b;
+ }
+ if(b == null || b.isEmpty()) {
+ return a;
+ }
+ Set<T> result = new HashSet<T>();
+ Set<T> t;
+
+ t = new HashSet<T>(a); t.removeAll(b); result.addAll(t);
+ t = new HashSet<T>(b); t.removeAll(a); result.addAll(t);
+
+ return result;
+ }
+
+ static <T> boolean hasDiff(Set<T> a, Set<T> b) {
+ if(a == null || a.isEmpty()) {
+ return b != null && !b.isEmpty();
+ }
+
+ if(b == null || b.isEmpty()) {
+ return true;
+ }
+
+ if(a.size() != b.size()) {
+ return true;
+ }
+
+ Iterator<T> oldIter = a.iterator();
+ Iterator<T> iter = b.iterator();
+
+ while(oldIter.hasNext()) {
+ T oldRequirement = oldIter.next();
+ T requirement = iter.next();
+ if (!oldRequirement.equals(requirement)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private AbstractMavenDependencyResolver getMavenDependencyResolver(MavenProjectFacade newFacade, IProgressMonitor monitor) throws CoreException {
+ ILifecycleMapping lifecycleMapping = newFacade.getLifecycleMapping(monitor);
+
+ if (lifecycleMapping instanceof ILifecycleMapping2) {
+ AbstractMavenDependencyResolver resolver = ((ILifecycleMapping2) lifecycleMapping).getDependencyResolver(monitor);
+ resolver.setManager(this);
+ return resolver;
+ }
+
+ return new DefaultMavenDependencyResolver(this, markerManager);
+ }
+
+ protected MavenExecutionRequest getConfiguredExecutionRequest(DependencyResolutionContext context,
+ MutableProjectRegistry state, IFile pom, ResolverConfiguration resolverConfiguration) throws CoreException {
+ MavenExecutionRequest mavenRequest = DefaultMavenExecutionRequest.copy(context.getExecutionRequest());
+ configureExecutionRequest(mavenRequest, state, pom, resolverConfiguration);
+ getMaven().populateDefaults(mavenRequest);
+ mavenRequest.setOffline(context.getRequest().isOffline());
+ return mavenRequest;
+ }
+
+ private MavenProjectFacade readMavenProject(IFile pom, DependencyResolutionContext context,
+ MutableProjectRegistry state, IProgressMonitor monitor) throws CoreException {
+ markerManager.deleteMarkers(pom, IMavenConstants.MARKER_POM_LOADING_ID);
+
+ ResolverConfiguration resolverConfiguration = readResolverConfiguration(pom.getProject());
+
+ MavenProject mavenProject = null;
+ MavenExecutionResult mavenResult = null;
+ if (pom.isAccessible()) {
+ MavenExecutionRequest mavenRequest = getConfiguredExecutionRequest(context, state, pom, resolverConfiguration);
+ mavenResult = getMaven().readProject(mavenRequest, monitor);
+ mavenProject = mavenResult.getProject();
+ }
+
+ markerManager.addEditorHintMarkers(pom, IMavenConstants.MARKER_POM_LOADING_ID);
+ if (mavenProject == null) {
+ markerManager.addMarkers(pom, IMavenConstants.MARKER_POM_LOADING_ID, mavenResult);
+ return null;
+ }
+
+ ILifecycleMapping lifecycleMapping = getLifecycleMapping(pom, mavenProject, resolverConfiguration, monitor);
+
+ // don't cache maven session
+ getMaven().detachFromSession(mavenProject);
+
+ // create and return new project facade
+ MavenProjectFacade mavenProjectFacade = new MavenProjectFacade(ProjectRegistryManager.this, pom, mavenProject,
+ resolverConfiguration, lifecycleMapping);
+
+ MavenPlugin.getDefault().getProjectConfigurationManager().validateProjectConfiguration(mavenProjectFacade, monitor);
+
+ return mavenProjectFacade;
+ }
+
+ MavenExecutionPlan calculateExecutionPlan(MavenProjectFacade facade, IProgressMonitor monitor) throws CoreException {
+ return calculateExecutionPlan(projectRegistry, facade, monitor);
+ }
+
+ private MavenExecutionPlan calculateExecutionPlan(IProjectRegistry state, MavenProjectFacade facade, IProgressMonitor monitor) throws CoreException {
+ MavenExecutionRequest request = createExecutionRequest(state, facade.getPom(), facade.getResolverConfiguration(), monitor);
+ request.setGoals(Arrays.asList("deploy")); //$NON-NLS-1$
+ return getMaven().calculateExecutionPlan(request, facade.getMavenProject(monitor), monitor);
+ }
+
+ public IFile getModulePom(IFile pom, String moduleName) {
+ return pom.getParent().getFile(new Path(moduleName).append(IMavenConstants.POM_FILE_NAME));
+ }
+
+ private Set<IFile> refreshWorkspaceModules(MutableProjectRegistry state, IFile pom, ArtifactKey mavenProject) {
+ if (mavenProject == null) {
+ return Collections.emptySet();
+ }
+
+ return state.removeWorkspaceModules(pom, mavenProject);
+ }
+
+ public void addMavenProjectChangedListener(IMavenProjectChangedListener listener) {
+ synchronized (projectChangeListeners) {
+ projectChangeListeners.add(listener);
+ }
+ }
+
+ public void removeMavenProjectChangedListener(IMavenProjectChangedListener listener) {
+ if(listener == null) {
+ return;
+ }
+ synchronized (projectChangeListeners) {
+ projectChangeListeners.remove(listener);
+ }
+ }
+
+ public void notifyProjectChangeListeners(List<MavenProjectChangedEvent> events, IProgressMonitor monitor) {
+ if(events.size() > 0) {
+ MavenProjectChangedEvent[] eventsArray = events.toArray(new MavenProjectChangedEvent[events.size()]);
+ ArrayList<IMavenProjectChangedListener> listeners = new ArrayList<IMavenProjectChangedListener>();
+ synchronized(this.projectChangeListeners) {
+ listeners.addAll(this.projectChangeListeners);
+ }
+ listeners.addAll(ExtensionReader.readProjectChangedEventListenerExtentions());
+ for(IMavenProjectChangedListener listener : listeners) {
+ listener.mavenProjectChanged(eventsArray, monitor);
+ }
+ }
+ }
+
+ public MavenProjectFacade getMavenProject(String groupId, String artifactId, String version) {
+ return projectRegistry.getProjectFacade(groupId, artifactId, version);
+ }
+
+ MavenExecutionResult readProjectWithDependencies(IFile pomFile, ResolverConfiguration resolverConfiguration,
+ MavenUpdateRequest updateRequest, IProgressMonitor monitor) {
+ return readProjectWithDependencies(projectRegistry, pomFile, resolverConfiguration, updateRequest, monitor);
+ }
+
+ private MavenExecutionResult readProjectWithDependencies(IProjectRegistry state, IFile pomFile, ResolverConfiguration resolverConfiguration,
+ MavenUpdateRequest updateRequest, IProgressMonitor monitor) {
+
+ try {
+ MavenExecutionRequest request = createExecutionRequest(state, pomFile, resolverConfiguration, monitor);
+ getMaven().populateDefaults(request);
+ request.setOffline(updateRequest.isOffline());
+ request.getProjectBuildingRequest().setResolveDependencies(true);
+ return getMaven().readProject(request, monitor);
+ } catch(CoreException ex) {
+ DefaultMavenExecutionResult result = new DefaultMavenExecutionResult();
+ result.addException(ex);
+ return result;
+ }
+
+ }
+
+ public IMavenProjectFacade[] getProjects() {
+ return projectRegistry.getProjects();
+ }
+
+ public IMavenProjectFacade getProject(IProject project) {
+ return projectRegistry.getProjectFacade(getPom(project));
+ }
+
+ public boolean setResolverConfiguration(IProject project, ResolverConfiguration configuration) {
+ MavenProjectFacade projectFacade = create(project, new NullProgressMonitor());
+ if(projectFacade!=null) {
+ projectFacade.setResolverConfiguration(configuration);
+ }
+ return saveResolverConfiguration(project, configuration);
+ }
+
+ /**
+ * Context
+ */
+ static class Context {
+ final IProjectRegistry state;
+
+ final ResolverConfiguration resolverConfiguration;
+
+ final IFile pom;
+
+ Context(IProjectRegistry state, ResolverConfiguration resolverConfiguration, IFile pom) {
+ this.state = state;
+ this.resolverConfiguration = resolverConfiguration;
+ this.pom = pom;
+ }
+ }
+
+ public MavenExecutionRequest createExecutionRequest(IFile pom, ResolverConfiguration resolverConfiguration, IProgressMonitor monitor) throws CoreException {
+ return createExecutionRequest(projectRegistry, pom, resolverConfiguration, monitor);
+ }
+
+ private MavenExecutionRequest createExecutionRequest(IProjectRegistry state, IFile pom, ResolverConfiguration resolverConfiguration, IProgressMonitor monitor) throws CoreException {
+ MavenExecutionRequest request = getMaven().createExecutionRequest(monitor);
+
+ return configureExecutionRequest(request, state, pom, resolverConfiguration);
+ }
+
+ private MavenExecutionRequest configureExecutionRequest(MavenExecutionRequest request, IProjectRegistry state,
+ IFile pom, ResolverConfiguration resolverConfiguration) throws CoreException {
+ request.setPom(pom.getLocation().toFile());
+
+ request.addActiveProfiles(resolverConfiguration.getActiveProfileList());
+
+ // temporary solution for https://issues.sonatype.org/browse/MNGECLIPSE-1607
+ Properties systemProperties = new Properties();
+ EnvironmentUtils.addEnvVars(systemProperties);
+ systemProperties.putAll(System.getProperties());
+ request.setSystemProperties(systemProperties);
+
+ // eclipse workspace repository implements both workspace dependency resolution
+ // and inter-module dependency resolution for multi-module projects.
+
+ request.setLocalRepository(getMaven().getLocalRepository());
+ request.setWorkspaceReader(getWorkspaceReader(state, pom, resolverConfiguration));
+
+ return request;
+ }
+
+ private EclipseWorkspaceArtifactRepository getWorkspaceReader(IProjectRegistry state, IFile pom,
+ ResolverConfiguration resolverConfiguration) {
+ Context context = new Context(state, resolverConfiguration, pom);
+ EclipseWorkspaceArtifactRepository workspaceReader = new EclipseWorkspaceArtifactRepository(context);
+ return workspaceReader;
+ }
+
+ public MavenArtifactRepository getWorkspaceLocalRepository() throws CoreException {
+ ResolverConfiguration resolverConfiguration = new ResolverConfiguration();
+ resolverConfiguration.setResolveWorkspaceProjects(true);
+ EclipseWorkspaceArtifactRepository workspaceReader = getWorkspaceReader(projectRegistry, null,
+ resolverConfiguration);
+
+ DelegatingLocalArtifactRepository localRepo = new DelegatingLocalArtifactRepository(getMaven().getLocalRepository());
+ localRepo.setIdeWorkspace(workspaceReader);
+
+ return localRepo;
+ }
+
+ MutableProjectRegistry newMutableProjectRegistry() {
+ return new MutableProjectRegistry(projectRegistry);
+ }
+
+ /**
+ * Applies mutable project registry to the primary project registry and
+ * and corresponding MavenProjectChangedEvent's to all registered
+ * IMavenProjectChangedListener's.
+ *
+ * This method must be called from a thread holding workspace root's lock.
+ *
+ * @throws StaleMutableProjectRegistryException if primary project registry
+ * was modified after mutable registry has been created
+ */
+ void applyMutableProjectRegistry(MutableProjectRegistry newState, IProgressMonitor monitor) {
+ List<MavenProjectChangedEvent> events = projectRegistry.apply(newState);
+ stateReader.writeWorkspaceState(projectRegistry);
+ notifyProjectChangeListeners(events, monitor);
+ }
+
+ IMaven getMaven() {
+ return maven;
+ }
+
+
+ ILifecycleMapping getLifecycleMapping(IFile pom, MavenProject project, ResolverConfiguration resolverConfiguration, IProgressMonitor monitor) {
+ String mappingId = null;
+
+ if (project.equals(pom.getParent())) {
+ throw new IllegalArgumentException("Nested workspace module " + pom); //$NON-NLS-1$
+ }
+
+ if ("pom".equals(project.getPackaging())) { //$NON-NLS-1$
+ return new NoopLifecycleMapping();
+ }
+
+ Plugin plugin = project.getPlugin( "org.eclipse.m2e:lifecycle-mapping" ); //$NON-NLS-1$
+
+ Xpp3Dom configuration = null;
+
+ if (plugin != null) {
+ configuration = (Xpp3Dom) plugin.getConfiguration();
+ if (configuration != null) {
+ Xpp3Dom mappingIdDom = configuration.getChild("mappingId"); //$NON-NLS-1$
+ if (mappingIdDom != null) {
+ mappingId = mappingIdDom.getValue();
+ }
+ }
+ }
+
+ ILifecycleMapping lifecycleMapping = null;
+ if (mappingId == null || mappingId.length() <= 0) {
+ lifecycleMapping = LifecycleMappingFactory.getLifecycleMappingFor(project.getPackaging());
+ } else {
+ lifecycleMapping = LifecycleMappingFactory.getLifecycleMapping(mappingId);
+ }
+
+ if(configuration != null && lifecycleMapping instanceof CustomizableLifecycleMapping) {
+ CustomizableLifecycleMapping custmizableMapping = (CustomizableLifecycleMapping) lifecycleMapping;
+
+ Xpp3Dom configuratorsDom = configuration.getChild("configurators"); //$NON-NLS-1$
+ Xpp3Dom executionsDom = configuration.getChild("mojoExecutions"); //$NON-NLS-1$
+
+ if(configuratorsDom != null) {
+ for(Xpp3Dom configuratorDom : configuratorsDom.getChildren("configurator")) { //$NON-NLS-1$
+ String configuratorId = configuratorDom.getAttribute("id"); //$NON-NLS-1$
+ AbstractProjectConfigurator configurator = LifecycleMappingFactory.getProjectConfigurator(configuratorId);
+ if(configurator == null) {
+ String message = "Configurator '"
+ + configuratorId
+ + "' is not available for project '"
+ + pom.getProject().getName()
+ + "'. To enable full functionality, install the configurator and run Maven->Update Project Configuration.";
+ MavenPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, IMavenConstants.PLUGIN_ID, message));
+ MavenPlugin.getDefault().getConsole().logError(message);
+// throw new IllegalArgumentException(message);
+ } else {
+ custmizableMapping.addConfigurator(configurator);
+ }
+ }
+ }
+
+ if(executionsDom != null) {
+ for(Xpp3Dom execution : executionsDom.getChildren("mojoExecution")) { //$NON-NLS-1$
+ String strRunOnIncremental = execution.getAttribute("runOnIncremental"); //$NON-NLS-1$
+ custmizableMapping.addConfigurator(MojoExecutionProjectConfigurator.fromString(execution.getValue(),
+ toBool(strRunOnIncremental, true)));
+ }
+ }
+ }
+
+ if (lifecycleMapping == null) {
+ // Do not create error marker here - it is created in ProjectConfigurationManager.validateLifecycleMappingConfiguration
+ String msg = "Project " + pom.getProject().getName() + " uses unknown or missing lifecycle mapping with id='"
+ + mappingId + "', project packaging type='" + project.getPackaging() + "'.";
+ //Exception e = new Exception(msg);
+ //MavenLogger.log(msg, e);
+ console.logError(msg);
+ return new MissingLifecycleMapping(mappingId);
+ }
+
+ return lifecycleMapping;
+ }
+
+ private boolean toBool(String value, boolean def) {
+ if(value == null || value.length() == 0) {
+ return def;
+ }
+ return Boolean.parseBoolean(value);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java
new file mode 100644
index 00000000..56452fae
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryReader.java
@@ -0,0 +1,216 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.osgi.service.resolver.VersionRange;
+
+import org.codehaus.plexus.util.IOUtil;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+
+
+/**
+ * Workspace state reader
+ *
+ * @author Eugene Kuleshov
+ */
+public class ProjectRegistryReader {
+
+ private static final String WORKSPACE_STATE = "workspaceState.ser"; //$NON-NLS-1$
+
+ private final File stateFile;
+
+ private static PackageAdmin packageAdmin;
+
+ public ProjectRegistryReader(File stateLocationDir) {
+ this.stateFile = new File(stateLocationDir, WORKSPACE_STATE);
+ }
+
+ public ProjectRegistry readWorkspaceState(final ProjectRegistryManager managerImpl) {
+ if(stateFile.exists()) {
+ final PackageAdmin packageAdmin = getPackageAdmin();
+ ObjectInputStream is = null;
+ try {
+ is = new ObjectInputStream(new BufferedInputStream(new FileInputStream(stateFile))) {
+ {
+ enableResolveObject(true);
+ }
+
+ protected Object resolveObject(Object o) throws IOException {
+ if(o instanceof IPathReplace) {
+ return ((IPathReplace) o).getPath();
+ } else if(o instanceof IFileReplace) {
+ return ((IFileReplace) o).getFile();
+ } else if(o instanceof MavenProjectManagerImplReplace) {
+ return managerImpl;
+ }
+ return super.resolveObject(o);
+ }
+
+ protected java.lang.Class<?> resolveClass(java.io.ObjectStreamClass desc) throws IOException,
+ ClassNotFoundException {
+ String symbolicName = (String) readObject();
+ if(symbolicName == null) {
+ return super.resolveClass(desc);
+ }
+ String versionStr = (String) readObject();
+ Version version = Version.parseVersion(versionStr);
+ VersionRange versionRange = new VersionRange(version, true, version, true);
+ Bundle[] bundles = packageAdmin.getBundles(symbolicName, versionRange.toString());
+ if(bundles == null || bundles.length != 1) {
+ throw new ClassNotFoundException("Could not find bundle " + symbolicName + "/" + version //$NON-NLS-1$ //$NON-NLS-2$
+ + " required to load class " + desc.getName()); //$NON-NLS-1$
+ }
+ return bundles[0].loadClass(desc.getName());
+ };
+ };
+ return (ProjectRegistry) is.readObject();
+ } catch(Exception ex) {
+ MavenLogger.log("Can't read workspace state", ex);
+ } finally {
+ IOUtil.close(is);
+ }
+ }
+ return null;
+ }
+
+ private static synchronized PackageAdmin getPackageAdmin() {
+ // TODO inject dependencies already!
+ if(packageAdmin == null) {
+ BundleContext context = MavenPlugin.getDefault().getBundleContext();
+ ServiceReference serviceReference = context.getServiceReference(PackageAdmin.class.getName());
+ packageAdmin = (PackageAdmin) context.getService(serviceReference);
+ }
+ return packageAdmin;
+ }
+
+ public void writeWorkspaceState(ProjectRegistry state) {
+ final ClassLoader thisClassloader = getClass().getClassLoader();
+
+ final PackageAdmin packageAdmin = getPackageAdmin();
+
+ ObjectOutputStream os = null;
+ try {
+ os = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(stateFile))) {
+ {
+ enableReplaceObject(true);
+ }
+
+ protected Object replaceObject(Object o) throws IOException {
+ if(o instanceof IPath) {
+ return new IPathReplace((IPath) o);
+ } else if(o instanceof IFile) {
+ return new IFileReplace((IFile) o);
+ } else if(o instanceof ProjectRegistryManager) {
+ return new MavenProjectManagerImplReplace();
+ }
+ return super.replaceObject(o);
+ }
+
+ protected void annotateClass(java.lang.Class<?> cl) throws IOException {
+ // if the class is visible through this classloader, assume it will be during reading stream back
+ try {
+ Class<?> target = cl;
+ while(target.isArray()) {
+ target = target.getComponentType();
+ }
+
+ if(target.isPrimitive() || target.equals(thisClassloader.loadClass(target.getName()))) {
+ writeObject(null); // TODO is there a better way?
+ return;
+ }
+ } catch(ClassNotFoundException ex) {
+ // fall through
+ }
+
+ // foreign class
+ Bundle bundle = packageAdmin.getBundle(cl);
+ if(bundle != null) {
+ writeObject(bundle.getSymbolicName());
+ writeObject(bundle.getVersion().toString());
+ }
+
+ // TODO this will likely fail during desirialization
+ };
+ };
+ synchronized(state) { // see MNGECLIPSE-860
+ os.writeObject(state);
+ }
+ } catch(Exception ex) {
+ MavenLogger.log("Can't write workspace state", ex);
+ } finally {
+ IOUtil.close(os);
+ }
+ }
+
+ /**
+ * IPath replacement used for object serialization
+ */
+ private static final class IPathReplace implements Serializable {
+ private static final long serialVersionUID = -2361259525684491181L;
+
+ private final String path;
+
+ public IPathReplace(IPath path) {
+ this.path = path.toPortableString();
+ }
+
+ public IPath getPath() {
+ return Path.fromPortableString(path);
+ }
+ }
+
+ /**
+ * IFile replacement used for object serialization
+ */
+ private static final class IFileReplace implements Serializable {
+ private static final long serialVersionUID = -7266001068347075329L;
+
+ private final String path;
+
+ public IFileReplace(IFile file) {
+ this.path = file.getFullPath().toPortableString();
+ }
+
+ public IFile getFile() {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ return root.getFile(Path.fromPortableString(path));
+ }
+ }
+
+ static final class MavenProjectManagerImplReplace implements Serializable {
+ private static final long serialVersionUID = 1995671440438776471L;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryRefreshJob.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryRefreshJob.java
new file mode 100644
index 00000000..ff0eeb51
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/ProjectRegistryRefreshJob.java
@@ -0,0 +1,233 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
+import org.eclipse.ui.progress.IProgressConstants;
+
+import org.eclipse.m2e.core.actions.OpenMavenConsoleAction;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.jobs.IBackgroundProcessingQueue;
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+
+public class ProjectRegistryRefreshJob extends Job implements IResourceChangeListener, IPreferenceChangeListener, IBackgroundProcessingQueue {
+
+ private static final int DELTA_FLAGS = IResourceDelta.CONTENT | IResourceDelta.MOVED_FROM | IResourceDelta.MOVED_TO
+ | IResourceDelta.COPIED_FROM | IResourceDelta.REPLACED;
+
+ private final List<MavenUpdateRequest> queue = new ArrayList<MavenUpdateRequest>();
+
+ private final ProjectRegistryManager manager;
+
+ private final IMavenConfiguration mavenConfiguration;
+
+ private final MavenConsole console;
+
+ public ProjectRegistryRefreshJob(ProjectRegistryManager manager, MavenConsole console, IMavenConfiguration mavenConfiguration) {
+ super(Messages.ProjectRegistryRefreshJob_title);
+ this.manager = manager;
+ this.mavenConfiguration = mavenConfiguration;
+ this.console = console;
+ setRule(ResourcesPlugin.getWorkspace().getRuleFactory().buildRule());
+ setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
+ }
+
+ public void refresh(MavenUpdateRequest updateRequest) {
+ queue(updateRequest);
+ schedule(1000L);
+ }
+
+ // Job
+
+ public IStatus run(IProgressMonitor monitor) {
+ monitor.beginTask(Messages.ProjectRegistryRefreshJob_task_refreshing, IProgressMonitor.UNKNOWN);
+ ArrayList<MavenUpdateRequest> requests;
+ synchronized(this.queue) {
+ requests = new ArrayList<MavenUpdateRequest>(this.queue);
+ this.queue.clear();
+ }
+
+ try {
+ MutableProjectRegistry newState = manager.newMutableProjectRegistry();
+ try {
+
+ for (MavenUpdateRequest request : requests) {
+ if(monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+
+ manager.refresh(newState, request, monitor);
+ }
+
+ ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRoot();
+ getJobManager().beginRule(rule, monitor);
+ try {
+ manager.applyMutableProjectRegistry(newState, monitor);
+ } finally {
+ getJobManager().endRule(rule);
+ }
+ } finally {
+ newState.close();
+ }
+
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+
+ } catch(OperationCanceledException ex) {
+ console.logMessage("Refreshing Maven model is canceled");
+
+ } catch (StaleMutableProjectRegistryException e) {
+ synchronized(this.queue) {
+ this.queue.addAll(0, requests);
+ if(!this.queue.isEmpty()) {
+ schedule(1000L);
+ }
+ }
+
+ } catch(Exception ex) {
+ MavenLogger.log(ex.getMessage(), ex);
+
+ } finally {
+ monitor.done();
+
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ // IResourceChangeListener
+
+ public void resourceChanged(IResourceChangeEvent event) {
+ boolean offline = mavenConfiguration.isOffline();
+ boolean updateSnapshots = false;
+
+ int type = event.getType();
+
+ if(IResourceChangeEvent.PRE_CLOSE == type || IResourceChangeEvent.PRE_DELETE == type) {
+ queue(new MavenUpdateRequest((IProject) event.getResource(), //
+ offline, updateSnapshots));
+
+ } else {
+ // if (IResourceChangeEvent.POST_CHANGE == type)
+ IResourceDelta delta = event.getDelta(); // workspace delta
+ IResourceDelta[] projectDeltas = delta.getAffectedChildren();
+ Set<IProject> removeProjects = new LinkedHashSet<IProject>();
+ Set<IProject> refreshProjects = new LinkedHashSet<IProject>();
+ for(int i = 0; i < projectDeltas.length; i++ ) {
+ try {
+ projectChanged(projectDeltas[i], removeProjects, refreshProjects);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+
+ // XXX consider to run refresh in offline mode when it is triggered by resource change
+ if(!removeProjects.isEmpty()) {
+ IProject[] projects = removeProjects.toArray(new IProject[removeProjects.size()]);
+ MavenUpdateRequest updateRequest = new MavenUpdateRequest(projects, offline, updateSnapshots);
+ updateRequest.setForce(false);
+ queue(updateRequest);
+ console.logMessage("Refreshing " + updateRequest.toString());
+ }
+ if(!refreshProjects.isEmpty()) {
+ IProject[] projects = refreshProjects.toArray(new IProject[refreshProjects.size()]);
+ MavenUpdateRequest updateRequest = new MavenUpdateRequest(projects, offline, updateSnapshots);
+ updateRequest.setForce(false);
+ queue(updateRequest);
+ console.logMessage("Refreshing " + updateRequest.toString());
+ }
+ }
+
+ synchronized(queue) {
+ if(!queue.isEmpty()) {
+ schedule(1000L);
+ }
+ }
+ }
+
+ private void projectChanged(IResourceDelta delta, Set<IProject> removeProjects, final Set<IProject> refreshProjects)
+ throws CoreException {
+ final IProject project = (IProject) delta.getResource();
+
+ for(IPath path : ProjectRegistryManager.METADATA_PATH) {
+ if (delta.findMember(path) != null) {
+ removeProjects.add(project);
+ return;
+ }
+ }
+
+ delta.accept(new IResourceDeltaVisitor() {
+ public boolean visit(IResourceDelta delta) {
+ IResource resource = delta.getResource();
+ if(resource instanceof IFile && IMavenConstants.POM_FILE_NAME.equals(resource.getName())) {
+ // XXX ignore output folders
+ if(delta.getKind() == IResourceDelta.REMOVED
+ || delta.getKind() == IResourceDelta.ADDED
+ || (delta.getKind() == IResourceDelta.CHANGED && ((delta.getFlags() & DELTA_FLAGS) != 0)))
+ {
+ // XXX check for interesting resources
+ refreshProjects.add(project);
+ }
+ }
+ return true;
+ }
+ });
+ }
+
+ private void queue(MavenUpdateRequest command) {
+ synchronized(queue) {
+ queue.add(command);
+ }
+ }
+
+ public void preferenceChange(PreferenceChangeEvent event) {
+ boolean offline = mavenConfiguration.isOffline();
+ boolean updateSnapshots = false;
+
+ if (event.getSource() instanceof IProject) {
+ queue(new MavenUpdateRequest(new IProject[] {(IProject) event.getSource()}, offline, updateSnapshots));
+ }
+ }
+
+ public boolean isEmpty() {
+ synchronized(queue) {
+ return queue.isEmpty();
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/RequiredCapability.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/RequiredCapability.java
new file mode 100644
index 00000000..0adf2681
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/RequiredCapability.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.io.Serializable;
+
+
+/**
+ * RequiredCapability
+ *
+ * @author igor
+ */
+public abstract class RequiredCapability implements Serializable {
+
+ private static final long serialVersionUID = -5445156687502685383L;
+
+ private final VersionlessKey versionlessKey;
+
+ public RequiredCapability(String namepsace, String id) {
+ if(namepsace == null || id == null) {
+ throw new NullPointerException();
+ }
+ this.versionlessKey = new VersionlessKey(namepsace, id);
+ }
+
+ public VersionlessKey getVersionlessKey() {
+ return versionlessKey;
+ }
+
+ /**
+ * Returns true if provided capability *potentially* satisfies this requirement. Capability/requirement match will be
+ * used to check if workspace project changes (new/changed/remove projects and metadata changes) affect other
+ * projects. isPotentialMatch Implementations should be good enough to avoid obviously pointless project dependency
+ * refreshes, but does not have to be perfectly precise.
+ */
+ public abstract boolean isPotentialMatch(Capability capability);
+
+ protected static <T> boolean eq(T a, T b) {
+ return a != null ? a.equals(b) : b == null;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/StaleMutableProjectRegistryException.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/StaleMutableProjectRegistryException.java
new file mode 100644
index 00000000..43f8ecd9
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/StaleMutableProjectRegistryException.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+/**
+ * StaleMutableProjectRegistryException
+ *
+ * @author igor
+ */
+public class StaleMutableProjectRegistryException extends IllegalStateException {
+
+ private static final long serialVersionUID = -1456658363775761949L;
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/VersionlessKey.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/VersionlessKey.java
new file mode 100644
index 00000000..55cef303
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/registry/VersionlessKey.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.project.registry;
+
+import java.io.Serializable;
+
+
+/**
+ * VersionlessKey
+ *
+ * @author igor
+ */
+public class VersionlessKey implements Serializable {
+ private static final long serialVersionUID = 2125977578206347429L;
+
+ private final String namespace;
+
+ private final String id;
+
+ public VersionlessKey(String namespace, String id) {
+ if(namespace == null || id == null) {
+ throw new NullPointerException();
+ }
+ this.namespace = namespace;
+ this.id = id;
+ }
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public int hashCode() {
+ int hash = namespace.hashCode();
+ hash = hash * 17 + id.hashCode();
+ return hash;
+ }
+
+ public boolean equals(Object obj) {
+ if(obj == this) {
+ return true;
+ }
+ if(!(obj instanceof VersionlessKey)) {
+ return false;
+ }
+ VersionlessKey other = (VersionlessKey) obj;
+ return namespace.equals(other.namespace) && id.equals(other.id);
+ }
+
+ public String toString() {
+ return namespace + "/" + id; //$NON-NLS-1$
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/IRepositoryDiscoverer.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/IRepositoryDiscoverer.java
new file mode 100644
index 00000000..4dfbb56d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/IRepositoryDiscoverer.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.repository;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+ * IRepositoryDiscoverer
+ *
+ * @author igor
+ */
+public interface IRepositoryDiscoverer {
+
+ /**
+ * Called during updateRegistry operation.
+ */
+ public void addRepositories(RepositoryRegistry registry, IProgressMonitor monitor) throws CoreException;
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/IRepositoryIndexer.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/IRepositoryIndexer.java
new file mode 100644
index 00000000..1573b657
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/IRepositoryIndexer.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.repository;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.m2e.core.repository.IRepository;
+
+/**
+ * IRepositoryIndexer
+ *
+ * @author igor
+ */
+public interface IRepositoryIndexer {
+
+ public String getIndexerId();
+
+ /**
+ * This method is called from a background thread which does not keep any workspace locks.
+ */
+ public void initialize(IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Called by repository registry when new repository is added.
+ *
+ * This method is called from a background thread which does not keep any workspace locks.
+ */
+ public void repositoryAdded(IRepository repository, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Called by repository registry when a repository is removed.
+ *
+ * This method is called from a background thread which does not keep any workspace locks.
+ */
+ public void repositoryRemoved(IRepository repository, IProgressMonitor monitor) throws CoreException;
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryInfo.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryInfo.java
new file mode 100644
index 00000000..a84aac55
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryInfo.java
@@ -0,0 +1,175 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.repository;
+
+import java.io.File;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+
+import org.apache.maven.artifact.repository.MavenArtifactRepository;
+import org.apache.maven.wagon.authentication.AuthenticationInfo;
+
+import org.eclipse.m2e.core.repository.IRepository;
+import org.eclipse.m2e.core.repository.IRepositoryRegistry;
+
+public class RepositoryInfo implements IRepository {
+
+ private final String id;
+ private final String repositoryUrl;
+ private final File basedir;
+ private final int scope;
+ private final AuthenticationInfo authInfo;
+
+ private String uid;
+
+ private String mirrorId;
+ private String mirrorOf;
+ private Set<IPath> projects = new HashSet<IPath>();
+
+ public RepositoryInfo(String id, String repositoryUrl, int scope, AuthenticationInfo authInfo) {
+ this(id, repositoryUrl, getBasedir(repositoryUrl), scope, authInfo);
+ }
+
+ public RepositoryInfo(String id, String repositoryUrl, File basedir, int scope, AuthenticationInfo authInfo) {
+ this.id = id;
+ this.repositoryUrl = repositoryUrl;
+ this.scope = scope;
+ this.authInfo = authInfo;
+ this.basedir = basedir;
+ }
+
+ public AuthenticationInfo getAuthenticationInfo() {
+ return authInfo;
+ }
+
+ public String getUrl() {
+ return repositoryUrl;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getMirrorId() {
+ return mirrorId;
+ }
+
+ public String getMirrorOf() {
+ return mirrorOf;
+ }
+
+ public void setMirrorOf(String mirrorOf) {
+ this.mirrorOf = mirrorOf;
+ }
+
+ public void setMirrorId(String mirrorId) {
+ this.mirrorId = mirrorId;
+ }
+
+ public Set<IPath> getProjects() {
+ return projects;
+ }
+
+ public void addProject(IPath project) {
+ if (isScope(IRepositoryRegistry.SCOPE_PROJECT)) {
+ projects.add(project);
+ }
+ }
+
+ public void removeProject(IPath project) {
+ projects.remove(project);
+ }
+
+ public String getUid() {
+ if (uid == null) {
+ uid = getUid(id, repositoryUrl, authInfo != null? authInfo.getUserName(): null);
+ }
+
+ return uid;
+ }
+
+ public static String getUid(String id, String repositoryUrl, String username) {
+ StringBuilder sb = new StringBuilder();
+ if (id != null) {
+ sb.append(id);
+ }
+ sb.append('|').append(repositoryUrl);
+ if (username != null) {
+ sb.append('|').append(username);
+ }
+ String uid;
+ try {
+ MessageDigest digest = MessageDigest.getInstance("MD5"); //$NON-NLS-1$
+ digest.update(sb.toString().getBytes());
+ byte messageDigest[] = digest.digest();
+ StringBuffer hexString = new StringBuffer();
+ for(int i = 0; i < messageDigest.length; i++ ) {
+ String hex = Integer.toHexString(0xFF & messageDigest[i]);
+ if(hex.length() == 1) {
+ hexString.append('0');
+ }
+ hexString.append(hex);
+ }
+ uid = hexString.toString();
+ } catch(NoSuchAlgorithmException ex) {
+ //this shouldn't happen with MD5
+ uid = sb.toString();
+ uid = uid.replace(':', '_').replace('/', '_').replace('|','_');
+ }
+ return uid;
+ }
+
+ public String getProtocol() {
+ return getProtocol(repositoryUrl);
+ }
+
+ // copy&paste from MavenArtifactRepository#protocol
+ public static String getProtocol(String repositoryUrl) {
+ final int pos = repositoryUrl.indexOf(":"); //$NON-NLS-1$
+
+ if(pos == -1) {
+ return "file"; //$NON-NLS-1$
+ }
+ return repositoryUrl.substring(0, pos).trim();
+ }
+
+ public static File getBasedir(String repositoryUrl) {
+ if (getProtocol(repositoryUrl).equalsIgnoreCase("file")) { //$NON-NLS-1$
+ // dirty trick!
+ MavenArtifactRepository trick = new MavenArtifactRepository();
+ trick.setUrl(repositoryUrl);
+ return new File(trick.getBasedir());
+ }
+ return null;
+ }
+
+ public File getBasedir() {
+ return basedir;
+ }
+
+ public boolean isScope(int scope) {
+ return (this.scope & scope) != 0;
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ if (id != null) {
+ sb.append(id).append('|');
+ }
+ sb.append(repositoryUrl);
+ return sb.toString();
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistry.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistry.java
new file mode 100644
index 00000000..03179291
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistry.java
@@ -0,0 +1,323 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.repository;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.settings.Mirror;
+import org.apache.maven.settings.Server;
+import org.apache.maven.settings.Settings;
+import org.apache.maven.wagon.authentication.AuthenticationInfo;
+
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactRepositoryRef;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.ISettingsChangeListener;
+import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.repository.IRepository;
+import org.eclipse.m2e.core.repository.IRepositoryRegistry;
+
+
+/**
+ * RepositoryRegistry
+ *
+ * @author igor
+ */
+public class RepositoryRegistry implements IRepositoryRegistry, IMavenProjectChangedListener, ISettingsChangeListener {
+
+ private final IMaven maven;
+
+ private final MavenProjectManager projectManager;
+
+ /**
+ * Maps repositoryUrl to IndexInfo of repository index
+ */
+ private final Map<String, RepositoryInfo> repositories = new ConcurrentHashMap<String, RepositoryInfo>();
+
+ /**
+ * Lazy instantiated local repository instance.
+ */
+ private RepositoryInfo localRepository;
+
+ /**
+ * Lock guarding lazy instantiation of localRepository instance
+ */
+ private final Object localRepositoryLock = new Object();
+
+ private final RepositoryInfo workspaceRepository;
+
+ private ArrayList<IRepositoryIndexer> indexers = new ArrayList<IRepositoryIndexer>();
+
+ private ArrayList<IRepositoryDiscoverer> discoverers = new ArrayList<IRepositoryDiscoverer>();
+
+ private final RepositoryRegistryUpdateJob job = new RepositoryRegistryUpdateJob(this);
+
+ public RepositoryRegistry(IMaven maven, MavenProjectManager projectManager) {
+ this.maven = maven;
+ this.projectManager = projectManager;
+
+ this.workspaceRepository = new RepositoryInfo(null/*id*/, "workspace://"/*url*/, null/*basedir*/, SCOPE_WORKSPACE, null/*auth*/); //$NON-NLS-1$
+ }
+
+ private RepositoryInfo newLocalRepositoryInfo() {
+ File localBasedir = new File(maven.getLocalRepositoryPath());
+ try {
+ localBasedir = localBasedir.getCanonicalFile();
+ } catch (IOException e) {
+ // will never happen
+ localBasedir = localBasedir.getAbsoluteFile();
+ }
+
+ String localUrl;
+ try {
+ localUrl = localBasedir.toURL().toExternalForm();
+ } catch(MalformedURLException ex) {
+ MavenLogger.log("Could not parse local repository path", ex);
+ localUrl = "file://" + localBasedir.getAbsolutePath(); //$NON-NLS-1$
+ }
+
+ // initialize local and workspace repositories
+ RepositoryInfo localRepository = new RepositoryInfo(null/*id*/, localUrl, localBasedir, SCOPE_LOCAL, null/*auth*/);
+ return localRepository;
+ }
+
+ public void mavenProjectChanged(MavenProjectChangedEvent[] events, IProgressMonitor monitor) {
+ /*
+ * This method is called while holding workspace lock. Avoid long-running operations if possible.
+ */
+
+ Settings settings = null;
+ try {
+ settings = maven.getSettings();
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+
+ for(MavenProjectChangedEvent event : events) {
+ IMavenProjectFacade oldFacade = event.getOldMavenProject();
+ if (oldFacade != null) {
+ removeProjectRepositories(oldFacade, monitor);
+ }
+ IMavenProjectFacade facade = event.getMavenProject();
+ if(facade != null) {
+ try {
+ addProjectRepositories(settings, facade, null /*asyncUpdate*/);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+
+ private void addProjectRepositories(Settings settings, IMavenProjectFacade facade, IProgressMonitor monitor) throws CoreException {
+ ArrayList<ArtifactRepositoryRef> repositories = getProjectRepositories(facade);
+
+ for (ArtifactRepositoryRef repo : repositories) {
+ RepositoryInfo repository = getRepository(repo);
+ if (repository != null) {
+ repository.addProject(facade.getPom().getFullPath());
+ continue;
+ }
+ AuthenticationInfo auth = getAuthenticationInfo(settings, repo.getId());
+ repository = new RepositoryInfo(repo.getId(), repo.getUrl(), SCOPE_PROJECT, auth);
+ repository.addProject(facade.getPom().getFullPath());
+
+ addRepository(repository, monitor);
+ }
+ }
+
+ public void addRepository(RepositoryInfo repository, IProgressMonitor monitor) {
+ if (!repositories.containsKey(repository.getUid())) {
+ repositories.put(repository.getUid(), repository);
+
+ for (IRepositoryIndexer indexer : indexers) {
+ try {
+ indexer.repositoryAdded(repository, monitor);
+ } catch (CoreException e) {
+ MavenLogger.log(e);
+ }
+ }
+ }
+ }
+
+ private void removeProjectRepositories(IMavenProjectFacade facade, IProgressMonitor monitor) {
+ ArrayList<ArtifactRepositoryRef> repositories = getProjectRepositories(facade);
+
+ for (ArtifactRepositoryRef repo : repositories) {
+ RepositoryInfo repository = getRepository(repo);
+ if (repository != null && repository.isScope(SCOPE_PROJECT)) {
+ repository.removeProject(facade.getPom().getFullPath());
+ if (repository.getProjects().isEmpty()) {
+ removeRepository(repository, monitor);
+ }
+ }
+ }
+ }
+
+ private void removeRepository(RepositoryInfo repository, IProgressMonitor monitor) {
+ repositories.remove(repository.getUid());
+
+ for (IRepositoryIndexer indexer : indexers) {
+ try {
+ indexer.repositoryRemoved(repository, monitor);
+ } catch (CoreException e) {
+ MavenLogger.log(e);
+ }
+ }
+ }
+
+ private ArrayList<ArtifactRepositoryRef> getProjectRepositories(IMavenProjectFacade facade) {
+ ArrayList<ArtifactRepositoryRef> repositories = new ArrayList<ArtifactRepositoryRef>();
+ repositories.addAll(facade.getArtifactRepositoryRefs());
+ repositories.addAll(facade.getPluginArtifactRepositoryRefs());
+ return repositories;
+ }
+
+
+ public AuthenticationInfo getAuthenticationInfo(Settings settings, String id) throws CoreException {
+ if (settings == null) {
+ return null;
+ }
+
+ Server server = settings.getServer(id);
+ if (server == null || server.getUsername() == null) {
+ return null;
+ }
+
+ server = maven.decryptPassword(server);
+
+ AuthenticationInfo info = new AuthenticationInfo();
+ info.setUserName(server.getUsername());
+ info.setPassword(server.getPassword());
+ return info;
+ }
+
+ public void updateRegistry(IProgressMonitor monitor) throws CoreException {
+ Settings settings = maven.getSettings();
+ List<Mirror> mirrors = maven.getMirrors();
+
+ // initialize indexers
+ for (IRepositoryIndexer indexer : indexers) {
+ indexer.initialize(monitor);
+ }
+
+ // process configured repositories
+
+ Map<String, RepositoryInfo> oldRepositories = new HashMap<String, RepositoryInfo>(repositories);
+ repositories.clear();
+
+ addRepository(this.workspaceRepository, monitor);
+
+ synchronized(localRepositoryLock) {
+ this.localRepository = newLocalRepositoryInfo();
+ }
+ addRepository(this.localRepository, monitor);
+
+ // mirrors
+ for(Mirror mirror : mirrors) {
+ AuthenticationInfo auth = getAuthenticationInfo(settings, mirror.getId());
+ RepositoryInfo repository = new RepositoryInfo(mirror.getId(), mirror.getUrl(), SCOPE_SETTINGS, auth);
+ repository.setMirrorOf(mirror.getMirrorOf());
+ addRepository(repository, monitor);
+ }
+
+ // repositories from settings.xml
+ ArrayList<ArtifactRepository> repos = new ArrayList<ArtifactRepository>();
+ repos.addAll(maven.getArtifactRepositories(false));
+ repos.addAll(maven.getPluginArtifactRepositories(false));
+
+ for(ArtifactRepository repo : repos) {
+ Mirror mirror = maven.getMirror(repo);
+ AuthenticationInfo auth = getAuthenticationInfo(settings, repo.getId());
+ RepositoryInfo repository = new RepositoryInfo(repo.getId(), repo.getUrl(), SCOPE_SETTINGS, auth);
+ if (mirror != null) {
+ repository.setMirrorId(mirror.getId());
+ }
+ addRepository(repository, monitor);
+ }
+
+ // project-specific repositories
+ for (IMavenProjectFacade facade : projectManager.getProjects()) {
+ addProjectRepositories(settings, facade, monitor);
+ }
+
+ // custom repositories
+ for (IRepositoryDiscoverer discoverer : discoverers) {
+ discoverer.addRepositories(this, monitor);
+ }
+
+ oldRepositories.keySet().removeAll(repositories.keySet());
+ for (RepositoryInfo repository : oldRepositories.values()) {
+ removeRepository(repository, monitor);
+ }
+ }
+
+ public List<IRepository> getRepositories(int scope) {
+ ArrayList<IRepository> result = new ArrayList<IRepository>();
+ for (RepositoryInfo repository : repositories.values()) {
+ if (repository.isScope(scope)) {
+ result.add(repository);
+ }
+ }
+ return result;
+ }
+
+ public void updateRegistry() {
+ job.updateRegistry();
+ }
+
+ public void addRepositoryIndexer(IRepositoryIndexer indexer) {
+ this.indexers.add(indexer);
+ }
+
+ public void addRepositoryDiscoverer(IRepositoryDiscoverer discoverer) {
+ this.discoverers.add(discoverer);
+ }
+
+ public RepositoryInfo getRepository(ArtifactRepositoryRef ref) {
+ String uid = RepositoryInfo.getUid(ref.getId(), ref.getUrl(), ref.getUsername());
+ return repositories.get(uid);
+ }
+
+ public IRepository getWorkspaceRepository() {
+ return workspaceRepository;
+ }
+
+ public IRepository getLocalRepository() {
+ synchronized(localRepositoryLock) {
+ if(localRepository == null) {
+ localRepository = newLocalRepositoryInfo();
+ }
+ }
+
+ return localRepository;
+ }
+
+ public void settingsChanged(Settings settings) {
+ updateRegistry();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistryUpdateJob.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistryUpdateJob.java
new file mode 100644
index 00000000..9cf09960
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/repository/RepositoryRegistryUpdateJob.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.internal.repository;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.jobs.IBackgroundProcessingQueue;
+
+/**
+ * RepositoryRegistryUpdateJob
+ *
+ * @author igor
+ */
+public class RepositoryRegistryUpdateJob extends Job implements IBackgroundProcessingQueue {
+
+ private final RepositoryRegistry registry;
+
+ private final ArrayList<Object> queue = new ArrayList<Object>();
+
+ public RepositoryRegistryUpdateJob(RepositoryRegistry registry) {
+ super(Messages.RepositoryRegistryUpdateJob_title);
+ this.registry = registry;
+ }
+
+ public IStatus run(IProgressMonitor monitor) {
+ synchronized(queue) {
+ queue.clear();
+ }
+ try {
+ registry.updateRegistry(monitor);
+ } catch(CoreException ex) {
+ return ex.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+
+ public boolean isEmpty() {
+ synchronized(queue) {
+ return queue.isEmpty();
+ }
+ }
+
+ public void updateRegistry() {
+ synchronized(queue) {
+ queue.add(new Object());
+ schedule(1000L);
+ }
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/jobs/IBackgroundProcessingQueue.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/jobs/IBackgroundProcessingQueue.java
new file mode 100644
index 00000000..bc9e3986
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/jobs/IBackgroundProcessingQueue.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.jobs;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+
+
+/**
+ * Common interface implemented by all m2e background processing jobs.
+ *
+ * @author igor
+ */
+public interface IBackgroundProcessingQueue {
+ public void join() throws InterruptedException;
+
+ public boolean isEmpty();
+
+ public IStatus run(IProgressMonitor monitor);
+
+ public boolean cancel();
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/messages.properties b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/messages.properties
new file mode 100644
index 00000000..14080ec8
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/messages.properties
@@ -0,0 +1,152 @@
+#
+# Copyright (c) 2007, 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
+#
+
+action.moduleProjectWizardAction=New Maven Module Project
+artifactComponent.artifact=Artifact
+artifactComponent.artifactId=Artifact Id\:
+artifactComponent.description=Description\:
+artifactComponent.groupId=Group Id\:
+artifactComponent.name=Name\:
+artifactComponent.package=Package\:
+artifactComponent.packaging=Packaging\:
+artifactComponent.version=Version\:
+directoriesComponent.projectLayout=Project layout
+launch.browseFs=Browse File Syste&m...
+launch.browseVariables=&Variables...
+launch.browseWorkspace=Browse &Workspace...
+launch.choosePomDir=Choose &Base directory
+launch.errorPomMissing=Base directory doesn't exist
+launch.errorSelectPom=Please select Base directory first
+launch.goals=&Select...
+launch.goalsDialog.lifecycleBuild=Build Lifecycle Phases
+launch.goalsDialog.lifecycleClean=Clean Lifecycle Phases
+launch.goalsDialog.lifecycleSite=Site Lifecycle Phases
+launch.goalsDialog.title=Goals
+launch.goalsLabel=&Goals\:
+launch.mainTabName=Main
+launch.pomDirectoryDoesntExist=Base directory doesn't exist or can't be read
+launch.pomDirectoryEmpty=Base directory should be specified
+launch.pomGroup=Base directory:
+launch.profilesLabel=&Profiles\:
+launch.propAddButton=&Add...
+launch.propName=Parameter Name
+launch.propRemoveButton=&Remove
+launch.propEditButton=E&dit...
+launch.propValue=Value
+launch.propertyDialog.browseVariables=Varia&bles...
+launch.propertyDialog.name=Name\:
+launch.propertyDialog.value=Value\:
+locationComponent.atExternal=Create project at e&xternal location
+locationComponent.browse=B&rowse...
+locationComponent.directory=&Location\:
+locationComponent.inWorkspace=Create project in &workspace
+locationComponent.location=Location
+locationComponent.selectLocation=Select Location
+plugin.markerArtifactResolutionError=Artifact resolution error\:
+plugin.markerBuildError=Project build error\: {0}
+plugin.markerParsingError=Parsing error\:
+preferences.checksumPolicyFail=fail
+preferences.checksumPolicyIgnore=ignore
+preferences.checksumPolicyWarn=warning
+preferences.debugOutput=Debu&g Output
+preferences.downloadSources=Do&wnload Artifact Sources
+preferences.downloadJavadoc=Download Artifact &JavaDoc
+preferences.globalChecksumPolicy=Global Checksum &Policy\:
+preferences.globalSettingsFile=&Global Settings File\:
+preferences.goalOnImport=Goals to run on project i&mport\:
+preferences.goalOnUpdate=Goals to run when &updating project configuration\:
+preferences.localRepository=Local Repository\:
+preferences.offline=&Offline
+preferences.refreshButton=Re&fresh Settings
+preferences.reindexButton=Re&index
+preferences.userSettingsFile=User Settings File\:
+projectSelectionDialog.title=Select a Maven project
+resolverConfiguration.advanced=Ad&vanced
+resolverConfiguration.enableResourceFiltering=Enable &resource filtering
+resolverConfiguration.profiles=&Profiles\:
+resolverConfiguration.projectsForModules=&Separate projects for modules
+resolverConfiguration.resolveWorkspaceProjects=Resolve &Workspace projects
+resolverConfiguration.template=Name &template\:
+resolverConfiguration.templateDescription=Optional Eclipse project name template, e.g. "[groupId].[artifactId]-[version]"
+resolverConfiguration.useMavenOutputFolders=Use Maven &output folders
+wizard.import.page.browse=&Browse...
+wizard.import.page.deselectAll=&Deselect All
+wizard.import.page.projects=&Projects\:
+wizard.import.page.refresh=&Refresh
+wizard.import.page.root=&Root Directory\:
+wizard.import.page.scanningErrors=Scanning errors ({0})\:
+wizard.import.page.selectAll=Select &All
+wizard.import.page.selectRootFolder=Select Root Folder
+wizard.import.validator.projectExists=Project {0} already exists\n Add a version or custom suffix using "Name template" in "Advanced" settings
+wizard.import.validator.workspaceFolder=Can't import project {0} from an existing workspace folder
+wizard.module.page.archetype.title=New Maven Module
+wizard.module.page.artifact.title=New Maven Module
+wizard.module.page.parameters.title=New Maven Module
+wizard.module.page.parent.browse=Br&owse...
+wizard.module.page.parent.description=Select the module name and parent
+wizard.module.page.parent.moduleName=&Module Name\:
+wizard.module.page.parent.parentProject=Parent Project\:
+wizard.module.page.parent.title=New Maven Module
+wizard.module.page.parent.validator.moduleName=Enter a module name.
+wizard.module.page.parent.validator.nameExists=A resource with this name already exists.
+wizard.module.page.parent.validator.parentProject=Select a parent project.
+wizard.module.page.title=New Maven module
+wizard.module.title=New Maven Module
+wizard.project.error.pomAlreadyExists=A pom.xml file already exists in the destination folder.
+wizard.project.error.pomExists=POM already exists
+wizard.project.job.creating=Creating {0}
+wizard.project.job.creatingProject=Creating project "{0}"
+wizard.project.job.failed=Failed to create project "{0}"
+wizard.project.page.archetype.archetypes=Archetypes\:
+wizard.project.page.archetype.column.artifactId=Artifact Id
+wizard.project.page.archetype.column.groupId=Group Id
+wizard.project.page.archetype.column.version=Version
+wizard.project.page.archetype.description=Select an Archetype
+wizard.project.page.archetype.details=Archetype Details
+wizard.project.page.archetype.details.description=Description\:
+wizard.project.page.archetype.details.repository=Repository\:
+wizard.project.page.archetype.retrievingArchetypes=Retrieving archetypes\:
+wizard.project.page.archetype.title=New Maven project
+wizard.project.page.artifact.parent.artifactId=Artifact Id\:
+wizard.project.page.artifact.parent.browse=Browse...
+wizard.project.page.artifact.parent.clear=Clear
+wizard.project.page.artifact.parent.groupId=Group Id\:
+wizard.project.page.artifact.parent.title=Parent Project
+wizard.project.page.artifact.parent.version=Version\:
+wizard.project.page.dependencies.add=&Add...
+wizard.project.page.dependencies.dependencies=Maven dependencies\:
+wizard.project.page.dependencies.description=Add additional dependencies to the project.
+wizard.project.page.dependencies.remove=&Remove
+wizard.project.page.dependencies.title=Select additional dependencies
+wizard.project.page.maven2.archetype.parameters.description=Specify Archetype parameters
+wizard.project.page.maven2.description=Configure project
+wizard.project.page.maven2.title=New Maven project
+wizard.project.page.maven2.validator.artifactID=Enter an artifact id.
+wizard.project.page.maven2.validator.artifactIDnospaces=Artifact id cannot contain spaces.
+wizard.project.page.maven2.validator.artifactIDinvalid=Invalid artifact id: {0}
+wizard.project.page.maven2.validator.groupID=Enter a group id for the artifact.
+wizard.project.page.maven2.validator.groupIDnospaces=Group id cannot contain spaces.
+wizard.project.page.maven2.validator.groupIDinvalid=Invalid group id: {0}
+wizard.project.page.maven2.validator.projectNameInvalid=Invalid project name: {0}
+wizard.project.page.maven2.validator.packaging=Enter a packaging for the artifact.
+wizard.project.page.maven2.validator.parent=To specify a parent project, set the parent group id, artifact id and version.
+wizard.project.page.maven2.validator.requiredProperty=Required property "{0}" is not set.
+wizard.project.page.maven2.validator.version=Enter a version for the artifact.
+wizard.project.page.project.description=Select project name and location
+wizard.project.page.project.projectName=&Project name\:
+wizard.project.page.project.simpleProject=Create a &simple project (skip archetype selection)
+wizard.project.page.project.title=New Maven project
+wizard.project.page.project.validator.invalidLocation=Invalid project location path
+wizard.project.page.project.validator.projectExists=Project "{0}" already exists.
+wizard.project.page.project.validator.projectLocation=Enter a location for the project.
+wizard.project.page.project.validator.projectName=Enter a project name.
+wizard.project.title=New Maven Project
+jira.username=Jira username (will use default user if empty)
+jira.password=Jira password
+pomEditor.defaultPage=Open XML page in the POM editor by default
+pomEditor.showAdvancedTabs=Show advanced tabs in the POM editor \ No newline at end of file
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/AbstractProjectScanner.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/AbstractProjectScanner.java
new file mode 100644
index 00000000..c996a869
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/AbstractProjectScanner.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+
+/**
+ * Project Scanner
+ *
+ * @author Eugene Kuleshov
+ */
+public abstract class AbstractProjectScanner<T extends MavenProjectInfo> {
+
+ private final List<T> projects = new ArrayList<T>();
+ private final List<Throwable> errors = new ArrayList<Throwable>();
+
+ /**
+ * Returns <code>List</code> of {@link MavenProjectInfo}
+ */
+ public List<T> getProjects() {
+ return projects;
+ }
+
+ /**
+ * Returns <code>List</code> of <code>Exception</code>
+ */
+ public List<Throwable> getErrors() {
+ return this.errors;
+ }
+
+ protected void addProject(T mavenProjectInfo) {
+ projects.add(mavenProjectInfo);
+ }
+
+ protected void addError(Throwable exception) {
+ errors.add(exception);
+ }
+
+ public abstract String getDescription();
+
+ public abstract void run(IProgressMonitor monitor) throws InterruptedException;
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenMarkerManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenMarkerManager.java
new file mode 100644
index 00000000..a96622ba
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenMarkerManager.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+
+import org.apache.maven.execution.MavenExecutionResult;
+
+/**
+ * IMavenMarkerManager
+ *
+ * @author Fred Bricon
+ */
+public interface IMavenMarkerManager {
+
+ /**
+ * Add markers to a pom file from a MavenExecutionResult.
+ * @param pomFile the pom file to attach markers to.
+ * @param result containing messages to be addedd as markers
+ */
+ public void addMarkers(IResource pomFile, String type, MavenExecutionResult result);
+
+ /**
+ * Add a Maven marker to a resource
+ * @param resource : the IResource to attach the marker to.
+ * @param message : the marker's message.
+ * @param lineNumber : the resource line to attach the marker to.
+ * @param severity : the severity of the marker.
+ */
+ public IMarker addMarker(IResource resource, String type, String message, int lineNumber, int severity);
+
+ /**
+ * Delete all Maven markers of the specified type from an IResource
+ */
+ public void deleteMarkers(IResource resource, String type) throws CoreException;
+
+ /**
+ * Transform an exception into an error marker on an IResource
+ */
+ public void addErrorMarkers(IResource resource, String type, Exception ex);
+
+ public void addEditorHintMarkers(IResource pom, String type);
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectChangedListener.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectChangedListener.java
new file mode 100644
index 00000000..f37ec18d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectChangedListener.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+public interface IMavenProjectChangedListener {
+ /**
+ * This method is called while holding workspace lock.
+ */
+ public void mavenProjectChanged(MavenProjectChangedEvent[] events, IProgressMonitor monitor);
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectFacade.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectFacade.java
new file mode 100644
index 00000000..ded501aa
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectFacade.java
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import java.io.File;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.lifecycle.MavenExecutionPlan;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.ArtifactRef;
+import org.eclipse.m2e.core.embedder.ArtifactRepositoryRef;
+import org.eclipse.m2e.core.internal.project.ProjectConfigurationManager;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+
+/**
+ * IMavenProjectFacade
+ *
+ * @noimplement This interface is not intended to be implemented by clients.
+ *
+ * @author Igor Fedorenko
+ */
+public interface IMavenProjectFacade {
+
+ /**
+ * Returns project relative paths of resource directories
+ */
+ IPath[] getResourceLocations();
+
+ /**
+ * Returns project relative paths of test resource directories
+ */
+ IPath[] getTestResourceLocations();
+
+ IPath[] getCompileSourceLocations();
+
+ IPath[] getTestCompileSourceLocations();
+
+ /**
+ * Returns project resource for given file system location or null the location is outside of project.
+ *
+ * @param resourceLocation absolute file system location
+ * @return IPath the full, absolute workspace path resourceLocation
+ */
+ IPath getProjectRelativePath(String resourceLocation);
+
+ /**
+ * Returns the full, absolute path of this project maven build output directory relative to the workspace or null if
+ * maven build output directory cannot be determined or outside of the workspace.
+ */
+ IPath getOutputLocation();
+
+ /**
+ * Returns the full, absolute path of this project maven build test output directory relative to the workspace or null
+ * if maven build output directory cannot be determined or outside of the workspace.
+ */
+ IPath getTestOutputLocation();
+
+ IPath getFullPath();
+
+ /**
+ * Lazy load and cache MavenProject instance
+ */
+ MavenProject getMavenProject(IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Returns cached MavenProject instance associated with this facade or null,
+ * if the cache has not been populated yet.
+ */
+ MavenProject getMavenProject();
+
+ /**
+ * Lazy load and cache build execution plan
+ */
+ MavenExecutionPlan getExecutionPlan(IProgressMonitor monitor) throws CoreException;
+
+ String getPackaging();
+
+ IProject getProject();
+
+ IFile getPom();
+
+ File getPomFile();
+
+ /**
+ * Returns the full, absolute path of the given file relative to the workspace. Returns null if the file does not
+ * exist or is not a member of this project.
+ */
+ IPath getFullPath(File file);
+
+ /**
+ * Visits trough Maven project artifacts and modules
+ *
+ * @param visitor a project visitor used to visit Maven project
+ * @param flags flags to specify visiting behavior. See {@link IMavenProjectVisitor#LOAD},
+ * {@link IMavenProjectVisitor#NESTED_MODULES}.
+ */
+ void accept(IMavenProjectVisitor visitor, int flags) throws CoreException;
+
+ void accept(IMavenProjectVisitor2 visitor, int flags, IProgressMonitor monitor) throws CoreException;
+
+ List<String> getMavenProjectModules();
+
+ Set<ArtifactRef> getMavenProjectArtifacts();
+
+ ResolverConfiguration getResolverConfiguration();
+
+ /**
+ * @return true if maven project needs to be re-read from disk
+ */
+ boolean isStale();
+
+ ArtifactKey getArtifactKey();
+
+ /**
+ * Associates the value with the key in session (i.e. transient) context.
+ * Intended as a mechanism to cache state derived from MavenProject.
+ * Session properties are cleared when MavenProject is re-read from disk.
+ *
+ * @see #getSessionProperty(String)
+ */
+ public void setSessionProperty(String key, Object value);
+
+ /**
+ * @return the value associated with the key in session context or null
+ * if the key is not associated with any value.
+ *
+ * @see #setSessionProperty(String, Object)
+ */
+ public Object getSessionProperty(String key);
+
+ public Set<ArtifactRepositoryRef> getArtifactRepositoryRefs();
+
+ public Set<ArtifactRepositoryRef> getPluginArtifactRepositoryRefs();
+
+ public ILifecycleMapping getLifecycleMapping(IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Returns true if the project configuration is valid. This flag is set by
+ * {@link ProjectConfigurationManager#validateProjectConfiguration(IMavenProjectFacade, IProgressMonitor)}. Returns
+ * false if the project configuration has not been validated yet.
+ */
+ boolean hasValidConfiguration();
+
+ void setHasValidConfiguration(boolean hasValidConfiguration);
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectImportResult.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectImportResult.java
new file mode 100644
index 00000000..218e5a4d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectImportResult.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import org.eclipse.core.resources.IProject;
+
+/**
+ * Holds IProject that was created during project import
+ *
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IMavenProjectImportResult {
+
+ /**
+ * @return MavenProjectInfo maven project import request
+ */
+ MavenProjectInfo getMavenProjectInfo();
+
+ /**
+ * @return IProject imported project or <code>null</code> if the project could not be imported.
+ */
+ IProject getProject();
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectVisitor.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectVisitor.java
new file mode 100644
index 00000000..71a5e400
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectVisitor.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * This interface is implemented by clients that visit MavenProject tree.
+ */
+public interface IMavenProjectVisitor {
+
+ public static int NONE = 0;
+
+ public static int LOAD = 1 << 0;
+
+ /**
+ * Visit Maven project or project module
+ *
+ * @param projectFacade a facade for visited Maven project
+ * @return true if nested artifacts and modules should be visited
+ */
+ public boolean visit(IMavenProjectFacade projectFacade) throws CoreException;
+
+ /**
+ * Visit Maven project dependency/artifact
+ *
+ * @param projectFacade a facade for visited Maven project
+ * @param artifact an artifact for project dependency
+ */
+// public void visit(IMavenProjectFacade projectFacade, Artifact artifact);
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectVisitor2.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectVisitor2.java
new file mode 100644
index 00000000..5effc055
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IMavenProjectVisitor2.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import org.apache.maven.artifact.Artifact;
+
+/**
+ * IMavenProjectVisitor2
+ *
+ * @author Igor Fedorenko
+ */
+public interface IMavenProjectVisitor2 extends IMavenProjectVisitor {
+
+ /**
+ * @param mavenProjectFacade
+ * @param artifact
+ */
+ void visit(IMavenProjectFacade mavenProjectFacade, Artifact artifact);
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IProjectConfigurationManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IProjectConfigurationManager.java
new file mode 100644
index 00000000..a36aa966
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/IProjectConfigurationManager.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+
+
+public interface IProjectConfigurationManager {
+
+ ISchedulingRule getRule();
+
+ List<IMavenProjectImportResult> importProjects(Collection<MavenProjectInfo> projects, //
+ ProjectImportConfiguration configuration, IProgressMonitor monitor) throws CoreException;
+
+ void createSimpleProject(IProject project, IPath location, Model model, String[] folders,
+ ProjectImportConfiguration configuration, IProgressMonitor monitor) throws CoreException;
+
+ void createArchetypeProject(IProject project, IPath location, Archetype archetype, //
+ String groupId, String artifactId, String version, String javaPackage, Properties properties, //
+ ProjectImportConfiguration configuration, IProgressMonitor monitor) throws CoreException;
+
+ Set<MavenProjectInfo> collectProjects(Collection<MavenProjectInfo> projects);
+
+ void enableMavenNature(IProject project, ResolverConfiguration configuration, IProgressMonitor monitor)
+ throws CoreException;
+
+ void disableMavenNature(IProject project, IProgressMonitor monitor) throws CoreException;
+
+ void updateProjectConfiguration(IProject project, ResolverConfiguration configuration, IProgressMonitor monitor)
+ throws CoreException;
+
+ ILifecycleMapping getLifecycleMapping(IMavenProjectFacade projectFacade, IProgressMonitor monitor)
+ throws CoreException;
+
+ /**
+ * Validates that the project configuration is valid. It does not actually (re)configure the project, but it validates
+ * that the project configure action will not fail for obvious reasons like missing lifecycle mapping, missing project
+ * configuration, etc.
+ *
+ * @return true if the configuration is valid
+ */
+ boolean validateProjectConfiguration(IMavenProjectFacade projectFacade, IProgressMonitor monitor);
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java
new file mode 100644
index 00000000..b397910e
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Profile;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.embedder.MavenModelManager;
+import org.eclipse.m2e.core.internal.Messages;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class LocalProjectScanner extends AbstractProjectScanner<MavenProjectInfo> {
+ private final File workspaceRoot;
+ private final List<String> folders;
+ private final boolean basedirRemameRequired;
+
+ private Set<File> scannedFolders = new HashSet<File>();
+ private final MavenConsole console;
+ private final MavenModelManager modelManager;
+
+ public LocalProjectScanner(File workspaceRoot, String folder, boolean needsRename, MavenModelManager modelManager,
+ MavenConsole console) {
+ this(workspaceRoot, Collections.singletonList(folder), needsRename, modelManager, console);
+ }
+
+ public LocalProjectScanner(File workspaceRoot, List<String> folders, boolean basedirRemameRequired,
+ MavenModelManager modelManager, MavenConsole console) {
+ this.workspaceRoot = workspaceRoot;
+ this.folders = folders;
+ this.basedirRemameRequired = basedirRemameRequired;
+ this.modelManager = modelManager;
+ this.console = console;
+ }
+
+ public void run(IProgressMonitor monitor) throws InterruptedException {
+ monitor.beginTask(Messages.LocalProjectScanner_task_scanning, IProgressMonitor.UNKNOWN);
+ try {
+ for(String folderName : folders) {
+ try {
+ File folder = new File(folderName).getCanonicalFile();
+ scanFolder(folder, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
+ } catch(IOException ex) {
+ addError(ex);
+ }
+ }
+ } finally {
+ monitor.done();
+ }
+ }
+
+ private void scanFolder(File baseDir, IProgressMonitor monitor) throws InterruptedException {
+ if(monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+
+ monitor.subTask(baseDir.toString());
+ monitor.worked(1);
+
+ // Don't scan the .metadata folder
+ if(!baseDir.exists() || !baseDir.isDirectory() || IMavenConstants.METADATA_FOLDER.equals(baseDir.getName())) {
+ return;
+ }
+
+ MavenProjectInfo projectInfo = readMavenProjectInfo(baseDir, "", null); //$NON-NLS-1$
+ if(projectInfo != null) {
+ addProject(projectInfo);
+ return; // don't scan subfolders of the Maven project
+ }
+
+ File[] files = baseDir.listFiles();
+ for(int i = 0; i < files.length; i++ ) {
+ File file;
+ try {
+ file = files[i].getCanonicalFile();
+ if(file.isDirectory()) {
+ scanFolder(file, monitor);
+ }
+ } catch(IOException ex) {
+ addError(ex);
+ }
+ }
+ }
+
+ private MavenProjectInfo readMavenProjectInfo(File baseDir, String modulePath, MavenProjectInfo parentInfo) {
+ try {
+ baseDir = baseDir.getCanonicalFile();
+
+ File pomFile = new File(baseDir, IMavenConstants.POM_FILE_NAME);
+ if(!pomFile.exists()) {
+ return null;
+ }
+
+ Model model = modelManager.readMavenModel(pomFile);
+
+ if (!scannedFolders.add(baseDir)) {
+ return null; // we already know this project
+ }
+
+ String pomName = modulePath + "/" + IMavenConstants.POM_FILE_NAME; //$NON-NLS-1$
+
+ MavenProjectInfo projectInfo = newMavenProjectInfo(pomName, pomFile, model, parentInfo);
+ projectInfo.setBasedirRename(getBasedirRename(projectInfo));
+
+ Map<String, Set<String>> modules = new LinkedHashMap<String, Set<String>>();
+ for(String module : model.getModules()) {
+ modules.put(module, new HashSet<String>());
+ }
+
+ for(Profile profile : model.getProfiles()) {
+ for(String module : profile.getModules()) {
+ Set<String> profiles = modules.get(module);
+ if(profiles == null) {
+ profiles = new HashSet<String>();
+ modules.put(module, profiles);
+ }
+ profiles.add(profile.getId());
+ }
+ }
+
+ for(Map.Entry<String, Set<String>> e : modules.entrySet()) {
+ String module = e.getKey();
+ Set<String> profiles = e.getValue();
+
+ File moduleBaseDir = new File(baseDir, module);
+ MavenProjectInfo moduleInfo = readMavenProjectInfo(moduleBaseDir, module, projectInfo);
+ if(moduleInfo != null) {
+ moduleInfo.addProfiles(profiles);
+ projectInfo.add(moduleInfo);
+ }
+ }
+
+ return projectInfo;
+
+ } catch(CoreException ex) {
+ addError(ex);
+ console.logError("Unable to read model " + baseDir.getAbsolutePath());
+ } catch(IOException ex) {
+ addError(ex);
+ console.logError("Unable to read model " + baseDir.getAbsolutePath());
+ }
+
+ return null;
+ }
+
+ protected MavenProjectInfo newMavenProjectInfo(String label, File pomFile, Model model, MavenProjectInfo parent) {
+ return new MavenProjectInfo(label, pomFile, model, parent);
+ }
+
+ public String getDescription() {
+ return folders.toString();
+ }
+
+ private int getBasedirRename(MavenProjectInfo mavenProjectInfo) throws IOException {
+ File cannonical = mavenProjectInfo.getPomFile().getParentFile().getParentFile().getCanonicalFile();
+ if (basedirRemameRequired && cannonical.equals(workspaceRoot.getCanonicalFile())) {
+ return MavenProjectInfo.RENAME_REQUIRED;
+ }
+ return MavenProjectInfo.RENAME_NO;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectChangedEvent.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectChangedEvent.java
new file mode 100644
index 00000000..e0d775ef
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectChangedEvent.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import org.eclipse.core.resources.IFile;
+
+public class MavenProjectChangedEvent {
+
+ private final IFile source;
+
+ private final int kind;
+
+ private final int flags;
+
+ public static final int KIND_ADDED = 1;
+
+ public static final int KIND_REMOVED = 2;
+
+ public static final int KIND_CHANGED = 3;
+
+ public static final int FLAG_NONE = 0;
+
+ public static final int FLAG_DEPENDENCIES = 1;
+
+ public static final int FLAG_DEPENDENCY_SOURCES = 2;
+
+ public static final int FLAG_ENTRY_SOURCES = 3;
+
+ private final IMavenProjectFacade oldMavenProject;
+
+ private final IMavenProjectFacade mavenProject;
+
+ public MavenProjectChangedEvent(IFile source, int kind, int flags, IMavenProjectFacade oldMavenProject, IMavenProjectFacade mavenProject) {
+ this.source = source;
+ this.kind = kind;
+ this.flags = flags;
+ this.oldMavenProject = oldMavenProject;
+ this.mavenProject = mavenProject;
+ }
+
+ public int getKind() {
+ return kind;
+ }
+
+ public int getFlags() {
+ return flags;
+ }
+
+ public IMavenProjectFacade getMavenProject() {
+ return mavenProject;
+ }
+
+ public IMavenProjectFacade getOldMavenProject() {
+ return oldMavenProject;
+ }
+
+ public IFile getSource() {
+ return source;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectInfo.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectInfo.java
new file mode 100644
index 00000000..64088a15
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectInfo.java
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.core.MavenLogger;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class MavenProjectInfo {
+
+ /**
+ * Project basedir must NOT be renamed on filesystem.
+ */
+ public static final int RENAME_NO = 0;
+
+ /**
+ * Project basedir MUST be ranamed to match workspace project name.
+ */
+ public static final int RENAME_REQUIRED = 2;
+
+ private final String label;
+
+ private File pomFile;
+
+ private Model model;
+
+ private final MavenProjectInfo parent;
+
+ /**
+ * Map of MavenProjectInfo
+ */
+ private final Map<String, MavenProjectInfo> projects = new LinkedHashMap<String, MavenProjectInfo>();
+
+ private final Set<String> profiles = new HashSet<String>();
+
+ private int basedirRename = RENAME_NO;
+
+ public MavenProjectInfo(String label, File pomFile, Model model, MavenProjectInfo parent) {
+ this.label = label;
+ this.pomFile = pomFile;
+ this.model = model;
+ this.parent = parent;
+ }
+
+ public void setPomFile(File pomFile) {
+ File oldDir = this.pomFile.getParentFile();
+ File newDir = pomFile.getParentFile();
+
+ for(MavenProjectInfo projectInfo : projects.values()) {
+ File childPom = projectInfo.getPomFile();
+ if(isSubDir(oldDir, childPom.getParentFile())) {
+ String oldPath = oldDir.getAbsolutePath();
+ String path = childPom.getAbsolutePath().substring(oldPath.length());
+ projectInfo.setPomFile(new File(newDir, path));
+ }
+ }
+
+ this.pomFile = pomFile;
+ }
+
+ /** @deprecated use set/get BasedirRename */
+ public void setNeedsRename(boolean needsRename) {
+ setBasedirRename(needsRename? RENAME_REQUIRED: RENAME_NO);
+ }
+
+ /** @deprecated use set/get BasedirRenamePolicy */
+ public boolean isNeedsRename() {
+ return getBasedirRename() == RENAME_REQUIRED;
+ }
+
+ /**
+ * See {@link #RENAME_NO}, {@link #RENAME_REQUIRED}
+ */
+ public void setBasedirRename(int basedirRename) {
+ this.basedirRename = basedirRename;
+ }
+
+ /**
+ * See {@link #RENAME_NO}, {@link #RENAME_REQUIRED}
+ */
+ public int getBasedirRename() {
+ return basedirRename;
+ }
+
+ private boolean isSubDir(File parentDir, File subDir) {
+ if(parentDir.equals(subDir)) {
+ return true;
+ }
+
+ if(subDir.getParentFile()!=null) {
+ return isSubDir(parentDir, subDir.getParentFile());
+ }
+
+ return false;
+ }
+
+ public void add(MavenProjectInfo info) {
+ String key;
+ try {
+ if(info.getPomFile() == null) {
+ // Is this possible?
+ key = info.getLabel();
+ } else {
+ key = info.getPomFile().getCanonicalPath();
+ }
+ } catch(IOException ex) {
+ throw new RuntimeException(ex);
+ }
+ MavenProjectInfo i = projects.get(key);
+ if(i==null) {
+ projects.put(key, info);
+ } else {
+ MavenLogger.log("Project info " + this + " already has a child project info with key '" + key + "'"); //$NON-NLS-3$
+ for(Iterator<String> it = info.getProfiles().iterator(); it.hasNext();) {
+ i.addProfile(it.next());
+ }
+ }
+ }
+
+ public void addProfile(String profileId) {
+ if(profileId!=null) {
+ this.profiles.add(profileId);
+ }
+ }
+
+ public void addProfiles(Collection<String> profiles) {
+ this.profiles.addAll(profiles);
+ }
+
+ public String getLabel() {
+ return this.label;
+ }
+
+ public File getPomFile() {
+ return this.pomFile;
+ }
+
+ public Model getModel() {
+ return this.model;
+ }
+
+ public void setModel(Model model) {
+ this.model = model;
+ }
+
+ public Collection<MavenProjectInfo> getProjects() {
+ return this.projects.values();
+ }
+
+ public MavenProjectInfo getParent() {
+ return this.parent;
+ }
+
+ public Set<String> getProfiles() {
+ return this.profiles;
+ }
+
+ public boolean equals(Object obj) {
+ if(obj instanceof MavenProjectInfo) {
+ MavenProjectInfo info = (MavenProjectInfo) obj;
+ if(pomFile == null) {
+ return info.getPomFile() == null;
+ }
+ return pomFile.equals(info.getPomFile());
+ }
+ return false;
+ }
+
+ public int hashCode() {
+ return pomFile==null ? 0 : pomFile.hashCode();
+ }
+
+ public String toString() {
+ return "'" + label + "'" + (pomFile == null ? "" : " " + pomFile.getAbsolutePath()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectManager.java
new file mode 100644
index 00000000..303d30a7
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectManager.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import java.io.File;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.apache.maven.artifact.repository.MavenArtifactRepository;
+import org.apache.maven.execution.MavenExecutionRequest;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager;
+import org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob;
+
+
+/**
+ * This class keeps track of all Maven projects present in the workspace and provides mapping between Maven artifacts
+ * and Workspace projects.
+ */
+public class MavenProjectManager {
+
+ public static final String STATE_FILENAME = "workspacestate.properties"; //$NON-NLS-1$
+
+ private final ProjectRegistryManager manager;
+
+ private final ProjectRegistryRefreshJob mavenBackgroundJob;
+
+ private final File workspaceStateFile;
+
+ public MavenProjectManager(ProjectRegistryManager manager, ProjectRegistryRefreshJob mavenBackgroundJob, File stateLocation) {
+ this.manager = manager;
+ this.mavenBackgroundJob = mavenBackgroundJob;
+ this.workspaceStateFile = new File(stateLocation, STATE_FILENAME);
+ }
+
+ // Maven projects
+
+ /**
+ * Performs requested Maven project update asynchronously, using background
+ * job. This method returns immediately.
+ */
+ public void refresh(MavenUpdateRequest request) {
+ mavenBackgroundJob.refresh(request);
+ }
+
+ /**
+ * Performs requested Maven project update synchronously. In other words, this method
+ * does not return until all affected projects have been updated and
+ * corresponding MavenProjectChangeEvent's broadcast.
+ *
+ * This method acquires a lock on the workspace's root.
+ */
+ public void refresh(MavenUpdateRequest request, IProgressMonitor monitor) throws CoreException {
+ manager.refresh(request, monitor);
+ }
+
+ public void addMavenProjectChangedListener(IMavenProjectChangedListener listener) {
+ manager.addMavenProjectChangedListener(listener);
+ }
+
+ public void removeMavenProjectChangedListener(IMavenProjectChangedListener listener) {
+ manager.removeMavenProjectChangedListener(listener);
+ }
+
+ /**
+ * Returns MavenProjectFacade corresponding to the pom. This method first looks in the project cache, then attempts to
+ * load the pom if the pom is not found in the cache. In the latter case, workspace resolution is assumed to be
+ * enabled for the pom but the pom will not be added to the cache.
+ */
+ public IMavenProjectFacade create(IFile pom, boolean load, IProgressMonitor monitor) {
+ return manager.create(pom, load, monitor);
+ }
+
+ public IMavenProjectFacade create(IProject project, IProgressMonitor monitor) {
+ return manager.create(project, monitor);
+ }
+
+ public ResolverConfiguration getResolverConfiguration(IProject project) {
+ IMavenProjectFacade projectFacade = create(project, new NullProgressMonitor());
+ if(projectFacade!=null) {
+ return projectFacade.getResolverConfiguration();
+ }
+ return manager.readResolverConfiguration(project);
+ }
+
+ public boolean setResolverConfiguration(IProject project, ResolverConfiguration configuration) {
+ return manager.setResolverConfiguration(project, configuration);
+ }
+
+ /**
+ * @return MavenProjectFacade[] all maven projects which exist under workspace root
+ */
+ public IMavenProjectFacade[] getProjects() {
+ return manager.getProjects();
+ }
+
+ /**
+ * @return IMavenProjectFacade cached IMavenProjectFacade corresponding
+ * to the project or null if there is no cache entry for the project.
+ */
+ public IMavenProjectFacade getProject(IProject project) {
+ return manager.getProject(project);
+ }
+
+ public IMavenProjectFacade getMavenProject(String groupId, String artifactId, String version) {
+ return manager.getMavenProject(groupId, artifactId, version);
+ }
+
+ public File getWorkspaceStateFile() {
+ return workspaceStateFile;
+ }
+
+ /**
+ * Request full maven build for a project.
+ *
+ * This call only has effect for projects that have maven nature and
+ * Maven builder configured.
+ *
+ * This call does not trigger the build. Instead next time Maven builder
+ * processes the project it will use goals to execute during clean
+ * build regardless of the build type requested.
+ *
+ * The main purpose of this call is to allow coordination between multiple
+ * builders configured for the same project.
+ */
+ public void requestFullMavenBuild(IProject project) throws CoreException {
+ project.setSessionProperty(IMavenConstants.FULL_MAVEN_BUILD, Boolean.TRUE);
+ }
+
+ /**
+ * PROVISIONAL
+ */
+ public MavenExecutionRequest createExecutionRequest(IFile pom, ResolverConfiguration resolverConfiguration, IProgressMonitor monitor) throws CoreException {
+ return manager.createExecutionRequest(pom, resolverConfiguration, monitor);
+ }
+
+ /**
+ * PROVISIONAL
+ */
+ public MavenExecutionRequest createExecutionRequest(IMavenProjectFacade project, IProgressMonitor monitor) throws CoreException {
+ return manager.createExecutionRequest(project.getPom(), project.getResolverConfiguration(), monitor);
+ }
+
+ /**
+ * Local repository implementation that checks artifacts in workspace first.
+ *
+ * PROVISIONAL
+ */
+ public MavenArtifactRepository getWorkspaceLocalRepository() throws CoreException {
+ return manager.getWorkspaceLocalRepository();
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectPomScanner.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectPomScanner.java
new file mode 100644
index 00000000..fe73112f
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectPomScanner.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osgi.util.NLS;
+
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+import org.apache.maven.model.Profile;
+import org.apache.maven.model.Scm;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.MavenModelManager;
+import org.eclipse.m2e.core.internal.Messages;
+
+/**
+ * Maven project scanner using dependency list
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenProjectPomScanner<T> extends AbstractProjectScanner<MavenProjectScmInfo> {
+
+ private final boolean developer;
+
+ private final Dependency[] dependencies;
+
+ private MavenConsole console;
+
+ private IMaven maven;
+
+ public MavenProjectPomScanner(boolean developer, Dependency[] dependencies, //
+ MavenModelManager modelManager, MavenConsole console) {
+ this.developer = developer;
+ this.dependencies = dependencies;
+ this.console = console;
+ this.maven = MavenPlugin.getDefault().getMaven();
+ }
+
+ public String getDescription() {
+ if(dependencies.length==1) {
+ Dependency d = dependencies[0];
+ return d.getGroupId() + ":" + d.getArtifactId() + ":" + d.getVersion() + (d.getClassifier()==null ? "" : ":" + d.getClassifier()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+ return "" + dependencies.length + " projects"; //$NON-NLS-1$
+ }
+
+ public void run(IProgressMonitor monitor) throws InterruptedException {
+ for(int i = 0; i < dependencies.length; i++ ) {
+ if(monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+
+ Dependency d = dependencies[i];
+
+ try {
+ Model model = resolveModel(d.getGroupId(), d.getArtifactId(), d.getVersion(), monitor);
+ if(model==null) {
+ String msg = "Can't resolve " + d.getArtifactId();
+ console.logError(msg);
+ addError(new Exception(msg));
+ continue;
+ }
+
+ Scm scm = resolveScm(model, monitor);
+ if(scm==null) {
+ String msg = "No SCM info for " + d.getArtifactId();
+ console.logError(msg);
+ addError(new Exception(msg));
+ continue;
+ }
+
+ String tag = scm.getTag();
+
+ console.logMessage(d.getArtifactId());
+ console.logMessage("Connection: " + scm.getConnection());
+ console.logMessage(" dev: " + scm.getDeveloperConnection());
+ console.logMessage(" url: " + scm.getUrl());
+ console.logMessage(" tag: " + tag);
+
+ String connection;
+ if(developer) {
+ connection = scm.getDeveloperConnection();
+ if(connection==null) {
+ String msg = d.getArtifactId() + " doesn't specify developer SCM connection";
+ console.logError(msg);
+ addError(new Exception(msg));
+ continue;
+ }
+ } else {
+ connection = scm.getConnection();
+ if(connection==null) {
+ String msg = d.getArtifactId() + " doesn't specify SCM connection";
+ console.logError(msg);
+ addError(new Exception(msg));
+ continue;
+ }
+ }
+
+ // connection: scm:svn:https://svn.apache.org/repos/asf/incubator/wicket/branches/wicket-1.2.x/wicket
+ // dev: scm:svn:https://svn.apache.org/repos/asf/incubator/wicket/branches/wicket-1.2.x/wicket
+ // url: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket
+ // tag: HEAD
+
+ // TODO add an option to select all modules/projects and optimize scan
+
+ if(connection.endsWith("/")) { //$NON-NLS-1$
+ connection = connection.substring(0, connection.length()-1);
+ }
+
+ int n = connection.lastIndexOf("/"); //$NON-NLS-1$
+ String label = (n == -1 ? connection : connection.substring(n)) + "/" + IMavenConstants.POM_FILE_NAME; //$NON-NLS-1$
+
+ addProject(new MavenProjectScmInfo(label, model, null, tag, connection, connection));
+
+ } catch(Exception ex) {
+ addError(ex);
+ String msg = "Error reading " + d.getArtifactId();
+ console.logError(msg);
+ MavenLogger.log(msg, ex);
+ }
+ }
+ }
+
+ private Scm resolveScm(Model model, IProgressMonitor monitor) throws ArtifactResolutionException,
+ ArtifactNotFoundException, XmlPullParserException, IOException, CoreException {
+ Scm scm = model.getScm();
+ if(scm != null) {
+ return scm;
+ }
+
+ Parent parent = model.getParent();
+ if(parent == null) {
+ return null;
+ }
+
+ Model parentModel = resolveModel(parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), monitor);
+ if(parentModel==null) {
+ return null;
+ }
+
+ Scm parentScm = resolveScm(parentModel, monitor);
+ if(parentScm==null) {
+ return null;
+ }
+
+ Set<String> modules = new HashSet<String>(parentModel.getModules());
+ List<Profile> parentModelProfiles = parentModel.getProfiles();
+ for(Profile profile : parentModelProfiles) {
+ modules.addAll(profile.getModules());
+ }
+
+ // heuristics for matching module names to artifactId
+ String artifactId = model.getArtifactId();
+ for(String module : modules) {
+ if(module.equals(artifactId) || module.endsWith("/" + artifactId)) { //$NON-NLS-1$
+ if(parentScm.getConnection()!=null) {
+ parentScm.setConnection(parentScm.getConnection() + "/" + module); //$NON-NLS-1$
+ }
+ if(parentScm.getDeveloperConnection()!=null) {
+ parentScm.setDeveloperConnection(parentScm.getDeveloperConnection() + "/" + module); //$NON-NLS-1$
+ }
+ return parentScm;
+ }
+ }
+
+ // XXX read modules from profiles
+
+ return parentScm;
+ }
+
+ private Model resolveModel(String groupId, String artifactId, String version, IProgressMonitor monitor)
+ throws CoreException {
+ monitor.subTask(NLS.bind(Messages.MavenProjectPomScanner_task_resolving, new Object[] { groupId, artifactId, version}));
+
+ List<ArtifactRepository> repositories = maven.getArtifactRepositories();
+ Artifact artifact = maven.resolve(groupId, artifactId, version, "pom", null, repositories, monitor); //$NON-NLS-1$
+
+ File file = artifact.getFile();
+ if(file == null) {
+ return null;
+ }
+
+ // XXX this fail on reading extensions
+ // MavenProject project = embedder.readProject(file);
+
+ monitor.subTask(NLS.bind(Messages.MavenProjectPomScanner_23, new Object[] {groupId, artifactId, version}));
+ return maven.readModel(file);
+ }
+
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectScmInfo.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectScmInfo.java
new file mode 100644
index 00000000..fc810dfa
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectScmInfo.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import java.io.File;
+
+import org.apache.maven.model.Model;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class MavenProjectScmInfo extends MavenProjectInfo {
+
+ private final String folderUrl;
+ private final String repositoryUrl;
+ private final String revision;
+ private final String branch;
+
+ private String username;
+ private String password;
+
+ private File sslCertificate;
+ private String sslCertificatePassphrase;
+
+ public MavenProjectScmInfo(String label, Model model, MavenProjectInfo parent, //
+ String revision, String folderUrl, String repositoryUrl) {
+ this(label, model, parent, null, revision, folderUrl, repositoryUrl);
+ }
+
+ public MavenProjectScmInfo(String label, Model model, MavenProjectInfo parent, //
+ String branch, String revision, String folderUrl, String repositoryUrl) {
+ super(label, null, model, parent);
+ this.revision = revision;
+ this.folderUrl = folderUrl;
+ this.repositoryUrl = repositoryUrl;
+ this.branch = branch;
+ }
+
+ public String getBranch() {
+ return this.branch;
+ }
+
+ public String getRevision() {
+ return this.revision;
+ }
+
+ public String getFolderUrl() {
+ return folderUrl;
+ }
+
+ public String getRepositoryUrl() {
+ return repositoryUrl;
+ }
+
+ public boolean equals(Object obj) {
+ if(obj instanceof MavenProjectScmInfo) {
+ MavenProjectScmInfo info = (MavenProjectScmInfo) obj;
+ return folderUrl.equals(info.getFolderUrl());
+ }
+ return false;
+ }
+
+ public int hashCode() {
+ return folderUrl.hashCode();
+ }
+
+ public String toString() {
+ return getLabel() + " " + folderUrl; //$NON-NLS-1$
+ }
+
+ public String getUsername() {
+ return username;
+ }
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public void setSSLCertificate(File certificate) {
+ this.sslCertificate = certificate;
+ }
+ public File getSSLCertificate() {
+ return sslCertificate;
+ }
+
+ public String getSSLCertificatePassphrase() {
+ return sslCertificatePassphrase;
+ }
+ public void setSSLCertificatePassphrase(String passphrase) {
+ this.sslCertificatePassphrase = passphrase;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectUtils.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectUtils.java
new file mode 100644
index 00000000..cbcf60e6
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenProjectUtils.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import java.io.File;
+import java.util.LinkedHashSet;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+import org.apache.maven.model.Resource;
+
+/**
+ * Collection of helper methods to map between MavenProject and IResource.
+ *
+ * @author igor
+ */
+public class MavenProjectUtils {
+
+ private MavenProjectUtils() {
+ }
+
+ /**
+ * Returns project resource for given filesystem location or null the location is outside of project.
+ *
+ * @param resourceLocation absolute filesystem location
+ * @return IPath the full, absolute workspace path resourceLocation
+ */
+ public static IPath getProjectRelativePath(IProject project, String resourceLocation) {
+ if(resourceLocation == null) {
+ return null;
+ }
+ IPath projectLocation = project.getLocation();
+ IPath directory = Path.fromOSString(resourceLocation); // this is an absolute path!
+ if(projectLocation == null || !projectLocation.isPrefixOf(directory)) {
+ return null;
+ }
+
+ return directory.removeFirstSegments(projectLocation.segmentCount()).makeRelative().setDevice(null);
+ }
+
+ public static IPath[] getResourceLocations(IProject project, List<Resource> resources) {
+ LinkedHashSet<IPath> locations = new LinkedHashSet<IPath>();
+ for(Resource resource : resources) {
+ locations.add(getProjectRelativePath(project, resource.getDirectory()));
+ }
+ return locations.toArray(new IPath[locations.size()]);
+ }
+
+ public static IPath[] getSourceLocations(IProject project, List<String> roots) {
+ LinkedHashSet<IPath> locations = new LinkedHashSet<IPath>();
+ for(String root : roots) {
+ IPath path = getProjectRelativePath(project, root);
+ if(path != null) {
+ locations.add(path);
+ }
+ }
+ return locations.toArray(new IPath[locations.size()]);
+ }
+
+ /**
+ * Returns the full, absolute path of the given file relative to the workspace. Returns null if the file does not
+ * exist or is not a member of this project.
+ */
+ public static IPath getFullPath(IProject project, File file) {
+ if (project == null || file == null) {
+ return null;
+ }
+
+ IPath projectPath = project.getLocation();
+ if(projectPath == null) {
+ return null;
+ }
+
+ IPath filePath = new Path(file.getAbsolutePath());
+ if (!projectPath.isPrefixOf(filePath)) {
+ return null;
+ }
+ IResource resource = project.findMember(filePath.removeFirstSegments(projectPath.segmentCount()));
+ if (resource == null) {
+ return null;
+ }
+ return resource.getFullPath();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenUpdateRequest.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenUpdateRequest.java
new file mode 100644
index 00000000..8f936f24
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/MavenUpdateRequest.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+
+/**
+ * Maven project update request
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenUpdateRequest {
+ private boolean offline = false;
+ private boolean updateSnapshots = false;
+ private boolean force = true;
+
+ /**
+ * Set of {@link IFile}
+ */
+ private final Set<IFile> pomFiles = new LinkedHashSet<IFile>();
+
+ public MavenUpdateRequest(boolean offline, boolean updateSnapshots) {
+ this.offline = offline;
+ this.updateSnapshots = updateSnapshots;
+ }
+
+ public MavenUpdateRequest(IProject project, boolean offline, boolean updateSnapshots) {
+ this(offline, updateSnapshots);
+ addPomFile(project);
+ }
+
+ public MavenUpdateRequest(IProject[] projects, boolean offline, boolean updateSnapshots) {
+ this(offline, updateSnapshots);
+
+ for(int i = 0; i < projects.length; i++ ) {
+ addPomFile(projects[i]);
+ }
+ }
+
+ public boolean isOffline() {
+ return this.offline;
+ }
+
+ public boolean isUpdateSnapshots() {
+ return this.updateSnapshots;
+ }
+
+ public void addPomFiles(Set<IFile> pomFiles) {
+ for (IFile pomFile : pomFiles) {
+ addPomFile(pomFile);
+ }
+ }
+
+ public void addPomFile(IFile pomFile) {
+ pomFiles.add(pomFile);
+ }
+
+ public void addPomFile(IProject project) {
+ pomFiles.add(project.getFile(IMavenConstants.POM_FILE_NAME));
+
+ }
+
+ public void removePomFile(IFile pomFile) {
+ pomFiles.remove(pomFile);
+ }
+
+ /**
+ * Returns Set of {@link IFile}
+ */
+ public Set<IFile> getPomFiles() {
+ return this.pomFiles;
+ }
+
+ public boolean isEmpty() {
+ return this.pomFiles.isEmpty();
+ }
+
+ public boolean isForce() {
+ return force;
+ }
+
+ public void setForce(boolean force) {
+ this.force = force;
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder("["); //$NON-NLS-1$
+ String sep = ""; //$NON-NLS-1$
+ for(IFile pomFile : pomFiles) {
+ sb.append(sep);
+ sb.append(pomFile.getFullPath());
+ sep = ", "; //$NON-NLS-1$
+ }
+ sb.append("]"); //$NON-NLS-1$
+
+ if(offline) {
+ sb.append(" offline"); //$NON-NLS-1$
+ }
+ if(updateSnapshots) {
+ sb.append(" updateSnapshots"); //$NON-NLS-1$
+ }
+ if(force) {
+ sb.append(" force"); //$NON-NLS-1$
+ }
+
+ return sb.toString();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ProjectImportConfiguration.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ProjectImportConfiguration.java
new file mode 100644
index 00000000..e8f8b8bf
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ProjectImportConfiguration.java
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.IWorkingSet;
+
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.Messages;
+
+
+/**
+ * Project import configuration bean.
+ */
+public class ProjectImportConfiguration {
+
+ private static final String GROUP_ID = "\\[groupId\\]"; //$NON-NLS-1$
+
+ private static final String ARTIFACT_ID = "\\[artifactId\\]"; //$NON-NLS-1$
+
+ private static final String VERSION = "\\[version\\]"; //$NON-NLS-1$
+
+ /** resolver configuration bean */
+ private ResolverConfiguration resolverConfiguration;
+
+ /** the project name template */
+ private String projectNameTemplate = ""; //$NON-NLS-1$
+
+ private IWorkingSet[] workingSets;
+
+ /** Creates a new configuration. */
+ public ProjectImportConfiguration(ResolverConfiguration resolverConfiguration) {
+ this.resolverConfiguration = resolverConfiguration;
+ }
+
+ /** Creates a new configuration. */
+ public ProjectImportConfiguration() {
+ this(new ResolverConfiguration());
+ }
+
+ /** Returns the resolver configuration bean. */
+ public ResolverConfiguration getResolverConfiguration() {
+ return resolverConfiguration;
+ }
+
+ /** Sets the project name template. */
+ public void setProjectNameTemplate(String projectNameTemplate) {
+ this.projectNameTemplate = projectNameTemplate;
+ }
+
+ /** Returns the project name template. */
+ public String getProjectNameTemplate() {
+ return projectNameTemplate;
+ }
+
+ /** @deprecated UI aspects will be refactored out of core import logic */
+ public void setWorkingSet(IWorkingSet workingSet) {
+ this.workingSets = workingSet == null ? null : new IWorkingSet[]{workingSet};
+ }
+
+ /** @deprecated UI aspects will be refactored out of core import logic */
+ public void setWorkingSets(IWorkingSet[] workingSets) {
+ this.workingSets = workingSets;
+ }
+
+ /** @deprecated UI aspects will be refactored out of core import logic */
+ public IWorkingSet[] getWorkingSets() {
+ return this.workingSets;
+ }
+
+ /**
+ * Calculates the project name for the given model.
+ *
+ * @deprecated This method does not take into account MavenProjectInfo.basedirRename
+ */
+ public String getProjectName(Model model) {
+ // XXX should use resolved MavenProject or Model
+ if(projectNameTemplate.length() == 0) {
+ return model.getArtifactId();
+ }
+
+ String artifactId = model.getArtifactId();
+ String groupId = model.getGroupId();
+ if(groupId == null && model.getParent() != null) {
+ groupId = model.getParent().getGroupId();
+ }
+ String version = model.getVersion();
+ if(version == null && model.getParent() != null) {
+ version = model.getParent().getVersion();
+ }
+
+ // XXX needs MavenProjectManager update to resolve groupId and version
+ return projectNameTemplate.replaceAll(GROUP_ID, groupId).replaceAll(ARTIFACT_ID, artifactId).replaceAll(VERSION,
+ version == null ? "" : version); //$NON-NLS-1$
+ }
+
+ /**
+ * @deprecated This method does not take into account MavenProjectInfo.basedirRename.
+ * Use IMavenProjectImportResult#getProject instead
+ */
+ public IProject getProject(IWorkspaceRoot root, Model model) {
+ return root.getProject(getProjectName(model));
+ }
+
+ /**
+ * @deprecated business logic does not belong to a value object
+ */
+ public IStatus validateProjectName(Model model) {
+ String projectName = getProjectName(model);
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+
+ // check if the project name is valid
+ IStatus nameStatus = workspace.validateName(projectName, IResource.PROJECT);
+ if(!nameStatus.isOK()) {
+ return nameStatus;
+ }
+
+ // check if project already exists
+ if(workspace.getRoot().getProject(projectName).exists()) {
+ return new Status( IStatus.ERROR, IMavenConstants.PLUGIN_ID, 0, Messages.getString("wizard.project.page.project.validator.projectExists",projectName), null); //$NON-NLS-1$
+ }
+
+ return Status.OK_STATUS;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ResolverConfiguration.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ResolverConfiguration.java
new file mode 100644
index 00000000..8271bd19
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/ResolverConfiguration.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Resolver configuration holder.
+ *
+ * TODO need a better name, this configures all aspects of maven project in eclipse,
+ * not just dependency resolution.
+ *
+ * @author Eugene Kuleshov
+ */
+public class ResolverConfiguration implements Serializable {
+ private static final long serialVersionUID = 1258510761534886581L;
+
+ private boolean resolveWorkspaceProjects = true;
+
+ private String activeProfiles = ""; //$NON-NLS-1$
+
+ public boolean shouldResolveWorkspaceProjects() {
+ return this.resolveWorkspaceProjects;
+ }
+
+ public String getActiveProfiles() {
+ return this.activeProfiles;
+ }
+
+ public List<String> getActiveProfileList() {
+ if (activeProfiles.trim().length() > 0) {
+ return Arrays.asList(activeProfiles.split("[,\\s\\|]")); //$NON-NLS-1$
+ }
+ return new ArrayList<String>();
+ }
+
+ public void setResolveWorkspaceProjects(boolean resolveWorkspaceProjects) {
+ this.resolveWorkspaceProjects = resolveWorkspaceProjects;
+ }
+
+ public void setActiveProfiles(String activeProfiles) {
+ this.activeProfiles = activeProfiles;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractBuildParticipant.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractBuildParticipant.java
new file mode 100644
index 00000000..ebc79a35
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractBuildParticipant.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project.configurator;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.execution.MavenSession;
+
+import org.sonatype.plexus.build.incremental.BuildContext;
+
+import org.eclipse.m2e.core.internal.builder.InternalBuildParticipant;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+
+/**
+ * AbstractMavenBuildParticipant
+ *
+ * @author igor
+ */
+public abstract class AbstractBuildParticipant extends InternalBuildParticipant {
+
+ /**
+ * This method is called during workspace full or incremental build.
+ */
+ public abstract Set<IProject> build(int kind, IProgressMonitor monitor) throws Exception;
+
+ public boolean callOnEmptyDelta() {
+ return false;
+ }
+
+ /**
+ * This method is called during workspace clean build.
+ */
+ @SuppressWarnings("unused")
+ public void clean(IProgressMonitor monitor) throws CoreException {
+ // default implementation does nothing
+ }
+
+ protected IMavenProjectFacade getMavenProjectFacade() {
+ return super.getMavenProjectFacade();
+ }
+
+ protected IResourceDelta getDelta(IProject project) {
+ return super.getDelta(project);
+ }
+
+ protected MavenSession getSession() {
+ return super.getSession();
+ }
+
+ protected BuildContext getBuildContext() {
+ return super.getBuildContext();
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractLifecycleMapping.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractLifecycleMapping.java
new file mode 100644
index 00000000..e64db998
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractLifecycleMapping.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project.configurator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+
+import org.apache.maven.lifecycle.MavenExecutionPlan;
+import org.apache.maven.plugin.MojoExecution;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+
+/**
+ * AbstractLifecycleMapping
+ *
+ * @author igor
+ */
+public abstract class AbstractLifecycleMapping implements ILifecycleMapping {
+
+ private String name;
+
+ private String id;
+
+ private boolean showConfigurators;
+
+ /**
+ * Calls #configure method of all registered project configurators
+ */
+ public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException {
+ addMavenBuilder(request.getProject(), monitor);
+
+ for(AbstractProjectConfigurator configurator : getProjectConfigurators(request.getMavenProjectFacade(), monitor)) {
+ if(monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+ configurator.configure(request, monitor);
+ }
+ }
+
+ public void unconfigure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException {
+ for(AbstractProjectConfigurator configurator : getProjectConfigurators(request.getMavenProjectFacade(), monitor)) {
+ if(monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+ configurator.unconfigure(request, monitor);
+ }
+ }
+
+ protected static void addMavenBuilder(IProject project, IProgressMonitor monitor) throws CoreException {
+ IProjectDescription description = project.getDescription();
+
+ // ensure Maven builder is always the last one
+ ICommand mavenBuilder = null;
+ ArrayList<ICommand> newSpec = new ArrayList<ICommand>();
+ for(ICommand command : description.getBuildSpec()) {
+ if(IMavenConstants.BUILDER_ID.equals(command.getBuilderName())) {
+ mavenBuilder = command;
+ } else {
+ newSpec.add(command);
+ }
+ }
+ if(mavenBuilder == null) {
+ mavenBuilder = description.newCommand();
+ mavenBuilder.setBuilderName(IMavenConstants.BUILDER_ID);
+ }
+ newSpec.add(mavenBuilder);
+ description.setBuildSpec(newSpec.toArray(new ICommand[newSpec.size()]));
+
+ project.setDescription(description, monitor);
+ }
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return Returns the id.
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /**
+ * @param id The id to set.
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * @param show Set whether the project configurators should show. Default is true.
+ */
+ public void setShowConfigurators(boolean show) {
+ this.showConfigurators = show;
+ }
+
+ /**
+ * Returns whether the project configurators will be shown in the UI. Default is true.
+ */
+ public boolean showConfigurators() {
+ return this.showConfigurators;
+ }
+
+ protected List<AbstractBuildParticipant> getBuildParticipants(IMavenProjectFacade facade,
+ List<AbstractProjectConfigurator> configurators, IProgressMonitor monitor) throws CoreException {
+ List<AbstractBuildParticipant> participants = new ArrayList<AbstractBuildParticipant>();
+
+ for(MojoExecution execution : facade.getExecutionPlan(monitor).getMojoExecutions()) {
+ for(AbstractProjectConfigurator configurator : configurators) {
+ if(configurator.isSupportedExecution(execution)) {
+ AbstractBuildParticipant participant = configurator.getBuildParticipant(execution);
+ if(participant != null) {
+ participants.add(participant);
+ }
+ }
+ }
+ }
+
+ return participants;
+ }
+
+ public List<MojoExecution> getNotCoveredMojoExecutions(IMavenProjectFacade mavenProjectFacade,
+ IProgressMonitor monitor) throws CoreException {
+ List<MojoExecution> result = new ArrayList<MojoExecution>();
+
+ List<AbstractProjectConfigurator> projectConfigurators = getProjectConfigurators(mavenProjectFacade, monitor);
+ MavenExecutionPlan mavenExecutionPlan = mavenProjectFacade.getExecutionPlan(monitor);
+ List<MojoExecution> allMojoExecutions = mavenExecutionPlan.getMojoExecutions();
+ for(MojoExecution mojoExecution : allMojoExecutions) {
+ if(!isInterestingPhase(mojoExecution.getLifecyclePhase())) {
+ continue;
+ }
+ boolean isCovered = false;
+ for(AbstractProjectConfigurator configurator : projectConfigurators) {
+ if(configurator.isSupportedExecution(mojoExecution)) {
+ isCovered = true;
+ break;
+ }
+ }
+ if(!isCovered) {
+ result.add(mojoExecution);
+ }
+ }
+ return result;
+ }
+
+ public List<AbstractBuildParticipant> getBuildParticipants(IMavenProjectFacade facade, IProgressMonitor monitor)
+ throws CoreException {
+ List<AbstractProjectConfigurator> configurators = getProjectConfigurators(facade, monitor);
+
+ return getBuildParticipants(facade, configurators, monitor);
+ }
+
+ private static final String[] INTERESTING_PHASES = {"validate", //
+ "initialize", //
+ "generate-sources", //
+ "process-sources", //
+ "generate-resources", //
+ "process-resources", //
+ "compile", //
+ "process-classes", //
+ "generate-test-sources", //
+ "process-test-sources", //
+ "generate-test-resources", //
+ "process-test-resources", //
+ "test-compile", //
+ "process-test-classes", //
+ // "test", //
+ // "prepare-package", //
+ // "package", //
+ //"pre-integration-test", //
+ // "integration-test", //
+ // "post-integration-test", //
+ // "verify", //
+ // "install", //
+ // "deploy", //
+ };
+
+ public boolean isInterestingPhase(String phase) {
+ for(String interestingPhase : INTERESTING_PHASES) {
+ if(interestingPhase.equals(phase)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public abstract List<AbstractProjectConfigurator> getProjectConfigurators(IMavenProjectFacade mavenProjectFacade,
+ IProgressMonitor monitor) throws CoreException;
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java
new file mode 100644
index 00000000..d6d51c76
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/AbstractProjectConfigurator.java
@@ -0,0 +1,243 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project.configurator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.model.PluginExecution;
+import org.apache.maven.plugin.MojoExecution;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.IMavenMarkerManager;
+import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+
+
+/**
+ * Used to configure maven projects.
+ *
+ * @author Igor Fedorenko
+ */
+public abstract class AbstractProjectConfigurator implements IExecutableExtension, IMavenProjectChangedListener {
+
+ public static final String ATTR_ID = "id"; //$NON-NLS-1$
+
+ public static final String ATTR_PRIORITY = "priority"; //$NON-NLS-1$
+
+ public static final String ATTR_NAME = "name"; //$NON-NLS-1$
+
+ public static final String ATTR_CLASS = "class"; //$NON-NLS-1$
+
+ private int priority;
+
+ private String id;
+
+ private String name;
+
+ /**
+ * List of maven plugin goal patterns for which this project configurator is enabled automatically. Can be null, in
+ * which case the project configurator can only be enabled explicitly in pom.xml.
+ */
+ protected List<PluginExecutionFilter> pluginExecutionFilters;
+
+ protected MavenProjectManager projectManager;
+
+ protected IMavenConfiguration mavenConfiguration;
+
+ protected IMavenMarkerManager markerManager;
+
+ protected MavenConsole console;
+
+ protected IMaven maven = MavenPlugin.getDefault().getMaven();
+
+ public void setProjectManager(MavenProjectManager projectManager) {
+ this.projectManager = projectManager;
+ }
+
+ public void setMavenConfiguration(IMavenConfiguration mavenConfiguration) {
+ this.mavenConfiguration = mavenConfiguration;
+ }
+
+ public void setMarkerManager(IMavenMarkerManager markerManager) {
+ this.markerManager = markerManager;
+ }
+
+ public void setConsole(MavenConsole console) {
+ this.console = console;
+ }
+
+ /**
+ * Configures Eclipse project passed in ProjectConfigurationRequest, using information from Maven project and other
+ * configuration request parameters
+ * <p>
+ * <i>Should be implemented by subclass</i>
+ *
+ * @param request a project configuration request
+ * @param monitor a progress monitor
+ */
+ public abstract void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Removes Maven specific configuration from the project passed in ProjectConfigurationRequest
+ *
+ * @param request a project un-configuration request
+ * @param monitor a progress monitor
+ */
+ @SuppressWarnings("unused")
+ public void unconfigure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException {
+ }
+
+ /**
+ * Updates project configuration according project changes.
+ * <p>
+ * <i>Can be overwritten by subclass</i>
+ *
+ * @param event a project change event
+ * @param monitor a progress monitor
+ */
+ @SuppressWarnings("unused")
+ public void mavenProjectChanged(MavenProjectChangedEvent event, IProgressMonitor monitor) throws CoreException {
+ }
+
+ // IMavenProjectChangedListener
+
+ public final void mavenProjectChanged(MavenProjectChangedEvent[] events, IProgressMonitor monitor) {
+ for(int i = 0; i < events.length; i++ ) {
+ try {
+ mavenProjectChanged(events[i], monitor);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+
+ public int getPriority() {
+ return priority;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ // IExecutableExtension
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
+ this.id = config.getAttribute(ATTR_ID);
+ this.name = config.getAttribute(ATTR_NAME);
+ String priorityString = config.getAttribute(ATTR_PRIORITY);
+ try {
+ priority = Integer.parseInt(priorityString);
+ } catch(Exception ex) {
+ priority = Integer.MAX_VALUE;
+ }
+
+ IConfigurationElement[] mojos = config.getChildren("mojo"); //$NON-NLS-1$
+ if(mojos != null && mojos.length > 0) {
+ pluginExecutionFilters = new ArrayList<PluginExecutionFilter>();
+ for(IConfigurationElement mojo : mojos) {
+ String groupId = mojo.getAttribute("groupId"); //$NON-NLS-1$
+ String artifactId = mojo.getAttribute("artifactId"); //$NON-NLS-1$
+ String versionRange = mojo.getAttribute("versionRange"); //$NON-NLS-1$
+ String goals = mojo.getAttribute("goals"); //$NON-NLS-1$
+ addPluginExecutionFilter(groupId, artifactId, versionRange, goals);
+ }
+ }
+ }
+
+ protected void addPluginExecutionFilter(String groupId, String artifactId, String versionRange, String goals) {
+ addPluginExecutionFilter(new PluginExecutionFilter(groupId, artifactId, versionRange, goals));
+ }
+
+ public void addPluginExecutionFilter(PluginExecutionFilter filter) {
+ // TODO validate
+ if(pluginExecutionFilters == null) {
+ pluginExecutionFilters = new ArrayList<PluginExecutionFilter>();
+ }
+ pluginExecutionFilters.add(filter);
+ }
+
+ // TODO move to a helper
+ public static void addNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException {
+ if(!project.hasNature(natureId)) {
+ IProjectDescription description = project.getDescription();
+ String[] prevNatures = description.getNatureIds();
+ String[] newNatures = new String[prevNatures.length + 1];
+ System.arraycopy(prevNatures, 0, newNatures, 1, prevNatures.length);
+ newNatures[0] = natureId;
+ description.setNatureIds(newNatures);
+ project.setDescription(description, monitor);
+ }
+ }
+
+ @Deprecated
+ protected <T> T getParameterValue(MavenSession session, MojoExecution execution, String parameter, Class<T> asType)
+ throws CoreException {
+ return maven.getMojoParameterValue(session, execution, parameter, asType);
+ }
+
+ protected <T> T getParameterValue(String parameter, Class<T> asType, MavenSession session, MojoExecution mojoExecution)
+ throws CoreException {
+ PluginExecution execution = new PluginExecution();
+ execution.setConfiguration(mojoExecution.getConfiguration());
+ return maven.getMojoParameterValue(parameter, asType, session, mojoExecution.getPlugin(), execution,
+ mojoExecution.getGoal());
+ }
+
+ protected void assertHasNature(IProject project, String natureId) throws CoreException {
+ if(project.getNature(natureId) == null) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ Messages.AbstractProjectConfigurator_error_missing_nature + natureId, null));
+ }
+ }
+
+ @Override
+ public String toString() {
+ return id + ":" + name + "(" + priority + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ public AbstractBuildParticipant getBuildParticipant(MojoExecution execution) {
+ return null;
+ }
+
+ public boolean isSupportedExecution(MojoExecution mojoExecution) {
+ if(pluginExecutionFilters == null) {
+ return false;
+ }
+ for(PluginExecutionFilter key : pluginExecutionFilters) {
+ if(key.match(mojoExecution)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/CustomizableLifecycleMapping.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/CustomizableLifecycleMapping.java
new file mode 100644
index 00000000..762ffd04
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/CustomizableLifecycleMapping.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project.configurator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+
+/**
+ * @author igor
+ */
+public class CustomizableLifecycleMapping extends AbstractLifecycleMapping {
+ public static final String EXTENSION_ID = "customizable"; //$NON-NLS-1$
+
+ private List<AbstractProjectConfigurator> configurators = new ArrayList<AbstractProjectConfigurator>();
+
+ @SuppressWarnings("unused")
+ public List<AbstractProjectConfigurator> getProjectConfigurators(IMavenProjectFacade facade, IProgressMonitor monitor)
+ throws CoreException {
+ return configurators;
+ }
+
+ public void addConfigurator(AbstractProjectConfigurator configurator) {
+ this.configurators.add(configurator);
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/DefaultLifecycleMapping.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/DefaultLifecycleMapping.java
new file mode 100644
index 00000000..3f5c2f00
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/DefaultLifecycleMapping.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project.configurator;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.lifecycle.MavenExecutionPlan;
+import org.apache.maven.plugin.MojoExecution;
+
+import org.eclipse.m2e.core.internal.lifecycle.LifecycleMappingFactory;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+
+/**
+ * DefaultLifecycleMapping
+ *
+ * @author igor
+ */
+public class DefaultLifecycleMapping extends CustomizableLifecycleMapping {
+
+ private static class MojoExecutionKey {
+ private final MojoExecution execution;
+
+ public MojoExecutionKey(MojoExecution execution) {
+ this.execution = execution;
+ }
+
+ public MojoExecution getMojoExecution() {
+ return execution;
+ }
+
+ public int hashCode() {
+ int hash = execution.getGroupId().hashCode();
+ hash = 17 * hash + execution.getArtifactId().hashCode();
+ hash = 17 * hash + execution.getVersion().hashCode();
+ hash = 17 * execution.getGoal().hashCode();
+ return hash;
+ }
+
+ public boolean equals(Object obj) {
+ if(this == obj) {
+ return true;
+ }
+ if(!(obj instanceof MojoExecutionKey)) {
+ return false;
+ }
+
+ MojoExecutionKey other = (MojoExecutionKey) obj;
+
+ return execution.getGroupId().equals(other.execution.getGroupId())
+ && execution.getArtifactId().equals(other.execution.getArtifactId())
+ && execution.getVersion().equals(other.execution.getVersion())
+ && execution.getGoal().equals(other.execution.getGoal());
+ }
+ }
+
+ public List<AbstractProjectConfigurator> getProjectConfigurators(IMavenProjectFacade facade, IProgressMonitor monitor)
+ throws CoreException {
+
+ List<AbstractProjectConfigurator> configurators = super.getProjectConfigurators(facade, monitor);
+
+ Map<MojoExecutionKey, AbstractProjectConfigurator> executions = new LinkedHashMap<MojoExecutionKey, AbstractProjectConfigurator>();
+
+ MavenExecutionPlan executionPlan = facade.getExecutionPlan(monitor);
+ execution: for(MojoExecution execution : executionPlan.getMojoExecutions()) {
+ MojoExecutionKey key = new MojoExecutionKey(execution);
+ for(AbstractProjectConfigurator configurator : configurators) {
+ if(configurator.isSupportedExecution(execution)) {
+ executions.put(key, configurator);
+ continue execution;
+ }
+ }
+ executions.put(key, null);
+ }
+
+ for(Map.Entry<MojoExecutionKey, AbstractProjectConfigurator> entry : executions.entrySet()) {
+ MojoExecutionKey key = entry.getKey();
+ if(entry.getValue() == null) {
+ // make sure to reuse the same instance of project configurator
+ for(AbstractProjectConfigurator configurator : executions.values()) {
+ if(configurator != null && configurator.isSupportedExecution(key.getMojoExecution())) {
+ entry.setValue(configurator);
+ break;
+ }
+ }
+ }
+ if(entry.getValue() == null) {
+ AbstractProjectConfigurator configurator = LifecycleMappingFactory.createProjectConfiguratorFor(key
+ .getMojoExecution());
+ if(configurator != null) {
+ entry.setValue(configurator);
+ }
+ }
+ }
+
+ ArrayList<AbstractProjectConfigurator> result = new ArrayList<AbstractProjectConfigurator>();
+
+ for(AbstractProjectConfigurator configurator : executions.values()) {
+ if(configurator != null && !result.contains(configurator)) {
+ result.add(configurator);
+ }
+ }
+
+ return result;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/ILifecycleMapping.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/ILifecycleMapping.java
new file mode 100644
index 00000000..80ece0df
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/ILifecycleMapping.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project.configurator;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.plugin.MojoExecution;
+
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+/**
+ * LifecycleMapping
+ *
+ * @author igor
+ */
+public interface ILifecycleMapping {
+ String getId();
+
+ String getName();
+
+ /**
+ * Configure Eclipse workspace project according to Maven build project configuration.
+ */
+ void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Undo any Eclipse project configuration done during previous call(s) to {@link #configure(ProjectConfigurationRequest, IProgressMonitor)}
+ */
+ void unconfigure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Returns list of AbstractBuildParticipant that need to be executed during
+ * Eclipse workspace build. List can be empty but cannot be null.
+ */
+ List<AbstractBuildParticipant> getBuildParticipants(IMavenProjectFacade facade, IProgressMonitor monitor) throws CoreException;
+
+ /** TODO does this belong here? */
+ List<AbstractProjectConfigurator> getProjectConfigurators(IMavenProjectFacade facade, IProgressMonitor monitor) throws CoreException;
+
+ List<MojoExecution> getNotCoveredMojoExecutions(IMavenProjectFacade mavenProjectFacade, IProgressMonitor monitor)
+ throws CoreException;
+
+ boolean isInterestingPhase(String phase);
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MavenProjectConfigurator.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MavenProjectConfigurator.java
new file mode 100644
index 00000000..204fcb98
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MavenProjectConfigurator.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project.configurator;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.model.Build;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+
+
+/**
+ * Generic project configurator that using Maven plugins
+ *
+ * @author Eugene Kuleshov
+ * @see AbstractProjectConfigurator
+ */
+public class MavenProjectConfigurator extends AbstractProjectConfigurator {
+
+ String pluginKey;
+
+ List<String> goals;
+
+ public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) {
+ if(pluginKey == null || goals == null) {
+ return;
+ }
+
+ MavenProject mavenProject = request.getMavenProject();
+ Build build = mavenProject.getBuild();
+ if(build != null) {
+ Map<String, Plugin> pluginMap = build.getPluginsAsMap();
+ Plugin mavenPlugin = pluginMap.get(pluginKey);
+ if(mavenPlugin != null) {
+ IFile pomFile = request.getPom();
+ ResolverConfiguration resolverConfiguration = request.getResolverConfiguration();
+ // MavenPlugin plugin = MavenPlugin.getDefault();
+ try {
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+ MavenExecutionRequest executionRequest = projectManager.createExecutionRequest(pomFile, resolverConfiguration, monitor);
+ executionRequest.setGoals(goals);
+ maven.execute(executionRequest, monitor);
+ } catch(Exception ex) {
+ String msg = ex.getMessage() == null ? ex.toString() : ex.getMessage();
+ console.logError(msg);
+ MavenLogger.log(msg, ex);
+ }
+
+ try {
+ request.getProject().refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ } catch(CoreException ex) {
+ IStatus status = ex.getStatus();
+ String msg = status.getMessage();
+ Throwable t = status.getException();
+ console.logError(msg + (t == null ? "" : "; " + t.toString())); //$NON-NLS-1$ //$NON-NLS-2$
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+
+ public String getPluginKey() {
+ return this.pluginKey;
+ }
+
+ public List<String> getGoals() {
+ return this.goals;
+ }
+
+ // IExecutableExtension
+
+ @Override
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
+ super.setInitializationData(config, propertyName, data);
+
+ Pattern pattern = Pattern.compile("(.+?)\\:(.+?)\\|(.+)"); //$NON-NLS-1$
+ String params = (String) data;
+ if(params != null) {
+ Matcher matcher = pattern.matcher(params);
+ if(matcher.find() && matcher.groupCount() == 3) {
+ pluginKey = matcher.group(1) + ":" + matcher.group(2); //$NON-NLS-1$
+ goals = Arrays.asList(matcher.group(3).split("\\|")); //$NON-NLS-1$
+ return;
+ }
+ }
+ MavenLogger.log("Unable to parse configuration for project configurator " + getId() + "; " + data, null); //$NON-NLS-2$
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " " + pluginKey + goals; //$NON-NLS-1$
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MavenResourcesProjectConfigurator.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MavenResourcesProjectConfigurator.java
new file mode 100644
index 00000000..87c013fe
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MavenResourcesProjectConfigurator.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project.configurator;
+
+import org.eclipse.m2e.core.internal.project.MojoExecutionProjectConfigurator;
+
+/**
+ * Project configurator for maven-resources-plugin
+ */
+public class MavenResourcesProjectConfigurator extends MojoExecutionProjectConfigurator {
+ public MavenResourcesProjectConfigurator() {
+ super(true /*runOnIncremental*/);
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MojoExecutionBuildParticipant.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MojoExecutionBuildParticipant.java
new file mode 100644
index 00000000..f0852f35
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/MojoExecutionBuildParticipant.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project.configurator;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.apache.maven.plugin.MojoExecution;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.IMaven;
+
+
+/**
+ * MojoExecutionBuildParticipant
+ *
+ * @author igor
+ */
+public class MojoExecutionBuildParticipant extends AbstractBuildParticipant {
+
+ private final MojoExecution execution;
+ private final boolean runOnIncremental;
+
+ public MojoExecutionBuildParticipant(MojoExecution execution, boolean runOnIncremental) {
+ this.execution = execution;
+ this.runOnIncremental = runOnIncremental;
+ }
+
+ public Set<IProject> build(int kind, IProgressMonitor monitor) throws Exception {
+ if(appliesToBuildKind(kind)) {
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+
+ maven.execute(getSession(), getMojoExecution(), monitor);
+ }
+ return null;
+ }
+
+ public boolean appliesToBuildKind(int kind) {
+ if(IncrementalProjectBuilder.FULL_BUILD == kind || IncrementalProjectBuilder.CLEAN_BUILD == kind) {
+ return true;
+ }
+ return runOnIncremental;
+ }
+
+ public MojoExecution getMojoExecution() {
+ return execution;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/NoopLifecycleMapping.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/NoopLifecycleMapping.java
new file mode 100644
index 00000000..9273aa71
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/NoopLifecycleMapping.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project.configurator;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+/**
+ * NoopLifecycleMapping
+ *
+ * @author igor
+ */
+public class NoopLifecycleMapping extends AbstractLifecycleMapping {
+
+ public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException {
+ // do nothing
+ }
+
+ public List<AbstractBuildParticipant> getBuildParticipants(IMavenProjectFacade facade, IProgressMonitor monitor)
+ throws CoreException {
+ return new ArrayList<AbstractBuildParticipant>();
+ }
+
+ public List<AbstractProjectConfigurator> getProjectConfigurators(IMavenProjectFacade facade, IProgressMonitor monitor)
+ throws CoreException {
+ return new ArrayList<AbstractProjectConfigurator>();
+ }
+
+ public void unconfigure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException {
+ // do nothing
+ }
+
+ public List<String> getPotentialMojoExecutionsForBuildKind(IMavenProjectFacade facade, int kind, IProgressMonitor progressMonitor) {
+ return Collections.emptyList();
+ }
+
+ public boolean isInterestingPhase(String phase) {
+ return false;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/PluginExecutionFilter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/PluginExecutionFilter.java
new file mode 100644
index 00000000..18f8b260
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/PluginExecutionFilter.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project.configurator;
+
+import java.util.Arrays;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.plugin.MojoExecution;
+
+
+public final class PluginExecutionFilter {
+
+ private final String groupId;
+
+ private final String artifactId;
+
+ private final String versionRange;
+
+ private final Set<String> goals;
+
+ private final VersionRange parsedVersionRange;
+
+ public PluginExecutionFilter(String groupId, String artifactId, String versionRange, String goals) {
+ this.groupId = groupId;
+ this.artifactId = artifactId;
+ this.versionRange = versionRange;
+ this.goals = new LinkedHashSet<String>(Arrays.asList(goals.split(","))); //$NON-NLS-1$;
+ try {
+ this.parsedVersionRange = VersionRange.createFromVersionSpec(versionRange);
+ } catch(InvalidVersionSpecificationException e) {
+ throw new IllegalArgumentException("Can't parse version range", e);
+ }
+ }
+
+ public String getVersionRange() {
+ return this.versionRange;
+ }
+
+ public String getGroupId() {
+ return this.groupId;
+ }
+
+ public String getArtifactId() {
+ return this.artifactId;
+ }
+
+ public Set<String> getGoals() {
+ return this.goals;
+ }
+
+ /**
+ * @return true if mojoExecution matches this key or false otherwise
+ */
+ public boolean match(MojoExecution mojoExecution) {
+ if(!groupId.equals(mojoExecution.getGroupId()) || !artifactId.equals(mojoExecution.getArtifactId())) {
+ return false;
+ }
+
+ DefaultArtifactVersion version = new DefaultArtifactVersion(mojoExecution.getVersion());
+
+ if(!parsedVersionRange.containsVersion(version)) {
+ return false;
+ }
+
+ return goals.contains(mojoExecution.getGoal());
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/ProjectConfigurationRequest.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/ProjectConfigurationRequest.java
new file mode 100644
index 00000000..f6f08f49
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/configurator/ProjectConfigurationRequest.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.project.configurator;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+
+/**
+ * ProjectConfigurationRequest
+ *
+ * @author igor
+ */
+public class ProjectConfigurationRequest {
+ private final boolean updateSources;
+ private final IMavenProjectFacade facade;
+ private final MavenProject mavenProject;
+ private final MavenSession mavenSession;
+
+ public ProjectConfigurationRequest(IMavenProjectFacade facade, MavenProject mavenProject, MavenSession mavenSession, boolean updateSources) {
+ this.facade = facade;
+ this.mavenSession = mavenSession;
+ this.updateSources = updateSources;
+ this.mavenProject = mavenProject;
+ }
+
+ public IProject getProject() {
+ return facade.getProject();
+ }
+
+ public ResolverConfiguration getResolverConfiguration() {
+ return facade.getResolverConfiguration();
+ }
+
+ public boolean isProjectConfigure() {
+ return updateSources;
+ }
+
+ public boolean isProjectImport() {
+ return !updateSources;
+ }
+
+ public MavenProject getMavenProject() {
+ return mavenProject;
+ }
+
+ public MavenSession getMavenSession() {
+ return mavenSession;
+ }
+
+ public IFile getPom() {
+ return facade.getPom();
+ }
+
+ public IMavenProjectFacade getMavenProjectFacade() {
+ return facade;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/repository/IRepository.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/repository/IRepository.java
new file mode 100644
index 00000000..285cc99e
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/repository/IRepository.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.repository;
+
+import java.io.File;
+
+import org.apache.maven.wagon.authentication.AuthenticationInfo;
+
+/**
+ * Repository tracked by repository registry.
+ *
+ * @author igor
+ */
+public interface IRepository {
+
+ /*
+ * Element/attribute names in settings.xml are quite confusing.
+ *
+ * "server" defines repository access credentials.
+ *
+ * "mirror/id" references server/id, i.e. credentials used to
+ * access the mirror. It does NOT identify the mirror.
+ *
+ * "repository/id" references server/id but also used to override repository
+ * definition. For example, repository with id=central defined in settings.xml
+ * overrides definition of central hardcoded in maven code.
+ *
+ */
+
+ /**
+ * Repository access credentials. Can be null.
+ */
+ public AuthenticationInfo getAuthenticationInfo();
+
+ /**
+ * Repository URL
+ */
+ public String getUrl();
+
+ /**
+ * For local repositories, returns basedir of repository contents.
+ *
+ * Returns null for remote repositories;
+ */
+ public File getBasedir();
+
+ /**
+ * Repository id element as defined in settings.xml or pom.xml file.
+ *
+ * Note that repository id is a reference to server element in settings.xml file,
+ * it does not uniquely identify a repository.
+ */
+ public String getId();
+
+ /**
+ * Unique repository id. Generated based on combination of repository url and userId.
+ * Can be used to store repository-related information on local filesystem.
+ */
+ public String getUid();
+
+ /**
+ * Indicates that repository id matches mirrorOf clause of a mirror. In other
+ * words, all repository requests will be redirected to a mirror.
+ *
+ * If null, repository is accessed directly.
+ *
+ * TODO decide return value format.
+ */
+ public String getMirrorId();
+
+ /**
+ * For repository mirrors, returns value of mirrorOf element as defined in settings.xml.
+ *
+ * Returns null for other repositories.
+ */
+ public String getMirrorOf();
+
+ /**
+ * Protocol part of repository url, i.e. "file", "http", etc.
+ */
+ public String getProtocol();
+
+ public boolean isScope(int scope);
+
+ /**
+ * Human readable repository identifier
+ */
+ public String toString();
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/repository/IRepositoryRegistry.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/repository/IRepositoryRegistry.java
new file mode 100644
index 00000000..5e676adf
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/repository/IRepositoryRegistry.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.repository;
+
+import java.util.List;
+
+import org.eclipse.m2e.core.embedder.ArtifactRepositoryRef;
+
+/**
+ * Registry of repositories accessible by m2e.
+ *
+ * The registry automatically tracks the following repositories
+ *
+ * <dl>
+ * <li>Maven local repository
+ * <li>Workspace repository
+ * <li>Mirrors defined in settings.xml
+ * <li>Repositories and pluginRepositories defined in active profiles in
+ * settings.xml
+ * <li>Repositories and pluginRepositories defined in pom.xml files of
+ * workspace Maven projects.
+ * </dl>
+ *
+ * @author igor
+ */
+public interface IRepositoryRegistry {
+
+ /**
+ *
+ */
+ public static final int SCOPE_UNKNOWN = 1;
+
+ /**
+ * Maven local repositories.
+ */
+ public static final int SCOPE_LOCAL = 1 << 1;
+
+ /**
+ * Eclipse workspace repository
+ */
+ public static final int SCOPE_WORKSPACE = 1 << 2;
+
+ /**
+ * Repositories defined in settings.xml file.
+ */
+ public static final int SCOPE_SETTINGS = 1 << 3;
+
+ /**
+ * Repositories defined in pom.xml files of workspace Maven projects
+ */
+ public static final int SCOPE_PROJECT = 1 << 4;
+
+
+ public List<IRepository> getRepositories(int scope);
+
+ public IRepository getWorkspaceRepository();
+
+ public IRepository getLocalRepository();
+
+ public IRepository getRepository(ArtifactRepositoryRef repositoryRef);
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/MavenCheckoutOperation.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/MavenCheckoutOperation.java
new file mode 100644
index 00000000..abdabde3
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/MavenCheckoutOperation.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.scm;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osgi.util.NLS;
+
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.MavenProjectScmInfo;
+
+
+/**
+ * Checkout operation
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenCheckoutOperation {
+
+ private final MavenConsole console;
+
+ private final File location;
+
+ private final Collection<MavenProjectScmInfo> mavenProjects;
+
+ private final List<String> locations = new ArrayList<String>();
+
+ public MavenCheckoutOperation(File location, Collection<MavenProjectScmInfo> mavenProjects, MavenConsole console) {
+ this.location = location;
+ this.mavenProjects = mavenProjects;
+ this.console = console;
+ }
+
+ public void run(IProgressMonitor monitor) throws InterruptedException, CoreException {
+ List<MavenProjectScmInfo> flatProjects = new ArrayList<MavenProjectScmInfo>();
+
+ // sort nested projects
+ for(MavenProjectScmInfo info : mavenProjects) {
+ if(monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+
+ String folderUrl = info.getFolderUrl();
+
+ monitor.setTaskName(NLS.bind(Messages.MavenCheckoutOperation_task_scanning, info.getLabel(), info.getFolderUrl()));
+
+ // XXX check if projects already exist
+ boolean isNestedPath = false;
+ for(MavenProjectScmInfo info2 : mavenProjects) {
+ if(info != info2) {
+ String path = info2.getFolderUrl();
+ if(folderUrl.startsWith(path + "/")) { //$NON-NLS-1$
+ isNestedPath = true;
+ break;
+ }
+ }
+ }
+ if(!isNestedPath) {
+ flatProjects.add(info);
+ }
+ }
+
+ for(MavenProjectScmInfo info : flatProjects) {
+ if(monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+
+ monitor.setTaskName(NLS.bind(Messages.MavenCheckoutOperation_task_checking,info.getLabel(), info.getFolderUrl()));
+
+ // XXX if location is pointing to workspace folder need to create unique dir too
+ File workspaceRoot = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
+ File location = getUniqueDir(this.location == null ? workspaceRoot : this.location);
+
+ ScmHandler handler = ScmHandlerFactory.getHandler(info.getFolderUrl());
+ if(handler == null) {
+ String msg = "SCM provider is not available for " + info.getFolderUrl();
+ console.logError(msg);
+ } else {
+ handler.checkoutProject(info, location, monitor);
+ locations.add(location.getAbsolutePath());
+ }
+
+ }
+
+ }
+
+ protected File getUniqueDir(File baseDir) {
+ long suffix = System.currentTimeMillis();
+ while(true) {
+ File tempDir = new File(baseDir, "maven." + suffix); //$NON-NLS-1$
+ if(!tempDir.exists()) {
+ return tempDir;
+ }
+ suffix++;
+ }
+ }
+
+ /**
+ * @return Returns collection of {@link MavenProjectScmInfo}
+ */
+ public Collection<MavenProjectScmInfo> getMavenProjects() {
+ return this.mavenProjects;
+ }
+
+ /**
+ * @return Returns list of <code>String</code> paths for the checked out locations
+ */
+ public List<String> getLocations() {
+ return this.locations;
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmHandler.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmHandler.java
new file mode 100644
index 00000000..9adb53a3
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmHandler.java
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.scm;
+
+import java.io.File;
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.MavenProjectScmInfo;
+
+/**
+ * An SCM handler base class
+ *
+ * @author Eugene Kuleshov
+ */
+public abstract class ScmHandler implements Comparable<ScmHandler>, IExecutableExtension {
+
+ public static final String ATTR_CLASS = "class"; //$NON-NLS-1$
+ public static final String ATTR_TYPE = "type"; //$NON-NLS-1$
+ public static final String ATTR_PRIORITY = "priority"; //$NON-NLS-1$
+
+ private String type;
+ private int priority;
+
+ public String getType() {
+ return type;
+ }
+
+ public int getPriority() {
+ return priority;
+ }
+
+ /**
+ * Opens resource from SCM
+ *
+ * @param url an url in maven-scm format for the resource to open
+ * @param revision a resource revision to open
+ *
+ * @throws CoreException when selected resource can't be open
+ *
+ * @see http://maven.apache.org/scm/scm-url-format.html
+ */
+ public InputStream open(String url, String revision) throws CoreException {
+ return null;
+ }
+
+ /**
+ * @param info
+ * @param location
+ * @param monitor
+ */
+ public abstract void checkoutProject(MavenProjectScmInfo info, //
+ File location, IProgressMonitor monitor) throws CoreException, InterruptedException;
+
+ // IExecutableExtension
+
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
+ String handlerClass = config.getAttribute(propertyName);
+ String type = config.getAttribute(ATTR_TYPE);
+ String priority = config.getAttribute(ATTR_PRIORITY);
+
+ this.type = type;
+
+ if(priority!=null) {
+ try {
+ this.priority = Integer.parseInt(priority);
+ } catch(Exception ex) {
+ MavenLogger.log("Unable to parse priority for " + handlerClass, ex);
+ }
+ }
+ }
+
+ // Comparable
+
+ public int compareTo(ScmHandler o) {
+ if(o != null) {
+ ScmHandler handler = o;
+ int res = getType().compareTo(handler.getType());
+ if(res==0) {
+ res = getPriority() - handler.getPriority();
+ }
+ return res;
+ }
+ return -1;
+ }
+
+ public int hashCode() {
+ final int prime = 31;
+ int result = prime + this.priority;
+ return prime * result + ((this.type == null) ? 0 : this.type.hashCode());
+ }
+
+ public boolean equals(Object obj) {
+ if(this == obj) {
+ return true;
+ }
+ if(obj == null) {
+ return false;
+ }
+ if(getClass() != obj.getClass()) {
+ return false;
+ }
+ ScmHandler other = (ScmHandler) obj;
+ if(this.priority != other.priority) {
+ return false;
+ }
+ if(this.type == null) {
+ if(other.type != null) {
+ return false;
+ }
+ } else if(!this.type.equals(other.type)) {
+ return false;
+ }
+ return true;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmHandlerFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmHandlerFactory.java
new file mode 100644
index 00000000..8d3c7d92
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmHandlerFactory.java
@@ -0,0 +1,152 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.scm;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+
+
+/**
+ * An SCM handler factory
+ *
+ * @author Eugene Kuleshov
+ */
+public class ScmHandlerFactory {
+
+
+ public static final String EXTENSION_SCM_HANDLERS = IMavenConstants.PLUGIN_ID + ".scmHandlers"; //$NON-NLS-1$
+
+ public static final String EXTENSION_SCM_HANDLERS_UI = IMavenConstants.PLUGIN_ID + ".scmHandlersUi"; //$NON-NLS-1$
+
+ private static final String ELEMENT_SCM_HANDLER = "handler"; //$NON-NLS-1$
+
+ private static final String ELEMENT_SCM_HANDLER_UI = "handlerUi"; //$NON-NLS-1$
+
+ private static volatile Map<String, List<ScmHandler>> scms;
+
+ private static volatile Map<String, ScmHandlerUi> scmUis;
+
+ public static synchronized void addScmHandlerUi(ScmHandlerUi handlerUi) {
+ getScmUis().put(handlerUi.getType(), handlerUi);
+ }
+
+ public static synchronized ScmHandlerUi getHandlerUiByType(String type) {
+ return type == null ? null : getScmUis().get(type);
+ }
+
+ public static synchronized void addScmHandler(ScmHandler handler) {
+ List<ScmHandler> handlers = getScms().get(handler.getType());
+ if(handlers == null) {
+ handlers = new ArrayList<ScmHandler>();
+ getScms().put(handler.getType(), handlers);
+ }
+ handlers.add(handler);
+ Collections.sort(handlers);
+ }
+
+ public static synchronized String[] getTypes() {
+ Map<String, List<ScmHandler>> scms = getScms();
+ return scms.keySet().toArray(new String[scms.size()]);
+ }
+
+ public static synchronized ScmHandler getHandler(String url) throws CoreException {
+ String type = ScmUrl.getType(url);
+ return getHandlerByType(type);
+ }
+
+ public static synchronized ScmHandler getHandlerByType(String type) {
+ List<ScmHandler> handlers = getScms().get(type);
+ if(handlers == null) {
+ return null;
+ }
+ return handlers.get(0);
+ }
+
+ private static Map<String, List<ScmHandler>> getScms() {
+ if(scms == null) {
+ scms = new TreeMap<String, List<ScmHandler>>();
+ for(ScmHandler scmHandler : readScmHanderExtensions()) {
+ addScmHandler(scmHandler);
+ }
+ }
+ return scms;
+ }
+
+ private static Map<String, ScmHandlerUi> getScmUis() {
+ if(scmUis == null) {
+ scmUis = new TreeMap<String, ScmHandlerUi>();
+ List<ScmHandlerUi> scmHandlerUis = readScmHandlerUiExtensions();
+ for(ScmHandlerUi scmHandlerUi : scmHandlerUis) {
+ addScmHandlerUi(scmHandlerUi);
+ }
+ }
+ return scmUis;
+ }
+
+ private static List<ScmHandler> readScmHanderExtensions() {
+ List<ScmHandler> scmHandlers = new ArrayList<ScmHandler>();
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint scmHandlersExtensionPoint = registry.getExtensionPoint(EXTENSION_SCM_HANDLERS);
+ if(scmHandlersExtensionPoint != null) {
+ IExtension[] scmHandlersExtensions = scmHandlersExtensionPoint.getExtensions();
+ for(IExtension extension : scmHandlersExtensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for(IConfigurationElement element : elements) {
+ if(element.getName().equals(ELEMENT_SCM_HANDLER)) {
+ try {
+ scmHandlers.add((ScmHandler) element.createExecutableExtension(ScmHandler.ATTR_CLASS));
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+ }
+ return scmHandlers;
+ }
+
+ private static List<ScmHandlerUi> readScmHandlerUiExtensions() {
+ ArrayList<ScmHandlerUi> scmHandlerUis = new ArrayList<ScmHandlerUi>();
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint scmHandlersUiExtensionPoint = registry.getExtensionPoint(EXTENSION_SCM_HANDLERS_UI);
+ if(scmHandlersUiExtensionPoint != null) {
+ IExtension[] scmHandlersUiExtensions = scmHandlersUiExtensionPoint.getExtensions();
+ for(IExtension extension : scmHandlersUiExtensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for(IConfigurationElement element : elements) {
+ if(element.getName().equals(ELEMENT_SCM_HANDLER_UI)) {
+ try {
+ scmHandlerUis.add((ScmHandlerUi) element.createExecutableExtension(ScmHandlerUi.ATTR_CLASS));
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+ }
+ return scmHandlerUis;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmHandlerUi.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmHandlerUi.java
new file mode 100644
index 00000000..bb8d4ec8
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmHandlerUi.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.scm;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * An SCM handler UI base class
+ *
+ * @author Eugene Kuleshov
+ */
+public abstract class ScmHandlerUi implements IExecutableExtension {
+ public static final String ATTR_TYPE = "type"; //$NON-NLS-1$
+ public static final String ATTR_CLASS = "class"; //$NON-NLS-1$
+
+ private String type;
+
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Show revision/tag browser dialog and allow user to select revision/tag
+ *
+ * @param shell the shell for revison/tag browser dialog
+ * @param scmUrl the current <code>ScmUrl</code>, or null if none
+ * @param scmRevision the current revision, or null if none
+ * @return String selected revision
+ */
+ public String selectRevision(Shell shell, ScmUrl scmUrl, String scmRevision) {
+ return null;
+ }
+
+ /**
+ * Show repository browser dialog and allow user to select location
+ *
+ * @param shell the shell for repository browser dialog
+ * @param scmUrl the current <code>ScmUrl</code>, or null if none
+ * @return ScmUrl for selected location or null if dialog was canceled
+ */
+ public ScmUrl selectUrl(Shell shell, ScmUrl scmUrl) {
+ return null;
+ }
+
+ public boolean isValidUrl(String scmUrl) {
+ return false;
+ }
+
+ public boolean isValidRevision(ScmUrl scmUrl, String scmRevision) {
+ return false;
+ }
+
+ public boolean canSelectUrl() {
+ return false;
+ }
+
+ public boolean canSelectRevision() {
+ return false;
+ }
+
+
+ // IExecutableExtension
+
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
+ this.type = config.getAttribute(ATTR_TYPE);
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmTag.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmTag.java
new file mode 100644
index 00000000..867357ca
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmTag.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.scm;
+
+/**
+ * An SCM wrapper for tags
+ *
+ * @author Eugene Kuleshov
+ */
+public class ScmTag {
+
+ public static enum Type {
+ HEAD, TAG, BRANCH, DATE;
+ }
+
+ private final String name;
+ private final Type type;
+
+
+ public ScmTag(String name) {
+ this(name, null);
+ }
+
+ public ScmTag(String name, Type type) {
+ this.name = name;
+ this.type = type;
+ }
+
+ /**
+ * Returns tag name
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * Returns tag type
+ */
+ public Type getType() {
+ return this.type;
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmUrl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmUrl.java
new file mode 100644
index 00000000..b3eb3ecf
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/scm/ScmUrl.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.scm;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.internal.Messages;
+
+/**
+ * An SCM URL wrapper used to adapt 3rd party resources:
+ *
+ * <pre>
+ * scm:{scm_provider}:{scm_provider_specific_part}
+ * </pre>
+ *
+ * @see http://maven.apache.org/scm/scm-url-format.html
+ * @see org.eclipse.core.runtime.IAdapterManager
+ *
+ * @author Eugene Kuleshov
+ */
+public class ScmUrl {
+ private final String scmUrl;
+ private final String scmParentUrl;
+ private final ScmTag tag;
+
+ public ScmUrl(String scmUrl) {
+ this(scmUrl, null);
+ }
+
+ public ScmUrl(String scmUrl, String scmParentUrl) {
+ this(scmUrl, null, null);
+ }
+
+ public ScmUrl(String scmUrl, String scmParentUrl, ScmTag tag) {
+ this.scmUrl = scmUrl;
+ this.scmParentUrl = scmParentUrl;
+ this.tag = tag;
+ }
+
+ /**
+ * Return SCM url
+ */
+ public String getUrl() {
+ return scmUrl;
+ }
+
+ /**
+ * Return SCM url for the parent folder
+ */
+ public String getParentUrl() {
+ return scmParentUrl;
+ }
+
+ /**
+ * Return SCM tag
+ */
+ public ScmTag getTag() {
+ return this.tag;
+ }
+
+ /**
+ * Return provider-specific part of the SCM url
+ *
+ * @return
+ */
+ public String getProviderUrl() {
+ try {
+ String type = ScmUrl.getType(scmUrl);
+ return scmUrl.substring(type.length() + 5);
+
+ } catch(CoreException ex) {
+ return null;
+ }
+ }
+
+ public static synchronized String getType(String url) throws CoreException {
+ if(!url.startsWith("scm:")) { //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, NLS.bind(Messages.ScmUrl_error, url), null));
+ }
+ int n = url.indexOf(":", 4); //$NON-NLS-1$
+ if(n == -1) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, NLS.bind(Messages.ScmUrl_error, url), null));
+ }
+ return url.substring(4, n);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/AbstractMavenDialog.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/AbstractMavenDialog.java
new file mode 100644
index 00000000..37a8d4ad
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/AbstractMavenDialog.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.dialogs;
+
+import org.eclipse.jface.dialogs.DialogSettings;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.SelectionStatusDialog;
+
+import org.eclipse.m2e.core.MavenPlugin;
+
+
+/**
+ * A dialog superclass, featuring position and size settings.
+ */
+public abstract class AbstractMavenDialog extends SelectionStatusDialog {
+
+ protected static final String KEY_WIDTH = "width"; //$NON-NLS-1$
+ protected static final String KEY_HEIGHT = "height"; //$NON-NLS-1$
+ private static final String KEY_X = "x"; //$NON-NLS-1$
+ private static final String KEY_Y = "y"; //$NON-NLS-1$
+ protected IDialogSettings settings;
+ private Point location;
+ private Point size;
+
+ /**
+ * @param parent
+ */
+ protected AbstractMavenDialog(Shell parent, String settingsSection) {
+ super(parent);
+
+ IDialogSettings pluginSettings = MavenPlugin.getDefault().getDialogSettings();
+ IDialogSettings settings = pluginSettings.getSection(settingsSection);
+ if(settings == null) {
+ settings = new DialogSettings(settingsSection);
+ settings.put(KEY_WIDTH, 480);
+ settings.put(KEY_HEIGHT, 450);
+ pluginSettings.addSection(settings);
+ }
+ this.settings = settings;
+ }
+
+ protected Point getInitialSize() {
+ Point result = super.getInitialSize();
+ if(size != null) {
+ result.x = Math.max(result.x, size.x);
+ result.y = Math.max(result.y, size.y);
+ Rectangle display = getShell().getDisplay().getClientArea();
+ result.x = Math.min(result.x, display.width);
+ result.y = Math.min(result.y, display.height);
+ }
+ return result;
+ }
+
+ protected Point getInitialLocation(Point initialSize) {
+ Point result = super.getInitialLocation(initialSize);
+ if(location != null) {
+ result.x = location.x;
+ result.y = location.y;
+ Rectangle display = getShell().getDisplay().getClientArea();
+ int xe = result.x + initialSize.x;
+ if(xe > display.width) {
+ result.x -= xe - display.width;
+ }
+ int ye = result.y + initialSize.y;
+ if(ye > display.height) {
+ result.y -= ye - display.height;
+ }
+ }
+ return result;
+ }
+
+ public boolean close() {
+ writeSettings();
+ return super.close();
+ }
+
+ /**
+ * Initializes itself from the dialog settings with the same state as at the
+ * previous invocation.
+ */
+ protected void readSettings() {
+ try {
+ int x = settings.getInt(KEY_X); //$NON-NLS-1$
+ int y = settings.getInt(KEY_Y); //$NON-NLS-1$
+ location = new Point(x, y);
+ } catch(NumberFormatException e) {
+ location = null;
+ }
+ try {
+ int width = settings.getInt(KEY_WIDTH); //$NON-NLS-1$
+ int height = settings.getInt(KEY_HEIGHT); //$NON-NLS-1$
+ size = new Point(width, height);
+
+ } catch(NumberFormatException e) {
+ size = null;
+ }
+ }
+
+ /**
+ * Stores it current configuration in the dialog store.
+ */
+ private void writeSettings() {
+ Point location = getShell().getLocation();
+ settings.put(KEY_X, location.x); //$NON-NLS-1$
+ settings.put(KEY_Y, location.y); //$NON-NLS-1$
+
+ Point size = getShell().getSize();
+ settings.put(KEY_WIDTH, size.x); //$NON-NLS-1$
+ settings.put(KEY_HEIGHT, size.y); //$NON-NLS-1$
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/AddDependencyDialog.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/AddDependencyDialog.java
new file mode 100644
index 00000000..3a19d329
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/AddDependencyDialog.java
@@ -0,0 +1,617 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.dialogs;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+
+import com.ibm.icu.text.DateFormat;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+
+import org.apache.lucene.search.BooleanQuery;
+
+import org.sonatype.aether.artifact.Artifact;
+import org.sonatype.aether.graph.DependencyNode;
+import org.sonatype.aether.graph.DependencyVisitor;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.index.UserInputSearchExpression;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.util.ProposalUtil;
+import org.eclipse.m2e.core.util.search.Packaging;
+import org.eclipse.m2e.core.wizards.MavenPomSelectionComponent;
+import org.eclipse.m2e.core.wizards.WidthGroup;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+
+
+/**
+ * A Dialog whose primary goal is to allow the user to select a dependency, either by entering the GAV coordinates
+ * manually, or by search through a repository index.
+ *
+ * @author rgould
+ */
+public class AddDependencyDialog extends AbstractMavenDialog {
+
+ public static final String[] SCOPES = new String[] {"compile", "provided", "runtime", "test", "system"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+
+ /*
+ * dependencies under dependencyManagement are permitted to use an the extra "import" scope
+ */
+ public static final String[] DEP_MANAGEMENT_SCOPES = new String[] {"compile", "provided", "runtime", "test", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "system", "import"}; //$NON-NLS-1$ //$NON-NLS-2$
+
+ protected static final String DIALOG_SETTINGS = AddDependencyDialog.class.getName();
+
+ protected static final long SEARCH_DELAY = 500L; //in milliseconds
+
+ protected String[] scopes;
+
+ protected TreeViewer resultsViewer;
+
+ protected Text queryText;
+
+ protected Text groupIDtext;
+
+ protected Text artifactIDtext;
+
+ protected Text versionText;
+
+ protected Text infoTextarea;
+
+ protected List scopeList;
+
+ protected java.util.List<Dependency> dependencies;
+
+ protected WidthGroup widthGroup;
+
+ /*
+ * Stores selected files from the results viewer. These are later
+ * converted into the above dependencies when OK is pressed.
+ */
+ protected java.util.List<IndexedArtifactFile> artifactFiles;
+
+ protected SearchJob currentSearch;
+
+ protected IProject project;
+
+ protected DependencyNode dependencyNode;
+
+ /*
+ * This is to be run when the dialog is done creating its controls, but
+ * before open() is called
+ */
+ protected Runnable onLoad;
+
+ protected SelectionListener resultsListener;
+
+ /**
+ * The AddDependencyDialog differs slightly in behaviour depending on context. If it is being used to apply a
+ * dependency under the "dependencyManagement" context, the extra "import" scope is available. Set @param
+ * isForDependencyManagement to true if this is case.
+ *
+ * @param parent
+ * @param isForDependencyManagement
+ * @param project the project which contains this POM. Used for looking up indices
+ */
+ public AddDependencyDialog(Shell parent, boolean isForDependencyManagement, IProject project) {
+ super(parent, DIALOG_SETTINGS);
+ this.project = project;
+
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ setTitle(Messages.AddDependencyDialog_title);
+// setStatusLineAboveButtons(true);
+
+ if(!isForDependencyManagement) {
+ this.scopes = SCOPES;
+ } else {
+ this.scopes = DEP_MANAGEMENT_SCOPES;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea()
+ */
+ protected Control createDialogArea(Composite parent) {
+ readSettings();
+
+ Composite composite = (Composite) super.createDialogArea(parent);
+
+ widthGroup = new WidthGroup();
+ composite.addControlListener(widthGroup);
+
+ Composite gavControls = createGAVControls(composite);
+ gavControls.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+
+ new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+
+ Composite searchControls = createSearchControls(composite);
+ searchControls.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ Display.getDefault().asyncExec(this.onLoad);
+
+ return composite;
+ }
+
+
+ /**
+ * Sets the up group-artifact-version controls
+ */
+ private Composite createGAVControls(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+
+ GridLayout gridLayout = new GridLayout(4, false);
+ gridLayout.marginWidth = 0;
+ composite.setLayout(gridLayout);
+
+ Label groupIDlabel = new Label(composite, SWT.NONE);
+ groupIDlabel.setText(Messages.AddDependencyDialog_groupId_label);
+ widthGroup.addControl(groupIDlabel);
+
+ groupIDtext = new Text(composite, SWT.BORDER);
+ groupIDtext.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Label scopeLabel = new Label(composite, SWT.NONE);
+ scopeLabel.setText(Messages.AddDependencyDialog_scope_label);
+
+ scopeList = new List(composite, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL);
+ scopeList.setItems(scopes);
+ GridData scopeListData = new GridData(SWT.LEFT, SWT.FILL, false, true, 1, 3);
+ scopeListData.heightHint = 20;
+ scopeListData.widthHint = 100;
+ scopeList.setLayoutData(scopeListData);
+ scopeList.setSelection(0);
+
+ Label artifactIDlabel = new Label(composite, SWT.NONE);
+ artifactIDlabel.setText(Messages.AddDependencyDialog_artifactId_label);
+ widthGroup.addControl(artifactIDlabel);
+
+ artifactIDtext = new Text(composite, SWT.BORDER);
+ artifactIDtext.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Label filler = new Label(composite, SWT.NONE);
+ filler.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 2));
+
+ Label versionLabel = new Label(composite, SWT.NONE);
+ versionLabel.setText(Messages.AddDependencyDialog_version_label);
+ widthGroup.addControl(versionLabel);
+
+ versionText = new Text(composite, SWT.BORDER);
+ versionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ /*
+ * Fix the tab order (group -> artifact -> version -> scope)
+ */
+ composite.setTabList(new Control[] { groupIDtext, artifactIDtext, versionText, scopeList});
+
+ ProposalUtil.addGroupIdProposal(project, groupIDtext, Packaging.ALL);
+ ProposalUtil.addArtifactIdProposal(project, groupIDtext, artifactIDtext, Packaging.ALL);
+ ProposalUtil.addVersionProposal(project, groupIDtext, artifactIDtext, versionText, Packaging.ALL);
+
+ artifactIDtext.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ updateInfo();
+ }
+ });
+
+ groupIDtext.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ updateInfo();
+ }
+ });
+
+ return composite;
+ }
+
+ void updateInfo() {
+// infoTextarea.setText(""); //$NON-NLS-1$
+ if(dependencyNode == null) {
+ return;
+ }
+ dependencyNode.accept(new DependencyVisitor() {
+
+ public boolean visitLeave(DependencyNode node) {
+ if(node.getDependency() != null && node.getDependency().getArtifact() != null) {
+ Artifact artifact = node.getDependency().getArtifact();
+ if(artifact.getGroupId().equalsIgnoreCase(groupIDtext.getText().trim())
+ && artifact.getArtifactId().equalsIgnoreCase(artifactIDtext.getText().trim())) {
+ infoTextarea.setText(NLS.bind(Messages.AddDependencyDialog_info_transitive,
+ new String[] {artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion()}));
+ }
+ return false;
+ }
+ return true;
+ }
+
+ public boolean visitEnter(DependencyNode node) {
+ return true;
+ }
+ });
+
+ }
+
+ private Composite createSearchControls(Composite parent) {
+ SashForm sashForm = new SashForm(parent, SWT.VERTICAL | SWT.SMOOTH);
+ sashForm.setLayout(new FillLayout());
+
+ Composite resultsComposite = new Composite(sashForm, SWT.NONE);
+ GridLayout resultsLayout = new GridLayout(1, false);
+ resultsLayout.marginWidth = 0;
+ resultsComposite.setLayout(resultsLayout);
+
+ Label queryLabel = new Label(resultsComposite, SWT.NONE);
+ queryLabel.setText(Messages.AddDependencyDialog_search_label);
+// widthGroup.addControl(queryLabel);
+
+ queryText = new Text(resultsComposite, SWT.BORDER | SWT.SEARCH);
+ queryText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ queryText.setFocus();
+
+// queryText.setMessage(Messages.AddDependencyDialog_search_message);
+
+ Label resultsLabel = new Label(resultsComposite, SWT.NONE);
+ resultsLabel.setText(Messages.AddDependencyDialog_results_label);
+ resultsLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
+// widthGroup.addControl(resultsLabel);
+
+ Tree resultsTree = new Tree(resultsComposite, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
+ GridData treeData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ treeData.heightHint = 140;
+ treeData.widthHint = 100;
+ resultsTree.setLayoutData(treeData);
+
+ Composite infoComposite = new Composite(sashForm, SWT.NONE);
+ GridLayout infoLayout = new GridLayout(1, false);
+ infoLayout.marginWidth = 0;
+ infoComposite.setLayout(infoLayout);
+
+ Label infoLabel = new Label(infoComposite, SWT.NONE);
+ infoLabel.setText(Messages.AddDependencyDialog_info_label);
+ infoLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
+// widthGroup.addControl(infoLabel);
+
+ infoTextarea = new Text(infoComposite, SWT.MULTI | SWT.READ_ONLY | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+ GridData infoData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ infoData.heightHint = 60;
+ infoData.widthHint = 100;
+ infoTextarea.setLayoutData(infoData);
+
+ sashForm.setWeights(new int[] {70, 30});
+
+ /*
+ * Set up TreeViewer for search results
+ */
+
+ resultsViewer = new TreeViewer(resultsTree);
+ resultsViewer.setContentProvider(new MavenPomSelectionComponent.SearchResultContentProvider());
+ //TODO we want to have the artifacts marked for presence and management..
+ resultsViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(new MavenPomSelectionComponent.SearchResultLabelProvider(Collections.EMPTY_SET, Collections.EMPTY_SET,
+ IIndex.SEARCH_ARTIFACT)));
+
+ /*
+ * Hook up events
+ */
+
+ resultsListener = new SelectionListener();
+ resultsViewer.addSelectionChangedListener(resultsListener);
+
+ queryText.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent e) {
+ if(e.keyCode == SWT.ARROW_DOWN) {
+ resultsViewer.getTree().setFocus();
+ }
+ }
+ });
+
+ queryText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ search(queryText.getText());
+ }
+ });
+
+ return sashForm;
+ }
+
+ /**
+ * Just a short helper method to determine what to display in the text widgets when the user selects multiple objects
+ * in the tree viewer. If the objects have the same value, then we should show that to them, otherwise we show
+ * something like "(multiple selected)"
+ *
+ * @param current
+ * @param newValue
+ * @return
+ */
+ String chooseWidgetText(String current, String newValue) {
+ if(current == null) {
+ return newValue;
+ } else if(!current.equals(newValue)) {
+ return Messages.AddDependencyDialog_multipleValuesSelected;
+ }
+ return current;
+ }
+
+ void appendFileInfo(final StringBuffer buffer, final IndexedArtifactFile file) {
+ buffer.append(" * " + file.fname);
+ if(file.size != -1) {
+ buffer.append(", size: ");
+ if((file.size / 1024 / 1024) > 0) {
+ buffer.append((file.size / 1024 / 1024) + "MB");
+ } else {
+ buffer.append(Math.max(1, file.size / 1024) + "KB");
+ }
+ }
+ buffer.append(", date: " + DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT).format(file.date));
+ buffer.append("\n");
+
+ if(dependencyNode != null) {
+ dependencyNode.accept(new DependencyVisitor() {
+
+ public boolean visitEnter(DependencyNode node) {
+ return true;
+ }
+
+ public boolean visitLeave(DependencyNode node) {
+ if(node.getDependency() == null || node.getDependency().getArtifact() == null) {
+ return true;
+ }
+ Artifact artifact = node.getDependency().getArtifact();
+ if(artifact.getGroupId().equalsIgnoreCase(file.group)
+ && artifact.getArtifactId().equalsIgnoreCase(file.artifact)) {
+ buffer.append(NLS.bind(Messages.AddDependencyDialog_transitive_dependency,
+ new String[] {artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion()}));
+ /*
+ * DependencyNodes don't know their parents. Determining which transitive dependency
+ * is using the selected dependency is non trivial :(
+ */
+ return false;
+ }
+ return true;
+ }
+ });
+ }
+ }
+
+ protected void search(String query) {
+ if(query == null || query.length() <= 2) {
+ if(this.currentSearch != null) {
+ this.currentSearch.cancel();
+ }
+ } else {
+ IndexManager indexManager = MavenPlugin.getDefault().getIndexManager();
+
+ if(this.currentSearch != null) {
+ this.currentSearch.cancel();
+ }
+
+ this.currentSearch = new SearchJob(query.toLowerCase(), indexManager);
+ this.currentSearch.schedule(SEARCH_DELAY);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult()
+ * This is called when OK is pressed. There's no obligation to do anything.
+ */
+ protected void computeResult() {
+ String scope = ""; //$NON-NLS-1$
+ if(scopeList.getSelection().length != 0) {
+ scope = scopeList.getSelection()[0];
+ }
+
+ if(artifactFiles == null || artifactFiles.size() == 1) {
+ Dependency dependency = createDependency(groupIDtext.getText().trim(), artifactIDtext.getText().trim(),
+ versionText.getText().trim(), scope, ""); //$NON-NLS-1$
+ this.dependencies = Collections.singletonList(dependency);
+ } else {
+ this.dependencies = new LinkedList<Dependency>();
+ for(IndexedArtifactFile file : artifactFiles) {
+ Dependency dep = createDependency(file.group, file.artifact, file.version, scope, file.type);
+ this.dependencies.add(dep);
+ }
+ }
+ }
+
+ private Dependency createDependency(String groupID, String artifactID, String version, String scope, String type) {
+ Dependency dependency = PomFactory.eINSTANCE.createDependency();
+ dependency.setGroupId(groupID);
+ dependency.setArtifactId(artifactID);
+ dependency.setVersion(version);
+
+ /*
+ * For scope and type, if the values are the default, don't save them.
+ * This reduces clutter in the XML file (although forces people who don't
+ * know what the defaults are to look them up).
+ */
+ dependency.setScope("compile".equals(scope) ? "" : scope); //$NON-NLS-1$ //$NON-NLS-2$
+ dependency.setType("jar".equals(type) ? "" : type); //$NON-NLS-1$ //$NON-NLS-2$
+
+ return dependency;
+ }
+
+ public java.util.List<Dependency> getDependencies() {
+ return this.dependencies;
+ }
+
+ void setInfo(int status, String message) {
+ updateStatus(new Status(status, IMavenConstants.PLUGIN_ID, message));
+ }
+
+ public final class SelectionListener implements ISelectionChangedListener {
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ if(selection.isEmpty()) {
+ infoTextarea.setText(""); //$NON-NLS-1$
+ artifactFiles = null;
+ } else {
+ String artifact = null;
+ String group = null;
+ String version = null;
+
+ artifactFiles = new LinkedList<IndexedArtifactFile>();
+ StringBuffer buffer = new StringBuffer();
+ Iterator iter = selection.iterator();
+ while(iter.hasNext()) {
+ Object obj = iter.next();
+ IndexedArtifactFile file = null;
+
+ if(obj instanceof IndexedArtifact) {
+ file = ((IndexedArtifact) obj).getFiles().iterator().next();
+ } else {
+ file = (IndexedArtifactFile) obj;
+ }
+
+ appendFileInfo(buffer, file);
+ artifactFiles.add(file);
+
+ artifact = chooseWidgetText(artifact, file.artifact);
+ group = chooseWidgetText(group, file.group);
+ version = chooseWidgetText(version, file.version);
+ }
+ setInfo(OK, NLS.bind(artifactFiles.size() == 1 ? Messages.AddDependencyDialog_itemSelected : Messages.AddDependencyDialog_itemsSelected, artifactFiles.size()));
+ infoTextarea.setText(buffer.toString());
+ artifactIDtext.setText(artifact);
+ groupIDtext.setText(group);
+ versionText.setText(version);
+
+ boolean enabled = !(artifactFiles.size() > 1);
+ artifactIDtext.setEnabled(enabled);
+ groupIDtext.setEnabled(enabled);
+ versionText.setEnabled(enabled);
+ }
+ }
+ }
+
+ private class SearchJob extends Job {
+
+ private String query;
+
+ private IndexManager indexManager;
+
+ private boolean cancelled = false;
+
+ public SearchJob(String query, IndexManager indexManager) {
+ super(NLS.bind(Messages.AddDependencyDialog_searchingFor, query));
+ this.query = query;
+ this.indexManager = indexManager;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected IStatus run(IProgressMonitor monitor) {
+ if(this.cancelled || resultsViewer == null || resultsViewer.getControl() == null
+ || resultsViewer.getControl().isDisposed()) {
+ return Status.CANCEL_STATUS;
+ }
+
+ try {
+ setResults(IStatus.OK, Messages.AddDependencyDialog_searching, Collections.<String, IndexedArtifact> emptyMap());
+ // TODO: before it was searching all indexes, but it should current project? (cstamas)
+ // If not, the change getIndex(project) to getAllIndexes() and done
+ // TODO: cstamas identified this as "user input", true?
+ Map<String, IndexedArtifact> results = indexManager.getIndex(project).search(new UserInputSearchExpression(query), IIndex.SEARCH_ARTIFACT,
+ IIndex.SEARCH_ALL);
+ setResults(IStatus.OK, NLS.bind(Messages.AddDependencyDialog_searchDone, results.size()), results);
+ } catch(BooleanQuery.TooManyClauses exception) {
+ setResults(IStatus.ERROR, Messages.AddDependencyDialog_tooManyResults,
+ Collections.<String, IndexedArtifact> emptyMap());
+ } catch(RuntimeException exception) {
+ setResults(IStatus.ERROR, NLS.bind(Messages.AddDependencyDialog_searchError, exception.toString()),
+ Collections.<String, IndexedArtifact> emptyMap());
+ } catch(CoreException ex) {
+ setResults(IStatus.ERROR, NLS.bind(Messages.AddDependencyDialog_searchError, ex.getMessage()),
+ Collections.<String, IndexedArtifact> emptyMap());
+ MavenLogger.log(ex);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#canceling()
+ */
+ protected void canceling() {
+ this.cancelled = true;
+ super.canceling();
+ }
+
+ private void setResults(final int status, final String infoMessage, final Map<String, IndexedArtifact> results) {
+ if(cancelled) {
+ return;
+ }
+
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ setInfo(status, infoMessage);
+ if(results != null && resultsViewer != null && resultsViewer.getControl() != null
+ && !resultsViewer.getControl().isDisposed()) {
+ resultsViewer.setInput(results);
+ }
+ }
+ });
+ }
+
+ }
+
+ public void setDepdencyNode(DependencyNode node) {
+ this.dependencyNode = node;
+ }
+
+ /**
+ * The provided runnable will be called after createDialogArea is done, but before it returns. This provides a way for
+ * long running operations to be executed in such a way as to not block the UI. This is primarily intended to allow
+ * the loading of the dependencyTree. The runnable should load the tree and then call setDependencyNode()
+ *
+ * @param runnable
+ */
+ public void onLoad(Runnable runnable) {
+ this.onLoad = runnable;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/EditDependencyDialog.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/EditDependencyDialog.java
new file mode 100644
index 00000000..4baaaf4f
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/EditDependencyDialog.java
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.dialogs;
+
+import static org.eclipse.m2e.core.util.Util.nvl;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.util.M2EUtils;
+import org.eclipse.m2e.core.util.ProposalUtil;
+import org.eclipse.m2e.core.util.search.Packaging;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+public class EditDependencyDialog extends AbstractMavenDialog {
+ protected static PomPackage POM_PACKAGE = PomPackage.eINSTANCE;
+
+ private static final String[] TYPES = new String[] {"jar", "war", "rar", "ear", "par", "ejb", "ejb-client", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+ "test-jar", "java-source", "javadoc", "maven-plugin", "pom"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+
+ private EditingDomain editingDomain;
+
+ private IProject project;
+
+ private String[] scopes;
+
+ protected Text groupIdText;
+
+ protected Text artifactIdText;
+
+ protected Text versionText;
+
+ protected Text classifierText;
+
+ protected Combo typeCombo;
+
+ protected Combo scopeCombo;
+
+ protected Text systemPathText;
+
+// protected Button selectSystemPathButton;
+
+ protected Button optionalButton;
+
+ private Dependency dependency;
+
+ public EditDependencyDialog(Shell parent, boolean dependencyManagement, EditingDomain editingDomain, IProject project) {
+ super(parent, EditDependencyDialog.class.getName());
+ this.editingDomain = editingDomain;
+ this.project = project;
+
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ setTitle(Messages.EditDependencyDialog_title);
+
+ if(!dependencyManagement) {
+ scopes = AddDependencyDialog.SCOPES;
+ } else {
+ scopes = AddDependencyDialog.DEP_MANAGEMENT_SCOPES;
+ }
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ readSettings();
+ Composite superComposite = (Composite) super.createDialogArea(parent);
+
+ Composite composite = new Composite(superComposite, SWT.NONE);
+ composite.setLayout(new GridLayout(3, false));
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ Label groupIdLabel = new Label(composite, SWT.NONE);
+ groupIdLabel.setText(Messages.EditDependencyDialog_groupId_label);
+
+ groupIdText = new Text(composite, SWT.BORDER);
+ GridData gd_groupIdText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+ gd_groupIdText.horizontalIndent = 4;
+ groupIdText.setLayoutData(gd_groupIdText);
+ ProposalUtil.addGroupIdProposal(project, groupIdText, Packaging.ALL);
+ M2EUtils.addRequiredDecoration(groupIdText);
+
+ Label artifactIdLabel = new Label(composite, SWT.NONE);
+ artifactIdLabel.setText(Messages.EditDependencyDialog_artifactId_label);
+
+ artifactIdText = new Text(composite, SWT.BORDER);
+ GridData gd_artifactIdText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+ gd_artifactIdText.horizontalIndent = 4;
+ artifactIdText.setLayoutData(gd_artifactIdText);
+ ProposalUtil.addArtifactIdProposal(project, groupIdText, artifactIdText, Packaging.ALL);
+ M2EUtils.addRequiredDecoration(artifactIdText);
+
+ Label versionLabel = new Label(composite, SWT.NONE);
+ versionLabel.setText(Messages.EditDependencyDialog_version_label);
+
+ versionText = new Text(composite, SWT.BORDER);
+ GridData versionTextData = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+ versionTextData.horizontalIndent = 4;
+ versionTextData.widthHint = 200;
+ versionText.setLayoutData(versionTextData);
+ ProposalUtil.addVersionProposal(project, groupIdText, artifactIdText, versionText, Packaging.ALL);
+
+ Label classifierLabel = new Label(composite, SWT.NONE);
+ classifierLabel.setText(Messages.EditDependencyDialog_classifier_label);
+
+ classifierText = new Text(composite, SWT.BORDER);
+ GridData gd_classifierText = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+ gd_classifierText.horizontalIndent = 4;
+ gd_classifierText.widthHint = 200;
+ classifierText.setLayoutData(gd_classifierText);
+ ProposalUtil
+ .addClassifierProposal(project, groupIdText, artifactIdText, versionText, classifierText, Packaging.ALL);
+
+ Label typeLabel = new Label(composite, SWT.NONE);
+ typeLabel.setText(Messages.EditDependencyDialog_type_label);
+
+ typeCombo = new Combo(composite, SWT.NONE);
+ typeCombo.setItems(TYPES);
+ GridData gd_typeText = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+ gd_typeText.horizontalIndent = 4;
+ gd_typeText.widthHint = 120;
+ typeCombo.setLayoutData(gd_typeText);
+
+ Label scopeLabel = new Label(composite, SWT.NONE);
+ scopeLabel.setText(Messages.EditDependencyDialog_scope_label);
+
+ scopeCombo = new Combo(composite, SWT.NONE);
+ scopeCombo.setItems(scopes);
+ GridData gd_scopeText = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+ gd_scopeText.horizontalIndent = 4;
+ gd_scopeText.widthHint = 120;
+ scopeCombo.setLayoutData(gd_scopeText);
+
+ Label systemPathLabel = new Label(composite, SWT.NONE);
+ systemPathLabel.setText(Messages.EditDependencyDialog_systemPath_label);
+
+ systemPathText = new Text(composite, SWT.BORDER);
+ GridData gd_systemPathText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+ gd_systemPathText.horizontalIndent = 4;
+ gd_systemPathText.widthHint = 200;
+ systemPathText.setLayoutData(gd_systemPathText);
+
+// selectSystemPathButton = new Button(composite, SWT.NONE);
+// selectSystemPathButton.setText("Select...");
+
+ new Label(composite, SWT.NONE);
+
+ optionalButton = new Button(composite, SWT.CHECK);
+ optionalButton.setText(Messages.EditDependencyDialog_optional_checkbox);
+ GridData gd_optionalButton = new GridData(SWT.LEFT, SWT.TOP, false, false, 2, 1);
+ gd_optionalButton.horizontalIndent = 4;
+ optionalButton.setLayoutData(gd_optionalButton);
+
+ composite.setTabList(new Control[] {groupIdText, artifactIdText, versionText, classifierText, typeCombo,
+ scopeCombo, systemPathText, /*selectSystemPathButton,*/optionalButton});
+
+ setDependency(dependency);
+
+ return superComposite;
+ }
+
+ protected void computeResult() {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ compoundCommand.append(createCommand(groupIdText.getText(), POM_PACKAGE.getDependency_GroupId(), "")); //$NON-NLS-1$
+ compoundCommand.append(createCommand(artifactIdText.getText(), POM_PACKAGE.getDependency_ArtifactId(), "")); //$NON-NLS-1$
+ compoundCommand.append(createCommand(versionText.getText(), POM_PACKAGE.getDependency_Version(), "")); //$NON-NLS-1$
+ compoundCommand.append(createCommand(classifierText.getText(), POM_PACKAGE.getDependency_Classifier(), "")); //$NON-NLS-1$
+ compoundCommand.append(createCommand(typeCombo.getText(), POM_PACKAGE.getDependency_Type(), "jar")); //$NON-NLS-1$
+ compoundCommand.append(createCommand(scopeCombo.getText(), POM_PACKAGE.getDependency_Scope(), "compile")); //$NON-NLS-1$
+ compoundCommand.append(createCommand(systemPathText.getText(), POM_PACKAGE.getDependency_SystemPath(), "")); //$NON-NLS-1$
+ compoundCommand.append(createCommand(String.valueOf(optionalButton.getSelection()),
+ POM_PACKAGE.getDependency_Optional(), "false")); //$NON-NLS-1$
+ editingDomain.getCommandStack().execute(compoundCommand);
+ }
+
+ public void setDependency(Dependency dependency) {
+ this.dependency = dependency;
+
+ if(dependency != null && groupIdText != null && !groupIdText.isDisposed()) {
+ groupIdText.setText(nvl(dependency.getGroupId()));
+ artifactIdText.setText(nvl(dependency.getArtifactId()));
+ versionText.setText(nvl(dependency.getVersion()));
+ classifierText.setText(nvl(dependency.getClassifier()));
+ typeCombo.setText("".equals(nvl(dependency.getType())) ? "jar" : dependency.getType()); //$NON-NLS-1$ //$NON-NLS-2$
+ scopeCombo.setText("".equals(nvl(dependency.getScope())) ? "compile" : dependency.getScope()); //$NON-NLS-1$ //$NON-NLS-2$
+ systemPathText.setText(nvl(dependency.getSystemPath()));
+
+ boolean optional = Boolean.parseBoolean(dependency.getOptional());
+ if(optionalButton.getSelection() != optional) {
+ optionalButton.setSelection(optional);
+ }
+ }
+ }
+
+ private Command createCommand(String value, Object feature, String defaultValue) {
+ return SetCommand.create(editingDomain, dependency, feature,
+ value.length() == 0 || value.equals(defaultValue) ? SetCommand.UNSET_VALUE : value);
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/InputHistory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/InputHistory.java
new file mode 100644
index 00000000..7aca5f83
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/InputHistory.java
@@ -0,0 +1,232 @@
+
+package org.eclipse.m2e.core.ui.dialogs;
+
+import java.beans.Beans;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Control;
+
+import org.eclipse.m2e.core.MavenPlugin;
+
+
+public class InputHistory {
+ /** the history limit */
+ protected static final int MAX_HISTORY = 10;
+
+ /** dialog settings to store input history */
+ protected IDialogSettings dialogSettings;
+
+ /** the Map of field ids to List of comboboxes that share the same history */
+ private Map<String, List<ControlWrapper>> comboMap;
+
+ private List<String> privileged;
+
+ public InputHistory(String sectionName) {
+ this(sectionName, new String[0]);
+ }
+
+ public InputHistory(String sectionName, String[] privileged) {
+ comboMap = new HashMap<String, List<ControlWrapper>>();
+
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ if(plugin != null) {
+ IDialogSettings pluginSettings = plugin.getDialogSettings();
+ dialogSettings = pluginSettings.getSection(sectionName);
+ if(dialogSettings == null) {
+ dialogSettings = pluginSettings.addNewSection(sectionName);
+ pluginSettings.addSection(dialogSettings);
+ }
+ }
+ assert privileged != null;
+ this.privileged = Arrays.asList(privileged);
+ }
+
+ /** Loads the input history from the dialog settings. */
+ public void load() {
+ if(Beans.isDesignTime()) {
+ return;
+ }
+
+ for(Map.Entry<String, List<ControlWrapper>> e : comboMap.entrySet()) {
+ String id = e.getKey();
+ Set<String> items = new LinkedHashSet<String>();
+ String[] itemsArr = dialogSettings.getArray(id);
+ items.addAll(privileged);
+ if(itemsArr != null) {
+ items.addAll(Arrays.asList(itemsArr));
+ }
+ for(ControlWrapper wrapper : e.getValue()) {
+ if(!wrapper.isDisposed()) {
+ wrapper.setItems(items.toArray(new String[0]));
+ }
+ }
+ }
+ }
+
+ /** Saves the input history into the dialog settings. */
+ public void save() {
+ if(Beans.isDesignTime()) {
+ return;
+ }
+
+ for(Map.Entry<String, List<ControlWrapper>> e : comboMap.entrySet()) {
+ String id = e.getKey();
+
+ Set<String> history = new LinkedHashSet<String>(MAX_HISTORY);
+
+ for(ControlWrapper wrapper : e.getValue()) {
+ wrapper.collect();
+ String lastValue = wrapper.text;
+ if(lastValue != null && lastValue.trim().length() > 0) {
+ history.add(lastValue);
+ }
+ }
+
+ ControlWrapper wrapper = e.getValue().iterator().next();
+ String[] items = wrapper.items;
+ if(items != null) {
+ for(int j = 0; j < items.length && history.size() < MAX_HISTORY; j++ ) {
+ // do not store the privileged items if they are not selected.
+ // we eventually inject the same or different set next time
+ if(!privileged.contains(items[j])) {
+ history.add(items[j]);
+ }
+ }
+ }
+
+ dialogSettings.put(id, history.toArray(new String[history.size()]));
+ }
+ }
+
+ /** Adds an input control to the list of fields to save. */
+ public void add(Control combo) {
+ add(null, combo);
+ }
+
+ /** Adds an input control to the list of fields to save. */
+ public void add(String id, final Control combo) {
+ if(combo != null) {
+ if(id == null) {
+ id = String.valueOf(combo.getData("name"));
+ }
+ List<ControlWrapper> combos = comboMap.get(id);
+ if(combos == null) {
+ combos = new ArrayList<ControlWrapper>();
+ comboMap.put(id, combos);
+ }
+ if(combo instanceof Combo) {
+ combos.add(new ComboWrapper((Combo) combo));
+ } else if(combo instanceof CCombo) {
+ combos.add(new CComboWrapper((CCombo) combo));
+ }
+ }
+ }
+
+ abstract private class ControlWrapper {
+ protected Control control;
+
+ protected String text;
+
+ protected String[] items;
+
+ private boolean collected;
+
+ protected ControlWrapper(Control control) {
+ this.control = control;
+ control.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ collect();
+ }
+ });
+ }
+
+ protected void collect() {
+ if(!collected && !isDisposed()) {
+ text = getText();
+ items = getItems();
+ }
+ collected = true;
+ }
+
+ protected boolean isDisposed() {
+ return control.isDisposed();
+ }
+
+ abstract protected String getText();
+
+ abstract protected String[] getItems();
+
+ abstract protected void setItems(String[] items);
+ }
+
+ private class ComboWrapper extends ControlWrapper {
+ private Combo combo;
+
+ protected ComboWrapper(Combo combo) {
+ super(combo);
+ this.combo = combo;
+ }
+
+ protected String getText() {
+ return combo.getText();
+ }
+
+ protected String[] getItems() {
+ return combo.getItems();
+ }
+
+ protected void setItems(String[] items) {
+ String value = combo.getText();
+ combo.setItems(items);
+ if(value.length() > 0) {
+ // setItems() clears the text input, so we need to restore it
+ combo.setText(value);
+ } else if(items.length > 0) {
+ combo.setText(items[0]);
+ }
+ }
+ }
+
+ private class CComboWrapper extends ControlWrapper {
+ private CCombo combo;
+
+ protected CComboWrapper(CCombo combo) {
+ super(combo);
+ this.combo = combo;
+ }
+
+ protected String getText() {
+ return combo.getText();
+ }
+
+ protected String[] getItems() {
+ try {
+ return combo.getItems();
+ } catch(SWTException swtException) {
+ //CCombo throws this if the list is disposed, but the combo itself is not disposed yet
+ return new String[0];
+ }
+ }
+
+ protected void setItems(String[] items) {
+ String value = combo.getText();
+ combo.setItems(items);
+ if(value.length() > 0) {
+ // setItems() clears the text input, so we need to restore it
+ combo.setText(value);
+ }
+ }
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenGoalSelectionDialog.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenGoalSelectionDialog.java
new file mode 100644
index 00000000..593d8feb
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenGoalSelectionDialog.java
@@ -0,0 +1,359 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.dialogs;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+
+
+public class MavenGoalSelectionDialog extends ElementTreeSelectionDialog {
+
+ Button isQualifiedNameButton;
+
+ boolean isQualifiedName = true;
+
+ public MavenGoalSelectionDialog(Shell parent) {
+ super(parent, new GoalsLabelProvider(), new GoalsContentProvider());
+
+ setTitle(Messages.getString("launch.goalsDialog.title")); //$NON-NLS-1$
+ setMessage(org.eclipse.m2e.core.internal.Messages.MavenGoalSelectionDialog_message);
+ setValidator(new GoalsSelectionValidator());
+ setInput(new Object());
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+ layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+ layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
+ layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ Label selectGoalLabel = new Label(composite, SWT.NONE);
+ selectGoalLabel.setText(org.eclipse.m2e.core.internal.Messages.MavenGoalSelectionDialog_lblSelect);
+
+ final GoalsFilter filter = new GoalsFilter();
+
+ final Text filterText = new Text(composite, SWT.BORDER);
+ GridData gd_filterText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_filterText.widthHint = 200;
+ filterText.setLayoutData(gd_filterText);
+ filterText.setFocus();
+
+ final TreeViewer treeViewer = createTreeViewer(composite);
+ treeViewer.addFilter(filter);
+
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.widthHint = 500;
+ data.heightHint = 400;
+ // data.widthHint = convertWidthInCharsToPixels(fWidth);
+ // data.heightHint = convertHeightInCharsToPixels(fHeight);
+
+ final Tree tree = treeViewer.getTree();
+ tree.setLayoutData(data);
+ tree.setFont(parent.getFont());
+
+ filterText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ String text = filterText.getText();
+ filter.setFilter(text);
+ treeViewer.refresh();
+ if(text.trim().length() == 0) {
+ treeViewer.collapseAll();
+ } else {
+ treeViewer.expandAll();
+ }
+ }
+ });
+
+ filterText.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent e) {
+ if(e.keyCode == SWT.ARROW_DOWN) {
+ tree.setFocus();
+ tree.setSelection(tree.getTopItem().getItem(0));
+
+ Object[] elements = ((ITreeContentProvider) treeViewer.getContentProvider()).getElements(null);
+ treeViewer.setSelection(new StructuredSelection(elements[0]));
+ }
+
+ }
+ });
+
+ isQualifiedNameButton = new Button(composite, SWT.CHECK);
+ isQualifiedNameButton.setText(org.eclipse.m2e.core.internal.Messages.MavenGoalSelectionDialog_btnQualified);
+ isQualifiedNameButton.setSelection(true);
+ isQualifiedNameButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ isQualifiedName = isQualifiedNameButton.getSelection();
+ }
+ });
+
+// if (fIsEmpty) {
+// messageLabel.setEnabled(false);
+// treeWidget.setEnabled(false);
+// }
+
+ return composite;
+ }
+
+ public boolean isQualifiedName() {
+ return isQualifiedName;
+ }
+
+ /**
+ * GoalsContentProvider
+ */
+ static class GoalsContentProvider implements ITreeContentProvider {
+ private static Object[] EMPTY = new Object[0];
+
+ private final List<Group> groups = new ArrayList<Group>();
+
+ public GoalsContentProvider() {
+// MavenEmbedderManager embedderManager = MavenPlugin.getDefault().getMavenEmbedderManager();
+// try {
+// MavenEmbedder embedder = embedderManager.getWorkspaceEmbedder();
+// groups.add(new Group(Messages.getString("launch.goalsDialog.lifecycleBuild"), //$NON-NLS-1$
+// null, null, getLifecyclePhases(embedder.getBuildLifecyclePhases())));
+// groups.add(new Group(Messages.getString("launch.goalsDialog.lifecycleSite"), //$NON-NLS-1$
+// null, null, getLifecyclePhases(embedder.getSiteLifecyclePhases())));
+// groups.add(new Group(Messages.getString("launch.goalsDialog.lifecycleClean"), //$NON-NLS-1$
+// null, null, getLifecyclePhases(embedder.getCleanLifecyclePhases())));
+// } catch(Exception e) {
+// MavenLogger.log("Unable to get lifecycle phases", e);
+// }
+
+ IndexManager indexManager = MavenPlugin.getDefault().getIndexManager();
+ try {
+ // TODO: this will search ALL indexes, isn't the right to search _this_ project reposes only?
+ // I did not find (at first glance, maybe was hasty) a way to get IProject
+ Map<String, IndexedArtifact> result = indexManager.getAllIndexes().search(null, IIndex.SEARCH_PLUGIN); //$NON-NLS-1$
+ TreeMap<String, Group> map = new TreeMap<String, Group>();
+ for(IndexedArtifact a : result.values()) {
+ IndexedArtifactFile f = a.getFiles().iterator().next();
+ if(f.prefix != null && f.prefix.length() > 0 && f.goals != null) {
+ List<Entry> goals = new ArrayList<Entry>();
+ for(String goal : f.goals) {
+ if(goal.length() > 0) {
+ goals.add(new Entry(goal, f.prefix, f));
+ }
+ }
+ if(goals.size() > 0) {
+ map.put(f.prefix + ":" + f.group, new Group(f.prefix, f.group, f.artifact, goals)); //$NON-NLS-1$
+ }
+ }
+ }
+ groups.addAll(map.values());
+ } catch(CoreException e) {
+ MavenLogger.log(e);
+ }
+ }
+
+ private List<Entry> getLifecyclePhases(List<?> phases) {
+ List<Entry> entries = new ArrayList<Entry>();
+ for(int i = 0; i < phases.size(); i++ ) {
+ entries.add(new Entry((String) phases.get(i), null, null));
+ }
+ return entries;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return groups.toArray();
+ }
+
+ public Object[] getChildren(Object parent) {
+ if(parent instanceof Group) {
+ return ((Group) parent).entries.toArray();
+ }
+ return EMPTY;
+ }
+
+ public boolean hasChildren(Object element) {
+ return element instanceof Group;
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public void dispose() {
+ }
+
+ }
+
+ /**
+ * GoalsLabelProvider
+ */
+ static class GoalsLabelProvider extends LabelProvider {
+ public String getText(Object element) {
+ if(element instanceof Group) {
+ Group g = (Group) element;
+ if(g.groupId == null) {
+ return g.name;
+ }
+ return g.name + " - " + g.groupId + ":" + g.artifactId; //$NON-NLS-1$ //$NON-NLS-2$
+
+ } else if(element instanceof Entry) {
+ return ((Entry) element).name;
+
+ }
+ return super.getText(element);
+ }
+ }
+
+ /**
+ * GoalsFilter
+ */
+ static class GoalsFilter extends ViewerFilter {
+ private String filter;
+
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if(filter == null || filter.trim().length() == 0) {
+ return true;
+ }
+ if(element instanceof Group) {
+ Group g = (Group) element;
+ if(g.name.indexOf(filter) > -1) {
+ return true;
+ }
+ for(Iterator<Entry> it = g.entries.iterator(); it.hasNext();) {
+ Entry e = it.next();
+ if(e.name.indexOf(filter) > -1) {
+ return true;
+ }
+ }
+
+ } else if(element instanceof Entry) {
+ Entry e = (Entry) element;
+ return e.name.indexOf(filter) > -1 || (e.prefix != null && e.prefix.indexOf(filter) > -1);
+
+ }
+ return false;
+ }
+
+ public void setFilter(String filter) {
+ this.filter = filter;
+ }
+ }
+
+ /**
+ * GoalsSelectionValidator
+ */
+ static class GoalsSelectionValidator implements ISelectionStatusValidator {
+ public IStatus validate(Object[] selection) {
+ if(selection.length == 0) {
+ return new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ org.eclipse.m2e.core.internal.Messages.MavenGoalSelectionDialog_error, null);
+ }
+ for(int j = 0; j < selection.length; j++ ) {
+ if(selection[j] instanceof Entry) {
+ continue;
+ }
+ return new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, "", null); //$NON-NLS-1$
+ }
+ return Status.OK_STATUS;
+ }
+ }
+
+ /**
+ * Group
+ */
+ static class Group {
+ public final String name;
+
+ public final String groupId;
+
+ public final String artifactId;
+
+ public final List<Entry> entries;
+
+ public Group(String name, String groupId, String artifactId, List<Entry> entries) {
+ this.name = name;
+ this.groupId = groupId;
+ this.artifactId = artifactId;
+ this.entries = entries;
+ }
+ }
+
+ /**
+ * Entry
+ */
+ public static class Entry {
+ public final String prefix;
+
+ public final String name;
+
+ private final IndexedArtifactFile f;
+
+ public Entry(String name, String prefix, IndexedArtifactFile f) {
+ this.prefix = prefix;
+ this.name = name;
+ this.f = f;
+ }
+
+ public String getName() {
+ return prefix == null ? name : prefix + ":" + name; //$NON-NLS-1$
+ }
+
+ public String getQualifiedName() {
+ // return prefix == null ? name : prefix + ":" + name;
+ return prefix == null ? name : f.group + ":" + f.artifact + ":" + f.version + ":" + name; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenMessageDialog.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenMessageDialog.java
new file mode 100644
index 00000000..ea439f57
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenMessageDialog.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.dialogs;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * MavenMessageDialog
+ *
+ * @author dyocum
+ */
+public class MavenMessageDialog extends MessageDialog {
+
+ private StyledText messageArea;
+ /**
+ * @param parentShell
+ * @param dialogTitle
+ * @param dialogTitleImage
+ * @param dialogMessage
+ * @param dialogImageType
+ * @param dialogButtonLabels
+ * @param defaultIndex
+ */
+ public MavenMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage,
+ int dialogImageType, String[] dialogButtonLabels, int defaultIndex) {
+ super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createCustomArea(Composite parent) {
+ // TODO Auto-generated method createCustomArea
+ this.messageArea = new StyledText(parent, SWT.WRAP|SWT.READ_ONLY|SWT.H_SCROLL|SWT.V_SCROLL|SWT.BORDER);
+ this.messageArea.setLayout(new GridLayout());
+ GridData gd = new GridData(SWT.LEFT, SWT.TOP, true, true);
+ //size hints
+ gd.widthHint = 600;
+ gd.heightHint = 300;
+ messageArea.setLayoutData(gd);
+ return messageArea;
+ }
+
+ /**
+ *
+ * @param parent Parent shell
+ * @param title Title of the dialog
+ * @param label The label shown above the msg.
+ * @param message The actual message to show in the text area.
+ */
+ public static void openInfo(Shell parent, String title, String label, String message) {
+ MavenMessageDialog dialog = new MavenMessageDialog(parent, title, Dialog.getImage(Dialog.DLG_IMG_INFO), // accept
+ label, INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0); // ok
+ dialog.create();
+ dialog.getMessageArea().setText(message);
+ dialog.getDialogArea().pack(true);
+ dialog.open();
+ return;
+ }
+
+
+ /**
+ * @return Returns the messageArea.
+ */
+ private StyledText getMessageArea() {
+ return messageArea;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenPropertyDialog.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenPropertyDialog.java
new file mode 100644
index 00000000..764714e6
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenPropertyDialog.java
@@ -0,0 +1,192 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.dialogs;
+
+// import org.eclipse.debug.ui.StringVariableSelectionDialog;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+import org.eclipse.m2e.core.core.Messages;
+
+
+public class MavenPropertyDialog extends Dialog {
+
+ private final String title;
+
+ private final String initialName;
+
+ private final String initialValue;
+
+ private final VerifyListener verifyListener;
+
+ protected Text nameText;
+
+ protected Text valueText;
+
+ private String name;
+
+ private String value;
+
+ public MavenPropertyDialog(Shell shell, String title, String initialName, String initialValue, VerifyListener verifyListener) {
+ super(shell);
+ this.title = title;
+ this.initialName = initialName;
+ this.initialValue = initialValue;
+ this.verifyListener = verifyListener;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createDialogArea(Composite parent) {
+ Composite comp = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2, false);
+ gridLayout.marginTop = 7;
+ gridLayout.marginWidth = 12;
+ comp.setLayout(gridLayout);
+
+ Label nameLabel = new Label(comp, SWT.NONE);
+ nameLabel.setText(Messages.getString("launch.propertyDialog.name")); //$NON-NLS-1$;
+ nameLabel.setFont(comp.getFont());
+
+ nameText = new Text(comp, SWT.BORDER | SWT.SINGLE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.widthHint = 300;
+ nameText.setLayoutData(gd);
+ nameText.setFont(comp.getFont());
+ nameText.setText(initialName==null ? "" : initialName); //$NON-NLS-1$
+ nameText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ updateButtons();
+ }
+ });
+
+ Label valueLabel = new Label(comp, SWT.NONE);
+ valueLabel.setText(Messages.getString("launch.propertyDialog.value")); //$NON-NLS-1$;
+ valueLabel.setFont(comp.getFont());
+
+ valueText = new Text(comp, SWT.BORDER | SWT.SINGLE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.widthHint = 300;
+ valueText.setLayoutData(gd);
+ valueText.setFont(comp.getFont());
+ valueText.setText(initialValue==null ? "" : initialValue); //$NON-NLS-1$
+ valueText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ updateButtons();
+ }
+ });
+
+// if(variables) {
+// Button variablesButton = new Button(comp, SWT.PUSH);
+// variablesButton.setText(Messages.getString("launch.propertyDialog.browseVariables")); //$NON-NLS-1$;
+// gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
+// gd.horizontalSpan = 2;
+// int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
+// gd.widthHint = Math.max(widthHint, variablesButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
+// variablesButton.setLayoutData(gd);
+// variablesButton.setFont(comp.getFont());
+//
+// variablesButton.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent se) {
+// StringVariableSelectionDialog variablesDialog = new StringVariableSelectionDialog(getShell());
+// if(variablesDialog.open() == IDialogConstants.OK_ID) {
+// String variable = variablesDialog.getVariableExpression();
+// if(variable != null) {
+// valueText.insert(variable.trim());
+// }
+// }
+// }
+// });
+// }
+
+ return comp;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public String getValue() {
+ return this.value;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
+ */
+ protected void buttonPressed(int buttonId) {
+ if(buttonId == IDialogConstants.OK_ID) {
+ name = nameText.getText();
+ value = valueText.getText();
+ } else {
+ name = null;
+ value = null;
+ }
+ super.buttonPressed(buttonId);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ if(title != null) {
+ shell.setText(title);
+ }
+// if (fInitialValues[0].length() == 0) {
+// PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IAntUIHelpContextIds.ADD_PROPERTY_DIALOG);
+// } else {
+// PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IAntUIHelpContextIds.EDIT_PROPERTY_DIALOG);
+// }
+ }
+
+ /**
+ * Enable the OK button if valid input
+ */
+ protected void updateButtons() {
+ String name = nameText.getText().trim();
+ String value = valueText.getText().trim();
+ // verify name
+ Event e = new Event();
+ e.widget = nameText;
+ VerifyEvent ev = new VerifyEvent(e);
+ ev.doit = true;
+ if (verifyListener != null) {
+ ev.text = name;
+ verifyListener.verifyText(ev);
+ }
+ getButton(IDialogConstants.OK_ID).setEnabled((name.length() > 0) && (value.length() > 0) && ev.doit);
+ }
+
+ /**
+ * Enable the buttons on creation.
+ *
+ * @see org.eclipse.jface.window.Window#create()
+ */
+ public void create() {
+ super.create();
+ updateButtons();
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenRepositorySearchDialog.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenRepositorySearchDialog.java
new file mode 100644
index 00000000..206caf68
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/dialogs/MavenRepositorySearchDialog.java
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.dialogs;
+
+import java.util.Collections;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.wizards.MavenPomSelectionComponent;
+
+
+/**
+ * Maven POM Search dialog
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenRepositorySearchDialog extends AbstractMavenDialog {
+ private static final String DIALOG_SETTINGS = MavenRepositorySearchDialog.class.getName();
+
+ private final boolean showScope;
+
+ private final Set<ArtifactKey> artifacts;
+
+ private final Set<ArtifactKey> managed;
+
+ /**
+ * One of
+ * {@link IIndex#SEARCH_ARTIFACT},
+ * {@link IIndex#SEARCH_CLASS_NAME},
+ */
+ private final String queryType;
+
+ private String queryText;
+
+ MavenPomSelectionComponent pomSelectionComponent;
+
+ private IndexedArtifact selectedIndexedArtifact;
+
+ private IndexedArtifactFile selectedIndexedArtifactFile;
+
+ private String selectedScope;
+
+ private Combo scopeCombo;
+
+
+ /**
+ * Create repository search dialog
+ *
+ * @param parent parent shell
+ * @param title dialog title
+ * @param queryType one of
+ * {@link IIndex#SEARCH_ARTIFACT},
+ * {@link IIndex#SEARCH_CLASS_NAME},
+ * @param artifacts Set&lt;Artifact&gt;
+ * @deprecated
+ */
+ public MavenRepositorySearchDialog(Shell parent, String title, String queryType, Set<ArtifactKey> artifacts) {
+ this(parent, title, queryType, artifacts, Collections.<ArtifactKey>emptySet(), false);
+ }
+
+ public MavenRepositorySearchDialog(Shell parent, String title, String queryType, Set<ArtifactKey> artifacts, Set<ArtifactKey> managed) {
+ this(parent, title, queryType, artifacts, managed, false);
+ }
+ /**
+ * @deprecated
+ */
+ public MavenRepositorySearchDialog(Shell parent, String title, String queryType, Set<ArtifactKey> artifacts, boolean showScope) {
+ this(parent, title, queryType, artifacts, Collections.<ArtifactKey>emptySet(), showScope);
+ }
+
+ public MavenRepositorySearchDialog(Shell parent, String title, String queryType, Set<ArtifactKey> artifacts, Set<ArtifactKey> managed, boolean showScope) {
+ super(parent, DIALOG_SETTINGS);
+ this.artifacts = artifacts;
+ this.managed = managed;
+ this.queryType = queryType;
+ this.showScope = showScope;
+
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ setStatusLineAboveButtons(true);
+ setTitle(title);
+ }
+
+ public void setQuery(String query) {
+ this.queryText = query;
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ readSettings();
+
+ Composite composite = (Composite) super.createDialogArea(parent);
+
+ pomSelectionComponent = new MavenPomSelectionComponent(composite, SWT.NONE);
+ pomSelectionComponent.init(queryText, queryType, artifacts, managed);
+
+ pomSelectionComponent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ pomSelectionComponent.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ if (!pomSelectionComponent.getStatus().matches(IStatus.ERROR)) {
+ okPressedDelegate();
+ }
+ }
+ });
+ pomSelectionComponent.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateStatusDelegate(pomSelectionComponent.getStatus());
+ }
+ });
+
+ return composite;
+ }
+
+ protected void createButtonsForButtonBar(Composite parent) {
+ if(showScope) {
+ ((GridLayout) parent.getLayout()).numColumns += 2;
+
+ Label scopeLabel = new Label(parent, SWT.NONE);
+ scopeLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+ scopeLabel.setText(Messages.MavenRepositorySearchDialog_lblScope);
+
+ scopeCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
+ scopeCombo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
+ scopeCombo.setItems(new String[] {"compile", "test", "runtime", "provided", "system", "import"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+ scopeCombo.setText(Messages.MavenRepositorySearchDialog_7);
+ }
+
+ super.createButtonsForButtonBar(parent);
+ }
+
+ void okPressedDelegate() {
+ okPressed();
+ }
+
+ void updateStatusDelegate(IStatus status) {
+ updateStatus(status);
+ }
+
+ protected void computeResult() {
+ selectedIndexedArtifact = pomSelectionComponent.getIndexedArtifact();
+ selectedIndexedArtifactFile = pomSelectionComponent.getIndexedArtifactFile();
+ selectedScope = scopeCombo == null ? null : scopeCombo.getText();
+ setResult(Collections.singletonList(selectedIndexedArtifactFile));
+ }
+
+ public IndexedArtifact getSelectedIndexedArtifact() {
+ return this.selectedIndexedArtifact;
+ }
+
+ public IndexedArtifactFile getSelectedIndexedArtifactFile() {
+ return this.selectedIndexedArtifactFile;
+ }
+
+ public String getSelectedScope() {
+ return this.selectedScope;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenAdapterFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenAdapterFactory.java
new file mode 100644
index 00000000..b09ccb05
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenAdapterFactory.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.ui.IActionFilter;
+
+/**
+ * @author Eugene Kuleshov
+ */
+@SuppressWarnings("unchecked")
+public class MavenAdapterFactory implements IAdapterFactory {
+
+ private static final Class[] ADAPTER_TYPES = new Class[] { IActionFilter.class };
+
+ public Class[] getAdapterList() {
+ return ADAPTER_TYPES;
+ }
+
+ public Object getAdapter(final Object adaptable, Class adapterType) {
+ return new IActionFilter() {
+ public boolean testAttribute(Object target, String name, String value) {
+ return "label".equals(name) // //$NON-NLS-1$
+ && value.equals(getStub(adaptable, LabelProviderStub.class).getLabel());
+ }
+
+ private <T> T getStub(final Object o, Class<T> type) {
+ // can't use IWorkbenchAdapter here because it can cause recursion
+ return (T) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {type}, //
+ new InvocationHandler() {
+ public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
+ try {
+ Method method = o.getClass().getDeclaredMethod(m.getName(), m.getParameterTypes());
+ return method.invoke(o, args);
+ } catch(RuntimeException ex) {
+ return null;
+ } catch(Exception ex) {
+ return null;
+ }
+ }
+ });
+ }
+ };
+ }
+
+ /**
+ * A stub interface to access org.eclipse.jdt.internal.ui.packageview.ClassPathContainer#getLabel()
+ */
+ public interface LabelProviderStub {
+ public String getLabel();
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenConsoleFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenConsoleFactory.java
new file mode 100644
index 00000000..29b62508
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenConsoleFactory.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal;
+
+import org.eclipse.ui.console.IConsoleFactory;
+
+import org.eclipse.m2e.core.MavenPlugin;
+
+/**
+ * Maven Console factory is used to show the console from the "Open Console"
+ * drop-down action in Console view.
+ *
+ * @see org.eclipse.ui.console.consoleFactory extension point.
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenConsoleFactory implements IConsoleFactory {
+
+ public void openConsole() {
+ MavenPlugin.getDefault().getConsole().showConsole();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenConsolePageParticipant.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenConsolePageParticipant.java
new file mode 100644
index 00000000..a8154d4b
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenConsolePageParticipant.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleConstants;
+import org.eclipse.ui.console.IConsolePageParticipant;
+import org.eclipse.ui.part.IPageBookViewPage;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.actions.MavenConsoleRemoveAction;
+import org.eclipse.m2e.core.actions.MavenDebugOutputAction;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+
+
+
+public class MavenConsolePageParticipant implements IConsolePageParticipant {
+
+ private IAction consoleRemoveAction;
+ private IAction debugAction;
+ private IAction showOnErrorAction;
+ private IAction showOnOutputAction;
+
+ private static final String SHOW_ON_OUTPUT_LBL = Messages.MavenConsolePageParticipant_any;
+ private static final String SHOW_ON_ERR_LBL = Messages.MavenConsolePageParticipant_error;
+
+ public void init(IPageBookViewPage page, IConsole console) {
+ this.consoleRemoveAction = new MavenConsoleRemoveAction();
+ this.debugAction = new MavenDebugOutputAction();
+
+
+ showOnOutputAction = new ShowOnOutputAction(console, SHOW_ON_OUTPUT_LBL);
+ showOnErrorAction = new ShowOnErrorAction(console, SHOW_ON_ERR_LBL);
+
+ IActionBars actionBars = page.getSite().getActionBars();
+ configureToolBar(actionBars.getToolBarManager());
+ }
+
+ private void configureToolBar(IToolBarManager mgr){
+ mgr.appendToGroup(IConsoleConstants.LAUNCH_GROUP, consoleRemoveAction);
+ mgr.prependToGroup(IConsoleConstants.OUTPUT_GROUP, debugAction);
+ mgr.appendToGroup(IConsoleConstants.OUTPUT_GROUP, showOnOutputAction);
+ mgr.appendToGroup(IConsoleConstants.OUTPUT_GROUP, showOnErrorAction);
+ }
+ public void dispose() {
+ this.consoleRemoveAction = null;
+ this.debugAction = null;
+ }
+
+ public void activated() {
+ }
+
+ public void deactivated() {
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+
+
+ class ShowOnErrorAction extends MavenShowConsoleAction{
+ public ShowOnErrorAction(IConsole console, String name){
+ super(name);
+ setImageDescriptor(MavenImages.SHOW_CONSOLE_ERR);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.MavenShowConsoleAction#getKey()
+ */
+ protected String getKey() {
+ return MavenPreferenceConstants.P_SHOW_CONSOLE_ON_ERR;
+ }
+ }
+
+ class ShowOnOutputAction extends MavenShowConsoleAction{
+
+ /**
+ * @param console
+ */
+ public ShowOnOutputAction(IConsole console, String name) {
+ super(name);
+ setImageDescriptor(MavenImages.SHOW_CONSOLE_OUT);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.MavenShowConsoleAction#getKey()
+ */
+ protected String getKey() {
+ return MavenPreferenceConstants.P_SHOW_CONSOLE_ON_OUTPUT;
+ }
+
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenShowConsoleAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenShowConsoleAction.java
new file mode 100644
index 00000000..42275036
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenShowConsoleAction.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+
+import org.eclipse.m2e.core.MavenPlugin;
+
+/**
+ * MavenShowConsoleAction
+ *
+ * @author dyocum
+ */
+public abstract class MavenShowConsoleAction extends Action implements IPropertyChangeListener{
+
+ public MavenShowConsoleAction(String name){
+ super(name, IAction.AS_CHECK_BOX);
+ setToolTipText(name);
+ getPreferenceStore().addPropertyChangeListener(this);
+ update();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ String property = event.getProperty();
+ if (property.equals(getKey())) {
+ update();
+ }
+ }
+
+ protected abstract String getKey();
+
+ private void update() {
+ IPreferenceStore store = getPreferenceStore();
+ if (store.getBoolean(getKey())) {
+ // on
+ setChecked(true);
+ } else {
+ // off
+ setChecked(false);
+ }
+ }
+
+ /**
+ * @return
+ */
+ private IPreferenceStore getPreferenceStore() {
+ return MavenPlugin.getDefault().getPreferenceStore();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ public void run() {
+ IPreferenceStore store = getPreferenceStore();
+ boolean show = isChecked();
+ store.removePropertyChangeListener(this);
+ store.setValue(getKey(), show);
+ store.addPropertyChangeListener(this);
+ }
+
+ /**
+ * Must be called to dispose this action.
+ */
+ public void dispose() {
+ getPreferenceStore().removePropertyChangeListener(this);
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java
new file mode 100644
index 00000000..c70fa53e
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/MavenVersionDecorator.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.swt.graphics.Image;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class MavenVersionDecorator implements ILabelDecorator {
+
+ private Map<ILabelProviderListener, IMavenProjectChangedListener> listeners = new HashMap<ILabelProviderListener, IMavenProjectChangedListener>();
+
+ public Image decorateImage(Image image, Object element) {
+ return null;
+ }
+
+ public String decorateText(String text, Object element) {
+ if(element instanceof IResource) {
+ IResource resource = (IResource) element;
+ IProject project = resource.getProject();
+ if(project!=null) {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectFacade facade = projectManager.create(project, new NullProgressMonitor());
+ if(facade!=null) {
+ ArtifactKey mavenProject = facade.getArtifactKey();
+ if(mavenProject!=null) {
+ String name = resource.getName();
+ int start = text.indexOf(name);
+ if(start>-1) {
+ int n = text.indexOf(' ', start + name.length());
+ if(n>-1) {
+ return text.substring(0, n) + " " + mavenProject.getVersion() + text.substring(n); //$NON-NLS-1$
+ }
+ }
+ return text + " " + mavenProject.getVersion(); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void addListener(final ILabelProviderListener listener) {
+ IMavenProjectChangedListener projectChangeListener = new IMavenProjectChangedListener() {
+ public void mavenProjectChanged(MavenProjectChangedEvent[] events, IProgressMonitor monitor) {
+ ArrayList<IResource> pomList = new ArrayList<IResource>();
+ for(int i = 0; i < events.length; i++ ) {
+ // pomList.add(events[i].getSource());
+ if(events[i]!=null && events[i].getMavenProject()!=null) {
+ IFile pom = events[i].getMavenProject().getPom();
+ pomList.add(pom);
+ if(pom.getParent().getType()==IResource.PROJECT) {
+ pomList.add(pom.getParent());
+ }
+ }
+ }
+ listener.labelProviderChanged(new LabelProviderChangedEvent(MavenVersionDecorator.this, pomList.toArray()));
+ }
+ };
+
+ listeners.put(listener, projectChangeListener);
+
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ projectManager.addMavenProjectChangedListener(projectChangeListener);
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ IMavenProjectChangedListener projectChangeListener = listeners.get(listener);
+ if(projectChangeListener!=null) {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ projectManager.removeMavenProjectChangedListener(projectChangeListener);
+ }
+ }
+
+ public void dispose() {
+ // TODO remove all listeners
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/components/TextComboBoxCellEditor.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/components/TextComboBoxCellEditor.java
new file mode 100644
index 00000000..45c0e957
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/components/TextComboBoxCellEditor.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.components;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+
+/**
+ * A TextComboBoxCellEditor to overcome the limitation of the standard ComboBoxCellEditor, which does not allow to edit
+ * plain text values.
+ *
+ * @author Dmitry Platonoff
+ */
+public class TextComboBoxCellEditor extends CellEditor {
+
+ protected String[] items;
+
+
+ protected CCombo combo;
+
+ public TextComboBoxCellEditor(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ protected Control createControl(Composite parent) {
+ combo = new CCombo(parent, getStyle());
+ combo.setFont(parent.getFont());
+
+ combo.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent e) {
+ keyReleaseOccured(e);
+ }
+ });
+ combo.addTraverseListener(new TraverseListener() {
+ public void keyTraversed(TraverseEvent e) {
+ if (e.detail == SWT.TRAVERSE_ESCAPE
+ || e.detail == SWT.TRAVERSE_RETURN) {
+ e.doit = false;
+ }
+ }
+ });
+
+ loadItems();
+
+ return combo;
+ }
+
+ protected Object doGetValue() {
+ Assert.isNotNull(combo);
+ return combo.getText();
+ }
+
+ protected void doSetFocus() {
+ Assert.isNotNull(combo);
+ combo.setFocus();
+ }
+
+ protected void doSetValue(Object value) {
+ Assert.isNotNull(combo);
+ combo.setText(String.valueOf(value));
+ }
+
+ public String[] getItems() {
+ return items;
+ }
+
+ public void setItems(String[] items) {
+ this.items = items;
+ loadItems();
+ }
+
+ protected void loadItems() {
+ if(combo != null && items != null) {
+ combo.setItems(items);
+ }
+ }
+
+ protected void keyReleaseOccured(KeyEvent keyEvent) {
+ if(keyEvent.character == SWT.ESC) {
+ fireCancelEditor();
+ } else if(keyEvent.character == SWT.TAB || keyEvent.character == SWT.CR) {
+ focusLost();
+ }
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/AbstractLifecyclePropertyPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/AbstractLifecyclePropertyPage.java
new file mode 100644
index 00000000..3ce330f1
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/AbstractLifecyclePropertyPage.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.lifecycle;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * AbstractLifecyclePropertyPage
+ * Holds the pieces used in the common lifecycle mapping properties pages.
+ *
+ * @author dyocum
+ */
+public abstract class AbstractLifecyclePropertyPage extends AbstractPropertyPageExtensionPoint implements ILifecyclePropertyPage{
+ private IProject project;
+ private Shell shell;
+
+ public AbstractLifecyclePropertyPage(){
+ }
+
+ public void setupPage(IProject project, Shell shell){
+ this.project = project;
+ this.setShell(shell);
+ }
+
+ public void setProject(IProject project){
+ this.project = project;
+ }
+
+ public IProject getProject(){
+ return project;
+ }
+
+ /**
+ * @param shell The shell to set.
+ */
+ public void setShell(Shell shell) {
+ this.shell = shell;
+ }
+
+ /**
+ * @return Returns the shell.
+ */
+ public Shell getShell() {
+ return shell;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/AbstractPropertyPageExtensionPoint.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/AbstractPropertyPageExtensionPoint.java
new file mode 100644
index 00000000..ace3c250
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/AbstractPropertyPageExtensionPoint.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.lifecycle;
+
+/**
+ * AbstractPropertyPageExtensionPoint
+ *
+ * @author dyocum
+ */
+public class AbstractPropertyPageExtensionPoint implements ILifecyclePropertyPageExtensionPoint {
+
+ private String name;
+ private String id;
+ private String lifecycleMappingId;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.lifecycle.ILifecyclePropertyPageExtensionPoint#getLifecycleMappingId()
+ */
+ public String getLifecycleMappingId() {
+ return lifecycleMappingId;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.lifecycle.ILifecyclePropertyPageExtensionPoint#getName()
+ */
+ public String getName() {
+ return name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.lifecycle.ILifecyclePropertyPageExtensionPoint#getPageId()
+ */
+ public String getPageId() {
+ return id;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.lifecycle.ILifecyclePropertyPageExtensionPoint#setLifecycleMappingId(java.lang.String)
+ */
+ public void setLifecycleMappingId(String lifecycleMappingId) {
+ this.lifecycleMappingId = lifecycleMappingId;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.lifecycle.ILifecyclePropertyPageExtensionPoint#setName()
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.lifecycle.ILifecyclePropertyPageExtensionPoint#setPageId()
+ */
+ public void setPageId(String id) {
+ this.id = id;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ILifecyclePropertyPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ILifecyclePropertyPage.java
new file mode 100644
index 00000000..bbc88239
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ILifecyclePropertyPage.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.lifecycle;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * ILifecyclePropertyPage
+ *
+ * @author dyocum
+ */
+public interface ILifecyclePropertyPage extends ILifecyclePropertyPageExtensionPoint{
+ /**
+ * Create and return the composite which will be shown in the parent properties page.
+ * @param parent
+ * @return
+ */
+ public Control createContents(Composite parent);
+
+ /**
+ * Called when the 'Restore Defaults' button is pressed in the properties page.
+ */
+ public void performDefaults();
+
+ /**
+ * Called when the 'OK' or 'Apply' buttons are pressed in the properties dialog.
+ * @return
+ */
+ public boolean performOk();
+
+ /**
+ * The project that these lifecycle mapping properties apply to
+ * @param project
+ */
+ public void setProject(IProject project);
+
+ public IProject getProject();
+
+ /**
+ * The parent shell used for showing error messages.
+ * @param shell
+ */
+ public void setShell(Shell shell);
+
+ public Shell getShell();
+
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ILifecyclePropertyPageExtensionPoint.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ILifecyclePropertyPageExtensionPoint.java
new file mode 100644
index 00000000..a81284da
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ILifecyclePropertyPageExtensionPoint.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.lifecycle;
+
+/**
+ * ILifecyclePropertyPageExtensionPoint
+ *
+ * @author dyocum
+ */
+public interface ILifecyclePropertyPageExtensionPoint {
+ /**
+ * The name of the page. This will be displayed in the title of the properties page.
+ * @return
+ */
+ public String getName();
+
+ /**
+ * Name of the page, called when the extension point is read in
+ */
+ public void setName(String name);
+
+ /**
+ * Get the id of the property page as defined in the extension point
+ * @return
+ */
+ public String getPageId();
+
+ /**
+ * Set the id of the property page, called when extension point is read
+ */
+ public void setPageId(String id);
+
+ /**
+ * Sets the id of the lifecycle mapping strategy that this property page is
+ * associated with
+ * @param lifecycleMappingId
+ */
+ public void setLifecycleMappingId(String lifecycleMappingId);
+
+ /**
+ * Gets the id of the lifecycle mapping strategy
+ * @return
+ */
+ public String getLifecycleMappingId();
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/LifecycleMappingPropertyPageFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/LifecycleMappingPropertyPageFactory.java
new file mode 100644
index 00000000..2be8b931
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/LifecycleMappingPropertyPageFactory.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.lifecycle;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swt.widgets.Shell;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.IProjectConfigurationManager;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+
+
+/**
+ * LifecycleMappingPropertyPageFactory
+ *
+ * @author dyocum
+ */
+public class LifecycleMappingPropertyPageFactory {
+
+ public static final String EXTENSION_LIFECYCLE_MAPPING_PROPERTY_PAGE = IMavenConstants.PLUGIN_ID + ".lifecycleMappingPropertyPage"; //$NON-NLS-1$
+
+ private static final String ATTR_LIFECYCLE_MAPPING_ID = "lifecycleMappingId"; //$NON-NLS-1$
+
+ private static final String ATTR_LIFECYCLE_PROP_NAME = "name"; //$NON-NLS-1$
+
+ private static final String ATTR_LIFECYCLE_PROP_ID = "id"; //$NON-NLS-1$
+
+ private static final String ELEMENT_LIFECYCLE_MAPPING_PROPERTY_PAGE = "lifecycleMappingPropertyPage"; //$NON-NLS-1$
+
+ private static LifecycleMappingPropertyPageFactory factory;
+
+ private Map<String, ILifecyclePropertyPage> pageMap;
+
+ public static LifecycleMappingPropertyPageFactory getFactory() {
+ if(factory == null) {
+ factory = new LifecycleMappingPropertyPageFactory();
+ factory.buildFactory();
+ }
+ return factory;
+ }
+
+ /**
+ * Get a particular lifecycle property page, set in the project to use for the lifecycle mapping, set the Shell for
+ * displaying dialogs.
+ *
+ * @param id
+ * @param project
+ * @param shell
+ * @return
+ */
+ public ILifecyclePropertyPage getPageForId(String id, IProject project, Shell shell) {
+ if(id == null){
+ //for the no-op (empty) lifecycle mapping, use that page
+ id = "NULL"; //$NON-NLS-1$
+ }
+ ILifecyclePropertyPage page = getFactory().pageMap.get(id);
+ if(page == null){
+ return null;
+ }
+ page.setProject(project);
+ page.setShell(shell);
+ return page;
+ }
+
+ public ILifecyclePropertyPage getPage(String id){
+ return getFactory().pageMap.get(id);
+ }
+
+ public void buildFactory() {
+ pageMap = new HashMap<String, ILifecyclePropertyPage>();
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint configuratorsExtensionPoint = registry.getExtensionPoint(EXTENSION_LIFECYCLE_MAPPING_PROPERTY_PAGE);
+ if(configuratorsExtensionPoint != null) {
+ IExtension[] configuratorExtensions = configuratorsExtensionPoint.getExtensions();
+ for(IExtension extension : configuratorExtensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for(IConfigurationElement element : elements) {
+ if(element.getName().equals(ELEMENT_LIFECYCLE_MAPPING_PROPERTY_PAGE)) {
+ try {
+ Object o = element.createExecutableExtension("class"); //$NON-NLS-1$
+ ILifecyclePropertyPage propPage = (ILifecyclePropertyPage) o;
+ String id = element.getAttribute(ATTR_LIFECYCLE_MAPPING_ID);
+
+ propPage.setLifecycleMappingId(id);
+ String name = element.getAttribute(ATTR_LIFECYCLE_PROP_NAME);
+ propPage.setName(name);
+
+ String pageId = element.getAttribute(ATTR_LIFECYCLE_PROP_ID);
+ if(pageId != null) {
+ propPage.setPageId(pageId);
+ }
+ pageMap.put(id, propPage);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public static IMavenProjectFacade getProjectFacade(IProject project) {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ return projectManager.create(project, new NullProgressMonitor());
+ }
+
+ public static ResolverConfiguration getResolverConfiguration(IProject project) {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ return projectManager.getResolverConfiguration(project);
+ }
+
+ public static ILifecycleMapping getLifecycleMapping(IProject project) throws CoreException {
+ IMavenProjectFacade facade = getProjectFacade(project);
+ ILifecycleMapping lifecycleMapping = null;
+ IProjectConfigurationManager configurationManager = MavenPlugin.getDefault().getProjectConfigurationManager();
+ lifecycleMapping = configurationManager.getLifecycleMapping(facade, new NullProgressMonitor());
+ return lifecycleMapping;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ProjectConfiguratorsTable.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ProjectConfiguratorsTable.java
new file mode 100644
index 00000000..806aeebb
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ProjectConfiguratorsTable.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.lifecycle;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+
+/**
+ * ProjectConfiguratorsTable
+ * Composite that holds a read only table of project configurators for a given lifecycle mapping strategy.
+ *
+ * @author dyocum
+ */
+public class ProjectConfiguratorsTable {
+
+ private TableViewer configuratorsTable;
+ private ProjectConfiguratorsTableContentProvider configuratorsContentProvider;
+ private ProjectConfiguratorsTableLabelProvider configuratorsLabelProvider;
+ public static final String[] CONFIG_TABLE_COLUMN_PROPERTIES = new String[]{ "name", "id"}; //$NON-NLS-1$ //$NON-NLS-2$
+ public static final String[] CONFIG_TABLE_COLUMN_NAMES = new String[]{ Messages.ProjectConfiguratorsTable_column_name, Messages.ProjectConfiguratorsTable_column_id};
+ private static final int TABLE_WIDTH = 500;
+
+ public ProjectConfiguratorsTable(Composite parent, IProject project){
+ createTable(parent);
+ updateTable(project);
+ }
+
+ protected void updateTable(IProject project){
+ if(project != null){
+ try{
+ ILifecycleMapping mapping = LifecycleMappingPropertyPageFactory.getLifecycleMapping(project);
+ List<AbstractProjectConfigurator> projectConfigurators = mapping.getProjectConfigurators(LifecycleMappingPropertyPageFactory.getProjectFacade(project), new NullProgressMonitor());
+ setProjectConfigurators(projectConfigurators.toArray(new AbstractProjectConfigurator[]{}));
+ } catch(CoreException e){
+ setProjectConfigurators(new AbstractProjectConfigurator[]{});
+ }
+ }
+ }
+ private void createTable(Composite parent){
+ configuratorsTable = new TableViewer(parent, SWT.BORDER|SWT.H_SCROLL|SWT.V_SCROLL);
+ TableViewerColumn nameColumn = new TableViewerColumn(configuratorsTable, SWT.LEFT);
+ nameColumn.getColumn().setText(CONFIG_TABLE_COLUMN_NAMES[0]);
+ nameColumn.getColumn().setWidth((int)(TABLE_WIDTH*.50));
+
+ TableViewerColumn idColumn = new TableViewerColumn(configuratorsTable, SWT.LEFT);
+ idColumn.getColumn().setText(CONFIG_TABLE_COLUMN_NAMES[1]);
+ idColumn.getColumn().setWidth((int)(TABLE_WIDTH*.50));
+
+ configuratorsTable.getTable().setHeaderVisible(true);
+ configuratorsTable.getTable().setLinesVisible(true);
+ configuratorsContentProvider = new ProjectConfiguratorsTableContentProvider();
+ configuratorsLabelProvider = new ProjectConfiguratorsTableLabelProvider();
+ configuratorsTable.setContentProvider(configuratorsContentProvider);
+ configuratorsTable.setLabelProvider(configuratorsLabelProvider);
+ configuratorsTable.setColumnProperties(CONFIG_TABLE_COLUMN_PROPERTIES);
+ configuratorsTable.getTable().setData("name", "projectConfiguratorsTable"); //$NON-NLS-1$ //$NON-NLS-2$
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
+ gd.horizontalIndent=6;
+ gd.grabExcessHorizontalSpace = true;
+ gd.grabExcessVerticalSpace = true;
+ configuratorsTable.getControl().setLayoutData(gd);
+
+ final TableColumn nCol = nameColumn.getColumn();
+ final TableColumn iCol = idColumn.getColumn();
+ final Table tab = configuratorsTable.getTable();
+ configuratorsTable.getTable().addControlListener(new ControlAdapter() {
+ public void controlResized(ControlEvent e) {
+ nCol.setWidth((int)(tab.getClientArea().width*0.50));
+ iCol.setWidth((int)(tab.getClientArea().width*0.50));
+ }
+ });
+ }
+
+ public TableViewer getTableViewer(){
+ return configuratorsTable;
+ }
+
+ public void setProjectConfigurators(AbstractProjectConfigurator[] configurators){
+ configuratorsTable.setInput(configurators);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ProjectConfiguratorsTableContentProvider.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ProjectConfiguratorsTableContentProvider.java
new file mode 100644
index 00000000..72fb20ac
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ProjectConfiguratorsTableContentProvider.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.lifecycle;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+
+/**
+ * ConfiguratorsTableContentProvider
+ *
+ * @author dyocum
+ */
+public class ProjectConfiguratorsTableContentProvider implements IStructuredContentProvider {
+
+ public ProjectConfiguratorsTableContentProvider(){
+ }
+
+ protected String[] getNoConfigMsg(){
+ return new String[]{Messages.ProjectConfiguratorsTableContentProvider_no_configs};
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ public Object[] getElements(Object inputElement) {
+
+ if(inputElement == null || !(inputElement instanceof AbstractProjectConfigurator[]) || ((AbstractProjectConfigurator[])inputElement).length == 0){
+ return getNoConfigMsg();
+ }
+ return (AbstractProjectConfigurator[])inputElement;
+
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+ // TODO Auto-generated method dispose
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // TODO Auto-generated method inputChanged
+
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ProjectConfiguratorsTableLabelProvider.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ProjectConfiguratorsTableLabelProvider.java
new file mode 100644
index 00000000..92fee588
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/lifecycle/ProjectConfiguratorsTableLabelProvider.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.lifecycle;
+
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+
+/**
+ * ConfiguratorsTableLabelProvider
+ *
+ * @author dyocum
+ */
+public class ProjectConfiguratorsTableLabelProvider implements ITableLabelProvider, IColorProvider{
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+ */
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+ */
+ public String getColumnText(Object element, int columnIndex) {
+ if(element == null){
+ return ""; //$NON-NLS-1$
+ } else if(element instanceof AbstractProjectConfigurator){
+ return columnIndex == 0 ? ((AbstractProjectConfigurator)element).getName() : ((AbstractProjectConfigurator)element).getId();
+ }
+ return columnIndex == 0 ? element.toString() : ""; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ */
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+ */
+ public void dispose() {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
+ */
+ public boolean isLabelProperty(Object element, String property) {
+ // TODO Auto-generated method isLabelProperty
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ */
+ public void removeListener(ILabelProviderListener listener) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
+ */
+ public Color getBackground(Object element) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
+ */
+ public Color getForeground(Object element) {
+ if(element instanceof AbstractProjectConfigurator){
+ return Display.getDefault().getSystemColor(SWT.COLOR_BLACK);
+ }
+ return Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
+
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/CustomizableLifecycleMappingPropertyPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/CustomizableLifecycleMappingPropertyPage.java
new file mode 100644
index 00000000..7f714460
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/CustomizableLifecycleMappingPropertyPage.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.lifecycle.AbstractLifecyclePropertyPage;
+import org.eclipse.m2e.core.ui.internal.lifecycle.ProjectConfiguratorsTable;
+
+/**
+ * CustomizableLifecycleMappingPropertyPage
+ *
+ * @author dyocum
+ */
+public class CustomizableLifecycleMappingPropertyPage extends AbstractLifecyclePropertyPage{
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ public Control createContents(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(2, false));
+ composite.setLayoutData(new GridData(GridData.FILL));
+ new ProjectConfiguratorsTable(composite, getProject());
+ return composite;
+ }
+
+ public void performDefaults(){
+ //do nothing
+ }
+
+ public boolean performOk() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.lifecycle.AbstractLifecyclePropertyPage#getMessage()
+ */
+ public String getMessage() {
+ // TODO Auto-generated method getMessage
+ return Messages.CustomizableLifecycleMappingPropertyPage_message;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/EmptyLifecycleMappingPropertyPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/EmptyLifecycleMappingPropertyPage.java
new file mode 100644
index 00000000..92c98101
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/EmptyLifecycleMappingPropertyPage.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import org.eclipse.m2e.core.internal.Messages;
+
+/**
+ * EmptyLifecycleMappingPropertyPage
+ *
+ * @author dyocum
+ */
+public class EmptyLifecycleMappingPropertyPage extends SimpleLifecycleMappingPropertyPage {
+
+ public EmptyLifecycleMappingPropertyPage() {
+ super(Messages.EmptyLifecycleMappingPropertyPage_title);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/GoalsFieldEditor.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/GoalsFieldEditor.java
new file mode 100644
index 00000000..480f0dad
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/GoalsFieldEditor.java
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Text;
+
+
+/**
+ * A field editor for a combo box that allows the drop-down selection of one of
+ * a list of items.
+ *
+ * Adapted from org.eclipse.jface.preference.ComboFieldEditor
+ */
+public class GoalsFieldEditor extends FieldEditor {
+
+ /**
+ * The <code>Combo</code> widget.
+ */
+ Text goalsText;
+
+ /**
+ * The value (not the name) of the currently selected item in the Combo widget.
+ */
+ String value;
+
+ private Button goialsSelectButton;
+
+ private final String buttonText;
+
+ /**
+ * Create the combo box field editor.
+ *
+ * @param name the name of the preference this field editor works on
+ * @param labelText the label text of the field editor
+ * @param buttonText
+ * @param entryValues the entry values
+ * @param parent the parent composite
+ */
+ public GoalsFieldEditor(String name, String labelText, String buttonText, Composite parent) {
+ init(name, labelText);
+ this.buttonText = buttonText;
+ createControl(parent);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int)
+ */
+ protected void adjustForNumColumns(int numColumns) {
+ if(numColumns > 1) {
+ Control control = getLabelControl();
+ ((GridData) control.getLayoutData()).horizontalSpan = numColumns;
+ ((GridData) goalsText.getLayoutData()).horizontalSpan = numColumns - 1;
+ } else {
+ Control control = getLabelControl();
+ ((GridData) control.getLayoutData()).horizontalSpan = 2;
+ ((GridData) goalsText.getLayoutData()).horizontalSpan = 1;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite, int)
+ */
+ protected void doFillIntoGrid(Composite parent, int numColumns) {
+ Control labelControl = getLabelControl(parent);
+ GridData gd = new GridData();
+ gd.horizontalSpan = numColumns;
+ gd.horizontalAlignment = GridData.FILL;
+ gd.grabExcessHorizontalSpace = true;
+ labelControl.setLayoutData(gd);
+
+ Text goalsText = getTextControl(parent);
+ gd = new GridData();
+ gd.horizontalSpan = numColumns - 1;
+ gd.horizontalAlignment = GridData.FILL;
+ gd.grabExcessHorizontalSpace = true;
+ goalsText.setLayoutData(gd);
+ goalsText.setFont(parent.getFont());
+
+ goialsSelectButton = new Button(parent, SWT.NONE);
+ goialsSelectButton.setText(buttonText);
+ goialsSelectButton.addSelectionListener(new MavenGoalSelectionAdapter(goalsText, parent.getShell()));
+ gd = new GridData();
+ gd.horizontalSpan = 1;
+ gd.horizontalAlignment = GridData.FILL;
+ gd.grabExcessHorizontalSpace = true;
+ goalsText.setLayoutData(gd);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#doLoad()
+ */
+ protected void doLoad() {
+ updateComboForValue(getPreferenceStore().getString(getPreferenceName()));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault()
+ */
+ protected void doLoadDefault() {
+ updateComboForValue(getPreferenceStore().getDefaultString(getPreferenceName()));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#doStore()
+ */
+ protected void doStore() {
+ if (value == null) {
+ getPreferenceStore().setToDefault(getPreferenceName());
+ } else {
+ getPreferenceStore().setValue(getPreferenceName(), value);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls()
+ */
+ public int getNumberOfControls() {
+ return 2;
+ }
+
+ /*
+ * Lazily create and return the Combo control.
+ */
+ private Text getTextControl(Composite parent) {
+ if (goalsText == null) {
+ goalsText = new Text(parent, SWT.BORDER);
+ goalsText.setFont(parent.getFont());
+// for (int i = 0; i < entryValues.length; i++) {
+// goalsCombo.add(entryValues[i], i);
+// }
+// goalsCombo.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent evt) {
+// String oldValue = value;
+// value = goalsCombo.getText();
+// setPresentsDefaultValue(false);
+// fireValueChanged(VALUE, oldValue, value);
+// }
+// });
+ goalsText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent modifyevent) {
+ String oldValue = value;
+ value = goalsText.getText();
+ setPresentsDefaultValue(false);
+ fireValueChanged(VALUE, oldValue, value);
+ }
+ });
+ }
+ return goalsText;
+ }
+
+ protected void setPresentsDefaultValue(boolean booleanValue) {
+ super.setPresentsDefaultValue(booleanValue);
+ }
+
+ protected void fireValueChanged(String property, Object oldValue, Object newValue) {
+ super.fireValueChanged(property, oldValue, newValue);
+ }
+
+// /*
+// * Given the name (label) of an entry, return the corresponding value.
+// */
+// String getValueForName(String name) {
+// for (int i = 0; i < fEntryValues.length; i++) {
+// String[] entry = fEntryValues[i];
+// if (name.equals(entry[0])) {
+// return entry[1];
+// }
+// }
+// return fEntryValues[0][0];
+// }
+
+ /*
+ * Set the name in the combo widget to match the specified value.
+ */
+ private void updateComboForValue(String value) {
+ this.value = value;
+ goalsText.setText(value);
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java
new file mode 100644
index 00000000..52c49d57
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java
@@ -0,0 +1,230 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.DialogSettings;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.archetype.catalog.ArchetypeCatalog;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory;
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory.LocalCatalogFactory;
+import org.eclipse.m2e.core.internal.Messages;
+
+/**
+ * Local Archetype catalog dialog
+ *
+ * @author Eugene Kuleshov
+ */
+public class LocalArchetypeCatalogDialog extends TitleAreaDialog {
+
+ private static final String DIALOG_SETTINGS = LocalArchetypeCatalogDialog.class.getName();
+
+ private static final String KEY_LOCATIONS = "catalogLocation"; //$NON-NLS-1$
+
+ private static final int MAX_HISTORY = 15;
+
+ private String title;
+
+ private String message;
+
+ Combo catalogLocationCombo;
+
+ private Text catalogDescriptionText;
+
+ private IDialogSettings dialogSettings;
+
+ private ArchetypeCatalogFactory archetypeCatalogFactory;
+
+
+ protected LocalArchetypeCatalogDialog(Shell shell, ArchetypeCatalogFactory factory) {
+ super(shell);
+ this.archetypeCatalogFactory = factory;
+ this.title = Messages.LocalArchetypeCatalogDialog_title;
+ this.message = Messages.LocalArchetypeCatalogDialog_message;
+ setShellStyle(SWT.DIALOG_TRIM);
+
+ IDialogSettings pluginSettings = MavenPlugin.getDefault().getDialogSettings();
+ dialogSettings = pluginSettings.getSection(DIALOG_SETTINGS);
+ if(dialogSettings == null) {
+ dialogSettings = new DialogSettings(DIALOG_SETTINGS);
+ pluginSettings.addSection(dialogSettings);
+ }
+ }
+
+ protected Control createContents(Composite parent) {
+ Control control = super.createContents(parent);
+ setTitle(title);
+ setMessage(message);
+ return control;
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ Composite composite1 = (Composite) super.createDialogArea(parent);
+
+ Composite composite = new Composite(composite1, SWT.NONE);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginTop = 7;
+ gridLayout.marginWidth = 12;
+ gridLayout.numColumns = 3;
+ composite.setLayout(gridLayout);
+
+ Label catalogLocationLabel = new Label(composite, SWT.NONE);
+ catalogLocationLabel.setText(Messages.LocalArchetypeCatalogDialog_lblCatalog);
+
+ catalogLocationCombo = new Combo(composite, SWT.NONE);
+ GridData gd_catalogLocationCombo = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_catalogLocationCombo.widthHint = 250;
+ catalogLocationCombo.setLayoutData(gd_catalogLocationCombo);
+ catalogLocationCombo.setItems(getSavedValues(KEY_LOCATIONS));
+
+ Button browseButton = new Button(composite, SWT.NONE);
+ browseButton.setText(Messages.LocalArchetypeCatalogDialog_btnBrowse);
+ browseButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(getShell());
+ dialog.setText(Messages.LocalArchetypeCatalogDialog_dialog_title);
+ String location = dialog.open();
+ if(location!=null) {
+ catalogLocationCombo.setText(location);
+ update();
+ }
+ }
+ });
+ setButtonLayoutData(browseButton);
+
+ Label catalogDescriptionLabel = new Label(composite, SWT.NONE);
+ catalogDescriptionLabel.setText(Messages.LocalArchetypeCatalogDialog_lblDesc);
+
+ catalogDescriptionText = new Text(composite, SWT.BORDER);
+ catalogDescriptionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+
+
+ if(archetypeCatalogFactory!=null) {
+ catalogLocationCombo.setText(archetypeCatalogFactory.getId());
+ catalogDescriptionText.setText(archetypeCatalogFactory.getDescription());
+ }
+
+ ModifyListener modifyListener = new ModifyListener() {
+ public void modifyText(final ModifyEvent e) {
+ update();
+ }
+ };
+ catalogLocationCombo.addModifyListener(modifyListener);
+ catalogDescriptionText.addModifyListener(modifyListener);
+
+ return composite;
+ }
+
+ private String[] getSavedValues(String key) {
+ String[] array = dialogSettings.getArray(key);
+ return array == null ? new String[0] : array;
+ }
+
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ shell.setText(title);
+ }
+
+ public void create() {
+ super.create();
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ }
+
+ protected void okPressed() {
+ String description = catalogDescriptionText.getText().trim();
+ String location = catalogLocationCombo.getText().trim();
+
+ archetypeCatalogFactory = new LocalCatalogFactory(location, description, true);
+
+ saveValue(KEY_LOCATIONS, location);
+
+ super.okPressed();
+ }
+
+ public ArchetypeCatalogFactory getArchetypeCatalogFactory() {
+ return archetypeCatalogFactory;
+ }
+
+ private void saveValue(String key, String value) {
+ List<String> dirs = new ArrayList<String>();
+ dirs.addAll(Arrays.asList(getSavedValues(key)));
+
+ dirs.remove(value);
+ dirs.add(0, value);
+
+ if(dirs.size() > MAX_HISTORY) {
+ dirs = dirs.subList(0, MAX_HISTORY);
+ }
+
+ dialogSettings.put(key, dirs.toArray(new String[dirs.size()]));
+ }
+
+ void update() {
+ boolean isValid = isValid();
+ // verifyButton.setEnabled(isValid);
+ getButton(IDialogConstants.OK_ID).setEnabled(isValid);
+ }
+
+ private boolean isValid() {
+ setErrorMessage(null);
+ setMessage(null, IStatus.WARNING);
+
+ String location = catalogLocationCombo.getText().trim();
+ if(location.length()==0) {
+ setErrorMessage(Messages.LocalArchetypeCatalogDialog_error_no_location);
+ return false;
+ }
+
+ if(!new File(location).exists()) {
+ setErrorMessage(Messages.LocalArchetypeCatalogDialog_error_exist);
+ return false;
+ }
+
+ LocalCatalogFactory factory = new LocalCatalogFactory(location, null, true);
+ ArchetypeCatalog archetypeCatalog = factory.getArchetypeCatalog();
+ @SuppressWarnings("unchecked")
+ List<Archetype> archetypes = archetypeCatalog.getArchetypes();
+ if(archetypes==null || archetypes.size()==0) {
+ setMessage(Messages.LocalArchetypeCatalogDialog_error_empty, IStatus.WARNING);
+ }
+
+ return true;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java
new file mode 100644
index 00000000..18b4f125
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java
@@ -0,0 +1,320 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWebBrowser;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory;
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory.LocalCatalogFactory;
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory;
+import org.eclipse.m2e.core.archetype.ArchetypeManager;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.Messages;
+
+
+/**
+ * Maven Archetype catalogs preference page
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenArchetypesPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ ArchetypeManager archetypeManager;
+ TableViewer archetypesViewer;
+
+ List<ArchetypeCatalogFactory> archetypeCatalogs;
+
+ public MavenArchetypesPreferencePage() {
+ setTitle(Messages.MavenArchetypesPreferencePage_title);
+
+ this.archetypeManager = MavenPlugin.getDefault().getArchetypeManager();
+ }
+
+ protected void performDefaults() {
+ for(Iterator<ArchetypeCatalogFactory> it = archetypeCatalogs.iterator(); it.hasNext();) {
+ ArchetypeCatalogFactory factory = it.next();
+ if(factory.isEditable()) {
+ it.remove();
+ }
+ }
+
+ archetypesViewer.setInput(archetypeCatalogs);
+ archetypesViewer.setSelection(null, true);
+
+ super.performDefaults();
+ }
+
+ public boolean performOk() {
+ Collection<ArchetypeCatalogFactory> catalogs = archetypeManager.getArchetypeCatalogs();
+ for(ArchetypeCatalogFactory factory : catalogs) {
+ if(factory.isEditable()) {
+ archetypeManager.removeArchetypeCatalogFactory(factory.getId());
+ }
+ }
+ for(ArchetypeCatalogFactory factory : archetypeCatalogs) {
+ if(factory.isEditable()) {
+ archetypeManager.addArchetypeCatalogFactory(factory);
+ }
+ }
+
+ try {
+ archetypeManager.saveCatalogs();
+ } catch(IOException ex) {
+ setErrorMessage(NLS.bind(Messages.MavenArchetypesPreferencePage_error, ex.getMessage()));
+ return false;
+ }
+
+ return super.performOk();
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+
+ protected Control createContents(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2, false);
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ composite.setLayout(gridLayout);
+
+ Link addRemoveOrLink = new Link(composite, SWT.NONE);
+ GridData gd_addRemoveOrLink = new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1);
+ addRemoveOrLink.setLayoutData(gd_addRemoveOrLink);
+ addRemoveOrLink.setText(Messages.MavenArchetypesPreferencePage_link);
+ addRemoveOrLink.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ URL url = new URL("http://maven.apache.org/plugins/maven-archetype-plugin/specification/archetype-catalog.html"); //$NON-NLS-1$
+ IWebBrowser browser = PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser();
+ browser.openURL(url);
+ } catch(MalformedURLException ex) {
+ MavenLogger.log("Malformed URL", ex);
+ } catch(PartInitException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ });
+
+ // archetypesViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER | SWT.FULL_SELECTION);
+ archetypesViewer = new TableViewer(composite, SWT.BORDER | SWT.FULL_SELECTION);
+
+ archetypesViewer.setLabelProvider(new CatalogsLabelProvider());
+
+ archetypesViewer.setContentProvider(new IStructuredContentProvider() {
+
+ public Object[] getElements(Object input) {
+ if(input instanceof Collection) {
+ return ((Collection<?>) input).toArray();
+ }
+ return new Object[0];
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public void dispose() {
+ }
+
+ });
+
+ Table table = archetypesViewer.getTable();
+ table.setLinesVisible(false);
+ table.setHeaderVisible(false);
+ table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 4));
+
+ TableColumn typeColumn = new TableColumn(table, SWT.NONE);
+ typeColumn.setWidth(250);
+ typeColumn.setText(""); //$NON-NLS-1$
+
+ Button addLocalButton = new Button(composite, SWT.NONE);
+ addLocalButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ addLocalButton.setText(Messages.MavenArchetypesPreferencePage_btnAddLocal);
+ addLocalButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ LocalArchetypeCatalogDialog dialog = new LocalArchetypeCatalogDialog(getShell(), null);
+ if (dialog.open()==Window.OK) {
+ ArchetypeCatalogFactory factory = dialog.getArchetypeCatalogFactory();
+ archetypeCatalogs.add(factory);
+ archetypesViewer.setInput(archetypeCatalogs);
+ archetypesViewer.setSelection(new StructuredSelection(factory), true);
+ }
+ }
+ });
+
+ Button addRemoteButton = new Button(composite, SWT.NONE);
+ addRemoteButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ addRemoteButton.setText(Messages.MavenArchetypesPreferencePage_btnAddRemote);
+ addRemoteButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ RemoteArchetypeCatalogDialog dialog = new RemoteArchetypeCatalogDialog(getShell(), null);
+ if (dialog.open()==Window.OK) {
+ ArchetypeCatalogFactory factory = dialog.getArchetypeCatalogFactory();
+ archetypeCatalogs.add(factory);
+ archetypesViewer.setInput(archetypeCatalogs);
+ archetypesViewer.setSelection(new StructuredSelection(factory), true);
+ }
+ }
+ });
+
+ final Button editButton = new Button(composite, SWT.NONE);
+ editButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ editButton.setEnabled(false);
+ editButton.setText(Messages.MavenArchetypesPreferencePage_btnEdit);
+ editButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ ArchetypeCatalogFactory factory = getSelectedArchetypeCatalogFactory();
+ ArchetypeCatalogFactory newFactory = null;
+ if(factory instanceof LocalCatalogFactory) {
+ LocalArchetypeCatalogDialog dialog = new LocalArchetypeCatalogDialog(getShell(), factory);
+ if (dialog.open()==Window.OK) {
+ newFactory = dialog.getArchetypeCatalogFactory();
+ }
+ } else if(factory instanceof RemoteCatalogFactory) {
+ RemoteArchetypeCatalogDialog dialog = new RemoteArchetypeCatalogDialog(getShell(), factory);
+ if (dialog.open()==Window.OK) {
+ newFactory = dialog.getArchetypeCatalogFactory();
+ }
+ }
+ if(newFactory!=null) {
+ int n = archetypeCatalogs.indexOf(factory);
+ if(n>-1) {
+ archetypeCatalogs.set(n, newFactory);
+ archetypesViewer.setInput(archetypeCatalogs);
+ archetypesViewer.setSelection(new StructuredSelection(newFactory), true);
+ }
+ }
+ }
+ });
+
+ final Button removeButton = new Button(composite, SWT.NONE);
+ removeButton.setEnabled(false);
+ removeButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true));
+ removeButton.setText(Messages.MavenArchetypesPreferencePage_btnRemove);
+ removeButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ ArchetypeCatalogFactory factory = getSelectedArchetypeCatalogFactory();
+ archetypeCatalogs.remove(factory);
+ archetypesViewer.setInput(archetypeCatalogs);
+ archetypesViewer.setSelection(null, true);
+ }
+ });
+
+ archetypesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ if(archetypesViewer.getSelection() instanceof IStructuredSelection) {
+ ArchetypeCatalogFactory factory = getSelectedArchetypeCatalogFactory();
+ boolean isEnabled = factory != null && factory.isEditable();
+ removeButton.setEnabled(isEnabled);
+ editButton.setEnabled(isEnabled);
+ }
+ }
+ });
+
+ archetypeCatalogs = new ArrayList<ArchetypeCatalogFactory>(archetypeManager.getArchetypeCatalogs());
+ archetypesViewer.setInput(archetypeCatalogs);
+ archetypesViewer.refresh(); // should listen on property changes instead?
+
+ return composite;
+ }
+
+ protected ArchetypeCatalogFactory getSelectedArchetypeCatalogFactory() {
+ IStructuredSelection selection = (IStructuredSelection) archetypesViewer.getSelection();
+ return (ArchetypeCatalogFactory) selection.getFirstElement();
+ }
+
+
+ static class CatalogsLabelProvider implements ITableLabelProvider, IColorProvider {
+
+ private Color disabledColor = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);
+
+ public String getColumnText(Object element, int columnIndex) {
+ ArchetypeCatalogFactory factory = (ArchetypeCatalogFactory) element;
+ if(factory instanceof LocalCatalogFactory) {
+ return NLS.bind(Messages.MavenArchetypesPreferencePage_local, factory.getDescription());
+ } else if(factory instanceof RemoteCatalogFactory) {
+ if(factory.isEditable()) {
+ return NLS.bind(Messages.MavenArchetypesPreferencePage_remote,factory.getDescription());
+ }
+ return NLS.bind(Messages.MavenArchetypesPreferencePage_packaged, factory.getDescription());
+ }
+ return factory.getDescription();
+ }
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ public Color getBackground(Object element) {
+ return null;
+ }
+
+ public Color getForeground(Object element) {
+ ArchetypeCatalogFactory factory = (ArchetypeCatalogFactory) element;
+ return !factory.isEditable() ? disabledColor : null;
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenGoalSelectionAdapter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenGoalSelectionAdapter.java
new file mode 100644
index 00000000..25493b14
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenGoalSelectionAdapter.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+import org.eclipse.m2e.core.ui.dialogs.MavenGoalSelectionDialog;
+
+public class MavenGoalSelectionAdapter extends SelectionAdapter {
+ private Shell shell;
+ private Text text;
+
+ public MavenGoalSelectionAdapter(Text text, Shell shell) {
+ this.text = text;
+ this.shell = shell;
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+// String fileName = Util.substituteVar(fPomDirName.getText());
+// if(!isDirectoryExist(fileName)) {
+// MessageDialog.openError(getShell(), Messages.getString("launch.errorPomMissing"),
+// Messages.getString("launch.errorSelectPom")); //$NON-NLS-1$ //$NON-NLS-2$
+// return;
+// }
+ MavenGoalSelectionDialog dialog = new MavenGoalSelectionDialog(shell);
+ int rc = dialog.open();
+ if(rc == IDialogConstants.OK_ID) {
+ text.insert(""); // clear selected text //$NON-NLS-1$
+
+ String txt = text.getText();
+ int len = txt.length();
+ int pos = text.getCaretPosition();
+
+ StringBuffer sb = new StringBuffer();
+ if((pos > 0 && txt.charAt(pos - 1) != ' ')) {
+ sb.append(' ');
+ }
+
+ String sep = ""; //$NON-NLS-1$
+ Object[] o = dialog.getResult();
+ for(int i = 0; i < o.length; i++ ) {
+ if(o[i] instanceof MavenGoalSelectionDialog.Entry) {
+ if(dialog.isQualifiedName()) {
+ sb.append(sep).append(((MavenGoalSelectionDialog.Entry) o[i]).getQualifiedName());
+ } else {
+ sb.append(sep).append(((MavenGoalSelectionDialog.Entry) o[i]).getName());
+ }
+ }
+ sep = " "; //$NON-NLS-1$
+ }
+
+ if(pos < len && txt.charAt(pos) != ' ') {
+ sb.append(' ');
+ }
+
+ text.insert(sb.toString());
+ text.setFocus();
+ }
+ }
+ } \ No newline at end of file
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java
new file mode 100644
index 00000000..e17ffd28
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenInstallationsPreferencePage.java
@@ -0,0 +1,677 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import java.io.File;
+import java.lang.reflect.Constructor;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.List;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.ide.IDE;
+
+import org.apache.maven.settings.building.SettingsProblem;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.embedder.MavenRuntime;
+import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.embedder.MavenEmbeddedRuntime;
+import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+
+
+/**
+ * Maven installations preference page
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenInstallationsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ final MavenPlugin mavenPlugin;
+
+ final MavenRuntimeManager runtimeManager;
+
+ final IMavenConfiguration mavenConfiguration;
+
+ final IMaven maven;
+
+ MavenRuntime defaultRuntime;
+
+ List<MavenRuntime> runtimes;
+
+ CheckboxTableViewer runtimesViewer;
+
+ Text globalSettingsText;
+
+ private String globalSettings;
+
+ boolean dirty = false;
+
+ public MavenInstallationsPreferencePage() {
+ setTitle(Messages.MavenInstallationsPreferencePage_title);
+
+ this.mavenPlugin = MavenPlugin.getDefault();
+ this.runtimeManager = mavenPlugin.getMavenRuntimeManager();
+ this.mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ this.maven = MavenPlugin.getDefault().getMaven();
+
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+
+ protected void performDefaults() {
+ runtimeManager.reset();
+ defaultRuntime = runtimeManager.getDefaultRuntime();
+ runtimes = runtimeManager.getMavenRuntimes();
+
+ runtimesViewer.setInput(runtimes);
+ runtimesViewer.setChecked(defaultRuntime, true);
+ runtimesViewer.refresh();
+
+ storeCustom(""); //$NON-NLS-1$
+ globalSettingsText.setText(""); //$NON-NLS-1$
+ mavenConfiguration.setGlobalSettingsFile(""); //$NON-NLS-1$
+
+ updateGlobals(true);
+ super.performDefaults();
+ setDirty(true);
+ }
+
+
+ protected void storeCustom(String dir){
+ mavenPlugin.getPreferenceStore().setValue(P_MAVEN_CUSTOM_GLOBAL, dir == null ? "" : dir); //$NON-NLS-1$
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#performApply()
+ */
+ protected void performApply() {
+ updateSettings();
+ }
+
+ public void updateSettings(){
+ new Job(Messages.MavenInstallationsPreferencePage_job_updating) {
+ protected IStatus run(IProgressMonitor monitor) {
+ String dir = getGlobalSettingsText();
+
+ runtimeManager.setRuntimes(runtimes);
+ runtimeManager.setDefaultRuntime(defaultRuntime);
+ String oldSettings = mavenConfiguration.getGlobalSettingsFile();
+
+ mavenConfiguration.setGlobalSettingsFile(dir);
+ if(defaultRuntime == null || defaultRuntime instanceof MavenEmbeddedRuntime){
+ storeCustom(dir);
+ }
+ IndexManager indexManager = mavenPlugin.getIndexManager();
+ try {
+ indexManager.getWorkspaceIndex().updateIndex(true, monitor);
+ } catch(CoreException ex) {
+ return ex.getStatus();
+ }
+ if((dir == null && oldSettings != null) || (dir != null && !(dir.equals(oldSettings)))){
+ //mavenPlugin.getIndexManager().scheduleIndexUpdate(IndexManager.LOCAL_INDEX, true, 0L);
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+
+ public boolean performOk() {
+ if (dirty) {
+ updateSettings();
+ }
+ return true;
+ }
+
+ public void setDirty(boolean dirty){
+ this.dirty = dirty;
+ }
+
+ public boolean isDirty(){
+ return this.dirty;
+ }
+
+ protected boolean validateMavenInstall(String dir){
+ if(dir == null || dir.length() == 0){
+ return false;
+ }
+ File selectedDir = new File(dir);
+ if(!selectedDir.isDirectory()){
+ MessageDialog.openError(getShell(), Messages.MavenInstallationsPreferencePage_error_title, Messages.MavenInstallationsPreferencePage_error_message);
+ return false;
+ }
+ File binDir = new File(dir, "bin"); //$NON-NLS-1$
+ File confDir = new File(dir, "conf"); //$NON-NLS-1$
+ File libDir = new File(dir, "lib"); //$NON-NLS-1$
+ if(!binDir.exists() || !confDir.exists() || !libDir.exists()){
+ MessageDialog.openError(getShell(), Messages.MavenInstallationsPreferencePage_error_title, Messages.MavenInstallationsPreferencePage_error2_message);
+ return false;
+ }
+ return true;
+ }
+ protected Control createContents(Composite parent) {
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(3, false);
+ gridLayout.marginBottom = 5;
+ gridLayout.marginRight = 5;
+ gridLayout.marginHeight = 0;
+ gridLayout.marginWidth = 0;
+ composite.setLayout(gridLayout);
+
+ Label link = new Label(composite, SWT.NONE);
+ link.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
+ link.setText(Messages.MavenInstallationsPreferencePage_link);
+
+
+ createTable(composite);
+ createGlobalSettings(composite);
+
+
+ defaultRuntime = runtimeManager.getDefaultRuntime();
+ runtimes = runtimeManager.getMavenRuntimes();
+
+ runtimesViewer.setInput(runtimes);
+ runtimesViewer.setChecked(defaultRuntime, true);
+ runtimesViewer.refresh(); // should listen on property changes instead?
+
+ checkSettings();
+ updateGlobals(false);
+ globalSettingsText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent modifyevent) {
+ setGlobalSettingsText(globalSettingsText.getText());
+ updateGlobalSettingsLink();
+ checkSettings();
+ setDirty(true);
+ }
+ });
+
+ return composite;
+ }
+
+ /**
+ *
+ */
+ private void updateGlobalSettingsText(boolean useLastCustomGlobal) {
+ String globalSettings = getGlobalSettingsFile(useLastCustomGlobal);
+ globalSettingsText.setText(globalSettings == null ? "" : globalSettings); //$NON-NLS-1$
+ }
+
+ /**
+ * Use this to retrieve the global settings file which has not been applied yet
+ * @return
+ */
+ public String getGlobalSettingsFile(boolean useLastCustomGlobal) {
+ if(defaultRuntime == null || defaultRuntime instanceof MavenEmbeddedRuntime){
+ String globalSettings = null;
+ if(useLastCustomGlobal){
+ globalSettings = mavenPlugin.getPreferenceStore().getString(P_MAVEN_CUSTOM_GLOBAL);
+ } else {
+ globalSettings = mavenPlugin.getPreferenceStore().getString(MavenPreferenceConstants.P_GLOBAL_SETTINGS_FILE);
+ }
+ return globalSettings.trim().length()==0 ? null : globalSettings;
+ }
+ return defaultRuntime == null ? null : defaultRuntime.getSettings();
+ }
+
+ public void setGlobalSettingsText(String settings){
+ this.globalSettings = settings;
+ }
+ public String getGlobalSettingsText(){
+ return this.globalSettings;
+ }
+ /**
+ *
+ */
+ private void updateGlobals(boolean useLastCustomGlobal) {
+ updateGlobalSettingsText(useLastCustomGlobal);
+ updateGlobalSettingsLink();
+ updateGlobalSettingsBrowseButton();
+ }
+
+ private Link globalSettingsLink;
+
+ private Button globalSettingsBrowseButton;
+
+ private MavenRuntime getCheckedRuntime(){
+ Object[] runtimes = runtimesViewer.getCheckedElements();
+ if(runtimes != null && runtimes.length > 0){
+ return (MavenRuntime)runtimes[0];
+ }
+ return null;
+ }
+
+ protected MavenRuntime getSelectedMavenRuntime(){
+ IStructuredSelection sel = (IStructuredSelection)runtimesViewer.getSelection();
+ return (MavenRuntime) sel.getFirstElement();
+ }
+
+ private void updateGlobalSettingsLink(){
+ MavenRuntime runtime = getCheckedRuntime();
+ String text = ""; //$NON-NLS-1$
+ String currText = globalSettingsText.getText();
+ boolean showURL = false;
+
+ File f = new File(currText);
+ if(f.exists()){
+ showURL = true;
+ }
+ String openFile = showURL ? Messages.MavenInstallationsPreferencePage_link_open : ":"; //$NON-NLS-2$
+ if(runtime instanceof MavenEmbeddedRuntime){
+ text = Messages.MavenInstallationsPreferencePage_settings+openFile;
+ } else {
+ text = Messages.MavenInstallationsPreferencePage_settings_install+openFile;
+ }
+ globalSettingsLink.setText(text);
+ }
+
+ private void updateGlobalSettingsBrowseButton(){
+ MavenRuntime runtime = getCheckedRuntime();
+ boolean enabled = (runtime != null && (runtime instanceof MavenEmbeddedRuntime));
+ globalSettingsBrowseButton.setEnabled(enabled);
+ globalSettingsText.setEditable(enabled);
+ }
+
+ private void createGlobalSettings(Composite composite) {
+ globalSettingsLink = new Link(composite, SWT.NONE);
+ globalSettingsLink.setData("name", "globalSettingsLink"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ globalSettingsLink.setToolTipText(Messages.MavenInstallationsPreferencePage_link_global);
+ GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1);
+ gd.verticalIndent = 25;
+ globalSettingsLink.setLayoutData(gd);
+
+ globalSettingsLink.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ String globalSettings = getGlobalSettings();
+ if(globalSettings.length() == 0) {
+ globalSettings = defaultRuntime.getSettings();
+ }
+ if(globalSettings != null && globalSettings.length() > 0) {
+ openEditor(globalSettings);
+ }
+ }
+ });
+
+ globalSettingsText = new Text(composite, SWT.BORDER);
+ globalSettingsText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ globalSettingsText.setData("name", "globalSettingsText"); //$NON-NLS-1$ //$NON-NLS-2$
+ globalSettingsBrowseButton = new Button(composite, SWT.NONE);
+ GridData gd_globalSettingsBrowseButton = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ globalSettingsBrowseButton.setLayoutData(gd_globalSettingsBrowseButton);
+ globalSettingsBrowseButton.setText(Messages.MavenInstallationsPreferencePage_btnGlobalBrowse);
+ globalSettingsBrowseButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
+ if(getGlobalSettings().length() > 0) {
+ dialog.setFileName(getGlobalSettings());
+ }
+ String file = dialog.open();
+ if(file != null) {
+ file = file.trim();
+ if(file.length() > 0) {
+ globalSettingsText.setText(file);
+ }
+ }
+ }
+ });
+ }
+
+
+ private void createTable(Composite composite){
+ runtimesViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER | SWT.FULL_SELECTION);
+
+ runtimesViewer.setLabelProvider(new RuntimesLabelProvider());
+
+ runtimesViewer.setContentProvider(new IStructuredContentProvider() {
+
+ @SuppressWarnings("unchecked")
+ public Object[] getElements(Object input) {
+ if(input instanceof List) {
+ List list = (List) input;
+ if(list.size() > 0) {
+ return list.toArray(new MavenRuntime[list.size()]);
+ }
+ }
+ return new Object[0];
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public void dispose() {
+ }
+
+ });
+
+ Table table = runtimesViewer.getTable();
+ table.setLinesVisible(false);
+ table.setHeaderVisible(false);
+ GridData gd_table = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 3);
+ gd_table.heightHint = 151;
+ gd_table.widthHint = 333;
+ table.setLayoutData(gd_table);
+
+ TableColumn typeColumn = new TableColumn(table, SWT.NONE);
+ typeColumn.setWidth(325);
+ typeColumn.setText(""); //$NON-NLS-1$
+
+ Button addButton = new Button(composite, SWT.NONE);
+ addButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ addButton.setText(Messages.MavenInstallationsPreferencePage_btnAdd);
+ addButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ DirectoryDialog dlg = new DirectoryDialog(getShell());
+ dlg.setText(Messages.MavenInstallationsPreferencePage_dialog_install_title);
+ dlg.setMessage(Messages.MavenInstallationsPreferencePage_dialog_install_message);
+ String dir = dlg.open();
+ if(dir == null){
+ return;
+ }
+ boolean ok = validateMavenInstall(dir);
+ if(ok){
+ MavenRuntime runtime = MavenRuntimeManager.createExternalRuntime(dir);
+ if(runtimes.contains(runtime)) {
+ MessageDialog.openError(getShell(), Messages.MavenInstallationsPreferencePage_error_title, Messages.MavenInstallationsPreferencePage_error3_message);
+ } else {
+ runtimes.add(runtime);
+ runtimesViewer.refresh();
+ runtimesViewer.setAllChecked(false);
+ runtimesViewer.setChecked(runtime, true);
+ if(runtime != null){
+ setCheckedRuntime(runtime);
+ }
+ }
+ }
+ }
+ });
+
+ final Button editButton = new Button(composite, SWT.NONE);
+ editButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ editButton.setEnabled(false);
+ editButton.setText(Messages.MavenInstallationsPreferencePage_btnEdit);
+ editButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ MavenRuntime runtime = getSelectedMavenRuntime();
+ DirectoryDialog dlg = new DirectoryDialog(Display.getCurrent().getActiveShell());
+ dlg.setText(Messages.MavenInstallationsPreferencePage_dialog_title);
+ dlg.setMessage(Messages.MavenInstallationsPreferencePage_dialog_message);
+ dlg.setFilterPath(runtime.getLocation());
+ String dir = dlg.open();
+ boolean ok = validateMavenInstall(dir);
+ if(ok && !dir.equals(runtime.getLocation())) {
+ MavenRuntime newRuntime = MavenRuntimeManager.createExternalRuntime(dir);
+ if(runtimes.contains(newRuntime)) {
+ MessageDialog.openError(getShell(), Messages.MavenInstallationsPreferencePage_error_title, Messages.MavenInstallationsPreferencePage_error4_message);
+ } else {
+ runtimes.set(runtimes.indexOf(runtime), newRuntime);
+ runtimesViewer.refresh();
+ setDirty(true);
+ if(newRuntime != null){
+ setCheckedRuntime(newRuntime);
+ }
+ }
+ }
+ }
+ });
+
+ final Button removeButton = new Button(composite, SWT.NONE);
+ removeButton.setEnabled(false);
+ removeButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ removeButton.setText(Messages.MavenInstallationsPreferencePage_btnRemove);
+ removeButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ MavenRuntime runtime = getSelectedMavenRuntime();
+ runtimes.remove(runtime);
+ runtimesViewer.refresh();
+ Object[] checkedElements = runtimesViewer.getCheckedElements();
+ if(checkedElements == null || checkedElements.length == 0) {
+ defaultRuntime = runtimeManager.getRuntime(MavenRuntimeManager.EMBEDDED);
+ runtimesViewer.setChecked(defaultRuntime, true);
+ setCheckedRuntime(defaultRuntime);
+ }
+ setDirty(true);
+ }
+ });
+
+ runtimesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ if(runtimesViewer.getSelection() instanceof IStructuredSelection) {
+ MavenRuntime runtime = getSelectedMavenRuntime();
+ boolean isEnabled = runtime != null && runtime.isEditable();
+ removeButton.setEnabled(isEnabled);
+ editButton.setEnabled(isEnabled);
+ }
+ }
+ });
+
+ runtimesViewer.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ if(event.getElement() != null && event.getChecked()){
+
+ setCheckedRuntime((MavenRuntime)event.getElement());
+ }
+ }
+ });
+ Link noteLabel = new Link(composite, SWT.WRAP | SWT.READ_ONLY);
+ GridData noteLabelData = new GridData(SWT.FILL, SWT.TOP, false, false, 2, 1);
+ noteLabelData.horizontalIndent = 15;
+ noteLabelData.widthHint = 100;
+
+ noteLabel.setLayoutData(noteLabelData);
+ noteLabel.setText(Messages.MavenInstallationsPreferencePage_lblNote1 +
+ Messages.MavenInstallationsPreferencePage_lblNote2);
+ noteLabel.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ URL url = new URL(e.text);
+ IWebBrowser browser = PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser();
+ browser.openURL(url);
+ } catch(MalformedURLException ex) {
+ MavenLogger.log("Malformed URL", ex);
+ } catch(PartInitException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ });
+ }
+
+ private static final String P_MAVEN_CUSTOM_GLOBAL = "customGlobalSettingsFile"; //$NON-NLS-1$
+
+ protected void setCheckedRuntime(MavenRuntime runtime){
+ runtimesViewer.setAllChecked(false);
+ runtimesViewer.setChecked(runtime, true);
+ defaultRuntime = runtime;
+ boolean useDefault = (defaultRuntime == null || defaultRuntime instanceof MavenEmbeddedRuntime);
+ updateGlobals(useDefault);
+ setDirty(true);
+ }
+
+ void checkSettings() {
+ setErrorMessage(null);
+ setMessage(null);
+
+ String globalSettings = getGlobalSettings();
+ if(globalSettings != null && globalSettings.length() > 0) {
+ File globalSettingsFile = new File(globalSettings);
+ if(!globalSettingsFile.exists()) {
+ setMessage(Messages.MavenInstallationsPreferencePage_error_global_missing, IMessageProvider.WARNING);
+ globalSettings = null;
+ }
+ } else {
+ globalSettings = null;
+ }
+
+ List<SettingsProblem> result = maven.validateSettings(globalSettings);
+ if(result.size() > 0) {
+ setMessage(Messages.MavenInstallationsPreferencePage_error_global_parse + result.get(0).getMessage(), IMessageProvider.WARNING);
+ }
+
+ }
+
+
+
+ @SuppressWarnings("unchecked")
+ void openEditor(final String fileName) {
+ // XXX create new settings.xml if does not exist
+
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = window.getActivePage();
+
+ IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor("settings.xml"); //$NON-NLS-1$
+
+ File file = new File(fileName);
+ IEditorInput input = null;
+ try {
+ //class implementing editor input for external file has been renamed in eclipse 3.3, hence reflection
+ Class javaInput = null;
+ try {
+ javaInput = Class.forName("org.eclipse.ui.internal.editors.text.JavaFileEditorInput"); //$NON-NLS-1$
+ Constructor cons = javaInput.getConstructor(new Class[] {File.class});
+ input = (IEditorInput) cons.newInstance(new Object[] {file});
+ } catch(Exception e) {
+ try {
+ IFileStore fileStore = EFS.getLocalFileSystem().fromLocalFile(file);
+ Class storeInput = Class.forName("org.eclipse.ui.ide.FileStoreEditorInput"); //$NON-NLS-1$
+ Constructor cons = storeInput.getConstructor(new Class[] {IFileStore.class});
+ input = (IEditorInput) cons.newInstance(new Object[] {fileStore});
+ } catch(Exception ex) {
+ //ignore...
+ }
+ }
+ final IEditorPart editor = IDE.openEditor(page, input, desc.getId());
+ editor.addPropertyListener(new IPropertyListener() {
+ public void propertyChanged(Object source, int propId) {
+ if(!editor.isDirty()) {
+ mavenPlugin.getConsole().logMessage("Refreshing settings " + fileName);
+ invalidateMavenSettings(false);
+ }
+ }
+ });
+
+ } catch(PartInitException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+
+
+ void invalidateMavenSettings(final boolean reindex) {
+// new Job("Invalidating Maven settings") {
+// protected IStatus run(IProgressMonitor monitor) {
+// mavenPlugin.getMavenEmbedderManager().invalidateMavenSettings();
+// if(reindex) {
+// mavenPlugin.getIndexManager().scheduleIndexUpdate(IndexManager.LOCAL_INDEX, true, 0L);
+// }
+// return Status.OK_STATUS;
+// }
+// }.schedule();
+ }
+ String getGlobalSettings() {
+ return globalSettingsText.getText().trim();
+ }
+
+ static class RuntimesLabelProvider implements ITableLabelProvider, IColorProvider {
+
+ public String getColumnText(Object element, int columnIndex) {
+ MavenRuntime runtime = (MavenRuntime) element;
+ return runtime.toString();
+ }
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ public Color getBackground(Object element) {
+ return null;
+ }
+
+ public Color getForeground(Object element) {
+ MavenRuntime runtime = (MavenRuntime) element;
+ if(!runtime.isEditable()) {
+ return Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);
+ }
+ return null;
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java
new file mode 100644
index 00000000..18105440
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenPreferencePage.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+
+
+public class MavenPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ final MavenPlugin plugin;
+
+ public MavenPreferencePage() {
+ super(GRID);
+ setPreferenceStore(MavenPlugin.getDefault().getPreferenceStore());
+
+ plugin = MavenPlugin.getDefault();
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+
+ /*
+ * Creates the field editors. Field editors are abstractions of the common GUI
+ * blocks needed to manipulate various types of preferences. Each field editor
+ * knows how to save and restore itself.
+ */
+ public void createFieldEditors() {
+
+ addField(new BooleanFieldEditor(MavenPreferenceConstants.P_OFFLINE, Messages.getString("preferences.offline"), //$NON-NLS-1$
+ getFieldEditorParent()));
+
+ addField(new BooleanFieldEditor(MavenPreferenceConstants.P_DEBUG_OUTPUT, //
+ Messages.getString("preferences.debugOutput"), //$NON-NLS-1$
+ getFieldEditorParent()));
+
+ // addField( new BooleanFieldEditor( MavenPreferenceConstants.P_UPDATE_SNAPSHOTS,
+ // Messages.getString( "preferences.updateSnapshots" ), //$NON-NLS-1$
+ // getFieldEditorParent() ) );
+
+ addField(new BooleanFieldEditor(MavenPreferenceConstants.P_DOWNLOAD_SOURCES, //
+ Messages.getString("preferences.downloadSources"), //$NON-NLS-1$
+ getFieldEditorParent()));
+
+ addField(new BooleanFieldEditor(MavenPreferenceConstants.P_DOWNLOAD_JAVADOC, //
+ Messages.getString("preferences.downloadJavadoc"), //$NON-NLS-1$
+ getFieldEditorParent()));
+
+ addField(new BooleanFieldEditor(MavenPreferenceConstants.P_UPDATE_INDEXES, //
+ org.eclipse.m2e.core.internal.Messages.MavenPreferencePage_download, //
+ getFieldEditorParent()));
+
+ addField(new BooleanFieldEditor(MavenPreferenceConstants.P_UPDATE_PROJECTS, //
+ org.eclipse.m2e.core.internal.Messages.MavenPreferencePage_update, //
+ getFieldEditorParent()));
+
+ addField(new BooleanFieldEditor(MavenPreferenceConstants.P_HIDE_FOLDERS_OF_NESTED_PROJECTS, //
+ org.eclipse.m2e.core.internal.Messages.MavenPreferencePage_hide, getFieldEditorParent()));
+
+ GridData comboCompositeGridData = new GridData();
+ comboCompositeGridData.verticalIndent = 25;
+ comboCompositeGridData.horizontalSpan = 3;
+ comboCompositeGridData.grabExcessHorizontalSpace = true;
+ comboCompositeGridData.horizontalAlignment = GridData.FILL;
+
+ Composite comboComposite = new Composite(getFieldEditorParent(), SWT.NONE);
+ comboComposite.setLayoutData(comboCompositeGridData);
+ comboComposite.setLayout(new GridLayout(2, false));
+
+ // addSeparator();
+ }
+
+ private void addSeparator() {
+ Label separator = new Label(getFieldEditorParent(), SWT.HORIZONTAL | SWT.SEPARATOR);
+ // separator.setVisible(false);
+ GridData separatorGridData = new GridData();
+ separatorGridData.horizontalSpan = 4;
+ separatorGridData.grabExcessHorizontalSpace = true;
+ separatorGridData.horizontalAlignment = GridData.FILL;
+ separatorGridData.verticalIndent = 10;
+ separator.setLayoutData(separatorGridData);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectLifecycleMappingPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectLifecycleMappingPage.java
new file mode 100644
index 00000000..fca8e44d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectLifecycleMappingPage.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.dialogs.PropertyPage;
+
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+import org.eclipse.m2e.core.ui.internal.lifecycle.ILifecyclePropertyPage;
+import org.eclipse.m2e.core.ui.internal.lifecycle.LifecycleMappingPropertyPageFactory;
+
+/**
+ * Maven project preference page
+ *
+ * @author Dan Yocum
+ */
+public class MavenProjectLifecycleMappingPage extends PropertyPage{
+
+ private ILifecyclePropertyPage currentPage;
+
+ public MavenProjectLifecycleMappingPage() {
+
+ setTitle(""); //$NON-NLS-1$
+ }
+
+ protected Control createContents(Composite parent) {
+ currentPage = loadCurrentPage((IProject)getElement());
+ setMessage(currentPage.getName());
+ return currentPage.createContents(parent);
+ }
+
+ private ILifecyclePropertyPage getErrorPage(String msg){
+ SimpleLifecycleMappingPropertyPage p = new SimpleLifecycleMappingPropertyPage(msg);
+ return p;
+ }
+
+ private ILifecyclePropertyPage getPage(ILifecycleMapping lifecycleMapping){
+ ILifecyclePropertyPage page = LifecycleMappingPropertyPageFactory.getFactory().getPageForId(lifecycleMapping.getId(), getProject(), this.getShell());
+ if(page == null){
+ page = getErrorPage(Messages.MavenProjectLifecycleMappingPage_error_no_page);
+ page.setName(lifecycleMapping.getName());
+ }
+ return page;
+ }
+
+ private ILifecyclePropertyPage loadCurrentPage(IProject project){
+ ILifecyclePropertyPage page = null;
+ try{
+ ILifecycleMapping lifecycleMapping = LifecycleMappingPropertyPageFactory.getLifecycleMapping(project);
+ if(lifecycleMapping == null){
+ return getErrorPage(Messages.MavenProjectLifecycleMappingPage_error_no_strategy);
+ }
+ page = getPage(lifecycleMapping);
+ return page;
+ } catch(CoreException ce){
+ MavenLogger.log(ce);
+ SimpleLifecycleMappingPropertyPage p = new SimpleLifecycleMappingPropertyPage(Messages.MavenProjectLifecycleMappingPage_error_page_error);
+ return p;
+ }
+ }
+
+ protected void performDefaults() {
+ currentPage.performDefaults();
+ }
+
+ protected IProject getProject() {
+ return (IProject) getElement();
+ }
+
+ public boolean performOk() {
+ return currentPage.performOk();
+ }
+
+ public void setElement(IAdaptable element){
+ if(currentPage != null && element instanceof IProject){
+ currentPage.setProject((IProject)element);
+ }
+ super.setElement(element);
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.java
new file mode 100644
index 00000000..b6078c36
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenProjectPreferencePage.java
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.PropertyPage;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+
+/**
+ * Maven project preference page
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenProjectPreferencePage extends PropertyPage {
+
+ private Button resolveWorspaceProjectsButton;
+// private Button includeModulesButton;
+
+ private Text activeProfilesText;
+
+ public MavenProjectPreferencePage() {
+ setTitle(Messages.MavenProjectPreferencePage_title);
+ }
+
+ protected Control createContents(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(2, false));
+ composite.setLayoutData(new GridData(GridData.FILL));
+
+ Label profilesLabel = new Label(composite, SWT.NONE);
+ profilesLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ profilesLabel.setText(Messages.MavenProjectPreferencePage_lblProfiles);
+
+ activeProfilesText = new Text(composite, SWT.BORDER);
+ activeProfilesText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+
+ resolveWorspaceProjectsButton = new Button(composite, SWT.CHECK);
+ GridData resolveWorspaceProjectsButtonData = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+ resolveWorspaceProjectsButton.setLayoutData(resolveWorspaceProjectsButtonData);
+ resolveWorspaceProjectsButton.setText(Messages.MavenProjectPreferencePage_btnResolve);
+
+// includeModulesButton = new Button(composite, SWT.CHECK);
+// GridData gd = new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1);
+// gd.verticalIndent = 15;
+// includeModulesButton.setLayoutData(gd);
+// includeModulesButton.setText("Include &Modules");
+//
+// Text includeModulesText = new Text(composite, SWT.WRAP | SWT.READ_ONLY | SWT.MULTI);
+// includeModulesText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE));
+// GridData gd_includeModulesText = new GridData(SWT.FILL, SWT.FILL, false, false, 2, 1);
+// gd_includeModulesText.horizontalIndent = 15;
+// gd_includeModulesText.verticalIndent = 0;
+// gd_includeModulesText.widthHint = 300;
+// gd_includeModulesText.heightHint = 120;
+// includeModulesText.setLayoutData(gd_includeModulesText);
+// includeModulesText.setBackground(composite.getBackground());
+// includeModulesText.setText("When enabled, dependencies from all nested modules "
+// + "are added to the \"Maven Dependencies\" container and "
+// + "source folders from nested modules are added to the current "
+// + "project build path (use \"Update Sources\" action)");
+
+ init(getResolverConfiguration());
+
+ return composite;
+ }
+
+ protected void performDefaults() {
+ init(new ResolverConfiguration());
+ }
+
+ private void init(ResolverConfiguration configuration) {
+
+ resolveWorspaceProjectsButton.setSelection(configuration.shouldResolveWorkspaceProjects());
+// includeModulesButton.setSelection(configuration.shouldIncludeModules());
+ activeProfilesText.setText(configuration.getActiveProfiles());
+ }
+
+ public boolean performOk() {
+ final IProject project = getProject();
+ try {
+ if(!project.isAccessible() || !project.hasNature(IMavenConstants.NATURE_ID)) {
+ return true;
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ return false;
+ }
+
+ final ResolverConfiguration configuration = getResolverConfiguration();
+ if(configuration.getActiveProfiles().equals(activeProfilesText.getText()) &&
+// configuration.shouldIncludeModules()==includeModulesButton.getSelection() &&
+ configuration.shouldResolveWorkspaceProjects()==resolveWorspaceProjectsButton.getSelection()) {
+ return true;
+ }
+
+ configuration.setResolveWorkspaceProjects(resolveWorspaceProjectsButton.getSelection());
+// configuration.setIncludeModules(includeModulesButton.getSelection());
+ configuration.setActiveProfiles(activeProfilesText.getText());
+
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ boolean isSet = projectManager.setResolverConfiguration(getProject(), configuration);
+ if(isSet) {
+
+ boolean res = MessageDialog.openQuestion(getShell(), Messages.MavenProjectPreferencePage_dialog_title, //
+ Messages.MavenProjectPreferencePage_dialog_message);
+ if(res) {
+ final MavenPlugin plugin = MavenPlugin.getDefault();
+ WorkspaceJob job = new WorkspaceJob(NLS.bind(Messages.MavenProjectPreferencePage_job, project.getName() )) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ try {
+ plugin.getProjectConfigurationManager().updateProjectConfiguration(project, configuration, monitor);
+ } catch(CoreException ex) {
+ return ex.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ job.setRule(plugin.getProjectConfigurationManager().getRule());
+ job.schedule();
+ }
+
+ }
+
+ return isSet;
+ }
+
+ private ResolverConfiguration getResolverConfiguration() {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ return projectManager.getResolverConfiguration(getProject());
+ }
+
+ private IProject getProject() {
+ return (IProject) getElement();
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java
new file mode 100644
index 00000000..788b8726
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MavenSettingsPreferencePage.java
@@ -0,0 +1,413 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import java.io.File;
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.repository.RepositorySystem;
+import org.apache.maven.settings.Settings;
+import org.apache.maven.settings.building.SettingsProblem;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.embedder.MavenRuntime;
+import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+
+
+/**
+ * Maven installations preference page
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenSettingsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ final MavenPlugin mavenPlugin;
+
+ final MavenRuntimeManager runtimeManager;
+
+ final IMavenConfiguration mavenConfiguration;
+
+ final IMaven maven;
+
+ MavenRuntime defaultRuntime;
+
+
+ Text userSettingsText;
+
+ Text localRepositoryText;
+
+ boolean dirty = false;
+
+ private Link userSettingsLink;
+
+ public MavenSettingsPreferencePage() {
+ setTitle(org.eclipse.m2e.core.internal.Messages.MavenSettingsPreferencePage_title);
+
+ this.mavenPlugin = MavenPlugin.getDefault();
+ this.runtimeManager = mavenPlugin.getMavenRuntimeManager();
+ this.mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ this.maven = MavenPlugin.getDefault().getMaven();
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
+ */
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if(visible){
+ updateLocalRepository();
+ }
+ }
+
+ protected void performDefaults() {
+ userSettingsText.setText(MavenCli.DEFAULT_USER_SETTINGS_FILE.getAbsolutePath());
+ setDirty(true);
+ updateLocalRepository();
+ super.performDefaults();
+ }
+
+ protected void updateSettings(final boolean updateMavenDependencies){
+ final String userSettings = getUserSettings();
+
+ new Job(org.eclipse.m2e.core.internal.Messages.MavenSettingsPreferencePage_job_updating) {
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ final File localRepositoryDir = new File(maven.getLocalRepository().getBasedir());
+ if(userSettings.length() > 0) {
+ mavenConfiguration.setUserSettingsFile(userSettings);
+ } else {
+ mavenConfiguration.setUserSettingsFile(null);
+ }
+
+ File newRepositoryDir = new File(maven.getLocalRepository().getBasedir());
+ if(!newRepositoryDir.equals(localRepositoryDir)) {
+ IndexManager indexManager = mavenPlugin.getIndexManager();
+ indexManager.getWorkspaceIndex().updateIndex(true, monitor);
+ }
+ if(updateMavenDependencies){
+ IMavenProjectFacade[] projects = MavenPlugin.getDefault().getMavenProjectManager().getProjects();
+ ArrayList<IProject> allProjects = new ArrayList<IProject>();
+ if(projects != null){
+ MavenPlugin.getDefault().getMaven().reloadSettings();
+ SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, projects.length);
+ for(int i=0;i<projects.length;i++){
+ subMonitor.beginTask(NLS.bind(org.eclipse.m2e.core.internal.Messages.MavenSettingsPreferencePage_task_updating, projects[i].getProject().getName()), 1);
+ allProjects.add(projects[i].getProject());
+ }
+ IMavenConfiguration configuration = MavenPlugin.getDefault().getMavenConfiguration();
+ MavenPlugin.getDefault().getMavenProjectManager().refresh(new MavenUpdateRequest(allProjects.toArray(new IProject[]{}), configuration.isOffline(), true));
+ subMonitor.done();
+ }
+ }
+ return Status.OK_STATUS;
+ } catch (CoreException e) {
+ return e.getStatus();
+ }
+ }
+ }.schedule();
+ }
+
+ protected void performApply() {
+ if(dirty){
+ updateSettings(false);
+ }
+ }
+
+ public boolean performOk() {
+ if (dirty) {
+ updateSettings(false);
+ }
+ return true;
+ }
+
+ public void setDirty(boolean dirty){
+ this.dirty = dirty;
+ }
+
+ public boolean isDirty(){
+ return this.dirty;
+ }
+
+ protected Control createContents(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(4, false);
+ gridLayout.marginBottom = 5;
+ gridLayout.marginRight = 5;
+ gridLayout.marginHeight = 0;
+ gridLayout.marginWidth = 0;
+ composite.setLayout(gridLayout);
+
+ createUserSettings(composite);
+ Label localRepositoryLabel = new Label(composite, SWT.NONE);
+ GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
+ gd.verticalIndent=25;
+ localRepositoryLabel.setLayoutData(gd);
+ localRepositoryLabel.setText(org.eclipse.m2e.core.internal.Messages.MavenSettingsPreferencePage_lblLocal);
+
+ localRepositoryText = new Text(composite, SWT.READ_ONLY|SWT.BORDER);
+ localRepositoryText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+ localRepositoryText.setData("name", "localRepositoryText"); //$NON-NLS-1$ //$NON-NLS-2$
+ localRepositoryText.setEditable(false);
+ Button reindexButton = new Button(composite, SWT.NONE);
+ reindexButton.setLayoutData(new GridData(SWT.FILL, SWT.RIGHT, false, false, 1, 1));
+ reindexButton.setText(Messages.getString("preferences.reindexButton")); //$NON-NLS-1$
+ reindexButton.addSelectionListener(new SelectionAdapter(){
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ public void widgetSelected(SelectionEvent e) {
+ new WorkspaceJob(org.eclipse.m2e.core.internal.Messages.MavenSettingsPreferencePage_job_indexing) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ IndexManager indexManager = mavenPlugin.getIndexManager();
+ indexManager.getWorkspaceIndex().updateIndex(true, monitor);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ });
+ defaultRuntime = runtimeManager.getDefaultRuntime();
+
+ String userSettings = mavenConfiguration.getUserSettingsFile();
+ if(userSettings == null || userSettings.length() == 0) {
+ userSettingsText.setText(MavenCli.DEFAULT_USER_SETTINGS_FILE.getAbsolutePath());
+ } else {
+ userSettingsText.setText(userSettings);
+ }
+
+ checkSettings();
+ updateLocalRepository();
+
+ userSettingsText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent modifyevent) {
+ updateLocalRepository();
+ checkSettings();
+ setDirty(true);
+ }
+ });
+
+ return composite;
+ }
+
+ public void updateSettingsLink(boolean active){
+ String text = org.eclipse.m2e.core.internal.Messages.MavenSettingsPreferencePage_link1;
+ if(active){
+ text = org.eclipse.m2e.core.internal.Messages.MavenSettingsPreferencePage_link2;
+ }
+ userSettingsLink.setText(text);
+ }
+ /**
+ * @param composite
+ */
+ private void createUserSettings(Composite composite) {
+
+ userSettingsLink = new Link(composite, SWT.NONE);
+ userSettingsLink.setData("name", "userSettingsLink"); //$NON-NLS-1$ //$NON-NLS-2$
+ userSettingsLink.setText(org.eclipse.m2e.core.internal.Messages.MavenSettingsPreferencePage_link2);
+ userSettingsLink.setToolTipText(org.eclipse.m2e.core.internal.Messages.MavenSettingsPreferencePage_link_tooltip);
+ GridData gd_userSettingsLabel = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
+
+ gd_userSettingsLabel.verticalIndent = 15;
+ userSettingsLink.setLayoutData(gd_userSettingsLabel);
+ userSettingsLink.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ String userSettings = getUserSettings();
+ if(userSettings.length() == 0) {
+ userSettings = MavenCli.DEFAULT_USER_SETTINGS_FILE.getAbsolutePath();
+ }
+ openEditor(userSettings);
+ }
+ });
+ userSettingsText = new Text(composite, SWT.BORDER);
+ userSettingsText.setData("name", "userSettingsText"); //$NON-NLS-1$ //$NON-NLS-2$
+ GridData gd_userSettingsText = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1);
+ gd_userSettingsText.verticalIndent = 5;
+ gd_userSettingsText.widthHint = 100;
+ userSettingsText.setLayoutData(gd_userSettingsText);
+
+ Button userSettingsBrowseButton = new Button(composite, SWT.NONE);
+ GridData gd_userSettingsBrowseButton = new GridData(SWT.FILL, SWT.RIGHT, false, false, 1, 1);
+
+ userSettingsBrowseButton.setLayoutData(gd_userSettingsBrowseButton);
+ userSettingsBrowseButton.setText(org.eclipse.m2e.core.internal.Messages.MavenSettingsPreferencePage_btnBrowse);
+ userSettingsBrowseButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
+ if(getUserSettings().length() > 0) {
+ dialog.setFileName(getUserSettings());
+ }
+ String file = dialog.open();
+ if(file != null) {
+ file = file.trim();
+ if(file.length() > 0) {
+ userSettingsText.setText(file);
+ updateLocalRepository();
+ checkSettings();
+ }
+ }
+ }
+ });
+
+ Button updateSettings = new Button(composite, SWT.NONE);
+ GridData gd = new GridData(SWT.FILL, SWT.LEFT, false, false, 1, 1);
+ updateSettings.setText(org.eclipse.m2e.core.internal.Messages.MavenSettingsPreferencePage_btnUpdate);
+ updateSettings.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e){
+ updateSettings(true);
+ }
+ });
+ }
+
+ protected void updateLocalRepository() {
+ final String userSettings = getUserSettings();
+ String globalSettings = runtimeManager.getGlobalSettingsFile();
+ try {
+ Settings settings = maven.buildSettings(globalSettings, userSettings);
+ String localRepository = settings.getLocalRepository();
+ if(localRepository == null){
+ localRepository = RepositorySystem.defaultUserLocalRepository.getAbsolutePath();
+ }
+ if(!localRepositoryText.isDisposed()) {
+ localRepositoryText.setText(localRepository == null ? "" : localRepository); //$NON-NLS-1$
+ }
+ } catch (CoreException e) {
+ setMessage(e.getMessage(), IMessageProvider.ERROR);
+ }
+ }
+
+ protected void checkSettings() {
+ setErrorMessage(null);
+ setMessage(null);
+ boolean fileExists = false;
+ String userSettings = getUserSettings();
+ if(userSettings != null && userSettings.length() > 0) {
+ File userSettingsFile = new File(userSettings);
+ if(!userSettingsFile.exists()) {
+ setMessage(org.eclipse.m2e.core.internal.Messages.MavenSettingsPreferencePage_error_missing, IMessageProvider.WARNING);
+ userSettings = null;
+
+ } else {
+ fileExists = true;
+ }
+
+ } else {
+ userSettings = null;
+ }
+ updateSettingsLink(fileExists);
+ List<SettingsProblem> result = maven.validateSettings(userSettings);
+ if(result.size() > 0) {
+ setMessage(NLS.bind(org.eclipse.m2e.core.internal.Messages.MavenSettingsPreferencePage_error_parse, result.get(0).getMessage()), IMessageProvider.WARNING);
+ }
+ }
+
+
+
+ @SuppressWarnings("unchecked")
+ void openEditor(final String fileName) {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = window.getActivePage();
+
+ IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor("settings.xml"); //$NON-NLS-1$
+
+ File file = new File(fileName);
+ IEditorInput input = null;
+ try {
+ //class implementing editor input for external file has been renamed in eclipse 3.3, hence reflection
+ Class javaInput = null;
+ try {
+ javaInput = Class.forName("org.eclipse.ui.internal.editors.text.JavaFileEditorInput"); //$NON-NLS-1$
+ Constructor cons = javaInput.getConstructor(new Class[] {File.class});
+ input = (IEditorInput) cons.newInstance(new Object[] {file});
+ } catch(Exception e) {
+ try {
+ IFileStore fileStore = EFS.getLocalFileSystem().fromLocalFile(file);
+ Class storeInput = Class.forName("org.eclipse.ui.ide.FileStoreEditorInput"); //$NON-NLS-1$
+ Constructor cons = storeInput.getConstructor(new Class[] {IFileStore.class});
+ input = (IEditorInput) cons.newInstance(new Object[] {fileStore});
+ } catch(Exception ex) {
+ //ignore...
+ }
+ }
+ final IEditorPart editor = IDE.openEditor(page, input, desc.getId());
+ editor.addPropertyListener(new IPropertyListener() {
+ public void propertyChanged(Object source, int propId) {
+ if(!editor.isDirty()) {
+ mavenPlugin.getConsole().logMessage("Refreshing settings " + fileName);
+ }
+ }
+ });
+
+ } catch(PartInitException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+
+ String getUserSettings() {
+ return userSettingsText.getText().trim();
+ }
+
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MissingLifecycleMappingPropertyPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MissingLifecycleMappingPropertyPage.java
new file mode 100644
index 00000000..602e7322
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/MissingLifecycleMappingPropertyPage.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.osgi.util.NLS;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.project.MissingLifecycleMapping;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+import org.eclipse.m2e.core.ui.internal.lifecycle.LifecycleMappingPropertyPageFactory;
+
+public class MissingLifecycleMappingPropertyPage extends SimpleLifecycleMappingPropertyPage {
+
+ public MissingLifecycleMappingPropertyPage() {
+ super(Messages.MissingLifecycleMappingPropertyPage_title);
+ }
+
+ protected String getMessage() {
+ try {
+ ILifecycleMapping lifecycleMapping = LifecycleMappingPropertyPageFactory.getLifecycleMapping(getProject());
+ if (lifecycleMapping instanceof MissingLifecycleMapping) {
+ String missingId = ((MissingLifecycleMapping) lifecycleMapping).getMissingMappingId();
+ return NLS.bind(Messages.MissingLifecycleMappingPropertyPage_error, missingId);
+ }
+ } catch(CoreException ex) {
+ // this is odd, but lets ignore it anyways
+ }
+ return super.getMessage();
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/ProblemReportingPreferencePage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/ProblemReportingPreferencePage.java
new file mode 100644
index 00000000..90abeaf9
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/ProblemReportingPreferencePage.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.internal.preferences.MavenPreferenceConstants;
+
+
+public class ProblemReportingPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ final MavenPlugin plugin;
+ private Composite parent;
+
+ public ProblemReportingPreferencePage() {
+ super(GRID);
+ setPreferenceStore(MavenPlugin.getDefault().getPreferenceStore());
+
+ plugin = MavenPlugin.getDefault();
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+
+ /*
+ * Creates the field editors. Field editors are abstractions of the common GUI
+ * blocks needed to manipulate various types of preferences. Each field editor
+ * knows how to save and restore itself.
+ */
+ public void createFieldEditors() {
+ parent = getFieldEditorParent();
+
+ addField(new StringFieldEditor(MavenPreferenceConstants.P_JIRA_USERNAME, Messages.getString("jira.username"), parent)); //$NON-NLS-1$
+
+ StringFieldEditor passwordEditor = new StringFieldEditor(MavenPreferenceConstants.P_JIRA_PASSWORD, Messages.getString("jira.password"), parent); //$NON-NLS-1$
+
+ addField(passwordEditor);
+ Text passwordField = passwordEditor.getTextControl(parent);
+ passwordField.setEchoChar('*');
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java
new file mode 100644
index 00000000..649c89da
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java
@@ -0,0 +1,284 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.DialogSettings;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.archetype.catalog.ArchetypeCatalog;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory;
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory;
+import org.eclipse.m2e.core.internal.Messages;
+
+/**
+ * Remote Archetype catalog dialog
+ *
+ * @author Eugene Kuleshov
+ */
+public class RemoteArchetypeCatalogDialog extends TitleAreaDialog {
+
+ /**
+ *
+ */
+ private static final int VERIFY_ID = IDialogConstants.CLIENT_ID + 1;
+
+ private static final String DIALOG_SETTINGS = RemoteArchetypeCatalogDialog.class.getName();
+
+ private static final String KEY_LOCATIONS = "catalogUrl"; //$NON-NLS-1$
+
+ private static final int MAX_HISTORY = 15;
+
+ private String title;
+
+ private String message;
+
+ Combo catalogUrlCombo;
+
+ private Text catalogDescriptionText;
+
+ private IDialogSettings dialogSettings;
+
+ private ArchetypeCatalogFactory archetypeCatalogFactory;
+
+ Button verifyButton;
+
+
+ protected RemoteArchetypeCatalogDialog(Shell shell, ArchetypeCatalogFactory factory) {
+ super(shell);
+ this.archetypeCatalogFactory = factory;
+ this.title = Messages.RemoteArchetypeCatalogDialog_title;
+ this.message = Messages.RemoteArchetypeCatalogDialog_message;
+ setShellStyle(SWT.DIALOG_TRIM);
+
+ IDialogSettings pluginSettings = MavenPlugin.getDefault().getDialogSettings();
+ dialogSettings = pluginSettings.getSection(DIALOG_SETTINGS);
+ if(dialogSettings == null) {
+ dialogSettings = new DialogSettings(DIALOG_SETTINGS);
+ pluginSettings.addSection(dialogSettings);
+ }
+ }
+
+ protected Control createContents(Composite parent) {
+ Control control = super.createContents(parent);
+ setTitle(title);
+ setMessage(message);
+ return control;
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ Composite composite1 = (Composite) super.createDialogArea(parent);
+
+ Composite composite = new Composite(composite1, SWT.NONE);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginTop = 7;
+ gridLayout.marginWidth = 12;
+ gridLayout.numColumns = 2;
+ composite.setLayout(gridLayout);
+
+ Label catalogLocationLabel = new Label(composite, SWT.NONE);
+ catalogLocationLabel.setText(Messages.RemoteArchetypeCatalogDialog_lblCatalog);
+
+ catalogUrlCombo = new Combo(composite, SWT.NONE);
+ GridData gd_catalogLocationCombo = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_catalogLocationCombo.widthHint = 250;
+ catalogUrlCombo.setLayoutData(gd_catalogLocationCombo);
+ catalogUrlCombo.setItems(getSavedValues(KEY_LOCATIONS));
+
+ Label catalogDescriptionLabel = new Label(composite, SWT.NONE);
+ catalogDescriptionLabel.setText(Messages.RemoteArchetypeCatalogDialog_lblDesc);
+
+ catalogDescriptionText = new Text(composite, SWT.BORDER);
+ catalogDescriptionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ if(archetypeCatalogFactory!=null) {
+ catalogUrlCombo.setText(archetypeCatalogFactory.getId());
+ catalogDescriptionText.setText(archetypeCatalogFactory.getDescription());
+ }
+
+ ModifyListener modifyListener = new ModifyListener() {
+ public void modifyText(final ModifyEvent e) {
+ update();
+ }
+ };
+ catalogUrlCombo.addModifyListener(modifyListener);
+ catalogDescriptionText.addModifyListener(modifyListener);
+
+ return composite;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.TrayDialog#createButtonBar(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createButtonBar(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+ layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+ layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
+ layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ composite.setFont(parent.getFont());
+
+ // create help control if needed
+ if(isHelpAvailable()) {
+ createHelpControl(composite);
+ }
+
+ verifyButton = createButton(composite, VERIFY_ID, Messages.RemoteArchetypeCatalogDialog_btnVerify, false);
+ verifyButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ verifyButton.setEnabled(false);
+ String url = catalogUrlCombo.getText();
+ final RemoteCatalogFactory factory = new RemoteCatalogFactory(url, null, true);
+
+ new Job(Messages.RemoteArchetypeCatalogDialog_job_download) {
+ protected IStatus run(IProgressMonitor monitor) {
+ IStatus status = Status.OK_STATUS;
+ ArchetypeCatalog catalog = null;
+ try {
+ catalog = factory.getArchetypeCatalog();
+ } finally {
+ final IStatus s = status;
+ @SuppressWarnings("unchecked")
+ final List<Archetype> archetypes = catalog==null ? Collections.emptyList() : catalog.getArchetypes();
+ getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ verifyButton.setEnabled(true);
+ if(!s.isOK()) {
+ setErrorMessage(NLS.bind(Messages.RemoteArchetypeCatalogDialog_error_read,s.getMessage()));
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ } else if(archetypes.size()==0) {
+ setMessage(Messages.RemoteArchetypeCatalogDialog_error_empty, IStatus.WARNING);
+ } else {
+ setMessage(NLS.bind(Messages.RemoteArchetypeCatalogDialog_message_found, archetypes.size()), IStatus.INFO);
+ }
+ }
+ });
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ });
+
+ Label filler= new Label(composite, SWT.NONE);
+ filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
+ layout.numColumns++;
+
+ super.createButtonsForButtonBar(composite); // cancel button
+
+ return composite;
+ }
+
+ protected Button getButton(int id) {
+ return super.getButton(id);
+ }
+
+ private String[] getSavedValues(String key) {
+ String[] array = dialogSettings.getArray(key);
+ return array == null ? new String[0] : array;
+ }
+
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ shell.setText(title);
+ }
+
+ public void create() {
+ super.create();
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ getButton(VERIFY_ID).setEnabled(false);
+ }
+
+ protected void okPressed() {
+ String description = catalogDescriptionText.getText().trim();
+ String location = catalogUrlCombo.getText().trim();
+
+ archetypeCatalogFactory = new RemoteCatalogFactory(location, description, true);
+
+ saveValue(KEY_LOCATIONS, location);
+
+ super.okPressed();
+ }
+
+ public ArchetypeCatalogFactory getArchetypeCatalogFactory() {
+ return archetypeCatalogFactory;
+ }
+
+ private void saveValue(String key, String value) {
+ List<String> dirs = new ArrayList<String>();
+ dirs.addAll(Arrays.asList(getSavedValues(key)));
+
+ dirs.remove(value);
+ dirs.add(0, value);
+
+ if(dirs.size() > MAX_HISTORY) {
+ dirs = dirs.subList(0, MAX_HISTORY);
+ }
+
+ dialogSettings.put(key, dirs.toArray(new String[dirs.size()]));
+ }
+
+ void update() {
+ boolean isValid = isValid();
+ getButton(IDialogConstants.OK_ID).setEnabled(isValid);
+ getButton(VERIFY_ID).setEnabled(isValid);
+ }
+
+ private boolean isValid() {
+ setErrorMessage(null);
+ setMessage(null, IStatus.WARNING);
+
+
+ String url = catalogUrlCombo.getText().trim();
+ if(url.length()==0) {
+ setErrorMessage(Messages.RemoteArchetypeCatalogDialog_error_required);
+ verifyButton.setEnabled(false);
+ return false;
+ }
+
+ verifyButton.setEnabled(true);
+ return true;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/SimpleLifecycleMappingPropertyPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/SimpleLifecycleMappingPropertyPage.java
new file mode 100644
index 00000000..76f8df82
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/preferences/SimpleLifecycleMappingPropertyPage.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.preferences;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.m2e.core.ui.internal.lifecycle.AbstractLifecyclePropertyPage;
+
+
+/**
+ * Simple lifecycle mapping properties page that displays static text.
+ *
+ * @author igor
+ */
+public class SimpleLifecycleMappingPropertyPage extends AbstractLifecyclePropertyPage {
+
+ private String message;
+
+ public SimpleLifecycleMappingPropertyPage(String message) {
+ this.message = message;
+ }
+
+ public Control createContents(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(2, false));
+ composite.setLayoutData(new GridData(GridData.FILL));
+ Label noInfoLabel = new Label(composite, SWT.NONE);
+ noInfoLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true, 2, 1));
+ noInfoLabel.setAlignment(SWT.CENTER);
+ noInfoLabel.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
+ noInfoLabel.setData("name", "noInfoLabel"); //$NON-NLS-1$ //$NON-NLS-2$
+ noInfoLabel.setText(getMessage());
+ return composite;
+ }
+
+ protected String getMessage() {
+ return message;
+ }
+
+ public void performDefaults() {
+ }
+
+ public boolean performOk() {
+ return true;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/search/MavenSearchPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/search/MavenSearchPage.java
new file mode 100644
index 00000000..38cdb6f1
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/search/MavenSearchPage.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.search;
+
+import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.search.ui.ISearchPage;
+import org.eclipse.search.ui.ISearchPageContainer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+
+import org.eclipse.m2e.core.internal.Messages;
+
+/**
+ * Maven Search Page
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenSearchPage extends DialogPage implements ISearchPage {
+
+ private Table table;
+ private Combo classNameText;
+ private Combo sha1Text;
+ private Combo versionText;
+ private Combo packagingIdText;
+ private Combo artifactIdText;
+ private Combo groupIdText;
+
+ // private ISearchPageContainer container;
+
+ public MavenSearchPage() {
+ }
+
+ public MavenSearchPage(String title) {
+ super(title);
+ }
+
+ public MavenSearchPage(String title, ImageDescriptor image) {
+ super(title, image);
+ }
+
+ public void setContainer(ISearchPageContainer container) {
+ // this.container = container;
+ }
+
+ public boolean performAction() {
+ // TODO Auto-generated method performAction
+ return false;
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(3, false));
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ setControl(parent);
+
+ Label groupIdLabel = new Label(composite, SWT.NONE);
+ groupIdLabel.setText(Messages.MavenSearchPage_lblGroupid);
+
+ groupIdText = new Combo(composite, SWT.NONE);
+ groupIdText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+
+ Label artifactIdLabel = new Label(composite, SWT.NONE);
+ artifactIdLabel.setText(Messages.MavenSearchPage_lblArtifactid);
+
+ artifactIdText = new Combo(composite, SWT.NONE);
+ artifactIdText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+
+ Label versionLabel = new Label(composite, SWT.NONE);
+ versionLabel.setText(Messages.MavenSearchPage_lblVersion);
+
+ versionText = new Combo(composite, SWT.NONE);
+ versionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+
+ Label packagingIdLabel = new Label(composite, SWT.NONE);
+ packagingIdLabel.setText(Messages.MavenSearchPage_lblPackaging);
+
+ packagingIdText = new Combo(composite, SWT.NONE);
+ GridData packagingIdTextData = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+ packagingIdTextData.widthHint = 208;
+ packagingIdText.setLayoutData(packagingIdTextData);
+
+ Label sha1Label = new Label(composite, SWT.NONE);
+ sha1Label.setText(Messages.MavenSearchPage_lblSha);
+
+ sha1Text = new Combo(composite, SWT.NONE);
+ sha1Text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Button browseButton = new Button(composite, SWT.NONE);
+ browseButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ browseButton.setText(Messages.MavenSearchPage_btnBrowse);
+
+ Label classNameLabel = new Label(composite, SWT.NONE);
+ classNameLabel.setText(Messages.MavenSearchPage_lblClass);
+
+ classNameText = new Combo(composite, SWT.NONE);
+ classNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+
+ Label separator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
+ GridData separatorData = new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1);
+ separatorData.heightHint = 15;
+ separatorData.minimumHeight = 15;
+ separator.setLayoutData(separatorData);
+ separator.setText(Messages.MavenSearchPage_separator);
+
+ Label repositoriesLabel = new Label(composite, SWT.NONE);
+ repositoriesLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
+ repositoriesLabel.setText(Messages.MavenSearchPage_lblRepos);
+
+ CheckboxTableViewer tableViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
+ table = tableViewer.getTable();
+ table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2));
+
+ Button selectAllButton = new Button(composite, SWT.NONE);
+ selectAllButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ selectAllButton.setText(Messages.MavenSearchPage_btnSelect);
+ new Label(composite, SWT.NONE);
+
+ Button deselectAllButton = new Button(composite, SWT.NONE);
+ deselectAllButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ deselectAllButton.setText(Messages.MavenSearchPage_btnUnselect);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/search/MavenSearchResult.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/search/MavenSearchResult.java
new file mode 100644
index 00000000..a464aeea
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/search/MavenSearchResult.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.search;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.search.ui.ISearchQuery;
+import org.eclipse.search.ui.text.AbstractTextSearchResult;
+import org.eclipse.search.ui.text.IEditorMatchAdapter;
+import org.eclipse.search.ui.text.IFileMatchAdapter;
+
+/**
+ * Maven search result
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenSearchResult extends AbstractTextSearchResult {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.search.ui.ISearchResult#getQuery()
+ */
+ public ISearchQuery getQuery() {
+ // TODO Auto-generated method getQuery
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.search.ui.ISearchResult#getLabel()
+ */
+ public String getLabel() {
+ // TODO Auto-generated method getLabel
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.search.ui.ISearchResult#getImageDescriptor()
+ */
+ public ImageDescriptor getImageDescriptor() {
+ // TODO Auto-generated method getImageDescriptor
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.search.ui.ISearchResult#getTooltip()
+ */
+ public String getTooltip() {
+ // TODO Auto-generated method getTooltip
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchResult#getEditorMatchAdapter()
+ */
+ public IEditorMatchAdapter getEditorMatchAdapter() {
+ // TODO Auto-generated method getEditorMatchAdapter
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchResult#getFileMatchAdapter()
+ */
+ public IFileMatchAdapter getFileMatchAdapter() {
+ // TODO Auto-generated method getFileMatchAdapter
+ return null;
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/search/MavenSearchResultPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/search/MavenSearchResultPage.java
new file mode 100644
index 00000000..d0c28aae
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/search/MavenSearchResultPage.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.search;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.search.ui.text.AbstractTextSearchViewPage;
+import org.eclipse.ui.IMemento;
+
+/**
+ * Maven search result page
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenSearchResultPage extends AbstractTextSearchViewPage {
+
+ public MavenSearchResultPage() {
+ super(FLAG_LAYOUT_TREE | FLAG_LAYOUT_FLAT);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTableViewer(org.eclipse.jface.viewers.TableViewer)
+ */
+ protected void configureTableViewer(TableViewer viewer) {
+ // TODO Auto-generated method configureTableViewer
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTreeViewer(org.eclipse.jface.viewers.TreeViewer)
+ */
+ protected void configureTreeViewer(TreeViewer viewer) {
+ // TODO Auto-generated method configureTreeViewer
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#clear()
+ */
+ protected void clear() {
+ // TODO Auto-generated method clear
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#elementsChanged(java.lang.Object[])
+ */
+ protected void elementsChanged(Object[] objects) {
+ // TODO Auto-generated method elementsChanged
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#restoreState(org.eclipse.ui.IMemento)
+ */
+ public void restoreState(IMemento memento) {
+ super.restoreState(memento);
+
+ // TODO Auto-generated method restoreState
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#saveState(org.eclipse.ui.IMemento)
+ */
+ public void saveState(IMemento memento) {
+ super.saveState(memento);
+ // TODO Auto-generated method saveState
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java
new file mode 100644
index 00000000..08547ca7
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/MavenRepositoryView.java
@@ -0,0 +1,596 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.actions.BaseSelectionListenerAction;
+import org.eclipse.ui.part.DrillDownAdapter;
+import org.eclipse.ui.part.ViewPart;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.MaterializeAction;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.index.IndexListener;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.index.IndexedArtifactGroup;
+import org.eclipse.m2e.core.internal.index.NexusIndex;
+import org.eclipse.m2e.core.repository.IRepository;
+import org.eclipse.m2e.core.ui.internal.views.nodes.AbstractIndexedRepositoryNode;
+import org.eclipse.m2e.core.ui.internal.views.nodes.IArtifactNode;
+import org.eclipse.m2e.core.ui.internal.views.nodes.IndexedArtifactFileNode;
+import org.eclipse.m2e.core.ui.internal.views.nodes.LocalRepositoryNode;
+import org.eclipse.m2e.core.ui.internal.views.nodes.RepositoryNode;
+import org.eclipse.m2e.core.util.M2EUtils;
+
+
+/**
+ * Maven repository view
+ *
+ * @author dyocum
+ */
+public class MavenRepositoryView extends ViewPart {
+ private static final String ENABLE_FULL = Messages.MavenRepositoryView_enable_full;
+ private static final String ENABLED_FULL = Messages.MavenRepositoryView_enabled_full;
+ private static final String DISABLE_DETAILS = Messages.MavenRepositoryView_disable_details;
+ private static final String DISABLED_DETAILS = Messages.MavenRepositoryView_details_disabled;
+ private static final String ENABLE_MIN = Messages.MavenRepositoryView_enable_minimum;
+ private static final String ENABLED_MIN = Messages.MavenRepositoryView_minimum_enabled;
+
+ private IndexManager indexManager = MavenPlugin.getDefault().getIndexManager();
+
+ private IAction collapseAllAction;
+
+ private IAction reloadSettings;
+
+ BaseSelectionListenerAction openPomAction;
+
+ private BaseSelectionListenerAction updateAction;
+
+ private BaseSelectionListenerAction rebuildAction;
+
+ private DisableIndexAction disableAction;
+ private EnableMinIndexAction enableMinAction;
+ private EnableFullIndexAction enableFullAction;
+
+ private BaseSelectionListenerAction copyUrlAction;
+
+ private BaseSelectionListenerAction materializeProjectAction;
+
+ TreeViewer viewer;
+ private RepositoryViewContentProvider contentProvider;
+
+ private DrillDownAdapter drillDownAdapter;
+
+ private IndexListener indexListener;
+
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+
+ public void createPartControl(Composite parent) {
+ viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ contentProvider = new RepositoryViewContentProvider();
+ viewer.setContentProvider(contentProvider);
+ viewer.setLabelProvider(new RepositoryViewLabelProvider(viewer.getTree().getFont()));
+
+ viewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+
+ }
+ });
+ viewer.setInput(getViewSite());
+ drillDownAdapter = new DrillDownAdapter(viewer);
+
+ makeActions();
+ hookContextMenu();
+
+ viewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ openPomAction.run();
+ }
+ });
+
+ contributeToActionBars();
+ this.indexListener = new IndexListener() {
+
+ public void indexAdded(IRepository repository) {
+ refreshView();
+ }
+
+ public void indexChanged(IRepository repository) {
+ refreshView();
+ }
+
+ public void indexRemoved(IRepository repository) {
+ refreshView();
+ }
+
+ public void indexUpdating(IRepository repository){
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run(){
+ viewer.refresh(true);
+ }
+ });
+ }
+ };
+
+ indexManager.addIndexListener(this.indexListener);
+ }
+
+ private void hookContextMenu() {
+ MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ MavenRepositoryView.this.fillContextMenu(manager);
+ }
+ });
+
+ Menu menu = menuMgr.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(menuMgr, viewer);
+ }
+
+ private void contributeToActionBars() {
+ IActionBars bars = getViewSite().getActionBars();
+ fillLocalPullDown(bars.getMenuManager());
+ fillLocalToolBar(bars.getToolBarManager());
+ }
+
+ private void fillLocalPullDown(IMenuManager manager) {
+ manager.add(new Separator());
+ manager.add(collapseAllAction);
+ manager.add(reloadSettings);
+ }
+
+ protected List<AbstractIndexedRepositoryNode> getSelectedRepositoryNodes(List elements){
+ ArrayList<AbstractIndexedRepositoryNode> list = new ArrayList<AbstractIndexedRepositoryNode>();
+ if (elements != null) {
+ for(int i=0;i<elements.size();i++){
+ Object elem = elements.get(i);
+ if(elem instanceof AbstractIndexedRepositoryNode) {
+ list.add((AbstractIndexedRepositoryNode)elem);
+ }
+ }
+ }
+ return list;
+ }
+ protected List<IArtifactNode> getArtifactNodes(List elements){
+ if(elements == null || elements.size() == 0){
+ return null;
+ }
+ ArrayList<IArtifactNode> list = new ArrayList<IArtifactNode>();
+ for(int i=0;i<elements.size();i++){
+ Object elem = elements.get(i);
+ if(elem instanceof IArtifactNode){
+ IArtifactNode node = (IArtifactNode)elem;
+ list.add(node);
+ }
+ }
+ return list;
+ }
+ void fillContextMenu(IMenuManager manager) {
+ manager.add(openPomAction);
+ manager.add(copyUrlAction);
+ manager.add(materializeProjectAction);
+ manager.add(new Separator());
+ manager.add(updateAction);
+ manager.add(rebuildAction);
+ manager.add(new Separator());
+ manager.add(disableAction);
+ manager.add(enableMinAction);
+ manager.add(enableFullAction);
+// manager.add(deleteFromLocalAction);
+ manager.add(new Separator());
+ manager.add(collapseAllAction);
+ manager.add(new Separator());
+ drillDownAdapter.addNavigationActions(manager);
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ private void fillLocalToolBar(IToolBarManager manager) {
+ manager.add(new Separator());
+ manager.add(collapseAllAction);
+ manager.add(reloadSettings);
+ manager.add(new Separator());
+ drillDownAdapter.addNavigationActions(manager);
+ }
+
+ private void makeActions() {
+ collapseAllAction = new Action(Messages.MavenRepositoryView_btnCollapse) {
+ public void run() {
+ viewer.collapseAll();
+ }
+ };
+ collapseAllAction.setToolTipText(Messages.MavenRepositoryView_btnCollapse_tooltip);
+ collapseAllAction.setImageDescriptor(MavenImages.COLLAPSE_ALL);
+ reloadSettings = new Action(Messages.MavenRepositoryView_action_reload){
+ public void run(){
+ String msg = Messages.MavenRepositoryView_reload_msg;
+ boolean res = MessageDialog.openConfirm(getViewSite().getShell(), //
+ Messages.MavenRepositoryView_reload_title, msg);
+ if(res){
+ Job job = new WorkspaceJob(Messages.MavenRepositoryView_job_reloading) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ try {
+ MavenPlugin.getDefault().getMaven().reloadSettings();
+ } catch(CoreException ex) {
+ return ex.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ job.schedule();
+ }
+ }
+ };
+
+ reloadSettings.setImageDescriptor(MavenImages.REFRESH);
+// deleteFromLocalAction = new BaseSelectionListenerAction("Delete from Repository") {
+// public void run() {
+// List<IArtifactNode> nodes = getArtifactNodes(getStructuredSelection().toList());
+// if(nodes != null){
+// for(IArtifactNode node : nodes){
+// String key = node.getDocumentKey();
+// System.out.println("key: "+key);
+// ((NexusIndexManager)MavenPlugin.getDefault().getIndexManager()).removeDocument("local", null, key);
+// }
+// }
+// }
+//
+// protected boolean updateSelection(IStructuredSelection selection) {
+// List<IArtifactNode> nodes = getArtifactNodes(getStructuredSelection().toList());
+// return (nodes != null && nodes.size() > 0);
+// }
+// };
+// deleteFromLocalAction.setToolTipText("Delete the selected GAV from the local repository");
+ //updateAction.setImageDescriptor(MavenImages.UPD_INDEX);
+
+
+ updateAction = new BaseSelectionListenerAction(Messages.MavenRepositoryView_action_update) {
+ public void run() {
+ List<AbstractIndexedRepositoryNode> nodes = getSelectedRepositoryNodes(getStructuredSelection().toList());
+ for(AbstractIndexedRepositoryNode node : nodes) {
+ if (node instanceof RepositoryNode) {
+ ((RepositoryNode) node).getIndex().scheduleIndexUpdate(false);
+ }
+ }
+ }
+
+ protected boolean updateSelection(IStructuredSelection selection) {
+ int indexCount = 0;
+ for (AbstractIndexedRepositoryNode node : getSelectedRepositoryNodes(selection.toList())) {
+ if (node instanceof RepositoryNode && node.isEnabledIndex()) {
+ indexCount ++;
+ }
+ }
+ if(indexCount > 1){
+ setText(Messages.MavenRepositoryView_update_more);
+ } else {
+ setText(Messages.MavenRepositoryView_update_one);
+ }
+ return indexCount > 0;
+ }
+ };
+ updateAction.setToolTipText(Messages.MavenRepositoryView_btnUpdate_tooltip);
+ updateAction.setImageDescriptor(MavenImages.UPD_INDEX);
+
+ rebuildAction = new BaseSelectionListenerAction(Messages.MavenRepositoryView_action_rebuild) {
+ public void run() {
+ List<AbstractIndexedRepositoryNode> nodes = getSelectedRepositoryNodes(getStructuredSelection().toList());
+ if(nodes.size() > 0){
+ if(nodes.size() == 1){
+ NexusIndex index = nodes.get(0).getIndex();
+ if (index != null) {
+ String repositoryUrl = index.getRepositoryUrl();
+ String msg = NLS.bind(Messages.MavenRepositoryView_rebuild_msg, repositoryUrl);
+ boolean res = MessageDialog.openConfirm(getViewSite().getShell(), //
+ Messages.MavenRepositoryView_rebuild_title, msg);
+ if(res) {
+ index.scheduleIndexUpdate(true);
+ }
+ }
+ } else {
+ String msg = Messages.MavenRepositoryView_rebuild_msg2;
+ boolean res = MessageDialog.openConfirm(getViewSite().getShell(), //
+ Messages.MavenRepositoryView_rebuild_title2, msg);
+ if(res) {
+ for(AbstractIndexedRepositoryNode node : nodes){
+ NexusIndex index = node.getIndex();
+ if (index != null) {
+ index.scheduleIndexUpdate(true);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ protected boolean updateSelection(IStructuredSelection selection) {
+ int indexCount = 0;
+ for (AbstractIndexedRepositoryNode node : getSelectedRepositoryNodes(selection.toList())) {
+ if ((node instanceof LocalRepositoryNode) || node.isEnabledIndex()) {
+ indexCount ++;
+ }
+ }
+ if(indexCount > 1){
+ setText(Messages.MavenRepositoryView_rebuild_many);
+ } else {
+ setText(Messages.MavenRepositoryView_rebuild_one);
+ }
+ return indexCount > 0;
+ }
+ };
+
+ rebuildAction.setToolTipText(Messages.MavenRepositoryView_action_rebuild_tooltip);
+ rebuildAction.setImageDescriptor(MavenImages.REBUILD_INDEX);
+
+ disableAction = new DisableIndexAction();
+
+ disableAction.setToolTipText(Messages.MavenRepositoryView_action_disable_tooltip);
+ disableAction.setImageDescriptor(MavenImages.REBUILD_INDEX);
+
+ enableMinAction = new EnableMinIndexAction();
+ enableMinAction.setToolTipText(Messages.MavenRepositoryView_action_enable_tooltip);
+ enableMinAction.setImageDescriptor(MavenImages.REBUILD_INDEX);
+
+ enableFullAction = new EnableFullIndexAction();
+ enableFullAction.setToolTipText(Messages.MavenRepositoryView_action_enableFull_tooltip);
+ enableFullAction.setImageDescriptor(MavenImages.REBUILD_INDEX);
+
+ openPomAction = new BaseSelectionListenerAction(Messages.MavenRepositoryView_action_open) {
+ public void run() {
+ ISelection selection = viewer.getSelection();
+ Object element = ((IStructuredSelection) selection).getFirstElement();
+ if(element instanceof IndexedArtifactFileNode) {
+ IndexedArtifactFile f = ((IndexedArtifactFileNode) element).getIndexedArtifactFile();
+ OpenPomAction.openEditor(f.group, f.artifact, f.version, null);
+ }
+ }
+
+ protected boolean updateSelection(IStructuredSelection selection) {
+ return selection.getFirstElement() instanceof IndexedArtifactFile;
+ }
+ };
+ openPomAction.setToolTipText(Messages.MavenRepositoryView_action_open_tooltip);
+ openPomAction.setImageDescriptor(MavenImages.POM);
+
+ copyUrlAction = new BaseSelectionListenerAction(Messages.MavenRepositoryView_action_copy) {
+ public void run() {
+ Object element = getStructuredSelection().getFirstElement();
+ String url = null;
+ if(element instanceof RepositoryNode) {
+ url = ((RepositoryNode) element).getRepositoryUrl();
+ } else if(element instanceof IndexedArtifactGroup) {
+ IndexedArtifactGroup group = (IndexedArtifactGroup) element;
+ String repositoryUrl = group.getRepository().getUrl();
+ if(!repositoryUrl.endsWith("/")) { //$NON-NLS-1$
+ repositoryUrl += "/"; //$NON-NLS-1$
+ }
+ url = repositoryUrl + group.getPrefix().replace('.', '/');
+ } else if(element instanceof IndexedArtifact) {
+ //
+ } else if(element instanceof IndexedArtifactFile) {
+ //
+ }
+ if(url != null) {
+ Clipboard clipboard = new Clipboard(Display.getCurrent());
+ clipboard.setContents(new String[] {url}, new Transfer[] {TextTransfer.getInstance()});
+ clipboard.dispose();
+ }
+ }
+
+ protected boolean updateSelection(IStructuredSelection selection) {
+ Object element = selection.getFirstElement();
+ return element instanceof RepositoryNode;
+ }
+ };
+ copyUrlAction.setToolTipText(Messages.MavenRepositoryView_action_copy_tooltip);
+ copyUrlAction.setImageDescriptor(MavenImages.COPY);
+
+ materializeProjectAction = new BaseSelectionListenerAction(Messages.MavenRepositoryView_action_materialize) {
+ public void run() {
+ Object element = getStructuredSelection().getFirstElement();
+ if(element instanceof IndexedArtifactFileNode){
+ MaterializeAction action = new MaterializeAction();
+ StructuredSelection sel = new StructuredSelection(new Object[]{((IndexedArtifactFileNode) element).getIndexedArtifactFile()});
+ action.selectionChanged(this, sel);
+ action.run(this);
+ }
+ }
+
+ protected boolean updateSelection(IStructuredSelection selection) {
+ return selection.getFirstElement() instanceof IndexedArtifactFileNode;
+ }
+ };
+ materializeProjectAction.setImageDescriptor(MavenImages.IMPORT_PROJECT);
+
+ viewer.addSelectionChangedListener(openPomAction);
+ viewer.addSelectionChangedListener(updateAction);
+ viewer.addSelectionChangedListener(disableAction);
+ viewer.addSelectionChangedListener(enableMinAction);
+ viewer.addSelectionChangedListener(enableFullAction);
+ viewer.addSelectionChangedListener(rebuildAction);
+ viewer.addSelectionChangedListener(copyUrlAction);
+ viewer.addSelectionChangedListener(materializeProjectAction);
+ }
+
+ protected void setIndexDetails(AbstractIndexedRepositoryNode node, String details) {
+ if (node != null && node.getIndex() != null) {
+ try {
+ node.getIndex().setIndexDetails(details);
+ } catch(CoreException ex) {
+ M2EUtils.showErrorDialog(this.getViewSite().getShell(), Messages.MavenRepositoryView_error_title, Messages.MavenRepositoryView_error_message, ex);
+ }
+ }
+ }
+
+ protected AbstractIndexedRepositoryNode getSelectedRepositoryNode(IStructuredSelection selection) {
+ List elements = selection.toList();
+ if (elements.size() != 1) {
+ return null;
+ }
+ Object element = elements.get(0);
+ return element instanceof AbstractIndexedRepositoryNode? (AbstractIndexedRepositoryNode) element: null;
+ }
+
+ public void dispose() {
+ viewer.removeSelectionChangedListener(materializeProjectAction);
+ viewer.removeSelectionChangedListener(copyUrlAction);
+ viewer.removeSelectionChangedListener(rebuildAction);
+ viewer.removeSelectionChangedListener(disableAction);
+ viewer.removeSelectionChangedListener(enableMinAction);
+ viewer.removeSelectionChangedListener(enableFullAction);
+ viewer.removeSelectionChangedListener(updateAction);
+ viewer.removeSelectionChangedListener(openPomAction);
+ indexManager.removeIndexListener(this.indexListener);
+ super.dispose();
+ }
+
+ void refreshView() {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ Object[] expandedElems = viewer.getExpandedElements();
+ if (!viewer.getControl().isDisposed()) {
+ viewer.setInput(getViewSite());
+ if(expandedElems != null && expandedElems.length > 0){
+ viewer.setExpandedElements(expandedElems);
+ }
+ }
+ }
+ });
+ };
+
+ /**
+ * Base Selection Listener does not allow the style (radio button/check) to be set.
+ * This base class listens to selections and sets the appropriate index value
+ * depending on its value
+ * AbstractIndexAction
+ *
+ * @author dyocum
+ */
+ abstract class AbstractIndexAction extends Action implements ISelectionChangedListener{
+
+ protected abstract String getDetailsValue();
+ protected abstract String getActionText();
+
+ public AbstractIndexAction(String text, int style){
+ super(text, style);
+ }
+
+ public void run() {
+ IStructuredSelection sel = (IStructuredSelection)viewer.getSelection();
+ setIndexDetails(getSelectedRepositoryNode(sel), getDetailsValue());
+ }
+
+ /*
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection sel = (IStructuredSelection)event.getSelection();
+ updateSelection(sel);
+ }
+
+ protected void updateSelection(IStructuredSelection selection) {
+ AbstractIndexedRepositoryNode node = getSelectedRepositoryNode(selection);
+ updateIndexDetails(node);
+ setText(getActionText());
+ boolean enabled = (node != null && node instanceof RepositoryNode);
+ this.setEnabled(enabled);
+ }
+
+ protected void updateIndexDetails(AbstractIndexedRepositoryNode node){
+ if(node == null || node.getIndex() == null){
+ return;
+ }
+ NexusIndex index = node.getIndex();
+ setChecked(getDetailsValue().equals(index.getIndexDetails()));
+ }
+
+ }
+
+ class DisableIndexAction extends AbstractIndexAction {
+ public DisableIndexAction(){
+ super(DISABLE_DETAILS, IAction.AS_CHECK_BOX);
+ }
+
+ protected String getDetailsValue(){
+ return NexusIndex.DETAILS_DISABLED;
+ }
+ protected String getActionText(){
+ return isChecked() ? DISABLED_DETAILS : DISABLE_DETAILS;
+ }
+ }
+
+ class EnableMinIndexAction extends AbstractIndexAction {
+ public EnableMinIndexAction(){
+ super(ENABLE_MIN, IAction.AS_CHECK_BOX);
+ }
+
+ protected String getDetailsValue(){
+ return NexusIndex.DETAILS_MIN;
+ }
+ protected String getActionText(){
+ return isChecked() ? ENABLED_MIN : ENABLE_MIN;
+ }
+ }
+
+ class EnableFullIndexAction extends AbstractIndexAction {
+ public EnableFullIndexAction(){
+ super(ENABLE_FULL, IAction.AS_CHECK_BOX);
+ }
+
+ protected String getDetailsValue(){
+ return NexusIndex.DETAILS_FULL;
+ }
+ protected String getActionText(){
+ return isChecked() ? ENABLED_FULL : ENABLE_FULL;
+ }
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewContentProvider.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewContentProvider.java
new file mode 100644
index 00000000..9a0b3fe0
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewContentProvider.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.IViewSite;
+
+import org.eclipse.m2e.core.ui.internal.views.nodes.CustomRepositoriesNode;
+import org.eclipse.m2e.core.ui.internal.views.nodes.GlobalRepositoriesNode;
+import org.eclipse.m2e.core.ui.internal.views.nodes.IMavenRepositoryNode;
+import org.eclipse.m2e.core.ui.internal.views.nodes.LocalRepositoryRootNode;
+import org.eclipse.m2e.core.ui.internal.views.nodes.ProjectRepositoriesNode;
+
+/**
+ * RepositoryViewContentProvider
+ *
+ * @author dyocum
+ */
+public class RepositoryViewContentProvider implements IStructuredContentProvider, ITreeContentProvider {
+
+ private LocalRepositoryRootNode localNode;
+ private GlobalRepositoriesNode globalNode;
+ private ProjectRepositoriesNode projectNode;
+ private CustomRepositoriesNode customNode;
+
+ public RepositoryViewContentProvider() {
+ }
+
+ public void inputChanged(Viewer v, Object oldInput, Object newInput) {
+ }
+
+ public void dispose() {
+ }
+
+ public Object[] getElements(Object parent) {
+ return getChildren(parent);
+ }
+
+ public Object getParent(Object child) {
+ return null;
+ }
+
+ public boolean hasChildren(Object parent) {
+ if(parent instanceof IMavenRepositoryNode){
+ return ((IMavenRepositoryNode)parent).hasChildren();
+ }
+ return false;
+ }
+
+ public Object[] getRootNodes(){
+ if(localNode == null){
+ localNode = new LocalRepositoryRootNode();
+
+ }
+ if(globalNode == null){
+ globalNode = new GlobalRepositoriesNode();
+ }
+ if(projectNode == null) {
+ projectNode = new ProjectRepositoriesNode();
+ }
+ if(customNode == null) {
+ customNode = new CustomRepositoriesNode();
+ }
+ return new Object[]{localNode, globalNode, projectNode, customNode};
+ }
+
+ public Object[] getChildren(Object parent) {
+ if(parent instanceof IViewSite){
+ return getRootNodes();
+ } else if(parent instanceof IMavenRepositoryNode){
+ return ((IMavenRepositoryNode)parent).getChildren();
+ }
+ return new Object[0];
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewLabelProvider.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewLabelProvider.java
new file mode 100644
index 00000000..0ac86c34
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/RepositoryViewLabelProvider.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views;
+
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.IFontProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+
+import org.eclipse.m2e.core.ui.internal.views.nodes.IMavenRepositoryNode;
+import org.eclipse.m2e.core.ui.internal.views.nodes.RepositoryNode;
+import org.eclipse.m2e.core.util.M2EUtils;
+
+/**
+ * RepositoryViewLabelProvider
+ *
+ * @author dyocum
+ */
+public class RepositoryViewLabelProvider extends LabelProvider implements IColorProvider, IFontProvider {
+
+ private Font italicFont;
+ public RepositoryViewLabelProvider(Font treeFont){
+ int size = 0;
+ FontData[] data = treeFont.getFontData();
+ if(data == null){
+ size = 12;
+ } else {
+ for(int i=0;i<data.length;i++){
+ size = Math.max(size, data[i].getHeight());
+ }
+ }
+ italicFont = M2EUtils.deriveFont(treeFont, SWT.ITALIC, size);
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.BaseLabelProvider#dispose()
+ */
+ public void dispose() {
+ italicFont.dispose();
+ super.dispose();
+ }
+
+
+ public String getText(Object obj) {
+ if(obj instanceof IMavenRepositoryNode){
+ return ((IMavenRepositoryNode)obj).getName();
+ }
+ return obj.toString();
+ }
+
+ public Image getImage(Object obj) {
+ if(obj instanceof IMavenRepositoryNode){
+ return ((IMavenRepositoryNode)obj).getImage();
+ }
+ return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
+ }
+
+ public Color getBackground(Object element) {
+ return null;
+ }
+
+ public Color getForeground(Object element) {
+ if(element instanceof RepositoryNode){
+ if(((RepositoryNode)element).isEnabledIndex()){
+ return Display.getDefault().getSystemColor(SWT.COLOR_BLACK);
+ }
+ return Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
+ }
+ return Display.getDefault().getSystemColor(SWT.COLOR_BLACK);
+ }
+
+ public Font getFont(Object element) {
+ if(element instanceof IMavenRepositoryNode){
+ boolean updating = ((IMavenRepositoryNode)element).isUpdating();
+ return updating ? italicFont : null;
+ }
+ return null;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractIndexedRepositoryNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractIndexedRepositoryNode.java
new file mode 100644
index 00000000..a6fb9f55
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractIndexedRepositoryNode.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+import java.util.Arrays;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.graphics.Image;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.index.IndexedArtifactGroup;
+import org.eclipse.m2e.core.internal.index.NexusIndex;
+
+
+/**
+ * AbstractIndexedRepository
+ *
+ * @author igor
+ */
+public abstract class AbstractIndexedRepositoryNode implements IMavenRepositoryNode {
+
+ protected static final Object[] NO_CHILDREN = new Object[0];
+
+ protected final NexusIndex index;
+
+ protected AbstractIndexedRepositoryNode(NexusIndex index) {
+ this.index = index;
+ }
+
+ public Object[] getChildren() {
+
+ if(index == null) {
+ return NO_CHILDREN;
+ }
+
+ try {
+ IndexedArtifactGroup[] rootGroups = index.getRootIndexedArtifactGroups();
+ if(rootGroups == null) {
+ return NO_CHILDREN;
+ }
+ IndexedArtifactGroupNode[] children = new IndexedArtifactGroupNode[rootGroups.length];
+ Arrays.sort(rootGroups);
+ for(int i = 0; i < rootGroups.length; i++ ) {
+ children[i] = new IndexedArtifactGroupNode(rootGroups[i]);
+ }
+ return children;
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ return NO_CHILDREN;
+ }
+ }
+
+ public Image getImage() {
+ return MavenImages.IMG_INDEX;
+ }
+
+ public boolean hasChildren() {
+ return index != null;
+ }
+
+ public boolean isUpdating() {
+ return index != null && index.isUpdating();
+ }
+
+ public NexusIndex getIndex() {
+ return index;
+ }
+
+ public String getRepositoryUrl() {
+ return index.getRepositoryUrl();
+ }
+
+ public boolean isEnabledIndex() {
+ return index != null && index.isEnabled();
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java
new file mode 100644
index 00000000..bb80d447
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/AbstractRepositoriesNode.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.graphics.Image;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.internal.index.NexusIndex;
+import org.eclipse.m2e.core.internal.index.NexusIndexManager;
+import org.eclipse.m2e.core.repository.IRepository;
+import org.eclipse.m2e.core.repository.IRepositoryRegistry;
+
+/**
+ * AbstractRepositoriesNode
+ *
+ * @author igor
+ */
+public abstract class AbstractRepositoriesNode implements IMavenRepositoryNode {
+
+ protected final NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getDefault().getIndexManager();
+ protected final IRepositoryRegistry repositoryRegistry = MavenPlugin.getDefault().getRepositoryRegistry();
+
+ public Object[] getChildren() {
+
+ ArrayList<Object> mirrorNodes = new ArrayList<Object>();
+ ArrayList<Object> globalRepoNodes = new ArrayList<Object>();
+
+ for (IRepository repo : getRepositories()) {
+ NexusIndex index = indexManager.getIndex(repo);
+ RepositoryNode node = new RepositoryNode(index);
+ if (repo.getMirrorOf() != null) {
+ mirrorNodes.add(node);
+ } else {
+ globalRepoNodes.add(node);
+ }
+ }
+
+ ArrayList<Object> nodes = new ArrayList<Object>();
+ nodes.addAll(mirrorNodes);
+ nodes.addAll(globalRepoNodes);
+
+ return nodes.toArray(new Object[nodes.size()]);
+ }
+
+ protected abstract List<IRepository> getRepositories();
+
+ public String toString() {
+ return getName();
+ }
+
+ public boolean hasChildren() {
+ Object[] kids = getChildren();
+ return kids != null && kids.length > 0;
+ }
+
+ public Image getImage() {
+ return MavenImages.IMG_INDEXES;
+ }
+
+ public boolean isUpdating() {
+ return false;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/CustomRepositoriesNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/CustomRepositoriesNode.java
new file mode 100644
index 00000000..678dcbdd
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/CustomRepositoriesNode.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+import java.util.List;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.repository.IRepository;
+import org.eclipse.m2e.core.repository.IRepositoryRegistry;
+
+/**
+ * CustomRepositoriesNode
+ *
+ * @author igor
+ */
+public class CustomRepositoriesNode extends AbstractRepositoriesNode {
+
+ protected List<IRepository> getRepositories() {
+ return repositoryRegistry.getRepositories(IRepositoryRegistry.SCOPE_UNKNOWN);
+ }
+
+ public String getName() {
+ return Messages.CustomRepositoriesNode_name;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/GlobalRepositoriesNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/GlobalRepositoriesNode.java
new file mode 100644
index 00000000..7eef0deb
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/GlobalRepositoriesNode.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+import java.util.List;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.repository.IRepository;
+import org.eclipse.m2e.core.repository.IRepositoryRegistry;
+
+
+/**
+ * Parent node for all artifact repositories and mirrors defined in settings.xml.
+ *
+ * @author dyocum
+ */
+public class GlobalRepositoriesNode extends AbstractRepositoriesNode {
+
+ public String getName() {
+ return Messages.GlobalRepositoriesNode_name;
+ }
+
+ protected List<IRepository> getRepositories() {
+ return repositoryRegistry.getRepositories(IRepositoryRegistry.SCOPE_SETTINGS);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IArtifactNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IArtifactNode.java
new file mode 100644
index 00000000..54c908fb
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IArtifactNode.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+
+/**
+ * AbstractArtifactNode
+ *
+ * @author dyocum
+ */
+public interface IArtifactNode {
+ public String getDocumentKey();
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IMavenRepositoryNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IMavenRepositoryNode.java
new file mode 100644
index 00000000..b296ca7f
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IMavenRepositoryNode.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * MavenRepositoryRootNode
+ *
+ * @author dyocum
+ */
+public interface IMavenRepositoryNode {
+
+ public Object[] getChildren();
+ public String getName();
+ public Image getImage();
+ public boolean hasChildren();
+ public boolean isUpdating();
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactFileNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactFileNode.java
new file mode 100644
index 00000000..4f9d5702
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactFileNode.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+import org.eclipse.swt.graphics.Image;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.internal.index.NexusIndexManager;
+
+/**
+ * IndexedArtifactFileNode
+ *
+ * @author dyocum
+ */
+public class IndexedArtifactFileNode implements IMavenRepositoryNode, IArtifactNode {
+
+ private IndexedArtifactFile artifactFile;
+
+ public IndexedArtifactFileNode(IndexedArtifactFile artifactFile){
+ this.artifactFile = artifactFile;
+ }
+
+ public IndexedArtifactFile getIndexedArtifactFile(){
+ return this.artifactFile;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.IMavenRepositoryNode#getChildren()
+ */
+ public Object[] getChildren() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.IMavenRepositoryNode#getName()
+ */
+ public String getName() {
+ String label = artifactFile.artifact;
+ if(artifactFile.classifier != null) {
+ label += " : " + artifactFile.classifier; //$NON-NLS-1$
+ }
+ if(artifactFile.version != null) {
+ label += " : " + artifactFile.version; //$NON-NLS-1$
+ }
+ return label;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.IMavenRepositoryNode#hasChildren()
+ */
+ public boolean hasChildren() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.nodes.IMavenRepositoryNode#getImage()
+ */
+ public Image getImage() {
+ if(artifactFile.sourcesExists == IIndex.PRESENT) {
+ return MavenImages.IMG_VERSION_SRC;
+ }
+ return MavenImages.IMG_VERSION;
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.nodes.IArtifactNode#getDocumentKey()
+ */
+ public String getDocumentKey() {
+ return NexusIndexManager.getDocumentKey(artifactFile.getArtifactKey());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.nodes.IMavenRepositoryNode#isUpdating()
+ */
+ public boolean isUpdating() {
+ return false;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java
new file mode 100644
index 00000000..28f5b5c4
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactGroupNode.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.internal.index.IndexedArtifactGroup;
+import org.eclipse.m2e.core.internal.index.NexusIndexManager;
+
+/**
+ * IndexedArtifactGroupNode
+ *
+ * @author dyocum
+ */
+public class IndexedArtifactGroupNode implements IMavenRepositoryNode, IArtifactNode {
+
+ private IndexedArtifactGroup indexedArtifactGroup;
+ private Object[] kids = null;
+ public IndexedArtifactGroupNode(IndexedArtifactGroup group){
+ this.indexedArtifactGroup = group;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.IMavenRepositoryNode#getChildren()
+ */
+ public Object[] getChildren() {
+ NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getDefault().getIndexManager();
+
+ IndexedArtifactGroup resolvedGroup = indexManager.resolveGroup(indexedArtifactGroup);
+ //IndexedArtifactGroup resolvedGroup = indexedArtifactGroup;
+ ArrayList<Object> results = new ArrayList<Object>();
+ Collection<IndexedArtifactGroup> groups = resolvedGroup.getNodes().values();
+ for(IndexedArtifactGroup group : groups){
+ IndexedArtifactGroupNode node = new IndexedArtifactGroupNode(group);
+ results.add(node);
+ }
+
+ Collection<IndexedArtifact> artifacts = resolvedGroup.getFiles().values(); // IndexedArtifact
+ for(IndexedArtifact artifact : artifacts){
+ IndexedArtifactNode artifactNode = new IndexedArtifactNode(artifact);
+ results.add(artifactNode);
+ }
+ kids = results.toArray(new Object[results.size()]);
+ return kids;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.IMavenRepositoryNode#getName()
+ */
+ public String getName() {
+ String prefix = indexedArtifactGroup.getPrefix();
+ int n = prefix.lastIndexOf('.');
+ return n < 0 ? prefix : prefix.substring(n + 1);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.IMavenRepositoryNode#hasChildren()
+ */
+ public boolean hasChildren() {
+// if(kids == null){
+// kids = getChildren();
+// }
+// return kids != null && kids.length > 0;
+ return true;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.nodes.IMavenRepositoryNode#getImage()
+ */
+ public Image getImage() {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.nodes.IArtifactNode#getDocumentKey()
+ */
+ public String getDocumentKey() {
+ return indexedArtifactGroup.getPrefix();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.nodes.IMavenRepositoryNode#isUpdating()
+ */
+ public boolean isUpdating() {
+ // TODO Auto-generated method isUpdating
+ return false;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactNode.java
new file mode 100644
index 00000000..23c3a8e0
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/IndexedArtifactNode.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+import java.util.ArrayList;
+import java.util.Set;
+
+import org.eclipse.swt.graphics.Image;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.internal.Messages;
+
+/**
+ * IndexedArtifactNode
+ *
+ * @author dyocum
+ */
+public class IndexedArtifactNode implements IMavenRepositoryNode, IArtifactNode {
+
+ private IndexedArtifact artifact;
+ private Object[] kids = null;
+ public IndexedArtifactNode(IndexedArtifact artifact){
+ this.artifact = artifact;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.IMavenRepositoryNode#getChildren()
+ */
+ public Object[] getChildren() {
+ Set<IndexedArtifactFile> files = artifact.getFiles();
+ if(files == null){
+ return new Object[0];
+ }
+ ArrayList<Object> fileList = new ArrayList<Object>();
+ for(IndexedArtifactFile iaf : files){
+ fileList.add(new IndexedArtifactFileNode(iaf));
+ }
+ kids = fileList.toArray(new IndexedArtifactFileNode[fileList.size()]);
+ return kids;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.IMavenRepositoryNode#getName()
+ */
+ public String getName() {
+ // return a.group + ":" + a.artifact;
+ String pkg = artifact.getPackaging();
+ if(pkg == null){
+ pkg = Messages.IndexedArtifactNode_no_pack;
+ }
+ return artifact.getArtifactId() + " - " + pkg; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.IMavenRepositoryNode#hasChildren()
+ */
+ public boolean hasChildren() {
+ //return kids != null && kids.length > 0;
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.nodes.IMavenRepositoryNode#getImage()
+ */
+ public Image getImage() {
+ return MavenImages.IMG_JAR;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.nodes.IArtifactNode#getDocumentKey()
+ */
+ public String getDocumentKey() {
+ return artifact.getArtifactId();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.ui.internal.views.nodes.IMavenRepositoryNode#isUpdating()
+ */
+ public boolean isUpdating() {
+ // TODO Auto-generated method isUpdating
+ return false;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryNode.java
new file mode 100644
index 00000000..e46218be
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryNode.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.index.NexusIndex;
+import org.eclipse.m2e.core.repository.IRepository;
+
+/**
+ * LocalRepositoryNode
+ *
+ * @author igor
+ */
+public class LocalRepositoryNode extends AbstractIndexedRepositoryNode {
+
+ public LocalRepositoryNode(NexusIndex index) {
+ super(index);
+ }
+
+ public String getName() {
+ IRepository repository = index.getRepository();
+ StringBuilder sb = new StringBuilder();
+ sb.append(Messages.LocalRepositoryNode_local);
+ if (repository.getBasedir() != null) {
+ sb.append(" (").append(repository.getBasedir().getAbsolutePath()).append(')'); //$NON-NLS-1$
+ }
+ return sb.toString();
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java
new file mode 100644
index 00000000..69b6bb17
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/LocalRepositoryRootNode.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+import org.eclipse.swt.graphics.Image;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.index.NexusIndex;
+import org.eclipse.m2e.core.internal.index.NexusIndexManager;
+
+/**
+ * LocalRepositoryNode
+ *
+ * @author dyocum
+ */
+public class LocalRepositoryRootNode implements IMavenRepositoryNode{
+
+ public Object[] getChildren() {
+ NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getDefault().getIndexManager();
+ NexusIndex localIndex = indexManager.getLocalIndex();
+ NexusIndex workspaceIndex = indexManager.getWorkspaceIndex();
+ return new Object[]{
+ new LocalRepositoryNode(localIndex),
+ new WorkspaceRepositoryNode(workspaceIndex)
+ };
+ }
+
+ public String getName() {
+ return Messages.LocalRepositoryRootNode_name;
+ }
+
+ public boolean hasChildren() {
+ return true;
+ }
+
+ public Image getImage() {
+ return MavenImages.IMG_INDEXES;
+ }
+
+ public boolean isUpdating() {
+ return false;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java
new file mode 100644
index 00000000..2c96cc27
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/ProjectRepositoriesNode.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+import java.util.ArrayList;
+
+import org.eclipse.swt.graphics.Image;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.index.NexusIndex;
+import org.eclipse.m2e.core.internal.index.NexusIndexManager;
+import org.eclipse.m2e.core.repository.IRepository;
+import org.eclipse.m2e.core.repository.IRepositoryRegistry;
+
+
+/**
+ * Parent node for all artifact repositories configured in pom.xml files.
+ */
+public class ProjectRepositoriesNode implements IMavenRepositoryNode {
+
+ private NexusIndexManager indexManager = (NexusIndexManager) MavenPlugin.getDefault().getIndexManager();
+ private IRepositoryRegistry repositoryRegistry = MavenPlugin.getDefault().getRepositoryRegistry();
+
+ public Object[] getChildren() {
+ ArrayList<Object> nodes = new ArrayList<Object>();
+ for(IRepository repo : repositoryRegistry.getRepositories(IRepositoryRegistry.SCOPE_PROJECT)) {
+ NexusIndex index = indexManager.getIndex(repo);
+ RepositoryNode node = new RepositoryNode(index);
+ nodes.add(node);
+ }
+ return nodes.toArray(new Object[nodes.size()]);
+ }
+
+ public Image getImage() {
+ return MavenImages.IMG_INDEXES;
+ }
+
+ public String getName() {
+ return Messages.ProjectRepositoriesNode_name;
+ }
+
+ public String toString() {
+ return getName();
+ }
+
+ public boolean hasChildren() {
+ Object[] kids = getChildren();
+ return kids != null && kids.length > 0;
+ }
+
+ public boolean isUpdating() {
+ return false;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/RepositoryNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/RepositoryNode.java
new file mode 100644
index 00000000..849df8bf
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/RepositoryNode.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.index.NexusIndex;
+import org.eclipse.m2e.core.repository.IRepository;
+
+/**
+ * LocalRepsoitoryNode
+ *
+ * @author dyocum
+ */
+public class RepositoryNode extends AbstractIndexedRepositoryNode {
+
+ private final IRepository repository;
+
+ public RepositoryNode(NexusIndex index){
+ super(index);
+ this.repository = index.getRepository();
+ }
+
+ public String getName() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(repository.getId());
+ sb.append(" (").append(repository.getUrl()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (repository.getMirrorOf() != null) {
+ sb.append(" [mirrorOf=").append(repository.getMirrorOf()).append("]"); //$NON-NLS-2$
+ }
+ if (repository.getMirrorId() != null) {
+ sb.append(" [mirrored by ").append(repository.getMirrorId()).append("]"); //$NON-NLS-2$
+ }
+ if (isUpdating()) {
+ sb.append(Messages.RepositoryNode_updating);
+ }
+ return sb.toString();
+ }
+
+ public String getRepositoryUrl() {
+ return repository.getUrl();
+ }
+
+ public String getRepoName() {
+ return repository.toString();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/WorkspaceRepositoryNode.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/WorkspaceRepositoryNode.java
new file mode 100644
index 00000000..4cbb19fe
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/ui/internal/views/nodes/WorkspaceRepositoryNode.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.ui.internal.views.nodes;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.internal.index.NexusIndex;
+
+/**
+ * WorkspaceRepositoryNode
+ *
+ * @author igor
+ */
+public class WorkspaceRepositoryNode extends AbstractIndexedRepositoryNode {
+
+ public WorkspaceRepositoryNode(NexusIndex index) {
+ super(index);
+ }
+
+ public String getName() {
+ return Messages.WorkspaceRepositoryNode_name;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/M2EErrorDialog.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/M2EErrorDialog.java
new file mode 100644
index 00000000..37a4a96f
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/M2EErrorDialog.java
@@ -0,0 +1,218 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.util;
+
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TableColumn;
+
+import org.eclipse.m2e.core.internal.Messages;
+
+/**
+ * M2EErrorDialog
+ * Error dialog for displaying a list/table of error values.
+ *
+ * @author dyocum
+ */
+public class M2EErrorDialog extends MessageDialog {
+
+
+ private TableViewer errorTable;
+ private static final int PROJECT_COL = 0;
+ protected static final int TABLE_WIDTH = 700;
+ protected String[] COL_NAMES = {Messages.M2EErrorDialog_column_name, Messages.M2EErrorDialog_column_error};
+ protected int[] COL_STYLES = {SWT.LEFT, SWT.LEFT};
+ protected Map<String, Throwable> errorMap;
+
+ /**
+ * @param parentShell
+ * @param dialogTitle
+ * @param dialogTitleImage
+ * @param dialogMessage
+ * @param dialogImageType
+ * @param dialogButtonLabels
+ * @param defaultIndex
+ */
+ public M2EErrorDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage,
+ int dialogImageType, String[] dialogButtonLabels, int defaultIndex, Map<String, Throwable> errorMap) {
+ super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
+ this.errorMap = errorMap;
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ }
+
+ protected Control createCustomArea(Composite parent) {
+ Composite comp = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(1, true);
+ comp.setLayout(layout);
+
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.widthHint = TABLE_WIDTH+50;
+ gd.grabExcessHorizontalSpace=true;
+ gd.grabExcessVerticalSpace=true;
+ comp.setLayoutData(gd);
+
+ gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.widthHint = TABLE_WIDTH;
+ gd.heightHint = 200;
+ errorTable = new TableViewer(comp, SWT.BORDER|SWT.H_SCROLL|SWT.V_SCROLL|SWT.FULL_SELECTION);
+ errorTable.getTable().setHeaderVisible(true);
+ errorTable.getTable().setLinesVisible(true);
+
+ errorTable.setContentProvider(new ErrorTableContentProvider());
+ errorTable.setLabelProvider(new ErrorTableLabelProvider());
+ errorTable.getControl().setLayoutData(gd);
+
+ setupTableColumns();
+ errorTable.setInput(errorMap);
+ return comp;
+ }
+
+ /**
+ * Create the table columns and set up their widths
+ */
+ protected void setupTableColumns() {
+ GC gc = new GC(errorTable.getControl());
+ gc.setFont(errorTable.getControl().getFont());
+ for(int i=0;i<COL_NAMES.length;i++){
+ TableColumn col = new TableColumn(errorTable.getTable(), COL_STYLES[i]);
+ col.setText(COL_NAMES[i]);
+ int width = calcStringWidth(gc, i);
+ col.setWidth(width);
+ }
+ gc.dispose();
+ }
+
+ /**
+ * Find out how wide the strings are so the columns can be set correctly.
+ * @param gc
+ * @param column
+ * @return
+ */
+ private int calcStringWidth(GC gc, int column){
+ int maxWidth = 100;
+ if(column == PROJECT_COL){
+ Set<String> keySet = errorMap.keySet();
+ for(String projectName : keySet){
+ int width = gc.stringExtent(projectName).x+10;
+ maxWidth = Math.max(maxWidth, width);
+ }
+ return maxWidth;
+ }
+ Collection<Throwable> values = errorMap.values();
+ for(Throwable t : values){
+ String msg = M2EUtils.getRootCauseMessage(t);
+ if(msg == null){
+ msg = ""; //$NON-NLS-1$
+ }
+ int width = gc.stringExtent(msg).x+10;
+ maxWidth = Math.max(maxWidth, width);
+ }
+ return maxWidth;
+ }
+
+ /**
+ * ErrorTableContentProvider
+ *
+ * @author dyocum
+ */
+ class ErrorTableContentProvider implements IStructuredContentProvider {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof Map){
+ return ((Map)inputElement).keySet().toArray();
+ }
+ return new Object[0];
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+ }
+
+ class ErrorTableLabelProvider implements ITableLabelProvider{
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+ */
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+ */
+ public String getColumnText(Object element, int columnIndex) {
+ if(columnIndex == PROJECT_COL){
+ return element.toString();
+ }
+ String msg = M2EUtils.getRootCauseMessage(errorMap.get(element));
+ return msg == null ? "" : msg; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ */
+ public void addListener(ILabelProviderListener listener) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+ */
+ public void dispose() {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
+ */
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ */
+ public void removeListener(ILabelProviderListener listener) {
+ }
+ }
+
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/M2EUtils.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/M2EUtils.java
new file mode 100644
index 00000000..8bb6e156
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/M2EUtils.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.util;
+
+import java.util.Map;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.fieldassist.FieldDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * M2EUtils
+ *
+ * @author dyocum
+ */
+public class M2EUtils {
+
+ public static Font deriveFont(Font f, int style, int height){
+ FontData[] fd = f.getFontData();
+ FontData[] newFD = new FontData[fd.length];
+ for(int i=0;i<fd.length;i++){
+ newFD[i] = new FontData(fd[i].getName(), height, style);
+ }
+ return new Font(Display.getCurrent(), newFD);
+ }
+
+ public static void showErrorDialog(Shell shell, String title, String msg, Exception e){
+ StringBuffer buff = new StringBuffer(msg);
+ Throwable t = getRootCause(e);
+ if(t != null && !nullOrEmpty(t.getMessage())){
+ buff.append(t.getMessage());
+ }
+ MessageDialog.openError(shell, title, buff.toString());
+ }
+
+ public static String getRootCauseMessage(Throwable t){
+ Throwable root = getRootCause(t);
+ if(t == null){
+ return null;
+ }
+ return root.getMessage();
+ }
+
+ public static Throwable getRootCause(Throwable ex) {
+ if(ex == null){
+ return null;
+ }
+ Throwable rootCause = ex;
+ Throwable cause = rootCause.getCause();
+ while(cause != null && cause != rootCause) {
+ rootCause = cause;
+ cause = cause.getCause();
+ }
+ return cause == null ? rootCause : cause;
+ }
+
+ public static boolean nullOrEmpty(String s){
+ return s == null || s.length() == 0;
+ }
+
+ /**
+ * @param shell
+ * @param string
+ * @param string2
+ * @param updateErrors
+ */
+ public static void showErrorsForProjectsDialog(final Shell shell, final String title, final String message,
+ final Map<String, Throwable> errorMap) {
+ // TODO Auto-generated method showErrorsForProjectsDialog
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run(){
+ String[] buttons = {IDialogConstants.OK_LABEL};
+ int ok_button = 0;
+ M2EErrorDialog errDialog = new M2EErrorDialog(shell, title, Dialog.getImage(Dialog.DLG_IMG_MESSAGE_ERROR), message, MessageDialog.ERROR, buttons, ok_button,
+ errorMap);
+ errDialog.create();
+ errDialog.open();
+ }
+ });
+
+ }
+
+ public static void addRequiredDecoration(Control control) {
+ FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
+ FieldDecorationRegistry.DEC_REQUIRED);
+ ControlDecoration controlDecoration = new ControlDecoration(control, SWT.LEFT | SWT.CENTER);
+ controlDecoration.setDescriptionText(fieldDecoration.getDescription());
+ controlDecoration.setImage(fieldDecoration.getImage());
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/ProposalUtil.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/ProposalUtil.java
new file mode 100644
index 00000000..68320167
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/ProposalUtil.java
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.fieldassist.ContentProposalAdapter;
+import org.eclipse.jface.fieldassist.FieldDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.jface.fieldassist.IContentProposal;
+import org.eclipse.jface.fieldassist.IContentProposalProvider;
+import org.eclipse.jface.fieldassist.IControlContentAdapter;
+import org.eclipse.jface.fieldassist.TextContentAdapter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.util.search.CComboContentAdapter;
+import org.eclipse.m2e.core.util.search.ControlDecoration;
+import org.eclipse.m2e.core.util.search.Packaging;
+import org.eclipse.m2e.core.util.search.SearchEngine;
+
+
+/**
+ * Holds the proposal utility code, previously in the editor.xml plug-in. Provides proposal suggestions for text and
+ * combo widgets for various metadata (group, artifact, etc.)
+ *
+ * @author rgould
+ */
+public class ProposalUtil {
+
+ public static abstract class Searcher {
+ public abstract Collection<String> search() throws CoreException;
+ }
+
+ public static final class TextProposal implements IContentProposal {
+ private final String text;
+
+ public TextProposal(String text) {
+ this.text = text;
+ }
+
+ public int getCursorPosition() {
+ return text.length();
+ }
+
+ public String getContent() {
+ return text;
+ }
+
+ public String getLabel() {
+ return text;
+ }
+
+ public String getDescription() {
+ return null;
+ }
+ }
+
+ public static void addCompletionProposal(final Control control, final Searcher searcher) {
+ FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
+ FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
+ ControlDecoration decoration = new ControlDecoration(control, SWT.LEFT | SWT.TOP);
+ decoration.setShowOnlyOnFocus(true);
+ decoration.setDescriptionText(fieldDecoration.getDescription());
+ decoration.setImage(fieldDecoration.getImage());
+
+ IContentProposalProvider proposalProvider = new IContentProposalProvider() {
+ public IContentProposal[] getProposals(String contents, int position) {
+ ArrayList<IContentProposal> proposals = new ArrayList<IContentProposal>();
+ try {
+ for(final String text : searcher.search()) {
+ proposals.add(new TextProposal(text));
+ }
+ } catch(CoreException e) {
+ MavenLogger.log(e);
+ }
+ return proposals.toArray(new IContentProposal[proposals.size()]);
+ }
+ };
+
+ IControlContentAdapter contentAdapter;
+ if(control instanceof Text) {
+ contentAdapter = new TextContentAdapter();
+ } else {
+ contentAdapter = new CComboContentAdapter();
+ }
+
+ ContentAssistCommandAdapter adapter = new ContentAssistCommandAdapter( //
+ control, contentAdapter, proposalProvider, //
+ ContentAssistCommandAdapter.CONTENT_PROPOSAL_COMMAND, null);
+ // ContentProposalAdapter adapter = new ContentProposalAdapter(control, contentAdapter, //
+ // proposalProvider, KeyStroke.getInstance(SWT.MOD1, ' '), null);
+ adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
+ adapter.setPopupSize(new Point(250, 120));
+ adapter.setPopupSize(new Point(250, 120));
+ }
+
+ public static void addClassifierProposal(final IProject project, final Text groupIdText, final Text artifactIdText,
+ final Text versionText, final Text classifierText, final Packaging packaging) {
+ addCompletionProposal(classifierText, new Searcher() {
+ public Collection<String> search() throws CoreException {
+ return getSearchEngine(project).findClassifiers(groupIdText.getText(), //
+ artifactIdText.getText(), versionText.getText(), classifierText.getText(), packaging);
+ }
+ });
+ }
+
+ public static void addVersionProposal(final IProject project, final Text groupIdText, final Text artifactIdText,
+ final Text versionText, final Packaging packaging) {
+ addCompletionProposal(versionText, new Searcher() {
+ public Collection<String> search() throws CoreException {
+ return getSearchEngine(project).findVersions(groupIdText.getText(), //
+ artifactIdText.getText(), versionText.getText(), packaging);
+ }
+ });
+ }
+
+ public static void addArtifactIdProposal(final IProject project, final Text groupIdText, final Text artifactIdText,
+ final Packaging packaging) {
+ addCompletionProposal(artifactIdText, new Searcher() {
+ public Collection<String> search() throws CoreException {
+ // TODO handle artifact info
+ return getSearchEngine(project).findArtifactIds(groupIdText.getText(), artifactIdText.getText(), packaging,
+ null);
+ }
+ });
+ }
+
+ public static void addGroupIdProposal(final IProject project, final Text groupIdText, final Packaging packaging) {
+ addCompletionProposal(groupIdText, new Searcher() {
+ public Collection<String> search() throws CoreException {
+ // TODO handle artifact info
+ return getSearchEngine(project).findGroupIds(groupIdText.getText(), packaging, null);
+ }
+ });
+ }
+
+ public static SearchEngine getSearchEngine(final IProject project) throws CoreException {
+ return MavenPlugin.getDefault().getSearchEngine(project);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/Util.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/Util.java
new file mode 100644
index 00000000..fa01cbae
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/Util.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.util;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Version;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.variables.VariablesPlugin;
+
+import org.eclipse.m2e.core.core.MavenLogger;
+
+
+/**
+ * Utility methods
+ *
+ * @author Eugene Kuleshov
+ */
+public class Util {
+
+ public static boolean isEclipseVersion(int major, int minor) {
+ Bundle bundle = ResourcesPlugin.getPlugin().getBundle();
+ String version = (String) bundle.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
+ Version v = Version.parseVersion(version);
+ return v.getMajor() == major && v.getMinor() == minor;
+ }
+
+ /**
+ * Proxy factory for compatibility stubs
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T proxy(final Object o, Class<T> type) {
+ return (T) Proxy.newProxyInstance(type.getClassLoader(), //
+ new Class[] {type}, //
+ new InvocationHandler() {
+ public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
+ try {
+ Method mm = o.getClass().getMethod(m.getName(), m.getParameterTypes());
+ return mm.invoke(o, args);
+ } catch(final NoSuchMethodException e) {
+ return null;
+ }
+ }
+ });
+ }
+
+ /**
+ * Stub interface for FileStoreEditorInput
+ *
+ * @see Util#proxy(Object, Class)
+ */
+ public static interface FileStoreEditorInputStub {
+ public java.net.URI getURI();
+ }
+
+ /**
+ * Helper method which creates a folder and, recursively, all its parent folders.
+ *
+ * @param folder The folder to create.
+ * @param derived true if folder should be marked as derived
+ * @throws CoreException if creating the given <code>folder</code> or any of its parents fails.
+ */
+ public static void createFolder(IFolder folder, boolean derived) throws CoreException {
+ // Recurse until we find a parent folder which already exists.
+ if(!folder.exists()) {
+ IContainer parent = folder.getParent();
+ // First, make sure that all parent folders exist.
+ if(parent != null && !parent.exists()) {
+ createFolder((IFolder) parent, false);
+ }
+ folder.create(true, true, null);
+ }
+
+ if(folder.isAccessible() && derived) {
+ folder.setDerived(true);
+ }
+ }
+
+ public static void setDerived(IFolder folder, boolean derived) throws CoreException {
+ if(folder.isAccessible()) {
+ folder.setDerived(derived);
+ }
+ }
+
+ /**
+ * Substitute any variable
+ */
+ public static String substituteVar(String s) {
+ if(s == null) {
+ return s;
+ }
+ try {
+ return VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(s);
+ } catch(CoreException e) {
+ MavenLogger.log(e);
+ return null;
+ }
+ }
+
+ public static String nvl(String s) {
+ return s == null ? "" : s; //$NON-NLS-1$
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/ArtifactInfo.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/ArtifactInfo.java
new file mode 100644
index 00000000..85b90527
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/ArtifactInfo.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.util.search;
+
+
+/**
+ * Information about the artifact.
+ *
+ * @author Lukas Krecan
+ */
+public class ArtifactInfo {
+ private final String groupId;
+ private final String artifactId;
+ private final String version;
+ private final String classfier;
+ private final String type;
+
+ public ArtifactInfo(String groupId, String artifactId, String version, String classfier, String type) {
+ this.groupId = groupId;
+ this.artifactId = artifactId;
+ this.version = version;
+ this.classfier = classfier;
+ this.type = type;
+ }
+
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public String getClassfier() {
+ return classfier;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Constructs a <code>String</code> with all attributes
+ * in name = value format.
+ *
+ * @return a <code>String</code> representation
+ * of this object.
+ */
+ public String toString()
+ {
+ final String TAB = " "; //$NON-NLS-1$
+
+ String retValue = ""; //$NON-NLS-1$
+
+ retValue = "ArtifactInfo ( " //$NON-NLS-1$
+ + "groupId = " + this.groupId + TAB //$NON-NLS-1$
+ + "artifactId = " + this.artifactId + TAB //$NON-NLS-1$
+ + "version = " + this.version + TAB //$NON-NLS-1$
+ + "classfier = " + this.classfier + TAB //$NON-NLS-1$
+ + "type = " + this.type + TAB //$NON-NLS-1$
+ + " )"; //$NON-NLS-1$
+
+ return retValue;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/CComboContentAdapter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/CComboContentAdapter.java
new file mode 100644
index 00000000..2dbbe432
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/CComboContentAdapter.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.util.search;
+
+import org.eclipse.jface.fieldassist.ContentProposalAdapter;
+import org.eclipse.jface.fieldassist.IControlContentAdapter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Control;
+
+
+/**
+ * An {@link IControlContentAdapter} for SWT CCombo controls. This is a convenience class for easily creating a
+ * {@link ContentProposalAdapter} for combo fields.
+ */
+public class CComboContentAdapter implements IControlContentAdapter /*, IControlContentAdapter2 */ {
+
+ /*
+ * Set to <code>true</code> if we should compute the text
+ * vertical bounds rather than just use the field size.
+ * Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=164748
+ * The corresponding SWT bug is
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=44072
+ */
+ private static final boolean COMPUTE_TEXT_USING_CLIENTAREA = !"carbon".equals(SWT.getPlatform()); //$NON-NLS-1$
+
+ public String getControlContents(Control control) {
+ return ((CCombo) control).getText();
+ }
+
+ public void setControlContents(Control control, String text, int cursorPosition) {
+ ((CCombo) control).setText(text);
+ ((CCombo) control).setSelection(new Point(cursorPosition, cursorPosition));
+ }
+
+ public void insertControlContents(Control control, String text, int cursorPosition) {
+ CCombo combo = (CCombo) control;
+ String contents = combo.getText();
+ Point selection = combo.getSelection();
+ StringBuffer sb = new StringBuffer();
+ sb.append(contents.substring(0, selection.x));
+ sb.append(text);
+ if(selection.y < contents.length()) {
+ sb.append(contents.substring(selection.y, contents.length()));
+ }
+ combo.setText(sb.toString());
+ selection.x = selection.x + cursorPosition;
+ selection.y = selection.x;
+ combo.setSelection(selection);
+ }
+
+ public int getCursorPosition(Control control) {
+ return ((CCombo) control).getSelection().x;
+ }
+
+ public Rectangle getInsertionBounds(Control control) {
+ // This doesn't take horizontal scrolling into affect.
+ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=204599
+ CCombo combo = (CCombo) control;
+ int position = combo.getSelection().y;
+ String contents = combo.getText();
+ GC gc = new GC(combo);
+ gc.setFont(combo.getFont());
+ Point extent = gc.textExtent(contents.substring(0, Math.min(position, contents.length())));
+ gc.dispose();
+ if(COMPUTE_TEXT_USING_CLIENTAREA) {
+ return new Rectangle(combo.getClientArea().x + extent.x, combo.getClientArea().y, 1, combo.getClientArea().height);
+ }
+ return new Rectangle(extent.x, 0, 1, combo.getSize().y);
+ }
+
+ public void setCursorPosition(Control control, int index) {
+ ((CCombo) control).setSelection(new Point(index, index));
+ }
+
+ public Point getSelection(Control control) {
+ return ((CCombo) control).getSelection();
+ }
+
+ public void setSelection(Control control, Point range) {
+ ((CCombo) control).setSelection(range);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/ControlDecoration.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/ControlDecoration.java
new file mode 100644
index 00000000..4e7b7fae
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/ControlDecoration.java
@@ -0,0 +1,1088 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+
+package org.eclipse.m2e.core.util.search;
+
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.jface.fieldassist.FieldDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.MouseTrackListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Region;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Widget;
+
+
+/**
+ * ControlDecoration renders an image decoration near a control. It allows clients to specify an image and a position
+ * for the image relative to the control. A ControlDecoration may be assigned description text, which can optionally be
+ * shown when the user hovers over the image. Clients can decorate any kind of control.
+ * <p>
+ * Decoration images always appear on the left or right side of the field, never above or below it. Decorations can be
+ * positioned at the top, center, or bottom of either side of the control. Future implementations may provide additional
+ * positioning options for decorations.
+ * <p>
+ * ControlDecoration renders the image adjacent to the specified (already created) control, with no guarantee that it
+ * won't be clipped or otherwise obscured or overlapped by adjacent controls, including another ControlDecoration placed
+ * in the same location. Clients should ensure that there is adequate space adjacent to the control to show the
+ * decoration properly.
+ * <p>
+ * Clients using ControlDecoration should typically ensure that enough margin space is reserved for a decoration by
+ * altering the layout data margins, although this is not assumed or required by the ControlDecoration implementation.
+ * <p>
+ * This class is intended to be instantiated and used by clients. It is not intended to be subclassed by clients.
+ *
+ * @since 3.3
+ * @see FieldDecoration
+ * @see FieldDecorationRegistry
+ */
+public class ControlDecoration {
+ /**
+ * Debug flag for tracing
+ */
+ private static boolean DEBUG = false;
+
+ /**
+ * Cached platform flags for dealing with platform-specific issues.
+ */
+ static boolean CARBON = "carbon".equals(SWT.getPlatform()); //$NON-NLS-1$
+
+ /**
+ * The associated control
+ */
+ Control control;
+
+ /**
+ * The composite on which to render the decoration and hook mouse events, or null if we are hooking all parent
+ * composites.
+ */
+ private Composite composite;
+
+ /**
+ * The associated image.
+ */
+ private Image image;
+
+ /**
+ * The associated description text.
+ */
+ private String descriptionText;
+
+ /**
+ * The position of the decoration.
+ */
+ private int position;
+
+ /**
+ * The decoration's visibility flag
+ */
+ boolean visible = true;
+
+ /**
+ * Boolean indicating whether the decoration should only be shown when the control has focus
+ */
+ boolean showOnlyOnFocus = false;
+
+ /**
+ * Boolean indicating whether the decoration should show its description text in a hover when the user hovers over the
+ * decoration.
+ */
+ boolean showHover = true;
+
+ /**
+ * Margin width used between the decorator and the control.
+ */
+ private int marginWidth = 0;
+
+ /**
+ * Registered selection listeners.
+ */
+ ListenerList selectionListeners = new ListenerList();
+
+ /**
+ * Registered menu detect listeners.
+ */
+ ListenerList menuDetectListeners = new ListenerList();
+
+ /**
+ * The focus listener
+ */
+ private FocusListener focusListener;
+
+ /**
+ * The dispose listener
+ */
+ private DisposeListener disposeListener;
+
+ /**
+ * The paint listener installed for drawing the decoration
+ */
+ private PaintListener paintListener;
+
+ /**
+ * The mouse listener installed for tracking the hover
+ */
+ private MouseTrackListener mouseTrackListener;
+
+ /**
+ * The mouse move listener installed for tracking the hover
+ */
+ MouseMoveListener mouseMoveListener;
+
+ /**
+ * The untyped listener installed for notifying external listeners
+ */
+ private Listener compositeListener;
+
+ /**
+ * Control that we last installed a move listener on. We only want one at a time.
+ */
+ Control moveListeningTarget = null;
+
+ /**
+ * Debug counter used to match add and remove listeners
+ */
+ private int listenerInstalls = 0;
+
+ /**
+ * The current rectangle used for tracking mouse moves
+ */
+ Rectangle decorationRectangle;
+
+ /**
+ * An internal flag tracking whether we have focus. We use this rather than isFocusControl() so that we can set the
+ * flag as soon as we get the focus callback, rather than having to do an asyncExec in the middle of a focus callback
+ * to ensure that isFocusControl() represents the outcome of the event.
+ */
+ boolean hasFocus = false;
+
+ /**
+ * The hover used for showing description text
+ */
+ private Hover hover;
+
+ /**
+ * The hover used to show a decoration image's description.
+ */
+ class Hover {
+ private static final String EMPTY = ""; //$NON-NLS-1$
+
+ /**
+ * Offset of info hover arrow from the left or right side.
+ */
+ private int hao = 10;
+
+ /**
+ * Width of info hover arrow.
+ */
+ private int haw = 8;
+
+ /**
+ * Height of info hover arrow.
+ */
+ private int hah = 10;
+
+ /**
+ * Margin around info hover text.
+ */
+ int hm = 2;
+
+ /**
+ * This info hover's shell.
+ */
+ Shell hoverShell;
+
+ /**
+ * The info hover text.
+ */
+ String text = EMPTY;
+
+ /**
+ * The region used to manage the shell shape
+ */
+ Region region;
+
+ /**
+ * Boolean indicating whether the last computed polygon location had an arrow on left. (true if left, false if
+ * right).
+ */
+ boolean arrowOnLeft = true;
+
+ /*
+ * Create a hover parented by the specified shell.
+ */
+ Hover(Shell parent) {
+ final Display display = parent.getDisplay();
+ hoverShell = new Shell(parent, SWT.NO_TRIM | SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
+ hoverShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+ hoverShell.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
+ hoverShell.addPaintListener(new PaintListener() {
+ public void paintControl(PaintEvent pe) {
+ pe.gc.drawText(text, hm, hm);
+ if(!CARBON) {
+ pe.gc.drawPolygon(getPolygon(true));
+ }
+ }
+ });
+ hoverShell.addMouseListener(new MouseAdapter() {
+ public void mouseDown(MouseEvent e) {
+ hideHover();
+ }
+ });
+ }
+
+ /*
+ * Compute a polygon that represents a hover with an arrow pointer. If
+ * border is true, compute the polygon inset by 1-pixel border. Consult
+ * the arrowOnLeft flag to determine which side the arrow is on.
+ */
+ int[] getPolygon(boolean border) {
+ Point e = getExtent();
+ int b = border ? 1 : 0;
+ if(arrowOnLeft) {
+ return new int[] {0, 0, e.x - b, 0, e.x - b, e.y - b, hao + haw, e.y - b, hao + haw / 2, e.y + hah - b, hao,
+ e.y - b, 0, e.y - b, 0, 0};
+ }
+ return new int[] {0, 0, e.x - b, 0, e.x - b, e.y - b, e.x - hao - b, e.y - b, e.x - hao - haw / 2, e.y + hah - b,
+ e.x - hao - haw, e.y - b, 0, e.y - b, 0, 0};
+ }
+
+ /*
+ * Dispose the hover, it is no longer needed. Dispose any resources
+ * allocated by the hover.
+ */
+ void dispose() {
+ if(!hoverShell.isDisposed()) {
+ hoverShell.dispose();
+ }
+ if(region != null) {
+ region.dispose();
+ }
+ }
+
+ /*
+ * Set the visibility of the hover.
+ */
+ void setVisible(boolean visible) {
+ if(visible) {
+ if(!hoverShell.isVisible()) {
+ hoverShell.setVisible(true);
+ }
+ } else {
+ if(hoverShell.isVisible()) {
+ hoverShell.setVisible(false);
+ }
+ }
+ }
+
+ /*
+ * Set the text of the hover to the specified text. Recompute the size
+ * and location of the hover to hover near the decoration rectangle,
+ * pointing the arrow toward the target control.
+ */
+ void setText(String t, Rectangle decorationRectangle, Control targetControl) {
+ if(t == null) {
+ t = EMPTY;
+ }
+ if(!t.equals(text)) {
+ Point oldSize = getExtent();
+ text = t;
+ hoverShell.redraw();
+ Point newSize = getExtent();
+ if(!oldSize.equals(newSize)) {
+ // set a flag that indicates the direction of arrow
+ arrowOnLeft = decorationRectangle.x <= targetControl.getLocation().x;
+ setNewShape();
+ }
+ }
+
+ Point extent = getExtent();
+ int y = -extent.y - hah + 1;
+ int x = arrowOnLeft ? -hao + haw / 2 : -extent.x + hao + haw / 2;
+
+ hoverShell.setLocation(control.getParent().toDisplay(decorationRectangle.x + x, decorationRectangle.y + y));
+ }
+
+ /*
+ * Return whether or not the hover (shell) is visible.
+ */
+ boolean isVisible() {
+ return hoverShell.isVisible();
+ }
+
+ /*
+ * Compute the extent of the hover for the current text.
+ */
+ Point getExtent() {
+ GC gc = new GC(hoverShell);
+ Point e = gc.textExtent(text);
+ gc.dispose();
+ e.x += hm * 2;
+ e.y += hm * 2;
+ return e;
+ }
+
+ /*
+ * Compute a new shape for the hover shell.
+ */
+ void setNewShape() {
+ Region oldRegion = region;
+ region = new Region();
+ region.add(getPolygon(false));
+ hoverShell.setRegion(region);
+ if(oldRegion != null) {
+ oldRegion.dispose();
+ }
+
+ }
+ }
+
+ /**
+ * Construct a ControlDecoration for decorating the specified control at the specified position relative to the
+ * control. Render the decoration on top of any Control that happens to appear at the specified location.
+ * <p>
+ * SWT constants are used to specify the position of the decoration relative to the control. The position should
+ * include style bits describing both the vertical and horizontal orientation. <code>SWT.LEFT</code> and
+ * <code>SWT.RIGHT</code> describe the horizontal placement of the decoration relative to the control, and the
+ * constants <code>SWT.TOP</code>, <code>SWT.CENTER</code>, and <code>SWT.BOTTOM</code> describe the vertical
+ * alignment of the decoration relative to the control. Decorations always appear on either the left or right side of
+ * the control, never above or below it. For example, a decoration appearing on the left side of the field, at the
+ * top, is specified as SWT.LEFT | SWT.TOP. If no position style bits are specified, the control decoration will be
+ * positioned to the left and center of the control (<code>SWT.LEFT | SWT.CENTER</code>).
+ * </p>
+ *
+ * @param control the control to be decorated
+ * @param position bit-wise or of position constants (<code>SWT.TOP</code>, <code>SWT.BOTTOM</code>,
+ * <code>SWT.LEFT</code>, <code>SWT.RIGHT</code>, and <code>SWT.CENTER</code>).
+ */
+ public ControlDecoration(Control control, int position) {
+ this(control, position, null);
+
+ }
+
+ /**
+ * Construct a ControlDecoration for decorating the specified control at the specified position relative to the
+ * control. Render the decoration only on the specified Composite or its children. The decoration will be clipped if
+ * it does not appear within the visible bounds of the composite or its child composites.
+ * <p>
+ * SWT constants are used to specify the position of the decoration relative to the control. The position should
+ * include style bits describing both the vertical and horizontal orientation. <code>SWT.LEFT</code> and
+ * <code>SWT.RIGHT</code> describe the horizontal placement of the decoration relative to the control, and the
+ * constants <code>SWT.TOP</code>, <code>SWT.CENTER</code>, and <code>SWT.BOTTOM</code> describe the vertical
+ * alignment of the decoration relative to the control. Decorations always appear on either the left or right side of
+ * the control, never above or below it. For example, a decoration appearing on the left side of the field, at the
+ * top, is specified as SWT.LEFT | SWT.TOP. If no position style bits are specified, the control decoration will be
+ * positioned to the left and center of the control (<code>SWT.LEFT | SWT.CENTER</code>).
+ * </p>
+ *
+ * @param control the control to be decorated
+ * @param position bit-wise or of position constants (<code>SWT.TOP</code>, <code>SWT.BOTTOM</code>,
+ * <code>SWT.LEFT</code>, <code>SWT.RIGHT</code>, and <code>SWT.CENTER</code>).
+ * @param composite The SWT composite within which the decoration should be rendered. The decoration will be clipped
+ * to this composite, but it may be rendered on a child of the composite. The decoration will not be visible
+ * if the specified composite or its child composites are not visible in the space relative to the control,
+ * where the decoration is to be rendered. If this value is <code>null</code>, then the decoration will be
+ * rendered on whichever composite (or composites) are located in the specified position.
+ */
+ public ControlDecoration(Control control, int position, Composite composite) {
+ this.position = position;
+ this.control = control;
+ this.composite = composite;
+
+ addControlListeners();
+
+ }
+
+ /**
+ * Adds the listener to the collection of listeners who will be notified when the platform-specific context menu
+ * trigger has occurred, by sending it one of the messages defined in the <code>MenuDetectListener</code> interface.
+ * <p>
+ * The <code>widget</code> field in the SelectionEvent will contain the Composite on which the decoration is rendered
+ * that received the click. The <code>x</code> and <code>y</code> fields will be in coordinates relative to the
+ * display. The <code>data</code> field will contain the decoration that received the event.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ * @see org.eclipse.swt.events.MenuDetectListener
+ * @see org.eclipse.swt.events.MenuDetectEvent
+ * @see #removeMenuDetectListener
+ */
+ public void addMenuDetectListener(MenuDetectListener listener) {
+ menuDetectListeners.add(listener);
+ }
+
+ /**
+ * Removes the listener from the collection of listeners who will be notified when the platform-specific context menu
+ * trigger has occurred.
+ *
+ * @param listener the listener which should no longer be notified. This message has no effect if the listener was not
+ * previously added to the receiver.
+ * @see org.eclipse.swt.events.MenuDetectListener
+ * @see #addMenuDetectListener
+ */
+ public void removeMenuDetectListener(MenuDetectListener listener) {
+ menuDetectListeners.remove(listener);
+ }
+
+ /**
+ * Adds the listener to the collection of listeners who will be notified when the decoration is selected, by sending
+ * it one of the messages defined in the <code>SelectionListener</code> interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the decoration is selected (by mouse click).
+ * <code>widgetDefaultSelected</code> is called when the decoration is double-clicked.
+ * </p>
+ * <p>
+ * The <code>widget</code> field in the SelectionEvent will contain the Composite on which the decoration is rendered
+ * that received the click. The <code>x</code> and <code>y</code> fields will be in coordinates relative to that
+ * widget. The <code>data</code> field will contain the decoration that received the event.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ * @see org.eclipse.swt.events.SelectionListener
+ * @see org.eclipse.swt.events.SelectionEvent
+ * @see #removeSelectionListener
+ */
+ public void addSelectionListener(SelectionListener listener) {
+ selectionListeners.add(listener);
+ }
+
+ /**
+ * Removes the listener from the collection of listeners who will be notified when the decoration is selected.
+ *
+ * @param listener the listener which should no longer be notified. This message has no effect if the listener was not
+ * previously added to the receiver.
+ * @see org.eclipse.swt.events.SelectionListener
+ * @see #addSelectionListener
+ */
+ public void removeSelectionListener(SelectionListener listener) {
+ selectionListeners.remove(listener);
+ }
+
+ /**
+ * Dispose this ControlDecoration. Unhook any listeners that have been installed on the target control. This method
+ * has no effect if the receiver is already disposed.
+ */
+ public void dispose() {
+ if(control == null) {
+ return;
+ }
+ if(hover != null) {
+ hover.dispose();
+ hover = null;
+ }
+ removeControlListeners();
+ control = null;
+ }
+
+ /**
+ * Get the control that is decorated by the receiver.
+ *
+ * @return the Control decorated by the receiver. May be <code>null</code> if the control has been uninstalled.
+ */
+ public Control getControl() {
+ return control;
+ }
+
+ /**
+ * Add any listeners needed on the target control and on the composite where the decoration is to be rendered.
+ */
+ private void addControlListeners() {
+ disposeListener = new DisposeListener() {
+ public void widgetDisposed(DisposeEvent event) {
+ dispose();
+ }
+ };
+ printAddListener(control, "DISPOSE"); //$NON-NLS-1$
+ control.addDisposeListener(disposeListener);
+
+ focusListener = new FocusListener() {
+ public void focusGained(FocusEvent event) {
+ hasFocus = true;
+ if(showOnlyOnFocus) {
+ update();
+ }
+ }
+
+ public void focusLost(FocusEvent event) {
+ hasFocus = false;
+ if(showOnlyOnFocus) {
+ update();
+ }
+ }
+ };
+ printAddListener(control, "FOCUS"); //$NON-NLS-1$
+ control.addFocusListener(focusListener);
+
+ // Listener for painting the decoration
+ paintListener = new PaintListener() {
+ public void paintControl(PaintEvent event) {
+ Control control = (Control) event.widget;
+ Rectangle rect = getDecorationRectangle(control);
+ if(shouldShowDecoration()) {
+ event.gc.drawImage(getImage(), rect.x, rect.y);
+ }
+ }
+ };
+
+ // Listener for tracking the end of a hover. Only installed
+ // after a hover begins.
+ mouseMoveListener = new MouseMoveListener() {
+ public void mouseMove(MouseEvent event) {
+ if(showHover) {
+ if(!decorationRectangle.contains(event.x, event.y)) {
+ hideHover();
+ // No need to listen any longer
+ printRemoveListener(event.widget, "MOUSEMOVE"); //$NON-NLS-1$
+ ((Control) event.widget).removeMouseMoveListener(mouseMoveListener);
+ moveListeningTarget = null;
+ }
+ }
+ }
+ };
+
+ // Listener for tracking the beginning of a hover. Always installed.
+ mouseTrackListener = new MouseTrackListener() {
+ public void mouseExit(MouseEvent event) {
+ // Just in case we didn't catch it before.
+ Control target = (Control) event.widget;
+ if(target == moveListeningTarget) {
+ printRemoveListener(target, "MOUSEMOVE"); //$NON-NLS-1$
+ target.removeMouseMoveListener(mouseMoveListener);
+ moveListeningTarget = null;
+ }
+ hideHover();
+ }
+
+ public void mouseHover(MouseEvent event) {
+ if(showHover) {
+ decorationRectangle = getDecorationRectangle((Control) event.widget);
+ if(decorationRectangle.contains(event.x, event.y)) {
+ showHoverText(getDescriptionText());
+ Control target = (Control) event.widget;
+ if(moveListeningTarget == null) {
+ printAddListener(target, "MOUSEMOVE"); //$NON-NLS-1$
+ target.addMouseMoveListener(mouseMoveListener);
+ moveListeningTarget = target;
+ } else if(target != moveListeningTarget) {
+ printRemoveListener(moveListeningTarget, "MOUSEMOVE"); //$NON-NLS-1$
+ moveListeningTarget.removeMouseMoveListener(mouseMoveListener);
+ printAddListener(target, "MOUSEMOVE"); //$NON-NLS-1$
+ target.addMouseMoveListener(mouseMoveListener);
+ moveListeningTarget = target;
+ } else {
+ // It is already installed on this control.
+ }
+ }
+ }
+ }
+
+ public void mouseEnter(MouseEvent event) {
+ // Nothing to do until a hover occurs.
+ }
+ };
+
+ compositeListener = new Listener() {
+ public void handleEvent(Event event) {
+ // Don't forward events if decoration is not showing
+ if(!visible) {
+ return;
+ }
+ // Notify listeners if any are registered.
+ switch(event.type) {
+ case SWT.MouseDown:
+ if(!selectionListeners.isEmpty())
+ notifySelectionListeners(event);
+ break;
+ case SWT.MouseDoubleClick:
+ if(!selectionListeners.isEmpty())
+ notifySelectionListeners(event);
+ break;
+ case SWT.MenuDetect:
+ if(!menuDetectListeners.isEmpty())
+ notifyMenuDetectListeners(event);
+ break;
+ }
+ }
+ };
+
+ // We do not know which parent in the control hierarchy
+ // is providing the decoration space, so hook all the way up, until
+ // the shell or the specified parent composite is reached.
+ Composite c = control.getParent();
+ while(c != null) {
+ installCompositeListeners(c);
+ if(composite != null && composite == c) {
+ // We just installed on the specified composite, so stop.
+ c = null;
+ } else if(c instanceof Shell) {
+ // We just installed on a shell, so don't go further
+ c = null;
+ } else {
+ c = c.getParent();
+ }
+ }
+ // force a redraw of the decoration area so our paint listener
+ // is notified.
+ update();
+ }
+
+ /*
+ * Install the listeners used to paint and track mouse events on the
+ * composite.
+ */
+ private void installCompositeListeners(Composite c) {
+ if(!c.isDisposed()) {
+ printAddListener(c, "PAINT"); //$NON-NLS-1$
+ c.addPaintListener(paintListener);
+ printAddListener(c, "MOUSETRACK"); //$NON-NLS-1$
+ c.addMouseTrackListener(mouseTrackListener);
+ printAddListener(c, "SWT.MenuDetect"); //$NON-NLS-1$
+ c.addListener(SWT.MenuDetect, compositeListener);
+ printAddListener(c, "SWT.MouseDown"); //$NON-NLS-1$
+ c.addListener(SWT.MouseDown, compositeListener);
+ printAddListener(c, "SWT.MouseDoubleClick"); //$NON-NLS-1$
+ c.addListener(SWT.MouseDoubleClick, compositeListener);
+ }
+ }
+
+ /*
+ * Remove the listeners used to paint and track mouse events on the
+ * composite.
+ */
+ private void removeCompositeListeners(Composite c) {
+ if(!c.isDisposed()) {
+ printRemoveListener(c, "PAINT"); //$NON-NLS-1$
+ c.removePaintListener(paintListener);
+ printRemoveListener(c, "MOUSETRACK"); //$NON-NLS-1$
+ c.removeMouseTrackListener(mouseTrackListener);
+ printRemoveListener(c, "SWT.MenuDetect"); //$NON-NLS-1$
+ c.removeListener(SWT.MenuDetect, compositeListener);
+ printRemoveListener(c, "SWT.MouseDown"); //$NON-NLS-1$
+ c.removeListener(SWT.MouseDown, compositeListener);
+ printRemoveListener(c, "SWT.MouseDoubleClick"); //$NON-NLS-1$
+ c.removeListener(SWT.MouseDoubleClick, compositeListener);
+ }
+ }
+
+ void notifySelectionListeners(Event event) {
+ if(!(event.widget instanceof Control)) {
+ return;
+ }
+ if(getDecorationRectangle((Control) event.widget).contains(event.x, event.y)) {
+ SelectionEvent clientEvent = new SelectionEvent(event);
+ clientEvent.data = this;
+ if(getImage() != null) {
+ clientEvent.height = getImage().getBounds().height;
+ clientEvent.width = getImage().getBounds().width;
+ }
+ Object[] listeners;
+ switch(event.type) {
+ case SWT.MouseDoubleClick:
+ if(event.button == 1) {
+ listeners = selectionListeners.getListeners();
+ for(int i = 0; i < listeners.length; i++ ) {
+ ((SelectionListener) listeners[i]).widgetDefaultSelected(clientEvent);
+ }
+ }
+ break;
+ case SWT.MouseDown:
+ if(event.button == 1) {
+ listeners = selectionListeners.getListeners();
+ for(int i = 0; i < listeners.length; i++ ) {
+ ((SelectionListener) listeners[i]).widgetSelected(clientEvent);
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ void notifyMenuDetectListeners(Event event) {
+ if(getDecorationRectangle(null).contains(event.x, event.y)) {
+ MenuDetectEvent clientEvent = new MenuDetectEvent(event);
+ clientEvent.data = this;
+ Object[] listeners = menuDetectListeners.getListeners();
+ for(int i = 0; i < listeners.length; i++ ) {
+ ((MenuDetectListener) listeners[i]).menuDetected(clientEvent);
+
+ }
+ }
+ }
+
+ /**
+ * Show the specified text using the same hover dialog as is used to show decorator descriptions. When
+ * {@link #setShowHover(boolean)} has been set to <code>true</code>, a decoration's description text will be shown in
+ * an info hover over the field's control whenever the mouse hovers over the decoration. This method can be used to
+ * show a decoration's description text at other times (such as when the control receives focus), or to show other
+ * text associated with the field. The hover will not be shown if the decoration is hidden.
+ *
+ * @param text the text to be shown in the info hover, or <code>null</code> if no text should be shown.
+ */
+ public void showHoverText(String text) {
+ if(control == null) {
+ return;
+ }
+ showHoverText(text, control);
+ }
+
+ /**
+ * Hide any hover popups that are currently showing on the control. When {@link #setShowHover(boolean)} has been set
+ * to <code>true</code>, a decoration's description text will be shown in an info hover over the field's control as
+ * long as the mouse hovers over the decoration, and will be hidden when the mouse exits the decoration. This method
+ * can be used to hide a hover, whether it was shown explicitly using {@link #showHoverText(String)}, or was showing
+ * because the user was hovering in the decoration.
+ * <p>
+ * This message has no effect if there is no current hover.
+ */
+ public void hideHover() {
+ if(hover != null) {
+ hover.setVisible(false);
+ }
+ }
+
+ /**
+ * Show the control decoration. This message has no effect if the decoration is already showing. If
+ * {@link #setShowOnlyOnFocus(boolean)} is set to <code>true</code>, the decoration will only be shown if the control
+ * has focus.
+ */
+ public void show() {
+ if(!visible) {
+ visible = true;
+ update();
+ }
+ }
+
+ /**
+ * Hide the control decoration and any associated hovers. This message has no effect if the decoration is already
+ * hidden.
+ */
+ public void hide() {
+ if(visible) {
+ visible = false;
+ hideHover();
+ update();
+ }
+ }
+
+ /**
+ * Get the description text that may be shown in a hover for this decoration.
+ *
+ * @return the text to be shown as a description for the decoration, or <code>null</code> if none has been set.
+ */
+ public String getDescriptionText() {
+ return descriptionText;
+ }
+
+ /**
+ * Set the image shown in this control decoration. Update the rendered decoration.
+ *
+ * @param text the text to be shown as a description for the decoration, or <code>null</code> if none has been set.
+ */
+ public void setDescriptionText(String text) {
+ this.descriptionText = text;
+ update();
+ }
+
+ /**
+ * Get the image shown in this control decoration.
+ *
+ * @return the image to be shown adjacent to the control, or <code>null</code> if one has not been set.
+ */
+ public Image getImage() {
+ return image;
+ }
+
+ /**
+ * Set the image shown in this control decoration. Update the rendered decoration.
+ *
+ * @param image the image to be shown adjacent to the control. Should never be <code>null</code>.
+ */
+ public void setImage(Image image) {
+ this.image = image;
+ update();
+ }
+
+ /**
+ * Get the boolean that controls whether the decoration is shown only when the control has focus. The default value of
+ * this setting is <code>false</code>.
+ *
+ * @return <code>true</code> if the decoration should only be shown when the control has focus, and <code>false</code>
+ * if it should always be shown. Note that if the control is not capable of receiving focus (
+ * <code>SWT.NO_FOCUS</code>), then the decoration will never show when this value is <code>true</code>.
+ */
+ public boolean getShowOnlyOnFocus() {
+ return showOnlyOnFocus;
+ }
+
+ /**
+ * Set the boolean that controls whether the decoration is shown only when the control has focus. The default value of
+ * this setting is <code>false</code>.
+ *
+ * @param showOnlyOnFocus <code>true</code> if the decoration should only be shown when the control has focus, and
+ * <code>false</code> if it should always be shown. Note that if the control is not capable of receiving
+ * focus (<code>SWT.NO_FOCUS</code>), then the decoration will never show when this value is
+ * <code>true</code>.
+ */
+ public void setShowOnlyOnFocus(boolean showOnlyOnFocus) {
+ this.showOnlyOnFocus = showOnlyOnFocus;
+ update();
+ }
+
+ /**
+ * Get the boolean that controls whether the decoration's description text should be shown in a hover when the user
+ * hovers over the decoration. The default value of this setting is <code>true</code>.
+ *
+ * @return <code>true</code> if a hover popup containing the decoration's description text should be shown when the
+ * user hovers over the decoration, and <code>false</code> if a hover should not be shown.
+ */
+ public boolean getShowHover() {
+ return showHover;
+ }
+
+ /**
+ * Set the boolean that controls whether the decoration's description text should be shown in a hover when the user
+ * hovers over the decoration. The default value of this setting is <code>true</code>.
+ *
+ * @param showHover <code>true</code> if a hover popup containing the decoration's description text should be shown
+ * when the user hovers over the decoration, and <code>false</code> if a hover should not be shown.
+ */
+ public void setShowHover(boolean showHover) {
+ this.showHover = showHover;
+ update();
+ }
+
+ /**
+ * Get the margin width in pixels that should be used between the decorator and the horizontal edge of the control.
+ * The default value of this setting is <code>0</code>.
+ *
+ * @return the number of pixels that should be reserved between the horizontal edge of the control and the adjacent
+ * edge of the decoration.
+ */
+ public int getMarginWidth() {
+ return marginWidth;
+ }
+
+ /**
+ * Set the margin width in pixels that should be used between the decorator and the horizontal edge of the control.
+ * The default value of this setting is <code>0</code>.
+ *
+ * @param marginWidth the number of pixels that should be reserved between the horizontal edge of the control and the
+ * adjacent edge of the decoration.
+ */
+ public void setMarginWidth(int marginWidth) {
+ this.marginWidth = marginWidth;
+ update();
+ }
+
+ /**
+ * Something has changed, requiring redraw. Redraw the decoration and update the hover text if appropriate.
+ */
+ protected void update() {
+ if(control == null || control.isDisposed()) {
+ return;
+ }
+ Rectangle rect = getDecorationRectangle(control.getShell());
+ // Redraw this rectangle in all children
+ control.getShell().redraw(rect.x, rect.y, rect.width, rect.height, true);
+ control.getShell().update();
+ if(hover != null && getDescriptionText() != null) {
+ hover.setText(getDescriptionText(), getDecorationRectangle(control.getParent()), control);
+ }
+ }
+
+ /*
+ * Show the specified text in the hover, positioning the hover near the
+ * specified control.
+ */
+ private void showHoverText(String text, Control hoverNear) {
+ // If we aren't to show a hover, don't do anything.
+ if(!showHover) {
+ return;
+ }
+
+ // If we are not visible, don't show the hover.
+ if(!visible) {
+ return;
+ }
+ // If there is no text, don't do anything.
+ if(text == null) {
+ hideHover();
+ return;
+ }
+
+ // If there is no control, nothing to do
+ if(control == null) {
+ return;
+ }
+ // Create the hover if it's not showing
+ if(hover == null) {
+ hover = new Hover(hoverNear.getShell());
+ }
+ hover.setText(text, getDecorationRectangle(control.getParent()), control);
+ hover.setVisible(true);
+ }
+
+ /*
+ * Remove any listeners installed on the controls.
+ */
+ private void removeControlListeners() {
+ if(control == null) {
+ return;
+ }
+ printRemoveListener(control, "FOCUS"); //$NON-NLS-1$
+ control.removeFocusListener(focusListener);
+ focusListener = null;
+
+ printRemoveListener(control, "DISPOSE"); //$NON-NLS-1$
+ control.removeDisposeListener(disposeListener);
+ disposeListener = null;
+
+ Composite c = control.getParent();
+ while(c != null) {
+ removeCompositeListeners(c);
+ if(composite != null && composite == c) {
+ // We previously installed listeners only to the specified
+ // composite, so stop.
+ c = null;
+ } else if(c instanceof Shell) {
+ // We previously installed listeners only up to the first Shell
+ // encountered, so stop.
+ c = null;
+ } else {
+ c = c.getParent();
+ }
+ }
+ paintListener = null;
+ mouseTrackListener = null;
+ compositeListener = null;
+
+ // We may have a remaining mouse move listener installed
+ if(moveListeningTarget != null) {
+ printRemoveListener(moveListeningTarget, "MOUSEMOVE"); //$NON-NLS-1$
+ moveListeningTarget.removeMouseMoveListener(mouseMoveListener);
+ moveListeningTarget = null;
+ mouseMoveListener = null;
+ }
+ if(DEBUG) {
+ if(listenerInstalls > 0) {
+ System.out.println("LISTENER LEAK>>>CHECK TRACE ABOVE"); //$NON-NLS-1$
+ } else if(listenerInstalls < 0) {
+ System.out.println("REMOVED UNREGISTERED LISTENERS>>>CHECK TRACE ABOVE"); //$NON-NLS-1$
+ } else {
+ System.out.println("ALL INSTALLED LISTENERS WERE REMOVED."); //$NON-NLS-1$
+ }
+ }
+ }
+
+ /**
+ * Return the rectangle in which the decoration should be rendered, in coordinates relative to the specified control.
+ * If the specified control is null, return the rectangle in display coordinates.
+ *
+ * @param targetControl the control whose coordinates should be used
+ * @return the rectangle in which the decoration should be rendered
+ */
+ protected Rectangle getDecorationRectangle(Control targetControl) {
+ if(getImage() == null || control == null) {
+ return new Rectangle(0, 0, 0, 0);
+ }
+ // Compute the bounds first relative to the control's parent.
+ Rectangle imageBounds = getImage().getBounds();
+ Rectangle controlBounds = control.getBounds();
+ int x, y;
+ // Compute x
+ if((position & SWT.RIGHT) == SWT.RIGHT) {
+ x = controlBounds.x + controlBounds.width + marginWidth;
+ } else {
+ // default is left
+ x = controlBounds.x - imageBounds.width - marginWidth;
+ }
+ // Compute y
+ if((position & SWT.TOP) == SWT.TOP) {
+ y = controlBounds.y;
+ } else if((position & SWT.BOTTOM) == SWT.BOTTOM) {
+ y = controlBounds.y + control.getBounds().height - imageBounds.height;
+ } else {
+ // default is center
+ y = controlBounds.y + (control.getBounds().height - imageBounds.height) / 2;
+ }
+
+ // Now convert to coordinates relative to the target control.
+ Point globalPoint = control.getParent().toDisplay(x, y);
+ Point targetPoint;
+ if(targetControl == null) {
+ targetPoint = globalPoint;
+ } else {
+ targetPoint = targetControl.toControl(globalPoint);
+ }
+ return new Rectangle(targetPoint.x, targetPoint.y, imageBounds.width, imageBounds.height);
+ }
+
+ /*
+ * Return true if the decoration should be shown, false if it should not.
+ */
+ boolean shouldShowDecoration() {
+ if(!visible) {
+ return false;
+ }
+ if(control == null || control.isDisposed() || getImage() == null) {
+ return false;
+ }
+
+ if(!control.isVisible()) {
+ return false;
+ }
+ if(showOnlyOnFocus) {
+ return hasFocus;
+ }
+ return true;
+ }
+
+ /*
+ * If in debug mode, print info about adding the specified listener.
+ */
+ void printAddListener(Widget widget, String listenerType) {
+ listenerInstalls++ ;
+ if(DEBUG) {
+ System.out.println("Added listener>>>" + listenerType + " to>>>" + widget); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ }
+
+ /*
+ * If in debug mode, print info about adding the specified listener.
+ */
+ void printRemoveListener(Widget widget, String listenerType) {
+ listenerInstalls-- ;
+ if(DEBUG) {
+ System.out.println("Removed listener>>>" + listenerType + " from>>>" + widget); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/IndexSearchEngine.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/IndexSearchEngine.java
new file mode 100644
index 00000000..6ac3717b
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/IndexSearchEngine.java
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.util.search;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.eclipse.core.runtime.CoreException;
+
+import org.apache.maven.artifact.versioning.ComparableVersion;
+
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.index.MatchTyped.MatchType;
+import org.eclipse.m2e.core.index.MatchTypedStringSearchExpression;
+import org.eclipse.m2e.core.index.SearchExpression;
+
+
+/**
+ * Search engine integrating {@link IndexManager} with POM XML editor.
+ *
+ * @author Lukas Krecan
+ * @author Eugene Kuleshov
+ */
+public class IndexSearchEngine implements SearchEngine {
+
+ private final IIndex index;
+
+ public IndexSearchEngine(IIndex index) {
+ this.index = index;
+ }
+
+ protected boolean isBlank(String str) {
+ return str == null || str.trim().length() == 0;
+ }
+
+ public Collection<String> findArtifactIds(String groupId, String searchExpression, Packaging packaging,
+ ArtifactInfo containingArtifact) {
+ // TODO add support for implicit groupIds in plugin dependencies "org.apache.maven.plugins", ...
+ // Someone, give me here access to settings.xml, to be able to pick up "real" predefined groupIds added by user
+ // Currently, I am just simulating the "factory defaults" of maven, but user changes to settings.xml
+ // will not be picked up this way!
+ ArrayList<SearchExpression> groupIdSearchExpressions = new ArrayList<SearchExpression>();
+ if(isBlank(groupId)) {
+ // values from effective settings
+ // we are wiring in the defaults only, but user changes are lost!
+ // org.apache.maven.plugins
+ // org.codehaus.mojo
+ groupIdSearchExpressions.add(new MatchTypedStringSearchExpression("org.apache.maven.plugins", MatchType.EXACT));
+ groupIdSearchExpressions.add(new MatchTypedStringSearchExpression("org.codehaus.mojo", MatchType.EXACT));
+ } else {
+ groupIdSearchExpressions.add(new MatchTypedStringSearchExpression(groupId, MatchType.EXACT));
+ }
+
+ try {
+ TreeSet<String> ids = new TreeSet<String>();
+ for(IndexedArtifact artifact : index.find(groupIdSearchExpressions, null, null,
+ Collections.singleton(packaging.toSearchExpression()))) {
+ ids.add(artifact.getArtifactId());
+ }
+ return subSet(ids, searchExpression);
+ } catch(CoreException ex) {
+ throw new SearchException(ex.getMessage(), ex.getStatus().getException());
+ }
+ }
+
+ public Collection<String> findClassifiers(String groupId, String artifactId, String version, String prefix,
+ Packaging packaging) {
+ try {
+ Collection<IndexedArtifact> values = index.find(new MatchTypedStringSearchExpression(groupId, MatchType.EXACT),
+ new MatchTypedStringSearchExpression(artifactId, MatchType.EXACT), null, packaging.toSearchExpression());
+ if(values.isEmpty()) {
+ return Collections.emptySet();
+ }
+
+ TreeSet<String> ids = new TreeSet<String>();
+ Set<IndexedArtifactFile> files = values.iterator().next().getFiles();
+ for(IndexedArtifactFile artifactFile : files) {
+ if(artifactFile.classifier != null) {
+ ids.add(artifactFile.classifier);
+ }
+ }
+ return subSet(ids, prefix);
+ } catch(CoreException ex) {
+ throw new SearchException(ex.getMessage(), ex.getStatus().getException());
+ }
+ }
+
+ public Collection<String> findGroupIds(String searchExpression, Packaging packaging, ArtifactInfo containingArtifact) {
+ try {
+ TreeSet<String> ids = new TreeSet<String>();
+
+ SearchExpression groupSearchExpression = isBlank(searchExpression) ? null : new MatchTypedStringSearchExpression(
+ searchExpression, MatchType.PARTIAL);
+
+ for(IndexedArtifact artifact : index.find(groupSearchExpression, null, null, packaging.toSearchExpression())) {
+ ids.add(artifact.getGroupId());
+ }
+ return subSet(ids, searchExpression);
+ } catch(CoreException ex) {
+ throw new SearchException(ex.getMessage(), ex.getStatus().getException());
+ }
+ }
+
+ public Collection<String> findTypes(String groupId, String artifactId, String version, String prefix,
+ Packaging packaging) {
+ try {
+ Collection<IndexedArtifact> values = index.find(new MatchTypedStringSearchExpression(groupId, MatchType.EXACT),
+ new MatchTypedStringSearchExpression(artifactId, MatchType.EXACT), null, packaging.toSearchExpression());
+ if(values.isEmpty()) {
+ return Collections.emptySet();
+ }
+
+ TreeSet<String> ids = new TreeSet<String>();
+ Set<IndexedArtifactFile> files = values.iterator().next().getFiles();
+ for(IndexedArtifactFile artifactFile : files) {
+ if(artifactFile.type != null) {
+ ids.add(artifactFile.type);
+ }
+ }
+ return subSet(ids, prefix);
+ } catch(CoreException ex) {
+ throw new SearchException(ex.getMessage(), ex.getStatus().getException());
+ }
+ }
+
+ public Collection<String> findVersions(String groupId, String artifactId, String searchExpression, Packaging packaging) {
+ try {
+ Collection<IndexedArtifact> values = index.find(new MatchTypedStringSearchExpression(groupId, MatchType.EXACT),
+ new MatchTypedStringSearchExpression(artifactId, MatchType.EXACT), null, packaging.toSearchExpression());
+ if(values.isEmpty()) {
+ return Collections.emptySet();
+ }
+
+ TreeSet<String> ids = new TreeSet<String>();
+ Set<IndexedArtifactFile> files = values.iterator().next().getFiles();
+ for(IndexedArtifactFile artifactFile : files) {
+ ids.add(artifactFile.version);
+ }
+ Collection<String> result = subSet(ids, searchExpression);
+
+ // sort results according to o.a.m.artifact.versioning.ComparableVersion
+ SortedSet<ComparableVersion> versions = new TreeSet<ComparableVersion>();
+ for(String version : result) {
+ versions.add(new ComparableVersion(version));
+ }
+ result = null; // not used any more
+ List<String> sorted = new ArrayList<String>(versions.size());
+ for(ComparableVersion version : versions) {
+ sorted.add(version.toString());
+ }
+ versions = null; // not used any more
+ Collections.reverse(sorted);
+ return sorted;
+ } catch(CoreException ex) {
+ throw new SearchException(ex.getMessage(), ex.getStatus().getException());
+ }
+ }
+
+ private Collection<String> subSet(TreeSet<String> ids, String searchExpression) {
+ if(searchExpression == null || searchExpression.length() == 0) {
+ return ids;
+ }
+ int n = searchExpression.length();
+ return ids.subSet(searchExpression, //
+ searchExpression.substring(0, n - 1) + ((char) (searchExpression.charAt(n - 1) + 1)));
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/MenuDetectEvent.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/MenuDetectEvent.java
new file mode 100644
index 00000000..95d976b5
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/MenuDetectEvent.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.util.search;
+
+
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.widgets.Event;
+
+/**
+ * Instances of this class are sent whenever the platform-
+ * specific trigger for showing a context menu is detected.
+ *
+ * @see MenuDetectListener
+ * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
+ *
+ * @since 3.3
+ */
+
+public final class MenuDetectEvent extends TypedEvent {
+
+ /**
+ * the display-relative x coordinate of the pointer
+ * at the time the context menu trigger occurred
+ */
+ public int x;
+
+ /**
+ * the display-relative y coordinate of the pointer
+ * at the time the context menu trigger occurred
+ */
+ public int y;
+
+ /**
+ * A flag indicating whether the operation should be allowed.
+ * Setting this field to <code>false</code> will cancel the operation.
+ */
+ public boolean doit;
+
+ private static final long serialVersionUID = -3061660596590828941L;
+
+/**
+ * Constructs a new instance of this class based on the
+ * information in the given untyped event.
+ *
+ * @param e the untyped event containing the information
+ */
+public MenuDetectEvent(Event e) {
+ super(e);
+ this.x = e.x;
+ this.y = e.y;
+ this.doit = e.doit;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the event
+ */
+public String toString() {
+ String string = super.toString ();
+ return string.substring (0, string.length() - 1) // remove trailing '}'
+ + " x=" + x //$NON-NLS-1$
+ + " y=" + y //$NON-NLS-1$
+ + " doit=" + doit //$NON-NLS-1$
+ + "}"; //$NON-NLS-1$
+}
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/MenuDetectListener.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/MenuDetectListener.java
new file mode 100644
index 00000000..4de16ce7
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/MenuDetectListener.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.util.search;
+
+
+import java.util.EventListener;
+
+/**
+ * Classes which implement this interface provide methods
+ * that deal with the events that are generated when the
+ * platform-specific trigger for showing a context menu is
+ * detected.
+ * <p>
+ * After creating an instance of a class that implements
+ * this interface it can be added to a control or TrayItem
+ * using the <code>addMenuDetectListener</code> method and
+ * removed using the <code>removeMenuDetectListener</code> method.
+ * When the context menu trigger occurs, the
+ * <code>menuDetected</code> method will be invoked.
+ * </p>
+ *
+ * @see MenuDetectEvent
+ *
+ * @since 3.3
+ */
+public interface MenuDetectListener extends EventListener {
+
+/**
+ * Sent when the platform-dependent trigger for showing a menu item is detected.
+ *
+ * @param e an event containing information about the menu detect
+ */
+public void menuDetected (MenuDetectEvent e);
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/Packaging.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/Packaging.java
new file mode 100644
index 00000000..52f92101
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/Packaging.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.util.search;
+
+import org.eclipse.m2e.core.index.SearchExpression;
+import org.eclipse.m2e.core.index.SourcedSearchExpression;
+
+
+/**
+ * Packaging representation.
+ *
+ * @author Lukas Krecan
+ */
+public enum Packaging {
+ ALL(null), PLUGIN("maven-plugin"), // //$NON-NLS-1$
+ POM("pom"); //$NON-NLS-1$
+
+ private final String text;
+
+ private Packaging(String text) {
+ this.text = text;
+ }
+
+ /**
+ * Text representation of the packaging.
+ */
+ public String getText() {
+ return text;
+ }
+
+ public SearchExpression toSearchExpression() {
+ if(ALL.equals(this)) {
+ return null;
+ }
+
+ return new SourcedSearchExpression(getText());
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/SearchEngine.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/SearchEngine.java
new file mode 100644
index 00000000..9490a7e7
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/SearchEngine.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.util.search;
+
+import java.util.Collection;
+
+
+/**
+ * Interface to be implemented by a SearchEngine.
+ *
+ * @author Lukas Krecan
+ */
+public interface SearchEngine {
+
+ /**
+ * Finds groupIds for given expression.
+ * @param searchExpression
+ * @param packaging
+ * @param containingArtifact When looking for exclusion, contains information about artifact we are excluding from.
+ * @return
+ */
+ public Collection<String> findGroupIds(String searchExpression, Packaging packaging, ArtifactInfo containingArtifact);
+
+ /**
+ * Finds artifactIds for given expression
+ * @param groupId
+ * @param searchExpression
+ * @param packaging
+ * @param containingArtifact When looking for exclusion, contains information about artifact we are excluding from.
+ * @return
+ */
+ public Collection<String> findArtifactIds(String groupId, String searchExpression, Packaging packaging, ArtifactInfo containingArtifact);
+
+ public Collection<String> findVersions(String groupId, String artifactId, String searchExpression, Packaging packaging);
+
+ public Collection<String> findClassifiers(String groupId, String artifactId, String version, String prefix, Packaging packaging);
+
+ public Collection<String> findTypes(String groupId, String artifactId, String version, String prefix, Packaging packaging);
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/SearchException.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/SearchException.java
new file mode 100644
index 00000000..606836ed
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/util/search/SearchException.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.util.search;
+
+/**
+ * @author Lukas Krecan
+ */
+public class SearchException extends RuntimeException {
+
+ private static final long serialVersionUID = 6909305234190388928L;
+
+ public SearchException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public SearchException(String message) {
+ super(message);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/AbstractMavenWizardPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/AbstractMavenWizardPage.java
new file mode 100644
index 00000000..cac68318
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/AbstractMavenWizardPage.java
@@ -0,0 +1,218 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.DialogSettings;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+
+
+/**
+ * AbstractMavenImportWizardPage
+ *
+ * @author Eugene Kuleshov
+ */
+public abstract class AbstractMavenWizardPage extends WizardPage {
+
+ /** the history limit */
+ protected static final int MAX_HISTORY = 15;
+
+ /**
+ * The project import configuration
+ */
+ private ProjectImportConfiguration importConfiguration;
+
+ /** The resolver configuration panel */
+ protected ResolverConfigurationComponent resolverConfigurationComponent;
+
+ /** dialog settings to store input history */
+ protected IDialogSettings dialogSettings;
+
+ /** the Map of field ids to List of comboboxes that share the same history */
+ private Map<String, List<Combo>> fieldsWithHistory;
+
+ private boolean isHistoryLoaded = false;
+
+ /** @wbp.parser.constructor */
+ protected AbstractMavenWizardPage(String pageName) {
+ this(pageName, null);
+ }
+
+ /**
+ * Creates a page. This constructor should be used for the wizards where you need to have the advanced settings box on
+ * each page. Pass the same bean to each page so they can share the data.
+ */
+ protected AbstractMavenWizardPage(String pageName, ProjectImportConfiguration importConfiguration) {
+ super(pageName);
+ this.importConfiguration = importConfiguration;
+
+ fieldsWithHistory = new HashMap<String, List<Combo>>();
+
+ initDialogSettings();
+ }
+
+ public ProjectImportConfiguration getImportConfiguration() {
+ return this.importConfiguration;
+ }
+
+ /** Creates an advanced settings panel. */
+ protected void createAdvancedSettings(Composite composite, GridData gridData) {
+ if(importConfiguration != null) {
+// Label separator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
+// GridData separatorData = new GridData(SWT.FILL, SWT.TOP, false, false, gridData.horizontalSpan, 1);
+// separatorData.verticalIndent = 7;
+// separator.setLayoutData(separatorData);
+ gridData.verticalIndent = 7;
+
+ resolverConfigurationComponent = new ResolverConfigurationComponent(composite, importConfiguration, true);
+ resolverConfigurationComponent.setLayoutData(gridData);
+ addFieldWithHistory("projectNameTemplate", resolverConfigurationComponent.template); //$NON-NLS-1$
+ }
+ }
+
+ /** Loads the advanced settings data when the page is displayed. */
+ public void setVisible(boolean visible) {
+ if(visible) {
+ if(!isHistoryLoaded) {
+ // load data before history kicks in
+ if(resolverConfigurationComponent != null) {
+ resolverConfigurationComponent.loadData();
+ }
+ loadInputHistory();
+ isHistoryLoaded = true;
+ } else {
+ saveInputHistory();
+ }
+ if(resolverConfigurationComponent != null) {
+ resolverConfigurationComponent.loadData();
+ }
+ }
+ super.setVisible(visible);
+ }
+
+ /** Saves the history when the page is disposed. */
+ public void dispose() {
+ saveInputHistory();
+ super.dispose();
+ }
+
+ /** Loads the dialog settings using the page name as a section name. */
+ private void initDialogSettings() {
+ IDialogSettings pluginSettings;
+
+ // This is strictly to get SWT Designer working locally without blowing up.
+ if( MavenPlugin.getDefault() == null ) {
+ pluginSettings = new DialogSettings("Workbench");
+ }
+ else {
+ pluginSettings = MavenPlugin.getDefault().getDialogSettings();
+ }
+
+ dialogSettings = pluginSettings.getSection(getName());
+ if(dialogSettings == null) {
+ dialogSettings = pluginSettings.addNewSection(getName());
+ pluginSettings.addSection(dialogSettings);
+ }
+ }
+
+ /** Loads the input history from the dialog settings. */
+ private void loadInputHistory() {
+ for(Map.Entry<String, List<Combo>> e : fieldsWithHistory.entrySet()) {
+ String id = e.getKey();
+ String[] items = dialogSettings.getArray(id);
+ if(items != null) {
+ for(Combo combo : e.getValue()) {
+ String text = combo.getText();
+ combo.setItems(items);
+ if(text.length() > 0) {
+ // setItems() clears the text input, so we need to restore it
+ combo.setText(text);
+ }
+ }
+ }
+ }
+ }
+
+ /** Saves the input history into the dialog settings. */
+ private void saveInputHistory() {
+ for(Map.Entry<String, List<Combo>> e : fieldsWithHistory.entrySet()) {
+ String id = e.getKey();
+
+ Set<String> history = new LinkedHashSet<String>(MAX_HISTORY);
+
+ for(Combo combo : e.getValue()) {
+ String lastValue = combo.getText();
+ if(lastValue != null && lastValue.trim().length() > 0) {
+ history.add(lastValue);
+ }
+ }
+
+ Combo combo = e.getValue().iterator().next();
+ String[] items = combo.getItems();
+ for(int j = 0; j < items.length && history.size() < MAX_HISTORY; j++ ) {
+ history.add(items[j]);
+ }
+
+ dialogSettings.put(id, history.toArray(new String[history.size()]));
+ }
+ }
+
+ /** Adds an input control to the list of fields to save. */
+ protected void addFieldWithHistory(String id, Combo combo) {
+ if(combo != null) {
+ List<Combo> combos = fieldsWithHistory.get(id);
+ if(combos == null) {
+ combos = new ArrayList<Combo>();
+ fieldsWithHistory.put(id, combos);
+ }
+ combos.add(combo);
+ }
+ }
+
+ protected String validateIdInput(String text, String id) {
+ if(text == null || text.length() == 0) {
+ return Messages.getString("wizard.project.page.maven2.validator." + id + "ID"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ if(text.contains(" ")) { //$NON-NLS-1$
+ return Messages.getString("wizard.project.page.maven2.validator." + id + "IDnospaces"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ IStatus nameStatus = ResourcesPlugin.getWorkspace().validateName(text, IResource.PROJECT);
+ if(!nameStatus.isOK()) {
+ return Messages.getString("wizard.project.page.maven2.validator." + id + "IDinvalid", nameStatus.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ if(!text.matches("[A-Za-z0-9_\\-.]+")) { //$NON-NLS-1$
+ return Messages.getString("wizard.project.page.maven2.validator." + id + "IDinvalid", text); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ return null;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/CustomArchetypeDialog.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/CustomArchetypeDialog.java
new file mode 100644
index 00000000..bd919d54
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/CustomArchetypeDialog.java
@@ -0,0 +1,252 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.DialogSettings;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.internal.Messages;
+
+/**
+ * Custom Archetype dialog
+ *
+ * @author Eugene Kuleshov
+ */
+public class CustomArchetypeDialog extends TitleAreaDialog {
+
+ private static final String DIALOG_SETTINGS = CustomArchetypeDialog.class.getName();
+
+ private static final String KEY_ARCHETYPE_GROUP_ID = "archetypeGroupId"; //$NON-NLS-1$
+
+ private static final String KEY_ARCHETYPE_ARTIFACT_ID = "archetypeArtifactId"; //$NON-NLS-1$
+
+ private static final String KEY_ARCHETYPE_VERSION = "archetypeVersion"; //$NON-NLS-1$
+
+ private static final String KEY_REPOSITORY_URL = "repositoryUrl"; //$NON-NLS-1$
+
+ private static final int MAX_HISTORY = 15;
+
+ private String title;
+
+ private String message;
+
+ private Combo archetypeGroupIdCombo;
+
+ private Combo archetypeArtifactIdCombo;
+
+ private Combo archetypeVersionCombo;
+
+ private Combo repositoryCombo;
+
+ private IDialogSettings dialogSettings;
+
+ private String archetypeArtifactId;
+
+ private String archetypeGroupId;
+
+ private String archetypeVersion;
+
+ private String repositoryUrl;
+
+ protected CustomArchetypeDialog(Shell shell, String title) {
+ super(shell);
+ this.title = title;
+ this.message = Messages.CustomArchetypeDialog_message;
+ setShellStyle(SWT.DIALOG_TRIM);
+
+ IDialogSettings pluginSettings = MavenPlugin.getDefault().getDialogSettings();
+ dialogSettings = pluginSettings.getSection(DIALOG_SETTINGS);
+ if(dialogSettings == null) {
+ dialogSettings = new DialogSettings(DIALOG_SETTINGS);
+ pluginSettings.addSection(dialogSettings);
+ }
+ }
+
+ protected Control createContents(Composite parent) {
+ Control control = super.createContents(parent);
+ setTitle(title);
+ setMessage(message);
+ return control;
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ Composite composite1 = (Composite) super.createDialogArea(parent);
+
+ Composite composite = new Composite(composite1, SWT.NONE);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginTop = 7;
+ gridLayout.marginWidth = 12;
+ gridLayout.numColumns = 2;
+ composite.setLayout(gridLayout);
+
+ Label archetypeGroupIdLabel = new Label(composite, SWT.NONE);
+ archetypeGroupIdLabel.setText(Messages.CustomArchetypeDialog_lblArchetypegroupId);
+
+ archetypeGroupIdCombo = new Combo(composite, SWT.NONE);
+ GridData archetypeGroupIdComboData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ archetypeGroupIdComboData.widthHint = 350;
+ archetypeGroupIdCombo.setLayoutData(archetypeGroupIdComboData);
+ archetypeGroupIdCombo.setItems(getSavedValues(KEY_ARCHETYPE_GROUP_ID));
+ archetypeGroupIdCombo.setData("name", "archetypeGroupId"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Label archetypeArtifactIdLabel = new Label(composite, SWT.NONE);
+ archetypeArtifactIdLabel.setText(Messages.CustomArchetypeDialog_lblArchetypeartifactid);
+
+ archetypeArtifactIdCombo = new Combo(composite, SWT.NONE);
+ archetypeArtifactIdCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ archetypeArtifactIdCombo.setItems(getSavedValues(KEY_ARCHETYPE_ARTIFACT_ID));
+ archetypeArtifactIdCombo.setData("name", "archetypeArtifactId"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Label archetypeVersionLabel = new Label(composite, SWT.NONE);
+ archetypeVersionLabel.setText(Messages.CustomArchetypeDialog_lblArchetypeversion);
+
+ archetypeVersionCombo = new Combo(composite, SWT.NONE);
+ archetypeVersionCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ archetypeVersionCombo.setItems(getSavedValues(KEY_ARCHETYPE_VERSION));
+ archetypeVersionCombo.setData("name", "archetypeVersion"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Label repositoryLabel = new Label(composite, SWT.NONE);
+ repositoryLabel.setText(Messages.CustomArchetypeDialog_lblRepo);
+
+ repositoryCombo = new Combo(composite, SWT.NONE);
+ repositoryCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ repositoryCombo.setItems(getSavedValues(KEY_REPOSITORY_URL));
+ repositoryCombo.setData("name", "repository"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ ModifyListener modifyListener = new ModifyListener() {
+ public void modifyText(final ModifyEvent e) {
+ update();
+ }
+ };
+
+ archetypeGroupIdCombo.addModifyListener(modifyListener);
+ archetypeArtifactIdCombo.addModifyListener(modifyListener);
+ archetypeVersionCombo.addModifyListener(modifyListener);
+ repositoryCombo.addModifyListener(modifyListener);
+
+// fullIndexButton = new Button(composite, SWT.CHECK);
+// fullIndexButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
+// fullIndexButton.setText("&Full Index");
+// fullIndexButton.setSelection(true);
+
+ return composite;
+ }
+
+ private String[] getSavedValues(String key) {
+ String[] array = dialogSettings.getArray(key);
+ return array == null ? new String[0] : array;
+ }
+
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ shell.setText(title);
+ }
+
+ public void create() {
+ super.create();
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ }
+
+ protected void okPressed() {
+ archetypeArtifactId = archetypeArtifactIdCombo.getText().trim();
+ archetypeGroupId = archetypeGroupIdCombo.getText().trim();
+ archetypeVersion = archetypeVersionCombo.getText().trim();
+ repositoryUrl = repositoryCombo.getText().trim();
+
+ saveValue(KEY_ARCHETYPE_GROUP_ID, archetypeGroupId);
+ saveValue(KEY_ARCHETYPE_ARTIFACT_ID, archetypeArtifactId);
+ saveValue(KEY_ARCHETYPE_VERSION, archetypeVersion);
+ saveValue(KEY_REPOSITORY_URL, repositoryUrl);
+
+ super.okPressed();
+ }
+
+ public String getArchetypeGroupId() {
+ return archetypeGroupId;
+ }
+
+ public String getArchetypeArtifactId() {
+ return archetypeArtifactId;
+ }
+
+ public String getArchetypeVersion() {
+ return archetypeVersion;
+ }
+
+ public String getRepositoryUrl() {
+ return repositoryUrl;
+ }
+
+ private void saveValue(String key, String value) {
+ List<String> dirs = new ArrayList<String>();
+ dirs.addAll(Arrays.asList(getSavedValues(key)));
+
+ dirs.remove(value);
+ dirs.add(0, value);
+
+ if(dirs.size() > MAX_HISTORY) {
+ dirs = dirs.subList(0, MAX_HISTORY);
+ }
+
+ dialogSettings.put(key, dirs.toArray(new String[dirs.size()]));
+ }
+
+ void update() {
+ boolean isValid = isValid();
+ // verifyButton.setEnabled(isValid);
+ getButton(IDialogConstants.OK_ID).setEnabled(isValid);
+ }
+
+ private boolean isValid() {
+ setErrorMessage(null);
+ setMessage(null, IStatus.WARNING);
+
+ if(archetypeGroupIdCombo.getText().trim().length()==0) {
+ setErrorMessage(Messages.CustomArchetypeDialog_error_grid);
+ return false;
+ }
+
+ if(archetypeArtifactIdCombo.getText().trim().length()==0) {
+ setErrorMessage(Messages.CustomArchetypeDialog_error_artid);
+ return false;
+ }
+
+ if(archetypeVersionCombo.getText().trim().length()==0) {
+ setErrorMessage(Messages.CustomArchetypeDialog_error_version);
+ return false;
+ }
+
+ // TODO check if archetype available locally
+
+ return true;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenArtifactComponent.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenArtifactComponent.java
new file mode 100644
index 00000000..9935ca36
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenArtifactComponent.java
@@ -0,0 +1,270 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.core.Messages;
+
+
+public class MavenArtifactComponent extends Composite {
+
+ public static final String JAR = "jar"; //$NON-NLS-1$
+
+ public static final String WAR = "war"; //$NON-NLS-1$
+
+ public static final String EAR = "ear"; //$NON-NLS-1$
+
+ public static final String RAR = "rar"; //$NON-NLS-1$
+
+ public static final String POM = "pom"; //$NON-NLS-1$
+
+ // MNGECLIPSE-688 add EJB Support
+ public static final String EJB = "ejb"; //$NON-NLS-1$
+
+ public static final String[] PACKAGING_OPTIONS = {JAR, WAR, EJB, EAR, RAR, POM, //
+ "maven-plugin", "maven-archetype", "osgi-bundle", "eclipse-plugin"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ public static final String DEFAULT_PACKAGING = JAR;
+
+ public static final String DEFAULT_VERSION = "0.0.1-SNAPSHOT"; //$NON-NLS-1$
+
+ /** group id text field */
+ protected Combo groupIdCombo;
+
+ /** artifact id text field */
+ protected Combo artifactIdCombo;
+
+ /** version text field */
+ protected Combo versionCombo;
+
+ /** packaging options combobox */
+ protected Combo packagingCombo;
+
+ /** name text field */
+ protected Combo nameCombo;
+
+ /** description text field */
+ protected Text descriptionText;
+
+ private ModifyListener modifyingListener;
+
+ private Label groupIdlabel;
+
+ private Label artifactIdLabel;
+
+ private Label versionLabel;
+
+ private Label packagingLabel;
+
+ private Label nameLabel;
+
+ private Label descriptionLabel;
+
+ /** Creates a new component. */
+ public MavenArtifactComponent(Composite parent, int styles) {
+ super(parent, styles);
+
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ layout.numColumns = 2;
+ setLayout(layout);
+
+ Group artifactGroup = new Group(this, SWT.NONE);
+ artifactGroup.setText(Messages.getString("artifactComponent.artifact")); //$NON-NLS-1$
+ GridData gd_artifactGroup = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1);
+ artifactGroup.setLayoutData(gd_artifactGroup);
+ artifactGroup.setLayout(new GridLayout(2, false));
+
+ groupIdlabel = new Label(artifactGroup, SWT.NONE);
+ groupIdlabel.setText(Messages.getString("artifactComponent.groupId")); //$NON-NLS-1$
+
+ groupIdCombo = new Combo(artifactGroup, SWT.BORDER);
+ groupIdCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
+ groupIdCombo.setData("name", "groupIdCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ artifactIdLabel = new Label(artifactGroup, SWT.NONE);
+ artifactIdLabel.setText(Messages.getString("artifactComponent.artifactId")); //$NON-NLS-1$
+
+ artifactIdCombo = new Combo(artifactGroup, SWT.BORDER);
+ artifactIdCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
+ artifactIdCombo.setData("name", "artifactIdCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ versionLabel = new Label(artifactGroup, SWT.NONE);
+ versionLabel.setText(Messages.getString("artifactComponent.version")); //$NON-NLS-1$
+
+ versionCombo = new Combo(artifactGroup, SWT.BORDER);
+ versionCombo.setLayoutData(new GridData(150, SWT.DEFAULT));
+ versionCombo.setText(DEFAULT_VERSION);
+ versionCombo.setData("name", "versionCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ packagingLabel = new Label(artifactGroup, SWT.NONE);
+ packagingLabel.setText(Messages.getString("artifactComponent.packaging")); //$NON-NLS-1$
+
+ packagingCombo = new Combo(artifactGroup, SWT.NONE);
+ packagingCombo.setItems(PACKAGING_OPTIONS);
+ packagingCombo.setText(DEFAULT_PACKAGING);
+ packagingCombo.setLayoutData(new GridData(150, SWT.DEFAULT));
+ packagingCombo.setData("name", "packagingCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ nameLabel = new Label(artifactGroup, SWT.NONE);
+ nameLabel.setLayoutData(new GridData());
+ nameLabel.setText(Messages.getString("artifactComponent.name")); //$NON-NLS-1$
+
+ nameCombo = new Combo(artifactGroup, SWT.BORDER);
+ nameCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ nameCombo.setData("name", "nameCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ descriptionLabel = new Label(artifactGroup, SWT.NONE);
+ descriptionLabel.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false));
+ descriptionLabel.setText(Messages.getString("artifactComponent.description")); //$NON-NLS-1$
+
+ descriptionText = new Text(artifactGroup, SWT.V_SCROLL | SWT.BORDER | SWT.WRAP);
+ GridData gd_descriptionText = new GridData(SWT.FILL, SWT.FILL, false, true);
+ gd_descriptionText.minimumHeight = 20;
+ descriptionText.setLayoutData(gd_descriptionText);
+ descriptionText.setData("name", "descriptionText"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void setModifyingListener(ModifyListener modifyingListener) {
+ this.modifyingListener = modifyingListener;
+
+ groupIdCombo.addModifyListener(modifyingListener);
+ artifactIdCombo.addModifyListener(modifyingListener);
+ versionCombo.addModifyListener(modifyingListener);
+ packagingCombo.addModifyListener(modifyingListener);
+ }
+
+ public void dispose() {
+ super.dispose();
+
+ if(modifyingListener != null) {
+ groupIdCombo.removeModifyListener(modifyingListener);
+ artifactIdCombo.removeModifyListener(modifyingListener);
+ versionCombo.removeModifyListener(modifyingListener);
+ packagingCombo.removeModifyListener(modifyingListener);
+ }
+ }
+
+ public String getModelName() {
+ return nameCombo.getText();
+ }
+
+ public String getArtifactId() {
+ return this.artifactIdCombo.getText();
+ }
+
+ public String getGroupId() {
+ return this.groupIdCombo.getText();
+ }
+
+ public String getVersion() {
+ return this.versionCombo.getText();
+ }
+
+ public String getPackaging() {
+ return packagingCombo.getText();
+ }
+
+ public String getDescription() {
+ return descriptionText.getText();
+ }
+
+ public void setModelName(String name) {
+ nameCombo.setText(name);
+ }
+
+ public void setGroupId(String groupId) {
+ this.groupIdCombo.setText(groupId);
+ }
+
+ public void setArtifactId(String artifact) {
+ this.artifactIdCombo.setText(artifact);
+ }
+
+ public void setVersion(String version) {
+ versionCombo.setText(version);
+ }
+
+ public void setPackaging(String packaging) {
+ if(packagingCombo != null) {
+ packagingCombo.setText(packaging);
+ }
+ }
+
+ public void setDescription(String description) {
+ if(descriptionText != null) {
+ descriptionText.setText(description);
+ }
+ }
+
+ public Model getModel() {
+ Model model = new Model();
+ model.setModelVersion("4.0.0"); //$NON-NLS-1$
+
+ model.setGroupId(getGroupId());
+ model.setArtifactId(getArtifactId());
+ model.setVersion(getVersion());
+ model.setPackaging(getPackaging());
+
+ if(getModelName().length()>0) {
+ model.setName(getModelName());
+ }
+ if(getDescription().length()>0) {
+ model.setDescription(getDescription());
+ }
+
+ return model;
+ }
+
+ /** Enables or disables the artifact id text field. */
+ public void setArtifactIdEditable(boolean b) {
+ artifactIdCombo.setEnabled(b);
+ }
+
+ public Combo getGroupIdCombo() {
+ return groupIdCombo;
+ }
+
+ public Combo getArtifactIdCombo() {
+ return artifactIdCombo;
+ }
+
+ public Combo getVersionCombo() {
+ return versionCombo;
+ }
+
+ public Combo getNameCombo() {
+ return nameCombo;
+ }
+
+ public void setWidthGroup(WidthGroup widthGroup) {
+ widthGroup.addControl(this.groupIdlabel);
+ widthGroup.addControl(this.artifactIdLabel);
+ widthGroup.addControl(this.versionLabel);
+ widthGroup.addControl(this.packagingLabel);
+ widthGroup.addControl(this.nameLabel);
+ widthGroup.addControl(this.descriptionLabel);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenCheckoutLocationPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenCheckoutLocationPage.java
new file mode 100644
index 00000000..e840467e
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenCheckoutLocationPage.java
@@ -0,0 +1,424 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+import org.apache.maven.model.Scm;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.scm.ScmHandlerFactory;
+import org.eclipse.m2e.core.scm.ScmHandlerUi;
+import org.eclipse.m2e.core.scm.ScmTag;
+import org.eclipse.m2e.core.scm.ScmUrl;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class MavenCheckoutLocationPage extends AbstractMavenWizardPage {
+
+ String scmType;
+ ScmUrl[] scmUrls;
+ String scmParentUrl;
+
+ Combo scmTypeCombo;
+
+ Combo scmUrlCombo;
+
+ Button scmUrlBrowseButton;
+
+ Button headRevisionButton;
+
+ Label revisionLabel;
+
+ Text revisionText;
+
+ Button revisionBrowseButton;
+
+ private Button checkoutAllProjectsButton;
+
+ protected MavenCheckoutLocationPage(ProjectImportConfiguration projectImportConfiguration) {
+ super("MavenCheckoutLocationPage", projectImportConfiguration);
+ setTitle(Messages.MavenCheckoutLocationPage_title);
+ setDescription(Messages.MavenCheckoutLocationPage_description);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(5, false);
+ gridLayout.verticalSpacing = 0;
+ composite.setLayout(gridLayout);
+ setControl(composite);
+
+ SelectionAdapter selectionAdapter = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updatePage();
+ }
+ };
+
+ if(scmUrls == null || scmUrls.length < 2) {
+ Label urlLabel = new Label(composite, SWT.NONE);
+ urlLabel.setLayoutData(new GridData());
+ urlLabel.setText(Messages.MavenCheckoutLocationPage_lblurl);
+
+ scmTypeCombo = new Combo(composite, SWT.READ_ONLY);
+ scmTypeCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ scmTypeCombo.setData("name", "mavenCheckoutLocation.typeCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+ String[] types = ScmHandlerFactory.getTypes();
+ for(int i = 0; i < types.length; i++ ) {
+ scmTypeCombo.add(types[i]);
+ }
+ scmTypeCombo.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ String newScmType = scmTypeCombo.getText();
+ if(!newScmType.equals(scmType)) {
+ scmType = newScmType;
+ scmUrlCombo.setText(""); //$NON-NLS-1$
+ updatePage();
+ }
+ }
+ });
+
+ if(scmUrls!=null && scmUrls.length == 1) {
+ try {
+ scmType = ScmUrl.getType(scmUrls[0].getUrl());
+ } catch(CoreException ex) {
+ }
+ }
+
+ scmUrlCombo = new Combo(composite, SWT.NONE);
+ scmUrlCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ scmUrlCombo.setData("name", "mavenCheckoutLocation.urlCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ scmUrlBrowseButton = new Button(composite, SWT.NONE);
+ scmUrlBrowseButton.setLayoutData(new GridData());
+ scmUrlBrowseButton.setText(Messages.MavenCheckoutLocationPage_btnBrowse);
+ }
+
+ headRevisionButton = new Button(composite, SWT.CHECK);
+ GridData headRevisionButtonData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 5, 1);
+ headRevisionButtonData.verticalIndent = 5;
+ headRevisionButton.setLayoutData(headRevisionButtonData);
+ headRevisionButton.setText(Messages.MavenCheckoutLocationPage_btnHead);
+ headRevisionButton.setSelection(true);
+ headRevisionButton.addSelectionListener(selectionAdapter);
+
+ revisionLabel = new Label(composite, SWT.RADIO);
+ GridData revisionButtonData = new GridData();
+ revisionButtonData.horizontalIndent = 10;
+ revisionLabel.setLayoutData(revisionButtonData);
+ revisionLabel.setText(Messages.MavenCheckoutLocationPage_lblRevision);
+ // revisionButton.addSelectionListener(selectionAdapter);
+
+ revisionText = new Text(composite, SWT.BORDER);
+ GridData revisionTextData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
+ revisionTextData.widthHint = 115;
+ revisionTextData.verticalIndent = 3;
+ revisionText.setLayoutData(revisionTextData);
+
+ if(scmUrls != null) {
+ ScmTag tag = scmUrls[0].getTag();
+ if(tag!=null) {
+ headRevisionButton.setSelection(false);
+ revisionText.setText(tag.getName());
+ }
+ }
+
+ revisionText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ updatePage();
+ }
+ });
+
+ revisionBrowseButton = new Button(composite, SWT.NONE);
+ GridData gd_revisionBrowseButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
+ gd_revisionBrowseButton.verticalIndent = 3;
+ revisionBrowseButton.setLayoutData(gd_revisionBrowseButton);
+ revisionBrowseButton.setText(Messages.MavenCheckoutLocationPage_btnRevSelect);
+ revisionBrowseButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ String url = scmParentUrl;
+ if(url==null) {
+ return;
+ }
+
+ String scmType = scmTypeCombo.getText();
+
+ ScmHandlerUi handlerUi = ScmHandlerFactory.getHandlerUiByType(scmType);
+ String revision = handlerUi.selectRevision(getShell(), scmUrls[0], revisionText.getText());
+ if(revision!=null) {
+ revisionText.setText(revision);
+ headRevisionButton.setSelection(false);
+ updatePage();
+ }
+ }
+ });
+
+ checkoutAllProjectsButton = new Button(composite, SWT.CHECK);
+ GridData checkoutAllProjectsData = new GridData(SWT.LEFT, SWT.TOP, true, false, 5, 1);
+ checkoutAllProjectsData.verticalIndent = 10;
+ checkoutAllProjectsButton.setLayoutData(checkoutAllProjectsData);
+ checkoutAllProjectsButton.setText(Messages.MavenCheckoutLocationPage_btnCheckout);
+ checkoutAllProjectsButton.setSelection(true);
+ checkoutAllProjectsButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updatePage();
+ }
+ });
+
+ GridData advancedSettingsData = new GridData(SWT.FILL, SWT.TOP, true, false, 5, 1);
+ advancedSettingsData.verticalIndent = 10;
+ createAdvancedSettings(composite, advancedSettingsData);
+
+ if(scmUrls!=null && scmUrls.length == 1) {
+ scmTypeCombo.setText(scmType == null ? "" : scmType); //$NON-NLS-1$
+ scmUrlCombo.setText(scmUrls[0].getProviderUrl());
+ }
+
+ if(scmUrls == null || scmUrls.length < 2) {
+ scmUrlBrowseButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ ScmHandlerUi handlerUi = ScmHandlerFactory.getHandlerUiByType(scmType);
+ // XXX should use null if there is no scmUrl selected
+ ScmUrl currentUrl = scmUrls==null || scmUrls.length==0 ? new ScmUrl("scm:" + scmType + ":") : scmUrls[0]; //$NON-NLS-1$ //$NON-NLS-2$
+ ScmUrl scmUrl = handlerUi.selectUrl(getShell(), currentUrl);
+ if(scmUrl!=null) {
+ scmUrlCombo.setText(scmUrl.getProviderUrl());
+ if(scmUrls==null) {
+ scmUrls = new ScmUrl[1];
+ }
+ scmUrls[0] = scmUrl;
+ scmParentUrl = scmUrl.getUrl();
+ updatePage();
+ }
+ }
+ });
+
+ scmUrlCombo.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ final String url = scmUrlCombo.getText();
+ if(url.startsWith("scm:")) { //$NON-NLS-1$
+ try {
+ final String type = ScmUrl.getType(url);
+ scmTypeCombo.setText(type);
+ scmType = type;
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ scmUrlCombo.setText(url.substring(type.length() + 5));
+ }
+ });
+ } catch(CoreException ex) {
+ }
+ return;
+ }
+
+ if(scmUrls==null) {
+ scmUrls = new ScmUrl[1];
+ }
+
+ ScmUrl scmUrl = new ScmUrl("scm:" + scmType + ":" + url); //$NON-NLS-1$ //$NON-NLS-2$
+ scmUrls[0] = scmUrl;
+ scmParentUrl = scmUrl.getUrl();
+ updatePage();
+ }
+ });
+ }
+
+ updatePage();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.wizards.AbstractMavenWizardPage#setVisible(boolean)
+ */
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+
+ if(dialogSettings!=null && scmUrlCombo!=null) {
+ String[] items = dialogSettings.getArray("scmUrl"); //$NON-NLS-1$
+ if(items != null) {
+ String text = scmUrlCombo.getText();
+ scmUrlCombo.setItems(items);
+ if (text.length() > 0) {
+ // setItems() clears the text input, so we need to restore it
+ scmUrlCombo.setText(text);
+ }
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.wizards.AbstractMavenWizardPage#dispose()
+ */
+ public void dispose() {
+ if(dialogSettings != null && scmUrlCombo!=null) {
+ Set<String> history = new LinkedHashSet<String>(MAX_HISTORY);
+
+ String lastValue = scmUrlCombo.getText();
+ if ( lastValue!=null && lastValue.trim().length() > 0 ) {
+ history.add("scm:" + scmType + ":" + lastValue); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ String[] items = scmUrlCombo.getItems();
+ for(int j = 0; j < items.length && history.size() < MAX_HISTORY; j++ ) {
+ history.add(items[j]);
+ }
+
+ dialogSettings.put("scmUrl", history.toArray(new String[history.size()])); //$NON-NLS-1$
+ }
+
+ super.dispose();
+ }
+
+ public IWizardContainer getContainer() {
+ return super.getContainer();
+ }
+
+ void updatePage() {
+ boolean canSelectUrl = false ;
+ boolean canSelectRevision = false;
+ ScmHandlerUi handlerUi = ScmHandlerFactory.getHandlerUiByType(scmType);
+ if(handlerUi!=null) {
+ canSelectUrl = handlerUi.canSelectUrl();
+ canSelectRevision = handlerUi.canSelectRevision();
+ }
+
+ if(scmUrlBrowseButton!=null) {
+ scmUrlBrowseButton.setEnabled(canSelectUrl);
+ }
+
+ revisionBrowseButton.setEnabled(canSelectRevision);
+
+ boolean isHeadRevision = isHeadRevision();
+ revisionLabel.setEnabled(!isHeadRevision);
+ revisionText.setEnabled(!isHeadRevision);
+
+ setPageComplete(isPageValid());
+ }
+
+ private boolean isPageValid() {
+ setErrorMessage(null);
+
+ if(scmUrls != null && scmUrls.length < 2) {
+ if(scmType == null) {
+ setErrorMessage(Messages.MavenCheckoutLocationPage_error_empty);
+ return false;
+ }
+ }
+
+ ScmHandlerUi handlerUi = ScmHandlerFactory.getHandlerUiByType(scmType);
+
+ if(scmUrls == null || scmUrls.length < 2) {
+ if(scmUrls == null || scmUrls.length == 0) {
+ setErrorMessage(Messages.MavenCheckoutLocationPage_error_empty_url);
+ return false;
+ }
+
+ if(handlerUi!=null && !handlerUi.isValidUrl(scmUrls[0].getUrl())) {
+ setErrorMessage(Messages.MavenCheckoutLocationPage_error_url_empty);
+ return false;
+ }
+ }
+
+ if(!isHeadRevision()) {
+ String revision = revisionText.getText().trim();
+ if(revision.length()==0) {
+ setErrorMessage(Messages.MavenCheckoutLocationPage_error_scm_empty);
+ return false;
+ }
+
+ if(handlerUi!=null && !handlerUi.isValidRevision(null, revision)) {
+ setErrorMessage(Messages.MavenCheckoutLocationPage_error_scm_invalid);
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public void setParent(String parentUrl) {
+ this.scmParentUrl = parentUrl;
+ }
+
+ public void setUrls(ScmUrl[] urls) {
+ this.scmUrls = urls;
+ }
+
+ public ScmUrl[] getUrls() {
+ return scmUrls;
+ }
+
+ public Scm[] getScms() {
+ if(scmUrls==null) {
+ return new Scm[0];
+ }
+
+ String revision = getRevision();
+ Scm[] scms = new Scm[scmUrls.length];
+ for(int i = 0; i < scms.length; i++ ) {
+ Scm scm = new Scm();
+ scm.setConnection(scmUrls[i].getUrl());
+ scm.setTag(revision);
+ scms[i] = scm;
+ }
+ return scms;
+ }
+
+ public boolean isCheckoutAllProjects() {
+ return checkoutAllProjectsButton.getSelection();
+ }
+
+ public boolean isHeadRevision() {
+ return headRevisionButton.getSelection();
+ }
+
+ public String getRevision() {
+ if(isHeadRevision()) {
+ return "HEAD"; //$NON-NLS-1$
+ }
+ return revisionText.getText().trim();
+ }
+
+ public void addListener(final SelectionListener listener) {
+ ModifyListener listenerProxy = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ Event event = new Event();
+ event.widget = e.widget;
+ listener.widgetSelected(new SelectionEvent(event));
+ }
+ };
+ scmUrlCombo.addModifyListener(listenerProxy);
+ revisionText.addModifyListener(listenerProxy);
+ headRevisionButton.addSelectionListener(listener);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenCheckoutWizard.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenCheckoutWizard.java
new file mode 100644
index 00000000..53f3b54a
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenCheckoutWizard.java
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.apache.maven.model.Scm;
+
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.MavenProjectScmInfo;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.scm.ScmUrl;
+
+
+/**
+ * Maven checkout wizard
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenCheckoutWizard extends Wizard implements IImportWizard, INewWizard {
+
+ private final ProjectImportConfiguration importConfiguration = new ProjectImportConfiguration();
+
+ private ScmUrl[] urls;
+
+ private String parentUrl;
+
+ private MavenCheckoutLocationPage scheckoutPage;
+
+ private MavenProjectWizardLocationPage locationPage;
+
+ private IStructuredSelection selection;
+
+
+ public MavenCheckoutWizard() {
+ this(null);
+ setNeedsProgressMonitor(true);
+ }
+
+ public MavenCheckoutWizard(ScmUrl[] urls) {
+ setUrls(urls);
+ setNeedsProgressMonitor(true);
+ setWindowTitle(Messages.MavenCheckoutWizard_title);
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+
+ importConfiguration.setWorkingSet(SelectionUtil.getSelectedWorkingSet(selection));
+
+ ArrayList<ScmUrl> urls = new ArrayList<ScmUrl>();
+ IAdapterManager adapterManager = Platform.getAdapterManager();
+ for(Iterator<?> it = selection.iterator(); it.hasNext();) {
+ ScmUrl url = (ScmUrl) adapterManager.getAdapter(it.next(), ScmUrl.class);
+ if(url!=null) {
+ urls.add(url);
+ }
+ }
+ setUrls(urls.toArray(new ScmUrl[urls.size()]));
+ }
+
+ private void setUrls(ScmUrl[] urls) {
+ if(urls!=null && urls.length>0) {
+ this.urls = urls;
+ this.parentUrl = getParentUrl(urls);
+ }
+ }
+
+ private String getParentUrl(ScmUrl[] urls) {
+ if(urls.length==1) {
+ return urls[0].getUrl();
+ }
+
+ String parent = urls[0].getParentUrl();
+ for(int i = 1; parent!=null && i < urls.length; i++ ) {
+ String url = urls[i].getParentUrl();
+ if(!parent.equals(url)) {
+ parent = null;
+ }
+ }
+ return parent;
+ }
+
+ public void addPages() {
+ scheckoutPage = new MavenCheckoutLocationPage(importConfiguration);
+ scheckoutPage.setUrls(urls);
+ scheckoutPage.setParent(parentUrl);
+
+ locationPage = new MavenProjectWizardLocationPage(importConfiguration, //
+ Messages.MavenCheckoutWizard_location1,
+ Messages.MavenCheckoutWizard_location2);
+ locationPage.setLocationPath(SelectionUtil.getSelectedLocation(selection));
+
+ addPage(scheckoutPage);
+ addPage(locationPage);
+ }
+
+// /** Adds the listeners after the page controls are created. */
+// public void createPageControls(Composite pageContainer) {
+// super.createPageControls(pageContainer);
+//
+// locationPage.addListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent e) {
+// projectsPage.setScms(locationPage.getScms(new NullProgressMonitor()));
+// }
+// });
+//
+// projectsPage.setScms(locationPage.getScms(new NullProgressMonitor()));
+// }
+
+ public boolean canFinish() {
+ if(scheckoutPage.isCheckoutAllProjects() && scheckoutPage.isPageComplete()) {
+ return true;
+ }
+ return super.canFinish();
+ }
+
+ public boolean performFinish() {
+ if(!canFinish()) {
+ return false;
+ }
+
+ final boolean checkoutAllProjects = scheckoutPage.isCheckoutAllProjects();
+
+ Scm[] scms = scheckoutPage.getScms();
+
+ final Collection<MavenProjectScmInfo> mavenProjects = new ArrayList<MavenProjectScmInfo>();
+ for(int i = 0; i < scms.length; i++ ) {
+ String url = scms[i].getConnection();
+ String revision = scms[i].getTag();
+
+ if(url.endsWith("/")) { //$NON-NLS-1$
+ url = url.substring(0, url.length()-1);
+ }
+
+ int n = url.lastIndexOf("/"); //$NON-NLS-1$
+ String label = (n == -1 ? url : url.substring(n)) + "/" + IMavenConstants.POM_FILE_NAME; //$NON-NLS-1$
+ MavenProjectScmInfo projectInfo = new MavenProjectScmInfo(label, null, //
+ null, revision, url, url);
+ mavenProjects.add(projectInfo);
+ }
+
+ MavenProjectCheckoutJob job = new MavenProjectCheckoutJob(importConfiguration, checkoutAllProjects) {
+ protected Collection<MavenProjectScmInfo> getProjects(IProgressMonitor monitor) {
+ return mavenProjects;
+ }
+ };
+
+ if(!locationPage.isInWorkspace()) {
+ job.setLocation(locationPage.getLocationPath().toFile());
+ }
+
+ job.schedule();
+
+ return true;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenDependenciesWizardPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenDependenciesWizardPage.java
new file mode 100644
index 00000000..4e66a4d4
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenDependenciesWizardPage.java
@@ -0,0 +1,291 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import org.apache.maven.model.Dependency;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.ui.dialogs.MavenRepositorySearchDialog;
+
+
+/**
+ * Wizard page for gathering information about Maven artifacts. Allows to select
+ * artifacts from the repository index.
+ */
+public class MavenDependenciesWizardPage extends AbstractMavenWizardPage {
+
+ /**
+ * Viewer containing dependencies
+ */
+ TableViewer dependencyViewer;
+
+ private Dependency[] dependencies;
+
+ /**
+ * Listeners notified about all changes
+ */
+ private List<ISelectionChangedListener> listeners = new ArrayList<ISelectionChangedListener>();
+
+ boolean showScope = false;
+
+ public MavenDependenciesWizardPage() {
+ this(null, Messages.getString("wizard.project.page.dependencies.title"), // //$NON-NLS-1$
+ Messages.getString("wizard.project.page.dependencies.description")); //$NON-NLS-1$
+ }
+
+ public MavenDependenciesWizardPage(ProjectImportConfiguration projectImportConfiguration, String title, String description) {
+ super("MavenDependenciesWizardPage", projectImportConfiguration); //$NON-NLS-1$
+ setTitle(title);
+ setDescription(description);
+ setPageComplete(true);
+ }
+
+ public void setShowScope(boolean showScope) {
+ this.showScope = showScope;
+ }
+
+ public void setDependencies(Dependency[] dependencies) {
+ this.dependencies = dependencies;
+ }
+
+ /**
+ * {@inheritDoc} This wizard page contains a <code>TableViewer</code> to display the currently included Maven2
+ * directories and a button area with buttons to add further dependencies or remove existing ones.
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout(3, false);
+ composite.setLayout(layout);
+
+ if(dependencies!=null) {
+ createArtifacts(composite);
+ }
+
+ createAdvancedSettings(composite, new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
+
+ setControl(composite);
+
+ updatePage();
+ }
+
+ private void createArtifacts(Composite composite) {
+ Label mavenArtifactsLabel = new Label(composite, SWT.NONE);
+ mavenArtifactsLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
+ mavenArtifactsLabel.setText(org.eclipse.m2e.core.internal.Messages.MavenDependenciesWizardPage_lblArtifacts);
+
+ dependencyViewer = new TableViewer(composite, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
+ dependencyViewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 2));
+ dependencyViewer.setUseHashlookup(true);
+ dependencyViewer.setLabelProvider(new ArtifactLabelProvider());
+ dependencyViewer.setComparator(new DependencySorter());
+ dependencyViewer.add(dependencies);
+
+ Button addDependencyButton = new Button(composite, SWT.PUSH);
+ GridData gd_addDependencyButton = new GridData(SWT.FILL, SWT.TOP, false, false);
+ addDependencyButton.setLayoutData(gd_addDependencyButton);
+ addDependencyButton.setText(Messages.getString("wizard.project.page.dependencies.add")); //$NON-NLS-1$
+
+ addDependencyButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getShell(), //
+ org.eclipse.m2e.core.internal.Messages.MavenDependenciesWizardPage_searchDialog_title, IIndex.SEARCH_ARTIFACT, Collections.<ArtifactKey>emptySet(), showScope);
+ if(dialog.open() == Window.OK) {
+ Object result = dialog.getFirstResult();
+ if(result instanceof IndexedArtifactFile) {
+ Dependency dependency = ((IndexedArtifactFile) result).getDependency();
+ dependency.setScope(dialog.getSelectedScope());
+ dependencyViewer.add(dependency);
+ notifyListeners();
+ } else if(result instanceof IndexedArtifact) {
+ // If we have an ArtifactInfo, we add the first FileInfo it contains
+ // which corresponds to the latest version of the artifact.
+ Set<IndexedArtifactFile> files = ((IndexedArtifact) result).getFiles();
+ if(files != null && !files.isEmpty()) {
+ dependencyViewer.add(files.iterator().next().getDependency());
+ notifyListeners();
+ }
+ }
+ }
+ }
+ });
+
+ final Button removeDependencyButton = new Button(composite, SWT.PUSH);
+ removeDependencyButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true));
+ removeDependencyButton.setText(Messages.getString("wizard.project.page.dependencies.remove")); //$NON-NLS-1$
+ removeDependencyButton.setEnabled(false);
+
+ removeDependencyButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ IStructuredSelection selection = (IStructuredSelection) dependencyViewer.getSelection();
+ if(selection != null) {
+ dependencyViewer.remove(selection.toArray());
+ notifyListeners();
+ }
+ }
+ });
+
+ dependencyViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ removeDependencyButton.setEnabled(selection.size() > 0);
+ }
+ });
+ }
+
+ public IWizardContainer getContainer() {
+ return super.getContainer();
+ }
+
+ void updatePage() {
+ setPageComplete(isPageValid());
+ }
+
+ private boolean isPageValid() {
+ setErrorMessage(null);
+ return true;
+ }
+
+ /**
+ * Notify listeners about changes
+ */
+ protected void notifyListeners() {
+ SelectionChangedEvent event = new SelectionChangedEvent(dependencyViewer, dependencyViewer.getSelection());
+ for(ISelectionChangedListener listener : listeners) {
+ listener.selectionChanged(event);
+ }
+ }
+
+ public void addListener(ISelectionChangedListener listener) {
+ listeners.add(listener);
+ }
+
+ /**
+ * Returns dependencies currently chosen by the user.
+ *
+ * @return dependencies currently chosen by the user. Neither the array nor any of its elements is
+ * <code>null</code>.
+ */
+ public Dependency[] getDependencies() {
+ List<Dependency> dependencies = new ArrayList<Dependency>();
+ for(int i = 0; i < dependencyViewer.getTable().getItemCount(); i++ ) {
+ Object element = dependencyViewer.getElementAt(i);
+ if(element instanceof Dependency) {
+ dependencies.add((Dependency) element);
+ }
+ }
+ return dependencies.toArray(new Dependency[dependencies.size()]);
+ }
+
+
+ /**
+ * Simple <code>LabelProvider</code> attached to the dependency viewer.
+ * <p>
+ * The information displayed for objects of type <code>Dependency</code> inside the dependency viewer is the
+ * following:
+ * </p>
+ * <p>
+ * {groupId} - {artifactId} - {version} - {type}
+ * </p>
+ */
+ public static class ArtifactLabelProvider extends LabelProvider {
+
+ /** The image to show for all objects of type <code>Dependency</code>. */
+ private static final Image DEPENDENCY_IMAGE = MavenImages.IMG_JAR;
+
+ /**
+ * {@inheritDoc}
+ * <p>
+ * The text returned for objects of type <code>Dependency</code> contains the following information about the
+ * dependency:
+ * </p>
+ * <p>
+ * {groupId} - {artifactId} - {version} - {type}
+ * </p>
+ */
+ public String getText(Object element) {
+ if(element instanceof Dependency) {
+ Dependency d = (Dependency) element;
+ return d.getGroupId() + ":" + d.getArtifactId() + ":" + d.getVersion() + (d.getClassifier() == null ? "" : ":" + d.getClassifier()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+ return super.getText(element);
+ }
+
+ public Image getImage(Object element) {
+ if(element instanceof Dependency) {
+ return DEPENDENCY_IMAGE;
+ }
+ return super.getImage(element);
+ }
+ }
+
+ /**
+ * Simple <code>ViewerComparator</code> attached to the dependency viewer. Objects of type <code>Dependency</code> are
+ * sorted by (1) their groupId and (2) their artifactId.
+ */
+ public static class DependencySorter extends ViewerComparator {
+
+ /**
+ * Two objects of type <code>Dependency</code> are sorted by (1) their groupId and (2) their artifactId.
+ */
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ if(!(e1 instanceof Dependency) || !(e2 instanceof Dependency)) {
+ return super.compare(viewer, e1, e2);
+ }
+
+ // First of all, compare the group IDs of the two dependencies.
+ String group1 = ((Dependency) e1).getGroupId();
+ String group2 = ((Dependency) e2).getGroupId();
+
+ int result = (group1 == null) ? -1 : group1.compareToIgnoreCase(group2);
+
+ // If the group IDs match, we sort by the artifact IDs.
+ if(result == 0) {
+ String artifact1 = ((Dependency) e1).getArtifactId();
+ String artifact2 = ((Dependency) e2).getArtifactId();
+ result = artifact1 == null ? -1 : artifact1.compareToIgnoreCase(artifact2);
+ }
+
+ return result;
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenImportWizard.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenImportWizard.java
new file mode 100644
index 00000000..3eeafc8b
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenImportWizard.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.progress.IProgressConstants;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.OpenMavenConsoleAction;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.MavenProjectInfo;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+
+
+/**
+ * Maven Import Wizard
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenImportWizard extends Wizard implements IImportWizard {
+
+ final ProjectImportConfiguration importConfiguration;
+
+ private MavenImportWizardPage page;
+
+ private List<String> locations;
+
+ private boolean showLocation = true;
+
+ public MavenImportWizard() {
+ importConfiguration = new ProjectImportConfiguration();
+ setNeedsProgressMonitor(true);
+ setWindowTitle(Messages.MavenImportWizard_title);
+ }
+
+ public MavenImportWizard(ProjectImportConfiguration importConfiguration, List<String> locations) {
+ this.importConfiguration = importConfiguration;
+ this.locations = locations;
+ this.showLocation = false;
+ setNeedsProgressMonitor(true);
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ if(locations == null || locations.isEmpty()) {
+ IPath location = SelectionUtil.getSelectedLocation(selection);
+ if(location != null) {
+ locations = Collections.singletonList(location.toOSString());
+ }
+ }
+
+ importConfiguration.setWorkingSet(SelectionUtil.getSelectedWorkingSet(selection));
+ }
+
+ public void addPages() {
+ page = new MavenImportWizardPage(importConfiguration);
+ page.setLocations(locations);
+ page.setShowLocation(showLocation);
+ addPage(page);
+ }
+
+ public boolean performFinish() {
+ if(!page.isPageComplete()) {
+ return false;
+ }
+
+ final Collection<MavenProjectInfo> projects = page.getProjects();
+
+ final MavenPlugin plugin = MavenPlugin.getDefault();
+
+ Job job = new WorkspaceJob(Messages.MavenImportWizard_job) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
+ try {
+ plugin.getProjectConfigurationManager().importProjects(projects, importConfiguration, monitor);
+ } catch(CoreException ex) {
+ plugin.getConsole().logError("Projects imported with errors");
+ return ex.getStatus();
+ }
+
+ return Status.OK_STATUS;
+ }
+ };
+ job.setRule(plugin.getProjectConfigurationManager().getRule());
+ job.schedule();
+
+ return true;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenImportWizardPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenImportWizardPage.java
new file mode 100644
index 00000000..f838854f
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenImportWizardPage.java
@@ -0,0 +1,525 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Tree;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.embedder.MavenModelManager;
+import org.eclipse.m2e.core.project.AbstractProjectScanner;
+import org.eclipse.m2e.core.project.LocalProjectScanner;
+import org.eclipse.m2e.core.project.MavenProjectInfo;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+
+
+/**
+ * Maven Import Wizard Page
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenImportWizardPage extends AbstractMavenWizardPage {
+
+ static final Object[] EMPTY = new Object[0];
+
+ protected Combo rootDirectoryCombo;
+
+ protected CheckboxTreeViewer projectTreeViewer;
+
+ private List<String> locations;
+
+ private IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+
+ private WorkingSetGroup workingSetGroup;
+
+ private boolean showLocation = true;
+
+ protected MavenImportWizardPage(ProjectImportConfiguration importConfiguration) {
+ super("MavenProjectImportWizardPage", importConfiguration);
+ setTitle(org.eclipse.m2e.core.internal.Messages.MavenImportWizardPage_title);
+ setDescription(org.eclipse.m2e.core.internal.Messages.MavenImportWizardPage_desc);
+ setPageComplete(false);
+ }
+
+ public void setShowLocation(boolean showLocation) {
+ this.showLocation = showLocation;
+ }
+
+ public void setLocations(List<String> locations) {
+ this.locations = locations;
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(3, false));
+ setControl(composite);
+
+ if(showLocation || locations==null || locations.isEmpty()) {
+ final Label selectRootDirectoryLabel = new Label(composite, SWT.NONE);
+ selectRootDirectoryLabel.setLayoutData(new GridData());
+ selectRootDirectoryLabel.setText(Messages.getString("wizard.import.page.root")); //$NON-NLS-1$
+
+ rootDirectoryCombo = new Combo(composite, SWT.NONE);
+ rootDirectoryCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ rootDirectoryCombo.addSelectionListener(new SelectionAdapter() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ if(rootDirectoryCombo.getText().trim().length() > 0) {
+ scanProjects();
+ }
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ if(rootDirectoryCombo.getText().trim().length() > 0) {
+ scanProjects();
+ }
+ }
+ });
+ rootDirectoryCombo.setFocus();
+ addFieldWithHistory("rootDirectory", rootDirectoryCombo); //$NON-NLS-1$
+
+ if(locations!=null && locations.size()==1) {
+ rootDirectoryCombo.setText(locations.get(0));
+ }
+
+ final Button browseButton = new Button(composite, SWT.NONE);
+ browseButton.setText(Messages.getString("wizard.import.page.browse")); //$NON-NLS-1$
+ browseButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ browseButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.NONE);
+ dialog.setText(Messages.getString("wizard.import.page.selectRootFolder")); //$NON-NLS-1$
+ String path = rootDirectoryCombo.getText();
+ if(path.length()==0) {
+ path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toPortableString();
+ }
+ dialog.setFilterPath(path);
+
+ String result = dialog.open();
+ if(result != null) {
+ rootDirectoryCombo.setText(result);
+ scanProjects();
+ }
+ }
+ });
+ }
+
+ final Label projectsLabel = new Label(composite, SWT.NONE);
+ projectsLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
+ projectsLabel.setText(Messages.getString("wizard.import.page.projects")); //$NON-NLS-1$
+
+ projectTreeViewer = new CheckboxTreeViewer(composite, SWT.BORDER);
+
+ projectTreeViewer.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ projectTreeViewer.setSubtreeChecked(event.getElement(), event.getChecked());
+ updateCheckedState();
+ Object[] checkedElements = projectTreeViewer.getCheckedElements();
+ setPageComplete(checkedElements != null && checkedElements.length > 0);
+ }
+ });
+
+ projectTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ validateProjectInfo((MavenProjectInfo) selection.getFirstElement());
+ }});
+
+ projectTreeViewer.setContentProvider(new ITreeContentProvider() {
+
+ public Object[] getElements(Object element) {
+ if(element instanceof List) {
+ @SuppressWarnings("unchecked")
+ List<MavenProjectInfo> projects = (List<MavenProjectInfo>) element;
+ return projects.toArray(new MavenProjectInfo[projects.size()]);
+ }
+ return EMPTY;
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if(parentElement instanceof List) {
+ @SuppressWarnings("unchecked")
+ List<MavenProjectInfo> projects = (List<MavenProjectInfo>) parentElement;
+ return projects.toArray(new MavenProjectInfo[projects.size()]);
+ } else if(parentElement instanceof MavenProjectInfo) {
+ MavenProjectInfo mavenProjectInfo = (MavenProjectInfo) parentElement;
+ Collection<MavenProjectInfo> projects = mavenProjectInfo.getProjects();
+ return projects.toArray(new MavenProjectInfo[projects.size()]);
+ }
+ return EMPTY;
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object parentElement) {
+ if(parentElement instanceof List) {
+ List<?> projects = (List<?>) parentElement;
+ return !projects.isEmpty();
+ } else if(parentElement instanceof MavenProjectInfo) {
+ MavenProjectInfo mavenProjectInfo = (MavenProjectInfo) parentElement;
+ return !mavenProjectInfo.getProjects().isEmpty();
+ }
+ return false;
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+ });
+
+ projectTreeViewer.setLabelProvider(new ProjectLabelProvider());
+
+ final Tree projectTree = projectTreeViewer.getTree();
+ GridData projectTreeData = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 3);
+ projectTreeData.heightHint = 250;
+ projectTreeData.widthHint = 500;
+ projectTree.setLayoutData(projectTreeData);
+
+ final Button selectAllButton = new Button(composite, SWT.NONE);
+ selectAllButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ selectAllButton.setText(Messages.getString("wizard.import.page.selectAll")); //$NON-NLS-1$
+ selectAllButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ projectTreeViewer.expandAll();
+ setAllChecked(true);
+ // projectTreeViewer.setSubtreeChecked(projectTreeViewer.getInput(), true);
+ validate();
+ }
+ });
+
+ final Button deselectAllButton = new Button(composite, SWT.NONE);
+ deselectAllButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ deselectAllButton.setText(Messages.getString("wizard.import.page.deselectAll")); //$NON-NLS-1$
+ deselectAllButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ setAllChecked(false);
+ // projectTreeViewer.setSubtreeChecked(projectTreeViewer.getInput(), false);
+ setPageComplete(false);
+ }
+ });
+
+ final Button refreshButton = new Button(composite, SWT.NONE);
+ refreshButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true));
+ refreshButton.setText(Messages.getString("wizard.import.page.refresh")); //$NON-NLS-1$
+ refreshButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ scanProjects();
+ }
+ });
+
+ this.workingSetGroup = new WorkingSetGroup(composite, getImportConfiguration(), getShell());
+
+ createAdvancedSettings(composite, new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
+ resolverConfigurationComponent.template.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent arg0) {
+ validate();
+ }
+ });
+
+ if(locations!=null && !locations.isEmpty()) {
+ scanProjects();
+ }
+ }
+
+ public void dispose() {
+ super.dispose();
+ workingSetGroup.dispose();
+ }
+
+ protected void scanProjects() {
+ final AbstractProjectScanner<MavenProjectInfo> projectScanner = getProjectScanner();
+ try {
+ getWizard().getContainer().run(true, true, new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ projectScanner.run(monitor);
+ }
+ });
+
+ projectTreeViewer.setInput(projectScanner.getProjects());
+ projectTreeViewer.expandAll();
+ // projectTreeViewer.setAllChecked(true);
+ setAllChecked(true);
+ Object[] checkedElements = projectTreeViewer.getCheckedElements();
+ setPageComplete(checkedElements != null && checkedElements.length > 0);
+ setErrorMessage(null);
+ setMessage(null);
+
+ List<Throwable> errors = projectScanner.getErrors();
+ if(!errors.isEmpty()) {
+ StringBuffer sb = new StringBuffer(Messages.getString("wizard.import.page.scanningErrors", errors.size())); //$NON-NLS-1$
+ int n = 1;
+ for(Throwable ex : errors) {
+ if(ex instanceof CoreException) {
+ String msg = ((CoreException) ex).getStatus().getMessage();
+ sb.append("\n ").append(n).append(" ").append(msg.trim()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ } else {
+ String msg = ex.getMessage()==null ? ex.toString() : ex.getMessage();
+ sb.append("\n ").append(n).append(" ").append(msg.trim()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ n++;
+ }
+
+ setMessage(sb.toString(), IMessageProvider.WARNING);
+ }
+
+ } catch(InterruptedException ex) {
+ // canceled
+
+ } catch(InvocationTargetException ex) {
+ Throwable e = ex.getTargetException() == null ? ex : ex.getTargetException();
+ String msg;
+ if(e instanceof CoreException) {
+ msg = e.getMessage();
+ MavenLogger.log(msg, e);
+ } else {
+ msg = "Scanning error " + projectScanner.getDescription() + "; " + e.toString(); //$NON-NLS-2$
+ MavenPlugin.getDefault().getConsole().logError(msg);
+ MavenLogger.log(msg, e);
+ }
+ projectTreeViewer.setInput(null);
+ setPageComplete(false);
+ setErrorMessage(msg);
+
+ }
+ }
+
+ void setAllChecked(boolean state) {
+ @SuppressWarnings("unchecked")
+ List<MavenProjectInfo> input = (List<MavenProjectInfo>) projectTreeViewer.getInput();
+ if(input!=null) {
+ for(MavenProjectInfo mavenProjectInfo : input) {
+ projectTreeViewer.setSubtreeChecked(mavenProjectInfo, state);
+ }
+ updateCheckedState();
+ }
+ }
+
+ void updateCheckedState() {
+ Object[] elements = projectTreeViewer.getCheckedElements();
+ for(int i = 0; i < elements.length; i++ ) {
+ Object element = elements[i];
+ if(element instanceof MavenProjectInfo) {
+ MavenProjectInfo info = (MavenProjectInfo) element;
+ if(isWorkspaceFolder(info) || isAlreadyExists(info)) {
+ projectTreeViewer.setChecked(info, false);
+ }
+ }
+ }
+ }
+
+ boolean isWorkspaceFolder(MavenProjectInfo info) {
+ if(info!=null) {
+ File pomFile = info.getPomFile();
+ if(pomFile != null) {
+ File parentFile = pomFile.getParentFile();
+ if(parentFile.getAbsolutePath().equals(workspaceRoot.getLocation().toFile().getAbsolutePath())) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ boolean isAlreadyExists(MavenProjectInfo info) {
+ if(info!=null) {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ IProject project = getImportConfiguration().getProject(workspace.getRoot(), info.getModel());
+ return project.exists();
+ }
+ return false;
+ }
+
+ protected AbstractProjectScanner<MavenProjectInfo> getProjectScanner() {
+ File root = workspaceRoot.getLocation().toFile();
+ MavenPlugin mavenPlugin = MavenPlugin.getDefault();
+ MavenModelManager modelManager = mavenPlugin.getMavenModelManager();
+ MavenConsole console = mavenPlugin.getConsole();
+ if(showLocation || locations == null || locations.isEmpty()) {
+ return new LocalProjectScanner(root, rootDirectoryCombo.getText(), false, modelManager, console);
+ }
+ return new LocalProjectScanner(root, locations, true, modelManager, console);
+ }
+
+ /**
+ * @return collection of <code>MavenProjectInfo</code>
+ */
+ public Collection<MavenProjectInfo> getProjects() {
+ Collection<MavenProjectInfo> checkedProjects = new ArrayList<MavenProjectInfo>();
+ for(Object o : projectTreeViewer.getCheckedElements()) {
+ checkedProjects.add((MavenProjectInfo) o);
+ }
+
+ return checkedProjects;
+ }
+
+ private void collectProjects(List<MavenProjectInfo> mavenProjects, Set<MavenProjectInfo> checkedProjects,
+ Collection<MavenProjectInfo> childProjects) {
+ for(MavenProjectInfo projectInfo : childProjects) {
+ if(checkedProjects.contains(projectInfo)) {
+ mavenProjects.add(projectInfo);
+ } else {
+ collectProjects(mavenProjects, checkedProjects, projectInfo.getProjects());
+ }
+ }
+ }
+
+ protected boolean validateProjectInfo(MavenProjectInfo info) {
+ if(info!=null) {
+ String projectName = getImportConfiguration().getProjectName(info.getModel());
+ if(isWorkspaceFolder(info)) {
+ setMessage(Messages.getString("wizard.import.validator.workspaceFolder", projectName), IMessageProvider.WARNING); //$NON-NLS-1$
+ } else if(isAlreadyExists(info)) {
+ setMessage(Messages.getString("wizard.import.validator.projectExists", projectName), IMessageProvider.WARNING); //$NON-NLS-1$
+ } else {
+ setMessage(null, IMessageProvider.WARNING);
+ return false;
+ }
+ }
+ return true;
+ }
+
+ protected void validate() {
+ Object[] elements = projectTreeViewer.getCheckedElements();
+ for(int i = 0; i < elements.length; i++ ) {
+ Object element = elements[i];
+ if(element instanceof MavenProjectInfo) {
+ if (validateProjectInfo((MavenProjectInfo) element)) {
+ setPageComplete(false);
+ return;
+ }
+ }
+ }
+
+ setMessage(null);
+ setPageComplete(projectTreeViewer.getCheckedElements().length > 0);
+ projectTreeViewer.refresh();
+ }
+
+ /**
+ * ProjectLabelProvider
+ */
+ class ProjectLabelProvider extends LabelProvider implements IColorProvider {
+
+ public String getText(Object element) {
+ if(element instanceof MavenProjectInfo) {
+ MavenProjectInfo info = (MavenProjectInfo) element;
+
+ if(info.getProfiles().isEmpty()) {
+ return info.getLabel() + " - " + getId(info); //$NON-NLS-1$
+ }
+
+ return info.getLabel() + " - " + getId(info) + " " + info.getProfiles(); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return super.getText(element);
+ }
+
+ private String getId(MavenProjectInfo info) {
+ Model model = info.getModel();
+
+ String groupId = model.getGroupId();
+ String artifactId = model.getArtifactId();
+ String version = model.getVersion();
+ String packaging = model.getPackaging();
+
+ Parent parent = model.getParent();
+
+ if(groupId==null && parent!=null) {
+ groupId = parent.getGroupId();
+ }
+ if(groupId==null) {
+ groupId = org.eclipse.m2e.core.internal.Messages.MavenImportWizardPage_inherited;
+ }
+
+ if(version==null && parent!=null) {
+ version = parent.getVersion();
+ }
+ if(version==null) {
+ version = org.eclipse.m2e.core.internal.Messages.MavenImportWizardPage_inherited;
+ }
+
+ return groupId + ":" + artifactId + ":" + version + ":" + packaging; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
+ */
+ public Color getForeground(Object element) {
+ if(element instanceof MavenProjectInfo) {
+ MavenProjectInfo info = (MavenProjectInfo) element;
+ if(isWorkspaceFolder(info)) {
+ return Display.getDefault().getSystemColor(SWT.COLOR_RED);
+ } else if(isAlreadyExists(info)) {
+ return Display.getDefault().getSystemColor(SWT.COLOR_GRAY);
+ }
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
+ */
+ public Color getBackground(Object element) {
+ return null;
+ }
+
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenInstallFileArtifactWizardPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenInstallFileArtifactWizardPage.java
new file mode 100644
index 00000000..adbcd2a0
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenInstallFileArtifactWizardPage.java
@@ -0,0 +1,390 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.io.File;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.internal.Messages;
+
+
+/**
+ * Wizard page to enter parameters required for artifact installation.
+ *
+ * @author Guillaume Sauthier
+ * @author Mike Haller
+ * @author Eugene Kuleshov
+ */
+public class MavenInstallFileArtifactWizardPage extends WizardPage {
+
+ Text artifactFileNameText;
+ Text pomFileNameText;
+
+ private Combo groupIdCombo;
+ private Combo artifactIdCombo;
+ private Combo versionCombo;
+ private Combo packagingCombo;
+ private Combo classifierCombo;
+
+ Button createChecksumButton;
+ Button generatePomButton;
+
+ private final IFile file;
+
+ public MavenInstallFileArtifactWizardPage(IFile file) {
+ super("mavenInstallFileWizardPage");
+ this.file = file;
+ this.setTitle(Messages.MavenInstallFileArtifactWizardPage_title);
+ this.setDescription(Messages.MavenInstallFileArtifactWizardPage_desc);
+ }
+
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NONE);
+ container.setLayout(new GridLayout(3, false));
+ container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ ModifyListener modifyingListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ pageChanged();
+ }
+ };
+
+ Label artifactFileNameLabel = new Label(container, SWT.NONE);
+ artifactFileNameLabel.setText(Messages.MavenInstallFileArtifactWizardPage_lblFileName);
+
+ artifactFileNameText = new Text(container, SWT.BORDER);
+ artifactFileNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ artifactFileNameText.setData("name", "artifactFileNametext"); //$NON-NLS-1$ //$NON-NLS-2$
+ artifactFileNameText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ updateFileName(getArtifactFileName());
+ pageChanged();
+ }
+ });
+
+ final Button artifactFileNameButton = new Button(container, SWT.NONE);
+ artifactFileNameButton.setLayoutData(new GridData());
+ artifactFileNameButton.setData("name", "externalPomFileButton"); //$NON-NLS-1$ //$NON-NLS-2$
+ artifactFileNameButton.setText(Messages.MavenInstallFileArtifactWizardPage_btnFilename);
+ artifactFileNameButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog fileDialog = new FileDialog(artifactFileNameButton.getShell());
+ fileDialog.setText(Messages.MavenInstallFileArtifactWizardPage_file_title);
+ fileDialog.setFileName(artifactFileNameText.getText());
+ String name = fileDialog.open();
+ if(name!=null) {
+ updateFileName(name);
+ }
+ }
+ });
+
+ Label pomFileNameLabel = new Label(container, SWT.NONE);
+ pomFileNameLabel.setText(Messages.MavenInstallFileArtifactWizardPage_lblPom);
+
+ pomFileNameText = new Text(container, SWT.BORDER);
+ pomFileNameText.setData("name", "pomFileNameText"); //$NON-NLS-1$ //$NON-NLS-2$
+ pomFileNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ pomFileNameText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ generatePomButton.setSelection(getPomFileName().length()==0);
+ pageChanged();
+ }
+ });
+
+ final Button pomFileNameButton = new Button(container, SWT.NONE);
+ pomFileNameButton.setLayoutData(new GridData());
+ pomFileNameButton.setData("name", "externalPomFileButton"); //$NON-NLS-1$ //$NON-NLS-2$
+ pomFileNameButton.setText(Messages.MavenInstallFileArtifactWizardPage_btnPom);
+ pomFileNameButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ FileDialog fileDialog = new FileDialog(pomFileNameButton.getShell());
+ fileDialog.setText(Messages.MavenInstallFileArtifactWizardPage_file_title);
+ fileDialog.setFileName(pomFileNameText.getText());
+ String res = fileDialog.open();
+ if(res!=null) {
+ pomFileNameText.setText(res);
+ }
+ }
+ });
+
+ new Label(container, SWT.NONE);
+
+ generatePomButton = new Button(container, SWT.CHECK);
+ generatePomButton.setData("name", "generatePomButton"); //$NON-NLS-1$ //$NON-NLS-2$
+ generatePomButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
+ generatePomButton.setText(Messages.MavenInstallFileArtifactWizardPage_btnGenerate);
+ generatePomButton.setSelection(true);
+ new Label(container, SWT.NONE);
+
+ createChecksumButton = new Button(container, SWT.CHECK);
+ createChecksumButton.setData("name", "createChecksumButton"); //$NON-NLS-1$ //$NON-NLS-2$
+ createChecksumButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
+ createChecksumButton.setText(Messages.MavenInstallFileArtifactWizardPage_btnChecksum);
+ createChecksumButton.setSelection(true);
+
+ Label separator = new Label(container, SWT.HORIZONTAL | SWT.SEPARATOR);
+ GridData separatorData = new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1);
+ separatorData.verticalIndent = 5;
+ separator.setLayoutData(separatorData);
+
+ Label groupIdlabel = new Label(container, SWT.NONE);
+ groupIdlabel.setText(Messages.MavenInstallFileArtifactWizardPage_lblgroupid);
+
+ groupIdCombo = new Combo(container, SWT.NONE);
+ groupIdCombo.setData("name", "groupIdCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+ groupIdCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ groupIdCombo.addModifyListener(modifyingListener);
+ new Label(container, SWT.NONE);
+
+ Label artifactIdLabel = new Label(container, SWT.NONE);
+ artifactIdLabel.setText(Messages.MavenInstallFileArtifactWizardPage_lblArtifact);
+
+ artifactIdCombo = new Combo(container, SWT.NONE);
+ artifactIdCombo.setData("name", "artifactIdCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+ artifactIdCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ artifactIdCombo.addModifyListener(modifyingListener);
+ new Label(container, SWT.NONE);
+
+ Label versionLabel = new Label(container, SWT.NONE);
+ versionLabel.setText(Messages.MavenInstallFileArtifactWizardPage_lblVersion);
+
+ versionCombo = new Combo(container, SWT.NONE);
+ versionCombo.setData("name", "versionCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+ versionCombo.setText(MavenArtifactComponent.DEFAULT_VERSION);
+ GridData versionComboData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
+ versionComboData.widthHint = 150;
+ versionCombo.setLayoutData(versionComboData);
+ versionCombo.addModifyListener(modifyingListener);
+
+ Label packagingLabel = new Label(container, SWT.NONE);
+ packagingLabel.setText(Messages.MavenInstallFileArtifactWizardPage_lblPackaging);
+
+ packagingCombo = new Combo(container, SWT.NONE);
+ packagingCombo.setData("name", "packagingCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+ packagingCombo.setText(MavenArtifactComponent.DEFAULT_PACKAGING);
+ packagingCombo.setItems(MavenArtifactComponent.PACKAGING_OPTIONS);
+ GridData packagingComboData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
+ packagingComboData.widthHint = 150;
+ packagingCombo.setLayoutData(packagingComboData);
+ packagingCombo.addModifyListener(modifyingListener);
+
+ Label classifierLabel = new Label(container, SWT.NONE);
+ classifierLabel.setText(Messages.MavenInstallFileArtifactWizardPage_lblClassifier);
+
+ classifierCombo = new Combo(container, SWT.NONE);
+ classifierCombo.setData("name", "classifierText"); //$NON-NLS-1$ //$NON-NLS-2$
+ classifierCombo.setItems(new String[] {"sources", "javadoc"}); //$NON-NLS-1$ //$NON-NLS-2$
+ GridData classifierTextData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
+ classifierTextData.widthHint = 150;
+ classifierCombo.setLayoutData(classifierTextData);
+ classifierCombo.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ generatePomButton.setSelection(getClassifier().length()==0);
+ }
+ });
+
+ if(file != null) {
+ updateFileName(file.getLocation().toOSString());
+ }
+
+ setControl(container);
+ }
+
+ void updateFileName(String fileName) {
+ if(!getArtifactFileName().equals(fileName)) {
+ artifactFileNameText.setText(fileName);
+ }
+
+ File file = new File(fileName);
+ if(!file.exists() || !file.isFile()) {
+ return;
+ }
+
+ if(fileName.endsWith(".jar") || fileName.endsWith(".war") || fileName.endsWith(".ear")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ packagingCombo.setText(fileName.substring(fileName.length()-3));
+ }
+
+ int n = fileName.lastIndexOf('.');
+ if(n>-1) {
+ String pomFileName = fileName.substring(0, n) + ".pom"; //$NON-NLS-1$
+ if(new File(pomFileName).exists()) {
+ pomFileNameText.setText(pomFileName);
+ }
+ } else {
+ pomFileNameText.setText(""); //$NON-NLS-1$
+ }
+
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ try {
+ IndexedArtifactFile iaf = plugin.getIndexManager().getAllIndexes().identify(file);
+ if(iaf!=null) {
+ groupIdCombo.setText(iaf.group);
+ artifactIdCombo.setText(iaf.artifact);
+ versionCombo.setText(iaf.version);
+ if(iaf.classifier!=null) {
+ classifierCombo.setText(iaf.classifier);
+ }
+
+ String name = iaf.group + ":" + iaf.artifact + "-" + iaf.version // //$NON-NLS-1$ //$NON-NLS-2$
+ + (iaf.classifier == null ? "" : iaf.classifier); //$NON-NLS-1$
+ setMessage(NLS.bind(Messages.MavenInstallFileArtifactWizardPage_message, name), WARNING);
+ return;
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+
+ if(n>-1) {
+ String pomFileName = fileName.substring(0, n) + ".pom"; //$NON-NLS-1$
+ if(new File(pomFileName).exists()) {
+ pomFileNameText.setText(pomFileName);
+
+ // read pom file
+
+ try {
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+ MavenProject mavenProject = maven.readProject(new File(pomFileName), null);
+
+ groupIdCombo.setText(mavenProject.getGroupId());
+ artifactIdCombo.setText(mavenProject.getArtifactId());
+ versionCombo.setText(mavenProject.getVersion());
+ packagingCombo.setText(mavenProject.getPackaging());
+ return;
+
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+
+ ArtifactKey artifactKey = SelectionUtil.getType(file, ArtifactKey.class);
+ if(artifactKey!=null) {
+ groupIdCombo.setText(artifactKey.getGroupId());
+ artifactIdCombo.setText(artifactKey.getArtifactId());
+ versionCombo.setText(artifactKey.getVersion());
+ if(artifactKey.getClassifier()!=null) {
+ classifierCombo.setText(artifactKey.getClassifier());
+ }
+ }
+ }
+
+ void pageChanged() {
+ String artifactFileName = getArtifactFileName();
+ if(artifactFileName.length() == 0) {
+ updateStatus(Messages.MavenInstallFileArtifactWizardPage_error_no_name);
+ return;
+ }
+
+ File file = new File(artifactFileName);
+ if(!file.exists() || !file.isFile()) {
+ updateStatus(Messages.MavenInstallFileArtifactWizardPage_error_missing);
+ return;
+ }
+
+ String pomFileName = getPomFileName();
+ if(pomFileName.length()>0) {
+ if(!new File(pomFileName).exists()) {
+ updateStatus(Messages.MavenInstallFileArtifactWizardPage_error_missingpom);
+ return;
+ }
+ }
+
+ if(getGroupId().length() == 0) {
+ updateStatus(Messages.MavenInstallFileArtifactWizardPage_error_groupid);
+ return;
+ }
+
+ if(getArtifactId().length() == 0) {
+ updateStatus(Messages.MavenInstallFileArtifactWizardPage_error_artifactid);
+ return;
+ }
+
+ if(getVersion().length() == 0) {
+ updateStatus(Messages.MavenInstallFileArtifactWizardPage_error_version);
+ return;
+ }
+
+ if(getPackaging().length() == 0) {
+ updateStatus(Messages.MavenInstallFileArtifactWizardPage_error_packaging);
+ return;
+ }
+
+ updateStatus(null);
+ }
+
+ private void updateStatus(String message) {
+ setErrorMessage(message);
+ setPageComplete(message == null);
+ }
+
+ public String getArtifactFileName() {
+ return artifactFileNameText.getText().trim();
+ }
+
+ public String getPomFileName() {
+ return pomFileNameText.getText().trim();
+ }
+
+ public String getGroupId() {
+ return groupIdCombo.getText().trim();
+ }
+
+ public String getArtifactId() {
+ return artifactIdCombo.getText().trim();
+ }
+
+ public String getVersion() {
+ return versionCombo.getText().trim();
+ }
+
+ public String getPackaging() {
+ return packagingCombo.getText().trim();
+ }
+
+ public String getClassifier() {
+ return this.classifierCombo.getText().trim();
+ }
+
+ public boolean isGeneratePom() {
+ return generatePomButton.getSelection();
+ }
+
+ public boolean isCreateChecksum() {
+ return createChecksumButton.getSelection();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenInstallFileRepositoryWizardPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenInstallFileRepositoryWizardPage.java
new file mode 100644
index 00000000..ef199a8f
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenInstallFileRepositoryWizardPage.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.io.File;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.Repository;
+
+
+/**
+ * MavenInstallFileRepositoryWizardPage used to chose to repositories for installing artifacts.
+ *
+ * @author Mike Haller
+ */
+public class MavenInstallFileRepositoryWizardPage extends WizardPage {
+
+ private final IFile pomFile;
+
+ public MavenInstallFileRepositoryWizardPage(IFile pomFile) {
+ super("mavenInstallFileRepositorySelectionPage");
+ setTitle("Repository Selection Page");
+ setDescription("Select the repositories where to deploy the artifact");
+ this.pomFile = pomFile;
+ }
+
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NONE);
+ container.setLayout(new GridLayout(1, false));
+ container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ Label repositoriesLabel = new Label(container, SWT.NONE);
+ repositoriesLabel.setData("name", "repositoriesLabel");
+ repositoriesLabel.setText("&Repositories:");
+
+ CheckboxTreeViewer repositoryViewer = new CheckboxTreeViewer(container, SWT.BORDER);
+ repositoryViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ // repositoryViewer.setInput(pomFile);
+ repositoryViewer.setLabelProvider(new RepositoryLabelProvider());
+ repositoryViewer.setContentProvider(new RepositoriesContentProvider());
+ repositoryViewer.setCheckedElements(new Object[] {RepositoriesContentProvider.LOCAL_REPOSITORY});
+
+ initRepositories();
+
+ setControl(container);
+ }
+
+ private void initRepositories() {
+ // TODO Auto-generated method initRepositories
+
+ }
+
+ /**
+ * RepositoryLabelProvider prints the name of a repository, and if available, its URL.
+ */
+ public class RepositoryLabelProvider extends LabelProvider {
+
+ public String getText(Object element) {
+ if(element instanceof Repository) {
+ Repository repository = (Repository) element;
+ if(repository.getUrl() != null && repository.getUrl().trim().length() > 0) {
+ return repository.getName() + "(" + repository.getUrl() + ")";
+ }
+ return repository.getName();
+ }
+ return super.getText(element);
+ }
+
+ }
+
+ /**
+ * LocalRepositoriesContentProvider provides a list of local and remote repositories.
+ * <p>
+ * If no repositories could be found in the POM Maven Model, a default local repository is shown.
+ */
+ public static class RepositoriesContentProvider implements ITreeContentProvider {
+
+ public static final Repository LOCAL_REPOSITORY = createLocalRepository();
+
+ private static Repository createLocalRepository() {
+ Repository repository = PomFactory.eINSTANCE.createRepository();
+ repository.setId("local");
+ repository.setName("Local Repository");
+ try {
+ File localRepositoryDir = new File(MavenPlugin.getDefault().getMaven().getLocalRepository().getBasedir());
+ repository.setUrl(localRepositoryDir.toURI().toString());
+ } catch(CoreException ex) {
+ MavenLogger.log("Unable to determine local repository URL, using default", ex);
+ }
+ return repository;
+ }
+
+ public Object[] getElements(Object arg0) {
+ return repositories.toArray();
+ }
+
+ private EList<Repository> repositories;
+
+ public Object[] getChildren(Object arg0) {
+ return null;
+ }
+
+ public Object getParent(Object arg0) {
+ return null;
+ }
+
+ public boolean hasChildren(Object arg0) {
+ return false;
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer arg0, Object arg1, Object newInput) {
+ if(newInput instanceof Model) {
+ Model model = (Model) newInput;
+ repositories = model.getRepositories();
+ }
+ }
+
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenInstallFileWizard.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenInstallFileWizard.java
new file mode 100644
index 00000000..23212884
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenInstallFileWizard.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.progress.IProgressConstants;
+
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenExecutionResult;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.OpenMavenConsoleAction;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.internal.Messages;
+
+
+/**
+ * Wizard to install artifacts into the local Maven repository.
+ *
+ * @author Guillaume Sauthier
+ * @author Mike Haller
+ * @author Eugene Kuleshov
+ * @since 0.9.7
+ */
+public class MavenInstallFileWizard extends Wizard implements IImportWizard {
+
+ private IFile selectedFile;
+
+ private IFile pomFile;
+
+ private MavenInstallFileArtifactWizardPage artifactPage;
+
+ private MavenInstallFileRepositoryWizardPage repositoryPage;
+
+ public MavenInstallFileWizard() {
+ setNeedsProgressMonitor(true);
+ setWindowTitle(Messages.MavenInstallFileWizard_title);
+ }
+
+ public void addPages() {
+ artifactPage = new MavenInstallFileArtifactWizardPage(selectedFile);
+ addPage(artifactPage);
+
+ // repositoryPage = new MavenInstallFileRepositoryWizardPage(pomFile);
+ // addPage(repositoryPage);
+ }
+
+ public boolean performFinish() {
+ final Properties properties = new Properties();
+
+ // Mandatory Properties for install:install-file
+ properties.setProperty("file", artifactPage.getArtifactFileName()); //$NON-NLS-1$
+
+ properties.setProperty("groupId", artifactPage.getGroupId()); //$NON-NLS-1$
+ properties.setProperty("artifactId", artifactPage.getArtifactId()); //$NON-NLS-1$
+ properties.setProperty("version", artifactPage.getVersion()); //$NON-NLS-1$
+ properties.setProperty("packaging", artifactPage.getPackaging()); //$NON-NLS-1$
+
+ if(artifactPage.getClassifier().length()>0) {
+ properties.setProperty("classifier", artifactPage.getClassifier()); //$NON-NLS-1$
+ }
+
+ if(artifactPage.getPomFileName().length()>0) {
+ properties.setProperty("pomFile", artifactPage.getPomFileName()); //$NON-NLS-1$
+ }
+ if(artifactPage.isGeneratePom()) {
+ properties.setProperty("generatePom", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ if(artifactPage.isCreateChecksum()) {
+ properties.setProperty("createChecksum", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ new Job(Messages.MavenInstallFileWizard_job) {
+ protected IStatus run(IProgressMonitor monitor) {
+ setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ try {
+ // Run the install:install-file goal
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+ MavenExecutionRequest request = maven.createExecutionRequest(monitor);
+ request.setGoals(Arrays.asList("install:install-file")); //$NON-NLS-1$
+ request.setUserProperties(properties);
+ MavenExecutionResult executionResult = maven.execute(request, monitor);
+
+ List<Throwable> exceptions = executionResult.getExceptions();
+ if(!exceptions.isEmpty()) {
+ for(Throwable exception : exceptions) {
+ String msg = Messages.MavenInstallFileWizard_error;
+ plugin.getConsole().logError(msg + "; " + exception.toString()); //$NON-NLS-1$
+ MavenLogger.log(msg, exception);
+ }
+ }
+
+ // TODO update index for local maven repository
+
+ } catch (CoreException ex) {
+ MavenLogger.log(ex);
+ plugin.getConsole().logError("Failed to install artifact");
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+
+ return true;
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ Object element = selection.getFirstElement();
+ if(element instanceof IFile) {
+ selectedFile = (IFile) element;
+ setPomFile(selectedFile.getProject());
+ } else if(element instanceof IProject) {
+ setPomFile((IProject) element);
+ }
+ }
+
+ private void setPomFile(IProject project) {
+ if(project.isAccessible()) {
+ IFile pomFile = project.getFile(IMavenConstants.POM_FILE_NAME);
+ if(pomFile!=null && pomFile.isAccessible()) {
+ this.pomFile = pomFile;
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenLocationComponent.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenLocationComponent.java
new file mode 100644
index 00000000..534dcdfe
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenLocationComponent.java
@@ -0,0 +1,193 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.m2e.core.core.Messages;
+
+
+/**
+ * Simple GUI component which allows the user to choose between a workspace
+ * location and a user specified external location.
+ *
+ * This component is mainly used for choosing the location at which to create
+ * a new project.
+ */
+public class MavenLocationComponent extends Composite {
+
+ /** Radio button indicating whether the workspace location has been chosen. */
+ protected Button inWorkspaceButton;
+
+ /** Radio button indicating whether an external location has been chosen. */
+ protected Button inExternalLocationButton;
+
+ /** Text field for defining a user specified external location. */
+ protected Combo locationCombo;
+
+ /** Button allowing to choose a directory on the file system as the external location. */
+ protected Button locationBrowseButton;
+
+ protected ModifyListener modifyingListener;
+
+ protected Label locationLabel;
+
+ /**
+ * Constructor.
+ *
+ * Constructs all the GUI components contained in this <code>Composite</code>.
+ * These components allow the user to choose between a workspace location and
+ * a user specified external location.
+ *
+ * @param parent The widget which will be the parent of this component.
+ * @param styles The widget style for this component.
+ * @param modifyingListener Listener which is notified when the contents of
+ * this component change due to user input.
+ */
+ public MavenLocationComponent( final Composite parent, int styles ) {
+ super( parent, styles );
+
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginHeight = 0;
+ gridLayout.marginWidth = 0;
+ setLayout( gridLayout );
+
+ Group locationGroup = new Group( this, SWT.NONE );
+ locationGroup.setText( Messages.getString( "locationComponent.location" ) ); //$NON-NLS-1$
+ locationGroup.setLayoutData( new GridData( GridData.FILL, GridData.FILL, true, true, 3, 1 ) );
+ GridLayout groupLayout = new GridLayout();
+ groupLayout.numColumns = 3;
+ groupLayout.marginLeft = 0;
+ locationGroup.setLayout( groupLayout );
+
+ GridData gridData = new GridData();
+ gridData.horizontalSpan = 3;
+
+ // first radio button
+ inWorkspaceButton = new Button( locationGroup, SWT.RADIO );
+ inWorkspaceButton.setText( Messages.getString( "locationComponent.inWorkspace" ) ); //$NON-NLS-1$
+ inWorkspaceButton.setLayoutData( new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1) );
+ inWorkspaceButton.addSelectionListener( new SelectionAdapter() {
+ public void widgetSelected( SelectionEvent e ) {
+ boolean isEnabled = !inWorkspaceButton.getSelection();
+ locationLabel.setEnabled( isEnabled );
+ locationCombo.setEnabled( isEnabled );
+ locationBrowseButton.setEnabled( isEnabled );
+ if(modifyingListener!=null) {
+ modifyingListener.modifyText( null );
+ }
+ }
+ } );
+
+ // second radio button
+ inExternalLocationButton = new Button( locationGroup, SWT.RADIO );
+ inExternalLocationButton.setText( Messages.getString( "locationComponent.atExternal" ) ); //$NON-NLS-1$
+ inExternalLocationButton.setLayoutData( gridData );
+
+ // choose directory
+ locationLabel = new Label( locationGroup, SWT.NONE );
+ GridData gd_locationLabel = new GridData();
+ gd_locationLabel.horizontalIndent = 10;
+ locationLabel.setLayoutData(gd_locationLabel);
+ locationLabel.setText( Messages.getString( "locationComponent.directory" ) ); //$NON-NLS-1$
+
+ locationCombo = new Combo( locationGroup, SWT.BORDER );
+ locationCombo.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+
+ locationBrowseButton = new Button( locationGroup, SWT.PUSH );
+ locationBrowseButton.setText( Messages.getString( "locationComponent.browse" ) ); //$NON-NLS-1$
+
+ gridData = new GridData( SWT.FILL, SWT.DEFAULT, false, false );
+ locationBrowseButton.setLayoutData( gridData );
+
+ locationBrowseButton.addSelectionListener( new SelectionAdapter() {
+ public void widgetSelected( SelectionEvent e ) {
+ DirectoryDialog dialog = new DirectoryDialog(getShell());
+ dialog.setText(Messages.getString( "locationComponent.selectLocation" )); //$NON-NLS-1$
+
+ String path = locationCombo.getText();
+ if(path.length()==0) {
+ path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toPortableString();
+ }
+ dialog.setFilterPath(path);
+
+ String selectedDir = dialog.open();
+ if(selectedDir != null) {
+ locationCombo.setText( selectedDir.trim() );
+ }
+ }
+ } );
+
+ inWorkspaceButton.setSelection( true );
+
+ locationLabel.setEnabled( false );
+ locationCombo.setEnabled( false );
+ locationBrowseButton.setEnabled( false );
+ }
+
+ /**
+ * Returns the path of the location chosen by the user.
+ *
+ * According to the user input, the path either points to the workspace or
+ * to a valid user specified location on the filesystem.
+ *
+ * @return The path of the location chosen by the user.
+ * Is never <code>null</code>.
+ */
+ public IPath getLocationPath() {
+ if ( isInWorkspace() ) {
+ return Platform.getLocation();
+ }
+ return Path.fromOSString( locationCombo.getText().trim() );
+ }
+
+ /**
+ * Returns whether the workspace has been chosen as the location to use.
+ *
+ * @return <code>true</code> if the workspace is chosen as the location to use,
+ * <code>false</code> if the specified external location is to be used.
+ */
+ public boolean isInWorkspace() {
+ return inWorkspaceButton.getSelection();
+ }
+
+ public void setModifyingListener( ModifyListener modifyingListener ) {
+ this.modifyingListener = modifyingListener;
+ locationCombo.addModifyListener( modifyingListener );
+ }
+
+ public Combo getLocationCombo() {
+ return locationCombo;
+ }
+
+ public void dispose() {
+ super.dispose();
+ if(modifyingListener!=null) {
+ locationCombo.removeModifyListener( modifyingListener );
+ }
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenMaterializePomWizard.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenMaterializePomWizard.java
new file mode 100644
index 00000000..920ab4ef
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenMaterializePomWizard.java
@@ -0,0 +1,241 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.apache.maven.model.Dependency;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.MavenProjectPomScanner;
+import org.eclipse.m2e.core.project.MavenProjectScmInfo;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+
+
+/**
+ * A wizard used to import projects for Maven artifacts
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenMaterializePomWizard extends Wizard implements IImportWizard, INewWizard {
+
+ ProjectImportConfiguration importConfiguration;
+
+ MavenDependenciesWizardPage selectionPage;
+
+ MavenProjectWizardLocationPage locationPage;
+
+ Button checkOutAllButton;
+
+ Button useDeveloperConnectionButton;
+
+ // TODO replace with ArtifactKey
+ private Dependency[] dependencies;
+
+ private IStructuredSelection selection;
+
+
+ public MavenMaterializePomWizard() {
+ importConfiguration = new ProjectImportConfiguration();
+ setNeedsProgressMonitor(true);
+ setWindowTitle(Messages.MavenMaterializePomWizard_title);
+ }
+
+ public void setDependencies(Dependency[] dependencies) {
+ this.dependencies = dependencies;
+ }
+
+ public Dependency[] getDependencies() {
+ return dependencies;
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+
+ importConfiguration.setWorkingSet(SelectionUtil.getSelectedWorkingSet(selection));
+
+ ArrayList<Dependency> dependencies = new ArrayList<Dependency>();
+
+ for(Iterator<?> it = selection.iterator(); it.hasNext();) {
+ Object element = it.next();
+ ArtifactKey artifactKey = SelectionUtil.getType(element, ArtifactKey.class);
+ if(artifactKey!=null) {
+ Dependency d = new Dependency();
+ d.setGroupId(artifactKey.getGroupId());
+ d.setArtifactId(artifactKey.getArtifactId());
+ d.setVersion(artifactKey.getVersion());
+ d.setClassifier(artifactKey.getClassifier());
+ dependencies.add(d);
+ }
+ }
+
+ setDependencies(dependencies.toArray(new Dependency[dependencies.size()]));
+ }
+
+ public void addPages() {
+ selectionPage = new MavenDependenciesWizardPage(importConfiguration, //
+ Messages.MavenMaterializePomWizard_dialog_title, //
+ Messages.MavenMaterializePomWizard_dialog_message) {
+ protected void createAdvancedSettings(Composite composite, GridData gridData) {
+ checkOutAllButton = new Button(composite, SWT.CHECK);
+ checkOutAllButton.setText(Messages.MavenMaterializePomWizard_btnCheckout);
+ checkOutAllButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
+
+ useDeveloperConnectionButton = new Button(composite, SWT.CHECK);
+ useDeveloperConnectionButton.setText(Messages.MavenMaterializePomWizard_btnDev);
+ useDeveloperConnectionButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
+
+ super.createAdvancedSettings(composite, gridData);
+ }
+ };
+ selectionPage.setDependencies(dependencies);
+
+ locationPage = new MavenProjectWizardLocationPage(importConfiguration, //
+ Messages.MavenMaterializePomWizard_location_title,
+ Messages.MavenMaterializePomWizard_location_message);
+ locationPage.setLocationPath(SelectionUtil.getSelectedLocation(selection));
+
+ addPage(selectionPage);
+ addPage(locationPage);
+ }
+
+ public boolean canFinish() {
+ return super.canFinish();
+ }
+
+ public boolean performFinish() {
+ if(!canFinish()) {
+ return false;
+ }
+
+ final Dependency[] dependencies = selectionPage.getDependencies();
+
+ final boolean checkoutAllProjects = checkOutAllButton.getSelection();
+ final boolean developer = useDeveloperConnectionButton.getSelection();
+
+ MavenProjectCheckoutJob job = new MavenProjectCheckoutJob(importConfiguration, checkoutAllProjects) {
+ protected List<MavenProjectScmInfo> getProjects(IProgressMonitor monitor) throws InterruptedException {
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ MavenProjectPomScanner<MavenProjectScmInfo> scanner = new MavenProjectPomScanner<MavenProjectScmInfo>(developer, dependencies, //
+ plugin.getMavenModelManager(), //
+ plugin.getConsole());
+ scanner.run(monitor);
+ // XXX handle errors/warnings
+
+ return scanner.getProjects();
+ }
+ };
+
+ if(!locationPage.isInWorkspace()) {
+ job.setLocation(locationPage.getLocationPath().toFile());
+ }
+
+ job.schedule();
+
+ return true;
+ }
+
+// public Scm[] getScms(IProgressMonitor monitor) {
+// ArrayList scms = new ArrayList();
+//
+// MavenPlugin plugin = MavenPlugin.getDefault();
+// MavenEmbedderManager embedderManager = plugin.getMavenEmbedderManager();
+// IndexManager indexManager = plugin.getMavenRepositoryIndexManager();
+// MavenConsole console = plugin.getConsole();
+//
+// MavenEmbedder embedder = embedderManager.getWorkspaceEmbedder();
+//
+// for(int i = 0; i < dependencies.length; i++ ) {
+// try {
+// Dependency d = dependencies[i];
+//
+// Artifact artifact = embedder.createArtifact(d.getGroupId(), //
+// d.getArtifactId(), d.getVersion(), null, "pom");
+//
+// List remoteRepositories = indexManager.getArtifactRepositories(null, null);
+//
+// embedder.resolve(artifact, remoteRepositories, embedder.getLocalRepository());
+//
+// File file = artifact.getFile();
+// if(file != null) {
+// MavenProject project = embedder.readProject(file);
+//
+// Scm scm = project.getScm();
+// if(scm == null) {
+// String msg = project.getId() + " doesn't specify SCM info";
+// console.logError(msg);
+// continue;
+// }
+//
+// String connection = scm.getConnection();
+// String devConnection = scm.getDeveloperConnection();
+// String tag = scm.getTag();
+// String url = scm.getUrl();
+//
+// console.logMessage(project.getArtifactId());
+// console.logMessage("Connection: " + connection);
+// console.logMessage(" dev: " + devConnection);
+// console.logMessage(" url: " + url);
+// console.logMessage(" tag: " + tag);
+//
+// if(connection==null) {
+// if(devConnection==null) {
+// String msg = project.getId() + " doesn't specify SCM connection";
+// console.logError(msg);
+// continue;
+// }
+// scm.setConnection(devConnection);
+// }
+//
+// // connection: scm:svn:https://svn.apache.org/repos/asf/incubator/wicket/branches/wicket-1.2.x/wicket
+// // dev: scm:svn:https://svn.apache.org/repos/asf/incubator/wicket/branches/wicket-1.2.x/wicket
+// // url: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket
+// // tag: HEAD
+//
+// // TODO add an option to select all modules/projects and optimize scan
+//
+// scms.add(scm);
+//
+//// if(!connection.startsWith(SCM_SVN_PROTOCOL)) {
+//// String msg = project.getId() + " SCM type is not supported " + connection;
+//// console.logError(msg);
+//// addError(new Exception(msg));
+//// } else {
+//// String svnUrl = connection.trim().substring(SCM_SVN_PROTOCOL.length());
+//// }
+// }
+//
+// } catch(Exception ex) {
+// console.logError(ex.getMessage());
+// }
+// }
+//
+// return (Scm[]) scms.toArray(new Scm[scms.size()]);
+// }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenModuleWizard.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenModuleWizard.java
new file mode 100644
index 00000000..d9028c09
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenModuleWizard.java
@@ -0,0 +1,305 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.progress.IProgressConstants;
+
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.OpenMavenConsoleAction;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+
+
+/**
+ * A project wizard for creating a new Maven2 module project.
+ */
+public class MavenModuleWizard extends Wizard implements INewWizard {
+
+ /** The name of the default wizard page image. */
+ // protected static final String DEFAULT_PAGE_IMAGE_NAME = "icons/new_m2_project_wizard.gif";
+
+ /** The default wizard page image. */
+ // protected static final ImageDescriptor DEFAULT_PAGE_IMAGE = MavenPlugin.getImageDescriptor(DEFAULT_PAGE_IMAGE_NAME);
+
+ /** the current selection */
+ private IStructuredSelection selection;
+
+ /** the parent page (#1) */
+ protected MavenModuleWizardParentPage parentPage;
+
+ /** The archetype selection page. */
+ protected MavenProjectWizardArchetypePage archetypePage;
+
+ /** The wizard page for gathering Maven2 project information. */
+ protected MavenProjectWizardArtifactPage artifactPage;
+
+ /** The wizard page for gathering archetype project information. */
+ protected MavenProjectWizardArchetypeParametersPage parametersPage;
+
+ /** The wizard page for choosing the Maven2 dependencies to use. */
+ private MavenDependenciesWizardPage dependenciesPage;
+
+ /** The project configuration bean. */
+ protected ProjectImportConfiguration configuration;
+
+ private String moduleName;
+
+ protected boolean isEditor = false;
+
+ /** Default constructor. Sets the title and image of the wizard. */
+ public MavenModuleWizard() {
+ setWindowTitle(Messages.getString("wizard.module.title")); //$NON-NLS-1$
+ setDefaultPageImageDescriptor(MavenImages.WIZ_NEW_PROJECT);
+ setNeedsProgressMonitor(true);
+ }
+
+ public MavenModuleWizard(boolean isEditor) {
+ this();
+ this.isEditor = isEditor;
+ }
+
+ /** Creates the pages. */
+ public void addPages() {
+ configuration = new ProjectImportConfiguration();
+
+ parentPage = new MavenModuleWizardParentPage(configuration);
+ archetypePage = new MavenProjectWizardArchetypePage(configuration);
+ parametersPage = new MavenProjectWizardArchetypeParametersPage(configuration);
+ artifactPage = new MavenProjectWizardArtifactPage(configuration);
+ dependenciesPage = new MavenDependenciesWizardPage(configuration, //
+ Messages.getString("wizard.project.page.dependencies.title"), // //$NON-NLS-1$
+ Messages.getString("wizard.project.page.dependencies.description")); //$NON-NLS-1$
+ dependenciesPage.setDependencies(new Dependency[0]);
+ dependenciesPage.setShowScope(true);
+
+ addPage(parentPage);
+ addPage(archetypePage);
+ addPage(parametersPage);
+ addPage(artifactPage);
+ addPage(dependenciesPage);
+ }
+
+ /** Adds the listeners after the page controls are created. */
+ public void createPageControls(Composite pageContainer) {
+ artifactPage.setParentReadonly(true);
+ artifactPage.setTitle(Messages.getString("wizard.module.page.artifact.title")); //$NON-NLS-1$
+ archetypePage.setTitle(Messages.getString("wizard.module.page.archetype.title")); //$NON-NLS-1$
+ parametersPage.setTitle(Messages.getString("wizard.module.page.parameters.title")); //$NON-NLS-1$
+
+ super.createPageControls(pageContainer);
+
+ parametersPage.setArtifactIdEnabled(false);
+
+ parentPage.addArchetypeSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ archetypePage.setUsed(!parentPage.isSimpleProject());
+ }
+ });
+
+ parentPage.addModuleNameListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ parametersPage.setProjectName(parentPage.getModuleName());
+ artifactPage.setProjectName(parentPage.getModuleName());
+ }
+ });
+
+ parentPage.addParentProjectListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ copyParentValues();
+ }
+ });
+
+ if(selection != null && selection.size() > 0) {
+ parentPage.setParent(selection.getFirstElement());
+ copyParentValues();
+ }
+ }
+
+ /** Copies the parent project parameters to the artifact page. */
+ protected void copyParentValues() {
+ Model model = parentPage.getParentModel();
+ if(model != null) {
+ String groupId = model.getGroupId();
+ String artifactId = model.getArtifactId();
+ String version = model.getVersion();
+
+ if(groupId == null) {
+ Parent parent = model.getParent();
+ if(parent != null) {
+ groupId = parent.getGroupId();
+ }
+ }
+ if(version == null) {
+ Parent parent = model.getParent();
+ if(parent != null) {
+ version = parent.getVersion();
+ }
+ }
+
+ artifactPage.setParentProject(groupId, artifactId, version);
+ parametersPage.setParentProject(groupId, artifactId, version);
+ }
+ }
+
+ /** Stores the current selection. */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ }
+
+ /** Performs the "finish" action. */
+ public boolean performFinish() {
+ // First of all, we extract all the information from the wizard pages.
+ // Note that this should not be done inside the operation we will run
+ // since many of the wizard pages' methods can only be invoked from within
+ // the SWT event dispatcher thread. However, the operation spawns a new
+ // separate thread to perform the actual work, i.e. accessing SWT elements
+ // from within that thread would lead to an exception.
+
+ final String moduleName = parentPage.getModuleName();
+
+ // Get the location where to create the project. For some reason, when using
+ // the default workspace location for a project, we have to pass null
+ // instead of the actual location.
+ final IPath location = parentPage.getParentContainer().getLocation();
+
+ final IFile parentPom = parentPage.getPom();
+
+ Job job;
+
+ final MavenPlugin plugin = MavenPlugin.getDefault();
+
+ if(parentPage.isSimpleProject()) {
+
+ final Model model = artifactPage.getModel();
+ @SuppressWarnings("unchecked")
+ List<Dependency> modelDependencies = model.getDependencies();
+ modelDependencies.addAll(Arrays.asList(dependenciesPage.getDependencies()));
+
+ final String[] folders = artifactPage.getFolders();
+
+ job = new WorkspaceJob(Messages.getString("wizard.project.job.creatingProject", moduleName)) { //$NON-NLS-1$
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
+ String projectName = configuration.getProjectName(model);
+ IProject project = configuration.getProject(ResourcesPlugin.getWorkspace().getRoot(), model);
+
+ // XXX respect parent's setting for separate projects for modules
+ // XXX should run update sources on parent instead of creating new module project
+
+ plugin.getProjectConfigurationManager().createSimpleProject(project, location.append(moduleName), model,
+ folders, configuration, monitor);
+
+ setModule(projectName);
+
+ return Status.OK_STATUS;
+ }
+ };
+
+ } else {
+ Model model = parametersPage.getModel();
+
+ final IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(moduleName);
+ final Archetype archetype = archetypePage.getArchetype();
+
+ final String groupId = model.getGroupId();
+ final String artifactId = model.getArtifactId();
+ final String version = model.getVersion();
+ final String javaPackage = parametersPage.getJavaPackage();
+ final Properties properties = parametersPage.getProperties();
+
+ job = new WorkspaceJob(Messages.getString("wizard.project.job.creating", archetype.getArtifactId())) { //$NON-NLS-1$
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ plugin.getProjectConfigurationManager().createArchetypeProject(project, location, archetype, //
+ groupId, artifactId, version, javaPackage, properties, configuration, monitor);
+
+ setModule(moduleName);
+
+ return Status.OK_STATUS;
+ }
+ };
+ }
+ job.addJobChangeListener(new JobChangeAdapter() {
+ public void done(IJobChangeEvent event) {
+ final IStatus result = event.getResult();
+ if(result.isOK()) {
+ if(!isEditor) {
+ plugin.getMavenModelManager().addModule(parentPom, moduleName);
+ }
+
+ } else {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openError(getShell(), //
+ Messages.getString("wizard.project.job.failed", moduleName), // //$NON-NLS-1$
+ result.getMessage());
+ }
+ });
+ }
+ }
+ });
+ job.setRule(plugin.getProjectConfigurationManager().getRule());
+ job.schedule();
+
+ if(isEditor) {
+ try {
+ job.join();
+ } catch(InterruptedException ex) {
+ // ignore
+ }
+ }
+
+ return true;
+ }
+
+ void setModule(String moduleName) {
+ this.moduleName = moduleName;
+ }
+
+ public String getModuleName() {
+ return this.moduleName;
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenModuleWizardParentPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenModuleWizardParentPage.java
new file mode 100644
index 00000000..4b2c1b14
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenModuleWizardParentPage.java
@@ -0,0 +1,310 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+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.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+
+
+/**
+ * Maven2ModuleParentPage
+ */
+public class MavenModuleWizardParentPage extends AbstractMavenWizardPage {
+
+ /** the module name input field */
+ private Combo moduleNameCombo;
+
+ /** the parent project input field */
+ protected Text parentProjectText;
+
+ /** the "create simple project" checkbox */
+ private Button simpleProject;
+
+ /** the parent object entity */
+ protected Object parentObject;
+
+ /** the parent container */
+ private IContainer parentContainer;
+
+ /** the parent POM file */
+ private IFile pom;
+
+ /** the parent model */
+ private Model parentModel;
+
+ /** working set selector widget */
+ private WorkingSetGroup workingSetGroup;
+
+
+ /** Creates a new page. */
+ public MavenModuleWizardParentPage(ProjectImportConfiguration projectImportConfiguration) {
+ super("MavenModuleWizardParentPage", projectImportConfiguration);
+ setTitle(Messages.getString("wizard.module.page.parent.title")); //$NON-NLS-1$
+ setDescription(Messages.getString("wizard.module.page.parent.description")); //$NON-NLS-1$
+ setPageComplete(false);
+ }
+
+ /** Creates the page controls. */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ container.setLayout(new GridLayout(3, false));
+
+ simpleProject = new Button(container, SWT.CHECK);
+ simpleProject.setText(Messages.getString("wizard.project.page.project.simpleProject")); //$NON-NLS-1$
+ simpleProject.setData("name", "simpleProjectButton"); //$NON-NLS-1$ //$NON-NLS-2$
+ simpleProject.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
+ simpleProject.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ validate();
+ }
+ });
+
+ Label nameLabel = new Label(container, SWT.NONE);
+ GridData gd_nameLabel = new GridData();
+ gd_nameLabel.verticalIndent = 10;
+ nameLabel.setLayoutData(gd_nameLabel);
+ nameLabel.setText(Messages.getString("wizard.module.page.parent.moduleName")); //$NON-NLS-1$
+
+ moduleNameCombo = new Combo(container, SWT.BORDER);
+ GridData gd_moduleNameCombo = new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1);
+ gd_moduleNameCombo.verticalIndent = 10;
+ moduleNameCombo.setLayoutData(gd_moduleNameCombo);
+ moduleNameCombo.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ });
+ addFieldWithHistory("moduleName", moduleNameCombo); //$NON-NLS-1$
+
+ Label parentLabel = new Label(container, SWT.NONE);
+ parentLabel.setText(Messages.getString("wizard.module.page.parent.parentProject")); //$NON-NLS-1$
+
+ parentProjectText = new Text(container, SWT.BORDER);
+ parentProjectText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
+ parentProjectText.setEditable(false);
+
+ Button browseButton = new Button(container, SWT.NONE);
+ browseButton.setText(Messages.getString("wizard.module.page.parent.browse")); //$NON-NLS-1$
+ browseButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ MavenProjectSelectionDialog dialog = new MavenProjectSelectionDialog(getShell());
+ if(dialog.open() == Window.OK) {
+ setParent(dialog.getFirstResult());
+ validate();
+ }
+ }
+ });
+
+ this.workingSetGroup = new WorkingSetGroup(container, getImportConfiguration(), getShell());
+
+ createAdvancedSettings(container, new GridData(SWT.FILL, SWT.TOP, true, false, 3, 1));
+
+ initialize();
+
+ setControl(container);
+ }
+
+ /** Initializes the GUI components and validates the page. */
+ private void initialize() {
+ loadParent();
+ validate();
+ }
+
+ /** Validates the data entered. */
+ void validate() {
+ String moduleName = moduleNameCombo.getText().trim();
+ if(moduleName.length() == 0) {
+ setErrorMessage(null);
+ setMessage(Messages.getString("wizard.module.page.parent.validator.moduleName")); //$NON-NLS-1$
+ setPageComplete(false);
+ return;
+ }
+
+ // check whether the project name is valid
+ IStatus nameStatus =
+ ResourcesPlugin.getWorkspace().validateName(moduleName, IResource.PROJECT);
+ if(!nameStatus.isOK()) {
+ setErrorMessage(nameStatus.getMessage());
+ setPageComplete(false);
+ return;
+ }
+
+ // check if the given folder already exists
+ if(parentContainer != null && parentContainer.exists(new Path(moduleName))) {
+ setErrorMessage(Messages.getString("wizard.module.page.parent.validator.nameExists")); //$NON-NLS-1$
+ setPageComplete(false);
+ return;
+ }
+
+ if(pom == null) {
+ setErrorMessage(null);
+ setMessage(Messages.getString("wizard.module.page.parent.validator.parentProject")); //$NON-NLS-1$
+ setPageComplete(false);
+ return;
+ }
+ if(!validateParent()){
+ return;
+ }
+ setErrorMessage(null);
+ setMessage(null);
+ setPageComplete(true);
+ }
+
+ /** Assigns a parent object. */
+ public void setParent(Object parent) {
+ parentObject = parent;
+ loadParent();
+ }
+
+ /** Loads the data from the parent object. */
+ protected void loadParent() {
+ if(parentObject == null) {
+ return;
+ }
+
+ int type = SelectionUtil.getElementType(parentObject);
+
+ if(SelectionUtil.POM_FILE == type) {
+ pom = SelectionUtil.getType(parentObject, IFile.class);
+ } else if(SelectionUtil.PROJECT_WITH_NATURE == type) {
+ IProject project = SelectionUtil.getType(parentObject, IProject.class);
+ pom = project.getFile(IMavenConstants.POM_FILE_NAME);
+
+ workingSetGroup.selectWorkingSets(SelectionUtil.getAssignedWorkingSets(project));
+ } else if(parentObject instanceof IContainer) {
+ pom = ((IContainer) parentObject).getFile(new Path(IMavenConstants.POM_FILE_NAME));
+ }
+
+ if(pom != null && pom.exists()) {
+ parentObject = pom;
+ parentContainer = pom.getParent();
+
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ try {
+ parentModel = plugin.getMavenModelManager().readMavenModel(pom);
+ validateParent();
+ parentProjectText.setText(parentModel.getArtifactId());
+ } catch(CoreException e) {
+ MavenLogger.log("Error loading POM: " + e.getMessage(), e);
+ }
+ }
+ }
+
+ private boolean validateParent(){
+ if(parentModel != null){
+ if(!"pom".equals(parentModel.getPackaging())){ //$NON-NLS-1$
+ setMessage(null);
+ setErrorMessage(org.eclipse.m2e.core.internal.Messages.MavenModuleWizardParentPage_error);
+ setPageComplete(false);
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /** Returns "true" if the user chose not to use archetypes. */
+ public boolean isSimpleProject() {
+ return simpleProject.getSelection();
+ }
+
+ /** Skips the archetype selection page if the user chooses a simple project. */
+ public IWizardPage getNextPage() {
+ return getWizard().getPage(
+ isSimpleProject() ? "MavenProjectWizardArtifactPage" : "MavenProjectWizardArchetypePage");
+ }
+
+ /** Returns the module name. */
+ public String getModuleName() {
+ return moduleNameCombo.getText();
+ }
+
+ /** Returns the parent model. */
+ public Model getParentModel() {
+ return parentModel;
+ }
+
+ /** Returns the parent POM file handle. */
+ public IFile getPom() {
+ return pom;
+ }
+
+ /** Returns the parent container. */
+ public IContainer getParentContainer() {
+ return parentContainer;
+ }
+
+ /** Offers a listener hookup to the pages watching the module name field. */
+ public void addModuleNameListener(ModifyListener modifyListener) {
+ moduleNameCombo.addModifyListener(modifyListener);
+ }
+
+ /** Unhooks the listener watching the module name field. */
+ public void removesModuleNameListener(ModifyListener modifyListener) {
+ moduleNameCombo.removeModifyListener(modifyListener);
+ }
+
+ /** Offers a listener hookup to the pages watching the parent name field. */
+ public void addParentProjectListener(ModifyListener modifyListener) {
+ parentProjectText.addModifyListener(modifyListener);
+ }
+
+ /** Unhooks the listener watching the parent name field. */
+ public void removesParentProjectListener(ModifyListener modifyListener) {
+ parentProjectText.removeModifyListener(modifyListener);
+ }
+
+ /** Offers a listener hookup to the pages watching the archetype switch. */
+ public void addArchetypeSelectionListener(SelectionListener selectionListener) {
+ simpleProject.addSelectionListener(selectionListener);
+ }
+
+ /** Removes the listener watching the project name field. */
+ public void removeArchetypeSelectionListener(SelectionListener selectionListener) {
+ simpleProject.removeSelectionListener(selectionListener);
+ }
+
+ /** Cleans up. */
+ public void dispose() {
+ super.dispose();
+ workingSetGroup.dispose();
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenParentComponent.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenParentComponent.java
new file mode 100644
index 00000000..b40aaeac
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenParentComponent.java
@@ -0,0 +1,223 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+
+import org.eclipse.m2e.core.core.Messages;
+
+
+/**
+ * Wizard page component showing panel project properties.
+ */
+public class MavenParentComponent extends Composite {
+
+ /** parent artifact id input field */
+ private Combo parentArtifactIdCombo;
+
+ /** parent group id input field */
+ private Combo parentGroupIdCombo;
+
+ /** parent version input field */
+ private Combo parentVersionCombo;
+
+ /** the "clear parent section" button */
+ private Button parentClearButton;
+
+ /** the "browse..." button */
+ private Button parentBrowseButton;
+
+ private Label groupIdLabel;
+
+ private Label artifactIdLabel;
+
+ private Label versionLabel;
+
+ /** Creates a new panel with parent controls. */
+ public MavenParentComponent(Composite parent, int style) {
+ super(parent, SWT.NONE);
+
+ boolean readonly = (style & SWT.READ_ONLY) != 0;
+
+ GridLayout topLayout = new GridLayout();
+ topLayout.marginHeight = 0;
+ topLayout.marginWidth = 0;
+ setLayout(topLayout);
+
+ Group group = new Group(this, SWT.NONE);
+ group.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ group.setText(Messages.getString("wizard.project.page.artifact.parent.title")); //$NON-NLS-1$
+
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 3;
+ group.setLayout(gridLayout);
+
+ groupIdLabel = new Label(group, SWT.NONE);
+ groupIdLabel.setText(Messages.getString("wizard.project.page.artifact.parent.groupId")); //$NON-NLS-1$
+
+ parentGroupIdCombo = new Combo(group, SWT.NONE);
+ parentGroupIdCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ parentGroupIdCombo.setData("name", "parentGroupIdCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+ parentGroupIdCombo.setEnabled(!readonly);
+
+ artifactIdLabel = new Label(group, SWT.NONE);
+ artifactIdLabel.setText(Messages.getString("wizard.project.page.artifact.parent.artifactId")); //$NON-NLS-1$
+
+ parentArtifactIdCombo = new Combo(group, SWT.NONE);
+ parentArtifactIdCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ parentArtifactIdCombo.setData("name", "parentArtifactIdCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+ parentArtifactIdCombo.setEnabled(!readonly);
+
+ versionLabel = new Label(group, SWT.NONE);
+ versionLabel.setText(Messages.getString("wizard.project.page.artifact.parent.version")); //$NON-NLS-1$
+
+ parentVersionCombo = new Combo(group, SWT.NONE);
+ GridData gd_versionCombo = new GridData(SWT.LEFT, SWT.CENTER, true, false);
+ gd_versionCombo.widthHint = 150;
+ parentVersionCombo.setLayoutData(gd_versionCombo);
+ parentVersionCombo.setEnabled(!readonly);
+ parentVersionCombo.setData("name", "parentVersionCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ if(!readonly) {
+ Composite buttonPanel = new Composite(group, SWT.NONE);
+ RowLayout rowLayout = new RowLayout();
+ rowLayout.pack = false;
+ rowLayout.marginTop = 0;
+ rowLayout.marginRight = 0;
+ rowLayout.marginLeft = 0;
+ rowLayout.marginBottom = 0;
+ buttonPanel.setLayout(rowLayout);
+ buttonPanel.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
+
+ parentBrowseButton = new Button(buttonPanel, SWT.NONE);
+ parentBrowseButton.setText(Messages.getString("wizard.project.page.artifact.parent.browse")); //$NON-NLS-1$
+ parentBrowseButton.setData("name", "parentBrowseButton"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ parentClearButton = new Button(buttonPanel, SWT.NONE);
+ parentClearButton.setText(Messages.getString("wizard.project.page.artifact.parent.clear")); //$NON-NLS-1$
+ parentClearButton.setData("name", "parentClearButton"); //$NON-NLS-1$ //$NON-NLS-2$
+ parentClearButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ setValues("", "", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ });
+ }
+ }
+
+ public Combo getGroupIdCombo() {
+ return parentGroupIdCombo;
+ }
+
+ public Combo getArtifactIdCombo() {
+ return this.parentArtifactIdCombo;
+ }
+
+ public Combo getVersionCombo() {
+ return this.parentVersionCombo;
+ }
+
+ public void setWidthGroup(WidthGroup widthGroup) {
+ widthGroup.addControl(this.groupIdLabel);
+ widthGroup.addControl(this.artifactIdLabel);
+ widthGroup.addControl(this.versionLabel);
+ }
+
+ /** Adds modify listener to the input controls. */
+ public void addModifyListener(ModifyListener listener) {
+ parentArtifactIdCombo.addModifyListener(listener);
+ parentGroupIdCombo.addModifyListener(listener);
+ parentVersionCombo.addModifyListener(listener);
+ }
+
+ /** Removes the listener from the input controls. */
+ public void removeModifyListener(ModifyListener listener) {
+ parentArtifactIdCombo.removeModifyListener(listener);
+ parentGroupIdCombo.removeModifyListener(listener);
+ parentVersionCombo.removeModifyListener(listener);
+ }
+
+ /** Adds selection listener to the "browse" button. */
+ public void addBrowseButtonListener(SelectionListener listener) {
+ if(parentBrowseButton != null) {
+ parentBrowseButton.addSelectionListener(listener);
+ }
+ }
+
+ /** Removes the selection listener from the "browse" button. */
+ public void removeBrowseButtonListener(SelectionListener listener) {
+ if(parentBrowseButton != null) {
+ parentBrowseButton.removeSelectionListener(listener);
+ }
+ }
+
+ /** Enables the "clear" button. */
+ public void setClearButtonEnabled(boolean enabled) {
+ if(parentClearButton != null) {
+ parentClearButton.setEnabled(enabled);
+ }
+ }
+
+ /** Sets the parent group values. */
+ public void setValues(String groupId, String artifactId, String version) {
+ parentGroupIdCombo.setText(groupId==null ? "" : groupId); //$NON-NLS-1$
+ parentArtifactIdCombo.setText(artifactId==null ? "" : artifactId); //$NON-NLS-1$
+ parentVersionCombo.setText(version==null ? "" : version); //$NON-NLS-1$
+ }
+
+ /** Updates a Maven model. */
+ public void updateModel(Model model) {
+ String groupId = parentGroupIdCombo.getText().trim();
+ if(groupId.length() > 0) {
+ Parent parent = new Parent();
+ parent.setGroupId(groupId);
+ parent.setArtifactId(parentArtifactIdCombo.getText().trim());
+ parent.setVersion(parentVersionCombo.getText().trim());
+ model.setParent(parent);
+ }
+ }
+
+ /**
+ * Validates the inputs to make sure all three fields are present in the same time, or none at all.
+ */
+ public boolean validate() {
+ int parentCheck = 0;
+ if(parentGroupIdCombo.getText().trim().length() > 0) {
+ parentCheck++ ;
+ }
+ if(parentArtifactIdCombo.getText().trim().length() > 0) {
+ parentCheck++ ;
+ }
+ if(parentVersionCombo.getText().trim().length() > 0) {
+ parentCheck++ ;
+ }
+
+ setClearButtonEnabled(parentCheck > 0);
+
+ return parentCheck == 0 || parentCheck == 3;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenPomSelectionComponent.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenPomSelectionComponent.java
new file mode 100644
index 00000000..6c708de5
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenPomSelectionComponent.java
@@ -0,0 +1,580 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import com.ibm.icu.text.DateFormat;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+
+import org.apache.lucene.search.BooleanQuery;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.index.IndexedArtifact;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.index.UserInputSearchExpression;
+import org.eclipse.m2e.core.internal.Messages;
+
+
+/**
+ * MavenPomSelectionComposite
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenPomSelectionComponent extends Composite {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.widgets.Widget#dispose()
+ */
+ public void dispose() {
+ if(searchJob != null) {
+ searchJob.cancel();
+ }
+ super.dispose();
+ }
+
+ Text searchText = null;
+
+ TreeViewer searchResultViewer = null;
+
+ Button javadocCheckBox;
+
+ Button sourcesCheckBox;
+
+ Button testCheckBox;
+
+ /**
+ * One of {@link IIndex#SEARCH_ARTIFACT}, {@link IIndex#SEARCH_CLASS_NAME},
+ */
+ String queryType;
+
+ SearchJob searchJob;
+
+ private IStatus status;
+
+ private ISelectionChangedListener selectionListener;
+
+ public static final String P_SEARCH_INCLUDE_JAVADOC = "searchIncludesJavadoc"; //$NON-NLS-1$
+
+ public static final String P_SEARCH_INCLUDE_SOURCES = "searchIncludesSources"; //$NON-NLS-1$
+
+ public static final String P_SEARCH_INCLUDE_TESTS = "searchIncludesTests"; //$NON-NLS-1$
+
+ private static final long SHORT_DELAY = 150L;
+
+ private static final long LONG_DELAY = 500L;
+
+ final HashSet<String> artifactKeys = new HashSet<String>();
+ final HashSet<String> managedKeys = new HashSet<String>();
+
+ public MavenPomSelectionComponent(Composite parent, int style) {
+ super(parent, style);
+ createSearchComposite();
+ }
+
+ private void createSearchComposite() {
+ GridLayout gridLayout = new GridLayout(2, false);
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ setLayout(gridLayout);
+
+ Label searchTextlabel = new Label(this, SWT.NONE);
+ searchTextlabel.setText(Messages.MavenPomSelectionComponent_search_title);
+ searchTextlabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
+
+ searchText = new Text(this, SWT.BORDER | SWT.SEARCH);
+ searchText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1));
+ searchText.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent e) {
+ if(e.keyCode == SWT.ARROW_DOWN) {
+ searchResultViewer.getTree().setFocus();
+ selectFirstElementInTheArtifactTreeIfNoSelectionHasBeenMade();
+ }
+ }
+ });
+
+ searchText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ scheduleSearch(searchText.getText(), true);
+ }
+ });
+
+ Label searchResultsLabel = new Label(this, SWT.NONE);
+ searchResultsLabel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1));
+ searchResultsLabel.setText(Messages.MavenPomSelectionComponent_lblResults);
+
+ Tree tree = new Tree(this, SWT.BORDER | SWT.SINGLE);
+ tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
+ tree.setData("name", "searchResultTree"); //$NON-NLS-1$ //$NON-NLS-2$
+ tree.addFocusListener(new FocusListener() {
+
+ public void focusGained(FocusEvent e) {
+ selectFirstElementInTheArtifactTreeIfNoSelectionHasBeenMade();
+ }
+
+ public void focusLost(FocusEvent e) {
+
+ }
+ });
+
+ searchResultViewer = new TreeViewer(tree);
+ }
+
+ void selectFirstElementInTheArtifactTreeIfNoSelectionHasBeenMade() {
+ //
+ // If we have started a new search when focus is passed to the tree viewer we will automatically select
+ // the first element if no element has been selected from a previous expedition into the tree viewer.
+ //
+ if(searchResultViewer.getTree().getItemCount() > 0 && searchResultViewer.getSelection().isEmpty()) {
+ Object artifact = searchResultViewer.getTree().getTopItem().getData();
+ searchResultViewer.setSelection(new StructuredSelection(artifact), true);
+ }
+ }
+
+ protected boolean showClassifiers() {
+ return (queryType != null && IIndex.SEARCH_ARTIFACT.equals(queryType));
+ }
+
+ private void setupButton(final Button button, String label, final String prefName, int horizontalIndent) {
+ button.setText(label);
+ GridData gd = new GridData(SWT.LEFT, SWT.TOP, false, false);
+ gd.horizontalIndent = horizontalIndent;
+ button.setLayoutData(gd);
+ boolean check = MavenPlugin.getDefault().getPreferenceStore().getBoolean(prefName);
+ button.setSelection(check);
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ boolean checked = button.getSelection();
+ MavenPlugin.getDefault().getPreferenceStore().setValue(prefName, checked);
+ scheduleSearch(searchText.getText(), false);
+ }
+ });
+ }
+
+ public void init(String queryText, String queryType, Set<ArtifactKey> artifacts, Set<ArtifactKey> managed) {
+ this.queryType = queryType;
+
+ if(queryText != null) {
+ searchText.setText(queryText);
+ }
+
+ if(artifacts != null) {
+ for(ArtifactKey a : artifacts) {
+ artifactKeys.add(a.getGroupId() + ":" + a.getArtifactId()); //$NON-NLS-1$
+ artifactKeys.add(a.getGroupId() + ":" + a.getArtifactId() + ":" + a.getVersion()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ if (managed != null) {
+ for (ArtifactKey a : managed) {
+ managedKeys.add(a.getGroupId() + ":" + a.getArtifactId()); //$NON-NLS-1$
+ managedKeys.add(a.getGroupId() + ":" + a.getArtifactId() + ":" + a.getVersion()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ searchResultViewer.setContentProvider(new SearchResultContentProvider());
+ searchResultViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(new SearchResultLabelProvider(artifactKeys, managedKeys, queryType)));
+ searchResultViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ if(!selection.isEmpty()) {
+ if(selection.size() == 1) {
+ IndexedArtifactFile f = getSelectedIndexedArtifactFile(selection.getFirstElement());
+ // int severity = artifactKeys.contains(f.group + ":" + f.artifact) ? IStatus.ERROR : IStatus.OK;
+ int severity = IStatus.OK;
+ String date = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT).format(f.date);
+ setStatus(
+ severity,
+ NLS.bind(Messages.MavenPomSelectionComponent_detail1, f.fname,
+ (f.size != -1 ? NLS.bind(Messages.MavenPomSelectionComponent_details2, date, f.size) : date)));
+ } else {
+ setStatus(IStatus.OK, NLS.bind(Messages.MavenPomSelectionComponent_selected, selection.size()));
+ }
+ } else {
+ setStatus(IStatus.ERROR, Messages.MavenPomSelectionComponent_nosel);
+ }
+ }
+ });
+ setupClassifiers();
+ setStatus(IStatus.ERROR, ""); //$NON-NLS-1$
+ scheduleSearch(queryText, false);
+ }
+
+ protected void setupClassifiers() {
+ if(showClassifiers()) {
+ Composite includesComp = new Composite(this, SWT.NONE);
+ includesComp.setLayout(new GridLayout(3, true));
+ GridData gd = new GridData(SWT.LEFT, SWT.TOP, true, false);
+ includesComp.setLayoutData(gd);
+
+ javadocCheckBox = new Button(includesComp, SWT.CHECK);
+ setupButton(javadocCheckBox, Messages.MavenPomSelectionComponent_btnJavadoc, P_SEARCH_INCLUDE_JAVADOC, 0);
+
+ sourcesCheckBox = new Button(includesComp, SWT.CHECK);
+ setupButton(sourcesCheckBox, Messages.MavenPomSelectionComponent_btnSource, P_SEARCH_INCLUDE_SOURCES, 10);
+
+ testCheckBox = new Button(includesComp, SWT.CHECK);
+ setupButton(testCheckBox, Messages.MavenPomSelectionComponent_btnTests, P_SEARCH_INCLUDE_TESTS, 10);
+ }
+ }
+
+ public IStatus getStatus() {
+ return this.status;
+ }
+
+ public void addDoubleClickListener(IDoubleClickListener listener) {
+ searchResultViewer.addDoubleClickListener(listener);
+ }
+
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ this.selectionListener = listener;
+ }
+
+ void setStatus(int severity, String message) {
+ this.status = new Status(severity, IMavenConstants.PLUGIN_ID, 0, message, null);
+ if(selectionListener != null) {
+ selectionListener.selectionChanged(new SelectionChangedEvent(searchResultViewer, searchResultViewer
+ .getSelection()));
+ }
+ }
+
+ public IndexedArtifact getIndexedArtifact() {
+ IStructuredSelection selection = (IStructuredSelection) searchResultViewer.getSelection();
+ Object element = selection.getFirstElement();
+ if(element instanceof IndexedArtifact) {
+ return (IndexedArtifact) element;
+ }
+ TreeItem[] treeItems = searchResultViewer.getTree().getSelection();
+ if(treeItems.length == 0) {
+ return null;
+ }
+ return (IndexedArtifact) treeItems[0].getParentItem().getData();
+ }
+
+ public IndexedArtifactFile getIndexedArtifactFile() {
+ IStructuredSelection selection = (IStructuredSelection) searchResultViewer.getSelection();
+ return getSelectedIndexedArtifactFile(selection.getFirstElement());
+ }
+
+ IndexedArtifactFile getSelectedIndexedArtifactFile(Object element) {
+ if(element instanceof IndexedArtifact) {
+ //the idea here is that if we have a managed version for something, then the IndexedArtifact shall
+ //represent that value..
+ IndexedArtifact ia = (IndexedArtifact)element;
+ if (managedKeys.contains(getKey(ia))) {
+ for (IndexedArtifactFile file : ia.getFiles()) {
+ if (managedKeys.contains(getKey(file))) {
+ return file;
+ }
+ }
+ }
+ return ia.getFiles().iterator().next();
+ }
+ return (IndexedArtifactFile) element;
+ }
+
+ void scheduleSearch(String query, boolean delay) {
+ if(query != null && query.length() > 2) {
+ if(searchJob == null) {
+ IndexManager indexManager = MavenPlugin.getDefault().getIndexManager();
+ searchJob = new SearchJob(queryType, indexManager);
+ } else {
+ if(!searchJob.cancel()) {
+ //for already running ones, just create new instance so that the previous one can piecefully die
+ //without preventing the new one from completing first
+ IndexManager indexManager = MavenPlugin.getDefault().getIndexManager();
+ searchJob = new SearchJob(queryType, indexManager);
+ }
+ }
+ searchJob.setQuery(query.toLowerCase());
+ searchJob.schedule(delay ? LONG_DELAY : SHORT_DELAY);
+ } else {
+ if(searchJob != null) {
+ searchJob.cancel();
+ }
+ }
+ }
+
+ static String getKey(IndexedArtifactFile file) {
+ return file.group + ":" + file.artifact + ":" + file.version; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ static String getKey(IndexedArtifact art) {
+ return art.getGroupId() + ":" + art.getArtifactId(); //$NON-NLS-1$
+ }
+
+
+ /**
+ * Search Job
+ */
+ private class SearchJob extends Job {
+
+ private IndexManager indexManager;
+
+ private String query;
+
+ private String field;
+
+ private volatile boolean stop = false;
+
+ public SearchJob(String field, IndexManager indexManager) {
+ super(Messages.MavenPomSelectionComponent_searchJob);
+ this.field = field;
+ this.indexManager = indexManager;
+ }
+
+ public void setQuery(String query) {
+ this.query = query;
+ }
+
+ public boolean shouldRun() {
+ stop = false;
+ return super.shouldRun();
+ }
+
+ public int getClassifier() {
+ int classifier = IIndex.SEARCH_JARS;
+ if(MavenPlugin.getDefault().getPreferenceStore().getBoolean(P_SEARCH_INCLUDE_JAVADOC)) {
+ classifier = classifier + IIndex.SEARCH_JAVADOCS;
+ }
+ if(MavenPlugin.getDefault().getPreferenceStore().getBoolean(P_SEARCH_INCLUDE_SOURCES)) {
+ classifier = classifier + IIndex.SEARCH_SOURCES;
+ }
+ if(MavenPlugin.getDefault().getPreferenceStore().getBoolean(P_SEARCH_INCLUDE_TESTS)) {
+ classifier = classifier + IIndex.SEARCH_TESTS;
+ }
+ return classifier;
+ }
+
+ protected IStatus run(IProgressMonitor monitor) {
+ int classifier = showClassifiers() ? getClassifier() : IIndex.SEARCH_ALL;
+ if(searchResultViewer == null || searchResultViewer.getControl() == null
+ || searchResultViewer.getControl().isDisposed()) {
+ return Status.CANCEL_STATUS;
+ }
+ if(query != null) {
+ String activeQuery = query;
+ try {
+ setResult(IStatus.OK, NLS.bind(Messages.MavenPomSelectionComponent_searching, activeQuery.toLowerCase()),
+ null);
+
+ // TODO: cstamas identified this as "user input", true?
+ Map<String, IndexedArtifact> res = indexManager.getAllIndexes().search( new UserInputSearchExpression(activeQuery), field, classifier);
+ setResult(IStatus.OK, NLS.bind(Messages.MavenPomSelectionComponent_results, activeQuery, res.size()), res);
+ } catch(BooleanQuery.TooManyClauses ex) {
+ setResult(IStatus.ERROR, Messages.MavenPomSelectionComponent_toomany,
+ Collections.<String, IndexedArtifact> emptyMap());
+ } catch(final RuntimeException ex) {
+ setResult(IStatus.ERROR, NLS.bind(Messages.MavenPomSelectionComponent_error, ex.toString()),
+ Collections.<String, IndexedArtifact> emptyMap());
+ } catch(final Exception ex) {
+ setResult(IStatus.ERROR, NLS.bind(Messages.MavenPomSelectionComponent_error, ex.getMessage()),
+ Collections.<String, IndexedArtifact> emptyMap());
+ }
+ }
+ return Status.OK_STATUS;
+ }
+
+ protected void canceling() {
+ stop = true;
+ }
+
+ private void setResult(final int severity, final String message, final Map<String, IndexedArtifact> result) {
+ if(stop)
+ return;
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ setStatus(severity, message);
+ if(result != null) {
+ if(!searchResultViewer.getControl().isDisposed()) {
+ searchResultViewer.setInput(result);
+ }
+ }
+ }
+ });
+ }
+ }
+
+ public static class SearchResultLabelProvider extends LabelProvider implements IColorProvider, DelegatingStyledCellLabelProvider.IStyledLabelProvider {
+ private final Set<String> artifactKeys;
+
+ private final String queryType;
+ private final Set<String> managedKeys;
+
+ /**
+ * both managedkeys and artifctkeys are supposed to hold both gr:art:ver combos and gr:art combos
+ * @param artifactKeys
+ * @param managedKeys
+ * @param queryType
+ */
+ public SearchResultLabelProvider(Set<String> artifactKeys, Set<String> managedKeys, String queryType) {
+ this.artifactKeys = artifactKeys;
+ this.queryType = queryType;
+ this.managedKeys = managedKeys;
+ }
+
+ public String getText(Object element) {
+ return super.getText(element);
+ }
+
+ protected String getRepoDisplayName(String repo) {
+ return repo;
+ }
+
+ public Color getForeground(Object element) {
+ if(element instanceof IndexedArtifactFile) {
+ IndexedArtifactFile f = (IndexedArtifactFile) element;
+ if(artifactKeys.contains(getKey(f))) {
+ return Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
+ }
+ } else if(element instanceof IndexedArtifact) {
+ IndexedArtifact i = (IndexedArtifact) element;
+ if(artifactKeys.contains(getKey(i))) {
+ return Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
+ }
+ }
+ return null;
+ }
+
+ public Color getBackground(Object element) {
+ return null;
+ }
+
+ public Image getImage(Object element) {
+ if(element instanceof IndexedArtifactFile) {
+ IndexedArtifactFile f = (IndexedArtifactFile) element;
+ if (managedKeys.contains(getKey(f))) {
+ return MavenImages.getOverlayImage(f.sourcesExists==IIndex.PRESENT ? MavenImages.PATH_VERSION_SRC : MavenImages.PATH_VERSION,
+ MavenImages.PATH_LOCK, IDecoration.BOTTOM_LEFT);
+ }
+
+ if(f.sourcesExists==IIndex.PRESENT) {
+ return MavenImages.IMG_VERSION_SRC;
+ }
+ return MavenImages.IMG_VERSION;
+ } else if(element instanceof IndexedArtifact) {
+ IndexedArtifact i = (IndexedArtifact) element;
+ if (managedKeys.contains(getKey(i))) {
+ return MavenImages.getOverlayImage(MavenImages.PATH_JAR, MavenImages.PATH_LOCK, IDecoration.BOTTOM_LEFT);
+ }
+ return MavenImages.IMG_JAR;
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider#getStyledText(java.lang.Object)
+ */
+ public StyledString getStyledText(Object element) {
+ if(element instanceof IndexedArtifact) {
+ IndexedArtifact a = (IndexedArtifact) element;
+ String name = (a.getClassname() == null ? "" : a.getClassname() + " " + a.getPackageName() + " ") + a.getGroupId() + " " + a.getArtifactId(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ StyledString ss = new StyledString();
+ ss.append(name);
+ if (managedKeys.contains(getKey(a))) {
+ ss.append(Messages.MavenPomSelectionComponent_managed_decoration, StyledString.DECORATIONS_STYLER);
+ }
+ return ss;
+ } else if(element instanceof IndexedArtifactFile) {
+ IndexedArtifactFile f = (IndexedArtifactFile) element;
+ StyledString ss = new StyledString();
+ String name = f.version + " [" + (f.type == null ? "jar" : f.type) + (f.classifier != null ? ", " + f.classifier : "") + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ ss.append(name);
+ if (managedKeys.contains(getKey(f))) {
+ ss.append(Messages.MavenPomSelectionComponent_managed_decoration, StyledString.DECORATIONS_STYLER);
+ }
+ return ss;
+ }
+ return new StyledString();
+ }
+
+ }
+
+ public static class SearchResultContentProvider implements ITreeContentProvider {
+ private static Object[] EMPTY = new Object[0];
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof Map) {
+ return ((Map<?, ?>) inputElement).values().toArray();
+ }
+ return EMPTY;
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if(parentElement instanceof IndexedArtifact) {
+ IndexedArtifact a = (IndexedArtifact) parentElement;
+ return a.getFiles().toArray();
+ }
+ return EMPTY;
+ }
+
+ public boolean hasChildren(Object element) {
+ return element instanceof IndexedArtifact;
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public void dispose() {
+
+ }
+
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenPomWizard.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenPomWizard.java
new file mode 100644
index 00000000..b3c5b2cc
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenPomWizard.java
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWizard;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.MavenModelManager;
+import org.eclipse.m2e.core.internal.Messages;
+
+
+/**
+ * New POM wizard
+ */
+public class MavenPomWizard extends Wizard implements INewWizard {
+ private MavenPomWizardPage artifactPage;
+
+ private MavenDependenciesWizardPage dependenciesPage;
+
+ private ISelection selection;
+
+ /**
+ * Constructor for MavenPomWizard.
+ */
+ public MavenPomWizard() {
+ super();
+ setNeedsProgressMonitor(true);
+ setWindowTitle(Messages.MavenPomWizard_title);
+ }
+
+ /**
+ * Adding the page to the wizard.
+ */
+
+ public void addPages() {
+ artifactPage = new MavenPomWizardPage(selection);
+ dependenciesPage = new MavenDependenciesWizardPage();
+ dependenciesPage.setDependencies(new Dependency[0]);
+
+ addPage(artifactPage);
+ addPage(dependenciesPage);
+ }
+
+ /**
+ * This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using
+ * wizard as execution context.
+ */
+ public boolean performFinish() {
+ final String projectName = artifactPage.getProject();
+ final Model model = artifactPage.getModel();
+ @SuppressWarnings("unchecked")
+ List<Dependency> modelDependencies = model.getDependencies();
+ modelDependencies.addAll(Arrays.asList(dependenciesPage.getDependencies()));
+
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException {
+ monitor.beginTask(Messages.MavenPomWizard_task, 1);
+ try {
+ doFinish(projectName, model, monitor);
+ monitor.worked(1);
+ } catch(CoreException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+
+ try {
+ getContainer().run(true, false, op);
+ } catch(InterruptedException e) {
+ return false;
+ } catch(InvocationTargetException e) {
+ Throwable realException = e.getTargetException();
+ MessageDialog.openError(getShell(), Messages.MavenPomWizard_error_title, realException.getMessage());
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * The worker method. It will find the container, create the file if missing or just replace its contents, and open
+ * the editor on the newly created file.
+ */
+ void doFinish(String projectName, final Model model, IProgressMonitor monitor) throws CoreException {
+ // monitor.beginTask("Creating " + fileName, 2);
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IResource resource = root.findMember(new Path(projectName));
+ if(!resource.exists() || (resource.getType() & IResource.FOLDER | IResource.PROJECT) == 0) {
+ // TODO show warning popup
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1,
+ NLS.bind(Messages.MavenPomWizard_status_not_exists, projectName), null));
+ }
+
+ IContainer container = (IContainer) resource;
+ final IFile file = container.getFile(new Path(IMavenConstants.POM_FILE_NAME));
+ if(file.exists()) {
+ // TODO show warning popup
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenPomWizard_error_exists, null));
+ }
+
+ final File pom = file.getLocation().toFile();
+
+ try {
+ MavenModelManager modelManager = MavenPlugin.getDefault().getMavenModelManager();
+ modelManager.createMavenModel(file, model);
+
+ getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ try {
+ IDE.openEditor(page, file, true);
+ } catch(PartInitException e) {
+ }
+ }
+ });
+
+ } catch(Exception ex) {
+ MavenLogger.log("Unable to create POM " + pom + "; " + ex.getMessage(), ex);
+
+ }
+ }
+
+ /**
+ * We will accept the selection in the workbench to see if we can initialize from it.
+ *
+ * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenPomWizardPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenPomWizardPage.java
new file mode 100644
index 00000000..b2b62645
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenPomWizardPage.java
@@ -0,0 +1,223 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.internal.Messages;
+
+
+/**
+ * Wizard page used to specify basic POM parameters
+ */
+public class MavenPomWizardPage extends AbstractMavenWizardPage {
+ private Text projectText;
+
+ private ISelection selection;
+
+ private MavenArtifactComponent pomComponent;
+
+ public MavenPomWizardPage(ISelection selection) {
+ super("wizardPage"); //$NON-NLS-1$
+ setTitle(Messages.MavenPomWizardPage_title);
+ setDescription(Messages.MavenPomWizardPage_desc);
+ this.selection = selection;
+ }
+
+ public void createControl(Composite parent) {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
+ layout.makeColumnsEqualWidth = false;
+
+ Composite container = new Composite(parent, SWT.NULL);
+ container.setLayout(layout);
+
+ ModifyListener modifyingListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }
+ };
+
+ Label label = new Label(container, SWT.NULL);
+ label.setText(Messages.MavenPomWizardPage_lblProject);
+
+ projectText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ projectText.setEditable(false);
+ projectText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ projectText.addModifyListener(modifyingListener);
+
+ Button button = new Button(container, SWT.PUSH);
+ final GridData gridData_2 = new GridData();
+ button.setLayoutData(gridData_2);
+ button.setText(Messages.MavenPomWizardPage_btnBrowse);
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleBrowse();
+ }
+ });
+
+ pomComponent = new MavenArtifactComponent(container, SWT.NONE);
+ pomComponent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
+ pomComponent.setModifyingListener(modifyingListener);
+ addFieldWithHistory("groupId", pomComponent.getGroupIdCombo()); //$NON-NLS-1$
+ addFieldWithHistory("artifactId", pomComponent.getArtifactIdCombo()); //$NON-NLS-1$
+ addFieldWithHistory("version", pomComponent.getVersionCombo()); //$NON-NLS-1$
+ addFieldWithHistory("name", pomComponent.getNameCombo()); //$NON-NLS-1$
+
+ initialize();
+ dialogChanged();
+ setControl(container);
+ }
+
+ /**
+ * Tests if the current workbench selection is a suitable container to use.
+ */
+ private void initialize() {
+ if(selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ IStructuredSelection ssel = (IStructuredSelection) selection;
+ if(ssel.size() > 1) {
+ return;
+ }
+ Object obj = ssel.getFirstElement();
+ if(obj instanceof IResource) {
+ IContainer container;
+ if(obj instanceof IContainer) {
+ container = (IContainer) obj;
+ } else {
+ container = ((IResource) obj).getParent();
+ }
+ projectText.setText(container.getFullPath().toString());
+ pomComponent.setArtifactId(container.getName());
+ pomComponent.setGroupId(container.getName());
+ }
+ }
+
+ pomComponent.setVersion(MavenArtifactComponent.DEFAULT_VERSION);
+ pomComponent.setPackaging(MavenArtifactComponent.DEFAULT_PACKAGING);
+ }
+
+ /**
+ * Uses the standard container selection dialog to choose the new value for the container field.
+ */
+ void handleBrowse() {
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(),
+ ResourcesPlugin.getWorkspace().getRoot(), false, Messages.MavenPomWizardPage_dialog_title);
+ dialog.showClosedProjects(false);
+ if(dialog.open() == Window.OK) {
+ Object[] result = dialog.getResult();
+ if(result.length == 1) {
+ projectText.setText(((Path) result[0]).toString());
+ }
+ }
+
+// IJavaModel javaModel = JavaCore.create();
+//
+// IJavaProject[] projects;
+// try {
+// projects = javaModel.getJavaProjects();
+// } catch(JavaModelException e) {
+// MavenLogger.log(e);
+// projects = new IJavaProject[0];
+// }
+//
+// ILabelProvider labelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
+// ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
+// dialog.setTitle("Select Project");
+// dialog.setMessage("Choose project where POM will be created");
+// dialog.setElements(projects);
+//
+// String projectName = getProject();
+// if(projectName != null && projectName.length() > 0) {
+// IJavaProject javaProject = javaModel.getJavaProject(projectName);
+// if(javaProject != null) {
+// dialog.setInitialSelections(new Object[] {javaProject});
+// }
+// }
+//
+// if(dialog.open() == Window.OK) {
+// projectText.setText(((IJavaProject) dialog.getFirstResult()).getProject().getFullPath().toString());
+// }
+ }
+
+ /**
+ * Ensures that both text fields are set.
+ */
+ void dialogChanged() {
+ IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getProject()));
+
+ if(getProject().length() == 0) {
+ updateStatus(Messages.MavenPomWizardPage_error_folder);
+ return;
+ }
+ if(container == null || (container.getType() & IResource.FOLDER | IResource.PROJECT) == 0) {
+ updateStatus(Messages.MavenPomWizardPage_error_folder2);
+ return;
+ }
+ if(!container.isAccessible()) {
+ updateStatus(Messages.MavenPomWizardPage_error_folder_write);
+ return;
+ }
+
+ // TODO
+ if(pomComponent.getGroupId().length() == 0) {
+ updateStatus(Messages.MavenPomWizardPage_error_grid);
+ }
+
+ if(pomComponent.getArtifactId().length() == 0) {
+ updateStatus(Messages.MavenPomWizardPage_error_artid);
+ }
+
+ if(pomComponent.getVersion().length() == 0) {
+ updateStatus(Messages.MavenPomWizardPage_error_version);
+ }
+
+ if(pomComponent.getPackaging().length() == 0) {
+ updateStatus(Messages.MavenPomWizardPage_error_pack);
+ }
+
+ updateStatus(null);
+ }
+
+ private void updateStatus(String message) {
+ setErrorMessage(message);
+ setPageComplete(message == null);
+ }
+
+ public String getProject() {
+ return projectText.getText();
+ }
+
+ public Model getModel() {
+ return pomComponent.getModel();
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectCheckoutJob.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectCheckoutJob.java
new file mode 100644
index 00000000..f894e0f6
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectCheckoutJob.java
@@ -0,0 +1,256 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.NewProjectAction;
+import org.eclipse.ui.progress.IProgressConstants;
+
+import org.codehaus.plexus.util.DirectoryScanner;
+import org.codehaus.plexus.util.FileUtils;
+
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.OpenMavenConsoleAction;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.MavenModelManager;
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.LocalProjectScanner;
+import org.eclipse.m2e.core.project.MavenProjectInfo;
+import org.eclipse.m2e.core.project.MavenProjectScmInfo;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.scm.MavenCheckoutOperation;
+
+
+/**
+ * Maven project checkout Job
+ *
+ * @author Eugene Kuleshov
+ */
+public abstract class MavenProjectCheckoutJob extends WorkspaceJob {
+
+ final ProjectImportConfiguration configuration;
+
+ boolean checkoutAllProjects;
+
+ Collection<MavenProjectInfo> projects;
+
+ File location;
+
+ List<String> collectedLocations = new ArrayList<String>();
+
+ public MavenProjectCheckoutJob(ProjectImportConfiguration importConfiguration, boolean checkoutAllProjects) {
+ super(Messages.MavenProjectCheckoutJob_title);
+ this.configuration = importConfiguration;
+ this.checkoutAllProjects = checkoutAllProjects;
+
+ setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
+ addJobChangeListener(new CheckoutJobChangeListener());
+ }
+
+ public void setLocation(File location) {
+ this.location = location;
+ }
+
+ protected abstract Collection<MavenProjectScmInfo> getProjects(IProgressMonitor monitor) throws InterruptedException;
+
+
+ // WorkspaceJob
+
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ try {
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ MavenConsole console = plugin.getConsole();
+
+ MavenCheckoutOperation operation = new MavenCheckoutOperation(location, getProjects(monitor), console);
+ operation.run(monitor);
+ collectedLocations.addAll(operation.getLocations());
+
+ IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
+
+ MavenModelManager modelManager = plugin.getMavenModelManager();
+
+ LocalProjectScanner scanner = new LocalProjectScanner(workspace.getLocation().toFile(), operation.getLocations(),
+ true, modelManager, console);
+ scanner.run(monitor);
+
+ this.projects = plugin.getProjectConfigurationManager().collectProjects(scanner.getProjects());
+
+ if(checkoutAllProjects) {
+ // check if there any project name conflicts
+ for(MavenProjectInfo projectInfo : projects) {
+ Model model = projectInfo.getModel();
+ if(model == null) {
+ model = modelManager.readMavenModel(projectInfo.getPomFile());
+ projectInfo.setModel(model);
+ }
+
+ String projectName = configuration.getProjectName(model);
+ IProject project = workspace.getProject(projectName);
+ if(project.exists()) {
+ checkoutAllProjects = false;
+ break;
+ }
+ }
+ }
+
+ return Status.OK_STATUS;
+
+ } catch(InterruptedException ex) {
+ return Status.CANCEL_STATUS;
+ }
+ }
+
+ /**
+ * Checkout job listener
+ */
+ final class CheckoutJobChangeListener extends JobChangeAdapter {
+
+ public void done(IJobChangeEvent event) {
+ IStatus result = event.getResult();
+ if(result.getSeverity() == IStatus.CANCEL) {
+ return;
+ } else if(!result.isOK()) {
+ // XXX report errors
+ return;
+ }
+
+ if(projects.isEmpty()) {
+ MavenPlugin.getDefault().getConsole().logMessage("No Maven projects to import");
+
+ if(collectedLocations.size()==1) {
+ final String location = collectedLocations.get(0);
+
+ DirectoryScanner projectScanner = new DirectoryScanner();
+ projectScanner.setBasedir(location);
+ projectScanner.setIncludes(new String[] {"**/.project"}); //$NON-NLS-1$
+ projectScanner.scan();
+
+ String[] projectFiles = projectScanner.getIncludedFiles();
+ if(projectFiles!=null && projectFiles.length>0) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ boolean res = MessageDialog.openConfirm(Display.getDefault().getActiveShell(), //
+ Messages.MavenProjectCheckoutJob_confirm_title, //
+ Messages.MavenProjectCheckoutJob_confirm_message);
+ if(res) {
+ IWizard wizard = new ProjectsImportWizard(collectedLocations.get(0));
+ WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
+ dialog.open();
+ } else {
+ cleanup(collectedLocations);
+ }
+ }
+ });
+ return;
+ }
+
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ boolean res = MessageDialog.openConfirm(Display.getDefault().getActiveShell(), //
+ Messages.MavenProjectCheckoutJob_confirm2_title, //
+ Messages.MavenProjectCheckoutJob_confirm2_message);
+ if(res) {
+ Clipboard clipboard = new Clipboard(Display.getDefault());
+ clipboard.setContents(new Object[] { location }, new Transfer[] { TextTransfer.getInstance() });
+
+ NewProjectAction newProjectAction = new NewProjectAction(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ newProjectAction.run();
+ } else {
+ cleanup(collectedLocations);
+ }
+ }
+ });
+ return;
+ }
+
+ cleanup(collectedLocations);
+ }
+
+ if(checkoutAllProjects) {
+ final MavenPlugin plugin = MavenPlugin.getDefault();
+ WorkspaceJob job = new WorkspaceJob(Messages.MavenProjectCheckoutJob_job) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ Set<MavenProjectInfo> projectSet = plugin.getProjectConfigurationManager().collectProjects(projects);
+
+ try {
+ plugin.getProjectConfigurationManager().importProjects(projectSet, configuration, monitor);
+ } catch(CoreException ex) {
+ plugin.getConsole().logError("Projects imported with errors");
+ return ex.getStatus();
+ }
+
+ return Status.OK_STATUS;
+ }
+ };
+ ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(ResourcesPlugin.getWorkspace().getRoot());
+ job.setRule(rule);
+ job.schedule();
+
+ } else {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ MavenImportWizard wizard = new MavenImportWizard(configuration, collectedLocations);
+ WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
+ int res = dialog.open();
+ if(res == Window.CANCEL) {
+ cleanup(collectedLocations);
+ }
+ }
+ });
+ }
+ }
+
+ protected void cleanup(List<String> locations) {
+ MavenConsole console = MavenPlugin.getDefault().getConsole();
+ for(String location : locations) {
+ try {
+ FileUtils.deleteDirectory(location);
+ } catch(IOException ex) {
+ String msg = "Can't delete " + location;
+ console.logError(msg + "; " + (ex.getMessage()==null ? ex.toString() : ex.getMessage())); //$NON-NLS-1$
+ MavenLogger.log(msg, ex);
+ }
+ }
+ }
+
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectSelectionDialog.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectSelectionDialog.java
new file mode 100644
index 00000000..77db0415
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectSelectionDialog.java
@@ -0,0 +1,192 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.dialogs.FilteredTree;
+import org.eclipse.ui.dialogs.PatternFilter;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.ui.dialogs.AbstractMavenDialog;
+
+
+/**
+ * A simple dialog allowing the selection of Maven projects and subfolders containing POMs.
+ */
+public class MavenProjectSelectionDialog extends AbstractMavenDialog {
+
+ protected static final String DIALOG_SETTINGS = MavenProjectSelectionDialog.class.getName();
+
+ protected static final long SEARCH_DELAY = 500L; //in milliseconds
+
+ private FilteredTree filteredTree;
+
+ private boolean useCheckboxTree;
+
+ /** Creates a dialog instance. */
+ public MavenProjectSelectionDialog(Shell parent, boolean useCheckboxTree) {
+ this(parent);
+ this.useCheckboxTree = useCheckboxTree;
+ }
+
+ /** Creates a dialog instance. */
+ public MavenProjectSelectionDialog(Shell parent) {
+ super(parent, DIALOG_SETTINGS);
+
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ setTitle(Messages.getString("projectSelectionDialog.title")); //$NON-NLS-1$
+ }
+
+ /** Produces the result of the selection. */
+ protected void computeResult() {
+ if(useCheckboxTree) {
+ List<Object> result = new ArrayList<Object>();
+ collectCheckedItems(getViewer().getTree().getItems(), result);
+ setResult(result);
+ } else {
+ setResult(((IStructuredSelection) getViewer().getSelection()).toList());
+ }
+ }
+
+ private void collectCheckedItems(TreeItem[] items, List<Object> list) {
+ for(TreeItem item : items) {
+ if(item.getChecked()) {
+ Object data = item.getData();
+ if(data != null) {
+ list.add(data);
+ }
+ }
+ collectCheckedItems(item.getItems(), list);
+ }
+ }
+
+ /** Creates the dialog controls. */
+ protected Control createDialogArea(Composite parent) {
+ readSettings();
+
+ Composite composite = (Composite) super.createDialogArea(parent);
+
+ filteredTree = new FilteredTree(composite, SWT.BORDER | (useCheckboxTree ? SWT.CHECK : 0), new PatternFilter(),
+ true);
+ filteredTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ getViewer().setContentProvider(new MavenContainerContentProvider());
+ getViewer().setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
+ getViewer().setInput(ResourcesPlugin.getWorkspace());
+
+ getViewer().addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ okPressed();
+ }
+ });
+
+ return composite;
+ }
+
+ protected void okPressed() {
+ super.okPressed();
+ }
+
+ protected TreeViewer getViewer() {
+ return filteredTree.getViewer();
+ }
+
+ /** The content provider class. */
+ protected static class MavenContainerContentProvider implements ITreeContentProvider {
+
+ /** Returns the children of the parent node. */
+ public Object[] getChildren(Object parent) {
+ if(parent instanceof IWorkspace) {
+ IProject[] projects = ((IWorkspace) parent).getRoot().getProjects();
+
+ List<IProject> children = new ArrayList<IProject>();
+ for(IProject project : projects) {
+ try {
+ if(project.isOpen() && project.hasNature(IMavenConstants.NATURE_ID)) {
+ children.add(project);
+ }
+ } catch(CoreException e) {
+ MavenLogger.log("Error checking project: " + e.getMessage(), e);
+ }
+ }
+ return children.toArray();
+ } else if(parent instanceof IContainer) {
+ IContainer container = (IContainer) parent;
+ if(container.isAccessible()) {
+ try {
+ List<IResource> children = new ArrayList<IResource>();
+ IResource[] members = container.members();
+ for(int i = 0; i < members.length; i++ ) {
+ if(members[i] instanceof IContainer
+ && ((IContainer) members[i]).exists(new Path(IMavenConstants.POM_FILE_NAME))) {
+ children.add(members[i]);
+ }
+ }
+ return children.toArray();
+ } catch(CoreException e) {
+ MavenLogger.log("Error checking container: " + e.getMessage(), e);
+ }
+ }
+ }
+ return new Object[0];
+ }
+
+ /** Returns the parent of the given element. */
+ public Object getParent(Object element) {
+ if(element instanceof IResource) {
+ return ((IResource) element).getParent();
+ }
+ return null;
+ }
+
+ /** Returns true if the element has any children. */
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0;
+ }
+
+ /** Disposes of any resources used. */
+ public void dispose() {
+ }
+
+ /** Handles the input change. */
+ public void inputChanged(Viewer viewer, Object arg1, Object arg2) {
+ }
+
+ /** Returns the elements of the given root. */
+ public Object[] getElements(Object element) {
+ return getChildren(element);
+ }
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizard.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizard.java
new file mode 100644
index 00000000..48e3630d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizard.java
@@ -0,0 +1,358 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.progress.IProgressConstants;
+
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.OpenMavenConsoleAction;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+
+
+/**
+ * Simple project wizard for creating a new Maven2 project.
+ * <p>
+ * The wizard provides the following functionality to the user:
+ * <ul>
+ * <li>Create the project in the workspace or at some external location.</li>
+ * <li>Provide information about the Maven2 artifact to create.</li>
+ * <li>Choose directories of the default Maven2 directory structure to create.</li>
+ * <li>Choose a set of Maven2 dependencies for the project.</li>
+ * </ul>
+ * </p>
+ * <p>
+ * Once the wizard has finished, the following resources are created and configured:
+ * <ul>
+ * <li>A POM file containing the given artifact information and the chosen dependencies.</li>
+ * <li>The chosen Maven2 directories.</li>
+ * <li>The .classpath file is configured to hold appropriate entries for the Maven2 directories created as well as the
+ * Java and Maven2 classpath containers.</li>
+ * </ul>
+ * </p>
+ */
+public class MavenProjectWizard extends Wizard implements INewWizard {
+
+ /** The wizard page for gathering general project information. */
+ protected MavenProjectWizardLocationPage locationPage;
+
+ /** The archetype selection page. */
+ protected MavenProjectWizardArchetypePage archetypePage;
+
+ /** The wizard page for gathering Maven2 project information. */
+ protected MavenProjectWizardArtifactPage artifactPage;
+
+ /** The wizard page for gathering archetype project information. */
+ protected MavenProjectWizardArchetypeParametersPage parametersPage;
+
+ /** The wizard page for choosing the Maven2 dependencies to use. */
+ protected MavenDependenciesWizardPage dependenciesPage;
+
+ ProjectImportConfiguration configuration;
+
+ protected Button simpleProject;
+
+ private IStructuredSelection selection;
+
+ /**
+ * Default constructor. Sets the title and image of the wizard.
+ */
+ public MavenProjectWizard() {
+ super();
+ setWindowTitle(Messages.getString("wizard.project.title")); //$NON-NLS-1$
+ setDefaultPageImageDescriptor(MavenImages.WIZ_NEW_PROJECT);
+ setNeedsProgressMonitor(true);
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ }
+
+ public void addPages() {
+ configuration = new ProjectImportConfiguration();
+ configuration.setWorkingSet(SelectionUtil.getSelectedWorkingSet(selection));
+
+ locationPage = new MavenProjectWizardLocationPage(configuration, //
+ Messages.getString("wizard.project.page.project.title"), // //$NON-NLS-1$
+ Messages.getString("wizard.project.page.project.description")) { //$NON-NLS-1$
+
+ protected void createAdditionalControls(Composite container) {
+ simpleProject = new Button(container, SWT.CHECK);
+ simpleProject.setText(Messages.getString("wizard.project.page.project.simpleProject")); //$NON-NLS-1$
+ simpleProject.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
+ simpleProject.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ validate();
+ }
+ });
+
+ Label label = new Label(container, SWT.NONE);
+ GridData labelData = new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1);
+ labelData.heightHint = 10;
+ label.setLayoutData(labelData);
+ }
+
+ /** Skips the archetype selection page if the user chooses a simple project. */
+ public IWizardPage getNextPage() {
+ return getPage(simpleProject.getSelection() ? "MavenProjectWizardArtifactPage" : "MavenProjectWizardArchetypePage"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ };
+ locationPage.setLocationPath(SelectionUtil.getSelectedLocation(selection));
+
+ archetypePage = new MavenProjectWizardArchetypePage(configuration);
+ parametersPage = new MavenProjectWizardArchetypeParametersPage(configuration);
+ artifactPage = new MavenProjectWizardArtifactPage(configuration);
+ dependenciesPage = new MavenDependenciesWizardPage(configuration, //
+ Messages.getString("wizard.project.page.dependencies.title"), // //$NON-NLS-1$
+ Messages.getString("wizard.project.page.dependencies.description")); //$NON-NLS-1$
+ dependenciesPage.setDependencies(new Dependency[0]);
+ dependenciesPage.setShowScope(true);
+
+ addPage(locationPage);
+ addPage(archetypePage);
+ addPage(parametersPage);
+ addPage(artifactPage);
+ addPage(dependenciesPage);
+ }
+
+ /** Adds the listeners after the page controls are created. */
+ public void createPageControls(Composite pageContainer) {
+ super.createPageControls(pageContainer);
+
+ simpleProject.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ boolean isSimpleproject = simpleProject.getSelection();
+ archetypePage.setUsed(!isSimpleproject);
+ parametersPage.setUsed(!isSimpleproject);
+ artifactPage.setUsed(isSimpleproject);
+ getContainer().updateButtons();
+ }
+ });
+
+ archetypePage.addArchetypeSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent selectionchangedevent) {
+ parametersPage.setArchetype(archetypePage.getArchetype());
+ getContainer().updateButtons();
+ }
+ });
+
+// locationPage.addProjectNameListener(new ModifyListener() {
+// public void modifyText(ModifyEvent e) {
+// parametersPage.setProjectName(locationPage.getProjectName());
+// artifactPage.setProjectName(locationPage.getProjectName());
+// }
+// });
+ }
+
+ /** Returns the model. */
+ public Model getModel() {
+ if(simpleProject.getSelection()) {
+ return artifactPage.getModel();
+ }
+ return parametersPage.getModel();
+ }
+
+ /**
+ * To perform the actual project creation, an operation is created and run using this wizard as execution context.
+ * That way, messages about the progress of the project creation are displayed inside the wizard.
+ */
+ public boolean performFinish() {
+ // First of all, we extract all the information from the wizard pages.
+ // Note that this should not be done inside the operation we will run
+ // since many of the wizard pages' methods can only be invoked from within
+ // the SWT event dispatcher thread. However, the operation spawns a new
+ // separate thread to perform the actual work, i.e. accessing SWT elements
+ // from within that thread would lead to an exception.
+
+// final IProject project = locationPage.getProjectHandle();
+// final String projectName = locationPage.getProjectName();
+
+ // Get the location where to create the project. For some reason, when using
+ // the default workspace location for a project, we have to pass null
+ // instead of the actual location.
+ final Model model = getModel();
+ final String projectName = configuration.getProjectName(model);
+ IStatus nameStatus = configuration.validateProjectName(model);
+ if(!nameStatus.isOK()) {
+ MessageDialog.openError(getShell(), Messages.getString("wizard.project.job.failed", projectName), nameStatus.getMessage()); //$NON-NLS-1$
+ return false;
+ }
+
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+
+ final IPath location = locationPage.isInWorkspace() ? null : locationPage.getLocationPath();
+ final IWorkspaceRoot root = workspace.getRoot();
+ final IProject project = configuration.getProject(root, model);
+
+ boolean pomExists = ( locationPage.isInWorkspace() ?
+ root.getLocation().append(project.getName()) : location ).append(IMavenConstants.POM_FILE_NAME).toFile().exists();
+ if ( pomExists ) {
+ MessageDialog.openError(getShell(), Messages.getString("wizard.project.job.failed", projectName), Messages.getString("wizard.project.error.pomAlreadyExists")); //$NON-NLS-1$ //$NON-NLS-2$
+ return false;
+ }
+
+ final Job job;
+
+ final MavenPlugin plugin = MavenPlugin.getDefault();
+
+ if(simpleProject.getSelection()) {
+ @SuppressWarnings("unchecked")
+ List<Dependency> modelDependencies = model.getDependencies();
+ modelDependencies.addAll(Arrays.asList(dependenciesPage.getDependencies()));
+
+ final String[] folders = artifactPage.getFolders();
+
+ job = new WorkspaceJob(Messages.getString("wizard.project.job.creatingProject", projectName)) { //$NON-NLS-1$
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
+ try {
+ plugin.getProjectConfigurationManager().createSimpleProject(project, location, model, folders, //
+ configuration, monitor);
+ return Status.OK_STATUS;
+ } catch(CoreException e) {
+ return e.getStatus();
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+
+ } else {
+ final Archetype archetype = archetypePage.getArchetype();
+
+ final String groupId = model.getGroupId();
+ final String artifactId = model.getArtifactId();
+ final String version = model.getVersion();
+ final String javaPackage = parametersPage.getJavaPackage();
+ final Properties properties = parametersPage.getProperties();
+
+ job = new WorkspaceJob(Messages.getString("wizard.project.job.creating", archetype.getArtifactId())) { //$NON-NLS-1$
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ setProperty(IProgressConstants.ACTION_PROPERTY, new OpenMavenConsoleAction());
+ try {
+ plugin.getProjectConfigurationManager().createArchetypeProject(project, location, archetype, //
+ groupId, artifactId, version, javaPackage, properties, configuration, monitor);
+ return Status.OK_STATUS;
+ } catch(CoreException e) {
+ return e.getStatus();
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ }
+
+ job.addJobChangeListener(new JobChangeAdapter() {
+ public void done(IJobChangeEvent event) {
+ final IStatus result = event.getResult();
+ if(!result.isOK()) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openError(getShell(), //
+ Messages.getString("wizard.project.job.failed", projectName), result.getMessage()); //$NON-NLS-1$
+ }
+ });
+ }
+ }
+ });
+
+
+ job.setRule(plugin.getProjectConfigurationManager().getRule());
+ job.schedule();
+
+// ProjectListener listener = new ProjectListener();
+// workspace.addResourceChangeListener(listener, IResourceChangeEvent.POST_CHANGE);
+// try {
+// job.setRule(plugin.getProjectConfigurationManager().getRule());
+// job.schedule();
+//
+// // MNGECLIPSE-766 wait until new project is created
+// while(listener.getNewProject() == null && (job.getState() & (Job.WAITING | Job.RUNNING)) > 0) {
+// try {
+// Thread.sleep(100L);
+// } catch (InterruptedException ex) {
+// // ignore
+// }
+// }
+//
+// } finally {
+// workspace.removeResourceChangeListener(listener);
+// }
+
+ return true;
+ }
+
+
+// static class ProjectListener implements IResourceChangeListener {
+// private IProject newProject = null;
+//
+// public void resourceChanged(IResourceChangeEvent event) {
+// IResourceDelta root = event.getDelta();
+// IResourceDelta[] projectDeltas = root.getAffectedChildren();
+// for (int i = 0; i < projectDeltas.length; i++) {
+// IResourceDelta delta = projectDeltas[i];
+// IResource resource = delta.getResource();
+// if (delta.getKind() == IResourceDelta.ADDED) {
+// newProject = (IProject)resource;
+// }
+// }
+// }
+// /**
+// * Gets the newProject.
+// * @return Returns a IProject
+// */
+// public IProject getNewProject() {
+// return newProject;
+// }
+// }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardArchetypePage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardArchetypePage.java
new file mode 100644
index 00000000..3e8ceb57
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardArchetypePage.java
@@ -0,0 +1,953 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ComboViewer;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.archetype.catalog.ArchetypeCatalog;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.DefaultArtifactRepository;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
+import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory;
+import org.eclipse.m2e.core.archetype.ArchetypeCatalogFactory.NexusIndexerCatalogFactory;
+import org.eclipse.m2e.core.archetype.ArchetypeManager;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.index.IMutableIndex;
+import org.eclipse.m2e.core.index.IndexListener;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.repository.IRepository;
+import org.eclipse.m2e.core.util.M2EUtils;
+
+
+/**
+ * Maven Archetype selection wizard page presents the user with a list of available Maven Archetypes available for
+ * creating new project.
+ */
+public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage implements IndexListener {
+
+ private static final String KEY_CATALOG = "catalog"; //$NON-NLS-1$
+
+ private static final String ALL_CATALOGS = org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_all;
+
+ public static final Comparator<Archetype> ARCHETYPE_COMPARATOR = new Comparator<Archetype>() {
+
+ public int compare(Archetype a1, Archetype a2) {
+ String g1 = a1.getGroupId();
+ String g2 = a2.getGroupId();
+ int res = g1.compareTo(g2);
+ if(res != 0) {
+ return res;
+ }
+
+ String i1 = a1.getArtifactId();
+ String i2 = a2.getArtifactId();
+ res = i1.compareTo(i2);
+ if(res != 0) {
+ return res;
+ }
+
+ String v1 = a1.getVersion();
+ String v2 = a2.getVersion();
+ if(v1 == null) {
+ return v2 == null ? 0 : -1;
+ }
+ return v1.compareTo(v2);
+ }
+
+ };
+
+ ComboViewer catalogsComboViewer;
+
+ Text filterText;
+
+ /** the archetype table viewer */
+ TableViewer viewer;
+
+ /** the description value label */
+ Text descriptionText;
+
+ Button showLastVersionButton;
+
+ Button includeShapshotsButton;
+
+ Button addArchetypeButton;
+
+ /** the list of available archetypes */
+ volatile Collection<Archetype> archetypes;
+
+ Collection<Archetype> lastVersionArchetypes;
+
+ /** a flag indicating if the archetype selection is actually used in the wizard */
+ private boolean isUsed = true;
+
+ ArchetypeCatalogFactory catalogFactory = null;
+
+ /**
+ * Default constructor. Sets the title and description of this wizard page and marks it as not being complete as user
+ * input is required for continuing.
+ */
+ public MavenProjectWizardArchetypePage(ProjectImportConfiguration projectImportConfiguration) {
+ super("MavenProjectWizardArchetypePage", projectImportConfiguration); //$NON-NLS-1$
+ setTitle(Messages.getString("wizard.project.page.archetype.title")); //$NON-NLS-1$
+ setDescription(Messages.getString("wizard.project.page.archetype.description")); //$NON-NLS-1$
+ setPageComplete(false);
+ }
+
+ /** Creates the page controls. */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(3, false));
+
+ createViewer(composite);
+
+ createAdvancedSettings(composite, new GridData(SWT.FILL, SWT.TOP, true, false, 3, 1));
+
+ MavenPlugin.getDefault().getIndexManager().addIndexListener(this);
+ setControl(composite);
+ }
+
+ /** Creates the archetype table viewer. */
+ private void createViewer(Composite parent) {
+ Label catalogsLabel = new Label(parent, SWT.NONE);
+ catalogsLabel.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_lblCatalog);
+
+ Composite catalogsComposite = new Composite(parent, SWT.NONE);
+ GridLayout catalogsCompositeLayout = new GridLayout();
+ catalogsCompositeLayout.marginWidth = 0;
+ catalogsCompositeLayout.marginHeight = 0;
+ catalogsCompositeLayout.numColumns = 2;
+ catalogsComposite.setLayout(catalogsCompositeLayout);
+ catalogsComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 2, 1));
+
+ catalogsComboViewer = new ComboViewer(catalogsComposite);
+ catalogsComboViewer.getControl().setData("name", "catalogsCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+ catalogsComboViewer.getCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ catalogsComboViewer.setContentProvider(new IStructuredContentProvider() {
+ public Object[] getElements(Object input) {
+
+ if(input instanceof Collection) {
+ return ((Collection<?>) input).toArray();
+ }
+ return new Object[0];
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public void dispose() {
+ }
+ });
+
+ catalogsComboViewer.setLabelProvider(new LabelProvider() {
+ public String getText(Object element) {
+ if(element instanceof ArchetypeCatalogFactory) {
+ return ((ArchetypeCatalogFactory) element).getDescription();
+ } else if(element instanceof String) {
+ return element.toString();
+ }
+ return super.getText(element);
+ }
+ });
+
+ catalogsComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+ if(selection instanceof IStructuredSelection) {
+ Object factory = ((IStructuredSelection) selection).getFirstElement();
+ if(factory instanceof ArchetypeCatalogFactory) {
+ catalogFactory = (ArchetypeCatalogFactory) factory;
+ } else if(factory instanceof String) {
+ catalogFactory = null;
+ }
+ reloadViewer();
+ } else {
+ catalogFactory = null;
+ loadArchetypes(null, null, null);
+ }
+ //remember what was switched to here
+ if(dialogSettings != null && catalogFactory != null) {
+ dialogSettings.put(KEY_CATALOG, catalogFactory.getId());
+ }
+ }
+ });
+
+ final ArchetypeManager archetypeManager = MavenPlugin.getDefault().getArchetypeManager();
+ Collection<ArchetypeCatalogFactory> archetypeCatalogs = archetypeManager.getArchetypeCatalogs();
+ ArrayList allCatalogs = new ArrayList(archetypeManager.getArchetypeCatalogs());
+ allCatalogs.add(0, ALL_CATALOGS);
+ catalogsComboViewer.setInput(allCatalogs);
+
+ Button configureButton = new Button(catalogsComposite, SWT.NONE);
+ configureButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ configureButton.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_btnConfigure);
+ configureButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ PreferencesUtil.createPreferenceDialogOn(getShell(),
+ "org.eclipse.m2e.preferences.MavenArchetypesPreferencePage", null, null).open(); //$NON-NLS-1$
+
+ if(catalogFactory == null || archetypeManager.getArchetypeCatalogFactory(catalogFactory.getId()) == null) {
+ catalogFactory = archetypeManager.getArchetypeCatalogFactory(NexusIndexerCatalogFactory.ID);
+ }
+
+ catalogsComboViewer.setInput(archetypeManager.getArchetypeCatalogs());
+ catalogsComboViewer.setSelection(new StructuredSelection(catalogFactory));
+ }
+ });
+
+ Label filterLabel = new Label(parent, SWT.NONE);
+ filterLabel.setLayoutData(new GridData());
+ filterLabel.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_lblFilter);
+
+ QuickViewerFilter quickViewerFilter = new QuickViewerFilter();
+ LastVersionFilter versionFilter = new LastVersionFilter();
+ IncludeSnapshotsFilter snapshotsFilter = new IncludeSnapshotsFilter();
+
+ filterText = new Text(parent, SWT.BORDER);
+ filterText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ filterText.addModifyListener(quickViewerFilter);
+ filterText.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent e) {
+ if(e.keyCode == SWT.ARROW_DOWN) {
+ viewer.getTable().setFocus();
+ viewer.getTable().setSelection(0);
+
+ viewer.setSelection(new StructuredSelection(viewer.getElementAt(0)), true);
+ }
+ }
+ });
+
+ ToolBar toolBar = new ToolBar(parent, SWT.FLAT);
+ toolBar.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+
+ final ToolItem clearToolItem = new ToolItem(toolBar, SWT.PUSH);
+ clearToolItem.setEnabled(false);
+ clearToolItem.setImage(MavenImages.IMG_CLEAR);
+ clearToolItem.setDisabledImage(MavenImages.IMG_CLEAR_DISABLED);
+ clearToolItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ filterText.setText(""); //$NON-NLS-1$
+ }
+ });
+
+ filterText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ clearToolItem.setEnabled(filterText.getText().length() > 0);
+ }
+ });
+
+ SashForm sashForm = new SashForm(parent, SWT.VERTICAL);
+ GridData gd_sashForm = new GridData(SWT.FILL, SWT.FILL, false, true, 3, 1);
+ // gd_sashForm.widthHint = 500;
+ gd_sashForm.heightHint = 200;
+ sashForm.setLayoutData(gd_sashForm);
+ sashForm.setLayout(new GridLayout());
+
+ Composite composite1 = new Composite(sashForm, SWT.NONE);
+ GridLayout gridLayout1 = new GridLayout();
+ gridLayout1.horizontalSpacing = 0;
+ gridLayout1.marginWidth = 0;
+ gridLayout1.marginHeight = 0;
+ composite1.setLayout(gridLayout1);
+
+ viewer = new TableViewer(composite1, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
+ Table table = viewer.getTable();
+ table.setData("name", "archetypesTable"); //$NON-NLS-1$ //$NON-NLS-2$
+ table.setHeaderVisible(true);
+
+ TableColumn column1 = new TableColumn(table, SWT.LEFT);
+ column1.setWidth(150);
+ column1.setText(Messages.getString("wizard.project.page.archetype.column.groupId")); //$NON-NLS-1$
+
+ TableColumn column0 = new TableColumn(table, SWT.LEFT);
+ column0.setWidth(150);
+ column0.setText(Messages.getString("wizard.project.page.archetype.column.artifactId")); //$NON-NLS-1$
+
+ TableColumn column2 = new TableColumn(table, SWT.LEFT);
+ column2.setWidth(100);
+ column2.setText(Messages.getString("wizard.project.page.archetype.column.version")); //$NON-NLS-1$
+
+ GridData tableData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ tableData.widthHint = 400;
+ tableData.heightHint = 200;
+ table.setLayoutData(tableData);
+
+ viewer.setLabelProvider(new ArchetypeLabelProvider());
+
+ viewer.setComparator(new ViewerComparator() {
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ return ARCHETYPE_COMPARATOR.compare((Archetype) e1, (Archetype) e2);
+ }
+ });
+
+ viewer.addFilter(quickViewerFilter);
+ viewer.addFilter(versionFilter);
+ viewer.addFilter(snapshotsFilter);
+
+ viewer.setContentProvider(new IStructuredContentProvider() {
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof Collection) {
+ return ((Collection<?>) inputElement).toArray();
+ }
+ return new Object[0];
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+ });
+
+ viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ Archetype archetype = getArchetype();
+ if(archetype != null) {
+ String repositoryUrl = archetype.getRepository();
+ String description = archetype.getDescription();
+
+ String text = description == null ? "" : description; //$NON-NLS-1$
+ text = text.replaceAll("\n", "").replaceAll("\\s{2,}", " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ if(repositoryUrl != null) {
+ text += text.length() > 0 ? "\n" + repositoryUrl : repositoryUrl; //$NON-NLS-1$
+ }
+
+ descriptionText.setText(text);
+ setPageComplete(true);
+ } else {
+ descriptionText.setText(""); //$NON-NLS-1$
+ setPageComplete(false);
+ }
+ }
+ });
+
+ viewer.addOpenListener(new IOpenListener() {
+ public void open(OpenEvent openevent) {
+ if(canFlipToNextPage()) {
+ getContainer().showPage(getNextPage());
+ }
+ }
+ });
+
+ Composite composite2 = new Composite(sashForm, SWT.NONE);
+ GridLayout gridLayout2 = new GridLayout();
+ gridLayout2.marginHeight = 0;
+ gridLayout2.marginWidth = 0;
+ gridLayout2.horizontalSpacing = 0;
+ composite2.setLayout(gridLayout2);
+
+ descriptionText = new Text(composite2, SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY | SWT.MULTI | SWT.BORDER);
+
+ GridData descriptionTextData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ descriptionTextData.heightHint = 40;
+ descriptionText.setLayoutData(descriptionTextData);
+ //whole dialog resizes badly without the width hint to the desc text
+ descriptionTextData.widthHint = 250;
+ sashForm.setWeights(new int[] {80, 20});
+
+ Composite buttonComposite = new Composite(parent, SWT.NONE);
+ GridData gd_buttonComposite = new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1);
+ buttonComposite.setLayoutData(gd_buttonComposite);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginHeight = 0;
+ gridLayout.marginWidth = 0;
+ gridLayout.numColumns = 3;
+ buttonComposite.setLayout(gridLayout);
+
+ showLastVersionButton = new Button(buttonComposite, SWT.CHECK);
+ showLastVersionButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
+ showLastVersionButton.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_btnLast);
+ showLastVersionButton.setSelection(true);
+ showLastVersionButton.addSelectionListener(versionFilter);
+
+ includeShapshotsButton = new Button(buttonComposite, SWT.CHECK);
+ GridData buttonData = new GridData(SWT.LEFT, SWT.CENTER, true, false);
+ buttonData.horizontalIndent = 25;
+ includeShapshotsButton.setLayoutData(buttonData);
+ includeShapshotsButton.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_btnSnapshots);
+ includeShapshotsButton.setSelection(false);
+ includeShapshotsButton.addSelectionListener(snapshotsFilter);
+
+ addArchetypeButton = new Button(buttonComposite, SWT.NONE);
+ addArchetypeButton.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_btnAdd);
+ addArchetypeButton.setData("name", "addArchetypeButton"); //$NON-NLS-1$ //$NON-NLS-2$
+ buttonData = new GridData(SWT.RIGHT, SWT.CENTER, true, false);
+ buttonData.horizontalIndent = 35;
+ addArchetypeButton.setLayoutData(buttonData);
+
+ addArchetypeButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CustomArchetypeDialog dialog = new CustomArchetypeDialog(getShell(),
+ org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_add_title);
+ if(dialog.open() == Window.OK) {
+ String archetypeGroupId = dialog.getArchetypeGroupId();
+ String archetypeArtifactId = dialog.getArchetypeArtifactId();
+ String archetypeVersion = dialog.getArchetypeVersion();
+ String repositoryUrl = dialog.getRepositoryUrl();
+ downloadArchetype(archetypeGroupId, archetypeArtifactId, archetypeVersion, repositoryUrl);
+ }
+ }
+ });
+ }
+
+ protected IWizardContainer getContainer() {
+ return super.getContainer();
+ }
+
+ public void addArchetypeSelectionListener(ISelectionChangedListener listener) {
+ viewer.addSelectionChangedListener(listener);
+ }
+
+ public void dispose() {
+ MavenPlugin.getDefault().getIndexManager().removeIndexListener(this);
+ super.dispose();
+ }
+
+ public List<Archetype> getArchetypesForCatalog() {
+ if(catalogFactory == null) {
+ return getAllArchetypes();
+ }
+ try {
+ return catalogFactory.getArchetypeCatalog().getArchetypes();
+
+ } catch(CoreException ce) {
+ setErrorMessage(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_error_read);
+ return null;
+ }
+ }
+
+ private List<Archetype> getAllArchetypes() {
+ ArchetypeManager manager = MavenPlugin.getDefault().getArchetypeManager();
+ Collection<ArchetypeCatalogFactory> archetypeCatalogs = manager.getArchetypeCatalogs();
+ ArrayList<Archetype> list = new ArrayList<Archetype>();
+
+ for(ArchetypeCatalogFactory catalog : archetypeCatalogs) {
+ try {
+ //temporary hack to get around 'Test Remote Catalog' blowing up on download
+ //described in https://issues.sonatype.org/browse/MNGECLIPSE-1792
+ if(catalog.getDescription().startsWith("Test")) { //$NON-NLS-1$
+ continue;
+ }
+ @SuppressWarnings("unchecked")
+ List arcs = catalog.getArchetypeCatalog().getArchetypes();
+ if(arcs != null) {
+ list.addAll(arcs);
+ }
+ } catch(Exception ce) {
+ MavenLogger.log("Unable to read archetype catalog: " + catalog.getId(), ce);
+ }
+ }
+ return list;
+ }
+
+ /** Loads the available archetypes. */
+ void loadArchetypes(final String groupId, final String artifactId, final String version) {
+ Job job = new Job(Messages.getString("wizard.project.page.archetype.retrievingArchetypes")) { //$NON-NLS-1$
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ List<Archetype> catalogArchetypes = getArchetypesForCatalog();
+
+ if(catalogArchetypes == null || catalogArchetypes.size() == 0) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ if(catalogFactory != null && "Nexus Indexer".equals(catalogFactory.getDescription())) { //$NON-NLS-1$
+ setErrorMessage(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_error_no);
+ }
+ }
+ });
+ } else {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ setErrorMessage(null);
+ }
+ });
+ }
+ if(catalogArchetypes == null) {
+ return Status.CANCEL_STATUS;
+ }
+ TreeSet<Archetype> archs = new TreeSet<Archetype>(ARCHETYPE_COMPARATOR);
+ archs.addAll(catalogArchetypes);
+ archetypes = archs;
+
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ updateViewer(groupId, artifactId, version);
+ }
+ });
+ } catch(Exception e) {
+ monitor.done();
+ return Status.CANCEL_STATUS;
+ }
+
+ return Status.OK_STATUS;
+ }
+ };
+ job.schedule();
+ }
+
+ public Set<Archetype> filterVersions(Collection<Archetype> archetypes) {
+ HashMap<String, Archetype> filteredArchetypes = new HashMap<String, Archetype>();
+
+ for(Archetype currentArchetype : archetypes) {
+ String key = getArchetypeKey(currentArchetype);
+ Archetype archetype = filteredArchetypes.get(key);
+ if(archetype == null) {
+ filteredArchetypes.put(key, currentArchetype);
+ } else {
+ DefaultArtifactVersion currentVersion = new DefaultArtifactVersion(currentArchetype.getVersion());
+ DefaultArtifactVersion version = new DefaultArtifactVersion(archetype.getVersion());
+ if(currentVersion.compareTo(version) > 0) {
+ filteredArchetypes.put(key, currentArchetype);
+ }
+ }
+ }
+
+ TreeSet<Archetype> result = new TreeSet<Archetype>(new Comparator<Archetype>() {
+ public int compare(Archetype a1, Archetype a2) {
+ String k1 = a1.getGroupId() + ":" + a1.getArtifactId() + ":" + a1.getVersion(); //$NON-NLS-1$ //$NON-NLS-2$
+ String k2 = a2.getGroupId() + ":" + a2.getArtifactId() + ":" + a2.getVersion(); //$NON-NLS-1$ //$NON-NLS-2$
+ return k1.compareTo(k2);
+ }
+ });
+ result.addAll(filteredArchetypes.values());
+ return result;
+ }
+
+ private String getArchetypeKey(Archetype archetype) {
+ return archetype.getGroupId() + ":" + archetype.getArtifactId(); //$NON-NLS-1$
+ }
+
+ ArchetypeCatalog getArchetypeCatalog() throws CoreException {
+ return catalogFactory == null ? null : catalogFactory.getArchetypeCatalog();
+ }
+
+ /** Sets the flag that the archetype selection is used in the wizard. */
+ public void setUsed(boolean isUsed) {
+ this.isUsed = isUsed;
+ }
+
+ /** Overrides the default to return "true" if the page is not used. */
+ public boolean isPageComplete() {
+ return !isUsed || super.isPageComplete();
+ }
+
+ /** Sets the focus to the table component. */
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+
+ if(visible) {
+ ArchetypeManager archetypeManager = MavenPlugin.getDefault().getArchetypeManager();
+ String catalogId = dialogSettings.get(KEY_CATALOG);
+ catalogFactory = null;
+ if(catalogId != null) {
+ catalogFactory = archetypeManager.getArchetypeCatalogFactory(catalogId);
+ }
+ catalogsComboViewer.setSelection(new StructuredSelection(catalogFactory == null ? ALL_CATALOGS : catalogFactory));
+
+ viewer.getTable().setFocus();
+ Archetype selected = getArchetype();
+ if(selected != null) {
+ viewer.reveal(selected);
+ }
+ }
+ }
+
+ /** Returns the selected archetype. */
+ public Archetype getArchetype() {
+ return (Archetype) ((IStructuredSelection) viewer.getSelection()).getFirstElement();
+ }
+
+ void updateViewer(String groupId, String artifactId, String version) {
+ lastVersionArchetypes = filterVersions(archetypes);
+
+ viewer.setInput(archetypes);
+
+ selectArchetype(groupId, artifactId, version);
+
+ Table table = viewer.getTable();
+ int columnCount = table.getColumnCount();
+ int width = 0;
+ for(int i = 0; i < columnCount; i++ ) {
+ TableColumn column = table.getColumn(i);
+ column.pack();
+ width += column.getWidth();
+ }
+ GridData tableData = (GridData) table.getLayoutData();
+ int oldHint = tableData.widthHint;
+ if(width > oldHint) {
+ tableData.widthHint = width;
+ }
+ getShell().pack(true);
+ tableData.widthHint = oldHint;
+ }
+
+ protected void selectArchetype(String groupId, String artifactId, String version) {
+ Archetype archetype = findArchetype(groupId, artifactId, version);
+
+ Table table = viewer.getTable();
+ if(archetype != null) {
+ viewer.setSelection(new StructuredSelection(archetype), true);
+
+ int n = table.getSelectionIndex();
+ table.setSelection(n);
+ }
+ }
+
+ /** Locates an archetype with given ids. */
+ protected Archetype findArchetype(String groupId, String artifactId, String version) {
+ for(Archetype archetype : archetypes) {
+ if(archetype.getGroupId().equals(groupId) && archetype.getArtifactId().equals(artifactId)) {
+ if(version == null || version.equals(archetype.getVersion())) {
+ return archetype;
+ }
+ }
+ }
+
+ return version == null ? null : findArchetype(groupId, artifactId, null);
+ }
+
+ protected void downloadArchetype(final String archetypeGroupId, final String archetypeArtifactId,
+ final String archetypeVersion, final String repositoryUrl) {
+ final String archetypeName = archetypeGroupId + ":" + archetypeArtifactId + ":" + archetypeVersion; //$NON-NLS-1$ //$NON-NLS-2$
+
+ try {
+ getContainer().run(true, true, new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InterruptedException {
+ monitor.beginTask(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_task_downloading
+ + archetypeName, IProgressMonitor.UNKNOWN);
+
+ try {
+ final IMaven maven = MavenPlugin.getDefault().getMaven();
+
+ final MavenPlugin plugin = MavenPlugin.getDefault();
+
+ final List<ArtifactRepository> remoteRepositories;
+ if(repositoryUrl.length() == 0) {
+ remoteRepositories = maven.getArtifactRepositories(); // XXX should use ArchetypeManager.getArhetypeRepositories()
+ } else {
+ ArtifactRepository repository = new DefaultArtifactRepository( //
+ "archetype", repositoryUrl, new DefaultRepositoryLayout(), null, null); //$NON-NLS-1$
+ remoteRepositories = Collections.singletonList(repository);
+ }
+
+ monitor.subTask(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_task_resolving);
+ Artifact pomArtifact = maven.resolve(archetypeGroupId, archetypeArtifactId, archetypeVersion,
+ "pom", null, remoteRepositories, monitor); //$NON-NLS-1$
+ monitor.worked(1);
+ if(monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+
+ File pomFile = pomArtifact.getFile();
+ if(pomFile.exists()) {
+ monitor.subTask(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_task_resolving2);
+ Artifact jarArtifact = maven.resolve(archetypeGroupId, archetypeArtifactId, archetypeVersion,
+ "jar", null, remoteRepositories, monitor); //$NON-NLS-1$
+ monitor.worked(1);
+ if(monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+
+ File jarFile = jarArtifact.getFile();
+
+ monitor.subTask(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_task_reading);
+ monitor.worked(1);
+ if(monitor.isCanceled()) {
+ throw new InterruptedException();
+ }
+
+ monitor.subTask(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_task_indexing);
+ IndexManager indexManager = plugin.getIndexManager();
+ IMutableIndex localIndex = indexManager.getLocalIndex();
+ localIndex.addArtifact(jarFile, new ArtifactKey(pomArtifact));
+
+ //save out the archetype
+ //TODO move this logig out of UI code!
+ Archetype archetype = new Archetype();
+ archetype.setGroupId(archetypeGroupId);
+ archetype.setArtifactId(archetypeArtifactId);
+ archetype.setVersion(archetypeVersion);
+ archetype.setRepository(repositoryUrl);
+ org.apache.maven.archetype.Archetype archetyper = MavenPlugin.getDefault().getArchetype();
+ archetyper.updateLocalCatalog(archetype);
+
+ loadArchetypes(archetypeGroupId, archetypeArtifactId, archetypeVersion);
+ } else {
+ final Artifact pom = pomArtifact;
+ //the user tried to add an archetype that couldn't be resolved on the server
+ getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ setErrorMessage(NLS.bind(
+ org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_error_resolve,
+ pom.toString()));
+ }
+ });
+ }
+
+ } catch(InterruptedException ex) {
+ throw ex;
+
+ } catch(final Exception ex) {
+ final String msg = NLS.bind(
+ org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_error_resolve2, archetypeName);
+ MavenLogger.log(msg, ex);
+ getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ setErrorMessage(msg + "\n" + ex.toString()); //$NON-NLS-1$
+ }
+ });
+
+ } finally {
+ monitor.done();
+
+ }
+ }
+ });
+
+ } catch(InterruptedException ex) {
+ // ignore
+
+ } catch(InvocationTargetException ex) {
+ String msg = NLS.bind(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypePage_error_resolve2,
+ archetypeName);
+ MavenLogger.log(msg, ex);
+ setErrorMessage(msg + "\n" + ex.toString()); //$NON-NLS-1$
+
+ }
+ }
+
+ /**
+ * ArchetypeLabelProvider
+ */
+ protected static class ArchetypeLabelProvider extends LabelProvider implements ITableLabelProvider {
+ /** Returns the element text */
+ public String getColumnText(Object element, int columnIndex) {
+ if(element instanceof Archetype) {
+ Archetype archetype = (Archetype) element;
+ switch(columnIndex) {
+ case 0:
+ return archetype.getGroupId();
+ case 1:
+ return archetype.getArtifactId();
+ case 2:
+ return archetype.getVersion();
+ }
+ }
+ return super.getText(element);
+ }
+
+ /** Returns the element text */
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+ }
+
+ /**
+ * QuickViewerFilter
+ */
+ protected class QuickViewerFilter extends ViewerFilter implements ModifyListener {
+
+ private String currentFilter;
+
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if(currentFilter == null || currentFilter.length() == 0) {
+ return true;
+ }
+ Archetype archetype = (Archetype) element;
+ return archetype.getGroupId().indexOf(currentFilter) > -1
+ || archetype.getArtifactId().indexOf(currentFilter) > -1;
+ }
+
+ public void modifyText(ModifyEvent e) {
+ this.currentFilter = filterText.getText().trim();
+ viewer.refresh();
+ }
+ }
+
+ protected class IncludeSnapshotsFilter extends ViewerFilter implements SelectionListener {
+
+ /**
+ *
+ */
+ private static final String SNAPSHOT = "SNAPSHOT"; //$NON-NLS-1$
+
+ private boolean includeSnapshots = false;
+
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if(element instanceof Archetype) {
+ String version = ((Archetype) element).getVersion();
+ boolean isSnap = false;
+ if(M2EUtils.nullOrEmpty(version)) {
+ isSnap = false;
+ } else if(version.lastIndexOf(SNAPSHOT) >= 0) {
+ isSnap = true;
+ }
+ return includeSnapshots ? true : !isSnap;
+ }
+ return false;
+
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ this.includeSnapshots = includeShapshotsButton.getSelection();
+ viewer.refresh();
+ Archetype archetype = getArchetype();
+ //can be null in some cases, don't try to reveal
+ if(archetype != null) {
+ viewer.reveal(archetype);
+ }
+ viewer.getTable().setSelection(viewer.getTable().getSelectionIndex());
+ viewer.getTable().setFocus();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ }
+
+ protected class LastVersionFilter extends ViewerFilter implements SelectionListener {
+
+ private boolean showLastVersion = true;
+
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ return showLastVersion ? lastVersionArchetypes.contains(element) : true;
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ this.showLastVersion = showLastVersionButton.getSelection();
+ viewer.refresh();
+ Archetype archetype = getArchetype();
+ //can be null in some cases, don't try to reveal
+ if(archetype != null) {
+ viewer.reveal(archetype);
+ }
+ viewer.getTable().setSelection(viewer.getTable().getSelectionIndex());
+ viewer.getTable().setFocus();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.index.IndexListener#indexAdded(org.eclipse.m2e.repository.IRepository)
+ */
+ public void indexAdded(IRepository repository) {
+
+ }
+
+ //reload the table when index updating finishes
+ //try to preserve selection in case this is a rebuild
+ protected void reloadViewer() {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ if(isCurrentPage()) {
+ StructuredSelection sel = (StructuredSelection) viewer.getSelection();
+ Archetype selArchetype = null;
+ if(sel != null && sel.getFirstElement() != null) {
+ selArchetype = (Archetype) sel.getFirstElement();
+ }
+ if(selArchetype != null) {
+ loadArchetypes(selArchetype.getGroupId(), selArchetype.getArtifactId(), selArchetype.getVersion());
+ } else {
+ loadArchetypes("org.apache.maven.archetypes", "maven-archetype-quickstart", "1.0"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ }
+ }
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.index.IndexListener#indexChanged(org.eclipse.m2e.repository.IRepository)
+ */
+ public void indexChanged(IRepository repository) {
+ reloadViewer();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.index.IndexListener#indexRemoved(org.eclipse.m2e.repository.IRepository)
+ */
+ public void indexRemoved(IRepository repository) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.index.IndexListener#indexUpdating(org.eclipse.m2e.repository.IRepository)
+ */
+ public void indexUpdating(IRepository repository) {
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardArchetypeParametersPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardArchetypeParametersPage.java
new file mode 100644
index 00000000..c566b6d4
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardArchetypeParametersPage.java
@@ -0,0 +1,617 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+import com.ibm.icu.lang.UCharacter;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+
+import org.apache.maven.archetype.catalog.Archetype;
+import org.apache.maven.archetype.common.ArchetypeArtifactManager;
+import org.apache.maven.archetype.exception.UnknownArchetype;
+import org.apache.maven.archetype.metadata.ArchetypeDescriptor;
+import org.apache.maven.archetype.metadata.RequiredProperty;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.ui.internal.components.TextComboBoxCellEditor;
+
+
+/**
+ * Wizard page responsible for gathering information about the Maven2 artifact when an archetype is being used to create
+ * a project (thus the class name pun).
+ */
+public class MavenProjectWizardArchetypeParametersPage extends AbstractMavenWizardPage {
+
+ public static final String DEFAULT_VERSION = "0.0.1-SNAPSHOT"; //$NON-NLS-1$
+
+ public static final String DEFAULT_PACKAGE = "foo"; //$NON-NLS-1$
+
+ Table propertiesTable;
+
+ TableViewer propertiesViewer;
+
+ final public static String KEY_PROPERTY = "key"; //$NON-NLS-1$
+
+ final public static int KEY_INDEX = 0;
+
+ final public static String VALUE_PROPERTY = "value"; //$NON-NLS-1$
+
+ final public static int VALUE_INDEX = 1;
+
+ /** group id text field */
+ protected Combo groupIdCombo;
+
+ /** artifact id text field */
+ protected Combo artifactIdCombo;
+
+ /** version text field */
+ protected Combo versionCombo;
+
+ /** package text field */
+ protected Combo packageCombo;
+
+ protected Button removeButton;
+
+ private boolean isUsed = true;
+
+ protected Set<String> requiredProperties;
+
+ protected Set<String> optionalProperties;
+
+ protected Archetype archetype;
+
+ protected boolean archetypeChanged = false;
+
+ /** shows if the package has been customized by the user */
+ protected boolean packageCustomized = false;
+
+ /** Creates a new page. */
+ public MavenProjectWizardArchetypeParametersPage(ProjectImportConfiguration projectImportConfiguration) {
+ super("Maven2ProjectWizardArchifactPage", projectImportConfiguration); //$NON-NLS-1$
+
+ setTitle(Messages.getString("wizard.project.page.maven2.title")); //$NON-NLS-1$
+ setDescription(Messages.getString("wizard.project.page.maven2.archetype.parameters.description")); //$NON-NLS-1$
+ setPageComplete(false);
+
+ requiredProperties = new HashSet<String>();
+ optionalProperties = new HashSet<String>();
+ }
+
+ /** Creates page controls. */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite.setLayout(new GridLayout(3, false));
+
+ createArtifactGroup(composite);
+ createPropertiesGroup(composite);
+
+ validate();
+
+ createAdvancedSettings(composite, new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
+ resolverConfigurationComponent.setModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ });
+
+ setControl(composite);
+
+ }
+
+ private void createArtifactGroup(Composite parent) {
+// Composite artifactGroup = new Composite(parent, SWT.NONE);
+// GridData gd_artifactGroup = new GridData( SWT.FILL, SWT.FILL, true, false );
+// artifactGroup.setLayoutData(gd_artifactGroup);
+// artifactGroup.setLayout(new GridLayout(2, false));
+
+ Label groupIdlabel = new Label(parent, SWT.NONE);
+ groupIdlabel.setText(Messages.getString("artifactComponent.groupId")); //$NON-NLS-1$
+
+ groupIdCombo = new Combo(parent, SWT.BORDER);
+ groupIdCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ addFieldWithHistory("groupId", groupIdCombo); //$NON-NLS-1$
+ groupIdCombo.setData("name", "groupId"); //$NON-NLS-1$ //$NON-NLS-2$
+ groupIdCombo.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ updateJavaPackage();
+ validate();
+ }
+ });
+
+ Label artifactIdLabel = new Label(parent, SWT.NONE);
+ artifactIdLabel.setText(Messages.getString("artifactComponent.artifactId")); //$NON-NLS-1$
+
+ artifactIdCombo = new Combo(parent, SWT.BORDER);
+ artifactIdCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ addFieldWithHistory("artifactId", artifactIdCombo); //$NON-NLS-1$
+ artifactIdCombo.setData("name", "artifactId"); //$NON-NLS-1$ //$NON-NLS-2$
+ artifactIdCombo.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ updateJavaPackage();
+ validate();
+ }
+ });
+
+ Label versionLabel = new Label(parent, SWT.NONE);
+ versionLabel.setText(Messages.getString("artifactComponent.version")); //$NON-NLS-1$
+
+ versionCombo = new Combo(parent, SWT.BORDER);
+ GridData gd_versionCombo = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
+ gd_versionCombo.widthHint = 150;
+ versionCombo.setLayoutData(gd_versionCombo);
+ versionCombo.setText(DEFAULT_VERSION);
+ addFieldWithHistory("version", versionCombo); //$NON-NLS-1$
+ versionCombo.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ });
+
+ Label packageLabel = new Label(parent, SWT.NONE);
+ packageLabel.setText(Messages.getString("artifactComponent.package")); //$NON-NLS-1$
+
+ packageCombo = new Combo(parent, SWT.BORDER);
+ packageCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ packageCombo.setData("name", "package"); //$NON-NLS-1$ //$NON-NLS-2$
+ addFieldWithHistory("package", packageCombo); //$NON-NLS-1$
+ packageCombo.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ if(!packageCustomized && !packageCombo.getText().equals(getDefaultJavaPackage())) {
+ packageCustomized = true;
+ }
+ validate();
+ }
+ });
+ }
+
+ private void createPropertiesGroup(Composite composite) {
+ Label propertiesLabel = new Label(composite, SWT.NONE);
+ propertiesLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
+ propertiesLabel.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypeParametersPage_lblProps);
+
+ propertiesViewer = new TableViewer(composite, SWT.BORDER | SWT.FULL_SELECTION);
+ propertiesTable = propertiesViewer.getTable();
+ propertiesTable.setLinesVisible(true);
+ propertiesTable.setHeaderVisible(true);
+ propertiesTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 2));
+
+ TableColumn propertiesTableNameColumn = new TableColumn(propertiesTable, SWT.NONE);
+ propertiesTableNameColumn.setWidth(130);
+ propertiesTableNameColumn.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypeParametersPage_columnName);
+
+ TableColumn propertiesTableValueColumn = new TableColumn(propertiesTable, SWT.NONE);
+ propertiesTableValueColumn.setWidth(230);
+ propertiesTableValueColumn.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypeParametersPage_columnValue);
+
+ propertiesViewer.setColumnProperties(new String[] {KEY_PROPERTY, VALUE_PROPERTY});
+
+ propertiesViewer.setCellEditors(new CellEditor[] {new TextCellEditor(propertiesTable, SWT.NONE),
+ new TextCellEditor(propertiesTable, SWT.NONE)});
+ propertiesViewer.setCellModifier(new ICellModifier() {
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+
+ public void modify(Object element, String property, Object value) {
+ if(element instanceof TableItem) {
+ ((TableItem) element).setText(getTextIndex(property), String.valueOf(value));
+ validate();
+ }
+ }
+
+ public Object getValue(Object element, String property) {
+ if(element instanceof TableItem) {
+ return ((TableItem) element).getText(getTextIndex(property));
+ }
+ return null;
+ }
+ });
+
+ Button addButton = new Button(composite, SWT.NONE);
+ addButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ addButton.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypeParametersPage_btnAdd);
+ addButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ propertiesViewer.editElement(addTableItem("?", "?"), KEY_INDEX); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ });
+
+ removeButton = new Button(composite, SWT.NONE);
+ removeButton.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
+ removeButton.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypeParametersPage_btnRemove);
+ removeButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if(propertiesTable.getSelectionCount() > 0) {
+ propertiesTable.remove(propertiesTable.getSelectionIndices());
+ removeButton.setEnabled(propertiesTable.getItemCount() > 0);
+ validate();
+ }
+ }
+ });
+ }
+
+ /**
+ * Validates the contents of this wizard page.
+ * <p>
+ * Feedback about the validation is given to the user by displaying error messages or informative messages on the
+ * wizard page. Depending on the provided user input, the wizard page is marked as being complete or not.
+ * <p>
+ * If some error or missing input is detected in the user input, an error message or informative message,
+ * respectively, is displayed to the user. If the user input is complete and correct, the wizard page is marked as
+ * begin complete to allow the wizard to proceed. To that end, the following conditions must be met:
+ * <ul>
+ * <li>The user must have provided a valid group ID.</li>
+ * <li>The user must have provided a valid artifact ID.</li>
+ * <li>The user must have provided a version for the artifact.</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#setMessage(java.lang.String)
+ * @see org.eclipse.jface.wizard.WizardPage#setErrorMessage(java.lang.String)
+ * @see org.eclipse.jface.wizard.WizardPage#setPageComplete(boolean)
+ */
+ void validate() {
+ String error = validateInput();
+ setErrorMessage(error);
+ setPageComplete(error == null);
+ }
+
+ private String validateInput() {
+ String error = validateIdInput(groupIdCombo.getText().trim(), "group"); //$NON-NLS-1$
+ if(error != null) {
+ return error;
+ }
+
+ error = validateIdInput(artifactIdCombo.getText().trim(), "artifact"); //$NON-NLS-1$
+ if(error != null) {
+ return error;
+ }
+
+ String versionValue = versionCombo.getText().trim();
+ if(versionValue.length() == 0) {
+ return Messages.getString("wizard.project.page.maven2.validator.version"); //$NON-NLS-1$
+ }
+ //TODO: check validity of version?
+
+ String packageName = packageCombo.getText();
+ if(packageName.trim().length() != 0) {
+ if(!Pattern.matches("[A-Za-z_$][A-Za-z_$\\d]*(?:\\.[A-Za-z_$][A-Za-z_$\\d]*)*", packageName)) { //$NON-NLS-1$
+ return org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypeParametersPage_error_package;
+ }
+ }
+
+ // validate project name
+ IStatus nameStatus = getImportConfiguration().validateProjectName(getModel());
+ if(!nameStatus.isOK()) {
+ return Messages.getString("wizard.project.page.maven2.validator.projectNameInvalid", nameStatus.getMessage()); //$NON-NLS-1$
+ }
+
+ if(requiredProperties.size() > 0) {
+ Properties properties = getProperties();
+ for(String key : requiredProperties) {
+ String value = properties.getProperty(key);
+ if(value == null || value.length() == 0) {
+ return Messages.getString("wizard.project.page.maven2.validator.requiredProperty", key); //$NON-NLS-1$
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /** Ends the wizard flow chain. */
+ public IWizardPage getNextPage() {
+ return null;
+ }
+
+ public void setArchetype(Archetype archetype) {
+ if(archetype == null) {
+ propertiesTable.removeAll();
+ archetypeChanged = false;
+ } else if(!archetype.equals(this.archetype)) {
+ this.archetype = archetype;
+ propertiesTable.removeAll();
+ requiredProperties.clear();
+ optionalProperties.clear();
+ archetypeChanged = true;
+
+ Properties properties = archetype.getProperties();
+ if(properties != null) {
+ for(Iterator<Map.Entry<Object, Object>> it = properties.entrySet().iterator(); it.hasNext();) {
+ Map.Entry<?, ?> e = it.next();
+ String key = (String) e.getKey();
+ addTableItem(key, (String) e.getValue());
+ optionalProperties.add(key);
+ }
+ }
+ }
+ }
+
+ void loadArchetypeDescriptor() {
+ final String groupId = archetype.getGroupId();
+ final String artifactId = archetype.getArtifactId();
+ final String version = archetype.getVersion();
+ final String archetypeName = groupId + ":" + artifactId + ":" + version; //$NON-NLS-1$ //$NON-NLS-2$
+
+ try {
+ getContainer().run(false, true, new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) {
+ monitor.beginTask(NLS.bind(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypeParametersPage_task, archetypeName), IProgressMonitor.UNKNOWN);
+ try {
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+
+ ArtifactRepository localRepository = maven.getLocalRepository();
+
+ List<ArtifactRepository> repositories = maven.getArtifactRepositories();
+
+ ArchetypeArtifactManager aaMgr = MavenPlugin.getDefault().getArchetypeArtifactManager();
+ if(aaMgr.isFileSetArchetype(groupId, artifactId, version, null, localRepository, repositories)) {
+ ArchetypeDescriptor descriptor = aaMgr.getFileSetArchetypeDescriptor(groupId, artifactId, version, null,
+ localRepository, repositories);
+ List<?> properties = descriptor.getRequiredProperties();
+ if(properties != null) {
+ for(Object o : properties) {
+ if(o instanceof RequiredProperty) {
+ RequiredProperty rp = (RequiredProperty) o;
+ requiredProperties.add(rp.getKey());
+ addTableItem(rp.getKey(), rp.getDefaultValue());
+ }
+ }
+ }
+ }
+ } catch(UnknownArchetype e) {
+ MavenLogger.log(NLS.bind("Error downloading archetype {0}",archetypeName), e);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ } finally {
+ monitor.done();
+ }
+ }
+ });
+ } catch(InterruptedException ex) {
+ // ignore
+ } catch(InvocationTargetException ex) {
+ String msg = NLS.bind(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArchetypeParametersPage_error_download, archetypeName);
+ MavenLogger.log(msg, ex);
+ setErrorMessage(msg + "\n" + ex.toString()); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @param key
+ * @param value
+ */
+ TableItem addTableItem(String key, String value) {
+ TableItem item = new TableItem(propertiesTable, SWT.NONE);
+ item.setData(item);
+ item.setText(KEY_INDEX, key);
+ item.setText(VALUE_INDEX, value == null ? "" : value); //$NON-NLS-1$
+ return item;
+ }
+
+ /**
+ * Updates the properties when a project name is set on the first page of the wizard.
+ */
+ public void setProjectName(String projectName) {
+ if(artifactIdCombo.getText().equals(groupIdCombo.getText())) {
+ groupIdCombo.setText(projectName);
+ }
+ artifactIdCombo.setText(projectName);
+ packageCombo.setText("org." + projectName.replace('-', '.')); //$NON-NLS-1$
+ validate();
+ }
+
+ /**
+ * Updates the properties when a project name is set on the first page of the wizard.
+ */
+ public void setParentProject(String groupId, String artifactId, String version) {
+ groupIdCombo.setText(groupId);
+ versionCombo.setText(version);
+ validate();
+ }
+
+ /** Enables or disables the artifact id text field. */
+ public void setArtifactIdEnabled(boolean b) {
+ artifactIdCombo.setEnabled(b);
+ }
+
+ /** Returns the package name. */
+ public String getJavaPackage() {
+ if(packageCombo.getText().length() > 0) {
+ return packageCombo.getText();
+ }
+ return getDefaultJavaPackage();
+ }
+
+ /** Updates the package name if the related fields changed. */
+ protected void updateJavaPackage() {
+ if(packageCustomized) {
+ return;
+ }
+
+ String defaultPackageName = getDefaultJavaPackage();
+ packageCombo.setText(defaultPackageName);
+ }
+
+ /** Returns the default package name. */
+ protected String getDefaultJavaPackage() {
+ return MavenProjectWizardArchetypeParametersPage.getDefaultJavaPackage(groupIdCombo.getText().trim(),
+ artifactIdCombo.getText().trim());
+ }
+
+ /** Creates the Model object. */
+ public Model getModel() {
+ Model model = new Model();
+
+ model.setModelVersion("4.0.0"); //$NON-NLS-1$
+ model.setGroupId(groupIdCombo.getText());
+ model.setArtifactId(artifactIdCombo.getText());
+ model.setVersion(versionCombo.getText());
+
+ return model;
+ }
+
+ public void setUsed(boolean isUsed) {
+ this.isUsed = isUsed;
+ }
+
+ public boolean isPageComplete() {
+ return !isUsed || super.isPageComplete();
+ }
+
+ /** Loads the group value when the page is displayed. */
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+
+ if(visible) {
+ if(groupIdCombo.getText().length() == 0 && groupIdCombo.getItemCount() > 0) {
+ groupIdCombo.setText(groupIdCombo.getItem(0));
+ packageCombo.setText(getDefaultJavaPackage());
+ packageCustomized = false;
+ }
+
+ if(archetypeChanged && archetype != null) {
+ archetypeChanged = false;
+ loadArchetypeDescriptor();
+ validate();
+ }
+
+ updatePropertyEditors();
+ }
+ }
+
+ public Properties getProperties() {
+ if(propertiesViewer.isCellEditorActive()) {
+ propertiesTable.setFocus();
+ }
+ Properties properties = new Properties();
+ for(int i = 0; i < propertiesTable.getItemCount(); i++ ) {
+ TableItem item = propertiesTable.getItem(i);
+ properties.put(item.getText(KEY_INDEX), item.getText(VALUE_INDEX));
+ }
+ return properties;
+ }
+
+ public int getTextIndex(String property) {
+ return KEY_PROPERTY.equals(property) ? KEY_INDEX : VALUE_INDEX;
+ }
+
+ public void updatePropertyEditors() {
+ CellEditor[] ce = propertiesViewer.getCellEditors();
+
+ int n = requiredProperties.size() + optionalProperties.size();
+ if(n == 0) {
+ if(ce[KEY_INDEX] instanceof TextComboBoxCellEditor) {
+ // if there was a combo editor previously defined, and the current
+ // archetype has no properties, replace it with a plain text editor
+ ce[KEY_INDEX].dispose();
+ ce[KEY_INDEX] = new TextCellEditor(propertiesTable, SWT.FLAT);
+ }
+ } else {
+ TextComboBoxCellEditor comboEditor = null;
+ // if there was a plain text editor previously defined, and the current
+ // archetype has properties, replace it with a combo editor
+ if(ce[KEY_INDEX] instanceof TextComboBoxCellEditor) {
+ comboEditor = (TextComboBoxCellEditor) ce[KEY_INDEX];
+ } else {
+ ce[KEY_INDEX].dispose();
+ comboEditor = new TextComboBoxCellEditor(propertiesTable, SWT.FLAT);
+ ce[KEY_INDEX] = comboEditor;
+ }
+
+ // populate the property name selection
+ List<String> propertyKeys = new ArrayList<String>(n);
+ propertyKeys.addAll(requiredProperties);
+ propertyKeys.addAll(optionalProperties);
+ comboEditor.setItems(propertyKeys.toArray(new String[n]));
+ }
+ }
+
+ public static String getDefaultJavaPackage(String groupId, String artifactId) {
+ StringBuffer sb = new StringBuffer(groupId);
+
+ if(sb.length() > 0 && artifactId.length() > 0) {
+ sb.append('.');
+ }
+
+ sb.append(artifactId);
+
+ if(sb.length() == 0) {
+ sb.append(DEFAULT_PACKAGE);
+ }
+
+ boolean isFirst = true;
+ StringBuffer pkg = new StringBuffer();
+ for(int i = 0; i < sb.length(); i++ ) {
+ char c = sb.charAt(i);
+ if(c == '-') {
+ pkg.append('_');
+ isFirst = false;
+ } else {
+ if(isFirst) {
+ if(UCharacter.isJavaIdentifierStart(c)) {
+ pkg.append(c);
+ isFirst = false;
+ }
+ } else {
+ if(c == '.') {
+ pkg.append('.');
+ isFirst = true;
+ } else if(UCharacter.isJavaIdentifierPart(c)) {
+ pkg.append(c);
+ }
+ }
+ }
+ }
+
+ return pkg.toString();
+ }
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardArtifactPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardArtifactPage.java
new file mode 100644
index 00000000..aabcc22d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardArtifactPage.java
@@ -0,0 +1,364 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+
+import org.apache.maven.model.Model;
+
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.ui.dialogs.MavenRepositorySearchDialog;
+
+
+/**
+ * Wizard page responsible for gathering information about the Maven2 artifact and the directories to create. This
+ * wizard page gathers Maven2 specific information. The user must specify the necessary information about the Maven2
+ * artifact and she can also decide which directories of the default Maven2 directory structure should be created. Input
+ * validation is performed in order to make sure that all the provided information is valid before letting the wizard
+ * continue.
+ */
+public class MavenProjectWizardArtifactPage extends AbstractMavenWizardPage {
+
+ private static final ProjectFolder JAVA = new ProjectFolder("src/main/java", "target/classes"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ private static final ProjectFolder JAVA_TEST = new ProjectFolder("src/test/java", "target/test-classes"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ private static final ProjectFolder RESOURCES = new ProjectFolder("src/main/resources", "target/classes"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ private static final ProjectFolder RESOURCES_TEST = new ProjectFolder("src/test/resources", "target/test-classes"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // private static final ProjectFolder FILTERS = new ProjectFolder("src/main/filters", null, false);
+
+ // private static final ProjectFolder FILTERS_TEST = new ProjectFolder("src/test/filters", null, false);
+
+ // private static final ProjectFolder ASSEMBLY = new ProjectFolder("src/main/assembly", null, false);
+
+ // private static final ProjectFolder CONFIG = new ProjectFolder("src/main/config", null, false);
+
+ private static final ProjectFolder WEBAPP = new ProjectFolder("src/main/webapp", null); //$NON-NLS-1$
+
+ private static final ProjectFolder EAR = new ProjectFolder("src/main/application", null); //$NON-NLS-1$
+
+ private static final ProjectFolder SITE = new ProjectFolder("src/site", null); //$NON-NLS-1$
+
+ private static final ProjectFolder[] JAR_DIRS = {JAVA, JAVA_TEST, RESOURCES, RESOURCES_TEST};
+
+ private static final ProjectFolder[] WAR_DIRS = {JAVA, JAVA_TEST, RESOURCES, RESOURCES_TEST, WEBAPP};
+
+ private static final ProjectFolder[] EAR_DIRS = {EAR}; // MNGECLIPSE-688 add EAR Support
+
+ private static final ProjectFolder[] POM_DIRS = {SITE};
+
+ /** special directory sets, default is JAR_DIRS */
+ private static final Map<String, ProjectFolder[]> directorySets = new HashMap<String, ProjectFolder[]>();
+ static {
+ directorySets.put(MavenArtifactComponent.WAR, WAR_DIRS);
+ directorySets.put(MavenArtifactComponent.POM, POM_DIRS);
+ directorySets.put(MavenArtifactComponent.EAR, EAR_DIRS); // MNGECLIPSE-688 add EAR Support
+ }
+
+ /** parent property panel */
+ protected MavenParentComponent parentComponent;
+
+ /** artifact property panel */
+ protected MavenArtifactComponent artifactComponent;
+
+ /** the parent readonly state */
+ private boolean readonlyParent = false;
+
+ private boolean isUsed;
+
+ /**
+ * Sets the title and description of this wizard page and marks it as not being complete as user input is required for
+ * continuing.
+ * @wbp.parser.constructor
+ */
+ public MavenProjectWizardArtifactPage(ProjectImportConfiguration projectImportConfiguration) {
+ this("MavenProjectWizardArtifactPage", projectImportConfiguration); //$NON-NLS-1$
+ }
+
+ /**
+ * Sets the title and description of this wizard page and marks it as not being complete as user input is required for
+ * continuing.
+ */
+ protected MavenProjectWizardArtifactPage(String name, ProjectImportConfiguration projectImportConfiguration) {
+ super(name, projectImportConfiguration);
+
+ setTitle(Messages.getString("wizard.project.page.maven2.title")); //$NON-NLS-1$
+ setDescription(Messages.getString("wizard.project.page.maven2.description")); //$NON-NLS-1$
+ setPageComplete(false);
+ }
+
+ /**
+ * {@inheritDoc} This wizard page contains a <code>MavenArtifactComponent</code> to gather information about the Maven
+ * artifact and a <code>Maven2DirectoriesComponent</code> which allows to choose which directories of the default
+ * Maven directory structure to create.
+ */
+ public void createControl(Composite parent) {
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+
+ Composite container = new Composite(parent, SWT.NULL);
+ container.setLayout(layout);
+
+ WidthGroup widthGroup = new WidthGroup();
+ container.addControlListener(widthGroup);
+
+ ModifyListener modifyingListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ };
+
+ artifactComponent = new MavenArtifactComponent(container, SWT.NONE);
+ artifactComponent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ artifactComponent.setWidthGroup(widthGroup);
+ artifactComponent.setModifyingListener(modifyingListener);
+ artifactComponent.setArtifactIdEditable(!readonlyParent);
+
+ parentComponent = new MavenParentComponent(container, readonlyParent ? SWT.READ_ONLY : SWT.NONE);
+ parentComponent.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ parentComponent.setWidthGroup(widthGroup);
+
+ parentComponent.addModifyListener(modifyingListener);
+ parentComponent.addBrowseButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getShell(), //
+ org.eclipse.m2e.core.internal.Messages.MavenProjectWizardArtifactPage_searchDialog_title, IIndex.SEARCH_PARENTS, Collections.<ArtifactKey> emptySet(), false);
+
+ if(dialog.open() == Window.OK) {
+ IndexedArtifactFile indexedArtifactFile = (IndexedArtifactFile) dialog.getFirstResult();
+ if(indexedArtifactFile != null) {
+ parentComponent.setValues(indexedArtifactFile.group, indexedArtifactFile.artifact,
+ indexedArtifactFile.version);
+ }
+ }
+ }
+ });
+
+ createAdvancedSettings(container, new GridData(SWT.FILL, SWT.TOP, false, false, 2, 1));
+ resolverConfigurationComponent.setModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ });
+
+ addFieldWithHistory("groupId", artifactComponent.getGroupIdCombo()); //$NON-NLS-1$
+ addFieldWithHistory("artifactId", artifactComponent.getArtifactIdCombo()); //$NON-NLS-1$
+ addFieldWithHistory("version", artifactComponent.getVersionCombo()); //$NON-NLS-1$
+ addFieldWithHistory("name", artifactComponent.getNameCombo()); //$NON-NLS-1$
+
+ addFieldWithHistory("groupId", parentComponent.getGroupIdCombo()); //$NON-NLS-1$
+ addFieldWithHistory("artifactId", parentComponent.getArtifactIdCombo()); //$NON-NLS-1$
+ addFieldWithHistory("version", parentComponent.getVersionCombo()); //$NON-NLS-1$
+
+ container.layout();
+
+ validate();
+
+ setControl(container);
+ }
+
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ artifactComponent.getGroupIdCombo().setFocus();
+ }
+
+ /**
+ * Returns the Maven2 model containing the artifact information provided by the user.
+ *
+ * @return The Maven2 model containing the provided artifact information. Is never <code>null</code>.
+ */
+ public Model getModel() {
+ Model model = artifactComponent.getModel();
+
+ parentComponent.updateModel(model);
+
+ return model;
+ }
+
+ /** Returns the list of directories for the currently selected packaging. */
+ private ProjectFolder[] getProjectFolders() {
+ ProjectFolder[] folders = directorySets.get(artifactComponent.getPackaging());
+ return folders == null ? JAR_DIRS : folders;
+ }
+
+ /**
+ * Returns the directories of the default Maven2 directory structure selected by the user. These directories should be
+ * created along with the new project.
+ *
+ * @return The Maven2 directories selected by the user. Neither the array nor any of its elements is <code>null</code>
+ * .
+ */
+ public String[] getFolders() {
+ ProjectFolder[] mavenDirectories = getProjectFolders();
+
+ String[] directories = new String[mavenDirectories.length];
+ for(int i = 0; i < directories.length; i++ ) {
+ directories[i] = mavenDirectories[i].getPath();
+ }
+
+ return directories;
+ }
+
+ /**
+ * Validates the contents of this wizard page.
+ * <p>
+ * Feedback about the validation is given to the user by displaying error messages or informative messages on the
+ * wizard page. Depending on the provided user input, the wizard page is marked as being complete or not.
+ * <p>
+ * If some error or missing input is detected in the user input, an error message or informative message,
+ * respectively, is displayed to the user. If the user input is complete and correct, the wizard page is marked as
+ * begin complete to allow the wizard to proceed. To that end, the following conditions must be met:
+ * <ul>
+ * <li>The user must have provided a group ID.</li>
+ * <li>The user must have provided an artifact ID.</li>
+ * <li>The user must have provided a version for the artifact.</li>
+ * <li>The user must have provided the packaging type for the artifact.</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#setMessage(java.lang.String)
+ * @see org.eclipse.jface.wizard.WizardPage#setErrorMessage(java.lang.String)
+ * @see org.eclipse.jface.wizard.WizardPage#setPageComplete(boolean)
+ */
+ void validate() {
+ String error = validateInput();
+ setErrorMessage(error);
+ setPageComplete(error == null);
+ }
+
+ private String validateInput() {
+ String error = validateIdInput(artifactComponent.getGroupId().trim(), "group"); //$NON-NLS-1$
+ if(error != null) {
+ return error;
+ }
+
+ error = validateIdInput(artifactComponent.getArtifactId().trim(), "artifact"); //$NON-NLS-1$
+ if(error != null) {
+ return error;
+ }
+
+ if(artifactComponent.getVersion().trim().length() == 0) {
+ return Messages.getString("wizard.project.page.maven2.validator.version"); //$NON-NLS-1$
+ }
+
+ if(artifactComponent.getPackaging().trim().length() == 0) {
+ return Messages.getString("wizard.project.page.maven2.validator.packaging"); //$NON-NLS-1$
+ }
+
+ // if the parent project is specified, all three fields must be present
+ if(!parentComponent.validate()) {
+ return Messages.getString("wizard.project.page.maven2.validator.parent"); //$NON-NLS-1$
+ }
+
+ // validate project name
+ IStatus nameStatus = getImportConfiguration().validateProjectName(artifactComponent.getModel());
+ if(!nameStatus.isOK()) {
+ return nameStatus.getMessage();
+ }
+
+ return null;
+ }
+
+ /**
+ * Updates the properties when a project name is set on the first page of the wizard.
+ */
+ public void setProjectName(String projectName) {
+ if(artifactComponent.getArtifactId().equals(artifactComponent.getGroupId())) {
+ artifactComponent.setGroupId(projectName);
+ }
+ artifactComponent.setArtifactId(projectName);
+ validate();
+ }
+
+ /** Sets the readonly parent flag. */
+ public void setParentReadonly(boolean b) {
+ readonlyParent = b;
+ }
+
+ /**
+ * Updates the properties when a project name is set on the first page of the wizard.
+ */
+ public void setParentProject(String groupId, String artifactId, String version) {
+ parentComponent.setValues(groupId, artifactId, version);
+ artifactComponent.setGroupId(groupId);
+ artifactComponent.setVersion(version);
+ validate();
+ }
+
+ public void setUsed(boolean isUsed) {
+ this.isUsed = isUsed;
+ }
+
+ public boolean isPageComplete() {
+ return !isUsed || super.isPageComplete();
+ }
+
+ /**
+ * A placeholder representing a directory in the project structure.
+ */
+ final static class ProjectFolder {
+
+ /** Folder path */
+ private String path = null;
+
+ /** Output path */
+ private String outputPath = null;
+
+ ProjectFolder(String path, String outputPath) {
+ this.path = path;
+ this.outputPath = outputPath;
+ }
+
+ /**
+ * Returns folder path
+ */
+ String getPath() {
+ return path;
+ }
+
+ /**
+ * Returns folder output path
+ */
+ String getOutputPath() {
+ return outputPath;
+ }
+
+ /**
+ * Returns true for source folder
+ */
+ boolean isSourceEntry() {
+ return this.getOutputPath() != null;
+ }
+
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardLocationPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardLocationPage.java
new file mode 100644
index 00000000..78f91edc
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/MavenProjectWizardLocationPage.java
@@ -0,0 +1,321 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+
+
+/**
+ * Wizard page used to specify project location and working set.
+ */
+public class MavenProjectWizardLocationPage extends AbstractMavenWizardPage {
+
+ Button useDefaultWorkspaceLocationButton;
+ Label locationLabel;
+ Combo locationCombo;
+
+ boolean initialized = false;
+ private WorkingSetGroup workingSetGroup;
+
+ private IPath location;
+
+ /**
+ * Creates Maven project location page.
+ *
+ * @param title location page title text
+ * @param description location page description text
+ */
+ public MavenProjectWizardLocationPage(ProjectImportConfiguration configuration, String title, String description) {
+ super("MavenProjectWizardLocationPage", configuration); //$NON-NLS-1$
+ setTitle(title);
+ setDescription(description);
+ setPageComplete(false);
+
+ }
+
+ /**
+ * Creates Maven project location page.
+ */
+ public MavenProjectWizardLocationPage(ProjectImportConfiguration configuration, boolean showSimpleProject) {
+ super("MavenProjectWizardLocationPage", configuration); //$NON-NLS-1$
+ setTitle(Messages.getString("wizard.project.page.project.title")); //$NON-NLS-1$
+ setDescription(Messages.getString("wizard.project.page.project.description")); //$NON-NLS-1$
+ setPageComplete(false);
+ }
+
+ /**
+ * {@inheritDoc} This wizard page contains a component to query the project name and a
+ * <code>MavenLocationComponent</code> which allows to specify whether the project should be created in the
+ * workspace or at some given external location.
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ container.setLayout(new GridLayout(3, false));
+
+ createAdditionalControls(container);
+
+// // project name
+// GridData gridData = new GridData();
+// Label label = new Label(container, SWT.NULL);
+// label.setLayoutData(gridData);
+// label.setText(Messages.getString("wizard.project.page.project.projectName"));
+// projectNameText = new Combo(container, SWT.BORDER | SWT.SINGLE);
+// projectNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+// projectNameText.addModifyListener(modifyingListener);
+// addFieldWithHistory("projectName", projectNameText);
+
+ // gridData.verticalIndent = 5;
+// locationComponent = new MavenLocationComponent(container, SWT.NONE);
+// locationComponent.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
+// locationComponent.setModifyingListener(modifyingListener);
+// addFieldWithHistory("location", locationComponent.getLocationCombo());
+
+ useDefaultWorkspaceLocationButton = new Button(container, SWT.CHECK);
+ GridData useDefaultWorkspaceLocationButtonData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
+ useDefaultWorkspaceLocationButton.setLayoutData(useDefaultWorkspaceLocationButtonData);
+ useDefaultWorkspaceLocationButton.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardLocationPage_btnUserDefault);
+ useDefaultWorkspaceLocationButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ boolean inWorkspace = isInWorkspace();
+ locationLabel.setEnabled(!inWorkspace);
+ locationCombo.setEnabled(!inWorkspace);
+ }
+ });
+ useDefaultWorkspaceLocationButton.setSelection(true);
+
+ locationLabel = new Label(container, SWT.NONE);
+ GridData locationLabelData = new GridData();
+ locationLabelData.horizontalIndent = 10;
+ locationLabel.setLayoutData(locationLabelData);
+ locationLabel.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardLocationPage_lblLocation);
+ locationLabel.setEnabled(false);
+
+ locationCombo = new Combo(container, SWT.NONE);
+ GridData locationComboData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ locationCombo.setLayoutData(locationComboData);
+ locationCombo.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ });
+ locationCombo.setEnabled(false);
+ addFieldWithHistory("location", locationCombo); //$NON-NLS-1$
+
+ Button locationBrowseButton = new Button(container, SWT.NONE);
+ GridData locationBrowseButtonData = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ locationBrowseButton.setLayoutData(locationBrowseButtonData);
+ locationBrowseButton.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardLocationPage_btnLocation);
+ locationBrowseButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ DirectoryDialog dialog = new DirectoryDialog(getShell());
+ dialog.setText(org.eclipse.m2e.core.internal.Messages.MavenProjectWizardLocationPage_dialog_location);
+
+ String path = locationCombo.getText();
+ if(path.length()==0) {
+ path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toPortableString();
+ }
+ dialog.setFilterPath(path);
+
+ String selectedDir = dialog.open();
+ if(selectedDir != null) {
+ locationCombo.setText(selectedDir);
+ useDefaultWorkspaceLocationButton.setSelection(false);
+ validate();
+ }
+ }
+ });
+
+ this.workingSetGroup = new WorkingSetGroup(container, getImportConfiguration(), getShell());
+
+ if(location==null || Platform.getLocation().equals(location)) {
+// useDefaultWorkspaceLocationButton.setSelection(true);
+ } else {
+// useDefaultWorkspaceLocationButton.setSelection(false);
+// locationLabel.setEnabled(true);
+// locationCombo.setEnabled(true);
+ locationCombo.setText(location.toOSString());
+ }
+
+ createAdvancedSettings(container, new GridData(SWT.FILL, SWT.TOP, true, false, 3, 1));
+
+ setControl(container);
+ }
+
+ /**
+ * Create additional controls
+ */
+ protected void createAdditionalControls(Composite container) {
+ }
+
+ public void dispose() {
+ super.dispose();
+ workingSetGroup.dispose();
+ }
+
+ /**
+ * Returns whether the user has chosen to create the project in the workspace or at an external location.
+ *
+ * @return <code>true</code> if the project is to be created in the workspace, <code>false</code> if it should be
+ * created at an external location.
+ */
+ public boolean isInWorkspace() {
+ return useDefaultWorkspaceLocationButton.getSelection();
+ }
+
+ /**
+ * Returns the path of the location where the project is to be created. According to the user input, the path either
+ * points to the workspace or to a valid user specified location on the filesystem.
+ *
+ * @return The path of the location where to create the project. Is never <code>null</code>.
+ */
+ public IPath getLocationPath() {
+ if(isInWorkspace()) {
+ return ResourcesPlugin.getWorkspace().getRoot().getLocation();
+ }
+ return Path.fromOSString(locationCombo.getText().trim());
+ }
+
+ public void setLocationPath(IPath location) {
+ this.location = location;
+ }
+
+ /** {@inheritDoc} */
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+
+ if(visible) {
+ initialized = true;
+ validate();
+// projectNameText.setFocus();
+ }
+ }
+
+ /**
+ * Validates the contents of this wizard page.
+ * <p>
+ * Feedback about the validation is given to the user by displaying error messages or informative messages on the
+ * wizard page. Depending on the provided user input, the wizard page is marked as being complete or not.
+ * <p>
+ * If some error or missing input is detected in the user input, an error message or informative message,
+ * respectively, is displayed to the user. If the user input is complete and correct, the wizard page is marked as
+ * begin complete to allow the wizard to proceed. To that end, the following conditions must be met:
+ * <ul>
+ * <li>The user must have provided a project name.</li>
+ * <li>The project name must be a valid project resource identifier.</li>
+ * <li>A project with the same name must not exist.</li>
+ * <li>A valid project location path must have been specified.</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.core.resources.IWorkspace#validateName(java.lang.String, int)
+ * @see org.eclipse.core.resources.IWorkspace#validateProjectLocation(org.eclipse.core.resources.IProject,
+ * org.eclipse.core.runtime.IPath)
+ * @see org.eclipse.jface.dialogs.DialogPage#setMessage(java.lang.String)
+ * @see org.eclipse.jface.wizard.WizardPage#setErrorMessage(java.lang.String)
+ * @see org.eclipse.jface.wizard.WizardPage#setPageComplete(boolean)
+ */
+ protected void validate() {
+ if (!initialized) {
+ return;
+ }
+
+ final IWorkspace workspace = ResourcesPlugin.getWorkspace();
+
+// final String name = getProjectName();
+//
+// // check whether the project name field is empty
+// if(name.trim().length() == 0) {
+// setErrorMessage(null);
+// setMessage(Messages.getString("wizard.project.page.project.validator.projectName"));
+// setPageComplete(false);
+// return;
+// }
+//
+// // check whether the project name is valid
+// final IStatus nameStatus = workspace.validateName(name, IResource.PROJECT);
+// if(!nameStatus.isOK()) {
+// setErrorMessage(nameStatus.getMessage());
+// setPageComplete(false);
+// return;
+// }
+//
+// // check whether project already exists
+// final IProject handle = getProjectHandle();
+// if(handle.exists()) {
+// setErrorMessage(Messages.getString("wizard.project.page.project.validator.projectExists"));
+// setPageComplete(false);
+// return;
+// }
+
+ IPath projectPath = getLocationPath();
+ String location = projectPath.toOSString();
+
+ // check whether location is empty
+ if(location.length() == 0) {
+ setErrorMessage(null);
+ setMessage(Messages.getString("wizard.project.page.project.validator.projectLocation")); //$NON-NLS-1$
+ setPageComplete(false);
+ return;
+ }
+
+ // check whether the location is a syntactically correct path
+ if(!Path.ROOT.isValidPath(location)) {
+ setErrorMessage(Messages.getString("wizard.project.page.project.validator.invalidLocation")); //$NON-NLS-1$
+ setPageComplete(false);
+ return;
+ }
+
+ // If we do not place the contents in the workspace validate the location.
+ if(!isInWorkspace()) {
+ //this wizardpage is used in multiple wizards, not only in MavenProjectWizard
+ // the other wizard don't seem to have any getModel() methods.
+ //see MNGECLIPSE-1252 for more.
+ if (getWizard() instanceof MavenProjectWizard)
+ {
+ String projectName = getImportConfiguration().getProjectName(((MavenProjectWizard)getWizard()).getModel());
+ if(projectName.length()>0){
+ final IStatus locationStatus = workspace.validateProjectLocation(workspace.getRoot().getProject(projectName), projectPath);
+ if(!locationStatus.isOK()) {
+ setErrorMessage(locationStatus.getMessage());
+ setPageComplete(false);
+ return;
+ }
+ }
+ }
+ }
+
+ setPageComplete(true);
+ setErrorMessage(null);
+ setMessage(null);
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/ProjectsImportPage.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/ProjectsImportPage.java
new file mode 100644
index 00000000..5200f7bf
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/ProjectsImportPage.java
@@ -0,0 +1,627 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.IOverwriteQuery;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.Messages;
+
+
+/**
+ * The ProjectsImportPage is the page that allows the user to import projects from a particular location.
+ */
+public class ProjectsImportPage extends WizardPage implements IOverwriteQuery {
+
+ String location;
+
+ CheckboxTreeViewer projectsList;
+
+ IProject[] wsProjects;
+
+ ProjectRecord[] selectedProjects = new ProjectRecord[0];
+
+
+ public ProjectsImportPage(String location) {
+ super("wizardExternalProjectsPage"); //$NON-NLS-1$
+ this.location = location;
+
+ setTitle(Messages.ProjectsImportPage_title);
+ setDescription(Messages.ProjectsImportPage_desc);
+ setPageComplete(false);
+ }
+
+ public void createControl(Composite parent) {
+ initializeDialogUnits(parent);
+
+ Composite workArea = new Composite(parent, SWT.NONE);
+ setControl(workArea);
+
+ workArea.setLayout(new GridLayout());
+ workArea.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));
+
+ createProjectsList(workArea);
+ createOptionsArea(workArea);
+ Dialog.applyDialogFont(workArea);
+
+ updateProjectsList(location);
+ }
+
+ /**
+ * Create the area with the extra options.
+ *
+ * @param workArea
+ */
+ private void createOptionsArea(Composite workArea) {
+ }
+
+ /**
+ * Create the checkbox list for the found projects.
+ *
+ * @param workArea
+ */
+ private void createProjectsList(Composite workArea) {
+ Label title = new Label(workArea, SWT.NONE);
+ title.setText(Messages.ProjectsImportPage_lstProjects);
+
+ Composite listComposite = new Composite(workArea, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginWidth = 0;
+ layout.makeColumnsEqualWidth = false;
+ listComposite.setLayout(layout);
+
+ listComposite.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH));
+
+ projectsList = new CheckboxTreeViewer(listComposite, SWT.BORDER);
+ GridData listData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH);
+ projectsList.getControl().setLayoutData(listData);
+
+ projectsList.setContentProvider(new ITreeContentProvider() {
+
+ public Object[] getChildren(Object parentElement) {
+ return null;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getValidProjects();
+ }
+
+ public boolean hasChildren(Object element) {
+ return false;
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public void dispose() {
+
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+ });
+
+ projectsList.setLabelProvider(new LabelProvider() {
+ public String getText(Object element) {
+ ProjectRecord projectRecord = (ProjectRecord) element;
+ return projectRecord.getProjectName() + " - " + projectRecord.projectFile.getParentFile().getAbsolutePath(); //$NON-NLS-1$
+ }
+ });
+
+ projectsList.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ setPageComplete(projectsList.getCheckedElements().length > 0);
+ }
+ });
+
+ projectsList.setInput(this);
+ projectsList.setComparator(new ViewerComparator());
+ createSelectionButtons(listComposite);
+ }
+
+ /**
+ * Create the selection buttons in the listComposite.
+ *
+ * @param listComposite
+ */
+ private void createSelectionButtons(Composite listComposite) {
+ Composite buttonsComposite = new Composite(listComposite, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ buttonsComposite.setLayout(layout);
+
+ buttonsComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
+
+ Button selectAll = new Button(buttonsComposite, SWT.PUSH);
+ selectAll.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ selectAll.setText(Messages.ProjectsImportPage_btnSelect);
+ selectAll.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ projectsList.setCheckedElements(selectedProjects);
+ setPageComplete(projectsList.getCheckedElements().length > 0);
+ }
+ });
+ Dialog.applyDialogFont(selectAll);
+ setButtonLayoutData(selectAll);
+
+ Button deselectAll = new Button(buttonsComposite, SWT.PUSH);
+ deselectAll.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ deselectAll.setText(Messages.ProjectsImportPage_btnDeselect);
+ deselectAll.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ projectsList.setCheckedElements(new Object[0]);
+ setPageComplete(false);
+ }
+ });
+ Dialog.applyDialogFont(deselectAll);
+ setButtonLayoutData(deselectAll);
+
+ Button refresh = new Button(buttonsComposite, SWT.PUSH);
+ refresh.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ refresh.setText(Messages.ProjectsImportPage_btnRefresh);
+ refresh.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateProjectsList(location);
+ }
+ });
+ Dialog.applyDialogFont(refresh);
+ setButtonLayoutData(refresh);
+ }
+
+ /**
+ * Update the list of projects based on path. Method declared public only for test suite.
+ *
+ * @param path
+ */
+ void updateProjectsList(final String path) {
+ try {
+ getContainer().run(true, true, new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) {
+ monitor.beginTask(Messages.ProjectsImportPage_task_search, 100);
+ File directory = new File(path);
+ selectedProjects = new ProjectRecord[0];
+ Collection<File> files = new ArrayList<File>();
+ monitor.worked(10);
+
+ if(directory.isDirectory()) {
+ if(!collectProjectFilesFromDirectory(files, directory, null, monitor)) {
+ return;
+ }
+ selectedProjects = new ProjectRecord[files.size()];
+ int index = 0;
+ monitor.worked(50);
+ monitor.subTask(Messages.ProjectsImportPage_task_processing);
+ for(File file : files) {
+ selectedProjects[index] = new ProjectRecord(file);
+ index++ ;
+ }
+ } else {
+ monitor.worked(60);
+ }
+ monitor.done();
+ }
+
+ });
+ } catch(InvocationTargetException e) {
+ MavenLogger.log(e.getMessage(), e);
+ } catch(InterruptedException e) {
+ // Nothing to do if the user interrupts.
+ }
+
+ projectsList.refresh(true);
+ projectsList.setCheckedElements(getValidProjects());
+ if(getValidProjects().length < selectedProjects.length) {
+ setMessage(Messages.ProjectsImportPage_message, WARNING);
+ } else {
+ setMessage(null, WARNING);
+ }
+ setPageComplete(projectsList.getCheckedElements().length > 0);
+ }
+
+ /**
+ * Collect the list of .project files that are under directory into files.
+ *
+ * @param files
+ * @param directory
+ * @param directoriesVisited Set of canonical paths of directories, used as recursion guard
+ * @param monitor The monitor to report to
+ * @return boolean <code>true</code> if the operation was completed.
+ */
+ boolean collectProjectFilesFromDirectory(Collection<File> files, File directory, Set<String> directoriesVisited,
+ IProgressMonitor monitor) {
+ if(monitor.isCanceled()) {
+ return false;
+ }
+
+ monitor.subTask(NLS.bind(Messages.ProjectsImportPage_task_checking, directory.getPath()));
+ File[] contents = directory.listFiles();
+ if(contents == null)
+ return false;
+
+ // Initialize recursion guard for recursive symbolic links
+ if(directoriesVisited == null) {
+ directoriesVisited = new HashSet<String>();
+ try {
+ directoriesVisited.add(directory.getCanonicalPath());
+ } catch(IOException exception) {
+ MavenLogger.log(exception.toString(), exception);
+ }
+ }
+
+ // first look for project description files
+ final String dotProject = IProjectDescription.DESCRIPTION_FILE_NAME;
+ for(File file : contents) {
+ if(file.isFile() && file.getName().equals(dotProject)) {
+ files.add(file);
+ // don't search sub-directories since we can't have nested
+ // projects
+ return true;
+ }
+ }
+
+ // no project description found, so recurse into sub-directories
+ for(File file : contents) {
+ if(file.isDirectory() && !IMavenConstants.METADATA_FOLDER.equals(file.getName())) {
+ try {
+ String canonicalPath = file.getCanonicalPath();
+ if(!directoriesVisited.add(canonicalPath)) {
+ // already been here --> do not recurse
+ continue;
+ }
+ } catch(IOException exception) {
+ MavenLogger.log(exception.toString(), exception);
+ }
+ collectProjectFilesFromDirectory(files, file, directoriesVisited, monitor);
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Create the selected projects
+ *
+ * @return boolean <code>true</code> if all project creations were successful.
+ */
+ public boolean createProjects() {
+ final Object[] selected = projectsList.getCheckedElements();
+
+ WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
+ protected void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ monitor.beginTask("", selected.length); //$NON-NLS-1$
+ if(monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+
+ for(int i = 0; i < selected.length; i++ ) {
+ createExistingProject((ProjectRecord) selected[i], new SubProgressMonitor(monitor, 1));
+ }
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+
+ // run the new project creation operation
+ try {
+ getContainer().run(true, true, op);
+ } catch(InterruptedException e) {
+ return false;
+ } catch(InvocationTargetException e) {
+ // one of the steps resulted in a core exception
+ Throwable t = e.getTargetException();
+ String message = Messages.ProjectsImportPage_error_creation;
+ IStatus status;
+ if(t instanceof CoreException) {
+ status = ((CoreException) t).getStatus();
+ } else {
+ status = new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, 1, message, t);
+ }
+ ErrorDialog.openError(getShell(), message, null, status);
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Performs clean-up if the user cancels the wizard without doing anything
+ */
+ public void performCancel() {
+ }
+
+ /**
+ * Create the project described in record. If it is successful return true.
+ *
+ * @param record
+ * @return boolean <code>true</code> if successful
+ * @throws InterruptedException
+ */
+ boolean createExistingProject(final ProjectRecord record, IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ String projectName = record.getProjectName();
+ final IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ final IProject project = workspace.getRoot().getProject(projectName);
+ if(record.description == null) {
+ // error case
+ record.description = workspace.newProjectDescription(projectName);
+ IPath locationPath = new Path(record.projectFile.getAbsolutePath());
+
+ // If it is under the root use the default location
+ if(Platform.getLocation().isPrefixOf(locationPath)) {
+ record.description.setLocation(null);
+ } else {
+ record.description.setLocation(locationPath);
+ }
+ } else {
+ record.description.setName(projectName);
+ }
+
+ try {
+ monitor.beginTask(Messages.ProjectsImportPage_task_creating, 100);
+
+ @SuppressWarnings("deprecation")
+ IPath projectPath = record.description.getLocation();
+ if(projectPath!=null) {
+ MavenConsole console = MavenPlugin.getDefault().getConsole();
+
+ IWorkspaceRoot root = workspace.getRoot();
+
+ if(projectPath.toFile().equals(root.getLocation().toFile())) {
+ console.logError("Can't create project " + projectName + " at Workspace folder");
+ return false;
+ }
+
+ if(projectPath.removeLastSegments(1).toFile().equals(root.getLocation().toFile())) {
+ // rename dir in workspace to match expected project name
+ if(!projectPath.equals(root.getLocation().append(projectName))) {
+ File projectDir = projectPath.toFile();
+ File newProject = new File(projectDir.getParent(), projectName);
+ if(!projectDir.renameTo(newProject)) {
+ MavenLogger.log("Can't rename " + projectDir + " to " + newProject, null);
+ }
+ record.description.setLocation(null);
+ }
+ }
+ }
+
+ project.create(record.description, new SubProgressMonitor(monitor, 30));
+ project.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor(monitor, 70));
+
+ } catch(CoreException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+
+ return true;
+ }
+
+ /**
+ * The <code>WizardDataTransfer</code> implementation of this <code>IOverwriteQuery</code> method asks the user
+ * whether the existing resource at the given path should be overwritten.
+ *
+ * @param pathString
+ * @return the user's reply: one of <code>"YES"</code>, <code>"NO"</code>, <code>"ALL"</code>, or
+ * <code>"CANCEL"</code>
+ */
+ public String queryOverwrite(String pathString) {
+ Path path = new Path(pathString);
+
+ String messageString;
+ // Break the message up if there is a file name and a directory
+ // and there are at least 2 segments.
+ if(path.getFileExtension() == null || path.segmentCount() < 2) {
+ messageString = NLS.bind(Messages.ProjectsImportPage_overwrite, pathString);
+ } else {
+ messageString = NLS.bind(Messages.ProjectsImportPage_overwrite2,
+ path.lastSegment(), path.removeLastSegments(1).toOSString());
+ }
+
+ final MessageDialog dialog = new MessageDialog(getContainer().getShell(), Messages.ProjectsImportPage_dialog_title, null,
+ messageString, MessageDialog.QUESTION, new String[] {IDialogConstants.YES_LABEL,
+ IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.NO_TO_ALL_LABEL,
+ IDialogConstants.CANCEL_LABEL}, 0);
+ String[] response = new String[] {YES, ALL, NO, NO_ALL, CANCEL};
+ // run in syncExec because callback is from an operation,
+ // which is probably not running in the UI thread.
+ getControl().getDisplay().syncExec(new Runnable() {
+ public void run() {
+ dialog.open();
+ }
+ });
+ return dialog.getReturnCode() < 0 ? CANCEL : response[dialog.getReturnCode()];
+ }
+
+ /**
+ * Retrieve all the projects in the current workspace.
+ *
+ * @return IProject[] array of IProject in the current workspace
+ */
+ private IProject[] getProjectsInWorkspace() {
+ if(wsProjects == null) {
+ wsProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ }
+ return wsProjects;
+ }
+
+ /**
+ * Method used for test suite.
+ *
+ * @return CheckboxTreeViewer the viewer containing all the projects found
+ */
+ public CheckboxTreeViewer getProjectsList() {
+ return projectsList;
+ }
+
+ /**
+ * Get the array of valid project records that can be imported from the source workspace or archive, selected by the
+ * user. If a project with the same name exists in both the source workspace and the current workspace, it will not
+ * appear in the list of projects to import and thus cannot be selected for import. Method declared public for test
+ * suite.
+ *
+ * @return ProjectRecord[] array of projects that can be imported into the workspace
+ */
+ public ProjectRecord[] getValidProjects() {
+ List<ProjectRecord> validProjects = new ArrayList<ProjectRecord>();
+ for(ProjectRecord projectRecord : selectedProjects) {
+ if(!isProjectInWorkspace(projectRecord.getProjectName())) {
+ validProjects.add(projectRecord);
+ }
+ }
+ return validProjects.toArray(new ProjectRecord[validProjects.size()]);
+ }
+
+ /**
+ * Determine if the project with the given name is in the current workspace.
+ *
+ * @param projectName String the project name to check
+ * @return boolean true if the project with the given name is in this workspace
+ */
+ private boolean isProjectInWorkspace(String projectName) {
+ if(projectName == null) {
+ return false;
+ }
+ IProject[] workspaceProjects = getProjectsInWorkspace();
+ for(int i = 0; i < workspaceProjects.length; i++ ) {
+ if(projectName.equals(workspaceProjects[i].getName())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+
+ /**
+ * Class declared public only for test suite.
+ */
+ public static class ProjectRecord {
+ File projectFile;
+
+ String projectName;
+
+ IProjectDescription description;
+
+ /**
+ * Create a record for a project based on the info in the file.
+ *
+ * @param file
+ */
+ ProjectRecord(File file) {
+ projectFile = file;
+ setProjectName();
+ }
+
+ /**
+ * Set the name of the project based on the projectFile.
+ */
+ private void setProjectName() {
+ IProjectDescription newDescription = null;
+ try {
+ IPath path = new Path(projectFile.getPath());
+ // if the file is in the default location, use the directory
+ // name as the project name
+ newDescription = ResourcesPlugin.getWorkspace().loadProjectDescription(path);
+
+ if(isDefaultLocation(path)) {
+ // projectName = path.segment(path.segmentCount() - 2);
+ // newDescription = ResourcesPlugin.getWorkspace().newProjectDescription(projectName);
+ }
+ } catch(CoreException e) {
+ // no good couldn't get the name
+ }
+
+ if(newDescription == null) {
+ this.description = null;
+ projectName = ""; //$NON-NLS-1$
+ } else {
+ this.description = newDescription;
+ projectName = this.description.getName();
+ }
+ }
+
+ /**
+ * Returns whether the given project description file path is in the default location for a project
+ *
+ * @param path The path to examine
+ * @return Whether the given path is the default location for a project
+ */
+ private boolean isDefaultLocation(IPath path) {
+ // The project description file must at least be within the project, which is within the workspace location
+ return path.segmentCount() > 1 && path.removeLastSegments(2).toFile().equals(Platform.getLocation().toFile());
+ }
+
+ /**
+ * Get the name of the project
+ *
+ * @return String
+ */
+ public String getProjectName() {
+ return projectName;
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/ProjectsImportWizard.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/ProjectsImportWizard.java
new file mode 100644
index 00000000..5e3c563d
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/ProjectsImportWizard.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import org.eclipse.jface.wizard.Wizard;
+
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.internal.Messages;
+
+/**
+ * WizardExtension
+ *
+ * @author Eugene Kuleshov
+ */
+public class ProjectsImportWizard extends Wizard {
+ private final String location;
+
+ private ProjectsImportPage mainPage;
+
+ public ProjectsImportWizard(String location) {
+ this.location = location;
+ setWindowTitle(Messages.ProjectsImportWizard_title);
+ setDefaultPageImageDescriptor(MavenImages.WIZ_IMPORT_WIZ);
+ }
+
+ public void addPages() {
+ mainPage = new ProjectsImportPage(this.location);
+ addPage(mainPage);
+ }
+
+ public boolean performCancel() {
+ mainPage.performCancel();
+ return true;
+ }
+
+ public boolean performFinish() {
+ return mainPage.createProjects();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/ResolverConfigurationComponent.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/ResolverConfigurationComponent.java
new file mode 100644
index 00000000..f94e4bff
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/ResolverConfigurationComponent.java
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+
+
+/**
+ * A foldable resolver configuration panel
+ */
+public class ResolverConfigurationComponent extends ExpandableComposite {
+
+ private static final String[] DEFAULT_NAME_TEMPLATES = {"[artifactId]", // //$NON-NLS-1$
+ "[artifactId]-TRUNK", // //$NON-NLS-1$
+ "[artifactId]-[version]", // //$NON-NLS-1$
+ "[groupId].[artifactId]", "[groupId].[artifactId]-[version]"}; //$NON-NLS-1$ //$NON-NLS-2$
+
+ /** The resolver configuration */
+ protected final ResolverConfiguration resolverConfiguration;
+
+ /** project import configuration */
+ private final ProjectImportConfiguration projectImportConfiguration;
+
+ private ModifyListener modifyListener;
+
+ Button resolveWorkspaceProjects;
+
+ Text profiles;
+
+ Combo template;
+
+ /** Creates a new component. */
+ public ResolverConfigurationComponent(final Composite parent,
+ final ProjectImportConfiguration propectImportConfiguration, final boolean enableProjectNameTemplate) {
+ super(parent, ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ this.projectImportConfiguration = propectImportConfiguration;
+ this.resolverConfiguration = propectImportConfiguration.getResolverConfiguration();
+
+ setText(Messages.getString("resolverConfiguration.advanced")); //$NON-NLS-1$
+
+ final Composite advancedComposite = new Composite(this, SWT.NONE);
+ setClient(advancedComposite);
+ addExpansionListener(new ExpansionAdapter() {
+ public void expansionStateChanged(ExpansionEvent e) {
+ Shell shell = parent.getShell();
+ Point minSize = shell.getMinimumSize();
+ shell.setMinimumSize(shell.getSize().x, minSize.y);
+ shell.pack();
+ parent.layout();
+ shell.setMinimumSize(minSize);
+ }
+ });
+
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginLeft = 11;
+ gridLayout.numColumns = 2;
+ advancedComposite.setLayout(gridLayout);
+
+ resolveWorkspaceProjects = new Button(advancedComposite, SWT.CHECK);
+ resolveWorkspaceProjects.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
+ resolveWorkspaceProjects.setText(Messages.getString("resolverConfiguration.resolveWorkspaceProjects")); //$NON-NLS-1$
+ resolveWorkspaceProjects.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ resolverConfiguration.setResolveWorkspaceProjects(resolveWorkspaceProjects.getSelection());
+ }
+ });
+
+ Label profilesLabel = new Label(advancedComposite, SWT.NONE);
+ profilesLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ profilesLabel.setText(Messages.getString("resolverConfiguration.profiles")); //$NON-NLS-1$
+
+ profiles = new Text(advancedComposite, SWT.BORDER);
+ profiles.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ profiles.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ resolverConfiguration.setActiveProfiles(profiles.getText());
+ }
+ });
+
+ if(enableProjectNameTemplate) {
+ Label templateLabel = new Label(advancedComposite, SWT.NONE);
+ templateLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ templateLabel.setText(Messages.getString("resolverConfiguration.template")); //$NON-NLS-1$
+
+ template = new Combo(advancedComposite, SWT.BORDER);
+ template.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ template.setToolTipText(Messages.getString("resolverConfiguration.templateDescription")); //$NON-NLS-1$
+ template.setItems(DEFAULT_NAME_TEMPLATES);
+ template.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ propectImportConfiguration.setProjectNameTemplate(template.getText());
+ }
+ });
+ }
+
+ loadData();
+ }
+
+ public void loadData() {
+ resolveWorkspaceProjects.setSelection(resolverConfiguration.shouldResolveWorkspaceProjects());
+ profiles.setText(resolverConfiguration.getActiveProfiles());
+ if(template != null) {
+ template.setText(projectImportConfiguration.getProjectNameTemplate());
+ }
+ }
+
+ public ResolverConfiguration getResolverConfiguration() {
+ return this.resolverConfiguration;
+ }
+
+ public void setModifyListener(ModifyListener modifyListener) {
+ this.modifyListener = modifyListener;
+
+ if(template != null) {
+ template.addModifyListener(modifyListener);
+ }
+ }
+
+ public void dispose() {
+ super.dispose();
+
+ if(modifyListener != null) {
+ template.removeModifyListener(modifyListener);
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/WidthGroup.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/WidthGroup.java
new file mode 100644
index 00000000..c6f8c77e
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/WidthGroup.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.HashSet;
+
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * Group of controls with the same width
+ *
+ * @author Eugene Kuleshov
+ */
+public class WidthGroup extends ControlAdapter {
+
+ private final HashSet<Control> controls = new HashSet<Control>();
+
+ public void controlResized(ControlEvent e) {
+ int maxWidth = 0;
+ for(Control c : this.controls) {
+ int width = c.getSize().x;
+ if(width > maxWidth) {
+ maxWidth = width;
+ }
+ }
+ if(maxWidth > 0) {
+ for(Control c : this.controls) {
+ GridData gd = (GridData) c.getLayoutData();
+ gd.widthHint = maxWidth;
+ c.getParent().layout();
+ }
+ }
+ }
+
+ public void addControl(Control control) {
+ controls.add(control);
+ control.getParent().layout();
+ }
+
+}
+
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/WorkingSetGroup.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/WorkingSetGroup.java
new file mode 100644
index 00000000..0d7bf352
--- /dev/null
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/wizards/WorkingSetGroup.java
@@ -0,0 +1,271 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.core.wizards;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.resource.DeviceResourceException;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.jface.resource.ResourceManager;
+import org.eclipse.jface.viewers.ComboViewer;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkingSet;
+import org.eclipse.ui.IWorkingSetManager;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
+
+import org.eclipse.m2e.core.internal.Messages;
+import org.eclipse.m2e.core.project.ProjectImportConfiguration;
+
+
+/**
+ * Working set group
+ *
+ * @author Eugene Kuleshov
+ */
+public class WorkingSetGroup {
+
+ static final List<String> WORKING_SET_IDS = Arrays.asList( //
+ "org.eclipse.ui.resourceWorkingSetPage", "org.eclipse.jdt.ui.JavaWorkingSetPage"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ ComboViewer workingsetComboViewer;
+
+ Button addToWorkingSetButton;
+
+ final ProjectImportConfiguration configuration;
+
+ final Shell shell;
+
+ public WorkingSetGroup(Composite container, ProjectImportConfiguration configuration, Shell shell) {
+ this.configuration = configuration;
+ this.shell = shell;
+
+ createControl(container);
+ }
+
+ private void createControl(Composite container) {
+ addToWorkingSetButton = new Button(container, SWT.CHECK);
+ GridData gd_addToWorkingSetButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
+ gd_addToWorkingSetButton.verticalIndent = 12;
+ addToWorkingSetButton.setLayoutData(gd_addToWorkingSetButton);
+ addToWorkingSetButton.setSelection(true);
+ addToWorkingSetButton.setData("name", "addToWorkingSetButton"); //$NON-NLS-1$ //$NON-NLS-2$
+ addToWorkingSetButton.setText(Messages.WorkingSetGroup_btnAddSet);
+ addToWorkingSetButton.setSelection(false);
+
+ final Label workingsetLabel = new Label(container, SWT.NONE);
+ GridData gd_workingsetLabel = new GridData();
+ gd_workingsetLabel.horizontalIndent = 10;
+ workingsetLabel.setLayoutData(gd_workingsetLabel);
+ workingsetLabel.setEnabled(false);
+ workingsetLabel.setData("name", "workingsetLabel"); //$NON-NLS-1$ //$NON-NLS-2$
+ workingsetLabel.setText(Messages.WorkingSetGroup_lblSet);
+
+ Combo workingsetCombo = new Combo(container, SWT.READ_ONLY);
+ workingsetCombo.setEnabled(false);
+ workingsetCombo.setData("name", "workingsetCombo"); //$NON-NLS-1$ //$NON-NLS-2$
+ workingsetCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ workingsetComboViewer = new ComboViewer(workingsetCombo);
+ workingsetComboViewer.setContentProvider(new IStructuredContentProvider() {
+ public Object[] getElements(Object input) {
+ if(input instanceof IWorkingSet[]) {
+ return (IWorkingSet[]) input;
+ } else if(input instanceof List<?>) {
+ return new Object[] {input};
+ } else if(input instanceof Set<?>) {
+ return ((Set<?>) input).toArray();
+ }
+ return new IWorkingSet[0];
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public void dispose() {
+ }
+ });
+ workingsetComboViewer.setLabelProvider(new LabelProvider() {
+ private ResourceManager images = new LocalResourceManager(JFaceResources.getResources());
+
+ @SuppressWarnings("deprecation")
+ public Image getImage(Object element) {
+ if(element instanceof IWorkingSet) {
+ ImageDescriptor imageDescriptor = ((IWorkingSet) element).getImage();
+ if(imageDescriptor != null) {
+ try {
+ return (Image) images.create(imageDescriptor);
+ } catch(DeviceResourceException ex) {
+ return null;
+ }
+ }
+ }
+ return super.getImage(element);
+ }
+
+ public String getText(Object element) {
+ if(element instanceof IWorkingSet) {
+ return ((IWorkingSet) element).getLabel();
+ } else if(element instanceof List<?>) {
+ StringBuffer sb = new StringBuffer();
+ for(Object o : (List<?>) element) {
+ if(o instanceof IWorkingSet) {
+ if(sb.length() > 0) {
+ sb.append(", "); //$NON-NLS-1$
+ }
+ sb.append(((IWorkingSet) o).getLabel());
+ }
+ }
+ return sb.toString();
+ }
+ return super.getText(element);
+ }
+
+ public void dispose() {
+ images.dispose();
+ super.dispose();
+ }
+ });
+
+ workingsetComboViewer.setComparator(new ViewerComparator());
+
+ final Button newWorkingSetButton = new Button(container, SWT.NONE);
+ newWorkingSetButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ newWorkingSetButton.setData("name", "configureButton"); //$NON-NLS-1$ //$NON-NLS-2$
+ newWorkingSetButton.setText(Messages.WorkingSetGroup_btnMore);
+ newWorkingSetButton.setEnabled(false);
+ newWorkingSetButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(final SelectionEvent e) {
+ IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
+ IWorkingSetSelectionDialog dialog = workingSetManager.createWorkingSetSelectionDialog(shell, true,
+ WORKING_SET_IDS.toArray(new String[0]));
+ if(dialog.open() == Window.OK) {
+ IWorkingSet[] workingSets = dialog.getSelection();
+
+ selectWorkingSets(workingSets);
+ }
+ }
+ });
+
+ if(selectWorkingSets(configuration.getWorkingSets())) {
+ addToWorkingSetButton.setSelection(true);
+ workingsetLabel.setEnabled(true);
+ workingsetComboViewer.getCombo().setEnabled(true);
+ newWorkingSetButton.setEnabled(true);
+ }
+
+ addToWorkingSetButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ boolean addToWorkingingSet = addToWorkingSetButton.getSelection();
+ workingsetLabel.setEnabled(addToWorkingingSet);
+ workingsetComboViewer.getCombo().setEnabled(addToWorkingingSet);
+ newWorkingSetButton.setEnabled(addToWorkingingSet);
+ if(addToWorkingingSet) {
+ updateConfiguration();
+ } else {
+ configuration.setWorkingSet(null);
+ }
+ }
+ });
+
+ workingsetComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateConfiguration();
+ }
+ });
+ }
+
+ protected void updateConfiguration() {
+ if(addToWorkingSetButton.getSelection()) {
+ IStructuredSelection selection = (IStructuredSelection) workingsetComboViewer.getSelection();
+ Object o = selection.getFirstElement();
+ if(o != null) {
+ if(o instanceof IWorkingSet) {
+ configuration.setWorkingSet((IWorkingSet) o);
+ } else if(o instanceof List<?>) {
+ List<?> l = (List<?>) o;
+ configuration.setWorkingSets(l.toArray(new IWorkingSet[l.size()]));
+ }
+ }
+ }
+ }
+
+ Set<IWorkingSet> getWorkingSets() {
+ Set<IWorkingSet> workingSets = new HashSet<IWorkingSet>();
+
+ IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
+ for(IWorkingSet workingSet : workingSetManager.getWorkingSets()) {
+ if(!workingSet.isEmpty()) {
+ IAdaptable[] elements = workingSet.getElements();
+ IResource resource = (IResource) elements[0].getAdapter(IResource.class);
+ if(resource != null) {
+ workingSets.add(workingSet);
+ }
+ } else {
+ if(WORKING_SET_IDS.contains(workingSet.getId())) {
+ workingSets.add(workingSet);
+ }
+ }
+ }
+
+ return workingSets;
+ }
+
+ public void dispose() {
+ workingsetComboViewer.getLabelProvider().dispose();
+ }
+
+ protected boolean selectWorkingSets(IWorkingSet[] workingSets) {
+ Set<IWorkingSet> defaultSets = getWorkingSets();
+ workingsetComboViewer.setInput(defaultSets);
+
+ if(workingSets != null && workingSets.length > 0) {
+ if(workingSets.length == 1) {
+ IWorkingSet workingSet = workingSets[0];
+ if(defaultSets.contains(workingSet)) {
+ workingsetComboViewer.setSelection(new StructuredSelection(workingSet));
+ }
+ } else {
+ List<?> list = Arrays.asList(workingSets);
+ workingsetComboViewer.add(list);
+ workingsetComboViewer.setSelection(new StructuredSelection((Object) list));
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/org.eclipse.m2e.editor.xml/.classpath b/org.eclipse.m2e.editor.xml/.classpath
new file mode 100644
index 00000000..dd481be1
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/.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/main/java/"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.m2e.editor.xml/.gitignore b/org.eclipse.m2e.editor.xml/.gitignore
new file mode 100644
index 00000000..ea8c4bf7
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/org.eclipse.m2e.editor.xml/.project b/org.eclipse.m2e.editor.xml/.project
new file mode 100644
index 00000000..2954a6bb
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.editor.xml</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.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.editor.xml/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.editor.xml/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..a59d065d
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,268 @@
+#Thu Feb 04 10:56:11 EST 2010
+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.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=2
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=1
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=2
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
diff --git a/org.eclipse.m2e.editor.xml/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.m2e.editor.xml/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000..faea1285
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,10 @@
+#Tue Nov 30 18:51:38 EST 2010
+eclipse.preferences.version=1
+formatter_profile=_m2 plugin
+formatter_settings_version=11
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;org.osgi;org.eclipse;org.eclipse.m2e;
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\n * Copyright (c) 2010 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 *******************************************************************************/</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/org.eclipse.m2e.editor.xml/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.m2e.editor.xml/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 00000000..0bb84942
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Sat Aug 02 21:11:39 EDT 2008
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
diff --git a/org.eclipse.m2e.editor.xml/.settings/org.eclipse.mylyn.team.ui.prefs b/org.eclipse.m2e.editor.xml/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 00000000..754a6578
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Sat Aug 02 21:11:39 EDT 2008
+commit.comment.template=${task.key}\: ${task.description}
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.editor.xml/.settings/org.eclipse.pde.prefs b/org.eclipse.m2e.editor.xml/.settings/org.eclipse.pde.prefs
new file mode 100644
index 00000000..c016977e
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,22 @@
+#Thu Aug 28 19:48:45 EDT 2008
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.deprecated=2
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=2
+compilers.p.no-required-att=1
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=1
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.editor.xml/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.editor.xml/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..0029eebb
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:19 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF b/org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..60ec5caf
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF
@@ -0,0 +1,27 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.m2e.editor.xml;singleton:=true
+Bundle-Version: 0.13.0.qualifier
+Bundle-Activator: org.eclipse.m2e.editor.xml.MvnIndexPlugin
+Eclipse-LazyStart: true
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.jface.text,
+ org.eclipse.wst.xml.ui,
+ org.eclipse.wst.sse.ui,
+ org.eclipse.wst.sse.core,
+ org.eclipse.wst.xml.core,
+ org.eclipse.wst.common.uriresolver,
+ org.eclipse.m2e.core;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.maven.runtime;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.core.resources,
+ org.eclipse.ui.ide,
+ org.eclipse.core.filesystem,
+ org.eclipse.ui.forms
+Export-Package: org.eclipse.m2e.editor.xml
+Bundle-ClassPath: .
+Bundle-Vendor: %Bundle-Vendor
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6
diff --git a/org.eclipse.m2e.editor.xml/OSGI-INF/l10n/bundle.properties b/org.eclipse.m2e.editor.xml/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000..c9e06c84
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,66 @@
+#Properties file for org.eclipse.m2e.editor.xml
+Bundle-Vendor = Eclipse m2e
+Bundle-Name = Maven POM XML Editor
+contextType.document = Document
+contextType.project = Project
+contextType.parent = Parent
+contextType.properties = Properties
+contextType.properties2 = Properties
+contextType.dependencies = Dependencies
+contextType.exclusions = Exclusions
+contextType.plugins = Plugins
+contextType.plugin = Plugin
+contextType.configuration = Configuration
+contextType.executions = Executions
+contextType.execution = Execution
+contextType.profiles = Profiles
+contextType.repositories = Repositories
+contextType.groupid = Group Id
+contextType.artifactid = Artifact Id
+contextType.version = Version
+contextType.classifier = Classifier
+contextType.type = Type
+contextType.systemPath = SystemPath
+contextType.packaging = Packaging
+contextType.scope = Scope
+contextType.phase = Phase
+contextType.goal = Goal
+contextType.module = Module
+template.project.description = New project element
+template.project.name = project
+template.parent.description = New parent element
+template.parent.name = parent
+template.property.description = New property element
+template.property.name = property
+template.dependency.description = New dependency element
+template.dependency.name = dependency
+template.encoding.description = Set source encoding for the project
+template.encoding.name = project.build.sourceEncoding
+template.exclusion.description = New exclusion element
+template.exclusion.name = exclusion
+template.plugin.description = New plugin element
+template.plugin.name = plugin
+template.compiler.description = Java compiler plugin configuration
+template.compiler.name = javac plugin
+template.aspectj.description = AspectJ plugin configuration
+template.aspectj.name = AspectJ plugin
+template.war.description = WAR plugin configuration
+template.war.name = war plugin
+template.ejb.description = EJB plugin configuration
+template.ejb.name = ejb plugin
+template.ear.description = EAR plugin configuration
+template.ear.name = ear plugin
+template.jetty.description = Jetty plugin configuration
+template.jetty.name = jetty plugin
+template.repository.description = New repository element
+template.repository.name = repository
+template.execution.description = New execution element
+template.execution.name = execution
+template.profile.description = New profile element
+template.profile.name = profile
+template.tools.description = Profile for tools.jar
+template.tools.name = tools.jar
+template.tools2.description = Path to the tools.jar
+template.tools2.name = tools.jar
+keyword.label = maven
+page.name = Templates \ No newline at end of file
diff --git a/org.eclipse.m2e.editor.xml/about.html b/org.eclipse.m2e.editor.xml/about.html
new file mode 100644
index 00000000..70e4b67c
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>October 29, 2010</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/org.eclipse.m2e.editor.xml/build.properties b/org.eclipse.m2e.editor.xml/build.properties
new file mode 100644
index 00000000..610df1ca
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/build.properties
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2008-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
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ icons/,\
+ schema/,\
+ OSGI-INF/l10n/bundle.properties,\
+ about.html
diff --git a/org.eclipse.m2e.editor.xml/icons/build_obj.gif b/org.eclipse.m2e.editor.xml/icons/build_obj.gif
new file mode 100644
index 00000000..7134210d
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/build_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/close.gif b/org.eclipse.m2e.editor.xml/icons/close.gif
new file mode 100644
index 00000000..2cd9c544
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/close.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/element_obj.gif b/org.eclipse.m2e.editor.xml/icons/element_obj.gif
new file mode 100644
index 00000000..b914ed76
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/element_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/exclude_obj.gif b/org.eclipse.m2e.editor.xml/icons/exclude_obj.gif
new file mode 100644
index 00000000..1b9b737f
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/exclude_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/execution_obj.gif b/org.eclipse.m2e.editor.xml/icons/execution_obj.gif
new file mode 100644
index 00000000..ec477ea4
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/execution_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/filter_obj.gif b/org.eclipse.m2e.editor.xml/icons/filter_obj.gif
new file mode 100644
index 00000000..6fe6f0e1
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/filter_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/goal_obj.gif b/org.eclipse.m2e.editor.xml/icons/goal_obj.gif
new file mode 100644
index 00000000..da1a1660
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/goal_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/include_obj.gif b/org.eclipse.m2e.editor.xml/icons/include_obj.gif
new file mode 100644
index 00000000..da72808f
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/include_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/jar_obj.gif b/org.eclipse.m2e.editor.xml/icons/jar_obj.gif
new file mode 100644
index 00000000..2fa1d777
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/jar_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/jars_obj.gif b/org.eclipse.m2e.editor.xml/icons/jars_obj.gif
new file mode 100644
index 00000000..9a85d476
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/jars_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/open_pom.gif b/org.eclipse.m2e.editor.xml/icons/open_pom.gif
new file mode 100644
index 00000000..e74037b4
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/open_pom.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/parameter_obj.gif b/org.eclipse.m2e.editor.xml/icons/parameter_obj.gif
new file mode 100644
index 00000000..f8277cfa
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/parameter_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/person_obj.gif b/org.eclipse.m2e.editor.xml/icons/person_obj.gif
new file mode 100644
index 00000000..6884f974
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/person_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/plugin_obj.gif b/org.eclipse.m2e.editor.xml/icons/plugin_obj.gif
new file mode 100644
index 00000000..8493df40
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/plugin_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/plugins_obj.gif b/org.eclipse.m2e.editor.xml/icons/plugins_obj.gif
new file mode 100644
index 00000000..0fa090a1
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/plugins_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/profile_obj.gif b/org.eclipse.m2e.editor.xml/icons/profile_obj.gif
new file mode 100644
index 00000000..7b2c1f75
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/profile_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/profiles_obj.gif b/org.eclipse.m2e.editor.xml/icons/profiles_obj.gif
new file mode 100644
index 00000000..5fd4f9c6
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/profiles_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/project_obj.gif b/org.eclipse.m2e.editor.xml/icons/project_obj.gif
new file mode 100644
index 00000000..94dba885
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/project_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/properties_obj.gif b/org.eclipse.m2e.editor.xml/icons/properties_obj.gif
new file mode 100644
index 00000000..6223cfcb
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/properties_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/property_obj.gif b/org.eclipse.m2e.editor.xml/icons/property_obj.gif
new file mode 100644
index 00000000..f8277cfa
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/property_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/report2_obj.gif b/org.eclipse.m2e.editor.xml/icons/report2_obj.gif
new file mode 100644
index 00000000..16f8b684
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/report2_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/report_obj.gif b/org.eclipse.m2e.editor.xml/icons/report_obj.gif
new file mode 100644
index 00000000..e2f6ddb8
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/report_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/repository_obj.gif b/org.eclipse.m2e.editor.xml/icons/repository_obj.gif
new file mode 100644
index 00000000..6645b64a
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/repository_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/resource_obj.gif b/org.eclipse.m2e.editor.xml/icons/resource_obj.gif
new file mode 100644
index 00000000..3d73df8a
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/resource_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/resources_obj.gif b/org.eclipse.m2e.editor.xml/icons/resources_obj.gif
new file mode 100644
index 00000000..e860d8a3
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/resources_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/role_obj.gif b/org.eclipse.m2e.editor.xml/icons/role_obj.gif
new file mode 100644
index 00000000..b3643da0
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/role_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/sample.gif b/org.eclipse.m2e.editor.xml/icons/sample.gif
new file mode 100644
index 00000000..34fb3c9d
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/sample.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/icons/template_obj.gif b/org.eclipse.m2e.editor.xml/icons/template_obj.gif
new file mode 100644
index 00000000..fdde5fbb
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/icons/template_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor.xml/plugin.xml b/org.eclipse.m2e.editor.xml/plugin.xml
new file mode 100644
index 00000000..eb77655e
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/plugin.xml
@@ -0,0 +1,403 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
+ <sourceViewerConfiguration
+ class="org.eclipse.m2e.editor.xml.PomStructuredTextViewConfiguration"
+ target="org.eclipse.m2e.core.pomFile, org.eclipse.wst.xml.core.xmlsource, org.eclipse.core.runtime.xml"/>
+ <contentOutlineConfiguration
+ class="org.eclipse.m2e.editor.xml.PomContentOutlineConfiguration"
+ target="org.eclipse.m2e.core.pomFile, org.eclipse.wst.xml.core.xmlsource, org.eclipse.core.runtime.xml"/>
+ <provisionalConfiguration
+ type="org.eclipse.jface.text.quickassist.IQuickAssistProcessor"
+ class="org.eclipse.m2e.editor.xml.PomQuickAssistProcessor"
+ target="org.eclipse.m2e.core.pomFile"/>
+ </extension>
+ <extension point="org.eclipse.wst.sse.core.modelHandler">
+ <modelHandler
+ associatedContentTypeId="org.eclipse.m2e.core.pomFile"
+ class="org.eclipse.m2e.editor.xml.PomModelHandler"
+ id="org.eclipse.m2e.core.pomFile.handler">
+ </modelHandler>
+ </extension>
+ <extension
+ point="org.eclipse.ui.ide.markerResolution">
+ <markerResolutionGenerator
+ class="org.eclipse.m2e.editor.xml.MavenMarkerResolutionGenerator"
+ markerType="org.eclipse.m2e.core.maven2Problem.pomloading">
+ </markerResolutionGenerator>
+ </extension>
+ <extension
+ point="org.eclipse.core.filebuffers.annotationModelCreation">
+ <factory
+ contentTypeId="org.eclipse.m2e.core.pomFile"
+ class="org.eclipse.m2e.editor.xml.internal.POMMarkerAnnotationModelFactory" />
+ </extension>
+ <extension point="org.eclipse.ui.editors.templates">
+ <contextType name="%contextType.document"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.#document"/>
+
+ <contextType name="%contextType.project"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.project"/>
+
+ <contextType name="%contextType.parent"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.parent"/>
+
+ <contextType name="%contextType.properties"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.properties"/>
+
+ <contextType name="%contextType.properties2"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.properties"/>
+
+ <contextType name="%contextType.dependencies"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.dependencies"/>
+
+ <contextType name="%contextType.exclusions"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.exclusions"/>
+
+ <contextType name="%contextType.plugins"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.plugins"/>
+
+ <contextType name="%contextType.plugin"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.plugin"/>
+
+ <contextType name="%contextType.configuration"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.configuration"/>
+
+ <contextType name="%contextType.executions"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.executions"/>
+
+ <contextType name="%contextType.execution"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.execution"/>
+
+ <contextType name="%contextType.profiles"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.profiles"/>
+
+ <contextType name="%contextType.repositories"
+ class="org.eclipse.m2e.editor.xml.PomTemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.repositories"/>
+
+ <contextType name="%contextType.groupid"
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.groupId"/>
+
+ <contextType name="%contextType.artifactid"
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.artifactId"/>
+
+ <contextType name="%contextType.version"
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.version"/>
+
+ <contextType name="%contextType.classifier"
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.classifier"/>
+
+ <contextType name="%contextType.type"
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.type"/>
+
+ <contextType name="%contextType.systemPath"
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.systemPath"/>
+
+ <contextType name="%contextType.packaging"
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.packaging"/>
+
+ <contextType name="%contextType.scope"
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.scope"/>
+
+ <contextType name="%contextType.phase"
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.phase"/>
+
+ <contextType name="%contextType.goal"
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.goal"/>
+
+ <contextType name="%contextType.module"
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.eclipse.m2e.editor.xml.templates.contextType.module"/>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.project.skeleton"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.#document"
+ name="%template.project.name"
+ description="%template.project.description">
+ <pattern>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
+ xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+ xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
+ &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;</pattern>
+ </template>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.property.skeleton"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.properties"
+ name="%template.property.name"
+ description="%template.property.description">
+ <pattern>&lt;${cursor}${name}&gt;${value}&lt;/${name}&gt;</pattern>
+ </template>
+ <template id="org.eclipse.m2e.editor.xml.templates.property.encoding"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.properties"
+ name="%template.encoding.name"
+ description="%template.encoding.description">
+ <pattern>&lt;project.build.sourceEncoding&gt;${encoding}&lt;/project.build.sourceEncoding&gt;</pattern>
+ </template>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.dependency.skeleton"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.dependencies"
+ name="%template.dependency.name"
+ description="%template.dependency.description">
+ <pattern>&lt;dependency&gt;
+ &lt;groupId&gt;${cursor}&lt;/groupId&gt;
+ &lt;artifactId&gt;&lt;/artifactId&gt;
+ &lt;version&gt;&lt;/version&gt;
+ &lt;/dependency&gt;</pattern>
+ </template>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.exclusion.skeleton"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.exclusions"
+ name="%template.exclusion.name"
+ description="%template.exclusion.description">
+ <pattern>&lt;exclusion&gt;
+ &lt;groupId&gt;${cursor}&lt;/groupId&gt;
+ &lt;artifactId&gt;&lt;/artifactId&gt;
+ &lt;/exclusion&gt;</pattern>
+ </template>
+
+
+ <template id="org.eclipse.m2e.editor.xml.templates.plugin.javac"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.plugins"
+ name="%template.compiler.name"
+ description="%template.compiler.description">
+ <pattern>&lt;plugin&gt;
+ &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+ &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
+ &lt;configuration&gt;
+ &lt;!-- http://maven.apache.org/plugins/maven-compiler-plugin/ --&gt;
+ &lt;source&gt;${cursor}1.5&lt;/source&gt;
+ &lt;target&gt;1.5&lt;/target&gt;
+ &lt;/configuration&gt;
+ &lt;/plugin&gt;</pattern>
+ </template>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.plugin.aspectj"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.plugins"
+ name="%template.aspectj.name"
+ description="%template.aspectj.description">
+ <pattern>&lt;plugin&gt;
+ &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
+ &lt;artifactId&gt;aspectj-maven-plugin&lt;/artifactId&gt;
+ &lt;!-- http://mojo.codehaus.org/aspectj-maven-plugin/ --&gt;
+ &lt;executions&gt;
+ &lt;execution&gt;
+ &lt;goals&gt;
+ &lt;goal&gt;compile&lt;/goal&gt;
+ &lt;/goals&gt;
+ &lt;/execution&gt;
+ &lt;/executions&gt;
+ &lt;/plugin&gt;</pattern>
+ </template>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.plugin.war"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.plugins"
+ name="%template.war.name"
+ description="%template.war.description">
+ <pattern>&lt;plugin&gt;
+ &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+ &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
+ &lt;version&gt;2.1-beta-1&lt;/version&gt;
+ &lt;configuration&gt;
+ &lt;!-- http://maven.apache.org/plugins/maven-war-plugin/ --&gt;
+ &lt;warSourceDirectory&gt;src/main/webapp&lt;/warSourceDirectory&gt;
+ &lt;!--
+ &lt;webResources&gt;
+ &lt;resource&gt;
+ &lt;directory&gt;src/main/webapp2&lt;/directory&gt;
+ &lt;filtering&gt;false&lt;/filtering&gt;
+ &lt;/resource&gt;
+ &lt;/webResources&gt;
+ --&gt;
+ &lt;/configuration&gt;
+ &lt;/plugin&gt;</pattern>
+ </template>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.plugin.ejb"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.plugins"
+ name="%template.ejb.name"
+ description="%template.ejb.description">
+ <pattern>&lt;plugin&gt;
+ &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+ &lt;artifactId&gt;maven-ejb-plugin&lt;/artifactId&gt;
+ &lt;version&gt;2.2&lt;/version&gt;
+ &lt;configuration&gt;
+ &lt;!-- http://maven.apache.org/plugins/maven-ejb-plugin/ --&gt;
+ &lt;ejbVersion&gt;3.0&lt;/ejbVersion&gt;
+ &lt;/configuration&gt;
+ &lt;/plugin&gt;</pattern>
+ </template>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.plugin.ear"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.plugins"
+ name="%template.ear.name"
+ description="%template.ear.description">
+ <pattern>&lt;plugin&gt;
+ &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+ &lt;artifactId&gt;maven-ear-plugin&lt;/artifactId&gt;
+ &lt;version&gt;2.4.1&lt;/version&gt;
+ &lt;configuration&gt;
+ &lt;!-- http://maven.apache.org/plugins/maven-ear-plugin/ --&gt;
+ &lt;version&gt;5&lt;/version&gt;
+ &lt;!--
+ &lt;earSourceDirectory&gt;EarContent&lt;/earSourceDirectory&gt;
+ &lt;applicationXml&gt;EarContent/META-INF/application.xml&lt;/applicationXml&gt;
+ &lt;generateApplicationXml&gt;true&lt;/generateApplicationXml&gt;
+ &lt;modules&gt;
+ &lt;ejbModule&gt;
+ &lt;groupId&gt;org.foo2&lt;/groupId&gt;
+ &lt;artifactId&gt;test-ejb&lt;/artifactId&gt;
+ &lt;/ejbModule&gt;
+ &lt;webModule&gt;
+ &lt;groupId&gt;org.foo2&lt;/groupId&gt;
+ &lt;artifactId&gt;test-war&lt;/artifactId&gt;
+ &lt;/webModule&gt;
+ &lt;jarModule&gt;
+ &lt;groupId&gt;org.foo2&lt;/groupId&gt;
+ &lt;artifactId&gt;test-jar&lt;/artifactId&gt;
+ &lt;/jarModule&gt;
+ &lt;/modules&gt;
+ --&gt;
+ &lt;/configuration&gt;
+ &lt;/plugin&gt;</pattern>
+ </template>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.plugin.jetty"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.plugins"
+ name="%template.jetty.name"
+ description="%template.jetty.description">
+ <pattern>&lt;plugin&gt;
+ &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
+ &lt;artifactId&gt;maven-jetty-plugin&lt;/artifactId&gt;
+ &lt;configuration&gt;
+ &lt;!-- http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin --&gt;
+ &lt;scanIntervalSeconds&gt;10&lt;/scanIntervalSeconds&gt;
+ &lt;connectors&gt;
+ &lt;connector implementation=&quot;org.mortbay.jetty.nio.SelectChannelConnector&quot;&gt;
+ &lt;port&gt;8080&lt;/port&gt;
+ &lt;maxIdleTime&gt;60000&lt;/maxIdleTime&gt;
+ &lt;/connector&gt;
+ &lt;/connectors&gt;
+ &lt;/configuration&gt;
+ &lt;/plugin&gt;</pattern>
+ </template>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.repository.skeleton"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.repositories"
+ name="%template.repository.name"
+ description="%template.repository.description">
+ <pattern>&lt;repository&gt;
+ &lt;id&gt;${cursor}&lt;/id&gt;
+ &lt;url&gt;&lt;/url&gt;
+ &lt;releases&gt;
+ &lt;enabled&gt;true&lt;/enabled&gt;
+ &lt;/releases&gt;
+ &lt;snapshots&gt;
+ &lt;enabled&gt;false&lt;/enabled&gt;
+ &lt;/snapshots&gt;
+ &lt;/repository&gt;</pattern>
+ </template>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.execution.skeleton"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.executions"
+ name="%template.execution.name"
+ description="%template.execution.description">
+ <pattern>&lt;execution&gt;
+ &lt;id&gt;${cursor}&lt;/id&gt;
+ &lt;phase&gt;${verify}&lt;/phase&gt;
+ &lt;goals&gt;
+ &lt;goal&gt;${run}&lt;/goal&gt;
+ &lt;/goals&gt;
+ &lt;inherited&gt;${false}&lt;/inherited&gt;
+ &lt;configuration&gt;
+ &lt;/configuration&gt;
+ &lt;/execution&gt;</pattern>
+ </template>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.profile.skeleton"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.profiles"
+ name="%template.profile.name"
+ description="%template.profile.description">
+ <pattern>&lt;profile&gt;
+ &lt;id&gt;${cursor}${test}&lt;/id&gt;
+ &lt;activation&gt;
+ &lt;/activation&gt;
+ &lt;/profile&gt;</pattern>
+ </template>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.profile.tools.jar"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.profiles"
+ name="%template.tools.name"
+ description="%template.tools.description">
+ <pattern>&lt;profile&gt;
+ &lt;id&gt;tools.jar&lt;/id&gt;
+ &lt;activation&gt;
+ &lt;property&gt;
+ &lt;name&gt;java.vendor&lt;/name&gt;
+ &lt;value&gt;Sun Microsystems Inc.&lt;/value&gt;
+ &lt;/property&gt;
+ &lt;/activation&gt;
+ &lt;dependencies&gt;
+ &lt;dependency&gt;
+ &lt;groupId&gt;com.sun&lt;/groupId&gt;
+ &lt;artifactId&gt;tools&lt;/artifactId&gt;
+ &lt;version&gt;1.4.2&lt;/version&gt;
+ &lt;scope&gt;system&lt;/scope&gt;
+ &lt;systemPath&gt;$${java.home}/../lib/tools.jar&lt;/systemPath&gt;
+ &lt;/dependency&gt;
+ &lt;/dependencies&gt;
+ &lt;/profile&gt;</pattern>
+ </template>
+
+ <template id="org.eclipse.m2e.editor.xml.templates.systemPath.tools.jar"
+ contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.systemPath"
+ name="%template.tools2.name"
+ description="%template.tools2.description">
+ <pattern>$${java.home}/../lib/tools.jar</pattern>
+ </template>
+ </extension>
+
+ <extension point="org.eclipse.ui.keywords">
+ <keyword id="org.eclipse.m2e.maven" label="%keyword.label"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.preferencePages">
+ <page id="org.eclipse.m2e.editor.xml.preferences.PomTemplatesPreferencePage"
+ category="org.eclipse.m2e.core.preferences.Maven2PreferencePage"
+ class="org.eclipse.m2e.editor.xml.preferences.PomTemplatesPreferencePage"
+ name="%page.name">
+ <keywordReference id="org.eclipse.m2e.maven"/>
+ </page>
+ </extension>
+ <!--extension
+ point="org.eclipse.wst.sse.ui.quickFixProcessor">
+ <quickFixProcessor
+ class="org.eclipse.m2e.editor.xml.PomQuickAssistProcessor"
+ problemType="pomhint">
+ </quickFixProcessor>
+ </extension-->
+
+</plugin>
diff --git a/org.eclipse.m2e.editor.xml/pom.xml b/org.eclipse.m2e.editor.xml/pom.xml
new file mode 100644
index 00000000..da5fd4fa
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/pom.xml
@@ -0,0 +1,24 @@
+<?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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.editor.xml</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>Maven POM XML Editor</name>
+
+</project>
diff --git a/org.eclipse.m2e.editor.xml/schema/.gitignore b/org.eclipse.m2e.editor.xml/schema/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/schema/.gitignore
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java
new file mode 100644
index 00000000..27ddffb9
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertArtifactProposal.java
@@ -0,0 +1,340 @@
+package org.eclipse.m2e.editor.xml;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.PluginManagement;
+import org.apache.maven.project.MavenProject;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension4;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension5;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.formatter.IContentFormatter;
+import org.eclipse.jface.text.formatter.IContentFormatterExtension;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.internal.project.MavenMarkerManager;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.ui.dialogs.MavenRepositorySearchDialog;
+import org.eclipse.m2e.editor.xml.InsertArtifactProposal.Configuration;
+import org.eclipse.m2e.editor.xml.internal.Messages;
+
+public class InsertArtifactProposal implements ICompletionProposal, ICompletionProposalExtension4, ICompletionProposalExtension5 {
+
+ private ISourceViewer sourceViewer;
+ private Region region;
+ private int generatedLength = 0;
+ private int generatedOffset;
+ private Configuration config;
+ private PomStructuredTextViewConfiguration textConfig;
+
+ public InsertArtifactProposal(ISourceViewer sourceViewer, Region region, Configuration config, PomStructuredTextViewConfiguration config2) {
+ this.sourceViewer = sourceViewer;
+ this.region = region;
+ generatedOffset = region.getOffset();
+ this.config = config;
+ this.textConfig = config2;
+ assert config.getType() != null;
+ }
+
+ public void apply(IDocument document) {
+ IProject prj = PomContentAssistProcessor.extractProject(sourceViewer);
+ Set<ArtifactKey> managedKeys = new HashSet<ArtifactKey>();
+ Set<ArtifactKey> usedKeys = new HashSet<ArtifactKey>();
+ if (prj != null) {
+ IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectManager().getProject(prj);
+ if (facade != null) {
+ MavenProject mp = facade.getMavenProject();
+ if (mp != null) {
+ PluginManagement pm = mp.getPluginManagement();
+ if (pm != null && pm.getPlugins() != null) {
+ for (Plugin plug : pm.getPlugins()) {
+ managedKeys.add(new ArtifactKey(plug.getGroupId(), plug.getArtifactId(), plug.getVersion(), null));
+ }
+ }
+ }
+ }
+ }
+ //TODO also collect the used plugin's list
+
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(sourceViewer.getTextWidget().getShell(),
+ config.getType().getWindowTitle(), config.getType().getIIndexType(),
+ usedKeys, managedKeys, false);
+ if (config.getInitiaSearchString() != null) {
+ dialog.setQuery(config.getInitiaSearchString());
+ }
+ if(dialog.open() == Window.OK) {
+ String lineDelim = document.getLegalLineDelimiters()[0];//do we care? or just append \n always?
+ IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+ int offset = region.getOffset();
+ if(af != null) {
+ if (config.getType() == SearchType.PARENT) {
+ try {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("<parent>").append(lineDelim); //$NON-NLS-1$
+ buffer.append("<groupId>").append(af.group).append("</groupId>").append(lineDelim); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("<artifactId>").append(af.artifact).append("</artifactId>").append(lineDelim); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("<version>").append(af.version).append("</version>").append(lineDelim); //$NON-NLS-1$ //$NON-NLS-2$
+ String relativePath = PomContentAssistProcessor.findRelativePath(sourceViewer, af.group, af.artifact, af.version);
+ if (relativePath != null) {
+ buffer.append("<relativePath>").append(relativePath).append("</relativePath>").append(lineDelim); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ buffer.append("</parent>").append(lineDelim); //$NON-NLS-1$
+ generatedLength = buffer.toString().length();
+ document.replace(offset, region.getLength(), buffer.toString());
+
+ IContentFormatter formatter = textConfig.getContentFormatter(sourceViewer);
+ Region resRegion = format(formatter, document, generatedOffset, generatedLength);
+ generatedOffset = resRegion.getOffset();
+ generatedLength = resRegion.getLength();
+ } catch(BadLocationException e) {
+ MavenLogger.log("Failed inserting parent element", e); //$NON-NLS-1$
+ }
+ }
+ if (config.getType() == SearchType.PLUGIN) {
+ Node current = config.getCurrentNode();
+ if ("project".equals(current.getNodeName())) { //$NON-NLS-1$
+ //in project section go with build/plugins.
+ Element build = MavenMarkerManager.findChildElement((Element)current, "build"); //$NON-NLS-1$
+ if (build == null) {
+ try {
+ StringBuffer buffer = new StringBuffer();
+ generateBuild(buffer, lineDelim, af, skipVersion(current, af, managedKeys));
+ generatedLength = buffer.toString().length();
+ document.replace(offset, 0, buffer.toString());
+
+ IContentFormatter formatter = textConfig.getContentFormatter(sourceViewer);
+ Region resRegion = format(formatter, document, generatedOffset, generatedLength);
+ generatedOffset = resRegion.getOffset();
+ generatedLength = resRegion.getLength();
+ } catch (BadLocationException e) {
+ MavenLogger.log("Failed inserting build element", e); //$NON-NLS-1$
+ }
+ return;
+ } else {
+ current = build;
+ IndexedRegion reg = (IndexedRegion)current;
+ //we need to update the offset to where we found the existing build element..
+ offset = reg.getEndOffset() - "</build>".length(); //$NON-NLS-1$
+ }
+ }
+ if ("build".equals(current.getNodeName()) || "pluginManagement".equals(current.getNodeName())) { //$NON-NLS-1$ //$NON-NLS-2$
+ Element plugins = MavenMarkerManager.findChildElement((Element)current, "plugins"); //$NON-NLS-1$
+ if (plugins == null) {
+ //we need to create it.
+ try {
+ StringBuffer buffer = new StringBuffer();
+ generatePlugins(buffer, lineDelim, af, skipVersion(current, af, managedKeys));
+ generatedLength = buffer.toString().length();
+ document.replace(offset, 0, buffer.toString());
+
+ IContentFormatter formatter = textConfig.getContentFormatter(sourceViewer);
+ Region resRegion = format(formatter, document, offset, generatedLength);
+ generatedOffset = resRegion.getOffset();
+ generatedLength = resRegion.getLength();
+ } catch (BadLocationException e) {
+ MavenLogger.log("Failed inserting plugins element", e); //$NON-NLS-1$
+ }
+ return;
+ } else {
+ current = plugins;
+ IndexedRegion reg = (IndexedRegion)current;
+ //we need to update the offset to where we found the existing plugins element..
+ offset = reg.getEndOffset() - "</plugins>".length(); //$NON-NLS-1$
+ }
+ }
+ if ("plugins".equals(current.getNodeName())) { //$NON-NLS-1$
+ //simple, just add the plugin here..
+ //TODO we might want to look if the plugin is already defined in this section or not..
+ try {
+ StringBuffer buffer = new StringBuffer();
+ generatePlugin(buffer, lineDelim, af, skipVersion(current, af, managedKeys));
+ generatedLength = buffer.toString().length();
+ document.replace(offset, 0, buffer.toString());
+ IContentFormatter formatter = textConfig.getContentFormatter(sourceViewer);
+ Region resRegion = format(formatter, document, offset, generatedLength);
+ generatedOffset = resRegion.getOffset();
+ generatedLength = resRegion.getLength();
+ } catch (BadLocationException e) {
+ MavenLogger.log("Failed inserting plugin element", e); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * decide if we want to generate the version element or not..
+ * @param currentNode
+ * @param af
+ * @param managedList
+ * @return
+ */
+ private boolean skipVersion(Node currentNode, IndexedArtifactFile af, Set<ArtifactKey> managedList) {
+ if ("pluginManagement".equals(currentNode.getNodeName()) || "pluginManagement".equals(currentNode.getParentNode().getNodeName())) {
+ return false;
+ }
+ ArtifactKey key = new ArtifactKey(af.group, af.artifact, af.version, null);
+ return managedList.contains(key);
+ }
+
+ private void generatePlugin(StringBuffer buffer, String lineDelim, IndexedArtifactFile af, boolean skipVersion) {
+ buffer.append("<plugin>").append(lineDelim); //$NON-NLS-1$
+ buffer.append("<groupId>").append(af.group).append("</groupId>").append(lineDelim); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append("<artifactId>").append(af.artifact).append("</artifactId>").append(lineDelim); //$NON-NLS-1$ //$NON-NLS-2$
+ //for managed plugins (if version matches only?), don't add the version element
+ if (!skipVersion) {
+ buffer.append("<version>").append(af.version).append("</version>").append(lineDelim); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ buffer.append("</plugin>").append(lineDelim); //$NON-NLS-1$
+ }
+
+ private void generatePlugins(StringBuffer buffer, String lineDelim, IndexedArtifactFile af, boolean skipVersion) {
+ buffer.append("<plugins>").append(lineDelim); //$NON-NLS-1$
+ generatePlugin(buffer, lineDelim, af, skipVersion);
+ buffer.append("</plugins>").append(lineDelim); //$NON-NLS-1$
+ }
+
+ private void generateBuild(StringBuffer buffer, String lineDelim, IndexedArtifactFile af, boolean skipVersion) {
+ buffer.append("<build>").append(lineDelim); //$NON-NLS-1$
+ generatePlugins(buffer, lineDelim, af, skipVersion);
+ buffer.append("</build>").append(lineDelim); //$NON-NLS-1$
+ }
+
+ /**
+ * take the document and format the region specified by the supplied formatter.
+ * operates on whole line (determined by the region specified)
+ * returns the new region encompassing the original region after formatting
+ */
+ public static Region format(IContentFormatter formatter, IDocument document, int offset, int length) throws BadLocationException {
+ int startLine = document.getLineOfOffset(offset);
+ int endLine = document.getLineOfOffset(offset + length - 1); // -1 to make sure to be before the end of line char
+ int startLineOffset = document.getLineOffset(startLine);
+ formatter.format(document, new Region(startLineOffset, (document.getLineOffset(endLine) + document.getLineLength(endLine)) - startLineOffset));
+ startLineOffset = document.getLineOffset(startLine); //should be same, just being paranoid
+ return new Region (startLineOffset, (document.getLineOffset(endLine) + document.getLineLength(endLine)) - startLineOffset);
+ }
+
+ public Point getSelection(IDocument document) {
+ return new Point(generatedOffset, generatedLength);
+ }
+
+ public String getAdditionalProposalInfo() {
+ return null; //not to be used anymore
+ }
+
+ public String getDisplayString() {
+ return config.getType().getDisplayName();
+ }
+
+ public Image getImage() {
+ return config.getType().getImage();
+ }
+
+ public IContextInformation getContextInformation() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isAutoInsertable() {
+ return false;
+ }
+
+ public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
+ return config.getType().getAdditionalInfo();
+ }
+
+ /**
+ * supported search types
+ * @author mkleint
+ *
+ */
+ public static enum SearchType {
+
+ PARENT(IIndex.SEARCH_PARENTS, Messages.InsertArtifactProposal_searchDialog_title, Messages.InsertArtifactProposal_display_name, MvnImages.IMG_OPEN_POM, Messages.InsertArtifactProposal_additionals),
+ PLUGIN(IIndex.SEARCH_PLUGIN, Messages.InsertArtifactProposal_insert_plugin_title, Messages.InsertArtifactProposal_insert_plugin_display_name, MvnImages.IMG_OPEN_POM, Messages.InsertArtifactProposal_insert_plugin_description);
+
+ private final String type;
+ private final String windowTitle;
+ private final String displayName;
+ private final Image image;
+ private final String additionalInfo;
+ private SearchType(String type, String windowTitle, String dn, Image img, String addInfo) {
+ this.type = type;
+ this.windowTitle = windowTitle;
+ this.displayName = dn;
+ this.image = img;
+ this.additionalInfo = addInfo;
+ }
+
+ String getIIndexType() {
+ return type;
+ }
+
+ public String getWindowTitle() {
+ return windowTitle;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public Image getImage() {
+ return image;
+ }
+
+ public String getAdditionalInfo() {
+ return additionalInfo;
+ }
+
+ }
+
+ public static class Configuration {
+ private final SearchType type;
+ private String initiaSearchString;
+ private Node node;
+
+ public Configuration(SearchType type) {
+ this.type = type;
+ }
+
+ public void setInitiaSearchString(String initiaSearchString) {
+ this.initiaSearchString = initiaSearchString;
+ }
+ public String getInitiaSearchString() {
+ return initiaSearchString;
+ }
+ public SearchType getType() {
+ return type;
+ }
+
+ public void setCurrentNode(Node node) {
+ this.node = node;
+ }
+
+ public Node getCurrentNode() {
+ return node;
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java
new file mode 100644
index 00000000..1424e7b6
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/InsertExpressionProposal.java
@@ -0,0 +1,110 @@
+package org.eclipse.m2e.editor.xml;
+
+import org.apache.maven.model.InputLocation;
+import org.apache.maven.model.InputSource;
+import org.apache.maven.model.Model;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension5;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.editor.xml.internal.Messages;
+/**
+ * insertion proposal for ${ expressions
+ * @author mkleint
+ *
+ */
+public class InsertExpressionProposal implements ICompletionProposal, ICompletionProposalExtension5 {
+
+ private IMavenProjectFacade project;
+ private String key;
+ private Region region;
+ private ISourceViewer sourceViewer;
+ private int len = 0;
+
+ public InsertExpressionProposal(ISourceViewer sourceViewer, Region region, String key, IMavenProjectFacade mvnproject) {
+ assert project != null;
+ this.sourceViewer = sourceViewer;
+ this.region = region;
+ this.key = key;
+ this.project = mvnproject;
+ }
+
+ public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
+ String value = PomTemplateContext.simpleInterpolate(project.getProject(), "${" + key + "}"); //$NON-NLS-1$ //$NON-NLS-2$
+ MavenProject mavprj = project.getMavenProject();
+ String loc = null;
+ if (mavprj != null) {
+ Model mdl = mavprj.getModel();
+ if (mdl.getProperties() != null && mdl.getProperties().containsKey(key)) {
+ if (mdl.getLocation("properties") != null) {
+ InputLocation location = mdl.getLocation("properties").getLocation(key); //$NON-NLS-1$
+ if (location != null) {
+ //MNGECLIPSE-2539 apparently you can have an InputLocation with null input source.
+ // check!
+ InputSource source = location.getSource();
+ if (source != null) {
+ loc = source.getModelId();
+ }
+ }
+ }
+ }
+ }
+ StringBuffer buff = new StringBuffer();
+ buff.append("<html>"); //$NON-NLS-1$
+ if (value != null) {
+ buff.append(NLS.bind(Messages.InsertExpressionProposal_hint1, value));
+ }
+ if (loc != null) {
+ buff.append(NLS.bind(Messages.InsertExpressionProposal_hint2, loc));
+ }
+ buff.append("</html>"); //$NON-NLS-1$
+ return buff.toString();
+ }
+
+ public void apply(IDocument document) {
+ int offset = region.getOffset();
+ String replace = "${" + key + "}"; //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ document.replace(offset, region.getLength(), replace);
+ len = replace.length();
+ } catch(BadLocationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+ public Point getSelection(IDocument document) {
+ return new Point(region.getOffset() + len, 0);
+ }
+
+ public String getAdditionalProposalInfo() {
+ //not used anymore
+ return null;
+ }
+
+ public String getDisplayString() {
+ return "${" + key + "}"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public Image getImage() {
+ // TODO what kind of icon to use?
+ return null;
+ }
+
+ public IContextInformation getContextInformation() {
+ return null;
+ }
+
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MavenMarkerResolutionGenerator.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MavenMarkerResolutionGenerator.java
new file mode 100644
index 00000000..351e8ec5
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MavenMarkerResolutionGenerator.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IMarkerResolutionGenerator;
+import org.eclipse.ui.IMarkerResolutionGenerator2;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+
+
+/**
+ * MavenMarkerResolutionGenerator
+ *
+ * @author dyocum
+ */
+public class MavenMarkerResolutionGenerator implements IMarkerResolutionGenerator, IMarkerResolutionGenerator2 {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IMarkerResolutionGenerator#getResolutions(org.eclipse.core.resources.IMarker)
+ */
+ public IMarkerResolution[] getResolutions(IMarker marker) {
+ String hint = marker.getAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, null);
+ if(hint != null) {
+ //only provide a quickfix for the schema marker
+ if(IMavenConstants.EDITOR_HINT_MISSING_SCHEMA.equals(hint)) {
+ return new IMarkerResolution[] {new XMLSchemaMarkerResolution()};
+ }
+ if(IMavenConstants.EDITOR_HINT_PARENT_VERSION.equals(hint)) {
+ return new IMarkerResolution[] {new PomQuickAssistProcessor.IdPartRemovalProposal(marker, true) };
+ }
+ if(IMavenConstants.EDITOR_HINT_PARENT_GROUP_ID.equals(hint)) {
+ return new IMarkerResolution[] {new PomQuickAssistProcessor.IdPartRemovalProposal(marker, false) };
+ }
+ if(hint.equals(IMavenConstants.EDITOR_HINT_MANAGED_DEPENDENCY_OVERRIDE)) {
+ return new IMarkerResolution[] {
+ new PomQuickAssistProcessor.ManagedVersionRemovalProposal(marker, true),
+ new PomQuickAssistProcessor.IgnoreWarningProposal(marker, IMavenConstants.MARKER_IGNORE_MANAGED)
+ };
+ }
+ if(hint.equals(IMavenConstants.EDITOR_HINT_MANAGED_PLUGIN_OVERRIDE)) {
+ return new IMarkerResolution[] {
+ new PomQuickAssistProcessor.ManagedVersionRemovalProposal(marker, false),
+ new PomQuickAssistProcessor.IgnoreWarningProposal(marker, IMavenConstants.MARKER_IGNORE_MANAGED)
+ };
+ }
+ }
+ return new IMarkerResolution[0];
+ }
+
+ public boolean hasResolutions(IMarker marker) {
+ String hint = marker.getAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, null); //$NON-NLS-1$
+ return !(hint == null);
+ }
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnImages.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnImages.java
new file mode 100644
index 00000000..90ff8203
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnImages.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+import org.eclipse.m2e.core.core.MavenLogger;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class MvnImages {
+
+ // object images
+
+ public static final Image IMG_JAR = createImage("jar_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_JARS = createImage("jars_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_REPOSITORY = createImage("repository_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_PLUGIN = createImage("plugin_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_PLUGINS = createImage("plugins_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_EXECUTION = createImage("execution_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_GOAL = createImage("goal_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_FILTER = createImage("filter_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_RESOURCE = createImage("resource_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_RESOURCES = createImage("resources_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_INCLUDE = createImage("include_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_EXCLUDE = createImage("exclude_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_PERSON = createImage("person_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_ROLE = createImage("role_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_PROPERTY = createImage("property_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_PROPERTIES = createImage("properties_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_REPORT = createImage("report_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_PROFILE = createImage("profile_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_PROFILES = createImage("profiles_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_PARAMETER = createImage("parameter_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_BUILD = createImage("build_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_ELEMENT = createImage("element_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_USER_TEMPLATE = createImage("template_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_OPEN_POM = createImage("open_pom.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_CLOSE = createImage("close.gif"); //$NON-NLS-1$
+
+ private static ImageDescriptor create(String key) {
+ try {
+ ImageDescriptor imageDescriptor = createDescriptor(key);
+ ImageRegistry imageRegistry = getImageRegistry();
+ if(imageRegistry!=null) {
+ imageRegistry.put(key, imageDescriptor);
+ }
+ return imageDescriptor;
+ } catch (Exception ex) {
+ MavenLogger.log(key, ex);
+ return null;
+ }
+ }
+
+ private static Image createImage(String key) {
+ create(key);
+ ImageRegistry imageRegistry = getImageRegistry();
+ return imageRegistry==null ? null : imageRegistry.get(key);
+ }
+
+ private static ImageRegistry getImageRegistry() {
+ MvnIndexPlugin plugin = MvnIndexPlugin.getDefault();
+ return plugin==null ? null : plugin.getImageRegistry();
+ }
+
+ private static ImageDescriptor createDescriptor(String image) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(MvnIndexPlugin.PLUGIN_ID, "icons/" + image); //$NON-NLS-1$
+ }
+
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnIndexPlugin.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnIndexPlugin.java
new file mode 100644
index 00000000..5e5812df
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/MvnIndexPlugin.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml;
+
+import java.io.IOException;
+
+import org.osgi.framework.BundleContext;
+
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
+import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+import org.eclipse.m2e.core.core.MavenLogger;
+
+
+/**
+ * @author Lukas Krecan
+ */
+public class MvnIndexPlugin extends AbstractUIPlugin {
+ public static final String PLUGIN_ID = "org.eclipse.m2e.editor.xml"; //$NON-NLS-1$
+
+ private static final String TEMPLATES_KEY = PLUGIN_ID + ".templates"; //$NON-NLS-1$
+
+ private static MvnIndexPlugin defaultInstance;
+
+ private TemplateStore templateStore;
+
+ private ContributionContextTypeRegistry contextTypeRegistry;
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ defaultInstance = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ defaultInstance = null;
+ }
+
+ public static MvnIndexPlugin getDefault() {
+ return defaultInstance;
+ }
+
+ /**
+ * Returns the template store.
+ *
+ * @return the template store.
+ */
+ public TemplateStore getTemplateStore() {
+ if(templateStore == null) {
+ templateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), TEMPLATES_KEY);
+ try {
+ templateStore.load();
+ } catch(IOException ex) {
+ MavenLogger.log("Unable to load pom templates", ex); //$NON-NLS-1$
+ }
+ }
+ return templateStore;
+ }
+
+ /**
+ * Returns the template context type registry.
+ *
+ * @return the template context type registry
+ */
+ public ContextTypeRegistry getTemplateContextRegistry() {
+ if(contextTypeRegistry == null) {
+ ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
+ for(PomTemplateContext contextType : PomTemplateContext.values()) {
+ registry.addContextType(contextType.getContextTypeId());
+ }
+ contextTypeRegistry = registry;
+ }
+ return contextTypeRegistry;
+ }
+
+ public ContextTypeRegistry getContextTypeRegistry() {
+ if(contextTypeRegistry == null) {
+ contextTypeRegistry = new ContributionContextTypeRegistry();
+ // TemplateContextType contextType = new TemplateContextType(CONTEXT_TYPE, "POM XML Editor");
+ PomTemplateContextType contextType = new PomTemplateContextType();
+ contextTypeRegistry.addContextType(contextType);
+ }
+ return contextTypeRegistry;
+ }
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentAssistProcessor.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentAssistProcessor.java
new file mode 100644
index 00000000..6b010671
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentAssistProcessor.java
@@ -0,0 +1,579 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.Stack;
+import java.util.TreeSet;
+
+import org.apache.maven.project.MavenProject;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.filebuffers.ITextFileBuffer;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.DocumentTemplateContext;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateContext;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.TemplateException;
+import org.eclipse.jface.text.templates.TemplateProposal;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.internal.WorkbenchPlugin;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
+import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistProcessor;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.internal.project.MavenMarkerManager;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.editor.xml.internal.Messages;
+
+/**
+ * @author Lukas Krecan
+ * @author Eugene Kuleshov
+ */
+@SuppressWarnings("restriction")
+public class PomContentAssistProcessor extends XMLContentAssistProcessor {
+
+ private static final ProposalComparator PROPOSAL_COMPARATOR = new ProposalComparator();
+
+ private ISourceViewer sourceViewer;
+
+ private PomStructuredTextViewConfiguration textConfig;
+
+ public PomContentAssistProcessor(ISourceViewer sourceViewer, PomStructuredTextViewConfiguration pomStructuredTextViewConfiguration) {
+ this.sourceViewer = sourceViewer;
+ textConfig = pomStructuredTextViewConfiguration;
+ }
+
+ //broken
+
+ protected void addTagNameProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
+ String currentNodeName = getCurrentNode(contentAssistRequest).getNodeName();
+ PomTemplateContext context = PomTemplateContext.fromNodeName(currentNodeName);
+ if(PomTemplateContext.CONFIGURATION == context)
+ {
+ //this is sort of hack that makes sure the config proposals appear even
+ // when you type <prefix
+ // the downside is that additional typing hides the proposals popup
+ // there has to be a better way though. the xml element completions seems to be coping with it fine..
+ contentAssistRequest.setReplacementBeginPosition(contentAssistRequest.getReplacementBeginPosition() - 1);
+ contentAssistRequest.setReplacementLength(contentAssistRequest.getReplacementLength() + 1);
+ addProposals(contentAssistRequest, context, getCurrentNode(contentAssistRequest), contentAssistRequest.getMatchString());
+ }
+ if(PomTemplateContext.UNKNOWN == context)
+ {
+ context = PomTemplateContext.fromNodeName(getCurrentNode(contentAssistRequest).getParentNode().getNodeName());
+ if(PomTemplateContext.CONFIGURATION == context)
+ {
+ addProposals(contentAssistRequest, context, getCurrentNode(contentAssistRequest).getParentNode(), contentAssistRequest.getMatchString());
+ }
+ }
+ super.addTagNameProposals(contentAssistRequest, childPosition);
+ }
+
+
+ @Override
+ protected void addTagInsertionProposals(ContentAssistRequest contentAssistRequest, int childPosition) {
+ String currentNodeName = getCurrentNode(contentAssistRequest).getNodeName();
+
+ addProposals(contentAssistRequest, PomTemplateContext.fromNodeName(currentNodeName));
+ super.addTagInsertionProposals(contentAssistRequest, childPosition);
+ }
+
+ private Node getCurrentNode(ContentAssistRequest contentAssistRequest) {
+ Node currentNode = contentAssistRequest.getNode();
+ if(currentNode instanceof Text) {
+ currentNode = currentNode.getParentNode();
+ }
+ return currentNode;
+ }
+
+ private void addProposals(ContentAssistRequest request, PomTemplateContext context) {
+ ITextSelection selection = (ITextSelection) sourceViewer.getSelectionProvider().getSelection();
+ int offset = request.getReplacementBeginPosition();
+ // adjust offset to end of normalized selection
+ if(selection.getOffset() == offset) {
+ offset = selection.getOffset() + selection.getLength();
+ }
+
+ String prefix = extractPrefix(sourceViewer, offset);
+
+ addExpressionProposal(request, context, getCurrentNode(request), prefix);
+
+ addGenerateProposals(request, context, getCurrentNode(request), prefix);
+
+ addProposals(request, context, getCurrentNode(request), prefix);
+ }
+ /**
+ * this is a proposal method for adding expressions when ${ is typed..
+ * @param request
+ * @param context
+ * @param currentNode
+ * @param prefix
+ */
+ private void addExpressionProposal(ContentAssistRequest request, PomTemplateContext context, Node currentNode,
+ String prefix) {
+ int exprStart = prefix.lastIndexOf("${"); //$NON-NLS-1$
+ if (exprStart != -1) {
+ //the regular prefix is separated by whitespace and <> brackets only, we need to cut the last portion
+ String realExpressionPrefix = prefix.substring(exprStart);
+ if (realExpressionPrefix.contains("}")) { //$NON-NLS-1$
+ //the expression is not opened..
+ return;
+ }
+ if (expressionproposalContexts.contains(context)) {
+ //add all effective pom expressions
+ IProject prj = extractProject(sourceViewer);
+ Region region = new Region(request.getReplacementBeginPosition() - realExpressionPrefix.length(), realExpressionPrefix.length());
+ if (prj != null) {
+ IMavenProjectFacade mvnproject = MavenPlugin.getDefault().getMavenProjectManager().getProject(prj);
+ Set<String> collect = new TreeSet<String>();
+ if (mvnproject != null) {
+ MavenProject mp = mvnproject.getMavenProject();
+ if (mp != null) {
+ Properties props = mp.getProperties();
+ if (props != null) {
+ for (Object key : props.keySet()) {
+ String keyString = key.toString();
+ if (("${" + keyString).startsWith(realExpressionPrefix)) { //$NON-NLS-1$
+ collect.add(keyString);
+ }
+ }
+ }
+ }
+ //add a few hardwired values as well
+ if ("${basedir}".startsWith(realExpressionPrefix)) { //$NON-NLS-1$
+ collect.add("basedir"); //$NON-NLS-1$
+ }
+ if ("${project.version}".startsWith(realExpressionPrefix)) { //$NON-NLS-1$
+ collect.add("project.version"); //$NON-NLS-1$
+ }
+ if ("${project.groupId}".startsWith(realExpressionPrefix)) { //$NON-NLS-1$
+ collect.add("project.groupId"); //$NON-NLS-1$
+ }
+ if ("${project.artifactId}".startsWith(realExpressionPrefix)) { //$NON-NLS-1$
+ collect.add("project.artifactId"); //$NON-NLS-1$
+ }
+ if ("${project.build.directory}".startsWith(realExpressionPrefix)) { //$NON-NLS-1$
+ collect.add("project.build.directory"); //$NON-NLS-1$
+ }
+ for (String key : collect) {
+ ICompletionProposal proposal = new InsertExpressionProposal(sourceViewer, region, key, mvnproject);
+ if(request.shouldSeparate()) {
+ request.addMacro(proposal);
+ } else {
+ request.addProposal(proposal);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private static List<PomTemplateContext> expressionproposalContexts = Arrays.asList(new PomTemplateContext[] {
+ PomTemplateContext.ARTIFACT_ID,
+ PomTemplateContext.CLASSIFIER,
+// PomTemplateContext.CONFIGURATION,
+ PomTemplateContext.GOAL,
+ PomTemplateContext.GROUP_ID,
+ PomTemplateContext.MODULE,
+ PomTemplateContext.PACKAGING,
+ PomTemplateContext.PHASE,
+ PomTemplateContext.PROPERTIES, //??
+ PomTemplateContext.SCOPE,
+ PomTemplateContext.SYSTEM_PATH,
+ PomTemplateContext.TYPE,
+// PomTemplateContext.VERSION, version is intentionally not included as we have specialized handling there..
+ PomTemplateContext.UNKNOWN //this one is both important and troubling.. but having a context for everything is weird.
+ });
+
+ private void addGenerateProposals(ContentAssistRequest request, PomTemplateContext context, Node node, String prefix) {
+ if (prefix.trim().length() != 0) {
+ //only provide these generate proposals when there is no prefix.
+ return;
+ }
+ if (context == PomTemplateContext.PROJECT) {
+ //check if we have a parent defined..
+ Node project = node;
+ if (project != null && project instanceof Element) {
+ Element parent = MavenMarkerManager.findChildElement((Element)project, "parent"); //$NON-NLS-1$
+ if (parent == null) {
+ //now add the proposal for parent inclusion
+ Region region = new Region(request.getReplacementBeginPosition(), 0);
+ Element groupId = MavenMarkerManager.findChildElement((Element)project, "groupId"); //$NON-NLS-1$
+ String groupString = null;
+ if (groupId != null) {
+ groupString = MavenMarkerManager.getElementTextValue(groupId);
+ }
+ InsertArtifactProposal.Configuration config = new InsertArtifactProposal.Configuration(InsertArtifactProposal.SearchType.PARENT);
+ config.setInitiaSearchString(groupString);
+ ICompletionProposal proposal = new InsertArtifactProposal(sourceViewer, region, config, this.textConfig);
+ if(request.shouldSeparate()) {
+ request.addMacro(proposal);
+ } else {
+ request.addProposal(proposal);
+ }
+ }
+ }
+ }
+ if (context == PomTemplateContext.PARENT && node.getNodeName().equals("parent")) { //$NON-NLS-1$
+ Element parent = (Element)node;
+ Element relPath = MavenMarkerManager.findChildElement(parent, "relativePath"); //$NON-NLS-1$
+ if (relPath == null) {
+ //only show when no relpath already defined..
+ String relative = findRelativePath(sourceViewer, parent);
+ if (relative != null) {
+ Region region = new Region(request.getReplacementBeginPosition(), 0);
+ ICompletionProposal proposal = new CompletionProposal("<relativePath>" + relative + "</relativePath>", //$NON-NLS-1$ //$NON-NLS-2$
+ region.getOffset(), region.getLength(), 0,
+ WorkbenchPlugin.getDefault().getImageRegistry().get(org.eclipse.ui.internal.SharedImages.IMG_OBJ_ADD),
+ NLS.bind(Messages.PomContentAssistProcessor_insert_relPath_title, relative), null, null);
+ if (request.shouldSeparate()) {
+ request.addMacro(proposal);
+ } else {
+ request.addProposal(proposal);
+ }
+ }
+ }
+ }
+ if (context == PomTemplateContext.RELATIVE_PATH) {
+ //completion in the text portion of relative path
+ Element parent = (Element) node.getParentNode();
+ if (parent != null && "parent".equals(parent.getNodeName())) { //$NON-NLS-1$
+ String relative = findRelativePath(sourceViewer, parent);
+ String textContent = MavenMarkerManager.getElementTextValue(node);
+ if (relative != null && !relative.equals(textContent)) {
+ Region region = new Region(request.getReplacementBeginPosition() - prefix.length(), prefix.length());
+ if (request.getNode() instanceof IndexedRegion && request.getNode() instanceof Text) {
+ //for <relativePath>|</relativePath> the current node is the element node and not the text node
+ //only replace the text node content..
+ IndexedRegion index = (IndexedRegion)request.getNode();
+ region = new Region(index.getStartOffset(), index.getEndOffset() - index.getStartOffset());
+ }
+ ICompletionProposal proposal = new CompletionProposal(relative,
+ region.getOffset(), region.getLength(), 0,
+ WorkbenchPlugin.getDefault().getImageRegistry().get(org.eclipse.ui.internal.SharedImages.IMG_OBJ_ADD),
+ NLS.bind(Messages.PomContentAssistProcessor_set_relPath_title, relative), null, null);
+ if (request.shouldSeparate()) {
+ request.addMacro(proposal);
+ } else {
+ request.addProposal(proposal);
+ }
+ }
+ }
+ }
+ if (context == PomTemplateContext.PLUGINS || context == PomTemplateContext.BUILD
+ || context == PomTemplateContext.PLUGIN_MANAGEMENT || context == PomTemplateContext.PROJECT) {
+ //now add the proposal for plugin inclusion
+ Region region = new Region(request.getReplacementBeginPosition(), 0);
+ InsertArtifactProposal.Configuration config = new InsertArtifactProposal.Configuration(InsertArtifactProposal.SearchType.PLUGIN);
+ config.setCurrentNode(node);
+
+ ICompletionProposal proposal = new InsertArtifactProposal(sourceViewer, region, config, this.textConfig);
+ if(request.shouldSeparate()) {
+ request.addMacro(proposal);
+ } else {
+ request.addProposal(proposal);
+ }
+
+ }
+
+ }
+ /*
+ * calculates the path of the node up in the hierarchy, example of result is project/build/plugins/plugin
+ * level parameter designates the number of parents to climb eg. for level 2 the result would be plugins/plugin
+ * level -1 means all the way to the top.
+ */
+ static String pathUp(Node node, int level) {
+ StringBuffer buf = new StringBuffer();
+ int current = level;
+ while (node != null && level > 0) {
+ if (node instanceof Element) {
+ if (buf.length() > 0) {
+ buf.insert(0, "/");
+ }
+ buf.insert(0, node.getNodeName());
+ current = current -1;
+ }
+ node = node.getParentNode();
+ }
+ return buf.toString();
+ }
+
+ private static String findRelativePath(ISourceViewer viewer, Element parent) {
+ String groupId = MavenMarkerManager.getElementTextValue(MavenMarkerManager.findChildElement(parent, "groupId")); //$NON-NLS-1$
+ String artifactId = MavenMarkerManager.getElementTextValue(MavenMarkerManager.findChildElement(parent, "artifactId")); //$NON-NLS-1$
+ String version = MavenMarkerManager.getElementTextValue(MavenMarkerManager.findChildElement(parent, "version")); //$NON-NLS-1$
+ return findRelativePath(viewer, groupId, artifactId, version);
+ }
+
+ public static String findRelativePath(ISourceViewer viewer, String groupId, String artifactId, String version) {
+ if (groupId != null && artifactId != null && version != null) {
+ IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectManager().getMavenProject(groupId, artifactId, version);
+ if (facade != null) {
+ //now add the proposal for relativePath
+ IFile parentPomFile = facade.getPom();
+ IPath path = parentPomFile.getLocation();
+ IProject prj = extractProject(viewer);
+ if (prj != null && path != null) {
+ IPath path2 = prj.getLocation();
+ IPath relative = path.makeRelativeTo(path2);
+ if (relative != path) {
+ return relative.toString();
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+
+
+ private void addProposals(ContentAssistRequest request, PomTemplateContext context, Node currentNode, String prefix) {
+ if(request != null) {
+ IProject prj = extractProject(sourceViewer);
+
+ ICompletionProposal[] templateProposals = getTemplateProposals(prj, sourceViewer,
+ request.getReplacementBeginPosition(), context.getContextTypeId(), currentNode, prefix);
+ for(ICompletionProposal proposal : templateProposals) {
+ if(request.shouldSeparate()) {
+ request.addMacro(proposal);
+ } else {
+ request.addProposal(proposal);
+ }
+ }
+ }
+ }
+
+ /**
+ * what is this method supposed to do? for the sourceViewer find the associated file on disk and for
+ * that one find the IProject it belongs to. The required condition for the IProject instance is that
+ * project relative path of the file shall only be pom.xml (thus no nested, unopened maven pom).
+ * So that when MavenPlugin.getDefault().getMavenProjectManager().getProject(prj); is called later on
+ * the instance, it actually returns the maven model facade for the pom.xml backing the sourceViewer.
+ * @param sourceViewer
+ * @return
+ */
+ public static IProject extractProject(ITextViewer sourceViewer) {
+ ITextFileBuffer buf = FileBuffers.getTextFileBufferManager().getTextFileBuffer(sourceViewer.getDocument());
+ IFileStore folder = buf.getFileStore();
+ File file = new File(folder.toURI());
+ IPath path = Path.fromOSString(file.getAbsolutePath());
+ Stack<IResource> stack = new Stack<IResource>();
+ //here we need to find the most inner project to the path.
+ //we do so by shortening the path and remembering all the resources identified.
+ // at the end we pick the last one from the stack. is there a catch to it?
+ IResource ifile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
+ if (ifile != null) {
+ stack.push(ifile);
+ } else {
+ while(path.segmentCount() > 1) {
+ ResourcesPlugin.getWorkspace().getRoot().findMember(path);
+ if(ifile != null) {
+ stack.push(ifile);
+ }
+ path = path.removeFirstSegments(1);
+ }
+ }
+ IResource res = stack.empty() ? null : stack.pop();
+ if (res != null) {
+ IProject prj = res.getProject();
+ //the project returned is in a way unrelated to nested child poms that don't have an opened project,
+ //in that case we pass along a wrong parent/aggregator
+ if (res.getProjectRelativePath().segmentCount() != 1) {
+ //if the project were the pom's project, the relative path would be just "pom.xml", if it's not just throw it out of the window..
+ prj = null;
+ }
+ return prj;
+ }
+ return null;
+ }
+
+ private ICompletionProposal[] getTemplateProposals(IProject project, ITextViewer viewer, int offset, String contextTypeId, Node currentNode, String prefix) {
+ ITextSelection selection = (ITextSelection) viewer.getSelectionProvider().getSelection();
+
+ // adjust offset to end of normalized selection
+ if(selection.getOffset() == offset) {
+ offset = selection.getOffset() + selection.getLength();
+ }
+
+// String prefix = extractPrefix(viewer, offset);
+ Region region = new Region(offset - prefix.length(), prefix.length());
+ TemplateContext context = createContext(viewer, region, contextTypeId);
+ if(context == null) {
+ return new ICompletionProposal[0];
+ }
+
+ // name of the selection variables {line, word}_selection
+ context.setVariable("selection", selection.getText()); //$NON-NLS-1$
+
+ PomTemplateContext templateContext = PomTemplateContext.fromId(contextTypeId);
+
+ // add the user defined templates - separate them from the rest of the templates
+ // so that we know what they are and can assign proper icon to them.
+ Image image = MvnImages.IMG_USER_TEMPLATE;
+ List<TemplateProposal> matches = new ArrayList<TemplateProposal>();
+ TemplateStore store = MvnIndexPlugin.getDefault().getTemplateStore();
+ if(store != null) {
+ Template[] templates = store.getTemplates(contextTypeId);
+ for(Template template : templates) {
+ TemplateProposal proposal = createProposalForTemplate(prefix, region, context, image, template, true);
+ if (proposal != null) {
+ matches.add(proposal);
+ }
+ }
+ }
+ if (templateContext == PomTemplateContext.CONFIGURATION) {
+ image = MvnImages.IMG_PARAMETER;
+ } else {
+ //other suggestions from the templatecontext are to be text inside the element, not actual
+ //elements..
+ image = null;
+ }
+
+ Template[] templates = templateContext.getTemplates(project, currentNode, prefix);
+ for(Template template : templates) {
+ TemplateProposal proposal = createProposalForTemplate(prefix, region, context, image, template, false);
+ if (proposal != null) {
+ matches.add(proposal);
+ }
+ }
+
+
+ if (templateContext!=PomTemplateContext.VERSION) {
+ // versions are already sorted with o.a.m.artifact.versioning.ComparableVersion
+ Collections.sort(matches, PROPOSAL_COMPARATOR);
+ }
+
+ return (ICompletionProposal[]) matches.toArray(new ICompletionProposal[matches.size()]);
+
+ }
+
+ private TemplateProposal createProposalForTemplate(String prefix, Region region, TemplateContext context, Image image,
+ final Template template, boolean isUserTemplate) {
+ try {
+ context.getContextType().validate(template.getPattern());
+ if(template.matches(prefix, context.getContextType().getId())) {
+ if (isUserTemplate) {
+ //for templates defined by users, preserve the default behaviour..
+ return new TemplateProposal(template, context, region, image, getRelevance(template, prefix)) {
+ public String getAdditionalProposalInfo() {
+ return StringUtils.convertToHTMLContent(super.getAdditionalProposalInfo());
+ }
+ };
+ } else {
+ return new TemplateProposal(template, context, region, image, getRelevance(template, prefix)) {
+ public String getAdditionalProposalInfo() {
+ return getTemplate().getDescription();
+ }
+
+ public String getDisplayString() {
+ return template.getName();
+ }
+ };
+ }
+ }
+ } catch(TemplateException e) {
+ // ignore
+ }
+
+ return null;
+ }
+
+ protected TemplateContext createContext(ITextViewer viewer, IRegion region, String contextTypeId) {
+ TemplateContextType contextType= getContextType(viewer, region, contextTypeId);
+ if (contextType != null) {
+ IDocument document= viewer.getDocument();
+ return new DocumentTemplateContext(contextType, document, region.getOffset(), region.getLength());
+ }
+ return null;
+ }
+
+ //TODO we should have different relevance for user defined templates and generated proposals..
+ protected int getRelevance(Template template, String prefix) {
+ if (template.getName().startsWith(prefix))
+ return 90;
+ return 0;
+ }
+
+ protected TemplateContextType getContextType(ITextViewer viewer, IRegion region, String contextTypeId) {
+ ContextTypeRegistry registry = MvnIndexPlugin.getDefault().getTemplateContextRegistry();
+ if(registry != null) {
+ return registry.getContextType(contextTypeId);
+ }
+ return null;
+ }
+
+ public static final String extractPrefix(ITextViewer viewer, int offset) {
+ int i = offset;
+ IDocument document = viewer.getDocument();
+ if(i > document.getLength()) {
+ return ""; //$NON-NLS-1$
+ }
+
+ try {
+ while(i > 0) {
+ char ch = document.getChar(i - 1);
+ if(ch == '>' || ch == '<' || ch == ' ' || ch == '\n' || ch == '\t') {
+ break;
+ }
+ i-- ;
+ }
+ return document.get(i, offset - i);
+ } catch(BadLocationException e) {
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+
+ static final class ProposalComparator implements Comparator<TemplateProposal> {
+ public int compare(TemplateProposal o1, TemplateProposal o2) {
+ int res = o2.getRelevance() - o1.getRelevance();
+ if(res == 0) {
+ res = o1.getDisplayString().compareTo(o2.getDisplayString());
+ }
+ return res;
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentOutlineConfiguration.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentOutlineConfiguration.java
new file mode 100644
index 00000000..60b4b27a
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomContentOutlineConfiguration.java
@@ -0,0 +1,358 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class PomContentOutlineConfiguration extends XMLContentOutlineConfiguration {
+
+ public ILabelProvider getLabelProvider(TreeViewer viewer) {
+ return new PomLabelProvider(super.getLabelProvider(viewer));
+ }
+
+ /**
+ * POM label provider
+ */
+ private final class PomLabelProvider implements ILabelProvider {
+
+ private static final String TARGET_PATH = "targetPath"; //$NON-NLS-1$
+
+ private static final String DIRECTORY = "directory"; //$NON-NLS-1$
+
+ private static final String REPORT_SET = "reportSet"; //$NON-NLS-1$
+
+ private static final String PROPERTIES = "properties"; //$NON-NLS-1$
+
+ private static final String REPORTING = "reporting"; //$NON-NLS-1$
+
+ private static final String BUILD = "build"; //$NON-NLS-1$
+
+ private static final String EXCLUDE = "exclude"; //$NON-NLS-1$
+
+ private static final String INCLUDE = "include"; //$NON-NLS-1$
+
+ private static final String FILTER = "filter"; //$NON-NLS-1$
+
+ private static final String TEST_RESOURCE = "testResource"; //$NON-NLS-1$
+
+ private static final String RESOURCE = "resource"; //$NON-NLS-1$
+
+ private static final String TEST_RESOURCES = "testResources"; //$NON-NLS-1$
+
+ private static final String RESOURCES = "resources"; //$NON-NLS-1$
+
+ private static final String GOAL = "goal"; //$NON-NLS-1$
+
+ private static final String EXECUTION = "execution"; //$NON-NLS-1$
+
+ private static final String PLUGIN = "plugin"; //$NON-NLS-1$
+
+ private static final String PLUGINS = "plugins"; //$NON-NLS-1$
+
+ private static final String SNAPSHOT_REPOSITORY = "snapshotRepository"; //$NON-NLS-1$
+
+ private static final String PLUGIN_REPOSITORY = "pluginRepository"; //$NON-NLS-1$
+
+ private static final String REPOSITORY = "repository"; //$NON-NLS-1$
+
+ private static final String SITE = "site"; //$NON-NLS-1$
+
+ private static final String CONTRIBUTOR = "contributor"; //$NON-NLS-1$
+
+ private static final String DEVELOPER = "developer"; //$NON-NLS-1$
+
+ private static final String PROFILE = "profile"; //$NON-NLS-1$
+
+ private static final String PROFILES = "profiles"; //$NON-NLS-1$
+
+ private static final String MODULE = "module"; //$NON-NLS-1$
+
+ private static final String EXTENSION = "extension"; //$NON-NLS-1$
+
+ private static final String EXCLUSION = "exclusion"; //$NON-NLS-1$
+
+ private static final String MODULES = "modules"; //$NON-NLS-1$
+
+ private static final String EXTENSIONS = "extensions"; //$NON-NLS-1$
+
+ private static final String EXCLUSIONS = "exclusions"; //$NON-NLS-1$
+
+ private static final String DEPENDENCIES = "dependencies"; //$NON-NLS-1$
+
+ private static final String PARENT = "parent"; //$NON-NLS-1$
+
+ private static final String SCOPE = "scope"; //$NON-NLS-1$
+
+ private static final String TYPE = "type"; //$NON-NLS-1$
+
+ private static final String CLASSIFIER = "classifier"; //$NON-NLS-1$
+
+ private static final String DEPENDENCY = "dependency"; //$NON-NLS-1$
+
+ private static final String ID = "id"; //$NON-NLS-1$
+
+ private static final String EMAIL = "email"; //$NON-NLS-1$
+
+ private static final String NAME = "name"; //$NON-NLS-1$
+
+ private static final String VERSION = "version"; //$NON-NLS-1$
+
+ private static final String GROUP_ID = "groupId"; //$NON-NLS-1$
+
+ private static final String ARTIFACT_ID = "artifactId"; //$NON-NLS-1$
+
+ private static final String NAMESPACE_POM = "http://maven.apache.org/POM/4.0.0"; //$NON-NLS-1$
+
+ private static final int MAX_LABEL_LENGTH = 120;
+
+ private final ILabelProvider labelProvider;
+
+ private PomLabelProvider(ILabelProvider labelProvider) {
+ this.labelProvider = labelProvider;
+ }
+
+ public Image getImage(Object element) {
+ Node node = (Node) element;
+ String namespace = node.getNamespaceURI();
+ String nodeName = node.getNodeName();
+
+ if(node.getNodeType()==Node.COMMENT_NODE) {
+ return labelProvider.getImage(element);
+ }
+
+ if(NAMESPACE_POM.equals(namespace)) {
+ if(PARENT.equals(nodeName)) {
+ return MvnImages.IMG_JAR;
+
+ } else if(DEPENDENCIES.equals(nodeName) //
+ || EXCLUSIONS.equals(nodeName) //
+ || EXTENSIONS.equals(nodeName) //
+ || MODULES.equals(nodeName)) {
+ return MvnImages.IMG_JARS;
+
+ } else if(DEPENDENCY.equals(nodeName) //
+ || EXCLUSION.equals(nodeName) //
+ || EXTENSION.equals(nodeName) //
+ || MODULE.equals(nodeName)) {
+ // TODO show folder if module is in the workspace
+ return MvnImages.IMG_JAR;
+
+ } else if(REPOSITORY.equals(nodeName) || PLUGIN_REPOSITORY.equals(nodeName)
+ || SNAPSHOT_REPOSITORY.equals(nodeName) || SITE.equals(nodeName)) {
+ return MvnImages.IMG_REPOSITORY;
+
+ } else if(PROFILES.equals(nodeName)) {
+ return MvnImages.IMG_PROFILES;
+
+ } else if(PROFILE.equals(nodeName)) {
+ return MvnImages.IMG_PROFILE;
+
+ } else if(DEVELOPER.equals(nodeName) || CONTRIBUTOR.equals(nodeName)) {
+ return MvnImages.IMG_PERSON;
+
+ } else if(PLUGINS.equals(nodeName)) {
+ return MvnImages.IMG_PLUGINS;
+
+ } else if(PLUGIN.equals(nodeName)) {
+ return MvnImages.IMG_PLUGIN;
+
+ } else if(EXECUTION.equals(nodeName)) {
+ return MvnImages.IMG_EXECUTION;
+
+ } else if(GOAL.equals(nodeName)) {
+ return MvnImages.IMG_GOAL;
+
+ } else if(RESOURCES.equals(nodeName) //
+ || TEST_RESOURCES.equals(nodeName)) {
+ return MvnImages.IMG_RESOURCES;
+
+ } else if(RESOURCE.equals(nodeName) //
+ || TEST_RESOURCE.equals(nodeName)) {
+ return MvnImages.IMG_RESOURCE;
+
+ } else if(FILTER.equals(nodeName)) {
+ return MvnImages.IMG_FILTER;
+
+ } else if(INCLUDE.equals(nodeName)) {
+ return MvnImages.IMG_INCLUDE;
+
+ } else if(EXCLUDE.equals(nodeName)) {
+ return MvnImages.IMG_EXCLUDE;
+
+ } else if(BUILD.equals(nodeName)) {
+ return MvnImages.IMG_BUILD;
+
+ } else if(REPORTING.equals(nodeName)) {
+ return MvnImages.IMG_REPORT;
+
+ } else if(PROPERTIES.equals(nodeName)) {
+ return MvnImages.IMG_PROPERTIES;
+
+ } else if(PROPERTIES.equals(node.getParentNode().getNodeName())) {
+ return MvnImages.IMG_PROPERTY;
+
+ // } else if("mailingList".equals(nodeName)) {
+ // return MvnImages.IMG_MAIL;
+
+ }
+
+ return MvnImages.IMG_ELEMENT;
+ }
+
+ return labelProvider.getImage(element);
+ }
+
+ public String getText(Object element) {
+ String text = labelProvider.getText(element);
+
+ Node node = (Node) element;
+ String namespace = node.getNamespaceURI();
+ String nodeName = node.getNodeName();
+
+ if(node.getNodeType()==Node.COMMENT_NODE) {
+ return cleanText(node);
+ }
+
+ if(NAMESPACE_POM.equals(namespace)) {
+ if(PARENT.equals(nodeName)) {
+ return getLabel(text, node, GROUP_ID, ARTIFACT_ID, VERSION);
+
+ } else if(DEPENDENCY.equals(nodeName)) {
+ return getLabel(text, node, GROUP_ID, ARTIFACT_ID, VERSION, CLASSIFIER, TYPE, SCOPE);
+
+ } else if(EXCLUSION.equals(nodeName)) {
+ return getLabel(text, node, GROUP_ID, ARTIFACT_ID);
+
+ } else if(EXTENSION.equals(nodeName)) {
+ return getLabel(text, node, GROUP_ID, ARTIFACT_ID, VERSION);
+
+ } else if(REPOSITORY.equals(nodeName) || PLUGIN_REPOSITORY.equals(nodeName)
+ || SNAPSHOT_REPOSITORY.equals(nodeName) || SITE.equals(nodeName) || PROFILE.equals(nodeName)
+ || EXECUTION.equals(nodeName)) {
+ return getLabel(text, node, ID);
+
+ } else if("mailingList".equals(nodeName)) { //$NON-NLS-1$
+ return getLabel(text, node, NAME);
+
+ } else if(DEVELOPER.equals(nodeName)) {
+ return getLabel(text, node, ID, NAME, EMAIL);
+
+ } else if(CONTRIBUTOR.equals(nodeName)) {
+ return getLabel(text, node, NAME, EMAIL);
+
+ } else if(PLUGIN.equals(nodeName)) {
+ return getLabel(text, node, GROUP_ID, ARTIFACT_ID, VERSION);
+
+ } else if(RESOURCE.equals(nodeName) || TEST_RESOURCE.equals(nodeName)) {
+ return getLabel(text, node, DIRECTORY, TARGET_PATH);
+
+ } else if(REPORT_SET.equals(nodeName)) {
+ return getLabel(text, node, ID);
+
+ } else if(EXECUTION.equals(nodeName)) {
+ return getLabel(text, node, ID);
+
+ }
+
+ NodeList childNodes = node.getChildNodes();
+ if(childNodes.getLength()==1) {
+ Node item = childNodes.item(0);
+ short nodeType = item.getNodeType();
+ if(nodeType==Node.TEXT_NODE || nodeType==Node.COMMENT_NODE) {
+ String nodeText = item.getNodeValue();
+ if(nodeText.length()>0) {
+ return text + " " + cleanText(item); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ return text;
+ }
+
+ public boolean isLabelProperty(Object element, String name) {
+ return labelProvider.isLabelProperty(element, name);
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ labelProvider.addListener(listener);
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ labelProvider.removeListener(listener);
+ }
+
+ public void dispose() {
+ labelProvider.dispose();
+ }
+
+ private String getLabel(String text, Node node, String... names) {
+ StringBuilder sb = new StringBuilder(text).append(" "); //$NON-NLS-1$
+ String sep = ""; //$NON-NLS-1$
+ for(String name : names) {
+ String value = getValue(node, name);
+ if(value!=null) {
+ sb.append(sep).append(value);
+ sep = " : "; //$NON-NLS-1$
+ }
+ }
+
+ return sb.toString();
+ }
+
+ private String getValue(Node node, String name) {
+ NodeList childNodes = node.getChildNodes();
+ for(int i = 0; i < childNodes.getLength(); i++ ) {
+ Node item = childNodes.item(i);
+ if(item.getNodeType()==Node.ELEMENT_NODE && name.equals(item.getNodeName())) {
+ NodeList nodes = item.getChildNodes();
+ if(nodes.getLength()==1) {
+ String value = nodes.item(0).getNodeValue().trim();
+ if(value.length()>0) {
+ return value;
+ }
+ }
+ return null;
+ }
+ }
+ return null;
+ }
+
+ private String cleanText(Node node) {
+ String value = node.getNodeValue();
+ if (value==null) {
+ return ""; //$NON-NLS-1$
+ }
+
+ value = value.replaceAll("\\s", " ").replaceAll("(\\s){2,}", " ").trim(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ if (value.length() > MAX_LABEL_LENGTH) {
+ value = value.substring(0, 120) + Dialog.ELLIPSIS;
+ }
+
+ return value;
+ }
+ }
+
+}
+
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java
new file mode 100644
index 00000000..25c71c7c
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomHyperlinkDetector.java
@@ -0,0 +1,729 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.model.Build;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.DependencyManagement;
+import org.apache.maven.model.InputLocation;
+import org.apache.maven.model.InputSource;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.PluginManagement;
+import org.apache.maven.project.MavenProject;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.filebuffers.ITextFileBuffer;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.editor.xml.internal.Messages;
+
+
+/**
+ * @author Eugene Kuleshov
+ * @author Milos Kleint
+ */
+public class PomHyperlinkDetector implements IHyperlinkDetector {
+
+ private final String[] versioned = new String[] {
+ "dependency>", //$NON-NLS-1$
+ "parent>", //$NON-NLS-1$
+ "plugin>", //$NON-NLS-1$
+ "reportPlugin>", //$NON-NLS-1$
+ "extension>" //$NON-NLS-1$
+ };
+ public IHyperlink[] detectHyperlinks(ITextViewer textViewer, final IRegion region, boolean canShowMultipleHyperlinks) {
+ if(region == null || textViewer == null) {
+ return null;
+ }
+
+ IDocument document = textViewer.getDocument();
+ if(document == null) {
+ return null;
+ }
+
+ IRegion lineInfo;
+ String line;
+ try {
+ lineInfo = document.getLineInformationOfOffset(region.getOffset());
+ line = document.get(lineInfo.getOffset(), lineInfo.getLength());
+ } catch(BadLocationException ex) {
+ return null;
+ }
+
+ if(line.length() == 0) {
+ return null;
+ }
+ List<IHyperlink> hyperlinks = new ArrayList<IHyperlink>();
+ final int offset = region.getOffset();
+ final String text = document.get();
+ Node current = getCurrentNode(document, offset);
+ //check if we have a property expression at cursor
+ IHyperlink link = openPropertyDefinition(current, textViewer, offset);
+ if (link != null) {
+ hyperlinks.add(link);
+ }
+ //now check if the dependency/plugin has a version element or not, if not, try searching for it in DM/PM of effective pom
+ link = openDPManagement(current, textViewer, offset);
+ if (link != null) {
+ hyperlinks.add(link);
+ }
+
+ //first check all elements that have id (groupId+artifactId+version) combo
+ Fragment fragment = null;
+ //TODO rewrite to use Nodes
+ for (String el : versioned) {
+ fragment = getFragment(text, offset, "<" + el, "</" + el); //$NON-NLS-1$ //$NON-NLS-2$
+ if (fragment != null) break;
+ }
+
+ if (fragment != null) {
+ link = openPOMbyID(fragment, textViewer);
+ if (link != null) {
+ hyperlinks.add(link);
+ }
+ }
+ //check if <module> text is selected.
+ //TODO rewrite to use Nodes
+ fragment = getFragment(text, offset, "<module>", "</module>"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (fragment != null) {
+ link = openModule(fragment, textViewer);
+ if (link != null) {
+ hyperlinks.add(link);
+ }
+ }
+ if (hyperlinks.size() > 0) {
+ return hyperlinks.toArray(new IHyperlink[0]);
+ }
+ return null;
+ }
+
+ static ManagedArtifactRegion findManagedArtifactRegion(Node current, ITextViewer textViewer, int offset) {
+ while (current != null && !( current instanceof Element)) {
+ current = current.getParentNode();
+ }
+ if (current != null) {
+ Node artNode = null;
+ Node groupNode = null;
+ if ("artifactId".equals(current.getNodeName())) { //$NON-NLS-1$
+ artNode = current;
+ }
+ if ("groupId".equals(current.getNodeName())) { //$NON-NLS-1$
+ groupNode = current;
+ }
+ //only on artifactid and groupid elements..
+ if (artNode == null && groupNode == null) {
+ return null;
+ }
+ Node root = current.getParentNode();
+ boolean isDependency = false;
+ boolean isPlugin = false;
+ if (root != null) {
+ String name = root.getNodeName();
+ if ("dependency".equals(name)) { //$NON-NLS-1$
+ isDependency = true;
+ }
+ if ("plugin".equals(name)) { //$NON-NLS-1$
+ isPlugin = true;
+ }
+ } else {
+ return null;
+ }
+ if (!isDependency && !isPlugin) {
+ //some kind of other identifier
+ return null;
+ }
+ //now see if version is missing
+ NodeList childs = root.getChildNodes();
+ for (int i = 0; i < childs.getLength(); i++) {
+ Node child = childs.item(i);
+ if (child instanceof Element) {
+ Element el = (Element) child;
+ if ("version".equals(el.getNodeName())) { //$NON-NLS-1$
+ return null;
+ }
+ if (artNode == null && "artifactId".equals(el.getNodeName())) { //$NON-NLS-1$
+ artNode = el;
+ }
+ if (groupNode == null && "groupId".equals(el.getNodeName())) { //$NON-NLS-1$
+ groupNode = el;
+ }
+ }
+ }
+ if (groupNode != null && artNode != null) {
+ assert groupNode instanceof IndexedRegion;
+ assert artNode instanceof IndexedRegion;
+
+ IndexedRegion groupReg = (IndexedRegion)groupNode;
+ IndexedRegion artReg = (IndexedRegion)artNode;
+ int startOffset = Math.min(groupReg.getStartOffset(), artReg.getStartOffset());
+ int length = Math.max(groupReg.getEndOffset(), artReg.getEndOffset()) - startOffset;
+ String groupId = getElementTextValue(groupNode);
+ String artifactId = getElementTextValue(artNode);
+ //TODO we shall rely on presence of a cached model, not project alone..
+ final IProject prj = PomContentAssistProcessor.extractProject(textViewer);
+ if (prj != null) {
+ //now we can create the region I guess,
+ return new ManagedArtifactRegion(startOffset, length, groupId, artifactId, isDependency, isPlugin, prj);
+ }
+ }
+ }
+ return null;
+ }
+
+ private IHyperlink openDPManagement(Node current, ITextViewer textViewer, int offset) {
+ final ManagedArtifactRegion region = findManagedArtifactRegion(current, textViewer, offset);
+ if (region != null) {
+ return new IHyperlink() {
+ public IRegion getHyperlinkRegion() {
+ return region;
+ }
+
+ public String getHyperlinkText() {
+ return NLS.bind(Messages.PomHyperlinkDetector_link_managed, "" + region.groupId + ":" + region.artifactId);
+ }
+
+ public String getTypeLabel() {
+ return "pom-dependency-plugin-management"; //$NON-NLS-1$
+ }
+
+ public void open() {
+ //see if we can find the plugin in plugin management of resolved project.
+ IMavenProjectFacade mvnproject = MavenPlugin.getDefault().getMavenProjectManager().getProject(region.project);
+ if (mvnproject != null) {
+ MavenProject mavprj = mvnproject.getMavenProject();
+ if (mavprj != null) {
+ InputLocation openLocation = findLocationForManagedArtifact(region, mavprj);
+ if (openLocation != null) {
+ File file = fileForInputLocation(openLocation);
+ if (file != null) {
+ IFileStore fileStore = EFS.getLocalFileSystem().getStore(file.toURI());
+ openXmlEditor(fileStore, openLocation.getLineNumber(), openLocation.getColumnNumber());
+ }
+ }
+ }
+ }
+ }
+ };
+ }
+ return null;
+ }
+
+
+ static InputLocation findLocationForManagedArtifact(final ManagedArtifactRegion region, MavenProject mavprj) {
+ Model mdl = mavprj.getModel();
+ InputLocation openLocation = null;
+ if (region.isDependency) {
+ DependencyManagement dm = mdl.getDependencyManagement();
+ if (dm != null) {
+ List<Dependency> list = dm.getDependencies();
+ String id = region.groupId + ":" + region.artifactId + ":"; //$NON-NLS-1$ //$NON-NLS-2$
+ if (list != null) {
+ for (Dependency dep : list) {
+ if (dep.getManagementKey().startsWith(id)) {
+ InputLocation location = dep.getLocation("artifactId"); //$NON-NLS-1$
+ //when would this be null?
+ if (location != null) {
+ openLocation = location;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (region.isPlugin) {
+ Build build = mdl.getBuild();
+ if (build != null) {
+ PluginManagement pm = build.getPluginManagement();
+ if (pm != null) {
+ List<Plugin> list = pm.getPlugins();
+ String id = Plugin.constructKey(region.groupId, region.artifactId);
+ if (list != null) {
+ for (Plugin plg : list) {
+ if (id.equals(plg.getKey())) {
+ InputLocation location = plg.getLocation("artifactId"); //$NON-NLS-1$
+ //when would this be null?
+ if (location != null) {
+ openLocation = location;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return openLocation;
+ }
+
+ static String getElementTextValue(Node element) {
+ if (element == null) return null;
+ StringBuffer buff = new StringBuffer();
+ NodeList list = element.getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node child = list.item(i);
+ if (child instanceof Text) {
+ Text text = (Text)child;
+ buff.append(text.getData());
+ }
+ }
+ return buff.toString();
+ }
+
+ static ExpressionRegion findExpressionRegion(Node current, ITextViewer viewer, int offset) {
+ if (current != null && current instanceof Text) {
+ Text node = (Text)current;
+ String value = node.getNodeValue();
+ if (value != null) {
+ assert node instanceof IndexedRegion;
+ IndexedRegion reg = (IndexedRegion)node;
+ int index = offset - reg.getStartOffset();
+ String before = value.substring(0, Math.min (index + 1, value.length()));
+ String after = value.substring(Math.min (index + 1, value.length()));
+ int start = before.lastIndexOf("${"); //$NON-NLS-1$
+ if (before.lastIndexOf("}") > start) {//$NON-NLS-1$
+ //we might be in between two expressions..
+ start = -1;
+ }
+ int end = after.indexOf("}"); //$NON-NLS-1$
+ if (after.indexOf("${") != -1 && after.indexOf("${") < end) {//$NON-NLS-1$
+ //we might be in between two expressions..
+ end = -1;
+ }
+ if (start > -1 && end > -1) {
+ final int startOffset = reg.getStartOffset() + start;
+ final String expr = before.substring(start) + after.substring(0, end + 1);
+ final int length = expr.length();
+ final String prop = before.substring(start + 2) + after.substring(0, end);
+// there are often properties that start with project. eg. project.build.sourceEncoding
+// if (prop.startsWith("project.") || prop.startsWith("pom.")) { //$NON-NLS-1$ //$NON-NLS-2$
+// return null; //ignore these, not in properties section.
+// }
+ final IProject prj = PomContentAssistProcessor.extractProject(viewer);
+ //TODO we shall rely on presence of a cached model, not project alone.. ]MNGECLIPSE-2540
+ if (prj != null) {
+ return new ExpressionRegion(startOffset, length, prop, prj);
+ }
+ }
+ }
+ }
+ return null;
+ }
+ /**
+ * converts an InputLocation to a file path on the local disk, null if not available.
+ * still the input source's model value can be used further..
+ * @param location
+ * @return
+ */
+ static File fileForInputLocation(InputLocation location) {
+ InputSource source = location.getSource();
+ if (source != null) {
+ //MNGECLIPSE-2539 apparently if maven can't resolve the model from local storage,
+ //the location will be empty. not only applicable to local repo models but
+ //apparently also to models in workspace not reachable by relativePath
+ String loc = source.getLocation();
+ File file = null;
+ if (loc != null) {
+ file = new File(loc);
+ } else {
+ //try to find pom by coordinates..
+ String modelId = source.getModelId();
+ String[] splitStrings = modelId.split(":");
+ assert splitStrings.length == 3;
+ IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectManager().getMavenProject(splitStrings[0], splitStrings[1], splitStrings[2]);
+ if (facade != null) {
+ file = facade.getPomFile();
+ }
+ }
+ return file;
+ }
+ return null;
+ }
+
+
+ private IHyperlink openPropertyDefinition(Node current, ITextViewer viewer, int offset) {
+ final ExpressionRegion region = findExpressionRegion(current, viewer, offset);
+ if (region != null) {
+ return new IHyperlink() {
+ public IRegion getHyperlinkRegion() {
+ return region;
+ }
+
+ public String getHyperlinkText() {
+ return NLS.bind(Messages.PomHyperlinkDetector_open_property, region.property);
+ }
+
+ public String getTypeLabel() {
+ return "pom-property-expression"; //$NON-NLS-1$
+ }
+
+ public void open() {
+ //see if we can find the plugin in plugin management of resolved project.
+ IMavenProjectFacade mvnproject = MavenPlugin.getDefault().getMavenProjectManager().getProject(region.project);
+ if(mvnproject != null) {
+ MavenProject mavprj = mvnproject.getMavenProject();
+ if(mavprj != null) {
+ Model mdl = mavprj.getModel();
+ if (mdl.getProperties().containsKey(region.property)) {
+ InputLocation location = mdl.getLocation( "properties" ).getLocation( region.property ); //$NON-NLS-1$
+ if (location != null) {
+ File file = fileForInputLocation(location);
+ if (file != null) {
+ IFileStore fileStore = EFS.getLocalFileSystem().getStore(file.toURI());
+ openXmlEditor(fileStore, location.getLineNumber(), location.getColumnNumber());
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+ }
+ return null;
+ }
+
+ private IHyperlink openModule(Fragment fragment, ITextViewer textViewer) {
+ final Fragment module = getValue(fragment, "<module>", "</module>"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ ITextFileBuffer buf = FileBuffers.getTextFileBufferManager().getTextFileBuffer(textViewer.getDocument());
+ IFileStore folder = buf.getFileStore().getParent();
+
+ String path = module.text;
+ //construct IPath for the child pom file, handle relative paths..
+ while(folder != null && path.startsWith("../")) { //NOI18N //$NON-NLS-1$
+ folder = folder.getParent();
+ path = path.substring("../".length());//NOI18N //$NON-NLS-1$
+ }
+ if(folder == null) {
+ return null;
+ }
+ IFileStore modulePom = folder.getChild(path);
+ if(!modulePom.getName().endsWith("xml")) {//NOI18N //$NON-NLS-1$
+ modulePom = modulePom.getChild("pom.xml");//NOI18N //$NON-NLS-1$
+ }
+ final IFileStore fileStore = modulePom;
+ if (!fileStore.fetchInfo().exists()) {
+ return null;
+ }
+
+ IHyperlink pomHyperlink = new IHyperlink() {
+ public IRegion getHyperlinkRegion() {
+ return new Region(module.offset, module.length);
+ }
+
+ public String getHyperlinkText() {
+ return NLS.bind(Messages.PomHyperlinkDetector_open_module, module.text);
+ }
+
+ public String getTypeLabel() {
+ return "pom-module"; //$NON-NLS-1$
+ }
+
+ public void open() {
+ openXmlEditor(fileStore);
+ }
+ };
+
+ return pomHyperlink;
+
+ }
+
+ private IHyperlink openPOMbyID(Fragment fragment, final ITextViewer viewer) {
+ final Fragment groupId = getValue(fragment, "<groupId>", "</groupId>"); //$NON-NLS-1$ //$NON-NLS-2$
+ final Fragment artifactId = getValue(fragment, "<artifactId>", Messages.PomHyperlinkDetector_23); //$NON-NLS-1$
+ final Fragment version = getValue(fragment, "<version>", "</version>"); //$NON-NLS-1$ //$NON-NLS-2$
+ final IProject prj = PomContentAssistProcessor.extractProject(viewer);
+
+ IHyperlink pomHyperlink = new IHyperlink() {
+ public IRegion getHyperlinkRegion() {
+ //the goal here is to have the groupid/artifactid/version combo underscored by the link.
+ //that will prevent underscoring big portions (like plugin config) underscored and
+ // will also handle cases like dependencies within plugins.
+ int max = groupId != null ? groupId.offset + groupId.length : Integer.MIN_VALUE;
+ int min = groupId != null ? groupId.offset : Integer.MAX_VALUE;
+ max = Math.max(max, artifactId != null ? artifactId.offset + artifactId.length : Integer.MIN_VALUE);
+ min = Math.min(min, artifactId != null ? artifactId.offset : Integer.MAX_VALUE);
+ max = Math.max(max, version != null ? version.offset + version.length : Integer.MIN_VALUE);
+ min = Math.min(min, version != null ? version.offset : Integer.MAX_VALUE);
+ return new Region(min, max - min);
+ }
+
+ public String getHyperlinkText() {
+ return NLS.bind(Messages.PomHyperlinkDetector_hyperlink_pattern, groupId, artifactId);
+ }
+
+ public String getTypeLabel() {
+ return "pom"; //$NON-NLS-1$
+ }
+
+ public void open() {
+ new Job(Messages.PomHyperlinkDetector_job_name) {
+ protected IStatus run(IProgressMonitor monitor) {
+ // TODO resolve groupId if groupId==null
+ String gridString = groupId == null ? "org.apache.maven.plugins" : groupId.text; //$NON-NLS-1$
+ String artidString = artifactId == null ? null : artifactId.text;
+ String versionString = version == null ? null : version.text;
+ if (prj != null && gridString != null && artidString != null && (version == null || version.text.contains("${"))) { //$NON-NLS-1$
+ try {
+ //TODO how do we decide here if the hyperlink is a dependency or a plugin
+ // hyperlink??
+ versionString = PomTemplateContext.extractVersion(prj, versionString, gridString, artidString, PomTemplateContext.EXTRACT_STRATEGY_DEPENDENCY);
+
+ } catch(CoreException e) {
+ versionString = null;
+ }
+ }
+ if (versionString == null) {
+ return Status.OK_STATUS;
+ }
+ OpenPomAction.openEditor(gridString,
+ artidString,
+ versionString, monitor);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+
+ };
+
+ return pomHyperlink;
+ }
+
+ /**
+ * fragment offset returned contains the xml elements
+ * while the text only includes the element text value
+ */
+ private Fragment getValue(Fragment section, String startTag, String endTag) {
+ int start = section.text.indexOf(startTag);
+ if(start == -1) {
+ return null;
+ }
+ int end = section.text.indexOf(endTag);
+ if(end == -1) {
+ return null;
+ }
+
+ return new Fragment(section.text.substring(start + startTag.length(), end).trim(), section.offset + start, end + endTag.length() - start);
+ }
+
+ /**
+ * returns the text, offset and length of the xml element. text includes the xml tags.
+ */
+ private Fragment getFragment(String text, int offset, String startTag, String endTag) {
+ int start = text.substring(0, offset).lastIndexOf(startTag);
+ if(start == -1) {
+ return null;
+ }
+
+ int end = text.indexOf(endTag, start);
+ if(end == -1 || end <= offset) {
+ return null;
+ }
+ end = end + endTag.length();
+ return new Fragment(text.substring(start, end), start, end - start);
+ }
+
+ private static class Fragment {
+ final int length;
+ final int offset;
+ final String text;
+
+ Fragment(String text, int start, int len) {
+ this.text = text;
+ this.offset = start;
+
+ this.length = len;
+
+ }
+
+ @Override
+ public String toString() {
+ return text;
+ }
+ }
+
+
+ /**
+ * copied from org.eclipse.wst.xml.ui.internal.hyperlink.XMLHyperlinkDetector
+ * Returns the node the cursor is currently on in the document. null if no
+ * node is selected
+ *
+ * returned value is also an instance of IndexedRegion
+ *
+ * @param offset
+ * @return Node either element, doctype, text, or null
+ */
+ static Node getCurrentNode(IDocument document, int offset) {
+ // get the current node at the offset (returns either: element,
+ // doctype, text)
+ IndexedRegion inode = null;
+ IStructuredModel sModel = null;
+ try {
+ sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+ if (sModel != null) {
+ inode = sModel.getIndexedRegion(offset);
+ if (inode == null) {
+ inode = sModel.getIndexedRegion(offset - 1);
+ }
+ }
+ }
+ finally {
+ if (sModel != null) {
+ sModel.releaseFromRead();
+ }
+ }
+
+ if (inode instanceof Node) {
+ return (Node) inode;
+ }
+ return null;
+ }
+
+ private void openXmlEditor(final IFileStore fileStore) {
+ openXmlEditor(fileStore, -1, -1);
+ }
+
+ private void openXmlEditor(final IFileStore fileStore, int line, int column) {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if(window != null) {
+ IWorkbenchPage page = window.getActivePage();
+ if(page != null) {
+ try {
+ IEditorPart part = IDE.openEditorOnFileStore(page, fileStore);
+ if(part instanceof FormEditor) {
+ FormEditor ed = (FormEditor) part;
+ ed.setActivePage(null); //null means source, always or just in the case of MavenPomEditor?
+ if(line != -1) {
+ if(ed.getActiveEditor() instanceof StructuredTextEditor) {
+ StructuredTextEditor structured = (StructuredTextEditor) ed.getActiveEditor();
+ // convert the line and Column numbers to an offset:
+ IDocument doc = structured.getTextViewer().getDocument();
+ if (doc instanceof IStructuredDocument) {
+ IStructuredDocument document = (IStructuredDocument) doc;
+ try {
+ int offset = document.getLineOffset(line - 1);
+ structured.selectAndReveal(offset + column - 1, 0);
+ } catch(BadLocationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ }
+ } catch(PartInitException e) {
+ MessageDialog.openInformation(
+ Display.getDefault().getActiveShell(), //
+ Messages.PomHyperlinkDetector_error_title,
+ NLS.bind(Messages.PomHyperlinkDetector_error_message, fileStore, e.toString()));
+
+ }
+ }
+ }
+ }
+
+
+ static class ExpressionRegion implements IRegion {
+
+ final String property;
+ private int length;
+ private int offset;
+ final IProject project;
+
+ public ExpressionRegion(int startOffset, int length, String prop, IProject project) {
+ this.offset = startOffset;
+ this.length = length;
+ this.property = prop;
+ this.project = project;
+ }
+
+ public int getLength() {
+ return length;
+ }
+
+ public int getOffset() {
+ return offset;
+ }
+ }
+
+ static class ManagedArtifactRegion implements IRegion {
+
+ private int length;
+ private int offset;
+ final IProject project;
+ final String groupId;
+ final String artifactId;
+ final boolean isPlugin;
+ final boolean isDependency;
+
+ public ManagedArtifactRegion(int startOffset, int length, String groupId, String artifactId, boolean isDependency, boolean isPlugin, IProject project) {
+ this.offset = startOffset;
+ this.length = length;
+ this.project = project;
+ this.artifactId = artifactId;
+ this.groupId = groupId;
+ this.isDependency = isDependency;
+ this.isPlugin = isPlugin;
+ }
+
+ public int getLength() {
+ return length;
+ }
+
+ public int getOffset() {
+ return offset;
+ }
+ }
+
+
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomModelHandler.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomModelHandler.java
new file mode 100644
index 00000000..cd68f514
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomModelHandler.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.w3c.dom.Element;
+
+import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
+import org.eclipse.wst.sse.core.internal.provisional.IModelLoader;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDocument;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.CMDocumentManager;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.ModelQueryImpl;
+import org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache;
+import org.eclipse.wst.xml.core.internal.contentmodel.util.NamespaceTable;
+import org.eclipse.wst.xml.core.internal.modelhandler.ModelHandlerForXML;
+import org.eclipse.wst.xml.core.internal.modelhandler.XMLModelLoader;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryAdapterFactoryForXML;
+import org.eclipse.wst.xml.core.internal.modelquery.XMLModelQueryAssociationProvider;
+import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapter;
+import org.eclipse.wst.xml.core.internal.ssemodelquery.ModelQueryAdapterImpl;
+
+
+
+@SuppressWarnings("restriction")
+public class PomModelHandler extends ModelHandlerForXML {
+
+ private static final String ASSOCIATED_CONTENT_TYPE_ID = "org.eclipse.m2e.pomFile"; //$NON-NLS-1$
+
+ private static final String POM_NAMESPACE = "http://maven.apache.org/POM/4.0.0"; //$NON-NLS-1$
+
+ private static final String POM_XSD = "http://maven.apache.org/xsd/maven-4.0.0.xsd"; //$NON-NLS-1$
+
+ public PomModelHandler() {
+ super();
+ setAssociatedContentTypeId(ASSOCIATED_CONTENT_TYPE_ID);
+ }
+
+ @Override
+ public IModelLoader getModelLoader() {
+ return new PomModelLoader();
+ }
+
+ private static class PomModelLoader extends XMLModelLoader {
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public List getAdapterFactories() {
+ List result = new ArrayList();
+ INodeAdapterFactory factory = new ModelQueryAdapterFactoryForPom();
+ result.add(factory);
+ return result;
+ }
+
+ }
+
+ static class ModelQueryAdapterFactoryForPom extends ModelQueryAdapterFactoryForXML {
+
+ protected ModelQueryAdapterImpl modelQueryAdapterImpl;
+
+ @Override
+ protected INodeAdapter createAdapter(INodeNotifier target) {
+ if(modelQueryAdapterImpl == null) {
+ ModelQueryAdapter mqa = (ModelQueryAdapter) super.createAdapter(target);
+ modelQueryAdapterImpl = new ModelQueryAdapterImpl(mqa.getCMDocumentCache(), new PomModelQueryImpl(mqa
+ .getCMDocumentCache(), mqa.getIdResolver()), mqa.getIdResolver());
+ }
+ return modelQueryAdapterImpl;
+ }
+
+ }
+
+ static class PomModelQueryImpl extends ModelQueryImpl {
+
+ public PomModelQueryImpl(CMDocumentCache cache, URIResolver idResolver) {
+ super(new PomModelQueryAssociationProvider(cache, idResolver));
+ }
+
+ }
+
+ static class PomModelQueryAssociationProvider extends XMLModelQueryAssociationProvider {
+
+ public PomModelQueryAssociationProvider(CMDocumentCache cache, URIResolver idResolver) {
+ super(cache, idResolver);
+ }
+
+ @Override
+ public CMDocument getCMDocument(String publicId, String systemId, String type) {
+ if("".equals(publicId) && "".equals(systemId)) { //$NON-NLS-1$ //$NON-NLS-2$
+ return null;
+ }
+
+ return super.getCMDocument(publicId, systemId, type);
+ }
+
+ @Override
+ public CMElementDeclaration getCMElementDeclaration(Element element) {
+ CMElementDeclaration result = super.getCMElementDeclaration(element);
+
+ if(result == null) {
+ NamespaceTable namespaceTable = new NamespaceTable(element.getOwnerDocument());
+ List list = NamespaceTable.getElementLineage(element);
+ Element rootElement = (Element) list.get(0);
+ namespaceTable.addElement(rootElement);
+
+ documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_ASYNC_LOAD, false);
+ documentManager.addCMDocumentReference(POM_NAMESPACE, POM_XSD, "XSD"); //$NON-NLS-1$
+ namespaceTable.addNamespaceInfo("", POM_NAMESPACE, ""); //$NON-NLS-1$ //$NON-NLS-2$
+
+ if(namespaceTable.isNamespaceEncountered()) {
+ result = getCMElementDeclaration(element, list, namespaceTable);
+ }
+ }
+
+ return result;
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java
new file mode 100644
index 00000000..b12153c1
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomQuickAssistProcessor.java
@@ -0,0 +1,678 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposalExtension5;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
+import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.text.edits.DeleteEdit;
+import org.eclipse.text.edits.InsertEdit;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.internal.WorkbenchPlugin;
+import org.eclipse.ui.texteditor.MarkerAnnotation;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.utils.StringUtils;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.project.MavenMarkerManager;
+import org.eclipse.m2e.editor.xml.internal.Messages;
+
+public class PomQuickAssistProcessor implements IQuickAssistProcessor {
+ private static final String GROUP_ID_NODE = "groupId"; //$NON-NLS-1$
+ private static final String ARTIFACT_ID_NODE = "artifactId"; //$NON-NLS-1$
+ private static final String VERSION_NODE = "version"; //$NON-NLS-1$
+
+ public static final String PROJECT_NODE = "project"; //$NON-NLS-1$
+ public static final String XSI_VALUE = " xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"+ //$NON-NLS-1$
+ "xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\""; //$NON-NLS-1$
+
+ public boolean canAssist(IQuickAssistInvocationContext arg0) {
+ return true;
+ }
+
+ public boolean canFix(Annotation an) {
+ if(an instanceof MarkerAnnotation) {
+ MarkerAnnotation mark = (MarkerAnnotation) an;
+ String hint = mark.getMarker().getAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, null);
+ if(hint != null) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext context) {
+ List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
+ Iterator<Annotation> annotationIterator = context.getSourceViewer().getAnnotationModel().getAnnotationIterator();
+ while(annotationIterator.hasNext()) {
+ Annotation annotation = annotationIterator.next();
+ if(annotation instanceof MarkerAnnotation) {
+ MarkerAnnotation mark = (MarkerAnnotation) annotation;
+ try {
+ Position position = context.getSourceViewer().getAnnotationModel().getPosition(annotation);
+ int lineNum = context.getSourceViewer().getDocument().getLineOfOffset(position.getOffset()) + 1;
+ int currentLineNum = context.getSourceViewer().getDocument().getLineOfOffset(context.getOffset()) + 1;
+ if(currentLineNum == lineNum) {
+ String hint = mark.getMarker().getAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, null);
+ if(hint != null) {
+ if(hint.equals(IMavenConstants.EDITOR_HINT_PARENT_GROUP_ID)) {
+ proposals.add(new IdPartRemovalProposal(context, false, mark));
+ } else if(hint.equals(IMavenConstants.EDITOR_HINT_PARENT_VERSION)) {
+ proposals.add(new IdPartRemovalProposal(context, true, mark));
+ } else if(hint.equals(IMavenConstants.EDITOR_HINT_MANAGED_DEPENDENCY_OVERRIDE)) {
+ proposals.add(new ManagedVersionRemovalProposal(context, true, mark));
+ //add a proposal to ignore the marker
+ proposals.add(new IgnoreWarningProposal(context, mark, IMavenConstants.MARKER_IGNORE_MANAGED));
+ } else if(hint.equals(IMavenConstants.EDITOR_HINT_MANAGED_PLUGIN_OVERRIDE)) {
+ proposals.add(new ManagedVersionRemovalProposal(context, false, mark));
+ //add a proposal to ignore the marker
+ proposals.add(new IgnoreWarningProposal(context, mark, IMavenConstants.MARKER_IGNORE_MANAGED));
+ } else if(hint.equals(IMavenConstants.EDITOR_HINT_MISSING_SCHEMA)) {
+ proposals.add(new SchemaCompletionProposal(context, mark));
+ }
+ }
+ }
+ } catch(Exception e) {
+ MvnIndexPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MvnIndexPlugin.PLUGIN_ID, "Exception in pom quick assist.", e));
+ }
+ }
+ }
+
+ if(proposals.size() > 0) {
+ return proposals.toArray(new ICompletionProposal[0]);
+ }
+ return null;
+ }
+
+ public String getErrorMessage() {
+ return null;
+ }
+
+ static Element getRootElement(IDocument doc) {
+ IDOMModel domModel = null;
+ try {
+ domModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+ IStructuredDocument document = domModel.getStructuredDocument();
+ Element root = domModel.getDocument().getDocumentElement();
+ return root;
+ } finally {
+ if (domModel != null) {
+ domModel.releaseFromRead();
+ }
+ }
+ }
+
+ static IStructuredDocument getDocument(IMarker marker) {
+ if (marker.getResource().getType() == IResource.FILE)
+ {
+ IDOMModel domModel = null;
+ try {
+ domModel = (IDOMModel)StructuredModelManager.getModelManager().getModelForEdit((IFile)marker.getResource());
+ return domModel.getStructuredDocument();
+ } catch(Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } finally {
+ if (domModel != null) {
+ domModel.releaseFromRead();
+ }
+ }
+ }
+ return null;
+ }
+
+ static String previewForRemovedElement(IDocument doc, Element removed) {
+ if (removed != null && removed instanceof IndexedRegion) {
+ IndexedRegion reg = (IndexedRegion)removed;
+ try {
+ int line = doc.getLineOfOffset(reg.getStartOffset());
+ int startLine = doc.getLineOffset(line);
+ int prev2 = doc.getLineOffset(Math.max(line - 2, 0));
+ String prevString = StringUtils.convertToHTMLContent(doc.get(prev2, startLine - prev2));
+ String currentLine = doc.get(startLine, doc.getLineLength(line));
+ int nextLine = Math.min(line + 2, doc.getNumberOfLines() - 1);
+ int next2End = doc.getLineOffset(nextLine) + doc.getLineLength(nextLine);
+ int next2Start = startLine + doc.getLineLength( line ) + 1;
+ String nextString = StringUtils.convertToHTMLContent(doc.get(next2Start, next2End - next2Start));
+ return "<html>...<br>" + prevString + /**"<del>" + currentLine + "</del>" +*/ nextString + "...<html>"; //$NON-NLS-1$ //$NON-NLS-2$
+ } catch(BadLocationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return null;
+ }
+
+class SchemaCompletionProposal implements ICompletionProposal, ICompletionProposalExtension5 {
+
+ IQuickAssistInvocationContext context;
+ private MarkerAnnotation annotation;
+ public SchemaCompletionProposal(IQuickAssistInvocationContext context, MarkerAnnotation mark){
+ this.context = context;
+ annotation = mark;
+ }
+
+ public void apply(IDocument doc) {
+ IDOMModel domModel = null;
+ try {
+ domModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+ IStructuredDocument document = domModel.getStructuredDocument();
+ Element root = domModel.getDocument().getDocumentElement();
+
+ //now check parent version and groupid against the current project's ones..
+ if (root.getNodeName().equals(PomQuickAssistProcessor.PROJECT_NODE)) { //$NON-NLS-1$
+ if (root instanceof IndexedRegion) {
+ IndexedRegion off = (IndexedRegion) root;
+
+ int offset = off.getStartOffset() + PomQuickAssistProcessor.PROJECT_NODE.length() + 1;
+ if (offset <= 0) {
+ return;
+ }
+ InsertEdit edit = new InsertEdit(offset, PomQuickAssistProcessor.XSI_VALUE);
+ try {
+ edit.apply(doc);
+ annotation.getMarker().delete();
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ IEditorPart activeEditor = MvnIndexPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage().getActiveEditor();
+ MvnIndexPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .saveEditor(activeEditor, false);
+ }
+ });
+ } catch(Exception e) {
+ MavenLogger.log("Unable to insert schema info", e); //$NON-NLS-1$
+ }
+ }
+ }
+ } finally {
+ if (domModel != null) {
+ domModel.releaseFromRead();
+ }
+ }
+ }
+
+ public String getAdditionalProposalInfo() {
+ //NOT TO BE REALLY IMPLEMENTED, we have the other method
+ return null;
+ }
+
+ public IContextInformation getContextInformation() {
+ return null;
+ }
+
+ public String getDisplayString() {
+ return Messages.PomQuickAssistProcessor_name;
+ }
+
+ public Image getImage() {
+ return WorkbenchPlugin.getDefault().getImageRegistry().get(org.eclipse.ui.internal.SharedImages.IMG_OBJ_ADD);
+ }
+
+ public Point getSelection(IDocument arg0) {
+ return null;
+ }
+
+ public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
+ // TODO Auto-generated method stub
+ return "<html>...<br>&lt;project <b>" + PomQuickAssistProcessor.XSI_VALUE + "</b>&gt;<br>...</html>"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+}
+
+
+static class IdPartRemovalProposal implements ICompletionProposal, ICompletionProposalExtension5, IMarkerResolution {
+
+ private IQuickAssistInvocationContext context;
+ private final boolean isVersion;
+ private final IMarker marker;
+ public IdPartRemovalProposal(IQuickAssistInvocationContext context, boolean version, MarkerAnnotation mark) {
+ this.context = context;
+ isVersion = version;
+ marker = mark.getMarker();
+ }
+
+ public IdPartRemovalProposal(IMarker marker, boolean version) {
+ this.marker = marker;
+ isVersion = version;
+ }
+
+ public void apply(IDocument doc) {
+ Element root = getRootElement(doc);
+ processFix(doc, root, isVersion, marker);
+ }
+
+ private void processFix(IDocument doc, Element root, boolean isversion, IMarker marker) {
+ //now check parent version and groupid against the current project's ones..
+ if (root.getNodeName().equals(PomQuickAssistProcessor.PROJECT_NODE)) { //$NON-NLS-1$
+ Element value = MavenMarkerManager.findChildElement(root, isversion ? VERSION_NODE : GROUP_ID_NODE); //$NON-NLS-1$ //$NON-NLS-2$
+ if (value != null && value instanceof IndexedRegion) {
+ IndexedRegion off = (IndexedRegion) value;
+
+ int offset = off.getStartOffset();
+ if (offset <= 0) {
+ return;
+ }
+ Node prev = value.getNextSibling();
+ if (prev instanceof Text) {
+ //check the content as well??
+ off = ((IndexedRegion) prev);
+ }
+ DeleteEdit edit = new DeleteEdit(offset, off.getEndOffset() - offset);
+ try {
+ edit.apply(doc);
+ marker.delete();
+ } catch(Exception e) {
+ MavenLogger.log("Unable to remove the element", e); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ public String getAdditionalProposalInfo() {
+ return null;
+ }
+
+ public IContextInformation getContextInformation() {
+ return null;
+ }
+
+ public String getDisplayString() {
+ return isVersion ? Messages.PomQuickAssistProcessor_title_version : Messages.PomQuickAssistProcessor_title_groupId;
+ }
+
+ public Image getImage() {
+ return WorkbenchPlugin.getDefault().getImageRegistry().get(org.eclipse.ui.internal.SharedImages.IMG_TOOL_DELETE);
+ }
+
+ public Point getSelection(IDocument arg0) {
+ return null;
+ }
+
+ public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
+ if (context == null) {
+ //no context in markerresolution, just to be sure..
+ return null;
+ }
+ IDocument doc = context.getSourceViewer().getDocument();
+ IDOMModel domModel = null;
+ try {
+ domModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+// IStructuredDocument document = domModel.getStructuredDocument();
+ Element root = domModel.getDocument().getDocumentElement();
+
+ //now check parent version and groupid against the current project's ones..
+ if (root.getNodeName().equals(PomQuickAssistProcessor.PROJECT_NODE)) { //$NON-NLS-1$
+ Element value = MavenMarkerManager.findChildElement(root, isVersion ? VERSION_NODE : GROUP_ID_NODE); //$NON-NLS-1$ //$NON-NLS-2$
+ String toRet = previewForRemovedElement(doc, value);
+ if (toRet != null) {
+ return toRet;
+ }
+ }
+ } finally {
+ if (domModel != null) {
+ domModel.releaseFromRead();
+ }
+ }
+ return Messages.PomQuickAssistProcessor_remove_hint;
+ }
+
+ public String getLabel() {
+ return getDisplayString();
+ }
+
+ public void run(IMarker marker) {
+ IStructuredDocument doc = getDocument(marker);
+ if (doc != null) {
+ Element root = getRootElement(doc);
+ processFix(doc, root, isVersion, marker);
+ }
+ }
+}
+
+static class ManagedVersionRemovalProposal implements ICompletionProposal, ICompletionProposalExtension5, IMarkerResolution {
+
+ private IQuickAssistInvocationContext context;
+ private final boolean isDependency;
+ private final IMarker marker;
+ public ManagedVersionRemovalProposal(IQuickAssistInvocationContext context, boolean dependency, MarkerAnnotation mark) {
+ this.context = context;
+ isDependency = dependency;
+ marker = mark.getMarker();
+ }
+
+ public ManagedVersionRemovalProposal(IMarker marker, boolean dependency) {
+ this.marker = marker;
+ isDependency = dependency;
+ }
+
+
+
+ public void apply(IDocument doc) {
+ Element root = getRootElement(doc);
+ processFix(doc, root, isDependency, marker);
+
+ }
+
+ private void processFix(IDocument doc, Element root, boolean isdep, IMarker marker) {
+ if (root.getNodeName().equals(PomQuickAssistProcessor.PROJECT_NODE)) {
+ Element artifact = findArtifactElement(root, isdep, marker);
+ if (artifact == null) {
+ //TODO report somehow?
+ MavenLogger.log("Unable to find the marked element"); //$NON-NLS-1$
+ return;
+ }
+ Element value = MavenMarkerManager.findChildElement(artifact, VERSION_NODE); //$NON-NLS-1$ //$NON-NLS-2$
+ if (value != null && value instanceof IndexedRegion) {
+ IndexedRegion off = (IndexedRegion) value;
+
+ int offset = off.getStartOffset();
+ if (offset <= 0) {
+ return;
+ }
+ Node prev = value.getNextSibling();
+ if (prev instanceof Text) {
+ //check the content as well??
+ off = ((IndexedRegion) prev);
+ }
+ DeleteEdit edit = new DeleteEdit(offset, off.getEndOffset() - offset);
+ try {
+ edit.apply(doc);
+ marker.delete();
+ } catch(Exception e) {
+ MavenLogger.log("Unable to remove the element", e); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ private Element findArtifactElement(Element root, boolean isdep, IMarker marker) {
+ if (root == null) {
+ return null;
+ }
+ String groupId = marker.getAttribute("groupId", null);
+ String artifactId = marker.getAttribute("artifactId", null);
+ assert groupId != null;
+ assert artifactId != null;
+
+ String profile = marker.getAttribute("profile", null);
+ Element artifactParent = root;
+ if (profile != null) {
+ Element profileRoot = MavenMarkerManager.findChildElement(root, "profiles");
+ if (profileRoot != null) {
+ for (Element prf : MavenMarkerManager.findChildElements(profileRoot, "profile")) {
+ if (profile.equals(MavenMarkerManager.getElementTextValue(MavenMarkerManager.findChildElement(prf, "id")))) {
+ artifactParent = prf;
+ break;
+ }
+ }
+ }
+ }
+ if (!isdep) {
+ //we have plugins now, need to go one level down to build
+ artifactParent = MavenMarkerManager.findChildElement(artifactParent, "build");
+ }
+ if (artifactParent == null) {
+ return null;
+ }
+ Element list = MavenMarkerManager.findChildElement(artifactParent, isdep ? "dependencies" : "plugins");
+ if (list == null) {
+ return null;
+ }
+ Element artifact = null;
+ for (Element art : MavenMarkerManager.findChildElements(list, isdep ? "dependency" : "plugin")) {
+ String grpString = MavenMarkerManager.getElementTextValue(MavenMarkerManager.findChildElement(art, GROUP_ID_NODE));
+ String artString = MavenMarkerManager.getElementTextValue(MavenMarkerManager.findChildElement(art, ARTIFACT_ID_NODE));
+ if (groupId.equals(grpString) && artifactId.equals(artString)) {
+ artifact = art;
+ break;
+ }
+ }
+ return artifact;
+ }
+
+ public String getAdditionalProposalInfo() {
+ return null;
+ }
+
+ public IContextInformation getContextInformation() {
+ return null;
+ }
+
+ public String getDisplayString() {
+ return Messages.PomQuickAssistProcessor_title_version;
+ }
+
+ public Image getImage() {
+ return WorkbenchPlugin.getDefault().getImageRegistry().get(org.eclipse.ui.internal.SharedImages.IMG_TOOL_DELETE);
+ }
+
+ public Point getSelection(IDocument arg0) {
+ return null;
+ }
+
+ public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
+ if (context == null) {
+ //no context in markerresolution, just to be sure..
+ return null;
+ }
+ IDocument doc = context.getSourceViewer().getDocument();
+ IDOMModel domModel = null;
+ try {
+ domModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+ Element root = domModel.getDocument().getDocumentElement();
+ Element artifact = findArtifactElement(root, isDependency, marker);
+ if (artifact != null) {
+ Element value = MavenMarkerManager.findChildElement(artifact, VERSION_NODE);
+ String toRet = previewForRemovedElement(doc, value);
+ if (toRet != null) {
+ return toRet;
+ }
+ }
+ } finally {
+ if (domModel != null) {
+ domModel.releaseFromRead();
+ }
+ }
+ return Messages.PomQuickAssistProcessor_remove_hint;
+ }
+
+ public String getLabel() {
+ return getDisplayString();
+ }
+
+ public void run(IMarker marker) {
+ IStructuredDocument doc = getDocument(marker);
+ if (doc != null) {
+ Element root = getRootElement(doc);
+ processFix(doc, root, isDependency, marker);
+ }
+ }
+}
+
+static class IgnoreWarningProposal implements ICompletionProposal, ICompletionProposalExtension5, IMarkerResolution {
+
+ private IQuickAssistInvocationContext context;
+ private final IMarker marker;
+ private final String markupText;
+ public IgnoreWarningProposal(IQuickAssistInvocationContext context, MarkerAnnotation mark, String markupText) {
+ this.context = context;
+ marker = mark.getMarker();
+ this.markupText = markupText;
+ }
+
+ public IgnoreWarningProposal(IMarker marker, String markupText) {
+ this.marker = marker;
+ this.markupText = markupText;
+ }
+
+ public void apply(IDocument doc) {
+ if (doc instanceof IStructuredDocument) {
+ processFix((IStructuredDocument) doc, marker);
+ } else {
+ IStructuredDocument strdoc = getDocument(marker);
+ if (strdoc != null) {
+ processFix(strdoc, marker);
+ }
+ }
+ }
+
+ private void processFix(IStructuredDocument doc, IMarker marker) {
+ IDOMModel domModel = null;
+ try {
+ domModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+ int line;
+ if (context != null) {
+ line = doc.getLineOfOffset(context.getOffset());
+ } else {
+ line = marker.getAttribute(IMarker.LINE_NUMBER, -1);
+ assert line != -1;
+ line = line - 1;
+ }
+ try {
+ int linestart = doc.getLineOffset(line);
+ int lineend = linestart + doc.getLineLength(line);
+ int start = linestart;
+ IndexedRegion reg = domModel.getIndexedRegion(start);
+ while (reg != null && !(reg instanceof Element) && start < lineend) {
+ reg = domModel.getIndexedRegion(reg.getEndOffset() + 1);
+ if (reg != null) {
+ start = reg.getStartOffset();
+ }
+ }
+ if (reg != null && reg instanceof Element) {
+ InsertEdit edit = new InsertEdit(reg.getEndOffset(), "<!--" + markupText + "-->");
+ try {
+ edit.apply(doc);
+ marker.delete();
+ } catch(Exception e) {
+ MavenLogger.log("Unable to insert", e); //$NON-NLS-1$
+ }
+ }
+ } catch(BadLocationException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ } finally {
+ if (domModel != null) {
+ domModel.releaseFromRead();
+ }
+ }
+ }
+
+ public String getAdditionalProposalInfo() {
+ return null;
+ }
+
+ public IContextInformation getContextInformation() {
+ return null;
+ }
+
+ public String getDisplayString() {
+ return "Ignore this warning";
+ }
+
+ public Image getImage() {
+ return MvnImages.IMG_CLOSE;
+ }
+
+ public Point getSelection(IDocument arg0) {
+ return null;
+ }
+
+ public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
+ if (context == null) {
+ //no context in markerresolution, just to be sure..
+ return null;
+ }
+ IDOMModel domModel = null;
+ try {
+ IDocument doc = context.getSourceViewer().getDocument();
+ domModel = (IDOMModel) StructuredModelManager.getModelManager().getExistingModelForRead(doc);
+ try {
+ //the offset of context is important here, not the offset of the marker!!!
+ //line/offset of marker only gets updated hen file gets saved.
+ //we need the proper handling also for unsaved documents..
+ int line = doc.getLineOfOffset(context.getOffset());
+ int linestart = doc.getLineOffset(line);
+ int lineend = linestart + doc.getLineLength(line);
+ int start = linestart;
+ IndexedRegion reg = domModel.getIndexedRegion(start);
+ while (reg != null && !(reg instanceof Element) && start < lineend) {
+ reg = domModel.getIndexedRegion(reg.getEndOffset() + 1);
+ if (reg != null) {
+ start = reg.getStartOffset();
+ }
+ }
+ if (reg != null && reg instanceof Element) { //just a simple guard against moved marker
+ try {
+ int startLine = doc.getLineOffset(line);
+ String currentLine = StringUtils.convertToHTMLContent(doc.get(reg.getStartOffset(), reg.getEndOffset() - reg.getStartOffset()));
+ String insert = StringUtils.convertToHTMLContent("<!--" + markupText + "-->");
+ return "<html>...<br>" + currentLine + "<b>" + insert + "</b><br>...<html>"; //$NON-NLS-1$ //$NON-NLS-2$
+ } catch(BadLocationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ } catch(BadLocationException e1) {
+ MavenLogger.log("Error while computing completion proposal", e1);
+ }
+ } finally {
+ if (domModel != null) {
+ domModel.releaseFromRead();
+ }
+ }
+ return Messages.PomQuickAssistProcessor_remove_hint;
+ }
+
+ public String getLabel() {
+ return getDisplayString();
+ }
+
+ public void run(IMarker marker) {
+ IStructuredDocument doc = getDocument(marker);
+ if (doc != null) {
+ processFix(doc, marker);
+ }
+ }
+}
+
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomStructuredTextViewConfiguration.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomStructuredTextViewConfiguration.java
new file mode 100644
index 00000000..5f5b26b1
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomStructuredTextViewConfiguration.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml;
+
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
+import org.eclipse.jface.text.quickassist.IQuickAssistAssistant;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.wst.sse.core.text.IStructuredPartitions;
+import org.eclipse.wst.xml.core.text.IXMLPartitions;
+import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
+
+/**
+ * @author Lukas Krecan
+ */
+public class PomStructuredTextViewConfiguration extends StructuredTextViewerConfigurationXML {
+
+ @Override
+ public IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
+ if(partitionType == IStructuredPartitions.DEFAULT_PARTITION || partitionType == IXMLPartitions.XML_DEFAULT) {
+ return new IContentAssistProcessor[] {new PomContentAssistProcessor(sourceViewer, this)};
+ }
+ return super.getContentAssistProcessors(sourceViewer, partitionType);
+ }
+
+ @Override
+ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
+ return new PomTextHover(sourceViewer, contentType, stateMask);
+ }
+
+ @Override
+ public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
+ IHyperlinkDetector[] detectors = super.getHyperlinkDetectors(sourceViewer);
+ if(detectors==null) {
+ detectors = new IHyperlinkDetector[0];
+ }
+
+ IHyperlinkDetector[] pomDetectors = new IHyperlinkDetector[detectors.length + 1];
+ pomDetectors[0] = new PomHyperlinkDetector();
+ System.arraycopy(detectors, 0, pomDetectors, 1, detectors.length);
+
+ return pomDetectors;
+ }
+
+ public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) {
+ //not explicitly setting processor results in having a bunch of generic quick fixes around..
+ //also see org.eclipse.wst.sse.ui.quickFixProcessor extension point regarding the way to declaratively
+ //register the pomquickassistprocessor
+ IQuickAssistAssistant quickAssistAssistant = super.getQuickAssistAssistant(sourceViewer);
+ quickAssistAssistant.setQuickAssistProcessor(new PomQuickAssistProcessor());
+ return quickAssistAssistant;
+ }
+
+}
+
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java
new file mode 100644
index 00000000..0738befd
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContext.java
@@ -0,0 +1,764 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.DependencyManagement;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.PluginManagement;
+import org.apache.maven.plugin.descriptor.MojoDescriptor;
+import org.apache.maven.plugin.descriptor.Parameter;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.interpolation.InterpolationException;
+import org.codehaus.plexus.interpolation.PrefixedObjectValueSource;
+import org.codehaus.plexus.interpolation.PropertiesBasedValueSource;
+import org.codehaus.plexus.interpolation.RegexBasedInterpolator;
+import org.codehaus.plexus.util.StringUtils;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.osgi.util.NLS;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.internal.project.MavenMarkerManager;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.util.search.ArtifactInfo;
+import org.eclipse.m2e.core.util.search.Packaging;
+import org.eclipse.m2e.core.util.search.SearchEngine;
+import org.eclipse.m2e.editor.xml.internal.Messages;
+
+
+/**
+ * Context types.
+ *
+ * @author Lukas Krecan
+ * @author Eugene Kuleshov
+ */
+public enum PomTemplateContext {
+
+ UNKNOWN("unknown"), // //$NON-NLS-1$
+
+ DOCUMENT("#document"), // //$NON-NLS-1$
+
+ PROJECT("project"), // //$NON-NLS-1$
+
+ BUILD("build"), // //$NON-NLS-1$
+
+ PARENT("parent"), // //$NON-NLS-1$
+
+ RELATIVE_PATH("relativePath"), // //$NON-NLS-1$
+
+ MODULES("modules"), // //$NON-NLS-1$
+
+ PROPERTIES("properties"), // //$NON-NLS-1$
+
+ DEPENDENCIES("dependencies"), // //$NON-NLS-1$
+
+ EXCLUSIONS("exclusions"), // //$NON-NLS-1$
+
+ PLUGINS("plugins"), // //$NON-NLS-1$
+
+ PLUGIN("plugin"), // //$NON-NLS-1$
+
+ PLUGIN_MANAGEMENT("pluginManagement"), // //$NON-NLS-1$
+
+ EXECUTIONS("executions"), // //$NON-NLS-1$
+
+ PROFILES("profiles"), // //$NON-NLS-1$
+
+ REPOSITORIES("repositories"), // //$NON-NLS-1$
+
+ CONFIGURATION("configuration") { //$NON-NLS-1$
+
+ @Override
+ protected void addTemplates(IProject project, Collection<Template> proposals, Node node, String prefix) throws CoreException {
+ if("execution".equals(node.getParentNode().getNodeName()) //$NON-NLS-1$
+ || "reportSet".equals(node.getParentNode().getNodeName())) { //$NON-NLS-1$
+ node = node.getParentNode().getParentNode();
+ }
+ String groupId = getGroupId(node);
+ if(groupId==null) {
+ groupId = "org.apache.maven.plugins"; // TODO support other default groups //$NON-NLS-1$
+ }
+ String artifactId = getArtifactId(node);
+ String version = extractVersion(project, getVersion(node), groupId, artifactId, EXTRACT_STRATEGY_PLUGIN | EXTRACT_STRATEGY_SEARCH);
+ if (version == null) {
+ return;
+ }
+ PluginDescriptor descriptor = PomTemplateContextUtil.INSTANCE.getPluginDescriptor(groupId, artifactId, version);
+ if(descriptor!=null) {
+ List<MojoDescriptor> mojos = descriptor.getMojos();
+ HashSet<String> params = new HashSet<String>();
+ for(MojoDescriptor mojo : mojos) {
+ List<Parameter> parameters = (List<Parameter>) mojo.getParameters();
+ for(Parameter parameter : parameters) {
+ boolean editable = parameter.isEditable();
+ if(editable) {
+ String name = parameter.getName();
+ if(!params.contains(name) && name.startsWith(prefix)) {
+ params.add(name);
+
+ String text = NLS.bind(Messages.PomTemplateContext_param, parameter.isRequired(), parameter.getType());
+
+ String expression = parameter.getExpression();
+ if(expression!=null) {
+ text += NLS.bind(Messages.PomTemplateContext_param_expr, expression);
+ }
+
+ String defaultValue = parameter.getDefaultValue();
+ if(defaultValue!=null) {
+ text += NLS.bind(Messages.PomTemplateContext_param_def, defaultValue);
+ }
+
+ String desc = parameter.getDescription().trim();
+ text += desc.startsWith("<p>") ? desc : "<br>" + desc; //$NON-NLS-1$ //$NON-NLS-2$
+
+ proposals.add(new Template(name, text, getContextTypeId(), //
+ "<" + name + ">${cursor}</" + name + ">", false)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+
+ GROUP_ID("groupId") { //$NON-NLS-1$
+ @Override
+ public void addTemplates(IProject project, Collection<Template> proposals, Node node, String prefix) throws CoreException {
+ String contextTypeId = getContextTypeId();
+ for(String groupId : getSearchEngine(project).findGroupIds(prefix, getPackaging(node), getContainingArtifact(node))) {
+ add(proposals, contextTypeId, groupId);
+ }
+ }
+ },
+
+ ARTIFACT_ID("artifactId") { //$NON-NLS-1$
+ @Override
+ public void addTemplates(IProject project, Collection<Template> proposals, Node node, String prefix) throws CoreException {
+ String groupId = getGroupId(node);
+ //#MNGECLIPSE-1832
+ if((groupId == null || groupId.trim().length() == 0) && "plugin".equals(node.getParentNode().getNodeName())) {
+ groupId = "org.apache.maven.plugins"; //$NON-NLS-1$
+ }
+ if(groupId != null) {
+ String contextTypeId = getContextTypeId();
+ for(String artifactId : getSearchEngine(project).findArtifactIds(groupId, prefix, getPackaging(node),
+ getContainingArtifact(node))) {
+ add(proposals, contextTypeId, artifactId, groupId + ":" + artifactId);
+ }
+ }
+ }
+ },
+
+ VERSION("version") { //$NON-NLS-1$
+ @Override
+ public void addTemplates(IProject project, Collection<Template> proposals, Node node, String prefix) throws CoreException {
+ String groupId = getGroupId(node);
+ //#MNGECLIPSE-1832
+ if((groupId == null || groupId.trim().length() == 0) && "plugin".equals(node.getParentNode().getNodeName())) {
+ groupId = "org.apache.maven.plugins"; //$NON-NLS-1$
+ }
+ String artifactId = getArtifactId(node);
+ if(groupId != null && artifactId != null) {
+ String contextTypeId = getContextTypeId();
+ for(String version : getSearchEngine(project).findVersions(groupId, artifactId, prefix, getPackaging(node))) {
+ add(proposals, contextTypeId, version, groupId + ":" + artifactId + ":" + version);
+ }
+ }
+ //mkleint: this concept that all versions out there are equal is questionable..
+ if (project != null && "dependency".equals(node.getParentNode().getNodeName())) { //$NON-NLS-1$
+ //see if we can complete the properties ending with .version
+
+ IMavenProjectFacade mvnproject = MavenPlugin.getDefault().getMavenProjectManager().getProject(project);
+ List<String> keys = new ArrayList<String>();
+ String contextTypeId = getContextTypeId();
+ if(mvnproject != null) {
+ MavenProject mvn = mvnproject.getMavenProject();
+ if (mvn != null) {
+ //if groupid is the same, suggest ${project.version}
+ if (groupId.equals(mvn.getGroupId())) {
+ proposals.add(new Template("${project.version}", Messages.PomTemplateContext_project_version_hint, contextTypeId, "$${project.version}", false)); //$NON-NLS-1$ //$NON-NLS-3$
+ }
+ Properties props = mvn.getProperties();
+ if (props != null) {
+ for (Object key : props.keySet()) {
+ //only add the properties following the .version convention
+ if (key.toString().endsWith(".version") || key.toString().endsWith("Version")) { //$NON-NLS-1$ //$NON-NLS-2$
+ keys.add(key.toString());
+ }
+ }
+ //sort just properties
+ Collections.sort(keys);
+ if (keys.size() > 0) {
+ for (String key : keys) {
+ String expr = "${" + key + "}"; //$NON-NLS-1$ //$NON-NLS-2$
+ proposals.add(new Template(expr, Messages.PomTemplateContext_expression_description, contextTypeId, "$" + expr, false)); //$NON-NLS-2$ //$NON-NLS-1$
+ }
+ }
+ }
+ }
+ } else {
+ //if we don't have the maven facade, it means the pom is probably broken.
+ //all we can do is to try guess the groupid and come up with the project.version proposal eventually
+ Element root = node.getOwnerDocument().getDocumentElement();
+ if (root != null && "project".equals(root.getNodeName())) {//$NON-NLS-1$
+ String currentgroupid = MavenMarkerManager.getElementTextValue(MavenMarkerManager.findChildElement(root, "groupId"));//$NON-NLS-1$
+ if (currentgroupid == null) {
+ Element parEl = MavenMarkerManager.findChildElement(root, "parent");//$NON-NLS-1$
+ if (parEl != null) {
+ currentgroupid = MavenMarkerManager.getElementTextValue(MavenMarkerManager.findChildElement(parEl, "groupId"));//$NON-NLS-1$
+ }
+ }
+ if (groupId.equals(currentgroupid)) {
+ proposals.add(new Template("${project.version}", Messages.PomTemplateContext_project_version_hint, contextTypeId, "$${project.version}", false)); //$NON-NLS-1$ //$NON-NLS-3$
+ }
+ }
+ }
+ }
+ }
+ },
+
+ CLASSIFIER("classifier") { //$NON-NLS-1$
+ @Override
+ public void addTemplates(IProject project, Collection<Template> proposals, Node node, String prefix) throws CoreException {
+ String groupId = getGroupId(node);
+ String artifactId = getArtifactId(node);
+ String version = getVersion(node);
+ if(groupId != null && artifactId != null && version != null) {
+ String contextTypeId = getContextTypeId();
+ for(String classifier : getSearchEngine(project).findClassifiers(groupId, artifactId, version, prefix,
+ getPackaging(node))) {
+ add(proposals, contextTypeId, classifier, groupId + ":" + artifactId + ":" + version + ":" + classifier);
+ }
+ }
+ }
+ },
+
+ TYPE("type") { //$NON-NLS-1$
+ @Override
+ public void addTemplates(IProject project, Collection<Template> proposals, Node node, String prefix) throws CoreException {
+ String groupId = getGroupId(node);
+ String artifactId = getArtifactId(node);
+ String version = getVersion(node);
+ String contextTypeId = getContextTypeId();
+ if(groupId != null && artifactId != null && version != null) {
+ for(String type : getSearchEngine(project).findTypes(groupId, artifactId, version, prefix, getPackaging(node))) {
+ add(proposals, contextTypeId, type, groupId + ":" + artifactId + ":" + version + ":" + type);
+ }
+ }
+ }
+ },
+
+ PACKAGING("packaging") { //$NON-NLS-1$
+ @Override
+ public void addTemplates(IProject project, Collection<Template> proposals, Node node, String prefix) {
+ String contextTypeId = getContextTypeId();
+ // TODO only show "pom" packaging in root section
+ add(proposals, contextTypeId, "pom"); //$NON-NLS-1$
+ add(proposals, contextTypeId, "jar"); //$NON-NLS-1$
+ add(proposals, contextTypeId, "war"); //$NON-NLS-1$
+ add(proposals, contextTypeId, "ear"); //$NON-NLS-1$
+ add(proposals, contextTypeId, "ejb"); //$NON-NLS-1$
+ add(proposals, contextTypeId, "eclipse-plugin"); //$NON-NLS-1$
+ add(proposals, contextTypeId, "eclipse-feature"); //$NON-NLS-1$
+ add(proposals, contextTypeId, "eclipse-update-site"); //$NON-NLS-1$
+ add(proposals, contextTypeId, "maven-plugin"); //$NON-NLS-1$
+ add(proposals, contextTypeId, "maven-archetype"); //$NON-NLS-1$
+ }
+ },
+
+ SCOPE("scope") { //$NON-NLS-1$
+ @Override
+ public void addTemplates(IProject project, Collection<Template> proposals, Node node, String prefix) {
+ String contextTypeId = getContextTypeId();
+ add(proposals, contextTypeId, "compile"); //$NON-NLS-1$
+ add(proposals, contextTypeId, "test"); //$NON-NLS-1$
+ add(proposals, contextTypeId, "provided"); //$NON-NLS-1$
+ add(proposals, contextTypeId, "runtime"); //$NON-NLS-1$
+ add(proposals, contextTypeId, "system"); //$NON-NLS-1$
+ // TODO only show "import" scope in <dependencyManagement>
+ add(proposals, contextTypeId, "import"); //$NON-NLS-1$
+ }
+ },
+
+ SYSTEM_PATH("systemPath"), //$NON-NLS-1$
+
+ PHASE("phase") { //$NON-NLS-1$
+ @Override
+ public void addTemplates(IProject project, Collection<Template> proposals, Node node, String prefix) {
+ String contextTypeId = getContextTypeId();
+ // TODO the following list should be derived from the packaging handler (the actual lifecycle)
+
+ // Clean Lifecycle
+ add(proposals, contextTypeId, "pre-clean", Messages.PomTemplateContext_preclean); //$NON-NLS-1$
+ add(proposals, contextTypeId, "clean", Messages.PomTemplateContext_clean); //$NON-NLS-1$
+ add(proposals, contextTypeId, "post-clean", Messages.PomTemplateContext_postclean); //$NON-NLS-1$
+
+ // Default Lifecycle
+ add(proposals, contextTypeId, "validate", Messages.PomTemplateContext_validate); //$NON-NLS-1$
+ add(proposals, contextTypeId, "generate-sources", Messages.PomTemplateContext_generatesources); //$NON-NLS-1$
+ add(proposals, contextTypeId, "process-sources", Messages.PomTemplateContext_processsources); //$NON-NLS-1$
+ add(proposals, contextTypeId, "generate-resources", Messages.PomTemplateContext_generateresources); //$NON-NLS-1$
+ add(proposals, contextTypeId, "process-resources", Messages.PomTemplateContext_processresources); //$NON-NLS-1$
+ add(proposals, contextTypeId, "compile", Messages.PomTemplateContext_compile); //$NON-NLS-1$
+ add(proposals, contextTypeId, "process-classes", Messages.PomTemplateContext_processclasses); //$NON-NLS-1$
+ add(proposals, contextTypeId, "generate-test-sources", Messages.PomTemplateContext_generatetestsources); //$NON-NLS-1$
+ add(proposals, contextTypeId, "process-test-sources", Messages.PomTemplateContext_processtestsources); //$NON-NLS-1$
+ add(proposals, contextTypeId, "generate-test-resources", Messages.PomTemplateContext_generatetestresources); //$NON-NLS-1$
+ add(proposals, contextTypeId, "process-test-resources", Messages.PomTemplateContext_processtestresources); //$NON-NLS-1$
+ add(proposals, contextTypeId, "test-compile", Messages.PomTemplateContext_testcompile); //$NON-NLS-1$
+ add(proposals, contextTypeId, "process-test-classes", Messages.PomTemplateContext_processtestclasses); //$NON-NLS-1$
+ add(proposals, contextTypeId, "test", Messages.PomTemplateContext_test); //$NON-NLS-1$
+ add(proposals, contextTypeId, "prepare-package", Messages.PomTemplateContext_preparepackage); //$NON-NLS-1$
+ add(proposals, contextTypeId, "package", Messages.PomTemplateContext_package); //$NON-NLS-1$
+ add(proposals, contextTypeId, "pre-integration-test", Messages.PomTemplateContext_preintegrationtest); //$NON-NLS-1$
+ add(proposals, contextTypeId, "integration-test", Messages.PomTemplateContext_integrationtest); //$NON-NLS-1$
+ add(proposals, contextTypeId, "post-integration-test", Messages.PomTemplateContext_postintegrationtest); //$NON-NLS-1$
+ add(proposals, contextTypeId, "verify", Messages.PomTemplateContext_verify); //$NON-NLS-1$
+ add(proposals, contextTypeId, "install", Messages.PomTemplateContext_install); //$NON-NLS-1$
+ add(proposals, contextTypeId, "deploy", Messages.PomTemplateContext_deploy); //$NON-NLS-1$
+
+ // Site Lifecycle
+ add(proposals, contextTypeId, "pre-site", Messages.PomTemplateContext_presite); //$NON-NLS-1$
+ add(proposals, contextTypeId, "site", Messages.PomTemplateContext_site); //$NON-NLS-1$
+ add(proposals, contextTypeId, "post-site", Messages.PomTemplateContext_postsite); //$NON-NLS-1$
+ add(proposals, contextTypeId, "site-deploy", Messages.PomTemplateContext_sitedeploy); //$NON-NLS-1$
+ }
+ },
+
+ GOAL("goal") { //$NON-NLS-1$
+ @Override
+ public void addTemplates(IProject project, Collection<Template> proposals, Node node, String prefix) throws CoreException {
+ if(!"goals".equals(node.getParentNode().getNodeName())) { //$NON-NLS-1$
+ return;
+ }
+ node = node.getParentNode();
+ if(!"execution".equals(node.getParentNode().getNodeName())) { //$NON-NLS-1$
+ return;
+ }
+ node = node.getParentNode();
+ if(!"executions".equals(node.getParentNode().getNodeName())) { //$NON-NLS-1$
+ return;
+ }
+ node = node.getParentNode();
+
+ String groupId = getGroupId(node);
+ if(groupId==null) {
+ groupId = "org.apache.maven.plugins"; //$NON-NLS-1$
+ }
+ String artifactId = getArtifactId(node);
+
+ String version = extractVersion(project, getVersion(node), groupId, artifactId, EXTRACT_STRATEGY_PLUGIN | EXTRACT_STRATEGY_SEARCH);
+ if(version==null) {
+ return;
+ }
+
+ PluginDescriptor descriptor = PomTemplateContextUtil.INSTANCE.getPluginDescriptor(groupId, artifactId, version);
+ if (descriptor != null) {
+ List<MojoDescriptor> mojos = descriptor.getMojos();
+ if (mojos != null) {
+ String contextTypeId = getContextTypeId();
+ for (MojoDescriptor mojo : mojos) {
+ add(proposals, contextTypeId, mojo.getGoal(), mojo.getDescription());
+ }
+ }
+ }
+ }
+ },
+
+ MODULE("module") { //$NON-NLS-1$
+ @Override
+ public void addTemplates(IProject project, Collection<Template> proposals, Node node, String prefix)
+ throws CoreException {
+ if(project == null) {
+ //shall not happen just double check.
+ return;
+ }
+ //MNGECLIPSE-2204 collect the existing values from the surrounding xml content only..
+ List<String> existings = new ArrayList<String>();
+ Node moduleNode = node;
+ if (moduleNode != null) {
+ Node modulesNode = moduleNode.getParentNode();
+ if (modulesNode != null) {
+ for (Element el : MavenMarkerManager.findChildElements((Element)modulesNode, "module")) {
+ if (el != moduleNode) {
+ String val = MavenMarkerManager.getElementTextValue(el);
+ if (val != null) {
+ existings.add(val);
+ }
+ }
+ }
+ }
+ }
+
+ File directory = new File(project.getLocationURI());
+ final File currentPom = new File(directory, "pom.xml");
+ String path = prefix;
+ boolean endingSlash = path.endsWith("/"); //$NON-NLS-1$
+ String[] elems = StringUtils.split(path, "/"); //$NON-NLS-1$
+ String lastElement = null;
+ for(int i = 0; i < elems.length; i++ ) {
+ if("..".equals(elems[i])) { //$NON-NLS-1$
+ directory = directory != null ? directory.getParentFile() : null;
+ } else if(i < elems.length - (endingSlash ? 0 : 1)) {
+ directory = directory != null ? new File(directory, elems[i]) : null;
+ } else {
+ lastElement = elems[i];
+ }
+ }
+ path = lastElement != null ? path.substring(0, path.length() - lastElement.length()) : path;
+ FileFilter filter = new FileFilter() {
+ public boolean accept(File pathname) {
+ if (pathname.isDirectory()) {
+ File pom = new File(pathname, "pom.xml"); //$NON-NLS-1$
+ //TODO shall also handle polyglot maven :)
+ return pom.exists() && pom.isFile() && !pom.equals(currentPom);
+ }
+ return false;
+ }
+ };
+ if (directory != null && directory.exists() && directory.isDirectory()) {
+ File[] offerings = directory.listFiles(filter);
+ for (File candidate : offerings) {
+ if(lastElement == null || candidate.getName().startsWith(lastElement) ) {
+ String val = path + candidate.getName();
+ if (!existings.contains(val)) { //only those not already being added in the surrounding area
+ add(proposals, getContextTypeId(), val, NLS.bind(Messages.PomTemplateContext_candidate, candidate));
+ }
+ }
+ }
+ if (path.length() == 0 && directory.equals(currentPom.getParentFile())) {
+ //for the empty value, when searching in current directory, propose also stuff one level up.
+ File currentParent = directory.getParentFile();
+ if (currentParent != null && currentParent.exists()) {
+ offerings = currentParent.listFiles(filter);
+ for (File candidate : offerings) {
+ String val = "../" + candidate.getName();
+ if (!existings.contains(val)) { //only those not already being added in the surrounding area
+ add(proposals, getContextTypeId(), val, NLS.bind(Messages.PomTemplateContext_candidate, candidate));
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+
+ private static final String PREFIX = MvnIndexPlugin.PLUGIN_ID + ".templates.contextType."; //$NON-NLS-1$
+
+ private final String nodeName;
+
+ private PomTemplateContext(String nodeName) {
+ this.nodeName = nodeName;
+ }
+
+ /**
+ * Return templates depending on the context type.
+ */
+ public Template[] getTemplates(IProject project, Node node, String prefix) {
+ Collection<Template> templates = new ArrayList<Template>();
+ try {
+ addTemplates(project, templates, node, prefix);
+ } catch (CoreException e) {
+ MavenLogger.log(e);
+ }
+ return templates.toArray(new Template[templates.size()]);
+ }
+
+ protected void addTemplates(IProject project, Collection<Template> templates, Node currentNode, String prefix) throws CoreException {
+ }
+
+ protected String getNodeName() {
+ return nodeName;
+ }
+
+ public String getContextTypeId() {
+ return PREFIX + nodeName;
+ }
+
+ public static PomTemplateContext fromId(String contextTypeId) {
+ for(PomTemplateContext context : values()) {
+ if(context.getContextTypeId().equals(contextTypeId)) {
+ return context;
+ }
+ }
+ return UNKNOWN;
+ }
+
+ public static PomTemplateContext fromNodeName(String idSuffix) {
+ for(PomTemplateContext context : values()) {
+ if(context.getNodeName().equals(idSuffix)) {
+ return context;
+ }
+ }
+ return UNKNOWN;
+ }
+
+ private static SearchEngine getSearchEngine(IProject project) throws CoreException {
+ if(searchEngineForTests != null) {
+ return searchEngineForTests;
+ }
+ return MavenPlugin.getDefault().getSearchEngine(project);
+ }
+
+
+ private static SearchEngine searchEngineForTests;
+
+ public static void setSearchEngineForTests(SearchEngine _searchEngineForTests) {
+ searchEngineForTests = _searchEngineForTests;
+ }
+
+ /**
+ * Returns containing artifactInfo for exclusions. Otherwise returns null.
+ */
+ protected ArtifactInfo getContainingArtifact(Node currentNode) {
+ if(isExclusion(currentNode)) {
+ Node node = currentNode.getParentNode().getParentNode();
+ return getArtifactInfo(node);
+ }
+ return null;
+ }
+
+ /**
+ * Returns artifact info from siblings of given node.
+ */
+ private ArtifactInfo getArtifactInfo(Node node) {
+ return new ArtifactInfo(getGroupId(node), getArtifactId(node), getVersion(node), //
+ getSiblingTextValue(node, "classifier"), getSiblingTextValue(node, "type")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Returns required packaging.
+ */
+ protected Packaging getPackaging(Node currentNode) {
+ if(isPlugin(currentNode)) {
+ return Packaging.PLUGIN;
+ } else if(isParent(currentNode)) {
+ return Packaging.POM;
+ }
+ return Packaging.ALL;
+ }
+
+ /**
+ * Returns true if user is editing plugin dependency.
+ */
+ private boolean isPlugin(Node currentNode) {
+ return "plugin".equals(currentNode.getParentNode().getNodeName()); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns true if user is editing plugin dependency exclusion.
+ */
+ private boolean isExclusion(Node currentNode) {
+ return "exclusion".equals(currentNode.getParentNode().getNodeName()); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns true if user is editing parent dependency.
+ */
+ private boolean isParent(Node currentNode) {
+ return "parent".equals(currentNode.getParentNode().getNodeName()); //$NON-NLS-1$
+ }
+
+ protected String getGroupId(Node currentNode) {
+ return getSiblingTextValue(currentNode, "groupId"); //$NON-NLS-1$
+ }
+
+ /**
+ *
+ * @param project
+ * @param version
+ * @param groupId
+ * @param artifactId
+ * @return
+ * @throws CoreException
+ */
+
+ static int EXTRACT_STRATEGY_PLUGIN = 1;
+ static int EXTRACT_STRATEGY_DEPENDENCY = 2;
+ static int EXTRACT_STRATEGY_SEARCH = 4;
+
+ static String extractVersion(IProject project, String version, String groupId, String artifactId, int strategy)
+ throws CoreException {
+ //interpolate the version found to get rid of expressions
+ version = simpleInterpolate(project, version);
+
+ if (version==null) {
+ Packaging pack = Packaging.ALL;
+ if ( (strategy & EXTRACT_STRATEGY_PLUGIN) != 0) {
+ version = searchPM(project, groupId, artifactId);
+ pack = Packaging.PLUGIN;
+ }
+ if ( (strategy & EXTRACT_STRATEGY_DEPENDENCY) != 0) {
+ version = searchDM(project, groupId, artifactId);
+ }
+ if (version == null && (strategy & EXTRACT_STRATEGY_SEARCH) != 0) {
+ Collection<String> versions = getSearchEngine(project).findVersions(groupId, artifactId, "", pack); //$NON-NLS-1$
+ if(versions.isEmpty()) {
+ return null;
+ }
+ version = versions.iterator().next();
+ }
+ }
+ return version;
+ }
+
+ //TODO MNGECLIPSE-2540 change project parameter to MavenProject I guess..
+ static String simpleInterpolate(IProject project, String text) {
+ if (text != null && text.contains("${")) { //$NON-NLS-1$
+ //when expression is in the version but no project instance around
+ // just give up.
+ if(project == null) {
+ return null;
+ }
+ IMavenProjectFacade mvnproject = MavenPlugin.getDefault().getMavenProjectManager().getProject(project);
+ if (mvnproject != null) {
+ MavenProject prj = mvnproject.getMavenProject();
+ if (prj != null) {
+ Properties props = prj.getProperties();
+ RegexBasedInterpolator inter = new RegexBasedInterpolator();
+ if (props != null) {
+ inter.addValueSource(new PropertiesBasedValueSource(props));
+ }
+ inter.addValueSource(new PrefixedObjectValueSource(Arrays.asList( new String[]{ "pom.", "project." } ), prj.getModel(), false)); //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ text = inter.interpolate(text);
+ } catch(InterpolationException e) {
+ text = null;
+ }
+
+ }
+ }
+ }
+ return text;
+ }
+
+ private static String searchPM(IProject project, String groupId, String artifactId) {
+ if (project == null) {
+ return null;
+ }
+ String version = null;
+ //see if we can find the plugin in plugin management of resolved project.
+ IMavenProjectFacade mvnproject = MavenPlugin.getDefault().getMavenProjectManager().getProject(project);
+ if(mvnproject != null) {
+ String id = Plugin.constructKey(groupId, artifactId);
+ MavenProject prj = mvnproject.getMavenProject();
+ if(prj != null) {
+ PluginManagement pm = prj.getPluginManagement();
+ if(pm != null) {
+ for(Plugin pl : pm.getPlugins()) {
+ if(id.equals(pl.getKey())) {
+ version = pl.getVersion();
+ break;
+ }
+ }
+ }
+ }
+ }
+ return version;
+ }
+
+ private static String searchDM(IProject project, String groupId, String artifactId) {
+ if (project == null) {
+ return null;
+ }
+ String version = null;
+ //see if we can find the dependency is in dependency management of resolved project.
+ IMavenProjectFacade mvnproject = MavenPlugin.getDefault().getMavenProjectManager().getProject(project);
+ if(mvnproject != null) {
+ String id = groupId + ":" + artifactId + ":";
+ MavenProject prj = mvnproject.getMavenProject();
+ if(prj != null) {
+ DependencyManagement dm = prj.getDependencyManagement();
+ if(dm != null) {
+ for(Dependency dep : dm.getDependencies()) {
+ if(dep.getManagementKey().startsWith(id)) {
+ version = dep.getVersion();
+ break;
+ }
+ }
+ }
+ }
+ }
+ return version;
+ }
+
+ protected static String getArtifactId(Node currentNode) {
+ return getSiblingTextValue(currentNode, "artifactId"); //$NON-NLS-1$
+ }
+
+ protected static String getVersion(Node currentNode) {
+ return getSiblingTextValue(currentNode, "version"); //$NON-NLS-1$
+ }
+
+ private static String getSiblingTextValue(Node sibling, String name) {
+ Node node = getSiblingWithName(sibling, name);
+ return getNodeTextValue(node);
+ }
+
+ /**
+ * Returns sibling with given name.
+ */
+ private static Node getSiblingWithName(Node node, String name) {
+ NodeList nodeList = node.getParentNode().getChildNodes();
+ for(int i = 0; i < nodeList.getLength(); i++ ) {
+ if(name.equals(nodeList.item(i).getNodeName())) {
+ return nodeList.item(i);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns text value of the node.
+ */
+ private static String getNodeTextValue(Node node) {
+ if(node != null && hasOneNode(node.getChildNodes())) {
+ return ((Text) node.getChildNodes().item(0)).getData().trim();
+ }
+ return null;
+ }
+
+ /**
+ * Returns true if there is only one node in the nodeList.
+ */
+ private static boolean hasOneNode(NodeList nodeList) {
+ return nodeList != null && nodeList.getLength() == 1;
+ }
+
+ private static void add(Collection<Template> proposals, String contextTypeId, String name) {
+ add(proposals, contextTypeId, name, name);
+ }
+
+ private static void add(Collection<Template> proposals, String contextTypeId, String name, String description) {
+ proposals.add(new Template(name, description, contextTypeId, name, false));
+ }
+
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextType.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextType.java
new file mode 100644
index 00000000..597219e4
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextType.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml;
+
+import org.eclipse.jface.text.templates.GlobalTemplateVariables;
+import org.eclipse.jface.text.templates.TemplateContextType;
+
+
+/**
+ * @author Lukas Krecan
+ */
+public class PomTemplateContextType extends TemplateContextType {
+ public PomTemplateContextType() {
+ addResolver(new GlobalTemplateVariables.Cursor());
+ addResolver(new GlobalTemplateVariables.Date());
+ addResolver(new GlobalTemplateVariables.Dollar());
+ addResolver(new GlobalTemplateVariables.LineSelection());
+ addResolver(new GlobalTemplateVariables.Time());
+ addResolver(new GlobalTemplateVariables.User());
+ addResolver(new GlobalTemplateVariables.WordSelection());
+ addResolver(new GlobalTemplateVariables.Year());
+ }
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java
new file mode 100644
index 00000000..c140d2ba
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTemplateContextUtil.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
+import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
+import org.codehaus.plexus.util.IOUtil;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMaven;
+
+class PomTemplateContextUtil {
+
+ public static final PomTemplateContextUtil INSTANCE = new PomTemplateContextUtil();
+
+ private final Map<String, PluginDescriptor> descriptors = new HashMap<String, PluginDescriptor>();
+
+ public PluginDescriptor getPluginDescriptor(String groupId, String artifactId, String version) {
+ String name = groupId + ":" + artifactId + ":" + version;
+ PluginDescriptor descriptor = descriptors.get(name);
+ if(descriptor!=null) {
+ return descriptor;
+ }
+
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ MavenConsole console = plugin.getConsole();
+ try {
+ IMaven embedder = MavenPlugin.getDefault().getMaven();
+
+ List<ArtifactRepository> repositories = embedder.getArtifactRepositories();
+
+ Artifact artifact = embedder.resolve(groupId, artifactId, version, "maven-plugin", null, repositories, null); //$NON-NLS-1$
+
+ File file = artifact.getFile();
+ if(file == null) {
+ String msg = "Can't resolve plugin " + name; //$NON-NLS-1$
+ console.logError(msg);
+ } else {
+ InputStream is = null;
+ ZipFile zf = null;
+ try {
+ zf = new ZipFile(file);
+ ZipEntry entry = zf.getEntry("META-INF/maven/plugin.xml"); //$NON-NLS-1$
+ if(entry != null) {
+ is = zf.getInputStream(entry);
+ PluginDescriptorBuilder builder = new PluginDescriptorBuilder();
+ descriptor = builder.build(new InputStreamReader(is));
+ descriptors.put(name, descriptor);
+ return descriptor;
+ }
+
+ } catch(Exception ex) {
+ String msg = "Can't read configuration for " + name; //$NON-NLS-1$
+ console.logError(msg);
+ MavenLogger.log(msg, ex);
+
+ } finally {
+ IOUtil.close(is);
+ try {
+ zf.close();
+ } catch(IOException ex) {
+ // ignore
+ }
+ }
+ }
+
+ } catch(CoreException ex) {
+ IStatus status = ex.getStatus();
+ if(status.getException() != null) {
+ console.logError(status.getMessage() + "; " + status.getException().getMessage());
+ } else {
+ console.logError(status.getMessage());
+ }
+ MavenLogger.log(ex);
+ }
+ return null;
+ }
+
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTextHover.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTextHover.java
new file mode 100644
index 00000000..c0322877
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/PomTextHover.java
@@ -0,0 +1,148 @@
+package org.eclipse.m2e.editor.xml;
+
+import java.util.List;
+
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.DependencyManagement;
+import org.apache.maven.model.InputLocation;
+import org.apache.maven.model.InputSource;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.PluginManagement;
+import org.apache.maven.project.MavenProject;
+import org.w3c.dom.Node;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.osgi.util.NLS;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.editor.xml.PomHyperlinkDetector.ExpressionRegion;
+import org.eclipse.m2e.editor.xml.PomHyperlinkDetector.ManagedArtifactRegion;
+import org.eclipse.m2e.editor.xml.internal.Messages;
+
+public class PomTextHover implements ITextHover {
+
+ public PomTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
+ }
+
+ public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
+ if (hoverRegion instanceof ExpressionRegion) {
+ ExpressionRegion region = (ExpressionRegion) hoverRegion;
+ IMavenProjectFacade mvnproject = MavenPlugin.getDefault().getMavenProjectManager().getProject(region.project);
+ if (mvnproject != null) {
+ MavenProject mavprj = mvnproject.getMavenProject();
+ if (mavprj != null) {
+ String value = PomTemplateContext.simpleInterpolate(region.project, "${" + region.property + "}"); //$NON-NLS-1$ //$NON-NLS-2$
+ String loc = null;
+ Model mdl = mavprj.getModel();
+ if (mdl.getProperties() != null && mdl.getProperties().containsKey(region.property)) {
+ if (mdl.getLocation("properties") != null) {
+ InputLocation location = mdl.getLocation("properties").getLocation(region.property); //$NON-NLS-1$
+ if (location != null) {
+ //MNGECLIPSE-2539 apparently you can have an InputLocation with null input source.
+ // check!
+ InputSource source = location.getSource();
+ if (source != null) {
+ loc = source.getModelId();
+ }
+ }
+ }
+ }
+ String ret = NLS.bind(Messages.PomTextHover_eval1,
+ value, loc != null ? NLS.bind(Messages.PomTextHover_eval2, loc) : ""); //$NON-NLS-2$ //$NON-NLS-1$
+ return ret;
+ }
+ }
+ } else if (hoverRegion instanceof ManagedArtifactRegion) {
+ ManagedArtifactRegion region = (ManagedArtifactRegion) hoverRegion;
+ IMavenProjectFacade mvnproject = MavenPlugin.getDefault().getMavenProjectManager().getProject(region.project);
+ if (mvnproject != null) {
+ MavenProject mavprj = mvnproject.getMavenProject();
+ if (mavprj != null) {
+ String version = null;
+ if (region.isDependency) {
+ DependencyManagement dm = mavprj.getDependencyManagement();
+ if (dm != null) {
+ List<Dependency> list = dm.getDependencies();
+ String id = region.groupId + ":" + region.artifactId + ":"; //$NON-NLS-1$ //$NON-NLS-2$
+ if (list != null) {
+ for (Dependency dep : list) {
+ if (dep.getManagementKey().startsWith(id)) {
+ version = dep.getVersion();
+ }
+ }
+ }
+ }
+ }
+
+ if (region.isPlugin) {
+ PluginManagement pm = mavprj.getPluginManagement();
+ if (pm != null) {
+ List<Plugin> list = pm.getPlugins();
+ String id = Plugin.constructKey(region.groupId, region.artifactId);
+ if (list != null) {
+ for (Plugin plg : list) {
+ if (id.equals(plg.getKey())) {
+ version = plg.getVersion();
+ }
+ }
+ }
+
+ }
+ }
+ StringBuffer ret = new StringBuffer();
+ ret.append("<html>"); //$NON-NLS-1$
+ if (version != null) {
+ ret.append(NLS.bind(Messages.PomTextHover_managed_version, version));
+ } else {
+ ret.append(Messages.PomTextHover_managed_version_missing);
+ }
+ ret.append("<br>"); //$NON-NLS-1$
+ InputLocation openLocation = PomHyperlinkDetector.findLocationForManagedArtifact(region, mavprj);
+ if (openLocation != null) {
+ //MNGECLIPSE-2539 apparently you can have an InputLocation with null input source.
+ // check!
+ InputSource source = openLocation.getSource();
+ if (source != null) {
+ ret.append(NLS.bind(Messages.PomTextHover_managed_location, source.getModelId()));
+ }
+ } else {
+ ret.append(Messages.PomTextHover_managed_location_missing);
+ }
+ ret.append("</html>"); //$NON-NLS-1$
+ return ret.toString();
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
+ IDocument document = textViewer.getDocument();
+ if(document == null) {
+ return null;
+ }
+
+ Node current = PomHyperlinkDetector.getCurrentNode(document, offset);
+ if (current != null) {
+ ExpressionRegion region = PomHyperlinkDetector.findExpressionRegion(current, textViewer, offset);
+ if (region != null) {
+ return region;
+ }
+ ManagedArtifactRegion manReg = PomHyperlinkDetector.findManagedArtifactRegion(current, textViewer, offset);
+ if (manReg != null) {
+ return manReg;
+ }
+ }
+ return null;
+ }
+
+
+
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/XMLSchemaMarkerResolution.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/XMLSchemaMarkerResolution.java
new file mode 100644
index 00000000..f35edc3d
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/XMLSchemaMarkerResolution.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.text.edits.InsertEdit;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.editor.xml.internal.Messages;
+
+/**
+ * MavenMarkerResolution
+ * TODO mkleint: this class shall be eventually merged with the class doing the same in POMQuickAssistProcessor
+ * @author dyocum
+ */
+public class XMLSchemaMarkerResolution implements IMarkerResolution {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IMarkerResolution#getLabel()
+ */
+ public String getLabel() {
+ return Messages.MavenMarkerResolution_schema_label;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IMarkerResolution#run(org.eclipse.core.resources.IMarker)
+ */
+ public void run(final IMarker marker) {
+ if(marker.getResource().getType() == IResource.FILE){
+ try {
+ IDOMModel domModel = (IDOMModel)StructuredModelManager.getModelManager().getModelForEdit((IFile)marker.getResource());
+ int offset = ((Integer)marker.getAttribute("offset")); //$NON-NLS-1$
+ IStructuredDocumentRegion regionAtCharacterOffset = domModel.getStructuredDocument().getRegionAtCharacterOffset(offset);
+ if(regionAtCharacterOffset != null && regionAtCharacterOffset.getText() != null &&
+ regionAtCharacterOffset.getText().lastIndexOf("<project") >=0){ //$NON-NLS-1$
+ //in case there are unsaved changes, find the current offset of the <project> node before inserting
+ offset = regionAtCharacterOffset.getStartOffset();
+ IDE.openEditor(MvnIndexPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage(), (IFile)marker.getResource());
+ InsertEdit edit = new InsertEdit(offset+8, PomQuickAssistProcessor.XSI_VALUE);
+ try {
+ edit.apply(domModel.getStructuredDocument());
+ IEditorPart activeEditor = MvnIndexPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ MvnIndexPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().saveEditor(activeEditor, false);
+ } catch(Exception e){
+ MavenLogger.log("Unable to insert schema info", e); //$NON-NLS-1$
+ }
+ } else {
+ String msg = Messages.MavenMarkerResolution_error;
+ MessageDialog.openError(MvnIndexPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.MavenMarkerResolution_error_title, msg);
+ }
+ } catch(Exception e) {
+ MavenLogger.log("Unable to run quick fix for maven marker", e); //$NON-NLS-1$
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/Messages.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/Messages.java
new file mode 100644
index 00000000..aa74c0cb
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/Messages.java
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+
+package org.eclipse.m2e.editor.xml.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.m2e.editor.xml.internal.messages"; //$NON-NLS-1$
+
+ public static String InsertArtifactProposal_additionals;
+
+ public static String InsertArtifactProposal_display_name;
+
+ public static String InsertArtifactProposal_insert_plugin_description;
+
+ public static String InsertArtifactProposal_insert_plugin_display_name;
+
+ public static String InsertArtifactProposal_insert_plugin_title;
+
+ public static String InsertArtifactProposal_searchDialog_title;
+
+ public static String InsertExpressionProposal_hint1;
+
+ public static String InsertExpressionProposal_hint2;
+
+ public static String MavenMarkerResolution_error;
+
+ public static String MavenMarkerResolution_error_title;
+
+ public static String MavenMarkerResolution_schema_label;
+ public static String PomContentAssistProcessor_insert_relPath_title;
+
+ public static String PomContentAssistProcessor_set_relPath_title;
+
+ public static String PomHyperlinkDetector_23;
+
+ public static String PomHyperlinkDetector_error_message;
+
+ public static String PomHyperlinkDetector_error_title;
+
+ public static String PomHyperlinkDetector_hyperlink_pattern;
+
+ public static String PomHyperlinkDetector_job_name;
+
+ public static String PomHyperlinkDetector_link_managed;
+
+ public static String PomHyperlinkDetector_open_module;
+
+ public static String PomHyperlinkDetector_open_property;
+
+ public static String PomQuickAssistProcessor_name;
+
+ public static String PomQuickAssistProcessor_remove_hint;
+ public static String PomQuickAssistProcessor_title_groupId;
+
+ public static String PomQuickAssistProcessor_title_version;
+
+ public static String PomTemplateContext_candidate;
+
+ public static String PomTemplateContext_clean;
+
+ public static String PomTemplateContext_compile;
+
+ public static String PomTemplateContext_deploy;
+
+ public static String PomTemplateContext_expression_description;
+
+ public static String PomTemplateContext_generateresources;
+
+ public static String PomTemplateContext_generatesources;
+
+ public static String PomTemplateContext_generatetestresources;
+
+ public static String PomTemplateContext_generatetestsources;
+
+ public static String PomTemplateContext_install;
+
+ public static String PomTemplateContext_integrationtest;
+
+ public static String PomTemplateContext_package;
+
+ public static String PomTemplateContext_param;
+
+ public static String PomTemplateContext_param_def;
+
+ public static String PomTemplateContext_param_expr;
+
+ public static String PomTemplateContext_postclean;
+
+ public static String PomTemplateContext_postintegrationtest;
+
+ public static String PomTemplateContext_postsite;
+
+ public static String PomTemplateContext_preclean;
+
+ public static String PomTemplateContext_preintegrationtest;
+
+ public static String PomTemplateContext_preparepackage;
+
+ public static String PomTemplateContext_presite;
+
+ public static String PomTemplateContext_processclasses;
+
+ public static String PomTemplateContext_processresources;
+
+ public static String PomTemplateContext_processsources;
+
+ public static String PomTemplateContext_processtestclasses;
+
+ public static String PomTemplateContext_processtestresources;
+
+ public static String PomTemplateContext_processtestsources;
+
+ public static String PomTemplateContext_project_version_hint;
+
+ public static String PomTemplateContext_site;
+
+ public static String PomTemplateContext_sitedeploy;
+
+ public static String PomTemplateContext_test;
+
+ public static String PomTemplateContext_testcompile;
+
+ public static String PomTemplateContext_validate;
+
+ public static String PomTemplateContext_verify;
+
+ public static String PomTextHover_eval1;
+
+ public static String PomTextHover_eval2;
+ public static String PomTextHover_managed_location;
+
+ public static String PomTextHover_managed_location_missing;
+
+ public static String PomTextHover_managed_version;
+
+ public static String PomTextHover_managed_version_missing;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/POMMarkerAnnotationModel.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/POMMarkerAnnotationModel.java
new file mode 100644
index 00000000..5a7bc121
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/POMMarkerAnnotationModel.java
@@ -0,0 +1,34 @@
+package org.eclipse.m2e.editor.xml.internal;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.ui.texteditor.MarkerAnnotation;
+import org.eclipse.wst.sse.ui.internal.StructuredResourceMarkerAnnotationModel;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+
+/**
+ * created this file to get the proper lightbulb icon for the warnings with hint
+ * @author mkleint
+ */
+public class POMMarkerAnnotationModel extends StructuredResourceMarkerAnnotationModel {
+
+ public POMMarkerAnnotationModel(IResource resource) {
+ super(resource);
+ }
+
+ public POMMarkerAnnotationModel(IResource resource, String secondaryID) {
+ super(resource, secondaryID);
+ }
+
+ @Override
+ protected MarkerAnnotation createMarkerAnnotation(IMarker marker) {
+ String hint = marker.getAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT, null);
+ if(hint != null) {
+ MarkerAnnotation ann = new MarkerAnnotation(marker);
+ ann.setQuickFixable(true);
+ return ann;
+ }
+ return super.createMarkerAnnotation(marker);
+ }
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/POMMarkerAnnotationModelFactory.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/POMMarkerAnnotationModelFactory.java
new file mode 100644
index 00000000..026f359a
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/POMMarkerAnnotationModelFactory.java
@@ -0,0 +1,34 @@
+package org.eclipse.m2e.editor.xml.internal;
+
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModelFactory;
+
+/**
+ * created this file to get the proper lightbulb icon for the warnings with hint
+ * is almost exact copy of the wst one..
+ * @author mkleint
+ */
+public class POMMarkerAnnotationModelFactory extends ResourceMarkerAnnotationModelFactory {
+ public POMMarkerAnnotationModelFactory() {
+ super();
+ }
+
+ /*
+ * @see org.eclipse.core.filebuffers.IAnnotationModelFactory#createAnnotationModel(org.eclipse.core.runtime.IPath)
+ */
+ public IAnnotationModel createAnnotationModel(IPath location) {
+ IAnnotationModel model = null;
+ IFile file = FileBuffers.getWorkspaceFileAtLocation(location);
+ if (file != null) {
+ model = new POMMarkerAnnotationModel(file);
+ }
+ else {
+ model = new POMMarkerAnnotationModel(ResourcesPlugin.getWorkspace().getRoot(), location.toString());
+ }
+ return model;
+ }
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/messages.properties b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/messages.properties
new file mode 100644
index 00000000..169707c9
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/internal/messages.properties
@@ -0,0 +1,66 @@
+InsertArtifactProposal_additionals=Opens a search dialog where you can select the parent pom for this project.
+InsertArtifactProposal_display_name=Insert reference to parent POM
+InsertArtifactProposal_insert_plugin_description=Opens a search dialog where you can select a Maven plugin to add to this project
+InsertArtifactProposal_insert_plugin_display_name=Insert plugin
+InsertArtifactProposal_insert_plugin_title=Select Plugin
+InsertArtifactProposal_searchDialog_title=Select Parent
+InsertExpressionProposal_hint1=The expression evaluates to <b>{0}</b> in the current effective pom.
+InsertExpressionProposal_hint2=<br>It is based on property defined in <b>{0}</b>
+MavenMarkerResolution_error=Unable to apply the quick fix. The file may have unsaved changes that invalidate the current quick fix.
+MavenMarkerResolution_error_title=Error
+MavenMarkerResolution_schema_label=Add Schema information to the specified pom.xml
+PomContentAssistProcessor_insert_relPath_title=Insert relativePath pointing to {0}
+PomContentAssistProcessor_set_relPath_title=Set relativePath to {0}
+PomHyperlinkDetector_23=</artifactId>
+PomHyperlinkDetector_error_message=Can't open editor for {0}\n{1}
+PomHyperlinkDetector_error_title=Open Maven POM
+PomHyperlinkDetector_hyperlink_pattern=Open pom.xml for {0}:{1}
+PomHyperlinkDetector_job_name=Opening POM
+PomHyperlinkDetector_link_managed=Open managed location for {0}
+PomHyperlinkDetector_open_module=Open module project pom.xml at {0}
+PomHyperlinkDetector_open_property=Open definition of property {0}
+PomQuickAssistProcessor_name=Add Maven XML Schema declaration
+PomQuickAssistProcessor_remove_hint=It removes the current definition to rely on value inherited from parent
+PomQuickAssistProcessor_title_groupId=Remove groupId declaration
+PomQuickAssistProcessor_title_version=Remove version declaration
+PomTemplateContext_candidate=Maven project at {0}
+PomTemplateContext_clean=Removes all files generated by the previous build
+PomTemplateContext_compile=Compile the source code of the project
+PomTemplateContext_deploy=Done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects
+PomTemplateContext_expression_description=Property defined in effective pom.
+PomTemplateContext_generateresources=Generate resources for inclusion in the package
+PomTemplateContext_generatesources=Generate any source code for inclusion in compilation
+PomTemplateContext_generatetestresources=Create resources for testing
+PomTemplateContext_generatetestsources=Generate any test source code for inclusion in compilation
+PomTemplateContext_install=Install the package into the local repository, for use as a dependency in other projects locally
+PomTemplateContext_integrationtest=Process and deploy the package if necessary into an environment where integration tests can be run
+PomTemplateContext_package=Take the compiled code and package it in its distributable format, such as a JAR
+PomTemplateContext_param=<b>required:</b> {0}<br><b>type:</b> {1}<br>
+PomTemplateContext_param_def=default: {0}<br>
+PomTemplateContext_param_expr=expression: {0}<br>
+PomTemplateContext_postclean=Executes processes needed to finalize the project cleaning
+PomTemplateContext_postintegrationtest=Perform actions required after integration tests have been executed. This may including cleaning up the environment
+PomTemplateContext_postsite=Executes processes needed to finalize the site generation, and to prepare for site deployment
+PomTemplateContext_preclean=Executes processes needed prior to the actual project cleaning
+PomTemplateContext_preintegrationtest=Perform actions required before integration tests are executed. This may involve things such as setting up the required environment
+PomTemplateContext_preparepackage=Perform any operations necessary to prepare a package before the actual packaging. This often results in an unpacked, processed version of the package. (Maven 2.1 and above)
+PomTemplateContext_presite=Executes processes needed prior to the actual project site generation
+PomTemplateContext_processclasses=Post-process the generated files from compilation, for example to do bytecode enhancement on Java classes
+PomTemplateContext_processresources=Copy and process the resources into the destination directory, ready for packaging
+PomTemplateContext_processsources=Process the source code, for example to filter any values
+PomTemplateContext_processtestclasses=Post-process the generated files from test compilation, for example to do bytecode enhancement on Java classes. For Maven 2.0.5 and above
+PomTemplateContext_processtestresources=Copy and process the resources into the test destination directory
+PomTemplateContext_processtestsources=Process the test source code, for example to filter any values
+PomTemplateContext_project_version_hint=For projects developed in sync only.
+PomTemplateContext_site=Generates the project's site documentation
+PomTemplateContext_sitedeploy=Deploys the generated site documentation to the specified web server
+PomTemplateContext_test=Run tests using a suitable unit testing framework. These tests should not require the code be packaged or deployed
+PomTemplateContext_testcompile=Compile the test source code into the test destination directory
+PomTemplateContext_validate=Validate the project is correct and all necessary information is available
+PomTemplateContext_verify=Run any checks to verify the package is valid and meets quality criteria
+PomTextHover_eval1=<html>This expression evaluates to <b>{0}</b>{1}</html>
+PomTextHover_eval2=<br>The property is defined in {0}
+PomTextHover_managed_location=The artifact is managed in {0}
+PomTextHover_managed_location_missing=The managed artifact's location could not be determined.
+PomTextHover_managed_version=The managed version is <b>{0}</b>
+PomTextHover_managed_version_missing=The managed version could not be determined
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/preferences/PomTemplatesPreferencePage.java b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/preferences/PomTemplatesPreferencePage.java
new file mode 100644
index 00000000..67022b62
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/preferences/PomTemplatesPreferencePage.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.xml.preferences;
+
+import org.eclipse.ui.texteditor.templates.TemplatePreferencePage;
+
+import org.eclipse.m2e.editor.xml.MvnIndexPlugin;
+
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class PomTemplatesPreferencePage extends TemplatePreferencePage {
+
+ public PomTemplatesPreferencePage() {
+ setPreferenceStore(MvnIndexPlugin.getDefault().getPreferenceStore());
+ setTemplateStore(MvnIndexPlugin.getDefault().getTemplateStore());
+ setContextTypeRegistry(MvnIndexPlugin.getDefault().getContextTypeRegistry());
+ }
+
+ @Override
+ public boolean performOk() {
+ boolean ok = super.performOk();
+ MvnIndexPlugin.getDefault().savePluginPreferences();
+ return ok;
+ }
+
+ @Override
+ protected boolean isShowFormatterSetting() {
+ return false;
+ }
+
+}
diff --git a/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/template/.gitignore b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/template/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/org.eclipse.m2e.editor.xml/src/main/java/org/eclipse/m2e/editor/xml/template/.gitignore
diff --git a/org.eclipse.m2e.editor/.classpath b/org.eclipse.m2e.editor/.classpath
new file mode 100644
index 00000000..798048dd
--- /dev/null
+++ b/org.eclipse.m2e.editor/.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>
diff --git a/org.eclipse.m2e.editor/.gitignore b/org.eclipse.m2e.editor/.gitignore
new file mode 100644
index 00000000..934e0e06
--- /dev/null
+++ b/org.eclipse.m2e.editor/.gitignore
@@ -0,0 +1,2 @@
+/bin
+/target
diff --git a/org.eclipse.m2e.editor/.project b/org.eclipse.m2e.editor/.project
new file mode 100644
index 00000000..98758e46
--- /dev/null
+++ b/org.eclipse.m2e.editor/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.editor</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.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.editor/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.editor/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..bafe5f29
--- /dev/null
+++ b/org.eclipse.m2e.editor/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,340 @@
+#Thu Feb 04 10:56:12 EST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.uad,*.ucd,*.uld,*.upd,*.udd,*.uod,*.usd,*.utd,*.uud,*.odd,*.ead,*.ecd,*.eld,*.epd,*.edd,*.eod,*.esd,*.etd,*.eud,*.urd*.uml,*.ecore,,*.launch,*.ucls
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=2
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=1
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=2
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/org.eclipse.m2e.editor/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.m2e.editor/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000..895d6ae3
--- /dev/null
+++ b/org.eclipse.m2e.editor/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,6 @@
+#Tue Nov 30 18:51:13 EST 2010
+eclipse.preferences.version=1
+formatter_profile=_m2 plugin
+formatter_settings_version=11
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\n * Copyright (c) 2010 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 *******************************************************************************/</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\nMavenPlugin.log(${exception_var});</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/org.eclipse.m2e.editor/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.m2e.editor/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 00000000..664db45d
--- /dev/null
+++ b/org.eclipse.m2e.editor/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Thu Aug 28 19:40:55 EDT 2008
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
diff --git a/org.eclipse.m2e.editor/.settings/org.eclipse.mylyn.team.ui.prefs b/org.eclipse.m2e.editor/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 00000000..70330615
--- /dev/null
+++ b/org.eclipse.m2e.editor/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Thu Jan 10 02:40:32 EST 2008
+commit.comment.template=${task.key}\: ${task.description}
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.editor/.settings/org.eclipse.pde.prefs b/org.eclipse.m2e.editor/.settings/org.eclipse.pde.prefs
new file mode 100644
index 00000000..ba68e401
--- /dev/null
+++ b/org.eclipse.m2e.editor/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,22 @@
+#Thu Jul 31 11:10:11 EDT 2008
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.deprecated=2
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=2
+compilers.p.no-required-att=1
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=1
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.editor/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.editor/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..0029eebb
--- /dev/null
+++ b/org.eclipse.m2e.editor/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:19 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.editor/META-INF/MANIFEST.MF b/org.eclipse.m2e.editor/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..3459cdbf
--- /dev/null
+++ b/org.eclipse.m2e.editor/META-INF/MANIFEST.MF
@@ -0,0 +1,28 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.m2e.editor;singleton:=true
+Bundle-Version: 0.13.0.qualifier
+Bundle-Activator: org.eclipse.m2e.editor.MavenEditorPlugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.search,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.forms,
+ org.eclipse.jface.text,
+ org.eclipse.wst.sse.ui,
+ org.eclipse.emf.edit.ui;resolution:=optional,
+ org.eclipse.m2e.core;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.maven.runtime;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.model.edit;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.editor.xml;bundle-version="[0.13.0,0.14.0)"
+Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6
+Bundle-Vendor: %Bundle-Vendor
+Bundle-ClassPath: .
+Export-Package: org.eclipse.m2e.editor,
+ org.eclipse.m2e.editor.composites,
+ org.eclipse.m2e.editor.dialogs,
+ org.eclipse.m2e.editor.plugins,
+ org.eclipse.m2e.editor.pom
diff --git a/org.eclipse.m2e.editor/OSGI-INF/l10n/bundle.properties b/org.eclipse.m2e.editor/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000..ce6e4131
--- /dev/null
+++ b/org.eclipse.m2e.editor/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,8 @@
+#Properties file for org.eclipse.m2e.editor
+Bundle-Vendor =Eclipse m2e
+Bundle-Name = Maven Integration for Eclipse (Editors)
+editor.name = Maven POM Editor
+page.name = POM Editor
+extension-point.pageFactory.name = Maven POM editor page factory
+extension-point.lifecycleMapping.name = Lifecycle Mapping Editor Contribution
+extension-point.pluginConfiguration.name = Plugin Configuration Editor Contribution \ No newline at end of file
diff --git a/org.eclipse.m2e.editor/about.html b/org.eclipse.m2e.editor/about.html
new file mode 100644
index 00000000..70e4b67c
--- /dev/null
+++ b/org.eclipse.m2e.editor/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>October 29, 2010</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/org.eclipse.m2e.editor/build.properties b/org.eclipse.m2e.editor/build.properties
new file mode 100644
index 00000000..11e00027
--- /dev/null
+++ b/org.eclipse.m2e.editor/build.properties
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2008-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
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
+jars.compile.order = .
+source.. = src/
+output.. = target/classes/
+bin.includes = plugin.xml,\
+ icons/,\
+ .,\
+ META-INF/,\
+ schema/,\
+ OSGI-INF/l10n/bundle.properties,\
+ about.html
diff --git a/org.eclipse.m2e.editor/icons/advanced_tabs.gif b/org.eclipse.m2e.editor/icons/advanced_tabs.gif
new file mode 100644
index 00000000..75bd8e6c
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/advanced_tabs.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/clear.gif b/org.eclipse.m2e.editor/icons/clear.gif
new file mode 100644
index 00000000..2cd9c544
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/clear.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/clear_disabled.gif b/org.eclipse.m2e.editor/icons/clear_disabled.gif
new file mode 100644
index 00000000..559e4629
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/clear_disabled.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/collapseall.gif b/org.eclipse.m2e.editor/icons/collapseall.gif
new file mode 100644
index 00000000..a2d80a90
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/collapseall.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/copy.gif b/org.eclipse.m2e.editor/icons/copy.gif
new file mode 100644
index 00000000..6d0dd17d
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/copy.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/cut.gif b/org.eclipse.m2e.editor/icons/cut.gif
new file mode 100644
index 00000000..d044e597
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/cut.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/editor-pom.gif b/org.eclipse.m2e.editor/icons/editor-pom.gif
new file mode 100644
index 00000000..aa4c32cd
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/editor-pom.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/effective_pom.gif b/org.eclipse.m2e.editor/icons/effective_pom.gif
new file mode 100644
index 00000000..6a7d8520
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/effective_pom.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/element_obj.gif b/org.eclipse.m2e.editor/icons/element_obj.gif
new file mode 100644
index 00000000..b914ed76
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/element_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/exclude_obj.gif b/org.eclipse.m2e.editor/icons/exclude_obj.gif
new file mode 100644
index 00000000..1b9b737f
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/exclude_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/execution_obj.gif b/org.eclipse.m2e.editor/icons/execution_obj.gif
new file mode 100644
index 00000000..ec477ea4
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/execution_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/expandall.gif b/org.eclipse.m2e.editor/icons/expandall.gif
new file mode 100644
index 00000000..0205b291
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/expandall.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/filter.gif b/org.eclipse.m2e.editor/icons/filter.gif
new file mode 100644
index 00000000..6fe6f0e1
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/filter.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/filter_obj.gif b/org.eclipse.m2e.editor/icons/filter_obj.gif
new file mode 100644
index 00000000..6fe6f0e1
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/filter_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/goal_obj.gif b/org.eclipse.m2e.editor/icons/goal_obj.gif
new file mode 100644
index 00000000..da1a1660
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/goal_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/group.gif b/org.eclipse.m2e.editor/icons/group.gif
new file mode 100644
index 00000000..51e703b1
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/group.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/hierarchy.gif b/org.eclipse.m2e.editor/icons/hierarchy.gif
new file mode 100644
index 00000000..21af3f49
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/hierarchy.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/include_obj.gif b/org.eclipse.m2e.editor/icons/include_obj.gif
new file mode 100644
index 00000000..da72808f
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/include_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/inherited_obj.gif b/org.eclipse.m2e.editor/icons/inherited_obj.gif
new file mode 100644
index 00000000..884952fd
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/inherited_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/jar_obj.gif b/org.eclipse.m2e.editor/icons/jar_obj.gif
new file mode 100644
index 00000000..2fa1d777
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/jar_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/new_jar.gif b/org.eclipse.m2e.editor/icons/new_jar.gif
new file mode 100644
index 00000000..006e02c3
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/new_jar.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/new_plugin.gif b/org.eclipse.m2e.editor/icons/new_plugin.gif
new file mode 100644
index 00000000..c663208e
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/new_plugin.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/new_project.gif b/org.eclipse.m2e.editor/icons/new_project.gif
new file mode 100644
index 00000000..ba5c27b8
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/new_project.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/parent_pom.gif b/org.eclipse.m2e.editor/icons/parent_pom.gif
new file mode 100644
index 00000000..fa4d1b71
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/parent_pom.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/paste.gif b/org.eclipse.m2e.editor/icons/paste.gif
new file mode 100644
index 00000000..39dd4d9d
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/paste.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/person_obj.gif b/org.eclipse.m2e.editor/icons/person_obj.gif
new file mode 100644
index 00000000..6884f974
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/person_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/plugin_obj.gif b/org.eclipse.m2e.editor/icons/plugin_obj.gif
new file mode 100644
index 00000000..8493df40
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/plugin_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/profile_obj.gif b/org.eclipse.m2e.editor/icons/profile_obj.gif
new file mode 100644
index 00000000..7b2c1f75
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/profile_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/project_obj.gif b/org.eclipse.m2e.editor/icons/project_obj.gif
new file mode 100644
index 00000000..94dba885
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/project_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/property_obj.gif b/org.eclipse.m2e.editor/icons/property_obj.gif
new file mode 100644
index 00000000..f8277cfa
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/property_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/refresh.gif b/org.eclipse.m2e.editor/icons/refresh.gif
new file mode 100644
index 00000000..3ca04d06
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/refresh.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/report2_obj.gif b/org.eclipse.m2e.editor/icons/report2_obj.gif
new file mode 100644
index 00000000..16f8b684
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/report2_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/report_obj.gif b/org.eclipse.m2e.editor/icons/report_obj.gif
new file mode 100644
index 00000000..e2f6ddb8
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/report_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/repository_obj.gif b/org.eclipse.m2e.editor/icons/repository_obj.gif
new file mode 100644
index 00000000..6645b64a
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/repository_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/resource_obj.gif b/org.eclipse.m2e.editor/icons/resource_obj.gif
new file mode 100644
index 00000000..3d73df8a
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/resource_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/role_obj.gif b/org.eclipse.m2e.editor/icons/role_obj.gif
new file mode 100644
index 00000000..b3643da0
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/role_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/scope.gif b/org.eclipse.m2e.editor/icons/scope.gif
new file mode 100644
index 00000000..2bd5e10a
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/scope.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/scope_obj.gif b/org.eclipse.m2e.editor/icons/scope_obj.gif
new file mode 100644
index 00000000..2bd5e10a
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/scope_obj.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/select_jar.gif b/org.eclipse.m2e.editor/icons/select_jar.gif
new file mode 100644
index 00000000..299198de
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/select_jar.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/select_maven.gif b/org.eclipse.m2e.editor/icons/select_maven.gif
new file mode 100644
index 00000000..e74037b4
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/select_maven.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/select_plugin.gif b/org.eclipse.m2e.editor/icons/select_plugin.gif
new file mode 100644
index 00000000..3667a55a
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/select_plugin.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/show_group.gif b/org.eclipse.m2e.editor/icons/show_group.gif
new file mode 100644
index 00000000..b487d071
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/show_group.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/show_group2.gif b/org.eclipse.m2e.editor/icons/show_group2.gif
new file mode 100644
index 00000000..5ef0ed7f
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/show_group2.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/show_inherited_dependencies.gif b/org.eclipse.m2e.editor/icons/show_inherited_dependencies.gif
new file mode 100644
index 00000000..a326000d
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/show_inherited_dependencies.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/sort.gif b/org.eclipse.m2e.editor/icons/sort.gif
new file mode 100644
index 00000000..6311cc00
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/sort.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/icons/web.gif b/org.eclipse.m2e.editor/icons/web.gif
new file mode 100644
index 00000000..09f609d6
--- /dev/null
+++ b/org.eclipse.m2e.editor/icons/web.gif
Binary files differ
diff --git a/org.eclipse.m2e.editor/plugin.xml b/org.eclipse.m2e.editor/plugin.xml
new file mode 100644
index 00000000..9a5f777e
--- /dev/null
+++ b/org.eclipse.m2e.editor/plugin.xml
@@ -0,0 +1,45 @@
+<?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
+-->
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="pageFactories" name="%extension-point.pageFactory.name" schema="schema/pageFactories.exsd"/>
+ <extension-point id="org.eclipse.m2e.editor.lifecycleMappingEditorContribution" name="%extension-point.lifecycleMapping.name" schema="schema/org.eclipse.m2e.editor.lifecycleMappingEditorContribution.exsd"/>
+ <extension-point id="org.eclipse.m2e.editor.plugins.configurationEditorContribution" name="%extension-point.pluginConfiguration.name" schema="schema/configurationEditorContribution.exsd"/>
+
+
+ <extension point="org.eclipse.ui.editors">
+ <editor
+ class="org.eclipse.m2e.editor.pom.MavenPomEditor"
+ contributorClass="org.eclipse.m2e.editor.pom.MavenPomEditorContributor"
+ icon="icons/editor-pom.gif"
+ id="org.eclipse.m2e.editor.MavenPomEditor"
+ name="%editor.name">
+ <contentTypeBinding contentTypeId="org.eclipse.m2e.core.pomFile"/>
+ </editor>
+ </extension>
+
+ <extension point="org.eclipse.m2e.core.m2menu">
+ <factory class="org.eclipse.m2e.editor.internal.actions.PomEditorMenuCreator"/>
+ </extension>
+ <extension point="org.eclipse.ui.preferencePages">
+ <page id="org.eclipse.m2e.editor.pom.PomEditorPreferencePage"
+ category="org.eclipse.m2e.core.preferences.Maven2PreferencePage"
+ class="org.eclipse.m2e.editor.pom.PomEditorPreferencePage"
+ name="%page.name">
+ <keywordReference id="org.eclipse.m2e.maven"/>
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.m2e.editor.lifecycleMappingEditorContribution">
+ <editContributor
+ class="org.eclipse.m2e.editor.lifecycle.custom.CustomLifecycleMappingEditorContribution"
+ editorFor="customizable">
+ </editContributor>
+ </extension>
+</plugin>
diff --git a/org.eclipse.m2e.editor/pom.xml b/org.eclipse.m2e.editor/pom.xml
new file mode 100644
index 00000000..a10c4dcc
--- /dev/null
+++ b/org.eclipse.m2e.editor/pom.xml
@@ -0,0 +1,24 @@
+<?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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.editor</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>Maven POM Editor</name>
+
+</project>
diff --git a/org.eclipse.m2e.editor/schema/configurationEditorContribution.exsd b/org.eclipse.m2e.editor/schema/configurationEditorContribution.exsd
new file mode 100644
index 00000000..4e40540a
--- /dev/null
+++ b/org.eclipse.m2e.editor/schema/configurationEditorContribution.exsd
@@ -0,0 +1,123 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2e.editor" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.m2e.editor" id="org.eclipse.m2e.editor.plugins.configurationEditorContribution" name="Plugin Configuration Editor Contribution"/>
+ </appInfo>
+ <documentation>
+ This extension point offers additional support for creation and configuration of Maven plug-ins in the m2eclipse POM editor.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="editContributor"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="editContributor">
+ <complexType>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+ Configuration editor implementation. If ommitted, a link to the default XML editor tab will be presented by the POM wizard.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.m2e.editor.plugins.IPluginConfigurationExtension"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ Display name - will be used in the pop-up menu to select a known plugin implementation.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="groupId" type="string" use="required">
+ <annotation>
+ <documentation>
+ Maven group id
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="artifactId" type="string" use="required">
+ <annotation>
+ <documentation>
+ Maven artifact id
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/org.eclipse.m2e.editor/schema/org.eclipse.m2e.editor.lifecycleMappingEditorContribution.exsd b/org.eclipse.m2e.editor/schema/org.eclipse.m2e.editor.lifecycleMappingEditorContribution.exsd
new file mode 100644
index 00000000..a359c7fc
--- /dev/null
+++ b/org.eclipse.m2e.editor/schema/org.eclipse.m2e.editor.lifecycleMappingEditorContribution.exsd
@@ -0,0 +1,112 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2e.editor" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.m2e.editor" id="org.eclipse.m2e.editor.lifecycleMappingEditorContribution" name="Lifecycle Mapping Editor Contribution"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="editContributor"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="editContributor">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.m2e.editor.lifecycle.ILifecycleMappingEditorContribution"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="editorFor" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="identifier"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/org.eclipse.m2e.editor/schema/pageFactories.exsd b/org.eclipse.m2e.editor/schema/pageFactories.exsd
new file mode 100644
index 00000000..86f814d1
--- /dev/null
+++ b/org.eclipse.m2e.editor/schema/pageFactories.exsd
@@ -0,0 +1,114 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.m2e.editor" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.m2e.editor" id="pageFactories" name="Maven POM editor page factories"/>
+ </appinfo>
+ <documentation>
+ Maven POM Editor page factrories
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="factory"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="factory">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Maven POM editor page factory implementation
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.m2e.editor.pom.MavenPomEditorPageFactory:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 0.9.7
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ 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
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/MavenEditorImages.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/MavenEditorImages.java
new file mode 100644
index 00000000..2597fa6c
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/MavenEditorImages.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class MavenEditorImages {
+
+ // images
+
+ public static final Image IMG_CLEAR = createImage("clear.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_CLEAR_DISABLED = createImage("clear_disabled.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_PROJECT = createImage("project_obj.gif"); //$NON-NLS-1$
+
+ // object images
+
+ public static final Image IMG_JAR = createImage("jar_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_INHERITED = createImage("inherited_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_REPOSITORY = createImage("repository_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_PLUGIN = createImage("plugin_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_EXECUTION = createImage("execution_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_GOAL = createImage("goal_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_FILTER = createImage("filter_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_RESOURCE = createImage("resource_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_INCLUDE = createImage("include_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_EXCLUDE = createImage("exclude_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_PERSON = createImage("person_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_ROLE = createImage("role_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_PROPERTY = createImage("property_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_REPORT = createImage("report_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_PROFILE = createImage("profile_obj.gif"); //$NON-NLS-1$
+
+ public static final Image IMG_SCOPE = createImage("scope_obj.gif"); //$NON-NLS-1$
+
+ // image descriptors
+
+ public static final ImageDescriptor REFRESH = create("refresh.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor COLLAPSE_ALL = create("collapseall.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor EXPAND_ALL = create("expandall.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor SHOW_GROUP = create("show_group.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor SHOW_INHERITED_DEPENDENCIES = create("show_inherited_dependencies.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor ADD_MODULE = create("new_project.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor ADD_ARTIFACT = create("new_jar.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor SELECT_ARTIFACT = create("select_jar.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor ADD_PLUGIN = create("new_plugin.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor SELECT_PLUGIN = create("select_plugin.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor SORT = create("sort.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor FILTER = create("filter.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor EFFECTIVE_POM = create("effective_pom.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PARENT_POM = create("parent_pom.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor WEB_PAGE = create("web.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor HIERARCHY = create("hierarchy.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor SCOPE = create("scope.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor ADVANCED_TABS = create("advanced_tabs.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor ELEMENT_OBJECT = create("element_obj.gif"); //$NON-NLS-1$
+
+
+ private static ImageDescriptor create(String key) {
+ try {
+ ImageDescriptor imageDescriptor = createDescriptor(key);
+ ImageRegistry imageRegistry = getImageRegistry();
+ if(imageRegistry!=null) {
+ imageRegistry.put(key, imageDescriptor);
+ }
+ return imageDescriptor;
+ } catch (Exception ex) {
+ MavenLogger.log(key, ex);
+ return null;
+ }
+ }
+
+ private static Image createImage(String key) {
+ create(key);
+ ImageRegistry imageRegistry = getImageRegistry();
+ return imageRegistry==null ? null : imageRegistry.get(key);
+ }
+
+ private static ImageRegistry getImageRegistry() {
+ MavenEditorPlugin plugin = MavenEditorPlugin.getDefault();
+ return plugin==null ? null : plugin.getImageRegistry();
+ }
+
+ private static ImageDescriptor createDescriptor(String image) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(MavenEditorPlugin.PLUGIN_ID, "icons/" + image); //$NON-NLS-1$
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/MavenEditorPlugin.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/MavenEditorPlugin.java
new file mode 100644
index 00000000..2a1454e8
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/MavenEditorPlugin.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class MavenEditorPlugin extends AbstractUIPlugin {
+
+ public static final String PLUGIN_ID = "org.eclipse.m2e.editor"; //$NON-NLS-1$
+
+ private static MavenEditorPlugin instance;
+
+ public MavenEditorPlugin() {
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ instance = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ instance = null;
+ }
+
+ public static MavenEditorPlugin getDefault() {
+ return instance;
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/BuildComposite.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/BuildComposite.java
new file mode 100644
index 00000000..a755dea2
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/BuildComposite.java
@@ -0,0 +1,705 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.composites;
+
+import static org.eclipse.m2e.editor.pom.FormUtils.setButton;
+import static org.eclipse.m2e.editor.pom.FormUtils.setText;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.editor.pom.FormUtils;
+import org.eclipse.m2e.editor.pom.MavenPomEditorPage;
+import org.eclipse.m2e.editor.pom.ValueProvider;
+import org.eclipse.m2e.model.edit.pom.BuildBase;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Resource;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class BuildComposite extends Composite {
+
+ protected static PomPackage POM_PACKAGE = PomPackage.eINSTANCE;
+
+ private FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+
+ MavenPomEditorPage parent;
+
+ // controls
+ Text defaultGoalText;
+ Text directoryText;
+ Text finalNameText;
+
+ ListEditorComposite<String> filtersEditor;
+
+ ListEditorComposite<Resource> resourcesEditor;
+ ListEditorComposite<Resource> testResourcesEditor;
+
+ Text resourceDirectoryText;
+ Text resourceTargetPathText;
+ ListEditorComposite<String> resourceIncludesEditor;
+ ListEditorComposite<String> resourceExcludesEditor;
+
+ Button resourceFilteringButton;
+ Section resourceDetailsSection;
+
+ // model
+ Resource currentResource;
+
+ boolean changingSelection = false;
+
+ ValueProvider<BuildBase> buildProvider;
+
+
+ public BuildComposite(Composite parent, int flags) {
+ super(parent, flags);
+
+ toolkit.adapt(this);
+
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ layout.makeColumnsEqualWidth = true;
+ setLayout(layout);
+
+ createBuildSection();
+ }
+
+ private void createBuildSection() {
+ SashForm horizontalSash = new SashForm(this, SWT.NONE);
+ toolkit.adapt(horizontalSash);
+ horizontalSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ Section buildSection = toolkit.createSection(horizontalSash, ExpandableComposite.TITLE_BAR);
+ buildSection.setText(Messages.BuildComposite_section_build);
+
+ Composite composite = toolkit.createComposite(buildSection, SWT.NONE);
+ GridLayout compositeLayout = new GridLayout(2, false);
+ compositeLayout.marginWidth = 1;
+ compositeLayout.marginHeight = 2;
+ composite.setLayout(compositeLayout);
+ toolkit.paintBordersFor(composite);
+ buildSection.setClient(composite);
+
+ toolkit.createLabel(composite, Messages.BuildComposite_lblDefaultGoal, SWT.NONE);
+
+ defaultGoalText = toolkit.createText(composite, null, SWT.NONE);
+ defaultGoalText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ toolkit.createLabel(composite, Messages.BuildComposite_lblDirectory, SWT.NONE);
+
+ directoryText = toolkit.createText(composite, null, SWT.NONE);
+ directoryText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ toolkit.createLabel(composite, Messages.BuildComposite_lblFinalName, SWT.NONE);
+
+ finalNameText = toolkit.createText(composite, null, SWT.NONE);
+ finalNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Label filtersLabel = toolkit.createLabel(composite, Messages.BuildComposite_lblFilters, SWT.NONE);
+ filtersLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
+
+ filtersEditor = new ListEditorComposite<String>(composite, SWT.NONE);
+ GridData filtersEditorData = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
+ filtersEditorData.heightHint = 47;
+ filtersEditor.setLayoutData(filtersEditorData);
+ toolkit.adapt(filtersEditor);
+ toolkit.paintBordersFor(filtersEditor);
+
+ filtersEditor.setContentProvider(new ListEditorContentProvider<String>());
+ filtersEditor.setLabelProvider(new StringLabelProvider(MavenEditorImages.IMG_FILTER));
+
+ filtersEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ boolean created = false;
+ BuildBase build = createBuildBase(compoundCommand, editingDomain);
+ EList<String> filters = build.getFilters();
+
+ String filter = "?";
+
+ Command addCommand = AddCommand.create(editingDomain, build, POM_PACKAGE.getBuildBase_Filters(), filter);
+ compoundCommand.append(addCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ if(created) {
+ filtersEditor.setInput(filters);
+ }
+ filtersEditor.setSelection(Collections.singletonList(filter));
+ }
+ });
+
+ filtersEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ List<String> selection = filtersEditor.getSelection();
+ for(String filter : selection) {
+ Command removeCommand = RemoveCommand.create(editingDomain, buildProvider.getValue(), //
+ POM_PACKAGE.getBuildBase_Filters(), filter);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ }
+ });
+
+ filtersEditor.setCellModifier(new ICellModifier() {
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+
+ public Object getValue(Object element, String property) {
+ return element;
+ }
+
+ public void modify(Object element, String property, Object value) {
+ int n = filtersEditor.getViewer().getTable().getSelectionIndex();
+ EList<String> filters = buildProvider.getValue().getFilters();
+ if(!value.equals(filters.get(n))) {
+ EditingDomain editingDomain = parent.getEditingDomain();
+ Command command = SetCommand.create(editingDomain, buildProvider.getValue(), //
+ POM_PACKAGE.getBuildBase_Filters(), value, n);
+ editingDomain.getCommandStack().execute(command);
+ filtersEditor.refresh();
+ }
+ }
+ });
+
+ ///
+
+ SashForm verticalSash = new SashForm(horizontalSash, SWT.VERTICAL);
+
+ createResourceSection(verticalSash);
+ createTestResourcesSection(verticalSash);
+
+ verticalSash.setWeights(new int[] {1, 1});
+
+ createResourceDetailsSection(horizontalSash);
+
+ horizontalSash.setWeights(new int[] {1, 1, 1});
+ }
+
+ private void createResourceDetailsSection(SashForm horizontalSash) {
+ resourceDetailsSection = toolkit.createSection(horizontalSash, ExpandableComposite.TITLE_BAR);
+ resourceDetailsSection.setText(Messages.BuildComposite_sectionResourceDetails);
+
+ Composite resourceDetailsComposite = toolkit.createComposite(resourceDetailsSection, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2, false);
+ gridLayout.marginWidth = 1;
+ gridLayout.marginHeight = 2;
+ resourceDetailsComposite.setLayout(gridLayout);
+ toolkit.paintBordersFor(resourceDetailsComposite);
+ resourceDetailsSection.setClient(resourceDetailsComposite);
+
+ Label resourceDirectoryLabel = toolkit.createLabel(resourceDetailsComposite, Messages.BuildComposite_lblDirectory, SWT.NONE);
+ resourceDirectoryLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+
+ resourceDirectoryText = toolkit.createText(resourceDetailsComposite, null, SWT.NONE);
+ resourceDirectoryText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Label resourceTargetPathLabel = toolkit.createLabel(resourceDetailsComposite, Messages.BuildComposite_lblTargetPath, SWT.NONE);
+ resourceTargetPathLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+
+ resourceTargetPathText = toolkit.createText(resourceDetailsComposite, null, SWT.NONE);
+ resourceTargetPathText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ resourceFilteringButton = toolkit.createButton(resourceDetailsComposite, Messages.BuildComposite_btnFiltering, SWT.CHECK);
+ resourceFilteringButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+
+ Label includesLabel = toolkit.createLabel(resourceDetailsComposite, Messages.BuildComposite_lblIncludes, SWT.NONE);
+ includesLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+
+ resourceIncludesEditor = new ListEditorComposite<String>(resourceDetailsComposite, SWT.NONE);
+ GridData includesEditorData = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
+ includesEditorData.heightHint = 60;
+ resourceIncludesEditor.setLayoutData(includesEditorData);
+ toolkit.adapt(resourceIncludesEditor);
+ toolkit.paintBordersFor(resourceIncludesEditor);
+
+ resourceIncludesEditor.setContentProvider(new ListEditorContentProvider<String>());
+ resourceIncludesEditor.setLabelProvider(new StringLabelProvider(MavenEditorImages.IMG_INCLUDE));
+
+ resourceIncludesEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ boolean created = false;
+ EList<String> includes = currentResource.getIncludes();
+
+
+ String include = "?";
+ Command addCommand = AddCommand.create(editingDomain, currentResource, POM_PACKAGE.getResource_Includes(), include);
+ compoundCommand.append(addCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ if(created) {
+ resourceIncludesEditor.setInput(includes);
+ }
+ resourceIncludesEditor.setSelection(Collections.singletonList(include));
+ }
+ });
+
+ resourceIncludesEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ List<String> selection = resourceIncludesEditor.getSelection();
+ for(String include : selection) {
+ Command removeCommand = RemoveCommand.create(editingDomain, currentResource, //
+ POM_PACKAGE.getResource_Includes(), include);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ }
+ });
+
+ resourceIncludesEditor.setCellModifier(new ICellModifier() {
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+
+ public Object getValue(Object element, String property) {
+ return element;
+ }
+
+ public void modify(Object element, String property, Object value) {
+ int n = resourceIncludesEditor.getViewer().getTable().getSelectionIndex();
+ EList<String> includes = currentResource.getIncludes();
+ if(!value.equals(includes.get(n))) {
+ EditingDomain editingDomain = parent.getEditingDomain();
+ Command command = SetCommand.create(editingDomain, currentResource, //
+ POM_PACKAGE.getResource_Includes(), value, n);
+ editingDomain.getCommandStack().execute(command);
+ resourceIncludesEditor.refresh();
+ }
+ }
+ });
+
+ Label excludesLabel = toolkit.createLabel(resourceDetailsComposite, Messages.BuildComposite_lblExcludes, SWT.NONE);
+ excludesLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+
+ resourceExcludesEditor = new ListEditorComposite<String>(resourceDetailsComposite, SWT.NONE);
+ GridData excludesEditorData = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
+ excludesEditorData.heightHint = 60;
+ resourceExcludesEditor.setLayoutData(excludesEditorData);
+ toolkit.adapt(resourceExcludesEditor);
+ toolkit.paintBordersFor(resourceExcludesEditor);
+
+ resourceExcludesEditor.setContentProvider(new ListEditorContentProvider<String>());
+ resourceExcludesEditor.setLabelProvider(new StringLabelProvider(MavenEditorImages.IMG_EXCLUDE));
+
+ resourceExcludesEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ boolean created = false;
+ EList<String> excludes = currentResource.getExcludes();
+
+ String exclude = "?";
+ Command addCommand = AddCommand.create(editingDomain, currentResource, POM_PACKAGE.getResource_Excludes(), exclude);
+ compoundCommand.append(addCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ if(created) {
+ resourceExcludesEditor.setInput(excludes);
+ }
+ resourceExcludesEditor.setSelection(Collections.singletonList(exclude));
+ }
+ });
+
+ resourceExcludesEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ List<String> selection = resourceExcludesEditor.getSelection();
+ for(String exclude : selection) {
+ Command removeCommand = RemoveCommand.create(editingDomain, currentResource, //
+ POM_PACKAGE.getResource_Excludes(), exclude);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ }
+ });
+
+ resourceExcludesEditor.setCellModifier(new ICellModifier() {
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+
+ public Object getValue(Object element, String property) {
+ return element;
+ }
+
+ public void modify(Object element, String property, Object value) {
+ int n = resourceExcludesEditor.getViewer().getTable().getSelectionIndex();
+ EList<String> excludes = currentResource.getExcludes();
+ if(!value.equals(excludes.get(n))) {
+ EditingDomain editingDomain = parent.getEditingDomain();
+ Command command = SetCommand.create(editingDomain, currentResource, //
+ POM_PACKAGE.getResource_Excludes(), value, n);
+ editingDomain.getCommandStack().execute(command);
+ resourceExcludesEditor.refresh();
+ }
+ }
+ });
+
+ }
+
+ private void createResourceSection(SashForm verticalSash) {
+ Section resourcesSection = toolkit.createSection(verticalSash, ExpandableComposite.TITLE_BAR);
+ resourcesSection.setText(Messages.BuildComposite_sectionResources);
+
+ resourcesEditor = new ListEditorComposite<Resource>(resourcesSection, SWT.NONE);
+ resourcesSection.setClient(resourcesEditor);
+ toolkit.adapt(resourcesEditor);
+ toolkit.paintBordersFor(resourcesEditor);
+
+ resourcesEditor.setContentProvider(new ListEditorContentProvider<Resource>());
+ resourcesEditor.setLabelProvider(new ResourceLabelProvider());
+
+ resourcesEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<Resource> selection = resourcesEditor.getSelection();
+ loadResourceDetails(selection.size()==1 ? selection.get(0) : null);
+
+ if(!selection.isEmpty()) {
+ changingSelection = true;
+ try {
+ testResourcesEditor.setSelection(Collections.<Resource>emptyList());
+ } finally {
+ changingSelection = false;
+ }
+ }
+ }
+ });
+
+ resourcesEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ boolean created = false;
+ BuildBase build = createBuildBase(compoundCommand, editingDomain);
+ EList<Resource> resources = build.getResources();
+
+ Resource resource = PomFactory.eINSTANCE.createResource();
+ Command addCommand = AddCommand.create(editingDomain, build, POM_PACKAGE.getBuildBase_Resources(), resource);
+ compoundCommand.append(addCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ if(created) {
+ resourcesEditor.setInput(resources);
+ }
+ resourcesEditor.setSelection(Collections.singletonList(resource));
+ resourceDirectoryText.setFocus();
+ }
+ });
+
+ resourcesEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ List<Resource> selection = resourcesEditor.getSelection();
+ for(Resource resource : selection) {
+ Command removeCommand = RemoveCommand.create(editingDomain, buildProvider.getValue(), //
+ POM_PACKAGE.getBuildBase_Resources(), resource);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ }
+ });
+ }
+
+ private void createTestResourcesSection(SashForm verticalSash) {
+ Section testResourcesSection = toolkit.createSection(verticalSash, ExpandableComposite.TITLE_BAR);
+ testResourcesSection.setText(Messages.BuildComposite_sectionTestResources);
+ toolkit.adapt(verticalSash, true, true);
+
+ testResourcesEditor = new ListEditorComposite<Resource>(testResourcesSection, SWT.NONE);
+ testResourcesSection.setClient(testResourcesEditor);
+ toolkit.adapt(testResourcesEditor);
+ toolkit.paintBordersFor(testResourcesEditor);
+
+ testResourcesEditor.setContentProvider(new ListEditorContentProvider<Resource>());
+ testResourcesEditor.setLabelProvider(new ResourceLabelProvider());
+
+ testResourcesEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<Resource> selection = testResourcesEditor.getSelection();
+ loadResourceDetails(selection.size()==1 ? selection.get(0) : null);
+
+ if(!selection.isEmpty()) {
+ changingSelection = true;
+ try {
+ resourcesEditor.setSelection(Collections.<Resource>emptyList());
+ } finally {
+ changingSelection = false;
+ }
+ }
+ }
+ });
+
+ testResourcesEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ boolean created = false;
+ BuildBase build = createBuildBase(compoundCommand, editingDomain);
+ EList<Resource> testResources = build.getTestResources();
+
+ Resource resource = PomFactory.eINSTANCE.createResource();
+ Command addCommand = AddCommand.create(editingDomain, build, POM_PACKAGE.getBuildBase_TestResources(), resource);
+ compoundCommand.append(addCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ if(created) {
+ testResourcesEditor.setInput(testResources);
+ }
+ testResourcesEditor.setSelection(Collections.singletonList(resource));
+ resourceDirectoryText.setFocus();
+ }
+ });
+
+ testResourcesEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ List<Resource> selection = testResourcesEditor.getSelection();
+ for(Resource resource : selection) {
+ Command removeCommand = RemoveCommand.create(editingDomain, buildProvider.getValue(), //
+ POM_PACKAGE.getBuildBase_TestResources(), resource);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ }
+ });
+ }
+
+ public void loadData(MavenPomEditorPage editorPage, ValueProvider<BuildBase> buildProvider) {
+ this.parent = editorPage;
+ this.buildProvider = buildProvider;
+
+ loadBuild();
+ loadResources();
+ loadTestResources();
+
+ loadResourceDetails(null);
+
+ filtersEditor.setReadOnly(parent.isReadOnly());
+ resourcesEditor.setReadOnly(parent.isReadOnly());
+ testResourcesEditor.setReadOnly(parent.isReadOnly());
+
+ resourceIncludesEditor.setReadOnly(parent.isReadOnly());
+ resourceExcludesEditor.setReadOnly(parent.isReadOnly());
+ }
+
+ public void updateView(MavenPomEditorPage editorPage, Notification notification) {
+ Object object = notification.getNotifier();
+
+ Object feature = notification.getFeature();
+
+ if(object instanceof BuildBase) {
+ loadBuild();
+ }
+
+ if(feature == PomPackage.Literals.BUILD_BASE__FILTERS) {
+ filtersEditor.refresh();
+ }
+
+ if(feature == PomPackage.Literals.BUILD_BASE__RESOURCES) {
+ resourcesEditor.refresh();
+ }
+
+ if(feature == PomPackage.Literals.BUILD_BASE__TEST_RESOURCES) {
+ testResourcesEditor.refresh();
+ }
+
+ if(object instanceof Resource) {
+ resourcesEditor.refresh();
+ testResourcesEditor.refresh();
+ if(object == currentResource) {
+ Object notificationObject = MavenPomEditorPage.getFromNotification(notification);
+ if(notificationObject == null || notificationObject instanceof Resource) {
+ loadResourceDetails((Resource) notificationObject);
+ }
+ }
+ }
+
+ if(feature == PomPackage.Literals.RESOURCE__INCLUDES) {
+ resourceIncludesEditor.refresh();
+ }
+
+ if(feature == PomPackage.Literals.RESOURCE__EXCLUDES) {
+ resourceExcludesEditor.refresh();
+ }
+
+ // XXX handle other notification types
+ }
+
+ private void loadBuild() {
+ if(parent != null) {
+ parent.removeNotifyListener(defaultGoalText);
+ parent.removeNotifyListener(directoryText);
+ parent.removeNotifyListener(finalNameText);
+ }
+
+ BuildBase build = buildProvider.getValue();
+ if(build!=null) {
+ setText(defaultGoalText, build.getDefaultGoal());
+ setText(directoryText, build.getDirectory());
+ setText(finalNameText, build.getFinalName());
+ } else {
+ setText(defaultGoalText, ""); //$NON-NLS-1$
+ setText(directoryText, ""); //$NON-NLS-1$
+ setText(finalNameText, ""); //$NON-NLS-1$
+ }
+
+ filtersEditor.setInput(build == null //
+ || build.getFilters() == null ? null : build.getFilters());
+
+ parent.setModifyListener(defaultGoalText, buildProvider, POM_PACKAGE.getBuildBase_DefaultGoal(), ""); //$NON-NLS-1$
+ parent.setModifyListener(directoryText, buildProvider, POM_PACKAGE.getBuildBase_Directory(), ""); //$NON-NLS-1$
+ parent.setModifyListener(finalNameText, buildProvider, POM_PACKAGE.getBuildBase_FinalName(), ""); //$NON-NLS-1$
+ }
+
+ private void loadResources() {
+ BuildBase build = buildProvider.getValue();
+ resourcesEditor.setInput(build == null //
+ || build.getResources() == null ? null : build.getResources());
+ }
+
+ private void loadTestResources() {
+ BuildBase build = buildProvider.getValue();
+ testResourcesEditor.setInput(build == null //
+ || build.getTestResources() == null ? null : build.getTestResources());
+ }
+
+ void loadResourceDetails(Resource resource) {
+ if(changingSelection) {
+ return;
+ }
+
+ currentResource = resource;
+
+ if(parent != null) {
+ parent.removeNotifyListener(resourceDirectoryText);
+ parent.removeNotifyListener(resourceTargetPathText);
+ parent.removeNotifyListener(resourceFilteringButton);
+ }
+
+ if(resource == null) {
+ FormUtils.setEnabled(resourceDetailsSection, false);
+
+ setText(resourceDirectoryText, ""); //$NON-NLS-1$
+ setText(resourceTargetPathText, ""); //$NON-NLS-1$
+ setButton(resourceFilteringButton, false);
+
+ resourceIncludesEditor.setInput(null);
+ resourceExcludesEditor.setInput(null);
+
+ return;
+ }
+
+ FormUtils.setEnabled(resourceDetailsSection, true);
+ FormUtils.setReadonly(resourceDetailsSection, parent.isReadOnly());
+
+ setText(resourceDirectoryText, resource.getDirectory());
+ setText(resourceTargetPathText, resource.getTargetPath());
+ setButton(resourceFilteringButton, "true".equals(resource.getFiltering()));
+
+ resourceIncludesEditor.setInput(resource.getIncludes()==null ? null : resource.getIncludes());
+ resourceExcludesEditor.setInput(resource.getExcludes()==null ? null : resource.getExcludes());
+
+ ValueProvider<Resource> provider = new ValueProvider.DefaultValueProvider<Resource>(resource);
+ parent.setModifyListener(resourceDirectoryText, provider, POM_PACKAGE.getResource_Directory(), ""); //$NON-NLS-1$
+ parent.setModifyListener(resourceTargetPathText, provider, POM_PACKAGE.getResource_TargetPath(), ""); //$NON-NLS-1$
+ parent.setModifyListener(resourceFilteringButton, provider, POM_PACKAGE.getResource_Filtering(), "false");
+
+ parent.registerListeners();
+ }
+
+ BuildBase createBuildBase(CompoundCommand compoundCommand, EditingDomain editingDomain) {
+ BuildBase build = buildProvider.getValue();
+ if(build == null) {
+ build = buildProvider.create(editingDomain, compoundCommand);
+ }
+ return build;
+ }
+
+ /**
+ * Label provider for {@link Resource}
+ */
+ public class ResourceLabelProvider extends LabelProvider {
+
+ public String getText(Object element) {
+ if(element instanceof Resource) {
+ return ((Resource) element).getDirectory();
+ }
+ return super.getText(element);
+ }
+
+ public Image getImage(Object element) {
+ return MavenEditorImages.IMG_RESOURCE;
+ }
+
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComparator.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComparator.java
new file mode 100644
index 00000000..dd43add5
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComparator.java
@@ -0,0 +1,80 @@
+package org.eclipse.m2e.editor.composites;
+
+import java.util.Comparator;
+
+import org.eclipse.m2e.model.edit.pom.Dependency;
+
+public class DependenciesComparator<T> implements Comparator<T> {
+
+ private boolean sortByGroups = true;
+
+ public int compare(T o1, T o2) {
+ String[] gav1;
+ String[] gav2;
+
+ if (o1 instanceof Dependency) {
+ gav1 = toGAV((Dependency) o1);
+ } else {
+ gav1 = toGAV((org.apache.maven.model.Dependency) o1);
+ }
+
+ if (o2 instanceof Dependency) {
+ gav2 = toGAV((Dependency) o2);
+ } else {
+ gav2 = toGAV((org.apache.maven.model.Dependency) o2);
+ }
+
+ return compareGAVs(gav1, gav2);
+ }
+
+ protected String[] toGAV(Dependency dep) {
+ String[] gav = new String[3];
+ gav[0] = dep.getGroupId();
+ gav[1] = dep.getArtifactId();
+ gav[2] = dep.getVersion();
+ return gav;
+ }
+
+ protected String[] toGAV(org.apache.maven.model.Dependency dep) {
+ String[] gav = new String[3];
+ gav[0] = dep.getGroupId();
+ gav[1] = dep.getArtifactId();
+ gav[2] = dep.getVersion();
+ return gav;
+ }
+
+ protected int compareGAVs(String[] gav1, String[] gav2) {
+
+ String g1 = gav1[0] == null ? "" : gav1[0]; //$NON-NLS-1$
+ String g2 = gav2[0] == null ? "" : gav2[0]; //$NON-NLS-1$
+
+ String a1 = gav1[1] == null ? "" : gav1[1]; //$NON-NLS-1$
+ String a2 = gav2[1] == null ? "" : gav2[1]; //$NON-NLS-1$
+
+ String v1 = gav1[2] == null ? "" : gav1[2]; //$NON-NLS-1$
+ String v2 = gav2[2] == null ? "" : gav2[2]; //$NON-NLS-1$
+
+ return compareDependencies(g1, a1, v1, g2, a2, v2);
+ }
+
+ protected int compareDependencies(String group1, String artifact1, String version1,
+ String group2, String artifact2, String version2) {
+ int comp = 0;
+ if (sortByGroups && (comp = group1.compareTo(group2)) != 0) {
+ return comp;
+ }
+ if ((comp = artifact1.compareTo(artifact2)) != 0) {
+ return comp;
+ }
+
+ return version1.compareTo(version2);
+ }
+
+ /**
+ * Set this to false to ignore groupIDs while sorting
+ * @param sortByGroups
+ */
+ public void setSortByGroups(boolean sortByGroups) {
+ this.sortByGroups = sortByGroups;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java
new file mode 100644
index 00000000..687462c2
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java
@@ -0,0 +1,954 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.composites;
+
+import static org.eclipse.m2e.editor.pom.FormUtils.nvl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.project.MavenProject;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.window.Window;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.ui.dialogs.AddDependencyDialog;
+import org.eclipse.m2e.core.ui.dialogs.EditDependencyDialog;
+import org.eclipse.m2e.core.ui.dialogs.MavenRepositorySearchDialog;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.MavenEditorPlugin;
+import org.eclipse.m2e.editor.dialogs.ManageDependenciesDialog;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.editor.pom.MavenPomEditor;
+import org.eclipse.m2e.editor.pom.MavenPomEditor.Callback;
+import org.eclipse.m2e.editor.pom.MavenPomEditorPage;
+import org.eclipse.m2e.editor.pom.SearchControl;
+import org.eclipse.m2e.editor.pom.SearchMatcher;
+import org.eclipse.m2e.editor.pom.ValueProvider;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.DependencyManagement;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.sonatype.aether.graph.DependencyNode;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class DependenciesComposite extends Composite {
+
+ protected static PomPackage POM_PACKAGE = PomPackage.eINSTANCE;
+
+ protected MavenPomEditorPage editorPage;
+
+ MavenPomEditor pomEditor;
+
+ private FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+
+ // controls
+
+ PropertiesListComposite<Dependency> dependencyManagementEditor;
+
+ //This ListComposite takes both m2e and maven Dependencies
+ DependenciesListComposite<Object> dependenciesEditor;
+
+ Button dependencySelectButton;
+
+ Action dependencySelectAction;
+
+ SearchControl searchControl;
+
+ SearchMatcher searchMatcher;
+
+ DependencyFilter searchFilter;
+
+ Action openWebPageAction;
+
+ // model
+
+ Model model;
+
+ MavenProject mavenProject;
+
+ ValueProvider<DependencyManagement> dependencyManagementProvider;
+
+ DependencyLabelProvider dependencyLabelProvider = new DependencyLabelProvider();
+
+ DependencyLabelProvider dependencyManagementLabelProvider = new DependencyLabelProvider();
+
+ protected boolean showInheritedDependencies = false;
+ IMavenProjectFacade facade = null;
+
+ ListEditorContentProvider<Object> dependenciesContentProvider = new ListEditorContentProvider<Object>();
+
+ DependenciesComparator<Object> dependenciesComparator;
+
+ ListEditorContentProvider<Dependency> dependencyManagementContentProvider = new ListEditorContentProvider<Dependency>();
+
+ DependenciesComparator<Dependency> dependencyManagementComparator;
+
+ public DependenciesComposite(Composite composite, MavenPomEditorPage editorPage, int flags, MavenPomEditor pomEditor) {
+ super(composite, flags);
+ this.editorPage = editorPage;
+ this.pomEditor = pomEditor;
+ createComposite();
+ editorPage.initPopupMenu(dependenciesEditor.getViewer(), ".dependencies"); //$NON-NLS-1$
+ editorPage.initPopupMenu(dependencyManagementEditor.getViewer(), ".dependencyManagement"); //$NON-NLS-1$
+ }
+
+ private void createComposite() {
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.makeColumnsEqualWidth = true;
+ gridLayout.marginWidth = 0;
+ setLayout(gridLayout);
+ toolkit.adapt(this);
+
+ SashForm horizontalSash = new SashForm(this, SWT.NONE);
+ GridData horizontalCompositeGridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ horizontalCompositeGridData.heightHint = 200;
+ horizontalSash.setLayoutData(horizontalCompositeGridData);
+ toolkit.adapt(horizontalSash, true, true);
+
+ createDependenciesSection(horizontalSash);
+ createDependencyManagementSection(horizontalSash);
+
+ horizontalSash.setWeights(new int[] {1, 1});
+ }
+
+ private void createDependenciesSection(SashForm verticalSash) {
+ Section dependenciesSection = toolkit.createSection(verticalSash, ExpandableComposite.TITLE_BAR);
+ dependenciesSection.marginWidth = 3;
+ dependenciesSection.setText(Messages.DependenciesComposite_sectionDependencies);
+
+ dependenciesComparator = new DependenciesComparator<Object>();
+ dependenciesContentProvider.setComparator(dependenciesComparator);
+
+ dependenciesEditor = new DependenciesListComposite<Object>(dependenciesSection, SWT.NONE, true);
+ dependenciesEditor.setLabelProvider(dependencyLabelProvider);
+ dependenciesEditor.setContentProvider(dependenciesContentProvider);
+
+ dependenciesEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = editorPage.getEditingDomain();
+
+ List<Object> dependencyList = dependenciesEditor.getSelection();
+ for(Object obj : dependencyList) {
+ if (obj instanceof Dependency) {
+ Dependency dependency = (Dependency) obj;
+ Command removeCommand = RemoveCommand.create(editingDomain, model, POM_PACKAGE.getModel_Dependencies(),
+ dependency);
+ compoundCommand.append(removeCommand);
+ } else if (obj instanceof org.apache.maven.model.Dependency) {
+ /*
+ * TODO: Support a refactoring of removing an inherited/managed dependency.
+ */
+ }
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ setDependenciesInput();
+ }
+ });
+
+ dependenciesEditor.setPropertiesListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ Object selection = dependenciesEditor.getSelection().get(0);
+ if (selection instanceof Dependency) {
+ Dependency dependency = (Dependency) selection;
+ EditDependencyDialog d = new EditDependencyDialog(getShell(), false, editorPage.getEditingDomain(), editorPage
+ .getProject());
+ d.setDependency(dependency);
+ if(d.open() == Window.OK) {
+ setDependenciesInput();
+ dependenciesEditor.setSelection(Collections.singletonList((Object) dependency));
+ }
+ } else if (selection instanceof org.apache.maven.model.Dependency) {
+ /*
+ * TODO: Support editing or displaying of inherited/managed dependencies.
+ */
+ }
+ }
+ });
+
+ dependenciesSection.setClient(dependenciesEditor);
+ toolkit.adapt(dependenciesEditor);
+ toolkit.paintBordersFor(dependenciesEditor);
+
+ dependenciesEditor.setManageButtonListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ openManageDependenciesDialog();
+ } catch(InvocationTargetException e1) {
+ MavenEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MavenEditorPlugin.PLUGIN_ID, "Error: ", e1)); //$NON-NLS-1$
+ } catch(InterruptedException e1) {
+ MavenEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MavenEditorPlugin.PLUGIN_ID, "Error: ", e1)); //$NON-NLS-1$
+ }
+ }
+ });
+
+ dependenciesEditor.setAddButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ final AddDependencyDialog addDepDialog = new AddDependencyDialog(getShell(), false, editorPage.getProject());
+
+ /*
+ * Load the dependency tree for the dialog so it can show already
+ * added transitive dependencies.
+ */
+ Runnable runnable = new Runnable() {
+
+ public void run() {
+ pomEditor.loadDependencies(new Callback() {
+
+ public void onFinish(DependencyNode node) {
+ addDepDialog.setDepdencyNode(node);
+ }
+
+ public void onException(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }, Artifact.SCOPE_TEST);
+ }
+ };
+
+ addDepDialog.onLoad(runnable);
+
+ if(addDepDialog.open() == Window.OK) {
+ List<Dependency> deps = addDepDialog.getDependencies();
+ for(Dependency dep : deps) {
+ setupDependency(new ValueProvider<Model>() {
+ @Override
+ public Model getValue() {
+ return model;
+ }
+ }, POM_PACKAGE.getModel_Dependencies(), dep);
+ }
+ setDependenciesInput();
+ dependenciesEditor.setSelection(Collections.singletonList((Object) deps.get(0)));
+ }
+ }
+
+ });
+
+ ToolBarManager modulesToolBarManager = new ToolBarManager(SWT.FLAT);
+
+ modulesToolBarManager.add(new Action(Messages.DependenciesComposite_action_sortAlphabetically, MavenEditorImages.SORT) {
+ {
+ setChecked(false);
+ }
+
+ @Override
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ @Override
+ public void run() {
+ dependenciesContentProvider.setShouldSort(isChecked());
+ dependenciesEditor.getViewer().refresh();
+ }
+ });
+
+ modulesToolBarManager.add(new Action(Messages.DependenciesComposite_action_showInheritedDependencies,
+ MavenEditorImages.SHOW_INHERITED_DEPENDENCIES) {
+ {
+ setChecked(false);
+ }
+
+ @Override
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ @Override
+ public void run() {
+ if (isChecked()) {
+ IRunnableWithProgress projectLoader = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ facade = readMavenProject(monitor);
+ if (facade == null) {
+ return;
+ }
+ dependencyLabelProvider.setFacade(facade);
+ showInheritedDependencies = true;
+
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ ISelection selection = dependenciesEditor.getViewer().getSelection();
+ setDependenciesInput();
+ dependenciesEditor.getViewer().refresh();
+ dependenciesEditor.getViewer().setSelection(selection, true);
+ }
+ });
+ } catch(CoreException e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+ };
+
+
+ try {
+ PlatformUI.getWorkbench().getProgressService().run(true, true, projectLoader);
+ } catch(InvocationTargetException e) {
+ MavenEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MavenEditorPlugin.PLUGIN_ID, null, e));
+ } catch(InterruptedException e) {
+ MavenEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MavenEditorPlugin.PLUGIN_ID, null, e));
+ }
+
+ if (facade == null || facade.getMavenProject() == null
+ || facade.getMavenProject().getModel() == null) {
+ /*
+ * If this is null here, there was an exception thrown during
+ * readMavenProject above, so we should uncheck the button
+ */
+ setChecked(false);
+ }
+ } else {
+ showInheritedDependencies = false;
+ ISelection selection = dependenciesEditor.getViewer().getSelection();
+ setDependenciesInput();
+ dependenciesEditor.getViewer().setSelection(selection, true);
+ }
+ }
+ });
+
+ modulesToolBarManager.add(new Action(Messages.DependenciesComposite_action_showgroupid,
+ MavenEditorImages.SHOW_GROUP) {
+ {
+ setChecked(false);
+ dependenciesComparator.setSortByGroups(false);
+ }
+
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ public void run() {
+ dependencyLabelProvider.setShowGroupId(isChecked());
+ dependenciesComparator.setSortByGroups(isChecked());
+ dependenciesEditor.getViewer().refresh();
+ }
+ });
+
+ modulesToolBarManager.add(new Action(Messages.DependenciesComposite_action_filter, MavenEditorImages.FILTER) {
+ {
+ setChecked(true);
+ }
+
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ public void run() {
+ TableViewer viewer = dependenciesEditor.getViewer();
+ if(isChecked()) {
+ viewer.addFilter(searchFilter);
+ } else {
+ viewer.removeFilter(searchFilter);
+ }
+ viewer.refresh();
+ if(isChecked()) {
+ searchControl.getSearchText().setFocus();
+ }
+ }
+ });
+
+ Composite toolbarComposite = toolkit.createComposite(dependenciesSection);
+ GridLayout toolbarLayout = new GridLayout(1, true);
+ toolbarLayout.marginHeight = 0;
+ toolbarLayout.marginWidth = 0;
+ toolbarComposite.setLayout(toolbarLayout);
+ toolbarComposite.setBackground(null);
+
+ modulesToolBarManager.createControl(toolbarComposite);
+ dependenciesSection.setTextClient(toolbarComposite);
+ }
+
+ private void createDependencyManagementSection(SashForm verticalSash) {
+ Section dependencyManagementSection = toolkit.createSection(verticalSash, ExpandableComposite.TITLE_BAR);
+ dependencyManagementSection.marginWidth = 3;
+ dependencyManagementSection.setText(Messages.DependenciesComposite_sectionDependencyManagement);
+
+ dependencyManagementEditor = new PropertiesListComposite<Dependency>(dependencyManagementSection, SWT.NONE, true);
+ dependencyManagementSection.setClient(dependencyManagementEditor);
+
+ dependencyManagementComparator = new DependenciesComparator<Dependency>();
+ dependencyManagementContentProvider.setComparator(dependencyManagementComparator);
+ dependencyManagementEditor.setLabelProvider(dependencyManagementLabelProvider);
+ dependencyManagementEditor.setContentProvider(dependencyManagementContentProvider);
+
+ dependencyManagementEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = editorPage.getEditingDomain();
+
+ List<Dependency> dependencyList = dependencyManagementEditor.getSelection();
+ for(Dependency dependency : dependencyList) {
+ Command removeCommand = RemoveCommand.create(editingDomain, //
+ dependencyManagementProvider.getValue(), POM_PACKAGE.getDependencyManagement_Dependencies(), dependency);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ }
+ });
+
+ dependencyManagementEditor.setPropertiesListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ Dependency dependency = dependencyManagementEditor.getSelection().get(0);
+ EditDependencyDialog d = new EditDependencyDialog(getShell(), true, editorPage.getEditingDomain(), editorPage
+ .getProject());
+ d.setDependency(dependency);
+ if(d.open() == Window.OK) {
+ dependencyManagementEditor.setInput(dependencyManagementProvider.getValue().getDependencies());
+ dependencyManagementEditor.setSelection(Collections.singletonList(dependency));
+ }
+ }
+ });
+
+ dependencyManagementEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<Dependency> selection = dependencyManagementEditor.getSelection();
+
+ if(!selection.isEmpty()) {
+ dependenciesEditor.setSelection(Collections.<Object> emptyList());
+ }
+ }
+ });
+
+ toolkit.adapt(dependencyManagementEditor);
+ toolkit.paintBordersFor(dependencyManagementEditor);
+
+ dependencyManagementEditor.setAddButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ // TODO calculate current list of artifacts for the project
+ Set<ArtifactKey> artifacts = Collections.emptySet();
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getShell(), //
+ Messages.DependenciesComposite_searchDialog_title, IIndex.SEARCH_ARTIFACT, artifacts, true);
+ if(dialog.open() == Window.OK) {
+ IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+ if(af != null) {
+ Dependency dependency = createDependency(dependencyManagementProvider,
+ POM_PACKAGE.getDependencyManagement_Dependencies(), //
+ af.group, af.artifact, af.version, af.classifier, "jar".equals(nvl(af.type)) ? "" : nvl(af.type), //$NON-NLS-1$ //$NON-NLS-2$
+ "compile".equals(nvl(dialog.getSelectedScope())) ? "" : nvl(dialog.getSelectedScope()));//$NON-NLS-1$ //$NON-NLS-2$
+ dependencyManagementEditor.setInput(dependencyManagementProvider.getValue().getDependencies());
+ dependencyManagementEditor.setSelection(Collections.singletonList(dependency));
+ }
+ }
+ }
+ });
+
+ ToolBarManager modulesToolBarManager = new ToolBarManager(SWT.FLAT);
+
+ modulesToolBarManager.add(new Action(Messages.DependenciesComposite_action_sortAlphabetically, MavenEditorImages.SORT) {
+ {
+ setChecked(false);
+ dependencyManagementContentProvider.setShouldSort(false);
+ }
+
+ @Override
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ @Override
+ public void run() {
+ dependencyManagementContentProvider.setShouldSort(isChecked());
+ dependencyManagementEditor.getViewer().refresh();
+ }
+ });
+
+ modulesToolBarManager.add(new Action(Messages.DependenciesComposite_action_showgroupid,
+ MavenEditorImages.SHOW_GROUP) {
+ {
+ setChecked(false);
+ dependencyManagementComparator.setSortByGroups(false);
+ }
+
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ public void run() {
+ dependencyManagementLabelProvider.setShowGroupId(isChecked());
+ dependencyManagementComparator.setSortByGroups(isChecked());
+ dependencyManagementEditor.getViewer().refresh();
+ }
+ });
+
+ modulesToolBarManager.add(new Action(Messages.DependenciesComposite_action_filter, MavenEditorImages.FILTER) {
+ {
+ setChecked(true);
+ }
+
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ public void run() {
+ TableViewer viewer = dependencyManagementEditor.getViewer();
+ if(isChecked()) {
+ viewer.addFilter(searchFilter);
+ } else {
+ viewer.removeFilter(searchFilter);
+ }
+ viewer.refresh();
+ if(isChecked()) {
+ searchControl.getSearchText().setFocus();
+ }
+ }
+ });
+
+ Composite toolbarComposite = toolkit.createComposite(dependencyManagementSection);
+ GridLayout toolbarLayout = new GridLayout(1, true);
+ toolbarLayout.marginHeight = 0;
+ toolbarLayout.marginWidth = 0;
+ toolbarComposite.setLayout(toolbarLayout);
+ toolbarComposite.setBackground(null);
+
+ modulesToolBarManager.createControl(toolbarComposite);
+ dependencyManagementSection.setTextClient(toolbarComposite);
+ }
+
+
+ @SuppressWarnings("unchecked")
+ public void loadData(Model model, ValueProvider<DependencyManagement> dependencyManagementProvider) {
+ this.model = model;
+ this.dependencyManagementProvider = dependencyManagementProvider;
+ this.dependencyLabelProvider.setPomEditor(editorPage.getPomEditor());
+ this.dependencyManagementLabelProvider.setPomEditor(editorPage.getPomEditor());
+
+ dependenciesEditor.setInput((List<Object>)(List<?>)model.getDependencies());
+
+ DependencyManagement dependencyManagement = dependencyManagementProvider.getValue();
+ dependencyManagementEditor.setInput(dependencyManagement == null ? null : dependencyManagement.getDependencies());
+
+ dependenciesEditor.setReadOnly(editorPage.isReadOnly());
+ dependencyManagementEditor.setReadOnly(editorPage.isReadOnly());
+
+ if(searchControl != null) {
+ searchControl.getSearchText().setEditable(true);
+ }
+ }
+
+ public void updateView(final MavenPomEditorPage editorPage, final Notification notification) {
+ Display.getDefault().asyncExec(new Runnable() {
+ @SuppressWarnings("unchecked")
+ public void run() {
+ EObject object = (EObject) notification.getNotifier();
+
+ // XXX event is not received when <dependencies> is deleted in XML
+ if(object instanceof Model) {
+ Model model2 = (Model) object;
+
+ if(model2.getDependencyManagement() != null && dependencyManagementEditor.getInput() == null) {
+ dependencyManagementEditor.setInput(model2.getDependencyManagement().getDependencies());
+ } else if(model2.getDependencyManagement() == null) {
+ dependencyManagementEditor.setInput(null);
+ }
+
+ if(model2.getDependencies() != null && dependenciesEditor.getInput() == null) {
+ dependenciesEditor.setInput((List<Object>)(List<?>)model2.getDependencies());
+ } else if(model2.getDependencies() == null) {
+ dependenciesEditor.setInput(null);
+ }
+
+ dependenciesEditor.refresh();
+ dependencyManagementEditor.refresh();
+ }
+
+ if(object instanceof DependencyManagement) {
+ if(dependenciesEditor.getInput() == null) {
+ dependenciesEditor.setInput((List<Object>)(List<?>)((DependencyManagement) object).getDependencies());
+ }
+ dependencyManagementEditor.refresh();
+ }
+ }
+ });
+ }
+
+ void setupDependency(ValueProvider<? extends EObject> parentProvider, EReference feature, Dependency dependency) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = editorPage.getEditingDomain();
+
+ EObject parent = parentProvider.getValue();
+ if(parent == null) {
+ parent = parentProvider.create(editingDomain, compoundCommand);
+ }
+
+ Command addDependencyCommand = AddCommand.create(editingDomain, parent, feature, dependency);
+ compoundCommand.append(addDependencyCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ }
+
+ Dependency createDependency(ValueProvider<? extends EObject> parentProvider, EReference feature, String groupId,
+ String artifactId, String version, String classifier, String type, String scope) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = editorPage.getEditingDomain();
+
+ EObject parent = parentProvider.getValue();
+ if(parent == null) {
+ parent = parentProvider.create(editingDomain, compoundCommand);
+ }
+
+ Dependency dependency = PomFactory.eINSTANCE.createDependency();
+ dependency.setGroupId(groupId);
+ dependency.setArtifactId(artifactId);
+ dependency.setVersion(version);
+ dependency.setClassifier(classifier);
+ dependency.setType(type);
+ dependency.setScope(scope);
+
+ Command addDependencyCommand = AddCommand.create(editingDomain, parent, feature, dependency);
+ compoundCommand.append(addDependencyCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ return dependency;
+ }
+
+ public void setSearchControl(SearchControl searchControl) {
+ if(this.searchControl != null) {
+ return;
+ }
+
+ this.searchMatcher = new SearchMatcher(searchControl);
+ this.searchFilter = new DependencyFilter(searchMatcher);
+ this.searchControl = searchControl;
+ this.searchControl.getSearchText().addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ selectDepenendencies(dependenciesEditor, model, POM_PACKAGE.getModel_Dependencies());
+ selectDepenendencies(dependencyManagementEditor, dependencyManagementProvider.getValue(),
+ POM_PACKAGE.getDependencyManagement_Dependencies());
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ private void selectDepenendencies(ListEditorComposite<?> editor, EObject parent,
+ EStructuralFeature feature) {
+ if(parent != null) {
+ editor.setSelection((List) parent.eGet(feature));
+ editor.refresh();
+ }
+ }
+ });
+ //we add filter here as the default behaviour is to filter..
+ TableViewer viewer = dependenciesEditor.getViewer();
+ viewer.addFilter(searchFilter);
+ viewer = dependencyManagementEditor.getViewer();
+ viewer.addFilter(searchFilter);
+
+ }
+
+ String getVersion(String groupId, String artifactId, IProgressMonitor monitor) {
+ try {
+ MavenProject mavenProject = editorPage.getPomEditor().readMavenProject(false, monitor);
+ Artifact a = mavenProject.getArtifactMap().get(groupId + ":" + artifactId); //$NON-NLS-1$
+ if(a != null) {
+ return a.getBaseVersion();
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ return null;
+ }
+
+ public static class DependencyFilter extends ViewerFilter {
+ private SearchMatcher searchMatcher;
+
+ public DependencyFilter(SearchMatcher searchMatcher) {
+ this.searchMatcher = searchMatcher;
+ }
+
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if(element instanceof Dependency) {
+ Dependency d = (Dependency) element;
+ return searchMatcher.isMatchingArtifact(d.getGroupId(), d.getArtifactId());
+ } else if (element instanceof org.apache.maven.model.Dependency) {
+ org.apache.maven.model.Dependency dependency = (org.apache.maven.model.Dependency) element;
+ return searchMatcher.isMatchingArtifact(dependency.getGroupId(), dependency.getArtifactId());
+ }
+ return false;
+ }
+ }
+
+ void openManageDependenciesDialog() throws InvocationTargetException, InterruptedException {
+ /*
+ * A linked list representing the path from child to root parent pom.
+ * The head is the child, the tail is the root pom
+ */
+ final LinkedList<MavenProject> hierarchy = new LinkedList<MavenProject>();
+
+ IRunnableWithProgress projectLoader = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ IMavenProjectFacade projectFacade = readMavenProject(monitor);
+ hierarchy.addAll(new ParentGatherer(mavenProject, projectFacade).getParentHierarchy(monitor));
+ } catch(CoreException e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+ };
+
+ PlatformUI.getWorkbench().getProgressService().run(false, true, projectLoader);
+
+ if (hierarchy.isEmpty()) {
+ //We were unable to read the project metadata above, so there was an error.
+ //User has already been notified to fix the problem.
+ return;
+ }
+
+ final ManageDependenciesDialog manageDepDialog = new ManageDependenciesDialog(getShell(), model, hierarchy,
+ pomEditor.getEditingDomain());
+ manageDepDialog.open();
+ }
+
+ /**
+ * Attempts to completely load the current MavenProject so as to get at the
+ * effective pom.
+ *
+ * In the case where the MavenProject cannot be accessed and markers are present,
+ * it will inform the user that they need to fix the problems before they can
+ * proceed.
+ *
+ * @param monitor
+ * @return the IMavenProjectFacade that corresponds to the project, or null if one was not loaded.
+ * @throws CoreException
+ */
+ protected IMavenProjectFacade readMavenProject(IProgressMonitor monitor) throws CoreException {
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ mavenProject = pomEditor.readMavenProject(false, monitor);
+ if (mavenProject == null) {
+ IMarker[] markers = pomEditor.getPomFile().findMarkers(IMavenConstants.MARKER_ID, true, IResource.DEPTH_ZERO);
+ if (markers != null && markers.length > 0) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ MessageDialog.openError(getShell(), Messages.DependenciesComposite_error, Messages.DependenciesComposite_fixProjectErrors);
+ }
+ });
+ return null;
+ } else {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ MessageDialog.openError(getShell(), Messages.DependenciesComposite_error, Messages.DependenciesComposite_checkConsoleForErrors);
+ }
+ });
+ return null;
+ }
+ } else {
+ maven.detachFromSession(mavenProject);
+ }
+ IMavenProjectFacade projectFacade = projectManager.create(pomEditor.getPomFile(), true, monitor);
+ return projectFacade;
+ }
+
+ protected void setDependenciesInput() {
+ List<Object> deps = new ArrayList<Object>(model.getDependencies());
+ if (showInheritedDependencies) {
+
+ /*
+ * Add the inherited dependencies into the bunch. But don't we need to
+ * filter out the dependencies that are duplicated in the M2E model, so
+ * we need to run through each list and only add ones that aren't in both.
+ */
+ List<org.apache.maven.model.Dependency> allDeps = new LinkedList<org.apache.maven.model.Dependency>();
+ allDeps.addAll(facade.getMavenProject().getModel().getDependencies());
+ allDeps.addAll(facade.getMavenProject().getModel().getDependencyManagement().getDependencies());
+ for (org.apache.maven.model.Dependency mavenDep : allDeps) {
+ boolean found = false;
+ Iterator<Dependency> iter = model.getDependencies().iterator();
+ while (!found && iter.hasNext()) {
+ Dependency m2eDep = iter.next();
+ if (mavenDep.getGroupId().equals(m2eDep.getGroupId())
+ && mavenDep.getArtifactId().equals(m2eDep.getArtifactId())
+ && mavenDep.getVersion().equals(m2eDep.getVersion())) {
+ found = true;
+ }
+ }
+ if (!found) {
+ deps.add(mavenDep);
+ }
+ }
+ }
+ dependenciesEditor.setInput(deps);
+ }
+
+ protected class PropertiesListComposite<T> extends ListEditorComposite<T> {
+ private static final String PROPERTIES_BUTTON_KEY = "PROPERTIES"; //$NON-NLS-1$
+ protected Button properties;
+
+ public PropertiesListComposite(Composite parent, int style, boolean includeSearch) {
+ super(parent, style, includeSearch);
+ }
+
+ @Override
+ protected void createButtons(boolean includeSearch) {
+ if(includeSearch) {
+ createAddButton();
+ }
+ createRemoveButton();
+ properties = createButton(Messages.ListEditorComposite_btnProperties);
+ addButton(PROPERTIES_BUTTON_KEY, properties);
+ }
+
+ public void setPropertiesListener(SelectionListener listener) {
+ properties.addSelectionListener(listener);
+ }
+
+ @Override
+ protected void viewerSelectionChanged() {
+ super.viewerSelectionChanged();
+ updatePropertiesButton();
+ }
+
+ protected void updatePropertiesButton() {
+ boolean enable = !viewer.getSelection().isEmpty() && !isBadSelection();
+ properties.setEnabled(!readOnly && enable);
+ }
+
+ @Override
+ protected void updateRemoveButton() {
+ boolean enable = !viewer.getSelection().isEmpty() && !isBadSelection();
+ getRemoveButton().setEnabled(!readOnly && enable);
+ }
+
+ @Override
+ public void setReadOnly(boolean readOnly) {
+ super.setReadOnly(readOnly);
+ updatePropertiesButton();
+ }
+
+ /**
+ * Returns true if the viewer has no input or if there is currently
+ * an inherited dependency selected
+ * @return
+ */
+ protected boolean isBadSelection() {
+ @SuppressWarnings("unchecked")
+ List<Object> deps = (List<Object>) viewer.getInput();
+ if (deps == null || deps.isEmpty()) {
+ return true;
+ }
+ boolean bad = false;
+ IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+ @SuppressWarnings("unchecked")
+ Iterator<Object> iter = selection.iterator();
+ while (iter.hasNext()) {
+ Object obj = iter.next();
+ if (obj instanceof org.apache.maven.model.Dependency) {
+ bad = true;
+ break;
+ }
+ }
+ return bad;
+ }
+ }
+
+ protected class DependenciesListComposite<T> extends PropertiesListComposite<T> {
+
+ private static final String MANAGE = "MANAGE"; //$NON-NLS-1$
+ protected Button manage;
+
+ public DependenciesListComposite(Composite parent, int style, boolean includeSearch) {
+ super(parent, style, includeSearch);
+ }
+
+ @Override
+ protected void createButtons(boolean includeSearch) {
+ super.createButtons(includeSearch);
+ manage = createButton(Messages.DependenciesComposite_manageButton);
+ addButton(MANAGE, manage);
+ }
+
+ @Override
+ protected void viewerSelectionChanged() {
+ super.viewerSelectionChanged();
+ updateManageButton();
+ }
+
+ @Override
+ public void setReadOnly(boolean readOnly) {
+ super.setReadOnly(readOnly);
+ updateManageButton();
+ }
+
+ protected void updateManageButton() {
+ manage.setEnabled(!readOnly && model.getDependencies() != null && !model.getDependencies().isEmpty());
+ }
+
+ public void setManageButtonListener(SelectionListener listener) {
+ manage.addSelectionListener(listener);
+ }
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyDetailComposite.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyDetailComposite.java
new file mode 100644
index 00000000..525af9b8
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyDetailComposite.java
@@ -0,0 +1,323 @@
+
+package org.eclipse.m2e.editor.composites;
+
+import static org.eclipse.m2e.editor.pom.FormUtils.nvl;
+import static org.eclipse.m2e.editor.pom.FormUtils.setButton;
+import static org.eclipse.m2e.editor.pom.FormUtils.setText;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.project.MavenProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.util.M2EUtils;
+import org.eclipse.m2e.core.util.ProposalUtil;
+import org.eclipse.m2e.core.util.search.Packaging;
+import org.eclipse.m2e.core.wizards.WidthGroup;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.editor.pom.FormUtils;
+import org.eclipse.m2e.editor.pom.MavenPomEditorPage;
+import org.eclipse.m2e.editor.pom.ValueProvider;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+
+public class DependencyDetailComposite extends Composite {
+
+ protected static PomPackage POM_PACKAGE = PomPackage.eINSTANCE;
+
+ private MavenPomEditorPage editorPage;
+
+ private FormToolkit toolkit;
+
+ private WidthGroup detailsWidthGroup = new WidthGroup();
+
+ protected Text groupIdText;
+
+ protected Text artifactIdText;
+
+ protected Text versionText;
+
+ private Text classifierText;
+
+ private CCombo typeCombo;
+
+ private CCombo scopeCombo;
+
+ private Text systemPathText;
+
+ private Button selectSystemPathButton;
+
+ private Button optionalButton;
+
+ public DependencyDetailComposite(Composite parent, MavenPomEditorPage editorPage) {
+ super(parent, SWT.NONE);
+
+ this.editorPage = editorPage;
+ toolkit = editorPage.getManagedForm().getToolkit();
+// toolkit = new FormToolkit(Display.getCurrent());
+
+ GridLayout dependencyCompositeLayout = new GridLayout(3, false);
+ dependencyCompositeLayout.marginWidth = 2;
+ dependencyCompositeLayout.marginHeight = 2;
+ setLayout(dependencyCompositeLayout);
+ addControlListener(detailsWidthGroup);
+
+ createControls();
+
+ toolkit.paintBordersFor(this);
+ toolkit.adapt(this);
+ }
+
+ protected String getVersion(String groupId, String artifactId, IProgressMonitor monitor) {
+ try {
+ MavenProject mavenProject = editorPage.getPomEditor().readMavenProject(false, monitor);
+ Artifact a = mavenProject.getArtifactMap().get(groupId + ":" + artifactId); //$NON-NLS-1$
+ if(a != null) {
+ return a.getBaseVersion();
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ return null;
+ }
+
+ private void createControls() {
+ Label groupIdLabel = toolkit.createLabel(this, Messages.DependenciesComposite_lblGroupId, SWT.NONE);
+ groupIdLabel.setLayoutData(new GridData());
+ detailsWidthGroup.addControl(groupIdLabel);
+
+ groupIdText = toolkit.createText(this, null, SWT.NONE);
+ GridData gd_groupIdText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+ gd_groupIdText.horizontalIndent = 4;
+ groupIdText.setLayoutData(gd_groupIdText);
+ ProposalUtil.addGroupIdProposal(editorPage.getProject(), groupIdText, Packaging.ALL);
+ M2EUtils.addRequiredDecoration(groupIdText);
+
+ Hyperlink artifactIdHyperlink = toolkit.createHyperlink(this, Messages.DependenciesComposite_lblArtifactId,
+ SWT.NONE);
+ artifactIdHyperlink.setLayoutData(new GridData());
+ artifactIdHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ final String groupId = groupIdText.getText();
+ final String artifactId = artifactIdText.getText();
+ final String version = versionText.getText();
+ new Job("Opening " + groupId + ":" + artifactId + ":" + version) {
+ protected IStatus run(IProgressMonitor monitor) {
+ OpenPomAction.openEditor(groupId, artifactId, //
+ version != null ? version : getVersion(groupId, artifactId, monitor), //
+ monitor);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ });
+
+ detailsWidthGroup.addControl(artifactIdHyperlink);
+
+ artifactIdText = toolkit.createText(this, null, SWT.NONE);
+ GridData gd_artifactIdText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+ gd_artifactIdText.horizontalIndent = 4;
+ artifactIdText.setLayoutData(gd_artifactIdText);
+ ProposalUtil.addArtifactIdProposal(editorPage.getProject(), groupIdText, artifactIdText, Packaging.ALL);
+ M2EUtils.addRequiredDecoration(artifactIdText);
+
+ Label versionLabel = toolkit.createLabel(this, Messages.DependenciesComposite_lblVersion, SWT.NONE);
+ versionLabel.setLayoutData(new GridData());
+ detailsWidthGroup.addControl(versionLabel);
+
+ versionText = toolkit.createText(this, null, SWT.NONE);
+ GridData versionTextData = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+ versionTextData.horizontalIndent = 4;
+ versionTextData.widthHint = 200;
+ versionText.setLayoutData(versionTextData);
+ ProposalUtil.addVersionProposal(editorPage.getProject(), groupIdText, artifactIdText, versionText, Packaging.ALL);
+
+ Label classifierLabel = toolkit.createLabel(this, Messages.DependenciesComposite_lblClassifier, SWT.NONE);
+ classifierLabel.setLayoutData(new GridData());
+ detailsWidthGroup.addControl(classifierLabel);
+
+ classifierText = toolkit.createText(this, null, SWT.NONE);
+ GridData gd_classifierText = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+ gd_classifierText.horizontalIndent = 4;
+ gd_classifierText.widthHint = 200;
+ classifierText.setLayoutData(gd_classifierText);
+ ProposalUtil.addClassifierProposal(editorPage.getProject(), groupIdText, artifactIdText, versionText,
+ classifierText, Packaging.ALL);
+
+ Label typeLabel = toolkit.createLabel(this, Messages.DependenciesComposite_lblType, SWT.NONE);
+ typeLabel.setLayoutData(new GridData());
+ detailsWidthGroup.addControl(typeLabel);
+
+ typeCombo = new CCombo(this, SWT.FLAT);
+ // FormUtils.addTypeProposal(groupIdText, artifactIdText, versionText, typeCombo, Packaging.ALL);
+
+ // TODO retrieve artifact type from selected dependency
+ typeCombo.add("jar"); //$NON-NLS-1$
+ typeCombo.add("war"); //$NON-NLS-1$
+ typeCombo.add("rar"); //$NON-NLS-1$
+ typeCombo.add("ear"); //$NON-NLS-1$
+ typeCombo.add("par"); //$NON-NLS-1$
+ typeCombo.add("ejb"); //$NON-NLS-1$
+ typeCombo.add("ejb-client"); //$NON-NLS-1$
+ typeCombo.add("test-jar"); //$NON-NLS-1$
+ typeCombo.add("java-source"); //$NON-NLS-1$
+ typeCombo.add("javadoc"); //$NON-NLS-1$
+ typeCombo.add("maven-plugin"); //$NON-NLS-1$
+ typeCombo.add("pom"); //$NON-NLS-1$
+
+ GridData gd_typeText = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+ gd_typeText.horizontalIndent = 4;
+ gd_typeText.widthHint = 120;
+ typeCombo.setLayoutData(gd_typeText);
+ typeCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ toolkit.adapt(typeCombo, true, true);
+
+ Label scopeLabel = toolkit.createLabel(this, Messages.DependenciesComposite_lblScope, SWT.NONE);
+ scopeLabel.setLayoutData(new GridData());
+ detailsWidthGroup.addControl(scopeLabel);
+
+ scopeCombo = new CCombo(this, SWT.READ_ONLY | SWT.FLAT);
+ scopeCombo.add("compile"); //$NON-NLS-1$
+ scopeCombo.add("test"); //$NON-NLS-1$
+ scopeCombo.add("provided"); //$NON-NLS-1$
+ scopeCombo.add("runtime"); //$NON-NLS-1$
+ scopeCombo.add("system"); //$NON-NLS-1$
+ // TODO should be only used on a dependency of type pom in the <dependencyManagement> section
+ scopeCombo.add("import"); //$NON-NLS-1$
+
+ GridData gd_scopeText = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+ gd_scopeText.horizontalIndent = 4;
+ gd_scopeText.widthHint = 120;
+ scopeCombo.setLayoutData(gd_scopeText);
+ scopeCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ toolkit.adapt(scopeCombo, true, true);
+
+ Label systemPathLabel = toolkit.createLabel(this, Messages.DependenciesComposite_lblSystemPath, SWT.NONE);
+ systemPathLabel.setLayoutData(new GridData());
+ detailsWidthGroup.addControl(systemPathLabel);
+
+ systemPathText = toolkit.createText(this, null, SWT.NONE);
+ GridData gd_systemPathText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_systemPathText.horizontalIndent = 4;
+ gd_systemPathText.widthHint = 200;
+ systemPathText.setLayoutData(gd_systemPathText);
+
+ selectSystemPathButton = toolkit.createButton(this, Messages.DependenciesComposite_btnSelect, SWT.NONE);
+ new Label(this, SWT.NONE);
+
+ optionalButton = toolkit.createButton(this, Messages.DependenciesComposite_btnOptional, SWT.CHECK);
+ GridData gd_optionalButton = new GridData(SWT.LEFT, SWT.TOP, false, false, 2, 1);
+ gd_optionalButton.horizontalIndent = 4;
+ optionalButton.setLayoutData(gd_optionalButton);
+
+ setTabList(new Control[] {groupIdText, artifactIdText, versionText, classifierText, typeCombo, scopeCombo,
+ systemPathText, selectSystemPathButton, optionalButton});
+ }
+
+ protected void update(Dependency dependency) {
+ if(editorPage != null) {
+ editorPage.removeNotifyListener(groupIdText);
+ editorPage.removeNotifyListener(artifactIdText);
+ editorPage.removeNotifyListener(versionText);
+ editorPage.removeNotifyListener(classifierText);
+ editorPage.removeNotifyListener(typeCombo);
+ editorPage.removeNotifyListener(scopeCombo);
+ editorPage.removeNotifyListener(systemPathText);
+ editorPage.removeNotifyListener(optionalButton);
+ }
+
+ if(editorPage == null || dependency == null) {
+ FormUtils.setEnabled(this, true);
+
+ setText(groupIdText, ""); //$NON-NLS-1$
+ setText(artifactIdText, ""); //$NON-NLS-1$
+ setText(versionText, ""); //$NON-NLS-1$
+ setText(classifierText, ""); //$NON-NLS-1$
+ setText(typeCombo, ""); //$NON-NLS-1$
+ setText(scopeCombo, ""); //$NON-NLS-1$
+ setText(systemPathText, ""); //$NON-NLS-1$
+ setButton(optionalButton, false);
+
+ return;
+ }
+
+ FormUtils.setEnabled(this, true);
+ FormUtils.setReadonly(this, editorPage.isReadOnly());
+
+ setText(groupIdText, dependency.getGroupId());
+ setText(artifactIdText, dependency.getArtifactId());
+ setText(versionText, dependency.getVersion());
+ setText(classifierText, dependency.getClassifier());
+ setText(typeCombo, "".equals(nvl(dependency.getType())) ? "jar" : dependency.getType());
+ setText(scopeCombo, "".equals(nvl(dependency.getScope())) ? "compile" : dependency.getScope());
+ setText(systemPathText, dependency.getSystemPath());
+
+ boolean optional = Boolean.parseBoolean(dependency.getOptional());
+ if(optionalButton.getSelection() != optional) {
+ optionalButton.setSelection(optional);
+ }
+
+ // set new listeners
+ ValueProvider<Dependency> dependencyProvider = new ValueProvider.DefaultValueProvider<Dependency>(dependency);
+ editorPage.setModifyListener(groupIdText, dependencyProvider, POM_PACKAGE.getDependency_GroupId(), ""); //$NON-NLS-1$
+ editorPage.setModifyListener(artifactIdText, dependencyProvider, POM_PACKAGE.getDependency_ArtifactId(), ""); //$NON-NLS-1$
+ editorPage.setModifyListener(versionText, dependencyProvider, POM_PACKAGE.getDependency_Version(), ""); //$NON-NLS-1$
+ editorPage.setModifyListener(classifierText, dependencyProvider, POM_PACKAGE.getDependency_Classifier(), ""); //$NON-NLS-1$
+ editorPage.setModifyListener(typeCombo, dependencyProvider, POM_PACKAGE.getDependency_Type(), "jar"); //$NON-NLS-1$
+ editorPage.setModifyListener(scopeCombo, dependencyProvider, POM_PACKAGE.getDependency_Scope(), "compile"); //$NON-NLS-1$
+ editorPage.setModifyListener(systemPathText, dependencyProvider, POM_PACKAGE.getDependency_SystemPath(), ""); //$NON-NLS-1$
+ editorPage.setModifyListener(optionalButton, dependencyProvider, POM_PACKAGE.getDependency_Optional(), "false");
+
+ editorPage.registerListeners();
+ }
+
+ public void setGroupId(String groupId) {
+ groupIdText.setText(nvl(groupId));
+ }
+
+ public String getGroupId() {
+ return groupIdText.getText();
+ }
+
+ public void setArtifactId(String artifactId) {
+ artifactIdText.setText(nvl(artifactId));
+ }
+
+ public String getArtifactId() {
+ return artifactIdText.getText();
+ }
+
+ public void setVersion(String version) {
+ versionText.setText(nvl(version));
+ }
+
+ public String getVersion() {
+ return versionText.getText();
+ }
+
+ public void setType(String type) {
+ typeCombo.setText(nvl(type));
+ }
+
+ public void setScope(String scope) {
+ scopeCombo.setText(nvl(scope));
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java
new file mode 100644
index 00000000..15280b70
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java
@@ -0,0 +1,249 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.composites;
+
+import java.util.Collection;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.model.Model;
+import org.apache.maven.project.MavenProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.MavenEditorPlugin;
+import org.eclipse.m2e.editor.pom.MavenPomEditor;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.Exclusion;
+import org.eclipse.m2e.model.edit.pom.Extension;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+
+
+/**
+ * Label provider for Dependency, Exclusion and Extension elements
+ *
+ * @author Eugene Kuleshov
+ */
+public class DependencyLabelProvider extends LabelProvider implements IColorProvider {
+
+ private MavenPomEditor pomEditor;
+
+ private boolean showGroupId = false;
+
+ private IMavenProjectFacade facade = null;
+
+ public void setPomEditor(MavenPomEditor pomEditor) {
+ this.pomEditor = pomEditor;
+ }
+
+ public void setShowGroupId(boolean showGroupId) {
+ this.showGroupId = showGroupId;
+ }
+
+ // IColorProvider
+
+ public Color getForeground(Object element) {
+ if(element instanceof Dependency) {
+ Dependency dependency = (Dependency) element;
+ String scope = dependency.getScope();
+ if(scope != null && !"compile".equals(scope)) { //$NON-NLS-1$
+ return Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
+ }
+ } else if (element instanceof org.apache.maven.model.Dependency) {
+ if (facade == null || facade.getMavenProject() == null
+ || facade.getMavenProject().getModel() == null) {
+ //If facade is null and we are getting maven Dependencies, something has gone horribly wrong
+ return Display.getDefault().getSystemColor(SWT.COLOR_RED);
+ }
+
+ if(!isInherited((org.apache.maven.model.Dependency) element)) {
+ return null;
+ }
+
+ /*
+ * Element is inherited, therefore we cannot edit it (yet ...)
+ */
+
+ return Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
+ }
+ return null;
+ }
+
+ protected boolean isInherited(org.apache.maven.model.Dependency dependency) {
+ if (dependency.getLocation("") == null) { //$NON-NLS-1$
+ MavenEditorPlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, MavenEditorPlugin.PLUGIN_ID,
+ "getLocation(\"\") for dependency '"+dependency.toString()+"' is null. This is a bug in Maven.")); //$NON-NLS-1$ //$NON-NLS-2$
+ return false;
+ }
+
+ if (dependency.getLocation("").getSource() == null) { //$NON-NLS-1$
+ MavenEditorPlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, MavenEditorPlugin.PLUGIN_ID,
+ "getLocation(\"\").getSource() for dependency '"+dependency.toString()+"' is null. This is a bug in Maven.")); //$NON-NLS-1$ //$NON-NLS-2$
+ return false;
+ }
+
+ String modelID = dependency.getLocation("").getSource().getModelId(); //$NON-NLS-1$
+ Model model = facade.getMavenProject().getModel();
+ String thisModelID = toModelID(model.getGroupId(), model.getArtifactId(), model.getVersion());
+
+ return (!thisModelID.equals(modelID));
+ }
+
+ public static String toModelID(String groupId, String artifactId, String version) {
+ /*
+ * Copied straight from package org.apache.maven.model.building.ModelProblemUtils.toId()
+ * TODO Remove this method when those methods are made public
+ */
+ StringBuilder buffer = new StringBuilder( 96 );
+
+ buffer.append( ( groupId != null && groupId.length() > 0 ) ? groupId : "[unknown-group-id]" ); //$NON-NLS-1$
+ buffer.append( ':' );
+ buffer.append( ( artifactId != null && artifactId.length() > 0 ) ? artifactId : "[unknown-artifact-id]" ); //$NON-NLS-1$
+ buffer.append( ':' );
+ buffer.append( ( version != null && version.length() > 0 ) ? version : "[unknown-version]" ); //$NON-NLS-1$
+
+ return buffer.toString();
+ }
+
+ public Color getBackground(Object element) {
+ return null;
+ }
+
+ // LabelProvider
+
+ @Override
+ public String getText(Object element) {
+ if(element instanceof Dependency) {
+ Dependency dependency = (Dependency) element;
+ return getText(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion(), //
+ dependency.getClassifier(), dependency.getType(), dependency.getScope());
+ } else if (element instanceof org.apache.maven.model.Dependency) {
+ org.apache.maven.model.Dependency dependency = (org.apache.maven.model.Dependency) element;
+ return getText(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion(),
+ dependency.getClassifier(), dependency.getType(), dependency.getScope());
+ } else if(element instanceof Exclusion) {
+ Exclusion exclusion = (Exclusion) element;
+ return getText(exclusion.getGroupId(), exclusion.getArtifactId(), null, null, null, null);
+ } else if(element instanceof Extension) {
+ Extension extension = (Extension) element;
+ return getText(extension.getGroupId(), extension.getArtifactId(), extension.getVersion(), null, null, null);
+ }
+ return super.getText(element);
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ if(element instanceof Dependency) {
+ Dependency dependency = (Dependency) element;
+ return getImage(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion());
+ } else if (element instanceof org.apache.maven.model.Dependency) {
+ org.apache.maven.model.Dependency dependency = (org.apache.maven.model.Dependency) element;
+ if (isInherited(dependency)) {
+ return MavenEditorImages.IMG_INHERITED;
+ }
+ return getImage(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion());
+ }else if(element instanceof Exclusion) {
+ Exclusion exclusion = (Exclusion) element;
+ return getImage(exclusion.getGroupId(), exclusion.getArtifactId(), null);
+ } else if(element instanceof Extension) {
+ Extension extension = (Extension) element;
+ return getImage(extension.getGroupId(), extension.getArtifactId(), extension.getVersion());
+ }
+
+ return null;
+ }
+
+ private Image getImage(String groupId, String artifactId, String version) {
+ // XXX need to resolve actual dependencies (i.e. inheritance, dependency management or properties)
+ // XXX need to handle version ranges
+
+ if((version == null || version.indexOf("${") > -1) && pomEditor != null) { //$NON-NLS-1$
+ try {
+ MavenProject mavenProject = pomEditor.readMavenProject(false, null);
+ if(mavenProject != null) {
+ Artifact artifact = mavenProject.getArtifactMap().get(groupId + ":" + artifactId); //$NON-NLS-1$
+ if(artifact!=null) {
+ version = artifact.getVersion();
+ }
+ if(version==null || version.indexOf("${") > -1) { //$NON-NLS-1$
+ Collection<Artifact> artifacts = mavenProject.getManagedVersionMap().values();
+ for(Artifact a : artifacts) {
+ if(a.getGroupId().equals(groupId) && a.getArtifactId().equals(artifactId)) {
+ version = a.getVersion();
+ break;
+ }
+ }
+ }
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+
+ if(groupId != null && artifactId != null && version != null) {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectFacade projectFacade = projectManager.getMavenProject(groupId, artifactId, version);
+ if(projectFacade != null) {
+ return MavenEditorImages.IMG_PROJECT;
+ }
+ }
+ return MavenEditorImages.IMG_JAR;
+ }
+
+ private String getText(String groupId, String artifactId, String version, String classifier, String type, String scope) {
+ StringBuilder sb = new StringBuilder();
+
+ if(showGroupId) {
+ sb.append(isEmpty(groupId) ? "?" : groupId).append(" : "); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ sb.append(isEmpty(artifactId) ? "?" : artifactId); //$NON-NLS-1$
+
+ if(!isEmpty(version)) {
+ sb.append(" : ").append(version); //$NON-NLS-1$
+ }
+
+ if(!isEmpty(classifier)) {
+ sb.append(" : ").append(classifier); //$NON-NLS-1$
+ }
+
+ if(!isEmpty(type)) {
+ sb.append(" : ").append(type); //$NON-NLS-1$
+ }
+
+ if(!isEmpty(scope)) {
+ sb.append(" [").append(scope).append(']'); //$NON-NLS-1$
+ }
+
+ return sb.toString();
+ }
+
+ private boolean isEmpty(String s) {
+ return s == null || s.trim().length() == 0;
+ }
+
+ public void setFacade(IMavenProjectFacade facade) {
+ this.facade = facade;
+ }
+
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorComposite.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorComposite.java
new file mode 100644
index 00000000..f9b12fe4
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorComposite.java
@@ -0,0 +1,263 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.composites;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+
+/**
+ * List editor composite
+ *
+ * @author Eugene Kuleshov
+ */
+public class ListEditorComposite<T> extends Composite {
+
+
+ TableViewer viewer;
+
+ protected Map<String, Button> buttons = new HashMap<String, Button>(5);
+
+ /*
+ * Default button keys
+ */
+ private static final String ADD = "ADD"; //$NON-NLS-1$
+ private static final String CREATE = "CREATE"; //$NON-NLS-1$
+ private static final String REMOVE = "REMOVE"; //$NON-NLS-1$
+
+ boolean readOnly = false;
+
+ protected FormToolkit toolkit;
+
+ public ListEditorComposite(Composite parent, int style, boolean includeSearch) {
+ super(parent, style);
+ toolkit = new FormToolkit(parent.getDisplay());
+
+ GridLayout gridLayout = new GridLayout(2, false);
+ gridLayout.marginWidth = 1;
+ gridLayout.marginHeight = 1;
+ gridLayout.verticalSpacing = 1;
+ setLayout(gridLayout);
+
+ final Table table = toolkit.createTable(this, SWT.FLAT | SWT.MULTI | style);
+ table.setData("name", "list-editor-composite-table"); //$NON-NLS-1$ //$NON-NLS-2$
+ final TableColumn column = new TableColumn(table, SWT.NONE);
+ table.addControlListener(new ControlAdapter() {
+ public void controlResized(ControlEvent e) {
+ column.setWidth(table.getClientArea().width);
+ }
+ });
+
+ viewer = new TableViewer(table);
+
+ createButtons(includeSearch);
+
+ int vSpan = buttons.size();
+ GridData viewerData = new GridData(SWT.FILL, SWT.FILL, true, true, 1, vSpan);
+ viewerData.widthHint = 100;
+ viewerData.heightHint = includeSearch ? 125 : 50;
+ viewerData.minimumHeight = includeSearch ? 125 : 50;
+ table.setLayoutData(viewerData);
+ viewer.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.TRUE);
+
+ viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ viewerSelectionChanged();
+ }
+ });
+
+ toolkit.paintBordersFor(this);
+ }
+
+ public ListEditorComposite(Composite parent, int style) {
+ this(parent, style, false);
+ }
+
+ public void setLabelProvider(ILabelProvider labelProvider) {
+ viewer.setLabelProvider(labelProvider);
+ }
+
+ public void setContentProvider(ListEditorContentProvider<T> contentProvider) {
+ viewer.setContentProvider(contentProvider);
+ }
+
+ public void setInput(List<T> input) {
+ viewer.setInput(input);
+ viewer.setSelection(new StructuredSelection());
+ }
+
+ public Object getInput() {
+ return viewer.getInput();
+ }
+
+ public void setOpenListener(IOpenListener listener) {
+ viewer.addOpenListener(listener);
+ }
+
+ public void addSelectionListener(ISelectionChangedListener listener) {
+ viewer.addSelectionChangedListener(listener);
+ }
+
+ public void setAddButtonListener(SelectionListener listener) {
+ if(getAddButton() != null) {
+ getAddButton().addSelectionListener(listener);
+ getAddButton().setEnabled(true);
+ }
+ }
+
+ protected Button getCreateButton() {
+ return buttons.get(CREATE);
+ }
+
+ protected Button getRemoveButton() {
+ return buttons.get(REMOVE);
+ }
+
+ protected Button getAddButton() {
+ return buttons.get(ADD);
+ }
+
+ public void setCreateButtonListener(SelectionListener listener) {
+ getCreateButton().addSelectionListener(listener);
+ getCreateButton().setEnabled(true);
+ }
+
+ public void setRemoveButtonListener(SelectionListener listener) {
+ getRemoveButton().addSelectionListener(listener);
+ }
+
+ public TableViewer getViewer() {
+ return viewer;
+ }
+
+ public int getSelectionIndex() {
+ return viewer.getTable().getSelectionIndex();
+ }
+
+ public void setSelectionIndex(int n) {
+ viewer.getTable().setSelection(n);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<T> getSelection() {
+ IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+ return selection == null ? Collections.emptyList() : selection.toList();
+ }
+
+ public void setSelection(List<T> selection) {
+ viewer.setSelection(new StructuredSelection(selection), true);
+ }
+
+ public void setReadOnly(boolean readOnly) {
+ this.readOnly = readOnly;
+ for (Map.Entry<String, Button> entry : buttons.entrySet()) {
+ if (entry.getKey().equals(REMOVE)) {
+ //Special case, as it makes no sense to enable if it there's nothing selected.
+ updateRemoveButton();
+ } else {
+ entry.getValue().setEnabled(!readOnly);
+ }
+ }
+ }
+
+ protected void viewerSelectionChanged() {
+ updateRemoveButton();
+ }
+
+ protected void updateRemoveButton() {
+ getRemoveButton().setEnabled(!readOnly && !viewer.getSelection().isEmpty());
+ }
+
+ public void refresh() {
+ if(!viewer.getTable().isDisposed()) {
+ viewer.refresh(true);
+ }
+ }
+
+ public void setCellModifier(ICellModifier cellModifier) {
+ viewer.setColumnProperties(new String[] {"?"}); //$NON-NLS-1$
+
+ TextCellEditor editor = new TextCellEditor(viewer.getTable());
+ viewer.setCellEditors(new CellEditor[] {editor});
+ viewer.setCellModifier(cellModifier);
+ }
+
+ public void setDoubleClickListener(IDoubleClickListener listener) {
+ viewer.addDoubleClickListener(listener);
+ }
+
+ /**
+ * Create the buttons that populate the column to the right of the ListViewer.
+ * Subclasses must call the helper method addButton to add each button to the
+ * composite.
+ *
+ * @param includeSearch true if the search button should be created
+ */
+ protected void createButtons(boolean includeSearch) {
+ if(includeSearch) {
+ createAddButton();
+ }
+ createCreateButton();
+ createRemoveButton();
+ }
+
+ protected void addButton(String key, Button button) {
+ buttons.put(key, button);
+ }
+
+ protected void createAddButton() {
+ addButton(ADD, createButton(Messages.ListEditorComposite_btnAdd));
+ }
+
+ protected void createCreateButton() {
+ addButton(CREATE, createButton(Messages.ListEditorComposite_btnCreate));
+ }
+
+ protected void createRemoveButton() {
+ addButton(REMOVE, createButton(Messages.ListEditorComposite_btnRemove));
+ }
+
+ protected Button createButton(String text) {
+ Button button = toolkit.createButton(this, text, SWT.FLAT);
+ GridData gd = new GridData(SWT.FILL, SWT.TOP, false, false);
+ gd.verticalIndent = 0;
+ button.setLayoutData(gd);
+ button.setEnabled(false);
+ return button;
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorContentProvider.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorContentProvider.java
new file mode 100644
index 00000000..735755c8
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorContentProvider.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.composites;
+
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class ListEditorContentProvider<T> implements IStructuredContentProvider {
+
+ public static final Object[] EMPTY = new Object[0];
+ private boolean shouldSort;
+ private Comparator<T> comparator;
+
+ @SuppressWarnings("unchecked")
+ public Object[] getElements(Object input) {
+ if(input instanceof List) {
+ List<T> list = (List<T>) input;
+ if (shouldSort) {
+ T[] array = (T[]) list.toArray();
+ Arrays.<T>sort(array, comparator);
+ return array;
+ }
+ return list.toArray();
+ }
+ return EMPTY;
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public void dispose() {
+ }
+
+ public void setShouldSort(boolean shouldSort) {
+ this.shouldSort = shouldSort;
+ }
+
+ public void setComparator(Comparator<T> comparator) {
+ this.comparator = comparator;
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ManageDependencyLabelProvider.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ManageDependencyLabelProvider.java
new file mode 100644
index 00000000..15556e45
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ManageDependencyLabelProvider.java
@@ -0,0 +1,14 @@
+package org.eclipse.m2e.editor.composites;
+
+import org.eclipse.swt.graphics.Color;
+
+public class ManageDependencyLabelProvider extends DependencyLabelProvider {
+ @Override
+ public Color getForeground(Object element) {
+ /*
+ * Super class shows scope=compile dependencies as greyed out, which we
+ * don't want to do here.
+ */
+ return null;
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ParentGatherer.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ParentGatherer.java
new file mode 100644
index 00000000..6a79c0ce
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ParentGatherer.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.composites;
+
+import java.util.LinkedList;
+
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.project.MavenProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+
+/**
+ * Helper class to get the parent chain given a pom
+ */
+public class ParentGatherer {
+ private MavenProject mavenProject;
+
+ private IMavenProjectFacade projectFacade;
+
+ public ParentGatherer(MavenProject leafProject, IMavenProjectFacade facade) {
+ this.mavenProject = leafProject;
+ this.projectFacade = facade;
+ }
+
+ /**
+ * Return the list of parents for a give pom
+ * @param monitor
+ * @return list of {@link MavenProject} from the given project to its ultimate parent.
+ * The first entry is the given pom, the last one the ultimate parent.
+ * @throws CoreException
+ */
+ public LinkedList<MavenProject> getParentHierarchy(IProgressMonitor monitor) throws CoreException {
+ LinkedList<MavenProject> hierarchy = new LinkedList<MavenProject>();
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ maven.detachFromSession(mavenProject);
+
+ hierarchy.add(mavenProject);
+
+ MavenProject project = mavenProject;
+ while(project.getModel().getParent() != null) {
+ if(monitor.isCanceled()) {
+ return null;
+ }
+ MavenExecutionRequest request = projectManager.createExecutionRequest(projectFacade, monitor);
+ project = maven.resolveParentProject(request, project, monitor);
+ hierarchy.add(project);
+ }
+ return hierarchy;
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/PluginsComposite.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/PluginsComposite.java
new file mode 100644
index 00000000..dc3ec33c
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/PluginsComposite.java
@@ -0,0 +1,1377 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.composites;
+
+import static org.eclipse.m2e.editor.pom.FormUtils.isEmpty;
+import static org.eclipse.m2e.editor.pom.FormUtils.nvl;
+import static org.eclipse.m2e.editor.pom.FormUtils.setButton;
+import static org.eclipse.m2e.editor.pom.FormUtils.setText;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.window.Window;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.actions.OpenUrlAction;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.ui.dialogs.MavenRepositorySearchDialog;
+import org.eclipse.m2e.core.util.M2EUtils;
+import org.eclipse.m2e.core.util.ProposalUtil;
+import org.eclipse.m2e.core.util.search.Packaging;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.editor.plugins.DefaultPluginConfigurationEditor;
+import org.eclipse.m2e.editor.plugins.IPluginConfigurationExtension;
+import org.eclipse.m2e.editor.plugins.PluginExtensionDescriptor;
+import org.eclipse.m2e.editor.pom.FormUtils;
+import org.eclipse.m2e.editor.pom.MavenPomEditorPage;
+import org.eclipse.m2e.editor.pom.SearchControl;
+import org.eclipse.m2e.editor.pom.SearchMatcher;
+import org.eclipse.m2e.editor.pom.ValueProvider;
+import org.eclipse.m2e.model.edit.pom.BuildBase;
+import org.eclipse.m2e.model.edit.pom.Configuration;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.Plugin;
+import org.eclipse.m2e.model.edit.pom.PluginExecution;
+import org.eclipse.m2e.model.edit.pom.PluginManagement;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.ReportPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class PluginsComposite extends Composite{
+
+ protected static PomPackage POM_PACKAGE = PomPackage.eINSTANCE;
+ public static final String EXTENSION_CONFIGURATION_EDITOR = "org.eclipse.m2e.editor.plugins.configurationEditorContribution"; //$NON-NLS-1$
+ public static final String ELEMENT_CONFIGURATION_EDITOR = "editContributor"; //$NON-NLS-1$
+
+ MavenPomEditorPage parentEditorPage;
+
+ // controls
+ CCombo executionPhaseCombo;
+ Text executionIdText;
+ Hyperlink pluginExecutionConfigurationHyperlink;
+ Button executionInheritedButton;
+ FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+
+ ListEditorComposite<Plugin> pluginsEditor;
+ ListEditorComposite<Plugin> pluginManagementEditor;
+
+ Text groupIdText;
+ Text artifactIdText;
+ Text versionText;
+ Section pluginDetailsSection;
+ Button pluginExtensionsButton;
+ Button pluginInheritedButton;
+
+ ListEditorComposite<Dependency> pluginDependenciesEditor;
+ ListEditorComposite<String> goalsEditor;
+ ListEditorComposite<PluginExecution> pluginExecutionsEditor;
+
+ Section pluginConfigurationSection;
+ IPluginConfigurationExtension configurationEditor;
+ IAction openConfigurationAction;
+
+ Section pluginExecutionSection;
+ Section pluginExecutionsSection;
+ Section pluginDependenciesSection;
+
+ Button pluginSelectButton;
+
+ Action pluginSelectAction;
+
+ PluginSelectAction pluginAddAction;
+
+ PluginSelectAction pluginManagementAddAction;
+
+ Action openWebPageAction;
+
+ ViewerFilter searchFilter;
+
+ SearchControl searchControl;
+
+ SearchMatcher searchMatcher;
+
+ // model
+
+ Plugin currentPlugin;
+ PluginExecution currentPluginExecution;
+
+ ValueProvider<BuildBase> buildProvider;
+
+ ValueProvider<PluginManagement> pluginManagementProvider;
+
+ Map<String,PluginExtensionDescriptor> pluginConfigurators;
+ IPluginConfigurationExtension defaultConfigurationEditor;
+
+ boolean changingSelection = false;
+
+
+ public PluginsComposite(Composite composite, MavenPomEditorPage page, int style) {
+ super(composite, style);
+ this.parentEditorPage = page;
+ GridLayout gridLayout = new GridLayout(1, false);
+ gridLayout.marginWidth = 0;
+ setLayout(gridLayout);
+ toolkit.adapt(this);
+
+ SashForm horizontalSashForm = new SashForm(this, SWT.NONE);
+ GridData gd_horizontalSashForm = new GridData(SWT.FILL, SWT.FILL, true, true);
+ horizontalSashForm.setLayoutData(gd_horizontalSashForm);
+ toolkit.adapt(horizontalSashForm, true, true);
+
+ SashForm verticalSashForm = new SashForm(horizontalSashForm, SWT.VERTICAL);
+ toolkit.adapt(verticalSashForm, true, true);
+
+ loadPluginConfigurators();
+
+ createPluginsSection(verticalSashForm);
+ createPluginManagementSection(verticalSashForm);
+
+ verticalSashForm.setWeights(new int[] {1, 1});
+
+ createPluginDetailsSection(horizontalSashForm);
+ horizontalSashForm.setWeights(new int[] {10, 15 });
+
+ updatePluginDetails(null);
+ }
+
+ private void createPluginsSection(SashForm verticalSashForm) {
+ Section pluginsSection = toolkit.createSection(verticalSashForm, ExpandableComposite.TITLE_BAR | ExpandableComposite.COMPACT);
+ pluginsSection.setText(Messages.PluginsComposite_section_Plugins);
+
+ pluginsEditor = new ListEditorComposite<Plugin>(pluginsSection, SWT.NONE, true);
+ pluginsSection.setClient(pluginsEditor);
+ toolkit.adapt(pluginsEditor);
+ toolkit.paintBordersFor(pluginsEditor);
+
+ final PluginLabelProvider labelProvider = new PluginLabelProvider();
+ pluginsEditor.setLabelProvider(labelProvider);
+ pluginsEditor.setContentProvider(new ListEditorContentProvider<Plugin>());
+
+ pluginsEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<Plugin> selection = pluginsEditor.getSelection();
+ updatePluginDetails(selection.size()==1 ? selection.get(0) : null);
+
+ if(!selection.isEmpty()) {
+ changingSelection = true;
+ pluginManagementEditor.setSelection(Collections.<Plugin>emptyList());
+ changingSelection = false;
+ }
+ }
+ });
+
+ pluginsEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ createPlugin(pluginsEditor, buildProvider, POM_PACKAGE.getBuildBase_Plugins(), null, null, null);
+ }
+ });
+
+ pluginsEditor.setAddButtonListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e){
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getShell(), //
+ Messages.PluginsComposite_searchDialog_selectPlugin, IIndex.SEARCH_PLUGIN, Collections.<ArtifactKey>emptySet());
+ if(dialog.open() == Window.OK) {
+ IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+ if(af != null) {
+ createPlugin(pluginsEditor, buildProvider, POM_PACKAGE.getBuildBase_Plugins(), af.group, af.artifact, af.version);
+ }
+ }
+ }
+ });
+
+ pluginsEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parentEditorPage.getEditingDomain();
+
+ List<Plugin> list = pluginsEditor.getSelection();
+ for(Plugin plugin : list) {
+ Command removeCommand = RemoveCommand.create(editingDomain, buildProvider.getValue(), //
+ POM_PACKAGE.getBuildBase_Plugins(), plugin);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ updatePluginDetails(null);
+ }
+ });
+
+ pluginAddAction = new PluginSelectAction(pluginsEditor, POM_PACKAGE.getBuildBase_Plugins());
+
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+
+ if(pluginConfigurators.size() > 0) {
+ toolBarManager.add(pluginAddAction.getItem());
+ toolBarManager.add(new Separator());
+ }
+
+ toolBarManager.add(new Action(Messages.PluginsComposite_action_showGroupId, MavenEditorImages.SHOW_GROUP) {
+ {
+ setChecked(false);
+ }
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+ public void run() {
+ labelProvider.setShowGroupId(isChecked());
+ pluginsEditor.getViewer().refresh();
+ }
+ });
+
+ toolBarManager.add(new Action(Messages.PluginsComposite_action_Filter, MavenEditorImages.FILTER) {
+ {
+ setChecked(true);
+ }
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+ public void run() {
+ TableViewer viewer = pluginsEditor.getViewer();
+ if(isChecked()) {
+ viewer.addFilter(searchFilter);
+ } else {
+ viewer.removeFilter(searchFilter);
+ }
+ viewer.refresh();
+ if(isChecked()) {
+ searchControl.getSearchText().setFocus();
+ }
+ }
+ });
+
+ Composite toolbarComposite = toolkit.createComposite(pluginsSection);
+ GridLayout toolbarLayout = new GridLayout(1, true);
+ toolbarLayout.marginHeight = 0;
+ toolbarLayout.marginWidth = 0;
+ toolbarComposite.setLayout(toolbarLayout);
+ toolbarComposite.setBackground(null);
+
+ toolBarManager.createControl(toolbarComposite);
+ pluginsSection.setTextClient(toolbarComposite);
+ }
+
+ private void createPluginManagementSection(SashForm verticalSashForm) {
+ Section pluginManagementSection = toolkit.createSection(verticalSashForm, ExpandableComposite.TITLE_BAR);
+ pluginManagementSection.setText(Messages.PluginsComposite_section_PluginManagent);
+
+ pluginManagementEditor = new ListEditorComposite<Plugin>(pluginManagementSection, SWT.NONE, true);
+ pluginManagementSection.setClient(pluginManagementEditor);
+ toolkit.adapt(pluginManagementEditor);
+ toolkit.paintBordersFor(pluginManagementEditor);
+
+ final PluginLabelProvider labelProvider = new PluginLabelProvider();
+ pluginManagementEditor.setLabelProvider(labelProvider);
+ pluginManagementEditor.setContentProvider(new ListEditorContentProvider<Plugin>());
+
+ pluginManagementEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<Plugin> selection = pluginManagementEditor.getSelection();
+ updatePluginDetails(selection.size()==1 ? selection.get(0) : null);
+
+ if(!selection.isEmpty()) {
+ changingSelection = true;
+ pluginsEditor.setSelection(Collections.<Plugin>emptyList());
+ changingSelection = false;
+ }
+ }
+ });
+
+ pluginManagementEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ createPlugin(pluginManagementEditor, pluginManagementProvider, POM_PACKAGE.getPluginManagement_Plugins(), null, null, null);
+ }
+ });
+
+
+ pluginManagementEditor.setAddButtonListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e){
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getShell(), //
+ Messages.PluginsComposite_seachDialog_selectPlugin, IIndex.SEARCH_PLUGIN, Collections.<ArtifactKey>emptySet());
+ if(dialog.open() == Window.OK) {
+ IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+ if(af != null) {
+ createPlugin(pluginManagementEditor, pluginManagementProvider, POM_PACKAGE.getPluginManagement_Plugins(), af.group, af.artifact, af.version);
+ }
+ }
+ }
+ });
+
+ pluginManagementEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parentEditorPage.getEditingDomain();
+
+ List<Plugin> list = pluginManagementEditor.getSelection();
+ for(Plugin plugin : list) {
+ Command removeCommand = RemoveCommand.create(editingDomain, //
+ pluginManagementProvider.getValue(), POM_PACKAGE.getPluginManagement_Plugins(), plugin);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ updatePluginDetails(null);
+ }
+ });
+
+ pluginManagementAddAction = new PluginSelectAction(pluginManagementEditor, POM_PACKAGE.getPluginManagement_Plugins());
+
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+
+ if(pluginConfigurators.size() > 0) {
+ toolBarManager.add(pluginManagementAddAction.getItem());
+ toolBarManager.add(new Separator());
+ }
+
+ toolBarManager.add(new Action(Messages.PluginsComposite_action_showGroupId, MavenEditorImages.SHOW_GROUP) {
+ {
+ setChecked(false);
+ }
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+ public void run() {
+ labelProvider.setShowGroupId(isChecked());
+ pluginManagementEditor.getViewer().refresh();
+ }
+ });
+
+ toolBarManager.add(new Action(Messages.PluginsComposite_action_Filter, MavenEditorImages.FILTER) {
+ {
+ setChecked(true);
+ }
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+ public void run() {
+ TableViewer viewer = pluginManagementEditor.getViewer();
+ if(isChecked()) {
+ viewer.addFilter(searchFilter);
+ } else {
+ viewer.removeFilter(searchFilter);
+ }
+ viewer.refresh();
+ if(isChecked()) {
+ searchControl.getSearchText().setFocus();
+ }
+ }
+ });
+
+ Composite toolbarComposite = toolkit.createComposite(pluginManagementSection);
+ GridLayout toolbarLayout = new GridLayout(1, true);
+ toolbarLayout.marginHeight = 0;
+ toolbarLayout.marginWidth = 0;
+ toolbarComposite.setLayout(toolbarLayout);
+ toolbarComposite.setBackground(null);
+
+ toolBarManager.createControl(toolbarComposite);
+ pluginManagementSection.setTextClient(toolbarComposite);
+ }
+
+ private void createPluginDetailsSection(Composite horizontalSashForm) {
+ Composite detailsComposite = toolkit.createComposite(horizontalSashForm, SWT.NONE);
+ GridLayout detailsCompositeLayout = new GridLayout();
+ detailsCompositeLayout.marginWidth = 0;
+ detailsCompositeLayout.marginHeight = 0;
+ detailsComposite.setLayout(detailsCompositeLayout);
+ toolkit.paintBordersFor(detailsComposite);
+
+ pluginDetailsSection = toolkit.createSection(detailsComposite, ExpandableComposite.TITLE_BAR);
+ pluginDetailsSection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ pluginDetailsSection.setText(Messages.PluginsComposite_section_pluginDetails);
+
+ Composite pluginDetailsComposite = toolkit.createComposite(pluginDetailsSection, SWT.NONE);
+ GridLayout pluginDetailsLayout = new GridLayout(3, false);
+ pluginDetailsLayout.marginWidth = 1;
+ pluginDetailsLayout.marginHeight = 2;
+ pluginDetailsComposite.setLayout(pluginDetailsLayout);
+ toolkit.paintBordersFor(pluginDetailsComposite);
+ pluginDetailsSection.setClient(pluginDetailsComposite);
+
+ toolkit.createLabel(pluginDetailsComposite, Messages.PluginsComposite_lblGroupId, SWT.NONE);
+
+ groupIdText = toolkit.createText(pluginDetailsComposite, null, SWT.NONE);
+ GridData gd_groupIdText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+ gd_groupIdText.horizontalIndent = 4;
+ groupIdText.setLayoutData(gd_groupIdText);
+ groupIdText.setData("name", "groupIdText"); //$NON-NLS-1$ //$NON-NLS-2$
+ ProposalUtil.addGroupIdProposal(parentEditorPage.getProject(), groupIdText, Packaging.PLUGIN);
+ M2EUtils.addRequiredDecoration(groupIdText);
+
+ Hyperlink artifactIdHyperlink = toolkit.createHyperlink(pluginDetailsComposite, Messages.PluginsComposite_lblArtifactId, SWT.NONE);
+ artifactIdHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ final String groupId = groupIdText.getText();
+ final String artifactId = artifactIdText.getText();
+ final String version = versionText.getText();
+ new Job("Opening " + groupId + ":" + artifactId + ":" + version) {
+ protected IStatus run(IProgressMonitor arg0) {
+ OpenPomAction.openEditor(groupId, artifactId, version, null);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ });
+
+ artifactIdText = toolkit.createText(pluginDetailsComposite, null, SWT.NONE);
+ GridData gd_artifactIdText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+ gd_artifactIdText.horizontalIndent = 4;
+ artifactIdText.setLayoutData(gd_artifactIdText);
+ artifactIdText.setData("name", "artifactIdText"); //$NON-NLS-1$ //$NON-NLS-2$
+ ProposalUtil.addArtifactIdProposal(parentEditorPage.getProject(), groupIdText, artifactIdText, Packaging.PLUGIN);
+ M2EUtils.addRequiredDecoration(artifactIdText);
+
+ Label label = toolkit.createLabel(pluginDetailsComposite, Messages.PluginsComposite_lblVersion, SWT.NONE);
+ label.setLayoutData(new GridData());
+
+ versionText = toolkit.createText(pluginDetailsComposite, null, SWT.NONE);
+ GridData versionTextData = new GridData(SWT.LEFT, SWT.CENTER, true, false);
+ versionTextData.horizontalIndent = 4;
+ versionTextData.widthHint = 200;
+ versionText.setLayoutData(versionTextData);
+ versionText.setData("name", "versionText"); //$NON-NLS-1$ //$NON-NLS-2$
+ ProposalUtil.addVersionProposal(parentEditorPage.getProject(), groupIdText, artifactIdText, versionText, Packaging.PLUGIN);
+
+ // pluginSelectButton = toolkit.createButton(pluginDetailsComposite, "Select...", SWT.NONE);
+ // pluginSelectButton.addSelectionListener(new SelectionAdapter() {
+ // public void widgetSelected(SelectionEvent e) {
+ // Set<Dependency> artifacts = Collections.emptySet();
+ // MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(parent.getEditorSite().getShell(),
+ // "Add Plugin", IndexManager.SEARCH_PLUGIN, artifacts);
+ // if(dialog.open() == Window.OK) {
+ // IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+ // if(af != null) {
+ // groupIdText.setText(nvl(af.group));
+ // artifactIdText.setText(nvl(af.artifact));
+ // versionText.setText(nvl(af.version));
+ // }
+ // }
+ // }
+ // });
+
+ pluginSelectAction = new Action(Messages.PluginsComposite_action_selectPlugin, MavenEditorImages.SELECT_PLUGIN) {
+ public void run() {
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getShell(), //
+ Messages.PluginsComposite_searchDialog_selectPlugin, IIndex.SEARCH_PLUGIN, Collections.<ArtifactKey>emptySet());
+ if(dialog.open() == Window.OK) {
+ IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+ if(af != null) {
+ groupIdText.setText(nvl(af.group));
+ artifactIdText.setText(nvl(af.artifact));
+ versionText.setText(nvl(af.version));
+ }
+ }
+ }
+ };
+ pluginSelectAction.setEnabled(false);
+
+ openWebPageAction = new Action(Messages.PluginsComposite_action_openWeb, MavenEditorImages.WEB_PAGE) {
+ public void run() {
+ final String groupId = groupIdText.getText();
+ final String artifactId = artifactIdText.getText();
+ final String version = versionText.getText();
+ new Job("Opening " + groupId + ":" + artifactId + ":" + version) {
+ protected IStatus run(IProgressMonitor monitor) {
+ OpenUrlAction.openBrowser(OpenUrlAction.ID_PROJECT, groupId, artifactId, version, monitor);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+
+ }
+ };
+ openWebPageAction.setEnabled(false);
+
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+ toolBarManager.add(pluginSelectAction);
+ toolBarManager.add(new Separator());
+ toolBarManager.add(openWebPageAction);
+
+ Composite toolbarComposite = toolkit.createComposite(pluginDetailsSection);
+ GridLayout toolbarLayout = new GridLayout(1, true);
+ toolbarLayout.marginHeight = 0;
+ toolbarLayout.marginWidth = 0;
+ toolbarComposite.setLayout(toolbarLayout);
+ toolbarComposite.setBackground(null);
+
+ toolBarManager.createControl(toolbarComposite);
+ pluginDetailsSection.setTextClient(toolbarComposite);
+
+ Composite composite = new Composite(pluginDetailsComposite, SWT.NONE);
+ GridLayout compositeLayout = new GridLayout();
+ compositeLayout.marginWidth = 0;
+ compositeLayout.marginHeight = 0;
+ compositeLayout.numColumns = 3;
+ composite.setLayout(compositeLayout);
+ composite.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false, 1, 1));
+ toolkit.adapt(composite);
+
+ pluginExtensionsButton = toolkit.createButton(composite, Messages.PluginsComposite_btnExtensions, SWT.CHECK);
+ pluginExtensionsButton.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false));
+
+ pluginInheritedButton = toolkit.createButton(composite, Messages.PluginsComposite_btnInherited, SWT.CHECK);
+ pluginInheritedButton.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false));
+
+ pluginDetailsComposite.setTabList(new Control[] {groupIdText, artifactIdText, versionText, composite});
+
+ createConfigurationSection(detailsComposite);
+
+ SashForm executionSash = new SashForm(detailsComposite, SWT.NONE);
+ executionSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
+ GridLayout executionSashLayout = new GridLayout();
+ executionSashLayout.horizontalSpacing = 3;
+ executionSashLayout.marginWidth = 0;
+ executionSashLayout.marginHeight = 0;
+ executionSashLayout.numColumns = 2;
+ executionSash.setLayout(executionSashLayout);
+ toolkit.adapt(executionSash);
+
+ pluginExecutionsSection = toolkit.createSection(executionSash,
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ GridData gd_pluginExecutionsSection = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd_pluginExecutionsSection.minimumHeight = 50;
+ pluginExecutionsSection.setLayoutData(gd_pluginExecutionsSection);
+ pluginExecutionsSection.setText(Messages.PluginsComposite_section_Executions);
+
+ pluginExecutionsEditor = new ListEditorComposite<PluginExecution>(pluginExecutionsSection, SWT.NONE);
+ pluginExecutionsSection.setClient(pluginExecutionsEditor);
+ toolkit.adapt(pluginExecutionsEditor);
+ toolkit.paintBordersFor(pluginExecutionsEditor);
+ pluginExecutionsEditor.setContentProvider(new ListEditorContentProvider<PluginExecution>());
+ pluginExecutionsEditor.setLabelProvider(new LabelProvider() {
+ public String getText(Object element) {
+ if(element instanceof PluginExecution) {
+ PluginExecution pluginExecution = (PluginExecution) element;
+ String label = isEmpty(pluginExecution.getId()) ? "?" : pluginExecution.getId();
+ if(pluginExecution.getPhase()!=null) {
+ label += " : " + pluginExecution.getPhase();
+ }
+ return label;
+ }
+ return ""; //$NON-NLS-1$
+ }
+ public Image getImage(Object element) {
+ return MavenEditorImages.IMG_EXECUTION;
+ }
+ });
+
+ pluginExecutionsEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<PluginExecution> selection = pluginExecutionsEditor.getSelection();
+ updatePluginExecution(selection.size()==1 ? selection.get(0) : null);
+ }
+ });
+
+ pluginExecutionsEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parentEditorPage.getEditingDomain();
+
+
+ PluginExecution pluginExecution = PomFactory.eINSTANCE.createPluginExecution();
+ Command command = AddCommand.create(editingDomain, currentPlugin, POM_PACKAGE.getPlugin_Executions(), pluginExecution);
+ compoundCommand.append(command);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ pluginExecutionsEditor.setSelection(Collections.singletonList(pluginExecution));
+ updatePluginExecution(pluginExecution);
+ executionIdText.setFocus();
+ }
+ });
+
+ pluginExecutionsEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parentEditorPage.getEditingDomain();
+
+ List<PluginExecution> list = pluginExecutionsEditor.getSelection();
+ Command removeCommand = RemoveCommand.create(editingDomain, //
+ currentPlugin, POM_PACKAGE.getPlugin_Executions(), list);
+ compoundCommand.append(removeCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ updatePluginExecution(null);
+ }
+ });
+
+ pluginExecutionSection = toolkit.createSection(executionSash,
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ GridData gd_pluginExecutionSection = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_pluginExecutionSection.minimumHeight = 50;
+ pluginExecutionSection.setLayoutData(gd_pluginExecutionSection);
+ pluginExecutionSection.setText(Messages.PluginsComposite_section_executionDetails);
+ new SectionExpansionAdapter(new Section[]{pluginExecutionSection, pluginExecutionsSection});
+
+ Composite executionComposite = toolkit.createComposite(pluginExecutionSection, SWT.NONE);
+ GridLayout executionCompositeLayout = new GridLayout(2, false);
+ executionCompositeLayout.marginWidth = 2;
+ executionCompositeLayout.marginHeight = 2;
+ executionComposite.setLayout(executionCompositeLayout);
+ pluginExecutionSection.setClient(executionComposite);
+ toolkit.paintBordersFor(executionComposite);
+
+ toolkit.createLabel(executionComposite, Messages.PluginsComposite_lblId, SWT.NONE);
+
+ executionIdText = toolkit.createText(executionComposite, null, SWT.NONE);
+ executionIdText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ toolkit.createLabel(executionComposite, Messages.PluginsComposite_lblPhase, SWT.NONE);
+
+ executionPhaseCombo = new CCombo(executionComposite, SWT.FLAT);
+ executionPhaseCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ executionPhaseCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ executionPhaseCombo.setItems(new String[] { //
+ "pre-clean", // Clean Lifecycle //$NON-NLS-1$
+ "clean", // //$NON-NLS-1$
+ "post-clean", // //$NON-NLS-1$
+ "validate", // Default Lifecycle //$NON-NLS-1$
+ "generate-sources", // //$NON-NLS-1$
+ "process-sources", // //$NON-NLS-1$
+ "generate-resources", // //$NON-NLS-1$
+ "process-resources", // //$NON-NLS-1$
+ "compile", // //$NON-NLS-1$
+ "process-classes", // //$NON-NLS-1$
+ "generate-test-sources", // //$NON-NLS-1$
+ "process-test-sources", // //$NON-NLS-1$
+ "generate-test-resources", // //$NON-NLS-1$
+ "process-test-resources", // //$NON-NLS-1$
+ "test-compile", // //$NON-NLS-1$
+ "process-test-classes", // //$NON-NLS-1$
+ "test", // //$NON-NLS-1$
+ "prepare-package", // //$NON-NLS-1$
+ "package", // //$NON-NLS-1$
+ "pre-integration-test", // //$NON-NLS-1$
+ "integration-test", // //$NON-NLS-1$
+ "post-integration-test", // //$NON-NLS-1$
+ "verify", // //$NON-NLS-1$
+ "install", // //$NON-NLS-1$
+ "deploy", // //$NON-NLS-1$
+ "pre-site", // //$NON-NLS-1$
+ "site", // Site Lifecycle //$NON-NLS-1$
+ "post-site", // //$NON-NLS-1$
+ "site-deploy"}); //$NON-NLS-1$
+ toolkit.adapt(executionPhaseCombo, true, true);
+
+ Label goalsLabel = toolkit.createLabel(executionComposite, Messages.PluginsComposite_lblGoals, SWT.NONE);
+ goalsLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
+
+ goalsEditor = new ListEditorComposite<String>(executionComposite, SWT.NONE);
+ goalsEditor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ toolkit.paintBordersFor(goalsEditor);
+ goalsEditor.setContentProvider(new ListEditorContentProvider<String>());
+ goalsEditor.setLabelProvider(new StringLabelProvider(MavenEditorImages.IMG_GOAL));
+
+ goalsEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parentEditorPage.getEditingDomain();
+
+ String goal = "?";
+ Command command = AddCommand.create(editingDomain, currentPluginExecution, POM_PACKAGE.getPluginExecution_Goals(), goal);
+ compoundCommand.append(command);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ goalsEditor.setSelection(Collections.singletonList(goal));
+ }
+ });
+
+ goalsEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parentEditorPage.getEditingDomain();
+
+ List<String> list = goalsEditor.getSelection();
+ for(String goal : list) {
+ Command removeCommand = RemoveCommand.create(editingDomain, //
+ currentPluginExecution, POM_PACKAGE.getPluginExecution_Goals(), goal);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ }
+ });
+
+ goalsEditor.setCellModifier(new ICellModifier() {
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+
+ public Object getValue(Object element, String property) {
+ return element;
+ }
+
+ public void modify(Object element, String property, Object value) {
+ int n = goalsEditor.getViewer().getTable().getSelectionIndex();
+ if(!value.equals(currentPluginExecution.getGoals().get(n))) {
+ EditingDomain editingDomain = parentEditorPage.getEditingDomain();
+ Command command = SetCommand.create(editingDomain, currentPluginExecution, //
+ POM_PACKAGE.getPluginExecution_Goals(), value, n);
+ editingDomain.getCommandStack().execute(command);
+
+ // currentPluginExecution.getGoals().getGoal().set(n, (String) value);
+ goalsEditor.update();
+ }
+ }
+ });
+
+ Composite executionConfigureComposite = new Composite(executionComposite, SWT.NONE);
+ executionConfigureComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 2, 1));
+ GridLayout gridLayout = new GridLayout(2, false);
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ executionConfigureComposite.setLayout(gridLayout);
+ toolkit.adapt(executionConfigureComposite);
+
+ executionInheritedButton = toolkit.createButton(executionConfigureComposite, Messages.PluginsComposite_btnInherited, SWT.CHECK);
+ executionInheritedButton.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false));
+
+ pluginExecutionConfigurationHyperlink = toolkit.createHyperlink(executionConfigureComposite, Messages.PluginsComposite_linkConfiguration, SWT.NONE);
+ pluginExecutionConfigurationHyperlink.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, false));
+ pluginExecutionConfigurationHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ EObject element = currentPluginExecution.getConfiguration();
+ parentEditorPage.getPomEditor().showInSourceEditor(element==null ? currentPluginExecution : element);
+ }
+ });
+
+ pluginDependenciesSection = toolkit.createSection(detailsComposite,
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ GridData pluginDependenciesSectionData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ pluginDependenciesSectionData.minimumHeight = 50;
+ pluginDependenciesSection.setLayoutData(pluginDependenciesSectionData);
+ pluginDependenciesSection.setText(Messages.PluginsComposite_section_PluginDependencies);
+
+ pluginDependenciesEditor = new ListEditorComposite<Dependency>(pluginDependenciesSection, SWT.NONE);
+ pluginDependenciesSection.setClient(pluginDependenciesEditor);
+ toolkit.adapt(pluginDependenciesEditor);
+ toolkit.paintBordersFor(pluginDependenciesEditor);
+ pluginDependenciesEditor.setContentProvider(new ListEditorContentProvider<Dependency>());
+ pluginDependenciesEditor.setLabelProvider(new DependencyLabelProvider());
+
+ pluginDependenciesEditor.setReadOnly(true);
+
+ // XXX implement plugin dependency editor actions and UI
+
+ FormUtils.setEnabled(pluginDependenciesEditor, false);
+ }
+
+ private void createConfigurationSection(Composite detailsComposite) {
+ pluginConfigurationSection = toolkit.createSection(detailsComposite,
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE);
+ pluginConfigurationSection.setText(Messages.PluginsComposite_section_configuration);
+ pluginConfigurationSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
+ pluginConfigurationSection.setEnabled(false);
+
+ defaultConfigurationEditor = new DefaultPluginConfigurationEditor();
+ setConfigurationEditor(defaultConfigurationEditor);
+
+ openConfigurationAction = new Action(Messages.PluginsComposite_action_openXml, MavenEditorImages.ELEMENT_OBJECT) {
+ public void run() {
+ EObject element = currentPlugin.getConfiguration();
+ parentEditorPage.getPomEditor().showInSourceEditor(element==null ? currentPlugin : element);
+ }
+ };
+ openConfigurationAction.setEnabled(false);
+
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+ toolBarManager.add(openConfigurationAction);
+
+ Composite toolbarComposite = toolkit.createComposite(pluginConfigurationSection);
+ GridLayout toolbarLayout = new GridLayout(1, true);
+ toolbarLayout.marginHeight = 0;
+ toolbarLayout.marginWidth = 0;
+ toolbarComposite.setLayout(toolbarLayout);
+ toolbarComposite.setBackground(null);
+
+ toolBarManager.createControl(toolbarComposite);
+ pluginConfigurationSection.setTextClient(toolbarComposite);
+ }
+
+ private IPluginConfigurationExtension findConfigurationEditor(String groupId, String artifactId) {
+ String ga = groupId + ':' + artifactId;
+ PluginExtensionDescriptor descriptor = pluginConfigurators.get(ga);
+ return descriptor == null || descriptor.getExtension() == null ?
+ defaultConfigurationEditor : descriptor.getExtension();
+ }
+
+ private void setConfigurationEditor(IPluginConfigurationExtension editor) {
+ if(configurationEditor == editor) {
+ return;
+ }
+
+ if(configurationEditor != null) {
+ configurationEditor.cleanup();
+ }
+
+ boolean expanded = pluginConfigurationSection.isExpanded();
+ if(expanded) {
+ pluginConfigurationSection.setExpanded(false);
+ }
+
+ Control control = pluginConfigurationSection.getClient();
+ if(control != null) {
+ control.dispose();
+ }
+ configurationEditor = editor;
+ configurationEditor.setPomEditor(parentEditorPage);
+
+ Composite configurationComposite = configurationEditor.createComposite(pluginConfigurationSection);
+ configurationComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
+ toolkit.adapt(configurationComposite);
+ pluginConfigurationSection.setClient(configurationComposite);
+ toolkit.paintBordersFor(configurationComposite);
+ pluginConfigurationSection.layout();
+
+ if(expanded) {
+ pluginConfigurationSection.setExpanded(true);
+ }
+ }
+
+ void updatePluginDetails(Plugin plugin) {
+ if(changingSelection) {
+ return;
+ }
+// if(plugin!=null && currentPlugin==plugin) {
+// return;
+// }
+ this.currentPlugin = plugin;
+
+ if(parentEditorPage!=null) {
+ parentEditorPage.removeNotifyListener(groupIdText);
+ parentEditorPage.removeNotifyListener(artifactIdText);
+ parentEditorPage.removeNotifyListener(versionText);
+ parentEditorPage.removeNotifyListener(pluginExtensionsButton);
+ parentEditorPage.removeNotifyListener(pluginInheritedButton);
+ }
+
+ if(plugin==null) {
+ pluginConfigurationSection.setExpanded(false);
+ pluginConfigurationSection.setEnabled(false);
+ FormUtils.setEnabled(pluginDetailsSection, false);
+ FormUtils.setEnabled(pluginExecutionsSection, false);
+ FormUtils.setEnabled(pluginDependenciesSection, false);
+ pluginSelectAction.setEnabled(false);
+ openWebPageAction.setEnabled(false);
+ openConfigurationAction.setEnabled(false);
+
+ setText(groupIdText, ""); //$NON-NLS-1$
+ setText(artifactIdText, ""); //$NON-NLS-1$
+ setText(versionText, ""); //$NON-NLS-1$
+ setButton(pluginExtensionsButton, false);
+ setButton(pluginInheritedButton, false);
+
+ pluginExecutionsEditor.setInput(null);
+ pluginDependenciesEditor.setInput(null);
+ updatePluginExecution(null);
+
+ if(configurationEditor != null) {
+ configurationEditor.cleanup();
+ }
+ return;
+ }
+
+ pluginConfigurationSection.setEnabled(true);
+ FormUtils.setEnabled(pluginDetailsSection, true);
+ FormUtils.setEnabled(pluginExecutionsSection, true);
+ FormUtils.setEnabled(pluginDependenciesSection, true);
+
+ FormUtils.setReadonly(pluginDetailsSection, parentEditorPage.isReadOnly());
+ FormUtils.setReadonly(pluginConfigurationSection, parentEditorPage.isReadOnly());
+ FormUtils.setReadonly(pluginExecutionsSection, parentEditorPage.isReadOnly());
+ pluginSelectAction.setEnabled(!parentEditorPage.isReadOnly());
+ openWebPageAction.setEnabled(true);
+ openConfigurationAction.setEnabled(true);
+
+ // XXX implement dependency editing
+ FormUtils.setReadonly(pluginDependenciesSection, true);
+
+ String groupId = plugin.getGroupId();
+ String artifactId = plugin.getArtifactId();
+ String version = plugin.getVersion();
+
+ setText(groupIdText, groupId);
+ setText(artifactIdText, artifactId);
+ setText(versionText, version);
+
+ setConfigurationEditor(findConfigurationEditor(groupId, artifactId));
+ if(configurationEditor != defaultConfigurationEditor && plugin.getConfiguration() == null) {
+ // if a configuration editor is available, create the config section right away
+ Configuration configuration = PomFactory.eINSTANCE.createConfiguration();
+ plugin.setConfiguration(configuration);
+ }
+ configurationEditor.setPlugin(plugin);
+
+ setButton(pluginInheritedButton, plugin.getInherited()==null || "true".equals(plugin.getInherited()));
+ setButton(pluginExtensionsButton, "true".equals(plugin.getExtensions()));
+
+ pluginExecutionsEditor.setInput(plugin.getExecutions());
+
+ pluginDependenciesEditor.setInput(plugin.getDependencies());
+
+ updatePluginExecution(null);
+
+ // register listeners
+
+ ValueProvider<Plugin> provider = new ValueProvider.DefaultValueProvider<Plugin>(currentPlugin);
+ parentEditorPage.setModifyListener(groupIdText, provider, POM_PACKAGE.getPlugin_GroupId(), ""); //$NON-NLS-1$
+ parentEditorPage.setModifyListener(artifactIdText, provider, POM_PACKAGE.getPlugin_ArtifactId(), ""); //$NON-NLS-1$
+ parentEditorPage.setModifyListener(versionText, provider, POM_PACKAGE.getPlugin_Version(), ""); //$NON-NLS-1$
+ parentEditorPage.setModifyListener(pluginInheritedButton, provider, POM_PACKAGE.getPlugin_Inherited(), "true");
+ parentEditorPage.setModifyListener(pluginExtensionsButton, provider, POM_PACKAGE.getPlugin_Extensions(), "false");
+ }
+
+ void updatePluginExecution(PluginExecution pluginExecution) {
+// if(pluginExecution!=null && currentPluginExecution==pluginExecution) {
+// return;
+// }
+ currentPluginExecution = pluginExecution;
+
+ if(parentEditorPage!=null) {
+ parentEditorPage.removeNotifyListener(executionIdText);
+ parentEditorPage.removeNotifyListener(executionPhaseCombo);
+ parentEditorPage.removeNotifyListener(executionInheritedButton);
+ }
+
+ if(pluginExecution==null) {
+ FormUtils.setEnabled(pluginExecutionSection, false);
+
+ setText(executionIdText, ""); //$NON-NLS-1$
+ setText(executionPhaseCombo, ""); //$NON-NLS-1$
+ setButton(executionInheritedButton, false);
+ goalsEditor.setInput(null);
+
+ return;
+ }
+
+ FormUtils.setEnabled(pluginExecutionSection, true);
+ FormUtils.setReadonly(pluginExecutionSection, parentEditorPage.isReadOnly());
+
+ setText(executionIdText, pluginExecution.getId());
+ setText(executionPhaseCombo, pluginExecution.getPhase());
+ setButton(executionInheritedButton, pluginExecution.getInherited()==null || "true".equals(pluginExecution.getInherited()));
+
+ goalsEditor.setInput(pluginExecution.getGoals());
+ // goalsEditor.setSelection(Collections.<String>emptyList());
+
+ // register listeners
+ ValueProvider<PluginExecution> provider = new ValueProvider.DefaultValueProvider<PluginExecution>(pluginExecution);
+ parentEditorPage.setModifyListener(executionIdText, provider, POM_PACKAGE.getPluginExecution_Id(), ""); //$NON-NLS-1$
+ parentEditorPage.setModifyListener(executionPhaseCombo, provider, POM_PACKAGE.getPluginExecution_Phase(), ""); //$NON-NLS-1$
+ parentEditorPage.setModifyListener(executionInheritedButton, provider, POM_PACKAGE.getPluginExecution_Inherited(), "true");
+ }
+
+ public void loadData(MavenPomEditorPage editorPage, ValueProvider<BuildBase> buildProvider,
+ ValueProvider<PluginManagement> pluginManagementProvider) {
+ this.parentEditorPage = editorPage;
+ this.buildProvider = buildProvider;
+ this.pluginManagementProvider = pluginManagementProvider;
+
+ changingSelection = true;
+ loadPlugins();
+ loadPluginManagement();
+ changingSelection = false;
+
+ pluginsEditor.setReadOnly(parentEditorPage.isReadOnly());
+ pluginManagementEditor.setReadOnly(parentEditorPage.isReadOnly());
+
+ pluginAddAction.setEnabled(!parentEditorPage.isReadOnly());
+ pluginAddAction.setProvider(buildProvider);
+ pluginManagementAddAction.setEnabled(!parentEditorPage.isReadOnly());
+ pluginManagementAddAction.setProvider(pluginManagementProvider);
+ updatePluginDetails(null);
+
+// pluginExecutionsEditor.setReadOnly(parent.isReadOnly());
+// goalsEditor.setReadOnly(parent.isReadOnly());
+// pluginDependenciesEditor.setReadOnly(parent.isReadOnly());
+ }
+
+ private void loadPlugins() {
+ BuildBase build = buildProvider.getValue();
+ pluginsEditor.setInput(build == null ? null : build.getPlugins());
+ }
+
+ private void loadPluginManagement() {
+ PluginManagement pluginManagement = pluginManagementProvider.getValue();
+ pluginManagementEditor.setInput(pluginManagement == null ? null : pluginManagement.getPlugins());
+ }
+
+ public void updateView(MavenPomEditorPage editorPage, Notification notification) {
+ Object object = notification.getNotifier();
+ Object feature = notification.getFeature();
+ Object notificationObject = MavenPomEditorPage.getFromNotification(notification);
+
+ if(feature == PomPackage.Literals.BUILD_BASE__PLUGINS || feature == PomPackage.Literals.PLUGIN_MANAGEMENT__PLUGINS) {
+ pluginsEditor.refresh();
+ pluginManagementEditor.refresh();
+ }
+
+ if(object instanceof PluginManagement) {
+ pluginManagementEditor.refresh();
+ }
+
+ if(object instanceof Plugin) {
+ pluginsEditor.refresh();
+ pluginManagementEditor.refresh();
+ if(object == currentPlugin && (notificationObject == null || notificationObject instanceof Plugin)) {
+ updatePluginDetails((Plugin) notificationObject);
+ }
+ }
+
+ if(feature == PomPackage.Literals.PLUGIN__EXECUTIONS) {
+ pluginExecutionsEditor.refresh();
+ goalsEditor.refresh();
+ }
+
+ if(object instanceof PluginExecution) {
+ pluginExecutionsEditor.refresh();
+ if(currentPluginExecution == object
+ && (notificationObject == null || notificationObject instanceof PluginExecution)) {
+ updatePluginExecution((PluginExecution) notificationObject);
+ }
+ }
+
+ if(feature == PomPackage.Literals.PLUGIN_EXECUTION__GOALS) {
+ goalsEditor.setInput(((PluginExecution) object).getGoals());
+ goalsEditor.refresh();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ void createPlugin(ListEditorComposite<Plugin> editor, ValueProvider<? extends EObject> parentObjectProvider, EStructuralFeature feature, String groupId, String artifactId, String version) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parentEditorPage.getEditingDomain();
+
+ EObject parentObject = parentObjectProvider.getValue();
+ boolean created = false;
+ if(null == parentObject) {
+ parentObject = parentObjectProvider.create(editingDomain, compoundCommand);
+ created = true;
+ }
+
+ Plugin plugin = PomFactory.eINSTANCE.createPlugin();
+ plugin.setGroupId(groupId);
+ plugin.setArtifactId(artifactId);
+ plugin.setVersion(version);
+
+ if(findConfigurationEditor(groupId, artifactId) != defaultConfigurationEditor) {
+ // if a configuration editor is available, create the config section right away
+ Configuration configuration = PomFactory.eINSTANCE.createConfiguration();
+ plugin.setConfiguration(configuration);
+ }
+
+ Command command = AddCommand.create(editingDomain, parentObject, feature, plugin);
+ compoundCommand.append(command);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ if(created) {
+ editor.setInput((EList<Plugin>)parentObject.eGet(feature));
+ }
+ editor.setSelection(Collections.singletonList(plugin));
+ updatePluginDetails(plugin);
+ groupIdText.setFocus();
+ }
+
+ /**
+ * Plugin label provider
+ */
+ static final class PluginLabelProvider extends LabelProvider {
+
+ private boolean showGroupId = false;
+
+ public void setShowGroupId(boolean showGroupId) {
+ this.showGroupId = showGroupId;
+ }
+
+ public String getText(Object element) {
+ if(element instanceof Plugin) {
+ Plugin plugin = (Plugin) element;
+ String label = ""; //$NON-NLS-1$
+
+ if(showGroupId) {
+ if(!isEmpty(plugin.getGroupId())) {
+ label += plugin.getGroupId() + " : ";
+ }
+ }
+
+ label += isEmpty(plugin.getArtifactId()) ? "?" : plugin.getArtifactId();
+
+ if(!isEmpty(plugin.getVersion())) {
+ label += " : " + plugin.getVersion();
+ }
+
+ return label;
+ }
+ return super.getText(element);
+ }
+
+ public Image getImage(Object element) {
+ return MavenEditorImages.IMG_PLUGIN;
+ }
+
+ }
+
+ public void setSearchControl(SearchControl searchControl) {
+ if(this.searchControl!=null) {
+ return;
+ }
+
+ this.searchMatcher = new SearchMatcher(searchControl);
+ this.searchFilter = new PluginFilter(searchMatcher);
+ this.searchControl = searchControl;
+ this.searchControl.getSearchText().addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ changingSelection = true;
+ selectPlugins(pluginsEditor, buildProvider.getValue().getPlugins());
+ selectPlugins(pluginManagementEditor, pluginManagementProvider.getValue().getPlugins());
+ changingSelection = false;
+
+ updatePluginDetails(null);
+ }
+
+ private void selectPlugins(ListEditorComposite<Plugin> editor, List<Plugin> value) {
+ List<Plugin> plugins = new ArrayList<Plugin>();
+ if(value!=null) {
+ for(Plugin p : value) {
+ if(searchMatcher.isMatchingArtifact(p.getGroupId(), p.getArtifactId())) {
+ plugins.add(p);
+ }
+ }
+ }
+ editor.setSelection(plugins);
+ editor.refresh();
+ }
+ });
+ //we add filter here as the default behaviour is to filter..
+ TableViewer viewer = pluginsEditor.getViewer();
+ viewer.addFilter(searchFilter);
+ viewer = pluginManagementEditor.getViewer();
+ viewer.addFilter(searchFilter);
+
+ }
+
+
+ public static class PluginFilter extends ViewerFilter {
+
+ private final SearchMatcher searchMatcher;
+
+ public PluginFilter(SearchMatcher searchMatcher) {
+ this.searchMatcher = searchMatcher;
+ }
+
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if(element instanceof Plugin) {
+ Plugin p = (Plugin) element;
+ return searchMatcher.isMatchingArtifact(p.getGroupId(), p.getArtifactId());
+ }
+ if(element instanceof ReportPlugin) {
+ ReportPlugin p = (ReportPlugin) element;
+ return searchMatcher.isMatchingArtifact(p.getGroupId(), p.getArtifactId());
+ }
+ return false;
+ }
+
+ }
+
+ private void loadPluginConfigurators() {
+ pluginConfigurators = new HashMap<String,PluginExtensionDescriptor>();
+
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint configuratorsExtensionPoint = registry.getExtensionPoint(EXTENSION_CONFIGURATION_EDITOR);
+ if(configuratorsExtensionPoint != null) {
+ IExtension[] configuratorExtensions = configuratorsExtensionPoint.getExtensions();
+ for(IExtension extension : configuratorExtensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for(IConfigurationElement element : elements) {
+ if(element.getName().equals(ELEMENT_CONFIGURATION_EDITOR)) {
+ PluginExtensionDescriptor descriptor = new PluginExtensionDescriptor(element);
+ pluginConfigurators.put(descriptor.toString(), descriptor);
+ }
+ }
+ }
+ }
+ }
+
+ // an action button with a list of supported plug-ins
+ final class PluginSelectAction extends Action implements IMenuCreator {
+ private Menu menu = null;
+ private List<IAction> actions = null;
+ ActionContributionItem item = null;
+ ValueProvider<? extends EObject> provider = null;
+
+ protected PluginSelectAction(ListEditorComposite<Plugin> editor, EReference pomPackage) {
+ super("", IAction.AS_DROP_DOWN_MENU); //$NON-NLS-1$
+ setImageDescriptor(MavenEditorImages.ADD_PLUGIN);
+ setMenuCreator(this);
+ setEnabled(false);
+ setToolTipText(Messages.PluginsComposite_tooltip_addPlugin);
+ actions = new ArrayList<IAction>();
+ for(PluginExtensionDescriptor descriptor : pluginConfigurators.values()) {
+ actions.add(createContributedAction(editor, pomPackage, descriptor));
+ }
+ actions.add(createDefaultAction(editor, pomPackage));
+ item = new ActionContributionItem(this);
+ }
+
+ private Action createDefaultAction(final ListEditorComposite<Plugin> editor, final EReference pomPackage) {
+ return new Action( Messages.PluginsComposite_action_other ) {
+ public void run() {
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getShell(),
+ Messages.PluginsComposite_searchDialog_addPlugin, IIndex.SEARCH_PLUGIN, Collections.<ArtifactKey>emptySet());
+ if(dialog.open() == Window.OK) {
+ IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+ if(af != null) {
+ createPlugin(editor, provider, pomPackage, af.group, af.artifact, af.version);
+ }
+ }
+ }
+ };
+ }
+
+ private Action createContributedAction(final ListEditorComposite<Plugin> editor, final EReference pomPackage, final PluginExtensionDescriptor descriptor) {
+ return new Action( descriptor.getName() ) {
+ public void run() {
+ String groupId = descriptor.getGroupId();
+ String artifactId = descriptor.getArtifactId();
+ String version = ""; //$NON-NLS-1$
+ try {
+ Collection<String> versions = MavenPlugin.getDefault().getSearchEngine(parentEditorPage.getProject()).findVersions(groupId, artifactId, null, Packaging.PLUGIN);
+ if(!versions.isEmpty()) {
+ version = versions.iterator().next();
+ }
+ } catch(CoreException e) {
+ // TODO Auto-generated catch block
+ MavenLogger.log("Error retrieving available versions for " + groupId + ':' + artifactId, e); //$NON-NLS-1$
+ }
+
+ createPlugin(editor, provider, pomPackage, groupId, artifactId, version);
+ }
+ };
+ }
+
+ public Menu getMenu(Menu menu) {
+ return null;
+ }
+
+ public Menu getMenu(Control control) {
+ dispose();
+ menu = new Menu(control);
+ for(IAction action : actions) {
+ ActionContributionItem item = new ActionContributionItem(action);
+ item.fill(menu, -1);
+ }
+ return menu;
+ }
+
+ public void dispose() {
+ if(menu != null) {
+ menu.dispose();
+ }
+ }
+
+ public IContributionItem getItem() {
+ return item;
+ }
+
+ public void run() {
+ // a drop-down button would have a separate click action which does nothing by default,
+ // we need to show the same menu as if the user clicked on the chevron
+ Widget w = item.getWidget();
+ if(w != null && w instanceof ToolItem) {
+ ToolItem ti = (ToolItem)w;
+ Rectangle r = ti.getBounds();
+ Point point = ti.getParent().toDisplay(r.x, r.y + r.height);
+ Menu m = getMenu(ti.getParent());
+ m.setLocation(point.x, point.y);
+ m.setVisible(true);
+ }
+ }
+
+ protected void setProvider(final ValueProvider<? extends EObject> provider) {
+ this.provider = provider;
+ }
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ReportingComposite.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ReportingComposite.java
new file mode 100644
index 00000000..0692ddfd
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ReportingComposite.java
@@ -0,0 +1,885 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.composites;
+
+import static org.eclipse.m2e.editor.pom.FormUtils.nvl;
+import static org.eclipse.m2e.editor.pom.FormUtils.setButton;
+import static org.eclipse.m2e.editor.pom.FormUtils.setText;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.window.Window;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.actions.OpenUrlAction;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.ui.dialogs.MavenRepositorySearchDialog;
+import org.eclipse.m2e.core.util.M2EUtils;
+import org.eclipse.m2e.core.util.ProposalUtil;
+import org.eclipse.m2e.core.util.search.Packaging;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.composites.PluginsComposite.PluginFilter;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.editor.pom.FormUtils;
+import org.eclipse.m2e.editor.pom.MavenPomEditorPage;
+import org.eclipse.m2e.editor.pom.SearchControl;
+import org.eclipse.m2e.editor.pom.SearchMatcher;
+import org.eclipse.m2e.editor.pom.ValueProvider;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.ReportPlugin;
+import org.eclipse.m2e.model.edit.pom.ReportSet;
+import org.eclipse.m2e.model.edit.pom.Reporting;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.Section;
+
+
+/**
+ * @author Eugene Kuleshov
+ * @author Dmitry Platonoff
+ */
+public class ReportingComposite extends Composite {
+
+ protected static PomPackage POM_PACKAGE = PomPackage.eINSTANCE;
+
+ FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+
+ MavenPomEditorPage editorPage;
+
+ Text outputFolderText;
+
+ Text groupIdText;
+
+ Text artifactIdText;
+
+ Text versionText;
+
+ Button pluginInheritedButton;
+
+ Hyperlink pluginConfigureButton;
+
+ ListEditorComposite<ReportSet> reportSetsEditor;
+
+ ListEditorComposite<String> reportsEditor;
+
+ ListEditorComposite<ReportPlugin> reportPluginsEditor;
+
+ Section pluginDetailsSection;
+
+ Button reportSetInheritedButton;
+
+ Hyperlink reportSetConfigureButton;
+
+ Button excludeDefaultsButton;
+
+ Section reportSetDetailsSection;
+
+ Section reportSetsSection;
+
+ Action openWebPageAction;
+
+// Action reportPluginAddAction;
+
+ Action reportPluginSelectAction;
+
+ ViewerFilter searchFilter;
+
+ SearchControl searchControl;
+
+ SearchMatcher searchMatcher;
+
+ // model
+
+ ValueProvider<Reporting> reportingProvider;
+
+ ReportPlugin currentReportPlugin = null;
+
+ ReportSet currentReportSet = null;
+
+
+ public ReportingComposite(Composite parent, MavenPomEditorPage page, int style) {
+ super(parent, style);
+ this.editorPage = page;
+ GridLayout gridLayout = new GridLayout(1, false);
+ gridLayout.marginWidth = 0;
+ setLayout(gridLayout);
+ toolkit.adapt(this);
+
+ SashForm horizontalSash = new SashForm(this, SWT.NONE);
+ horizontalSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ toolkit.adapt(horizontalSash, true, true);
+
+ createContentSection(horizontalSash);
+
+ Composite verticalSash = toolkit.createComposite(horizontalSash);
+ GridLayout reportingPluginDetailsLayout = new GridLayout();
+ reportingPluginDetailsLayout.marginWidth = 0;
+ reportingPluginDetailsLayout.marginHeight = 0;
+ verticalSash.setLayout(reportingPluginDetailsLayout);
+
+ createPluginDetailsSection(verticalSash);
+ createReportSetDetails(verticalSash);
+
+ horizontalSash.setWeights(new int[] {1, 1});
+ }
+
+ private void createContentSection(SashForm horizontalSash) {
+ Composite composite_1 = toolkit.createComposite(horizontalSash, SWT.NONE);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ composite_1.setLayout(gridLayout);
+ toolkit.paintBordersFor(composite_1);
+
+ Section contentSection = toolkit.createSection(composite_1, ExpandableComposite.TITLE_BAR);
+ contentSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ contentSection.setText(Messages.ReportingComposite_section_Content);
+
+ Composite composite = toolkit.createComposite(contentSection, SWT.NONE);
+ composite.setLayout(new GridLayout(2, false));
+ contentSection.setClient(composite);
+ toolkit.paintBordersFor(composite);
+
+ toolkit.createLabel(composite, Messages.ReportingComposite_lblOutputFolder, SWT.NONE);
+
+ outputFolderText = toolkit.createText(composite, null, SWT.NONE);
+ outputFolderText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ excludeDefaultsButton = toolkit.createButton(composite, Messages.ReportingComposite_btnExcludeDefaults, SWT.CHECK);
+ excludeDefaultsButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 2, 1));
+
+ Section reportingPluginsSection = toolkit.createSection(composite_1, ExpandableComposite.TITLE_BAR);
+ reportingPluginsSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
+ reportingPluginsSection.setText(Messages.ReportingComposite_sectionReportingPlugins);
+
+ reportPluginsEditor = new ListEditorComposite<ReportPlugin>(reportingPluginsSection, SWT.NONE, true);
+ reportingPluginsSection.setClient(reportPluginsEditor);
+ toolkit.paintBordersFor(reportPluginsEditor);
+ toolkit.adapt(reportPluginsEditor);
+
+ final ReportPluginsLabelProvider labelProvider = new ReportPluginsLabelProvider();
+ reportPluginsEditor.setLabelProvider(labelProvider);
+ reportPluginsEditor.setContentProvider(new ListEditorContentProvider<ReportPlugin>());
+
+ reportPluginsEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<ReportPlugin> selection = reportPluginsEditor.getSelection();
+ updateReportPluginDetails(selection.size() == 1 ? selection.get(0) : null);
+ }
+ });
+
+ reportPluginsEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ createReportingPlugin(null, null, null);
+ }
+ });
+
+ reportPluginsEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = editorPage.getEditingDomain();
+
+ Reporting reporting = reportingProvider.getValue();
+
+ if(reporting != null) {
+ List<ReportPlugin> pluginList = reportPluginsEditor.getSelection();
+ for(ReportPlugin reportPlugin : pluginList) {
+ Command removeCommand = RemoveCommand.create(editingDomain, reporting, POM_PACKAGE
+ .getReporting_Plugins(), reportPlugin);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ updateContent(reporting);
+ }
+ }
+ });
+
+ reportPluginsEditor.setAddButtonListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e){
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getShell(), //
+ Messages.ReportingComposite_searchDialog_addPlugin, IIndex.SEARCH_PLUGIN, Collections.<ArtifactKey>emptySet());
+ if(dialog.open() == Window.OK) {
+ IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+ if(af != null) {
+ createReportingPlugin(af.group, af.artifact, af.version);
+ }
+ }
+ }
+ });
+// reportPluginAddAction = new Action("Add Report Plugin", MavenEditorImages.ADD_PLUGIN) {
+// public void run() {
+//
+// }
+// };
+// reportPluginAddAction.setEnabled(false);
+// toolBarManager.add(reportPluginAddAction);
+// toolBarManager.add(new Separator());
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+
+
+ toolBarManager.add(new Action(Messages.ReportingComposite_action_showGroupId, MavenEditorImages.SHOW_GROUP) {
+ {
+ setChecked(true);
+ }
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+ public void run() {
+ labelProvider.setShowGroupId(isChecked());
+ reportPluginsEditor.getViewer().refresh();
+ }
+ });
+
+ toolBarManager.add(new Action(Messages.ReportingComposite_action_filter, MavenEditorImages.FILTER) {
+ {
+ setChecked(true);
+ }
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+ public void run() {
+ TableViewer viewer = reportPluginsEditor.getViewer();
+ if(isChecked()) {
+ viewer.addFilter(searchFilter);
+ } else {
+ viewer.removeFilter(searchFilter);
+ }
+ viewer.refresh();
+ if(isChecked()) {
+ searchControl.getSearchText().setFocus();
+ }
+ }
+ });
+
+ Composite toolbarComposite = toolkit.createComposite(reportingPluginsSection);
+ GridLayout toolbarLayout = new GridLayout(1, true);
+ toolbarLayout.marginHeight = 0;
+ toolbarLayout.marginWidth = 0;
+ toolbarComposite.setLayout(toolbarLayout);
+ toolbarComposite.setBackground(null);
+
+ toolBarManager.createControl(toolbarComposite);
+ reportingPluginsSection.setTextClient(toolbarComposite);
+
+ }
+
+ private void createPluginDetailsSection(Composite verticalSash) {
+ pluginDetailsSection = toolkit.createSection(verticalSash, ExpandableComposite.TITLE_BAR);
+ pluginDetailsSection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ pluginDetailsSection.setText(Messages.ReportingComposite_section_reportingPluginDetails);
+
+ Composite pluginDetailsComposite = toolkit.createComposite(pluginDetailsSection, SWT.NONE);
+ GridLayout gridLayout_1 = new GridLayout(2, false);
+ gridLayout_1.marginWidth = 2;
+ gridLayout_1.marginHeight = 2;
+ pluginDetailsComposite.setLayout(gridLayout_1);
+ pluginDetailsSection.setClient(pluginDetailsComposite);
+ toolkit.paintBordersFor(pluginDetailsComposite);
+
+ toolkit.createLabel(pluginDetailsComposite, Messages.ReportingComposite_lblGroupId, SWT.NONE);
+
+ groupIdText = toolkit.createText(pluginDetailsComposite, null, SWT.NONE);
+ GridData gd_groupIdText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_groupIdText.horizontalIndent = 4;
+ groupIdText.setLayoutData(gd_groupIdText);
+ groupIdText.setData("name", "groupIdText"); //$NON-NLS-1$ //$NON-NLS-2$
+ ProposalUtil.addGroupIdProposal(editorPage.getProject(), groupIdText, Packaging.ALL);
+ M2EUtils.addRequiredDecoration(groupIdText);
+
+ Hyperlink artifactIdHyperlink = toolkit.createHyperlink(pluginDetailsComposite, Messages.ReportingComposite_lblArtifactId, SWT.NONE);
+ artifactIdHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ final String groupId = groupIdText.getText();
+ final String artifactId = artifactIdText.getText();
+ final String version = versionText.getText();
+ new Job("Opening " + groupId + ":" + artifactId + ":" + version) {
+ protected IStatus run(IProgressMonitor arg0) {
+ OpenPomAction.openEditor(groupId, artifactId, version, null);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ });
+
+ artifactIdText = toolkit.createText(pluginDetailsComposite, null, SWT.NONE);
+ GridData gd_artifactIdText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_artifactIdText.horizontalIndent = 4;
+ artifactIdText.setLayoutData(gd_artifactIdText);
+ artifactIdText.setData("name", "artifactIdText"); //$NON-NLS-1$ //$NON-NLS-2$
+ ProposalUtil.addArtifactIdProposal(editorPage.getProject(), groupIdText, artifactIdText, Packaging.ALL);
+ M2EUtils.addRequiredDecoration(artifactIdText);
+
+ toolkit.createLabel(pluginDetailsComposite, Messages.ReportingComposite_lblVersion, SWT.NONE);
+
+ versionText = toolkit.createText(pluginDetailsComposite, null, SWT.NONE);
+ GridData gd_versionText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_versionText.horizontalIndent = 4;
+ versionText.setLayoutData(gd_versionText);
+ versionText.setData("name", "versionText"); //$NON-NLS-1$ //$NON-NLS-2$
+ ProposalUtil.addVersionProposal(editorPage.getProject(), groupIdText, artifactIdText, versionText, Packaging.ALL);
+
+ Composite pluginConfigureComposite = toolkit.createComposite(pluginDetailsComposite, SWT.NONE);
+ GridData pluginConfigureCompositeData = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 2, 1);
+ pluginConfigureComposite.setLayoutData(pluginConfigureCompositeData);
+ GridLayout pluginConfigureCompositeLayout = new GridLayout(2, false);
+ pluginConfigureCompositeLayout.marginWidth = 0;
+ pluginConfigureCompositeLayout.marginHeight = 0;
+ pluginConfigureComposite.setLayout(pluginConfigureCompositeLayout);
+ toolkit.paintBordersFor(pluginConfigureComposite);
+
+ pluginInheritedButton = toolkit.createButton(pluginConfigureComposite, Messages.ReportingComposite_btnInherited, SWT.CHECK);
+ pluginInheritedButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+
+ pluginConfigureButton = toolkit.createHyperlink(pluginConfigureComposite, Messages.ReportingComposite_link_Configuration, SWT.NONE);
+ pluginConfigureButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+ pluginConfigureButton.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ if(currentReportPlugin != null) {
+ EObject element = currentReportPlugin.getConfiguration();
+ editorPage.getPomEditor().showInSourceEditor(element == null ? currentReportPlugin : element);
+ }
+ }
+ });
+ pluginDetailsComposite.setTabList(new Control[] {groupIdText, artifactIdText, versionText, pluginConfigureComposite});
+
+ openWebPageAction = new Action(Messages.ReportingComposite_action_openWeb, MavenEditorImages.WEB_PAGE) {
+ public void run() {
+ final String groupId = groupIdText.getText();
+ final String artifactId = artifactIdText.getText();
+ final String version = versionText.getText();
+ new Job("Opening " + groupId + ":" + artifactId + ":" + version) {
+ protected IStatus run(IProgressMonitor monitor) {
+ OpenUrlAction.openBrowser(OpenUrlAction.ID_PROJECT, groupId, artifactId, version, monitor);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+
+ }
+ };
+ openWebPageAction.setEnabled(false);
+
+ reportPluginSelectAction = new Action(Messages.ReportingComposite_action_selectReportingPlugin, MavenEditorImages.SELECT_PLUGIN) {
+ public void run() {
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getShell(), //
+ Messages.ReportingComposite_searchDialog_selectPlugin, IIndex.SEARCH_PLUGIN, Collections.<ArtifactKey>emptySet());
+ if(dialog.open() == Window.OK) {
+ IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+ if(af != null) {
+ groupIdText.setText(nvl(af.group));
+ artifactIdText.setText(nvl(af.artifact));
+ versionText.setText(nvl(af.version));
+ }
+ }
+ }
+ };
+ reportPluginSelectAction.setEnabled(false);
+
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+ toolBarManager.add(reportPluginSelectAction);
+ toolBarManager.add(new Separator());
+ toolBarManager.add(openWebPageAction);
+
+ Composite toolbarComposite = toolkit.createComposite(pluginDetailsSection);
+ GridLayout toolbarLayout = new GridLayout(1, true);
+ toolbarLayout.marginHeight = 0;
+ toolbarLayout.marginWidth = 0;
+ toolbarComposite.setLayout(toolbarLayout);
+ toolbarComposite.setBackground(null);
+
+ toolBarManager.createControl(toolbarComposite);
+ pluginDetailsSection.setTextClient(toolbarComposite);
+
+ }
+
+ private void createReportSetDetails(Composite verticalSash) {
+ reportSetsSection = toolkit.createSection(verticalSash, ExpandableComposite.TITLE_BAR);
+ reportSetsSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ reportSetsSection.setText(Messages.ReportingComposite_section_reportSets);
+
+ reportSetsEditor = new ListEditorComposite<ReportSet>(reportSetsSection, SWT.NONE);
+ reportSetsSection.setClient(reportSetsEditor);
+ toolkit.paintBordersFor(reportSetsEditor);
+ toolkit.adapt(reportSetsEditor);
+
+ reportSetsEditor.setContentProvider(new ListEditorContentProvider<ReportSet>());
+ reportSetsEditor.setLabelProvider(new LabelProvider() {
+ public String getText(Object element) {
+ if(element instanceof ReportSet) {
+ ReportSet reportSet = (ReportSet) element;
+ String id = reportSet.getId();
+ return id == null || id.length() == 0 ? "?" : id;
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ public Image getImage(Object element) {
+ // TODO add icon for report set
+ return null;
+ }
+ });
+
+ reportSetsEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<ReportSet> selection = reportSetsEditor.getSelection();
+ updateReportSetDetails(selection.size() == 1 ? selection.get(0) : null);
+ }
+ });
+
+ reportSetsEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if(currentReportPlugin == null) {
+ return;
+ }
+
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = editorPage.getEditingDomain();
+
+ boolean reportSetsCreated = false;
+
+ ReportSet reportSet = PomFactory.eINSTANCE.createReportSet();
+ Command addReportSet = AddCommand.create(editingDomain, currentReportPlugin, POM_PACKAGE.getReportPlugin_ReportSets(),
+ reportSet);
+ compoundCommand.append(addReportSet);
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ if(reportSetsCreated) {
+ updateReportPluginDetails(currentReportPlugin);
+ }
+ reportSetsEditor.setSelection(Collections.singletonList(reportSet));
+ }
+ });
+
+ reportSetsEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if(currentReportPlugin == null) {
+ return;
+ }
+
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = editorPage.getEditingDomain();
+
+
+ List<ReportSet> reportSetList = reportSetsEditor.getSelection();
+ for(ReportSet reportSet : reportSetList) {
+ Command removeCommand = RemoveCommand.create(editingDomain, currentReportPlugin, POM_PACKAGE
+ .getReportPlugin_ReportSets(), reportSet);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ updateReportPluginDetails(currentReportPlugin);
+ }
+ });
+
+ reportSetsEditor.setCellModifier(new ICellModifier() {
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+
+ public Object getValue(Object element, String property) {
+ if(element instanceof ReportSet) {
+ String id = ((ReportSet) element).getId();
+ return id == null ? "" : id; //$NON-NLS-1$
+ }
+ return element;
+ }
+
+ public void modify(Object element, String property, Object value) {
+ EditingDomain editingDomain = editorPage.getEditingDomain();
+ if(!value.equals(currentReportSet.getId())) {
+ Command command = SetCommand.create(editingDomain, currentReportSet, POM_PACKAGE.getReportSet_Id(), value);
+ editingDomain.getCommandStack().execute(command);
+ }
+ }
+ });
+
+ reportSetDetailsSection = toolkit.createSection(verticalSash, ExpandableComposite.TITLE_BAR);
+ reportSetDetailsSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ reportSetDetailsSection.setText(Messages.ReportingComposite_section_reportSetReports);
+
+ Composite reportSetDetailsComposite = toolkit.createComposite(reportSetDetailsSection, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(1, false);
+ gridLayout.marginWidth = 1;
+ gridLayout.marginHeight = 1;
+ reportSetDetailsComposite.setLayout(gridLayout);
+ reportSetDetailsSection.setClient(reportSetDetailsComposite);
+ toolkit.paintBordersFor(reportSetDetailsComposite);
+
+ reportsEditor = new ListEditorComposite<String>(reportSetDetailsComposite, SWT.NONE);
+ reportsEditor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ toolkit.paintBordersFor(reportsEditor);
+ toolkit.adapt(reportsEditor);
+
+ reportsEditor.setContentProvider(new ListEditorContentProvider<String>());
+ reportsEditor.setLabelProvider(new StringLabelProvider(MavenEditorImages.IMG_REPORT));
+
+ reportsEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if(currentReportSet == null) {
+ return;
+ }
+
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = editorPage.getEditingDomain();
+
+ Command addReport = AddCommand.create(editingDomain, currentReportSet, POM_PACKAGE.getReportSet_Reports(), "?");
+ compoundCommand.append(addReport);
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ reportsEditor.refresh();
+ }
+ });
+
+ reportsEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if(currentReportSet == null) {
+ return;
+ }
+
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = editorPage.getEditingDomain();
+
+ List<String> reportList = reportsEditor.getSelection();
+ for(String report : reportList) {
+ Command removeCommand = RemoveCommand.create(editingDomain, currentReportSet, POM_PACKAGE.getReportSet_Reports(),
+ report);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ }
+ });
+
+ reportsEditor.setCellModifier(new ICellModifier() {
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+
+ public Object getValue(Object element, String property) {
+ return element;
+ }
+
+ public void modify(Object element, String property, Object value) {
+ EditingDomain editingDomain = editorPage.getEditingDomain();
+ Command command = SetCommand.create(editingDomain, currentReportSet, POM_PACKAGE
+ .getReportSet_Reports(), value, reportsEditor.getViewer().getTable().getSelectionIndex());
+ editingDomain.getCommandStack().execute(command);
+ }
+ });
+
+ Composite reportSetConfigureComposite = toolkit.createComposite(reportSetDetailsComposite, SWT.NONE);
+ reportSetConfigureComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, false));
+ GridLayout reportSetConfigureCompositeLayout = new GridLayout();
+ reportSetConfigureCompositeLayout.numColumns = 2;
+ reportSetConfigureCompositeLayout.marginWidth = 0;
+ reportSetConfigureCompositeLayout.marginHeight = 0;
+ reportSetConfigureComposite.setLayout(reportSetConfigureCompositeLayout);
+ toolkit.paintBordersFor(reportSetConfigureComposite);
+
+ reportSetInheritedButton = toolkit.createButton(reportSetConfigureComposite, Messages.ReportingComposite_btnInherited, SWT.CHECK);
+ reportSetInheritedButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+
+ reportSetConfigureButton = toolkit.createHyperlink(reportSetConfigureComposite, Messages.ReportingComposite_link_Configuration, SWT.NONE);
+ reportSetConfigureButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
+ reportSetConfigureButton.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ if(currentReportSet != null) {
+ EObject element = currentReportSet.getConfiguration();
+ editorPage.getPomEditor().showInSourceEditor(element == null ? currentReportSet : element);
+ }
+ }
+ });
+
+ // XXX implement editor actions
+ }
+
+ protected void updateReportPluginDetails(ReportPlugin reportPlugin) {
+ currentReportPlugin = reportPlugin;
+
+ if(editorPage != null) {
+ editorPage.removeNotifyListener(groupIdText);
+ editorPage.removeNotifyListener(artifactIdText);
+ editorPage.removeNotifyListener(versionText);
+ editorPage.removeNotifyListener(pluginInheritedButton);
+ }
+
+ if(editorPage == null || reportPlugin == null) {
+ FormUtils.setEnabled(pluginDetailsSection, false);
+ FormUtils.setEnabled(reportSetsSection, false);
+ reportPluginSelectAction.setEnabled(false);
+ openWebPageAction.setEnabled(false);
+
+ setText(groupIdText, ""); //$NON-NLS-1$
+ setText(artifactIdText, ""); //$NON-NLS-1$
+ setText(versionText, ""); //$NON-NLS-1$
+
+ pluginInheritedButton.setSelection(false);
+
+ reportSetsEditor.setInput(null);
+
+ updateReportSetDetails(null);
+
+ return;
+ }
+
+ FormUtils.setEnabled(pluginDetailsSection, true);
+ FormUtils.setEnabled(reportSetsSection, true);
+ FormUtils.setReadonly(pluginDetailsSection, editorPage.isReadOnly());
+ FormUtils.setReadonly(reportSetsSection, editorPage.isReadOnly());
+ reportPluginSelectAction.setEnabled(!editorPage.isReadOnly());
+ openWebPageAction.setEnabled(true);
+
+ setText(groupIdText, reportPlugin.getGroupId());
+ setText(artifactIdText, reportPlugin.getArtifactId());
+ setText(versionText, reportPlugin.getVersion());
+
+ pluginInheritedButton.setSelection(Boolean.parseBoolean(reportPlugin.getInherited()));
+
+ ValueProvider<ReportPlugin> provider = new ValueProvider.DefaultValueProvider<ReportPlugin>(reportPlugin);
+ editorPage.setModifyListener(groupIdText, provider, POM_PACKAGE.getReportPlugin_GroupId(), ""); //$NON-NLS-1$
+ editorPage.setModifyListener(artifactIdText, provider, POM_PACKAGE.getReportPlugin_ArtifactId(), ""); //$NON-NLS-1$
+ editorPage.setModifyListener(versionText, provider, POM_PACKAGE.getReportPlugin_Version(), ""); //$NON-NLS-1$
+ editorPage.setModifyListener(pluginInheritedButton, provider, POM_PACKAGE.getReportPlugin_Inherited(), "false");
+ editorPage.registerListeners();
+
+ reportSetsEditor.setInput(reportPlugin.getReportSets());
+
+ updateReportSetDetails(null);
+ }
+
+ protected void updateReportSetDetails(ReportSet reportSet) {
+ if(editorPage != null) {
+ editorPage.removeNotifyListener(reportSetInheritedButton);
+ }
+
+ currentReportSet = reportSet;
+
+ if(reportSet == null || editorPage == null) {
+ FormUtils.setEnabled(reportSetDetailsSection, false);
+ reportSetInheritedButton.setSelection(false);
+ reportsEditor.setInput(null);
+ return;
+ }
+
+ FormUtils.setEnabled(reportSetDetailsSection, true);
+ FormUtils.setReadonly(reportSetDetailsSection, editorPage.isReadOnly());
+
+ reportSetInheritedButton.setSelection(Boolean.parseBoolean(reportSet.getInherited()));
+ ValueProvider<ReportSet> provider = new ValueProvider.DefaultValueProvider<ReportSet>(reportSet);
+ editorPage.setModifyListener(reportSetInheritedButton, provider, POM_PACKAGE.getReportSet_Inherited(), "false");
+ editorPage.registerListeners();
+
+ reportsEditor.setInput(reportSet.getReports());
+ }
+
+ public void loadData(MavenPomEditorPage editorPage, ValueProvider<Reporting> reportingProvider) {
+ this.editorPage = editorPage;
+ this.reportingProvider = reportingProvider;
+
+// reportPluginAddAction.setEnabled(!parent.getPomEditor().isReadOnly());
+
+ updateContent(reportingProvider.getValue());
+ }
+
+ void updateContent(Reporting reporting) {
+ if(editorPage != null) {
+ editorPage.removeNotifyListener(outputFolderText);
+ editorPage.removeNotifyListener(excludeDefaultsButton);
+ }
+
+ if(reporting == null) {
+ setText(outputFolderText,""); //$NON-NLS-1$
+ setButton(excludeDefaultsButton, false);
+ reportPluginsEditor.setInput(null);
+ } else {
+ setText(outputFolderText,reporting.getOutputDirectory());
+ setButton(excludeDefaultsButton, "true".equals(reporting.getExcludeDefaults()));
+ reportPluginsEditor.setInput(reporting.getPlugins());
+ }
+
+ editorPage.setModifyListener(outputFolderText, reportingProvider, POM_PACKAGE.getReporting_OutputDirectory(), ""); //$NON-NLS-1$
+ editorPage.setModifyListener(excludeDefaultsButton, reportingProvider, POM_PACKAGE.getReporting_ExcludeDefaults(), "false");
+ editorPage.registerListeners();
+
+ updateReportPluginDetails(null);
+ }
+
+ public void updateView(MavenPomEditorPage editorPage, Notification notification) {
+ EObject object = (EObject) notification.getNotifier();
+ Object feature = notification.getFeature();
+
+ if(object instanceof Reporting || feature == PomPackage.Literals.REPORTING__PLUGINS) {
+ reportPluginsEditor.refresh();
+ } else if(object instanceof ReportPlugin) {
+ reportPluginsEditor.refresh();
+
+ Object notificationObject = MavenPomEditorPage.getFromNotification(notification);
+ if(object == currentReportPlugin && (notificationObject == null || notificationObject instanceof ReportPlugin)) {
+ updateReportPluginDetails((ReportPlugin) notificationObject);
+ }
+ } else if(feature == PomPackage.Literals.REPORT_PLUGIN__REPORT_SETS || object instanceof ReportSet) {
+ reportSetsEditor.refresh();
+ } else if(feature == PomPackage.Literals.REPORT_SET__REPORTS) {
+ reportsEditor.refresh();
+ }
+ }
+
+ void createReportingPlugin(String groupId, String artifactId, String version) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = editorPage.getEditingDomain();
+
+ boolean reportsCreated = false;
+
+ Reporting reporting = reportingProvider.getValue();
+ if(reporting == null) {
+ reporting = reportingProvider.create(editingDomain, compoundCommand);
+ reportsCreated = true;
+ }
+
+
+ ReportPlugin reportPlugin = PomFactory.eINSTANCE.createReportPlugin();
+ reportPlugin.setGroupId(groupId);
+ reportPlugin.setArtifactId(artifactId);
+ reportPlugin.setVersion(version);
+
+ Command addReportPlugin = AddCommand.create(editingDomain, reporting,
+ POM_PACKAGE.getReporting_Plugins(), reportPlugin);
+ compoundCommand.append(addReportPlugin);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ if(reportsCreated) {
+ updateContent(reporting);
+ } else {
+ updateReportPluginDetails(reportPlugin);
+ }
+ reportPluginsEditor.setSelection(Collections.singletonList(reportPlugin));
+ groupIdText.setFocus();
+ }
+
+ public void setSearchControl(SearchControl searchControl) {
+ if(this.searchControl!=null) {
+ return;
+ }
+
+ this.searchMatcher = new SearchMatcher(searchControl);
+ this.searchFilter = new PluginFilter(searchMatcher);
+ this.searchControl = searchControl;
+ this.searchControl.getSearchText().addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ selectPlugins(reportPluginsEditor, reportingProvider);
+ updateReportPluginDetails(null);
+ }
+
+ private void selectPlugins(ListEditorComposite<ReportPlugin> editor, ValueProvider<Reporting> provider) {
+ List<ReportPlugin> plugins = new ArrayList<ReportPlugin>();
+ Reporting value = provider.getValue();
+ if(value != null) {
+ for(ReportPlugin p : value.getPlugins()) {
+ if(searchMatcher.isMatchingArtifact(p.getGroupId(), p.getArtifactId())) {
+ plugins.add(p);
+ }
+ }
+ }
+ editor.setSelection(plugins);
+ editor.refresh();
+ }
+ });
+ //we add filter here as the default behaviour is to filter..
+ TableViewer viewer = reportPluginsEditor.getViewer();
+ viewer.addFilter(searchFilter);
+
+ }
+
+ final class ReportPluginsLabelProvider extends LabelProvider {
+
+ private boolean showGroupId = true;
+
+ public void setShowGroupId(boolean showGroupId) {
+ this.showGroupId = showGroupId;
+ }
+
+ public String getText(Object element) {
+ if(element instanceof ReportPlugin) {
+ ReportPlugin reportPlugin = (ReportPlugin) element;
+
+ String groupId = reportPlugin.getGroupId();
+ String artifactId = reportPlugin.getArtifactId();
+ String version = reportPlugin.getVersion();
+
+ String label = ""; //$NON-NLS-1$
+
+ if(showGroupId) {
+ label = (groupId == null ? "?" : groupId) + " : ";
+ }
+
+ label += artifactId == null ? "?" : artifactId;
+
+ if(version != null) {
+ label += " : " + version;
+ }
+
+ return label;
+ }
+ return super.getText(element);
+ }
+
+ public Image getImage(Object element) {
+ return MavenEditorImages.IMG_PLUGIN;
+ }
+
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/RepositoriesComposite.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/RepositoriesComposite.java
new file mode 100644
index 00000000..1e3d12b4
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/RepositoriesComposite.java
@@ -0,0 +1,1287 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.composites;
+
+import static org.eclipse.m2e.editor.pom.FormUtils.isEmpty;
+import static org.eclipse.m2e.editor.pom.FormUtils.setButton;
+import static org.eclipse.m2e.editor.pom.FormUtils.setText;
+import static org.eclipse.m2e.editor.pom.FormUtils.nvl;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.wizards.WidthGroup;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.editor.pom.FormUtils;
+import org.eclipse.m2e.editor.pom.MavenPomEditorPage;
+import org.eclipse.m2e.editor.pom.ValueProvider;
+import org.eclipse.m2e.model.edit.pom.DeploymentRepository;
+import org.eclipse.m2e.model.edit.pom.DistributionManagement;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Relocation;
+import org.eclipse.m2e.model.edit.pom.Repository;
+import org.eclipse.m2e.model.edit.pom.RepositoryPolicy;
+import org.eclipse.m2e.model.edit.pom.Site;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.Section;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class RepositoriesComposite extends Composite {
+
+ static PomPackage POM_PACKAGE = PomPackage.eINSTANCE;
+
+ MavenPomEditorPage parent;
+
+ FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+
+ // controls
+
+ ListEditorComposite<Repository> repositoriesEditor;
+
+ ListEditorComposite<Repository> pluginRepositoriesEditor;
+
+ Section repositoryDetailsSection;
+
+ Section releaseRepositorySection;
+
+ Section snapshotRepositorySection;
+
+ Section projectSiteSection;
+
+ Section relocationSection;
+
+ Text repositoryIdText;
+
+ Text repositoryNameText;
+
+ Text repositoryUrlText;
+
+ CCombo repositoryLayoutCombo;
+
+ Button releasesEnabledButton;
+
+ CCombo releasesUpdatePolicyCombo;
+
+ CCombo releasesChecksumPolicyCombo;
+
+ Label releasesChecksumPolicyLabel;
+
+ Label releasesUpdatePolicyLabel;
+
+ Button snapshotsEnabledButton;
+
+ CCombo snapshotsUpdatePolicyCombo;
+
+ CCombo snapshotsChecksumPolicyCombo;
+
+ Label snapshotsChecksumPolicyLabel;
+
+ Label snapshotsUpdatePolicyLabel;
+
+ Text projectSiteIdText;
+
+ Text projectSiteNameText;
+
+ Text projectSiteUrlText;
+
+ Text projectDownloadUrlText;
+
+ Text relocationGroupIdText;
+
+ Text relocationArtifactIdText;
+
+ Text relocationVersionText;
+
+ Text relocationMessageText;
+
+ Text snapshotRepositoryIdText;
+
+ Text snapshotRepositoryNameText;
+
+ Text snapshotRepositoryUrlText;
+
+ CCombo snapshotRepositoryLayoutCombo;
+
+ Button snapshotRepositoryUniqueVersionButton;
+
+ Text releaseRepositoryIdText;
+
+ Text releaseRepositoryNameText;
+
+ Text releaseRepositoryUrlText;
+
+ CCombo releaseRepositoryLayoutCombo;
+
+ Button releaseRepositoryUniqueVersionButton;
+
+ WidthGroup leftWidthGroup = new WidthGroup();
+
+ WidthGroup rightWidthGroup = new WidthGroup();
+
+ Composite projectSiteComposite;
+
+ Composite releaseDistributionRepositoryComposite;
+
+ Composite relocationComposite;
+
+ Composite snapshotRepositoryComposite;
+
+ boolean changingSelection = false;
+
+ // model
+
+ // Model model;
+ Repository currentRepository;
+
+ Model model;
+
+ ValueProvider<DistributionManagement> distributionManagementProvider;
+
+ public RepositoriesComposite(Composite parent, int flags) {
+ super(parent, flags);
+
+ toolkit.adapt(this);
+
+ GridLayout gridLayout = new GridLayout(1, true);
+ gridLayout.marginWidth = 0;
+ setLayout(gridLayout);
+
+ SashForm horizontalSash = new SashForm(this, SWT.NONE);
+ horizontalSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ SashForm verticalSash = new SashForm(horizontalSash, SWT.VERTICAL);
+ toolkit.adapt(verticalSash, true, true);
+
+ createRepositoriesSection(verticalSash);
+ createPluginRepositoriesSection(verticalSash);
+
+ verticalSash.setWeights(new int[] {1, 1});
+
+ createRepositoryDetailsSection(horizontalSash);
+
+ toolkit.adapt(horizontalSash, true, true);
+ horizontalSash.setWeights(new int[] {1, 1});
+
+ SashForm repositoriesSash = new SashForm(this, SWT.NONE);
+ repositoriesSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ toolkit.adapt(repositoriesSash, true, true);
+
+ createReleaseRepositorySection(repositoriesSash);
+ createSnapshotRepositorySection(repositoriesSash);
+
+ repositoriesSash.setWeights(new int[] {1, 1});
+
+ SashForm projectSiteSash = new SashForm(this, SWT.NONE);
+ projectSiteSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ toolkit.adapt(projectSiteSash, true, true);
+
+ createProjectSiteSection(projectSiteSash);
+ createRelocationSection(projectSiteSash);
+
+ projectSiteSash.setWeights(new int[] {1, 1});
+ }
+
+ public void dispose() {
+ // projectSiteComposite.removeControlListener(leftWidthGroup);
+ // releaseDistributionRepositoryComposite.removeControlListener(leftWidthGroup);
+
+ // snapshotRepositoryComposite.removeControlListener(rightWidthGroup);
+ // relocationComposite.removeControlListener(rightWidthGroup);
+
+ super.dispose();
+ }
+
+ private void createRepositoriesSection(SashForm verticalSash) {
+ Section repositoriesSection = toolkit.createSection(verticalSash, ExpandableComposite.TITLE_BAR | ExpandableComposite.COMPACT);
+ repositoriesSection.setText(Messages.RepositoriesComposite_section_repositories);
+
+ repositoriesEditor = new ListEditorComposite<Repository>(repositoriesSection, SWT.NONE);
+
+ repositoriesEditor.setLabelProvider(new RepositoryLabelProvider());
+ repositoriesEditor.setContentProvider(new ListEditorContentProvider<Repository>());
+
+ repositoriesEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<Repository> selection = repositoriesEditor.getSelection();
+ updateRepositoryDetailsSection(selection.size() == 1 ? selection.get(0) : null);
+
+ if(!selection.isEmpty()) {
+ changingSelection = true;
+ pluginRepositoriesEditor.setSelection(Collections.<Repository> emptyList());
+ changingSelection = false;
+ }
+ }
+ });
+
+ repositoriesEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ Repository repository = PomFactory.eINSTANCE.createRepository();
+ Command addCommand = AddCommand.create(editingDomain, model, POM_PACKAGE.getModel_Repositories(),
+ repository);
+ compoundCommand.append(addCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ repositoriesEditor.setSelection(Collections.singletonList(repository));
+ updateRepositoryDetailsSection(repository);
+ repositoryIdText.setFocus();
+ }
+ });
+
+ repositoriesEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ List<Repository> list = repositoriesEditor.getSelection();
+ for(Repository repository : list) {
+ Command removeCommand = RemoveCommand.create(editingDomain, model, POM_PACKAGE
+ .getModel_Repositories(), repository);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ updateRepositoryDetailsSection(null);
+ }
+ });
+
+ toolkit.paintBordersFor(repositoriesEditor);
+ toolkit.adapt(repositoriesEditor);
+ repositoriesSection.setClient(repositoriesEditor);
+ }
+
+ private void createPluginRepositoriesSection(SashForm verticalSash) {
+ Section pluginRepositoriesSection = toolkit.createSection(verticalSash, ExpandableComposite.TITLE_BAR | ExpandableComposite.COMPACT);
+ pluginRepositoriesSection.setText(Messages.RepositoriesComposite_section_pluginRepositories);
+
+ pluginRepositoriesEditor = new ListEditorComposite<Repository>(pluginRepositoriesSection, SWT.NONE);
+
+ pluginRepositoriesEditor.setLabelProvider(new RepositoryLabelProvider());
+ pluginRepositoriesEditor.setContentProvider(new ListEditorContentProvider<Repository>());
+
+ pluginRepositoriesEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<Repository> selection = pluginRepositoriesEditor.getSelection();
+ updateRepositoryDetailsSection(selection.size() == 1 ? selection.get(0) : null);
+
+ if(!selection.isEmpty()) {
+ changingSelection = true;
+ repositoriesEditor.setSelection(Collections.<Repository> emptyList());
+ changingSelection = false;
+ }
+ }
+ });
+
+ pluginRepositoriesEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ Repository pluginRepository = PomFactory.eINSTANCE.createRepository();
+ Command addCommand = AddCommand.create(editingDomain, model, POM_PACKAGE
+ .getModel_PluginRepositories(), pluginRepository);
+ compoundCommand.append(addCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ pluginRepositoriesEditor.setSelection(Collections.singletonList(pluginRepository));
+ updateRepositoryDetailsSection(pluginRepository);
+ repositoryIdText.setFocus();
+ }
+ });
+
+ pluginRepositoriesEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ List<Repository> list = pluginRepositoriesEditor.getSelection();
+ for(Repository repository : list) {
+ Command removeCommand = RemoveCommand.create(editingDomain, model,
+ POM_PACKAGE.getModel_PluginRepositories(), repository);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ updateRepositoryDetailsSection(null);
+ }
+ });
+
+ toolkit.paintBordersFor(pluginRepositoriesEditor);
+ toolkit.adapt(pluginRepositoriesEditor);
+ pluginRepositoriesSection.setClient(pluginRepositoriesEditor);
+ }
+
+ private void createRepositoryDetailsSection(Composite parent) {
+ repositoryDetailsSection = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR);
+ repositoryDetailsSection.setText(Messages.RepositoriesComposite_section_repositoryDetails);
+
+ Composite repositoryDetailsComposite = toolkit.createComposite(repositoryDetailsSection);
+ repositoryDetailsComposite.setLayout(new GridLayout(2, false));
+ repositoryDetailsSection.setClient(repositoryDetailsComposite);
+ toolkit.paintBordersFor(repositoryDetailsComposite);
+
+ Label idLabel = new Label(repositoryDetailsComposite, SWT.NONE);
+ idLabel.setText(Messages.RepositoriesComposite_lblId);
+
+ repositoryIdText = toolkit.createText(repositoryDetailsComposite, ""); //$NON-NLS-1$
+ GridData gd_repositoryIdText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_repositoryIdText.widthHint = 100;
+ repositoryIdText.setLayoutData(gd_repositoryIdText);
+
+ Label nameLabel = new Label(repositoryDetailsComposite, SWT.NONE);
+ nameLabel.setText(Messages.RepositoriesComposite_lblName);
+
+ repositoryNameText = toolkit.createText(repositoryDetailsComposite, ""); //$NON-NLS-1$
+ repositoryNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Hyperlink repositoryUrlHyperlink = toolkit.createHyperlink(repositoryDetailsComposite, Messages.RepositoriesComposite_lblUrl, SWT.NONE);
+ repositoryUrlHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ FormUtils.openHyperlink(repositoryUrlText.getText());
+ }
+ });
+
+ repositoryUrlText = toolkit.createText(repositoryDetailsComposite, ""); //$NON-NLS-1$
+ GridData gd_repositoryUrlText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_repositoryUrlText.widthHint = 100;
+ repositoryUrlText.setLayoutData(gd_repositoryUrlText);
+
+ Label layoutLabel = new Label(repositoryDetailsComposite, SWT.NONE);
+ layoutLabel.setText(Messages.RepositoriesComposite_lblLayout);
+
+ repositoryLayoutCombo = new CCombo(repositoryDetailsComposite, SWT.FLAT);
+ repositoryLayoutCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ repositoryLayoutCombo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
+ repositoryLayoutCombo.setItems(new String[] {"default", "legacy"});
+
+ Composite composite = new Composite(repositoryDetailsComposite, SWT.NONE);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ toolkit.adapt(composite, true, true);
+ toolkit.paintBordersFor(composite);
+ GridLayout compositeLayout = new GridLayout();
+ compositeLayout.marginBottom = 2;
+ compositeLayout.marginWidth = 2;
+ compositeLayout.marginHeight = 0;
+ compositeLayout.numColumns = 2;
+ composite.setLayout(compositeLayout);
+
+ releasesEnabledButton = toolkit.createButton(composite, Messages.RepositoriesComposite_btnEnableRelease, SWT.CHECK | SWT.FLAT);
+ GridData releasesEnabledButtonData = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+ releasesEnabledButtonData.verticalIndent = 5;
+ releasesEnabledButton.setLayoutData(releasesEnabledButtonData);
+ releasesEnabledButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ boolean isEnabled = releasesEnabledButton.getSelection();
+ releasesUpdatePolicyLabel.setEnabled(isEnabled);
+ releasesUpdatePolicyCombo.setEnabled(isEnabled);
+ releasesChecksumPolicyLabel.setEnabled(isEnabled);
+ releasesChecksumPolicyCombo.setEnabled(isEnabled);
+ }
+ });
+
+ releasesUpdatePolicyLabel = new Label(composite, SWT.NONE);
+ releasesUpdatePolicyLabel.setText(Messages.RepositoriesComposite_lblUpdatePolicy);
+ GridData releasesUpdatePolicyLabelData = new GridData();
+ releasesUpdatePolicyLabelData.horizontalIndent = 15;
+ releasesUpdatePolicyLabel.setLayoutData(releasesUpdatePolicyLabelData);
+
+ releasesUpdatePolicyCombo = new CCombo(composite, SWT.FLAT);
+ releasesUpdatePolicyCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ releasesUpdatePolicyCombo.setItems(new String[] {"daily", "always", "interval:30", "never"});
+ releasesUpdatePolicyCombo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
+ toolkit.adapt(releasesUpdatePolicyCombo, true, true);
+
+ releasesChecksumPolicyLabel = new Label(composite, SWT.NONE);
+ releasesChecksumPolicyLabel.setText(Messages.RepositoriesComposite_lblChecksumPolicy);
+ GridData releasesChecksumPolicyLabelData = new GridData();
+ releasesChecksumPolicyLabelData.horizontalIndent = 15;
+ releasesChecksumPolicyLabel.setLayoutData(releasesChecksumPolicyLabelData);
+
+ releasesChecksumPolicyCombo = new CCombo(composite, SWT.READ_ONLY | SWT.FLAT);
+ toolkit.adapt(releasesChecksumPolicyCombo, true, true);
+ releasesChecksumPolicyCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ releasesChecksumPolicyCombo.setItems(new String[] {"ignore", "fail", "warn"});
+ releasesChecksumPolicyCombo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
+
+ snapshotsEnabledButton = toolkit.createButton(composite, Messages.RepositoriesComposite_btnEnableSnapshots, SWT.CHECK | SWT.FLAT);
+ GridData snapshotsEnabledButtonData = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+ snapshotsEnabledButtonData.verticalIndent = 5;
+ snapshotsEnabledButton.setLayoutData(snapshotsEnabledButtonData);
+ snapshotsEnabledButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ boolean isEnabled = releasesEnabledButton.getSelection();
+ snapshotsUpdatePolicyLabel.setEnabled(isEnabled);
+ snapshotsUpdatePolicyCombo.setEnabled(isEnabled);
+ snapshotsChecksumPolicyLabel.setEnabled(isEnabled);
+ snapshotsChecksumPolicyCombo.setEnabled(isEnabled);
+ }
+ });
+
+ snapshotsUpdatePolicyLabel = new Label(composite, SWT.NONE);
+ snapshotsUpdatePolicyLabel.setText(Messages.RepositoriesComposite_lblUpdatePolicy);
+ GridData snapshotsUpdatePolicyLabelData = new GridData();
+ snapshotsUpdatePolicyLabelData.horizontalIndent = 15;
+ snapshotsUpdatePolicyLabel.setLayoutData(snapshotsUpdatePolicyLabelData);
+
+ snapshotsUpdatePolicyCombo = new CCombo(composite, SWT.FLAT);
+ snapshotsUpdatePolicyCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ snapshotsUpdatePolicyCombo.setItems(new String[] {"daily", "always", "interval:30", "never"});
+ snapshotsUpdatePolicyCombo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
+ toolkit.adapt(snapshotsUpdatePolicyCombo, true, true);
+ toolkit.paintBordersFor(snapshotsUpdatePolicyCombo);
+
+ snapshotsChecksumPolicyLabel = new Label(composite, SWT.NONE);
+ snapshotsChecksumPolicyLabel.setText(Messages.RepositoriesComposite_lblChecksumPolicy);
+ GridData checksumPolicyLabelData = new GridData();
+ checksumPolicyLabelData.horizontalIndent = 15;
+ snapshotsChecksumPolicyLabel.setLayoutData(checksumPolicyLabelData);
+ toolkit.adapt(snapshotsChecksumPolicyLabel, true, true);
+
+ snapshotsChecksumPolicyCombo = new CCombo(composite, SWT.READ_ONLY | SWT.FLAT);
+ snapshotsChecksumPolicyCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ snapshotsChecksumPolicyCombo.setItems(new String[] {"ignore", "fail", "warn"});
+ snapshotsChecksumPolicyCombo.setLayoutData(new GridData());
+ toolkit.adapt(snapshotsChecksumPolicyCombo, true, true);
+ toolkit.paintBordersFor(snapshotsChecksumPolicyCombo);
+ repositoryDetailsComposite.setTabList(new Control[] {repositoryIdText, repositoryNameText, repositoryUrlText, repositoryLayoutCombo, composite});
+
+ updateRepositoryDetailsSection(null);
+ }
+
+ private void createRelocationSection(SashForm sashForm) {
+ relocationSection = toolkit.createSection(sashForm, ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ relocationSection.setText(Messages.RepositoriesComposite_sectionRelocation);
+
+ relocationComposite = toolkit.createComposite(relocationSection, SWT.NONE);
+ relocationComposite.setLayout(new GridLayout(2, false));
+ toolkit.paintBordersFor(relocationComposite);
+ relocationSection.setClient(relocationComposite);
+ relocationComposite.addControlListener(rightWidthGroup);
+
+ Label relocationGroupIdLabel = toolkit.createLabel(relocationComposite, Messages.RepositoriesComposite_lblGroupId, SWT.NONE);
+ rightWidthGroup.addControl(relocationGroupIdLabel);
+
+ relocationGroupIdText = toolkit.createText(relocationComposite, null, SWT.NONE);
+ GridData gd_relocationGroupIdText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_relocationGroupIdText.widthHint = 100;
+ relocationGroupIdText.setLayoutData(gd_relocationGroupIdText);
+
+ Hyperlink relocationArtifactIdHyperlink = toolkit.createHyperlink(relocationComposite, Messages.RepositoriesComposite_lblArtifactid, SWT.NONE);
+ relocationArtifactIdHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ final String groupId = relocationGroupIdText.getText();
+ final String artifactId = relocationArtifactIdText.getText();
+ final String version = relocationVersionText.getText();
+ new Job("Opening " + groupId + ":" + artifactId + ":" + version) {
+ protected IStatus run(IProgressMonitor arg0) {
+ OpenPomAction.openEditor(groupId, artifactId, version, null);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ });
+
+ rightWidthGroup.addControl(relocationArtifactIdHyperlink);
+
+ relocationArtifactIdText = toolkit.createText(relocationComposite, null, SWT.NONE);
+ GridData gd_relocationArtifactIdText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_relocationArtifactIdText.widthHint = 100;
+ relocationArtifactIdText.setLayoutData(gd_relocationArtifactIdText);
+
+ Label relocationVersionLabel = toolkit.createLabel(relocationComposite, Messages.RepositoriesComposite_lblVersion, SWT.NONE);
+ rightWidthGroup.addControl(relocationVersionLabel);
+
+ relocationVersionText = toolkit.createText(relocationComposite, null, SWT.NONE);
+ GridData gd_relocationVersionText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_relocationVersionText.widthHint = 100;
+ relocationVersionText.setLayoutData(gd_relocationVersionText);
+
+ Label relocationMessageLabel = toolkit.createLabel(relocationComposite, Messages.RepositoriesComposite_lblMessage, SWT.NONE);
+ rightWidthGroup.addControl(relocationMessageLabel);
+
+ relocationMessageText = toolkit.createText(relocationComposite, null, SWT.NONE);
+ GridData gd_relocationMessageText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_relocationMessageText.widthHint = 100;
+ relocationMessageText.setLayoutData(gd_relocationMessageText);
+ relocationComposite.setTabList(new Control[] {relocationGroupIdText, relocationArtifactIdText, relocationVersionText, relocationMessageText});
+ }
+
+ private void createProjectSiteSection(SashForm sashForm) {
+ projectSiteSection = toolkit.createSection(sashForm, ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ projectSiteSection.setText(Messages.RepositoriesComposite_section_projectSite);
+
+ projectSiteComposite = toolkit.createComposite(projectSiteSection, SWT.NONE);
+ projectSiteComposite.setLayout(new GridLayout(2, false));
+ toolkit.paintBordersFor(projectSiteComposite);
+ projectSiteSection.setClient(projectSiteComposite);
+ projectSiteComposite.addControlListener(leftWidthGroup);
+
+ Label siteIdLabel = toolkit.createLabel(projectSiteComposite, Messages.RepositoriesComposite_lblSiteId, SWT.NONE);
+ leftWidthGroup.addControl(siteIdLabel);
+
+ projectSiteIdText = toolkit.createText(projectSiteComposite, null, SWT.NONE);
+ GridData gd_projectSiteIdText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_projectSiteIdText.widthHint = 100;
+ projectSiteIdText.setLayoutData(gd_projectSiteIdText);
+
+ Label siteNameLabel = toolkit.createLabel(projectSiteComposite, Messages.RepositoriesComposite_lblName, SWT.NONE);
+ leftWidthGroup.addControl(siteNameLabel);
+
+ projectSiteNameText = toolkit.createText(projectSiteComposite, null, SWT.NONE);
+ GridData gd_projectSiteNameText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_projectSiteNameText.widthHint = 100;
+ projectSiteNameText.setLayoutData(gd_projectSiteNameText);
+
+ Hyperlink projectSiteUrlHyperlink = toolkit.createHyperlink(projectSiteComposite, Messages.RepositoriesComposite_lblUrl2, SWT.NONE);
+ projectSiteUrlHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ FormUtils.openHyperlink(projectSiteUrlText.getText());
+ }
+ });
+ leftWidthGroup.addControl(projectSiteUrlHyperlink);
+
+ projectSiteUrlText = toolkit.createText(projectSiteComposite, null, SWT.NONE);
+ GridData gd_projectSiteUrlText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_projectSiteUrlText.widthHint = 100;
+ projectSiteUrlText.setLayoutData(gd_projectSiteUrlText);
+ sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ toolkit.adapt(sashForm, true, true);
+
+ Hyperlink projectDownloadUrlHyperlink = toolkit.createHyperlink(projectSiteComposite, Messages.RepositoriesComposite_lblDownload, SWT.NONE);
+ projectDownloadUrlHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ FormUtils.openHyperlink(projectDownloadUrlText.getText());
+ }
+ });
+ leftWidthGroup.addControl(projectDownloadUrlHyperlink);
+
+ projectDownloadUrlText = toolkit.createText(projectSiteComposite, null, SWT.NONE);
+ GridData gd_projectDownloadUrlText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_projectDownloadUrlText.widthHint = 100;
+ projectDownloadUrlText.setLayoutData(gd_projectDownloadUrlText);
+ projectSiteComposite.setTabList(new Control[] {projectSiteIdText, projectSiteNameText, projectSiteUrlText, projectDownloadUrlText});
+ }
+
+ private void createSnapshotRepositorySection(SashForm distributionManagementSash) {
+ snapshotRepositorySection = toolkit.createSection(distributionManagementSash, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ snapshotRepositorySection.setText(Messages.RepositoriesComposite_section_snapshotDistRepo);
+
+ snapshotRepositoryComposite = toolkit.createComposite(snapshotRepositorySection, SWT.NONE);
+ snapshotRepositoryComposite.setLayout(new GridLayout(2, false));
+ toolkit.paintBordersFor(snapshotRepositoryComposite);
+ snapshotRepositorySection.setClient(snapshotRepositoryComposite);
+ snapshotRepositoryComposite.addControlListener(rightWidthGroup);
+
+ Label snapshotRepositoryIdLabel = toolkit.createLabel(snapshotRepositoryComposite, Messages.RepositoriesComposite_lblRepoId, SWT.NONE);
+ rightWidthGroup.addControl(snapshotRepositoryIdLabel);
+
+ snapshotRepositoryIdText = toolkit.createText(snapshotRepositoryComposite, null, SWT.NONE);
+ GridData gd_snapshotRepositoryIdText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_snapshotRepositoryIdText.widthHint = 100;
+ snapshotRepositoryIdText.setLayoutData(gd_snapshotRepositoryIdText);
+
+ Label snapshotRepositoryNameLabel = toolkit.createLabel(snapshotRepositoryComposite, Messages.RepositoriesComposite_lblName, SWT.NONE);
+ rightWidthGroup.addControl(snapshotRepositoryNameLabel);
+
+ snapshotRepositoryNameText = toolkit.createText(snapshotRepositoryComposite, null, SWT.NONE);
+ GridData gd_snapshotRepositoryNameText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_snapshotRepositoryNameText.widthHint = 100;
+ snapshotRepositoryNameText.setLayoutData(gd_snapshotRepositoryNameText);
+
+ Hyperlink snapshotRepositoryUrlHyperlink = toolkit.createHyperlink(snapshotRepositoryComposite, Messages.RepositoriesComposite_lblUrl2, SWT.NONE);
+ snapshotRepositoryUrlHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ FormUtils.openHyperlink(snapshotRepositoryUrlText.getText());
+ }
+ });
+ rightWidthGroup.addControl(snapshotRepositoryUrlHyperlink);
+
+ snapshotRepositoryUrlText = toolkit.createText(snapshotRepositoryComposite, null, SWT.NONE);
+ GridData gd_snapshotRepositoryUrlText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_snapshotRepositoryUrlText.widthHint = 100;
+ snapshotRepositoryUrlText.setLayoutData(gd_snapshotRepositoryUrlText);
+
+ Label snapshotRepositoryLayoutLabel = toolkit.createLabel(snapshotRepositoryComposite, Messages.RepositoriesComposite_lblLayout, SWT.NONE);
+ snapshotRepositoryLayoutLabel.setLayoutData(new GridData());
+ rightWidthGroup.addControl(snapshotRepositoryLayoutLabel);
+
+ snapshotRepositoryLayoutCombo = new CCombo(snapshotRepositoryComposite, SWT.FLAT);
+ snapshotRepositoryLayoutCombo.setItems(new String[] {"default", "legacy"});
+ snapshotRepositoryLayoutCombo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
+ snapshotRepositoryLayoutCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ toolkit.adapt(snapshotRepositoryLayoutCombo, true, true);
+ new Label(snapshotRepositoryComposite, SWT.NONE);
+
+ snapshotRepositoryUniqueVersionButton = toolkit.createButton(snapshotRepositoryComposite, //
+ Messages.RepositoriesComposite_btnUniqueVersion, SWT.CHECK);
+ snapshotRepositoryUniqueVersionButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ snapshotRepositoryComposite.setTabList(new Control[] {snapshotRepositoryIdText, snapshotRepositoryNameText, snapshotRepositoryUrlText, snapshotRepositoryLayoutCombo, snapshotRepositoryUniqueVersionButton});
+ }
+
+ private void createReleaseRepositorySection(SashForm distributionManagementSash) {
+ releaseRepositorySection = toolkit.createSection(distributionManagementSash, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ releaseRepositorySection.setText(Messages.RepositoriesComposite_section_releaseDistRepo);
+
+ releaseDistributionRepositoryComposite = toolkit.createComposite(releaseRepositorySection, SWT.NONE);
+ releaseDistributionRepositoryComposite.setLayout(new GridLayout(2, false));
+ toolkit.paintBordersFor(releaseDistributionRepositoryComposite);
+ releaseRepositorySection.setClient(releaseDistributionRepositoryComposite);
+ releaseDistributionRepositoryComposite.addControlListener(leftWidthGroup);
+
+ Label releaseRepositoryIdLabel = toolkit.createLabel(releaseDistributionRepositoryComposite, Messages.RepositoriesComposite_lblRepoId, SWT.NONE);
+ leftWidthGroup.addControl(releaseRepositoryIdLabel);
+
+ releaseRepositoryIdText = toolkit.createText(releaseDistributionRepositoryComposite, null, SWT.NONE);
+ GridData gd_releaseRepositoryIdText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_releaseRepositoryIdText.widthHint = 100;
+ releaseRepositoryIdText.setLayoutData(gd_releaseRepositoryIdText);
+
+ Label releaseRepositoryNameLabel = toolkit.createLabel(releaseDistributionRepositoryComposite, Messages.RepositoriesComposite_lblName, SWT.NONE);
+ leftWidthGroup.addControl(releaseRepositoryNameLabel);
+
+ releaseRepositoryNameText = toolkit.createText(releaseDistributionRepositoryComposite, null, SWT.NONE);
+ GridData gd_releaseRepositoryNameText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_releaseRepositoryNameText.widthHint = 100;
+ releaseRepositoryNameText.setLayoutData(gd_releaseRepositoryNameText);
+
+ Hyperlink releaseRepositoryUrlHyperlink = toolkit.createHyperlink(releaseDistributionRepositoryComposite, Messages.RepositoriesComposite_lblUrl2,
+ SWT.NONE);
+ releaseRepositoryUrlHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ FormUtils.openHyperlink(releaseRepositoryUrlText.getText());
+ }
+ });
+ leftWidthGroup.addControl(releaseRepositoryUrlHyperlink);
+
+ releaseRepositoryUrlText = toolkit.createText(releaseDistributionRepositoryComposite, null, SWT.NONE);
+ GridData gd_releaseRepositoryUrlText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_releaseRepositoryUrlText.widthHint = 100;
+ releaseRepositoryUrlText.setLayoutData(gd_releaseRepositoryUrlText);
+
+ Label releaseRepositoryLayoutLabel = toolkit.createLabel(releaseDistributionRepositoryComposite, Messages.RepositoriesComposite_lblLayout,
+ SWT.NONE);
+ releaseRepositoryLayoutLabel.setLayoutData(new GridData());
+ leftWidthGroup.addControl(releaseRepositoryLayoutLabel);
+
+ releaseRepositoryLayoutCombo = new CCombo(releaseDistributionRepositoryComposite, SWT.FLAT);
+ releaseRepositoryLayoutCombo.setItems(new String[] {"default", "legacy"});
+ releaseRepositoryLayoutCombo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
+ releaseRepositoryLayoutCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ toolkit.adapt(releaseRepositoryLayoutCombo, true, true);
+ new Label(releaseDistributionRepositoryComposite, SWT.NONE);
+
+ releaseRepositoryUniqueVersionButton = toolkit.createButton(releaseDistributionRepositoryComposite,
+ Messages.RepositoriesComposite_btnUniqueVersion, SWT.CHECK);
+ releaseRepositoryUniqueVersionButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ releaseDistributionRepositoryComposite.setTabList(new Control[] {releaseRepositoryIdText, releaseRepositoryNameText, releaseRepositoryUrlText, releaseRepositoryLayoutCombo, releaseRepositoryUniqueVersionButton});
+ }
+
+ public void loadData(MavenPomEditorPage editorPage, Model model,
+ ValueProvider<DistributionManagement> distributionManagementProvider) {
+ this.parent = editorPage;
+ this.model = model;
+ this.distributionManagementProvider = distributionManagementProvider;
+
+ loadRepositories();
+ loadPluginRepositories();
+
+ loadReleaseDistributionRepository();
+ loadSnapshotDistributionRepository();
+ loadProjectSite();
+ loadRelocation();
+
+ registerReleaseRepositoryListeners();
+ registerSnapshotRepositoryListeners();
+ registerProjectListeners();
+ registerRelocationListeners();
+
+ repositoriesEditor.setReadOnly(parent.isReadOnly());
+ pluginRepositoriesEditor.setReadOnly(parent.isReadOnly());
+
+ expandSections();
+ }
+
+ private void expandSections() {
+ DistributionManagement dm = distributionManagementProvider.getValue();
+ if(dm != null) {
+ boolean isRepositoriesExpanded = false;
+
+ if(dm.getRepository() != null) {
+ DeploymentRepository r = dm.getRepository();
+ isRepositoriesExpanded |= !isEmpty(r.getId()) || !isEmpty(r.getName()) || !isEmpty(r.getUrl())
+ || !isEmpty(r.getLayout()) || !isEmpty(r.getUniqueVersion());
+ }
+
+ if(dm.getSnapshotRepository() != null) {
+ DeploymentRepository r = dm.getSnapshotRepository();
+ isRepositoriesExpanded |= !isEmpty(r.getId()) || !isEmpty(r.getName()) || !isEmpty(r.getUrl())
+ || !isEmpty(r.getLayout()) || !isEmpty(r.getUniqueVersion());
+ }
+
+ releaseRepositorySection.setExpanded(isRepositoriesExpanded);
+ snapshotRepositorySection.setExpanded(isRepositoriesExpanded);
+
+ boolean isSiteExpanded = false;
+
+ Site s = dm.getSite();
+ if(s != null) {
+ isSiteExpanded |= !isEmpty(s.getId()) || !isEmpty(s.getName()) || !isEmpty(s.getUrl())
+ || !isEmpty(dm.getDownloadUrl());
+ } else {
+ isSiteExpanded |= !isEmpty(dm.getDownloadUrl());
+ }
+
+ if(dm.getRelocation() != null) {
+ Relocation r = dm.getRelocation();
+ isSiteExpanded |= !isEmpty(r.getGroupId()) || !isEmpty(r.getArtifactId()) || !isEmpty(r.getVersion())
+ || !isEmpty(r.getMessage());
+ }
+
+ projectSiteSection.setExpanded(isSiteExpanded);
+ relocationSection.setExpanded(isSiteExpanded);
+
+ } else {
+ releaseRepositorySection.setExpanded(false);
+ snapshotRepositorySection.setExpanded(false);
+ projectSiteSection.setExpanded(false);
+ relocationSection.setExpanded(false);
+ }
+
+ relocationSection.addExpansionListener(new ExpansionAdapter() {
+ boolean isExpanding = false;
+
+ public void expansionStateChanged(ExpansionEvent e) {
+ if(!isExpanding) {
+ isExpanding = true;
+ projectSiteSection.setExpanded(relocationSection.isExpanded());
+ isExpanding = false;
+ }
+ }
+ });
+ projectSiteSection.addExpansionListener(new ExpansionAdapter() {
+ boolean isExpanding = false;
+
+ public void expansionStateChanged(ExpansionEvent e) {
+ if(!isExpanding) {
+ isExpanding = true;
+ relocationSection.setExpanded(projectSiteSection.isExpanded());
+ isExpanding = false;
+ }
+ }
+ });
+
+ releaseRepositorySection.addExpansionListener(new ExpansionAdapter() {
+ boolean isExpanding = false;
+
+ public void expansionStateChanged(ExpansionEvent e) {
+ if(!isExpanding) {
+ isExpanding = true;
+ snapshotRepositorySection.setExpanded(releaseRepositorySection.isExpanded());
+ isExpanding = false;
+ }
+ }
+ });
+ snapshotRepositorySection.addExpansionListener(new ExpansionAdapter() {
+ boolean isExpanding = false;
+
+ public void expansionStateChanged(ExpansionEvent e) {
+ if(!isExpanding) {
+ isExpanding = true;
+ releaseRepositorySection.setExpanded(snapshotRepositorySection.isExpanded());
+ isExpanding = false;
+ }
+ }
+ });
+ }
+
+ private void registerReleaseRepositoryListeners() {
+ ValueProvider<DeploymentRepository> repositoryProvider = new ValueProvider.ParentValueProvider<DeploymentRepository>(
+ releaseRepositoryIdText, releaseRepositoryNameText, releaseRepositoryUrlText) {
+ public DeploymentRepository getValue() {
+ DistributionManagement dm = distributionManagementProvider.getValue();
+ return dm == null ? null : dm.getRepository();
+ }
+
+ public DeploymentRepository create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ DistributionManagement dm = createDistributionManagement(editingDomain, compoundCommand);
+ DeploymentRepository r = dm.getRepository();
+ if(r == null) {
+ r = PomFactory.eINSTANCE.createDeploymentRepository();
+ Command command = SetCommand.create(editingDomain, dm, POM_PACKAGE.getDistributionManagement_Repository(), r);
+ compoundCommand.append(command);
+ }
+ return r;
+ }
+ };
+ parent.setModifyListener(releaseRepositoryIdText, repositoryProvider, POM_PACKAGE.getDeploymentRepository_Id(), ""); //$NON-NLS-1$
+ parent.setModifyListener(releaseRepositoryNameText, repositoryProvider, POM_PACKAGE.getDeploymentRepository_Name(),
+ ""); //$NON-NLS-1$
+ parent.setModifyListener(releaseRepositoryUrlText, repositoryProvider, POM_PACKAGE.getDeploymentRepository_Url(),
+ ""); //$NON-NLS-1$
+ parent.setModifyListener(releaseRepositoryLayoutCombo, repositoryProvider, POM_PACKAGE
+ .getDeploymentRepository_Layout(), "default");
+ parent.setModifyListener(releaseRepositoryUniqueVersionButton, repositoryProvider, POM_PACKAGE
+ .getDeploymentRepository_UniqueVersion(), "true");
+ }
+
+ private void registerSnapshotRepositoryListeners() {
+ ValueProvider<DeploymentRepository> repositoryProvider = new ValueProvider.ParentValueProvider<DeploymentRepository>(
+ snapshotRepositoryIdText, snapshotRepositoryNameText, snapshotRepositoryUrlText) {
+ public DeploymentRepository getValue() {
+ DistributionManagement dm = distributionManagementProvider.getValue();
+ return dm == null ? null : dm.getSnapshotRepository();
+ }
+
+ public DeploymentRepository create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ DistributionManagement dm = createDistributionManagement(editingDomain, compoundCommand);
+ DeploymentRepository r = dm.getSnapshotRepository();
+ if(r == null) {
+ r = PomFactory.eINSTANCE.createDeploymentRepository();
+ Command command = SetCommand.create(editingDomain, dm, POM_PACKAGE
+ .getDistributionManagement_SnapshotRepository(), r);
+ compoundCommand.append(command);
+ }
+ return r;
+ }
+ };
+ parent
+ .setModifyListener(snapshotRepositoryIdText, repositoryProvider, POM_PACKAGE.getDeploymentRepository_Id(), ""); //$NON-NLS-1$
+ parent.setModifyListener(snapshotRepositoryNameText, repositoryProvider,
+ POM_PACKAGE.getDeploymentRepository_Name(), ""); //$NON-NLS-1$
+ parent.setModifyListener(snapshotRepositoryUrlText, repositoryProvider, POM_PACKAGE.getDeploymentRepository_Url(),
+ ""); //$NON-NLS-1$
+ parent.setModifyListener(snapshotRepositoryLayoutCombo, repositoryProvider, POM_PACKAGE
+ .getDeploymentRepository_Layout(), "default");
+ parent.setModifyListener(snapshotRepositoryUniqueVersionButton, repositoryProvider, POM_PACKAGE
+ .getDeploymentRepository_UniqueVersion(), "true");
+ }
+
+ private void registerProjectListeners() {
+ //do not use ParentValueProvider here as it renders the other providers useless (siteProvider etc)
+ ValueProvider<DistributionManagement> dmProvider = new ValueProvider.DefaultValueProvider<DistributionManagement>(distributionManagementProvider.getValue())
+ {
+ public DistributionManagement getValue() {
+ return distributionManagementProvider.getValue();
+ }
+
+ public DistributionManagement create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ return createDistributionManagement(editingDomain, compoundCommand);
+ }
+ };
+ parent.setModifyListener(projectDownloadUrlText, dmProvider, POM_PACKAGE.getDistributionManagement_DownloadUrl(),
+ ""); //$NON-NLS-1$
+
+ ValueProvider<Site> siteProvider = new ValueProvider.ParentValueProvider<Site>(projectSiteIdText,
+ projectSiteNameText, projectSiteUrlText) {
+ public Site getValue() {
+ DistributionManagement dm = distributionManagementProvider.getValue();
+ return dm == null ? null : dm.getSite();
+ }
+
+ public Site create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ DistributionManagement dm = createDistributionManagement(editingDomain, compoundCommand);
+ Site s = dm.getSite();
+ if(s == null) {
+ s = PomFactory.eINSTANCE.createSite();
+ Command command = SetCommand.create(editingDomain, dm, POM_PACKAGE.getDistributionManagement_Site(), s);
+ compoundCommand.append(command);
+ }
+ return s;
+ }
+ };
+ parent.setModifyListener(projectSiteIdText, siteProvider, POM_PACKAGE.getSite_Id(), ""); //$NON-NLS-1$
+ parent.setModifyListener(projectSiteNameText, siteProvider, POM_PACKAGE.getSite_Name(), ""); //$NON-NLS-1$
+ parent.setModifyListener(projectSiteUrlText, siteProvider, POM_PACKAGE.getSite_Url(), ""); //$NON-NLS-1$
+ }
+
+ private void registerRelocationListeners() {
+ ValueProvider<Relocation> relocationProvider = new ValueProvider.ParentValueProvider<Relocation>(
+ relocationGroupIdText, relocationArtifactIdText, relocationVersionText, relocationMessageText) {
+ public Relocation getValue() {
+ DistributionManagement dm = distributionManagementProvider.getValue();
+ return dm == null ? null : dm.getRelocation();
+ }
+
+ public Relocation create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ DistributionManagement dm = createDistributionManagement(editingDomain, compoundCommand);
+ Relocation r = dm.getRelocation();
+ if(r == null) {
+ r = PomFactory.eINSTANCE.createRelocation();
+ Command command = SetCommand.create(editingDomain, dm, POM_PACKAGE.getDistributionManagement_Relocation(), r);
+ compoundCommand.append(command);
+ }
+ return r;
+ }
+ };
+ parent.setModifyListener(relocationGroupIdText, relocationProvider, POM_PACKAGE.getRelocation_GroupId(), ""); //$NON-NLS-1$
+ parent.setModifyListener(relocationArtifactIdText, relocationProvider, POM_PACKAGE.getRelocation_ArtifactId(), ""); //$NON-NLS-1$
+ parent.setModifyListener(relocationVersionText, relocationProvider, POM_PACKAGE.getRelocation_Version(), ""); //$NON-NLS-1$
+ parent.setModifyListener(relocationMessageText, relocationProvider, POM_PACKAGE.getRelocation_Message(), ""); //$NON-NLS-1$
+ }
+
+ private void loadReleaseDistributionRepository() {
+ DistributionManagement dm = distributionManagementProvider.getValue();
+ DeploymentRepository repository = dm == null ? null : dm.getRepository();
+ if(repository != null) {
+ setText(releaseRepositoryIdText, repository.getId());
+ setText(releaseRepositoryNameText, repository.getName());
+ setText(releaseRepositoryUrlText, repository.getUrl());
+ setText(releaseRepositoryLayoutCombo, "".equals(nvl(repository.getLayout())) ? "default" : nvl(repository.getLayout())); //$NON-NLS-1$ //$NON-NLS-2$
+ setButton(releaseRepositoryUniqueVersionButton, "true".equals(repository.getUniqueVersion()));
+ } else {
+ setText(releaseRepositoryIdText, ""); //$NON-NLS-1$
+ setText(releaseRepositoryNameText, ""); //$NON-NLS-1$
+ setText(releaseRepositoryUrlText, ""); //$NON-NLS-1$
+ setText(releaseRepositoryLayoutCombo, ""); //$NON-NLS-1$
+ setButton(releaseRepositoryUniqueVersionButton, true); // default
+ }
+ }
+
+ private void loadSnapshotDistributionRepository() {
+ DistributionManagement dm = distributionManagementProvider.getValue();
+ DeploymentRepository repository = dm == null ? null : dm.getSnapshotRepository();
+ if(repository != null) {
+ setText(snapshotRepositoryIdText, repository.getId());
+ setText(snapshotRepositoryNameText, repository.getName());
+ setText(snapshotRepositoryUrlText, repository.getUrl());
+ setText(snapshotRepositoryLayoutCombo, "".equals(nvl(repository.getLayout())) ? "default" : nvl(repository.getLayout())); //$NON-NLS-1$ //$NON-NLS-2$
+ setButton(snapshotRepositoryUniqueVersionButton, "true".equals(repository.getUniqueVersion()));
+ } else {
+ setText(snapshotRepositoryIdText, ""); //$NON-NLS-1$
+ setText(snapshotRepositoryNameText, ""); //$NON-NLS-1$
+ setText(snapshotRepositoryUrlText, ""); //$NON-NLS-1$
+ setText(snapshotRepositoryLayoutCombo, ""); //$NON-NLS-1$
+ setButton(snapshotRepositoryUniqueVersionButton, true); // default
+ }
+ }
+
+ private void loadProjectSite() {
+ DistributionManagement dm = distributionManagementProvider.getValue();
+ Site site = dm == null ? null : dm.getSite();
+ if(site != null) {
+ setText(projectSiteIdText, site.getId());
+ setText(projectSiteNameText, site.getName());
+ setText(projectSiteUrlText, site.getUrl());
+ } else {
+ setText(projectSiteIdText, ""); //$NON-NLS-1$
+ setText(projectSiteNameText, ""); //$NON-NLS-1$
+ setText(projectSiteUrlText, ""); //$NON-NLS-1$
+ }
+
+ setText(projectDownloadUrlText, dm == null ? null : dm.getDownloadUrl());
+ }
+
+ private void loadRelocation() {
+ DistributionManagement dm = distributionManagementProvider.getValue();
+ Relocation relocation = dm == null ? null : dm.getRelocation();
+ if(relocation != null) {
+ setText(relocationGroupIdText, relocation.getGroupId());
+ setText(relocationArtifactIdText, relocation.getArtifactId());
+ setText(relocationVersionText, relocation.getVersion());
+ setText(relocationMessageText, relocation.getMessage());
+ } else {
+ setText(relocationGroupIdText, ""); //$NON-NLS-1$
+ setText(relocationArtifactIdText, ""); //$NON-NLS-1$
+ setText(relocationVersionText, ""); //$NON-NLS-1$
+ setText(relocationMessageText, ""); //$NON-NLS-1$
+ }
+ }
+
+ private void loadRepositories() {
+ repositoriesEditor.setInput(model.getRepositories());
+ repositoriesEditor.setReadOnly(parent.isReadOnly());
+ changingSelection = true;
+ updateRepositoryDetailsSection(null);
+ changingSelection = false;
+ }
+
+ private void loadPluginRepositories() {
+ pluginRepositoriesEditor.setInput(model.getPluginRepositories());
+ pluginRepositoriesEditor.setReadOnly(parent.isReadOnly());
+ changingSelection = true;
+ updateRepositoryDetailsSection(null);
+ changingSelection = false;
+ }
+
+ public void updateView(MavenPomEditorPage editorPage, Notification notification) {
+ EObject object = (EObject) notification.getNotifier();
+ Object feature = notification.getFeature();
+ if(PomPackage.Literals.MODEL__REPOSITORIES == feature) {
+ repositoriesEditor.refresh();
+ }
+
+ if(PomPackage.Literals.MODEL__PLUGIN_REPOSITORIES == feature) {
+ pluginRepositoriesEditor.refresh();
+ }
+
+ if(object instanceof Repository) {
+ repositoriesEditor.refresh();
+ pluginRepositoriesEditor.refresh();
+
+ Object notificationObject = MavenPomEditorPage.getFromNotification(notification);
+ if(currentRepository == object && (notificationObject == null || notificationObject instanceof Repository)) {
+ updateRepositoryDetailsSection((Repository) notificationObject);
+ }
+ }
+
+ if(object instanceof DistributionManagement) {
+ if(object == distributionManagementProvider.getValue()) {
+ loadProjectSite();
+ loadRelocation();
+ loadReleaseDistributionRepository();
+ loadSnapshotDistributionRepository();
+ }
+ }
+
+ if(object instanceof Site) {
+ if(object.eContainer() == distributionManagementProvider.getValue()) {
+ loadProjectSite();
+ }
+ }
+
+ if(object instanceof Relocation) {
+ if(object.eContainer() == distributionManagementProvider.getValue()) {
+ loadRelocation();
+ }
+ }
+
+ if(object instanceof DeploymentRepository) {
+ if(object.eContainer() == distributionManagementProvider.getValue()) {
+ loadReleaseDistributionRepository();
+ loadSnapshotDistributionRepository();
+ }
+ }
+
+ // XXX
+ }
+
+ protected void updateRepositoryDetailsSection(final Repository repository) {
+ if(changingSelection) {
+ return;
+ }
+// if(repository != null && currentRepository == repository) {
+// return;
+// }
+ currentRepository = repository;
+
+ if(parent != null) {
+ parent.removeNotifyListener(repositoryIdText);
+ parent.removeNotifyListener(repositoryNameText);
+ parent.removeNotifyListener(repositoryUrlText);
+ parent.removeNotifyListener(repositoryLayoutCombo);
+
+ parent.removeNotifyListener(releasesEnabledButton);
+ parent.removeNotifyListener(releasesChecksumPolicyCombo);
+ parent.removeNotifyListener(releasesUpdatePolicyCombo);
+
+ parent.removeNotifyListener(snapshotsEnabledButton);
+ parent.removeNotifyListener(snapshotsChecksumPolicyCombo);
+ parent.removeNotifyListener(snapshotsUpdatePolicyCombo);
+ }
+
+ if(repository == null) {
+ FormUtils.setEnabled(repositoryDetailsSection, false);
+
+ setText(repositoryIdText, ""); //$NON-NLS-1$
+ setText(repositoryNameText, ""); //$NON-NLS-1$
+ setText(repositoryLayoutCombo, ""); //$NON-NLS-1$
+ setText(repositoryUrlText, ""); //$NON-NLS-1$
+
+ setButton(releasesEnabledButton, false);
+ setText(releasesChecksumPolicyCombo, ""); //$NON-NLS-1$
+ setText(releasesUpdatePolicyCombo, ""); //$NON-NLS-1$
+
+ setButton(snapshotsEnabledButton, false);
+ setText(snapshotsChecksumPolicyCombo, ""); // move into listener //$NON-NLS-1$
+ setText(snapshotsUpdatePolicyCombo, ""); //$NON-NLS-1$
+
+ // XXX swap repository details panel
+
+ return;
+ }
+
+// repositoryIdText.setEnabled(true);
+// repositoryNameText.setEnabled(true);
+// repositoryLayoutCombo.setEnabled(true);
+// repositoryUrlText.setEnabled(true);
+// releasesEnabledButton.setEnabled(true);
+// snapshotsEnabledButton.setEnabled(true);
+
+ setText(repositoryIdText, repository.getId());
+ setText(repositoryNameText, repository.getName());
+ setText(repositoryLayoutCombo, "".equals(nvl(repository.getLayout())) ? "default" : nvl(repository.getLayout()));//$NON-NLS-1$ //$NON-NLS-2$
+ setText(repositoryUrlText, repository.getUrl());
+
+ {
+ RepositoryPolicy releases = repository.getReleases();
+ if(releases != null) {
+ setButton(releasesEnabledButton, releases.getEnabled() == null || "true".equals(releases.getEnabled()));
+ setText(releasesChecksumPolicyCombo, releases.getChecksumPolicy());
+ setText(releasesUpdatePolicyCombo, releases.getUpdatePolicy());
+ } else {
+ setButton(releasesEnabledButton, true);
+ }
+ boolean isReleasesEnabled = releasesEnabledButton.getSelection();
+ releasesChecksumPolicyCombo.setEnabled(isReleasesEnabled);
+ releasesUpdatePolicyCombo.setEnabled(isReleasesEnabled);
+ releasesChecksumPolicyLabel.setEnabled(isReleasesEnabled);
+ releasesUpdatePolicyLabel.setEnabled(isReleasesEnabled);
+ }
+
+ {
+ RepositoryPolicy snapshots = repository.getSnapshots();
+ if(snapshots != null) {
+ setButton(snapshotsEnabledButton, snapshots.getEnabled() == null || "true".equals(snapshots.getEnabled()));
+ setText(snapshotsChecksumPolicyCombo, snapshots.getChecksumPolicy());
+ setText(snapshotsUpdatePolicyCombo, snapshots.getUpdatePolicy());
+ } else {
+ setButton(snapshotsEnabledButton, true);
+ }
+ boolean isSnapshotsEnabled = snapshotsEnabledButton.getSelection();
+ snapshotsChecksumPolicyCombo.setEnabled(isSnapshotsEnabled);
+ snapshotsUpdatePolicyCombo.setEnabled(isSnapshotsEnabled);
+ snapshotsChecksumPolicyLabel.setEnabled(isSnapshotsEnabled);
+ snapshotsUpdatePolicyLabel.setEnabled(isSnapshotsEnabled);
+ }
+
+ FormUtils.setEnabled(repositoryDetailsSection, true);
+ FormUtils.setReadonly(repositoryDetailsSection, parent.isReadOnly());
+
+ ValueProvider<Repository> repositoryProvider = new ValueProvider.DefaultValueProvider<Repository>(repository);
+ parent.setModifyListener(repositoryIdText, repositoryProvider, POM_PACKAGE.getRepository_Id(), ""); //$NON-NLS-1$
+ parent.setModifyListener(repositoryNameText, repositoryProvider, POM_PACKAGE.getRepository_Name(), ""); //$NON-NLS-1$
+ parent.setModifyListener(repositoryUrlText, repositoryProvider, POM_PACKAGE.getRepository_Url(), ""); //$NON-NLS-1$
+ parent.setModifyListener(repositoryLayoutCombo, repositoryProvider, POM_PACKAGE.getRepository_Layout(), "default");
+
+ ValueProvider<RepositoryPolicy> releasesProvider = new ValueProvider.ParentValueProvider<RepositoryPolicy>(
+ releasesEnabledButton, releasesChecksumPolicyCombo, releasesUpdatePolicyCombo) {
+ public RepositoryPolicy getValue() {
+ return repository.getReleases();
+ }
+
+ public RepositoryPolicy create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ RepositoryPolicy policy = getValue();
+ if(policy == null) {
+ policy = PomFactory.eINSTANCE.createRepositoryPolicy();
+ Command command = SetCommand.create(editingDomain, repository, POM_PACKAGE.getRepository_Releases(), policy);
+ compoundCommand.append(command);
+ }
+ return policy;
+ }
+ };
+ parent
+ .setModifyListener(releasesEnabledButton, releasesProvider, POM_PACKAGE.getRepositoryPolicy_Enabled(), "true");
+ parent.setModifyListener(releasesChecksumPolicyCombo, releasesProvider, POM_PACKAGE
+ .getRepositoryPolicy_ChecksumPolicy(), ""); //$NON-NLS-1$
+ parent.setModifyListener(releasesUpdatePolicyCombo, releasesProvider, POM_PACKAGE
+ .getRepositoryPolicy_UpdatePolicy(), ""); //$NON-NLS-1$
+
+ ValueProvider<RepositoryPolicy> snapshotsProvider = new ValueProvider.ParentValueProvider<RepositoryPolicy>(
+ snapshotsEnabledButton, snapshotsChecksumPolicyCombo, snapshotsUpdatePolicyCombo) {
+ public RepositoryPolicy getValue() {
+ return repository.getSnapshots();
+ }
+
+ public RepositoryPolicy create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ RepositoryPolicy policy = getValue();
+ if(policy == null) {
+ policy = PomFactory.eINSTANCE.createRepositoryPolicy();
+ Command command = SetCommand.create(editingDomain, repository, POM_PACKAGE.getRepository_Snapshots(), policy);
+ compoundCommand.append(command);
+ }
+ return policy;
+ }
+ };
+ parent.setModifyListener(snapshotsEnabledButton, snapshotsProvider, POM_PACKAGE.getRepositoryPolicy_Enabled(),
+ "true");
+ parent.setModifyListener(snapshotsChecksumPolicyCombo, snapshotsProvider, POM_PACKAGE
+ .getRepositoryPolicy_ChecksumPolicy(), ""); //$NON-NLS-1$
+ parent.setModifyListener(snapshotsUpdatePolicyCombo, snapshotsProvider, POM_PACKAGE
+ .getRepositoryPolicy_UpdatePolicy(), ""); //$NON-NLS-1$
+ }
+
+ DistributionManagement createDistributionManagement(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ DistributionManagement dm = distributionManagementProvider.getValue();
+ if(dm == null) {
+ dm = distributionManagementProvider.create(editingDomain, compoundCommand);
+ }
+ return dm;
+ }
+
+ /**
+ * Repository label provider
+ */
+ public class RepositoryLabelProvider extends LabelProvider {
+
+ public String getText(Object element) {
+ if(element instanceof Repository) {
+ Repository r = (Repository) element;
+ return (isEmpty(r.getId()) ? "?" : r.getId()) + " : " + (isEmpty(r.getUrl()) ? "?" : r.getUrl());
+ }
+ return super.getText(element);
+ }
+
+ public Image getImage(Object element) {
+ return MavenEditorImages.IMG_REPOSITORY;
+ }
+
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/SectionExpansionAdapter.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/SectionExpansionAdapter.java
new file mode 100644
index 00000000..1f34cec0
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/SectionExpansionAdapter.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.composites;
+
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * An expansion adapter that collapses all the sections in the same row.
+ */
+public class SectionExpansionAdapter extends ExpansionAdapter {
+ private boolean inProgress = false;
+ private Section[] sections;
+
+ public SectionExpansionAdapter(Section[] sections) {
+ this.sections = sections;
+ for(Section section : sections) {
+ section.addExpansionListener(this);
+ }
+ }
+
+ public void expansionStateChanged(ExpansionEvent e) {
+ if(!inProgress && e.getSource() instanceof Section) {
+ inProgress = true;
+ boolean expand = ((Section)e.getSource()).isExpanded();
+
+ for(Section section : sections) {
+ section.setExpanded(expand);
+ }
+
+ inProgress = false;
+ }
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/StringLabelProvider.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/StringLabelProvider.java
new file mode 100644
index 00000000..270be049
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/StringLabelProvider.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.composites;
+
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Label provider for <code>String</code> entries
+ *
+ * @author Eugene Kuleshov
+ */
+public class StringLabelProvider extends LabelProvider {
+ private final Image img;
+
+ public StringLabelProvider(Image img) {
+ this.img = img;
+ }
+
+ public String getText(Object element) {
+ if(element instanceof String) {
+ return (String) element;
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ public Image getImage(Object element) {
+ return img;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/TeamComposite.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/TeamComposite.java
new file mode 100644
index 00000000..0b634366
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/TeamComposite.java
@@ -0,0 +1,630 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.composites;
+
+import static org.eclipse.m2e.editor.pom.FormUtils.setText;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.m2e.core.wizards.WidthGroup;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.editor.pom.FormUtils;
+import org.eclipse.m2e.editor.pom.MavenPomEditorPage;
+import org.eclipse.m2e.editor.pom.PropertiesSection;
+import org.eclipse.m2e.editor.pom.ValueProvider;
+import org.eclipse.m2e.model.edit.pom.Contributor;
+import org.eclipse.m2e.model.edit.pom.Developer;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.Section;
+
+
+/**
+ * @author Dmitry Platonoff
+ */
+public class TeamComposite extends Composite {
+
+ protected static PomPackage POM_PACKAGE = PomPackage.eINSTANCE;
+
+ private FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+
+ MavenPomEditorPage parent;
+
+ // controls
+
+ Model model;
+
+ ListEditorComposite<Developer> developersEditor;
+
+ ListEditorComposite<Contributor> contributorsEditor;
+
+ Composite detailsComposite;
+
+ Text userIdText;
+
+ Text userNameText;
+
+ Text userEmailText;
+
+ Text userUrlText;
+
+ CCombo userTimezoneText;
+
+ Text organizationNameText;
+
+ Text organizationUrlText;
+
+ ListEditorComposite<String> rolesEditor;
+
+ Label userIdLabel;
+
+ // model
+ EObject currentSelection;
+
+ boolean changingSelection = false;
+
+ private PropertiesSection propertiesSection;
+
+ public TeamComposite(MavenPomEditorPage editorPage, Composite composite, int flags) {
+ super(composite, flags);
+ this.parent = editorPage;
+ createComposite();
+ }
+
+ private void createComposite() {
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.makeColumnsEqualWidth = true;
+ gridLayout.marginWidth = 0;
+ setLayout(gridLayout);
+ toolkit.adapt(this);
+
+ SashForm horizontalSash = new SashForm(this, SWT.NONE);
+ horizontalSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ toolkit.adapt(horizontalSash, true, true);
+
+ SashForm verticalSash = new SashForm(horizontalSash, SWT.VERTICAL);
+ toolkit.adapt(verticalSash, true, true);
+
+ createDevelopersSection(toolkit, verticalSash);
+ createContributorsSection(toolkit, verticalSash);
+
+ verticalSash.setWeights(new int[] {1, 1});
+
+ createDetailsPanel(toolkit, horizontalSash);
+
+ horizontalSash.setWeights(new int[] {1, 1});
+ }
+
+ private void createDevelopersSection(FormToolkit toolkit, SashForm verticalSash) {
+ Section developersSection = toolkit.createSection(verticalSash, ExpandableComposite.TITLE_BAR);
+ developersSection.setText(Messages.TeamComposite_section_developers);
+
+ developersEditor = new ListEditorComposite<Developer>(developersSection, SWT.NONE);
+
+ developersEditor.setContentProvider(new ListEditorContentProvider<Developer>());
+ developersEditor.setLabelProvider(new TeamLabelProvider());
+
+ developersEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ Developer developer = PomFactory.eINSTANCE.createDeveloper();
+ Command addDependencyCommand = AddCommand.create(editingDomain, model, POM_PACKAGE
+ .getModel_Developers(), developer);
+ compoundCommand.append(addDependencyCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ developersEditor.setSelection(Collections.singletonList(developer));
+ updateDetails(developer);
+ userIdText.setFocus();
+ }
+ });
+
+ developersEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ List<Developer> developerList = developersEditor.getSelection();
+ for(Developer developer : developerList) {
+ Command removeCommand = RemoveCommand.create(editingDomain, model, POM_PACKAGE
+ .getModel_Developers(), developer);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ updateDetails(null);
+ }
+ });
+
+ developersEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<Developer> selection = developersEditor.getSelection();
+ updateDetails(selection.size() == 1 ? selection.get(0) : null);
+
+ if(!selection.isEmpty()) {
+ changingSelection = true;
+ try {
+ contributorsEditor.setSelection(Collections.<Contributor> emptyList());
+ } finally {
+ changingSelection = false;
+ }
+ }
+ }
+ });
+
+ developersSection.setClient(developersEditor);
+ toolkit.paintBordersFor(developersEditor);
+ toolkit.adapt(developersEditor);
+ }
+
+ private void createContributorsSection(FormToolkit toolkit, SashForm verticalSash) {
+ Section contributorsSection = toolkit.createSection(verticalSash, ExpandableComposite.TITLE_BAR);
+ contributorsSection.setText(Messages.TeamComposite_section_contributors);
+
+ contributorsEditor = new ListEditorComposite<Contributor>(contributorsSection, SWT.NONE);
+ contributorsEditor.setContentProvider(new ListEditorContentProvider<Contributor>());
+ contributorsEditor.setLabelProvider(new TeamLabelProvider());
+
+ contributorsEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ Contributor contributor = PomFactory.eINSTANCE.createContributor();
+ Command addDependencyCommand = AddCommand.create(editingDomain, model, POM_PACKAGE
+ .getModel_Contributors(), contributor);
+ compoundCommand.append(addDependencyCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ contributorsEditor.setSelection(Collections.singletonList(contributor));
+ updateDetails(contributor);
+ userNameText.setFocus();
+ }
+ });
+
+ contributorsEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ List<Contributor> contributorList = contributorsEditor.getSelection();
+ for(Contributor contributor : contributorList) {
+ Command removeCommand = RemoveCommand.create(editingDomain, model, POM_PACKAGE
+ .getModel_Contributors(), contributor);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ updateDetails(null);
+ }
+ });
+
+ contributorsEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<Contributor> selection = contributorsEditor.getSelection();
+ updateDetails(selection.size() == 1 ? selection.get(0) : null);
+
+ if(!selection.isEmpty()) {
+ changingSelection = true;
+ try {
+ developersEditor.setSelection(Collections.<Developer> emptyList());
+ } finally {
+ changingSelection = false;
+ }
+ }
+ }
+ });
+
+ contributorsSection.setClient(contributorsEditor);
+ toolkit.paintBordersFor(contributorsEditor);
+ toolkit.adapt(contributorsEditor);
+ }
+
+ private void createDetailsPanel(FormToolkit toolkit, SashForm horizontalSash) {
+ detailsComposite = toolkit.createComposite(horizontalSash, SWT.NONE);
+ GridLayout detailsCompositeGridLayout = new GridLayout();
+ detailsCompositeGridLayout.marginLeft = 5;
+ detailsCompositeGridLayout.marginWidth = 0;
+ detailsCompositeGridLayout.marginHeight = 0;
+ detailsComposite.setLayout(detailsCompositeGridLayout);
+ toolkit.paintBordersFor(detailsComposite);
+
+ Section userDetailsSection = toolkit.createSection(detailsComposite, ExpandableComposite.TITLE_BAR);
+ GridData gd_userDetailsSection = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ userDetailsSection.setLayoutData(gd_userDetailsSection);
+ userDetailsSection.setText(Messages.TeamComposite_section_userdetails);
+
+ Composite userDetailsComposite = toolkit.createComposite(userDetailsSection, SWT.NONE);
+ userDetailsComposite.setLayout(new GridLayout(2, false));
+ toolkit.paintBordersFor(userDetailsComposite);
+ userDetailsSection.setClient(userDetailsComposite);
+
+ userIdLabel = toolkit.createLabel(userDetailsComposite, Messages.TeamComposite_lblId, SWT.NONE);
+
+ userIdText = toolkit.createText(userDetailsComposite, null, SWT.NONE);
+ userIdText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Label userNameLabel = toolkit.createLabel(userDetailsComposite, Messages.TeamComposite_lblName, SWT.NONE);
+
+ userNameText = toolkit.createText(userDetailsComposite, null, SWT.NONE);
+ userNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Label userEmailLabel = toolkit.createLabel(userDetailsComposite, Messages.TeamComposite_lblEmail, SWT.NONE);
+
+ userEmailText = toolkit.createText(userDetailsComposite, null, SWT.NONE);
+ userEmailText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Hyperlink userUrlLabel = toolkit.createHyperlink(userDetailsComposite, Messages.TeamComposite_lblUrl, SWT.NONE);
+ userUrlLabel.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ FormUtils.openHyperlink(userUrlText.getText());
+ }
+ });
+
+ userUrlText = toolkit.createText(userDetailsComposite, null, SWT.NONE);
+ userUrlText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Label userTimezoneLabel = toolkit.createLabel(userDetailsComposite, Messages.TeamComposite_lblTimezone, SWT.NONE);
+
+ userTimezoneText = new CCombo(userDetailsComposite, SWT.FLAT);
+ userTimezoneText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ userTimezoneText.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+
+ Section organizationSection = toolkit.createSection(detailsComposite, ExpandableComposite.TITLE_BAR);
+ organizationSection.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ organizationSection.setText(Messages.TeamComposite_section_organization);
+
+ Composite organizationComposite = toolkit.createComposite(organizationSection, SWT.NONE);
+ organizationComposite.setLayout(new GridLayout(2, false));
+ toolkit.paintBordersFor(organizationComposite);
+ organizationSection.setClient(organizationComposite);
+
+ Label organizationNameLabel = toolkit.createLabel(organizationComposite, Messages.TeamComposite_lblName, SWT.NONE);
+
+ organizationNameText = toolkit.createText(organizationComposite, null, SWT.NONE);
+ organizationNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Hyperlink organizationUrlLabel = toolkit.createHyperlink(organizationComposite, Messages.TeamComposite_lblUrl, SWT.NONE);
+ organizationUrlLabel.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ FormUtils.openHyperlink(organizationUrlText.getText());
+ }
+ });
+
+ organizationUrlText = toolkit.createText(organizationComposite, null, SWT.NONE);
+ organizationUrlText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ WidthGroup widthGroup = new WidthGroup();
+ widthGroup.addControl(userIdLabel);
+ widthGroup.addControl(userNameLabel);
+ widthGroup.addControl(userEmailLabel);
+ widthGroup.addControl(userUrlLabel);
+ widthGroup.addControl(userTimezoneLabel);
+ widthGroup.addControl(organizationNameLabel);
+ widthGroup.addControl(organizationUrlLabel);
+ userDetailsComposite.addControlListener(widthGroup);
+ userDetailsComposite.setTabList(new Control[] {userIdText, userNameText, userEmailText, userUrlText, userTimezoneText});
+ organizationComposite.addControlListener(widthGroup);
+ organizationComposite.setTabList(new Control[] {organizationNameText, organizationUrlText});
+
+ createRolesSection(toolkit, detailsComposite);
+ createPropertiesSection(toolkit, detailsComposite);
+ }
+
+ private void createRolesSection(FormToolkit toolkit, Composite detailsComposite) {
+ Section rolesSection = toolkit.createSection(detailsComposite, ExpandableComposite.TITLE_BAR);
+ rolesSection.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ rolesSection.setText(Messages.TeamComposite_section_roles);
+
+ rolesEditor = new ListEditorComposite<String>(rolesSection, SWT.NONE);
+ toolkit.paintBordersFor(rolesEditor);
+ toolkit.adapt(rolesEditor);
+ rolesSection.setClient(rolesEditor);
+
+ rolesEditor.setContentProvider(new ListEditorContentProvider<String>());
+ rolesEditor.setLabelProvider(new StringLabelProvider(MavenEditorImages.IMG_ROLE));
+
+ rolesEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ EObject parentObject = currentSelection;
+ EStructuralFeature feature = null;
+ if(currentSelection != null) {
+ if(currentSelection instanceof Contributor) {
+ feature = POM_PACKAGE.getContributor_Roles();
+ } else if(currentSelection instanceof Developer) {
+ feature = POM_PACKAGE.getDeveloper_Roles();
+ }
+ }
+
+ Command addRoleCommand = AddCommand.create(editingDomain, parentObject, feature, "?");
+ compoundCommand.append(addRoleCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ updateRoles((EList<String>)parentObject.eGet(feature));
+ }
+ });
+
+ rolesEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = parent.getEditingDomain();
+
+ EObject parentObject = currentSelection;
+ EStructuralFeature feature = null;
+ if(currentSelection != null) {
+ if(currentSelection instanceof Contributor) {
+ feature = POM_PACKAGE.getContributor_Roles();
+ } else if(currentSelection instanceof Developer) {
+ feature = POM_PACKAGE.getDeveloper_Roles();
+ }
+ }
+ List<String> roleList = rolesEditor.getSelection();
+ for(String role : roleList) {
+ Command removeCommand = RemoveCommand.create(editingDomain, parentObject, feature, role);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ }
+ });
+
+ rolesEditor.setCellModifier(new ICellModifier() {
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+
+ public Object getValue(Object element, String property) {
+ return element;
+ }
+
+ public void modify(Object element, String property, Object value) {
+ int n = rolesEditor.getViewer().getTable().getSelectionIndex();
+ if(!value.equals(getRoles().get(n))) {
+ EditingDomain editingDomain = parent.getEditingDomain();
+ EObject parentObject = currentSelection;
+ EStructuralFeature feature = null;
+ if(currentSelection != null) {
+ if(currentSelection instanceof Contributor) {
+ feature = POM_PACKAGE.getContributor_Roles();
+ } else if(currentSelection instanceof Developer) {
+ feature = POM_PACKAGE.getDeveloper_Roles();
+ }
+ }
+ Command command = SetCommand.create(editingDomain, parentObject,
+ feature, value, n);
+ editingDomain.getCommandStack().execute(command);
+ }
+ }
+ });
+
+ }
+
+ private void createPropertiesSection(FormToolkit toolkit, Composite composite) {
+ propertiesSection = new PropertiesSection(toolkit, composite, parent.getEditingDomain());
+ }
+
+ public void loadContributors() {
+ changingSelection = true;
+ contributorsEditor.setInput(model.getContributors());
+ changingSelection = false;
+ }
+
+ void loadDevelopers() {
+ changingSelection = true;
+ developersEditor.setInput(model.getDevelopers());
+ changingSelection = false;
+ }
+
+ protected void updateDetails(EObject eo) {
+ if(changingSelection) {
+ return;
+ }
+
+ this.currentSelection = eo;
+
+ if(parent != null) {
+ parent.removeNotifyListener(userIdText);
+ parent.removeNotifyListener(userNameText);
+ parent.removeNotifyListener(userEmailText);
+ parent.removeNotifyListener(userUrlText);
+ parent.removeNotifyListener(userTimezoneText);
+ parent.removeNotifyListener(organizationNameText);
+ parent.removeNotifyListener(organizationUrlText);
+ }
+
+ if(parent == null || eo == null) {
+ FormUtils.setEnabled(detailsComposite, false);
+
+ setText(userIdText, ""); //$NON-NLS-1$
+ setText(userNameText, ""); //$NON-NLS-1$
+ setText(userEmailText, ""); //$NON-NLS-1$
+ setText(userUrlText, ""); //$NON-NLS-1$
+ setText(userTimezoneText, ""); //$NON-NLS-1$
+
+ setText(organizationNameText, ""); //$NON-NLS-1$
+ setText(organizationUrlText, ""); //$NON-NLS-1$
+
+ rolesEditor.setInput(null);
+
+ return;
+ }
+
+ FormUtils.setEnabled(detailsComposite, true);
+ FormUtils.setReadonly(detailsComposite, parent.isReadOnly());
+
+ EList<String> roles = null;
+ if(eo instanceof Contributor) {
+ Contributor contributor = (Contributor) eo;
+ updateContributorDetails(contributor);
+ roles = contributor.getRoles();
+ propertiesSection.setModel(contributor, POM_PACKAGE.getContributor_Properties());
+ } else if(eo instanceof Developer) {
+ Developer developer = (Developer) eo;
+ updateDeveloperDetails(developer);
+ roles = developer.getRoles();
+ propertiesSection.setModel(developer, POM_PACKAGE.getDeveloper_Properties());
+ }
+
+ parent.registerListeners();
+
+ updateRoles(roles);
+ }
+
+ protected void updateContributorDetails(Contributor contributor) {
+ setText(userIdText, ""); //$NON-NLS-1$
+ setText(userNameText, contributor.getName());
+ setText(userEmailText, contributor.getEmail());
+ setText(userUrlText, contributor.getUrl());
+ setText(userTimezoneText, contributor.getTimezone());
+ setText(organizationNameText, contributor.getOrganization());
+ setText(organizationUrlText, contributor.getOrganizationUrl());
+
+ userIdLabel.setEnabled(false);
+ userIdText.setEnabled(false);
+
+ ValueProvider<Contributor> contributorProvider = new ValueProvider.DefaultValueProvider<Contributor>(contributor);
+ parent.setModifyListener(userNameText, contributorProvider, POM_PACKAGE.getContributor_Name(), ""); //$NON-NLS-1$
+ parent.setModifyListener(userEmailText, contributorProvider, POM_PACKAGE.getContributor_Email(), ""); //$NON-NLS-1$
+ parent.setModifyListener(userUrlText, contributorProvider, POM_PACKAGE.getContributor_Url(), ""); //$NON-NLS-1$
+ parent.setModifyListener(userTimezoneText, contributorProvider, POM_PACKAGE.getContributor_Timezone(), ""); //$NON-NLS-1$
+ parent.setModifyListener(organizationNameText, contributorProvider, POM_PACKAGE.getContributor_Organization(), ""); //$NON-NLS-1$
+ parent
+ .setModifyListener(organizationUrlText, contributorProvider, POM_PACKAGE.getContributor_OrganizationUrl(), ""); //$NON-NLS-1$
+ }
+
+ protected void updateDeveloperDetails(Developer developer) {
+ setText(userIdText, developer.getId());
+ setText(userNameText, developer.getName());
+ setText(userEmailText, developer.getEmail());
+ setText(userUrlText, developer.getUrl());
+ setText(userTimezoneText, developer.getTimezone());
+ setText(organizationNameText, developer.getOrganization());
+ setText(organizationUrlText, developer.getOrganizationUrl());
+
+ ValueProvider<Developer> developerProvider = new ValueProvider.DefaultValueProvider<Developer>(developer);
+ parent.setModifyListener(userIdText, developerProvider, POM_PACKAGE.getDeveloper_Id(), ""); //$NON-NLS-1$
+ parent.setModifyListener(userNameText, developerProvider, POM_PACKAGE.getDeveloper_Name(), ""); //$NON-NLS-1$
+ parent.setModifyListener(userEmailText, developerProvider, POM_PACKAGE.getDeveloper_Email(), ""); //$NON-NLS-1$
+ parent.setModifyListener(userUrlText, developerProvider, POM_PACKAGE.getDeveloper_Url(), ""); //$NON-NLS-1$
+ parent.setModifyListener(userTimezoneText, developerProvider, POM_PACKAGE.getDeveloper_Timezone(), ""); //$NON-NLS-1$
+ parent.setModifyListener(organizationNameText, developerProvider, POM_PACKAGE.getDeveloper_Organization(), ""); //$NON-NLS-1$
+ parent.setModifyListener(organizationUrlText, developerProvider, POM_PACKAGE.getDeveloper_OrganizationUrl(), ""); //$NON-NLS-1$
+ }
+
+ public void updateView(Notification notification) {
+ EObject object = (EObject) notification.getNotifier();
+ Object feature = notification.getFeature();
+
+ if(feature == PomPackage.Literals.MODEL__DEVELOPERS) {
+ developersEditor.refresh();
+ } else if(feature == PomPackage.Literals.MODEL__CONTRIBUTORS) {
+ contributorsEditor.refresh();
+ } else {
+ Object notificationObject = MavenPomEditorPage.getFromNotification(notification);
+ if(object instanceof Contributor) {
+ contributorsEditor.refresh();
+
+ if(object == currentSelection)
+ updateDetails(object);
+ } else if(object instanceof Developer) {
+ developersEditor.refresh();
+
+ if(object == currentSelection)
+ updateDetails(object);
+ } else if(feature == PomPackage.Literals.DEVELOPER__ROLES || feature == PomPackage.Literals.CONTRIBUTOR__ROLES) {
+ EList<String> roles = (EList<String>)object.eGet((EStructuralFeature)feature);
+ if(object == getRoles()) {
+ updateRoles(roles);
+ }
+ }
+ }
+ }
+
+ public void loadData(Model model) {
+ this.model = model;
+ loadDevelopers();
+ loadContributors();
+
+ developersEditor.setReadOnly(parent.isReadOnly());
+ contributorsEditor.setReadOnly(parent.isReadOnly());
+
+ updateDetails(null);
+ }
+
+ protected EList<String> getRoles() {
+ if(currentSelection != null) {
+ if(currentSelection instanceof Contributor) {
+ return ((Contributor) currentSelection).getRoles();
+ } else if(currentSelection instanceof Developer) {
+ return ((Developer) currentSelection).getRoles();
+ }
+ }
+ return null;
+ }
+
+ protected void updateRoles(EList<String> roles) {
+ rolesEditor.setInput(roles);
+ }
+
+ protected EList<PropertyElement> getProperties() {
+ if(currentSelection != null) {
+ if(currentSelection instanceof Contributor) {
+ return ((Contributor) currentSelection).getProperties();
+ } else if(currentSelection instanceof Developer) {
+ return ((Developer) currentSelection).getProperties();
+ }
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/TeamLabelProvider.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/TeamLabelProvider.java
new file mode 100644
index 00000000..e45ba6a8
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/TeamLabelProvider.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.composites;
+
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.model.edit.pom.Contributor;
+import org.eclipse.m2e.model.edit.pom.Developer;
+import org.eclipse.swt.graphics.Image;
+
+
+/**
+ * Label provider for Developer and Contributor elements
+ *
+ * @author Dmitry Platonoff
+ */
+public class TeamLabelProvider extends LabelProvider {
+
+ @Override
+ public String getText(Object element) {
+ if(element instanceof Developer) {
+ Developer developer = (Developer) element;
+ return getText(developer.getName(), developer.getEmail(), developer.getOrganization());
+ }
+ else if(element instanceof Contributor) {
+ Contributor contributor = (Contributor) element;
+ return getText(contributor.getName(), contributor.getEmail(), contributor.getOrganization());
+ }
+ return super.getText(element);
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ return MavenEditorImages.IMG_PERSON;
+ }
+
+ private String getText(String name, String email, String organization) {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append(isEmpty(name) ? "?" : name);
+
+ if(!isEmpty(email)) {
+ sb.append(" <").append(email).append('>');
+ }
+
+ if(!isEmpty(organization)) {
+ sb.append(", ").append(organization);
+ }
+
+ return sb.toString();
+ }
+
+ private boolean isEmpty(String s) {
+ return s == null || s.trim().length() == 0;
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java
new file mode 100644
index 00000000..83287013
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java
@@ -0,0 +1,527 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.dialogs;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.ListIterator;
+
+import org.apache.maven.project.MavenProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.ui.dialogs.AbstractMavenDialog;
+import org.eclipse.m2e.editor.MavenEditorPlugin;
+import org.eclipse.m2e.editor.composites.ListEditorContentProvider;
+import org.eclipse.m2e.editor.composites.ManageDependencyLabelProvider;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.DependencyManagement;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.util.PomResourceFactoryImpl;
+import org.eclipse.m2e.model.edit.pom.util.PomResourceImpl;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Tree;
+
+
+/**
+ * This dialog is used to present the user with a list of dialogs that they can move to being managed under
+ * "dependencyManagement". It allows them to pick the destination POM where the dependencies will be managed.
+ *
+ * @author rgould
+ */
+public class ManageDependenciesDialog extends AbstractMavenDialog {
+
+
+ protected static final String DIALOG_SETTINGS = ManageDependenciesDialog.class.getName();
+ protected TableViewer dependenciesViewer;
+ protected TreeViewer pomsViewer;
+ protected Model model;
+ LinkedList<MavenProject> projectHierarchy;
+ protected EditingDomain editingDomain;
+ private IStatus status;
+
+ /**
+ * Hierarchy is a LinkedList representing the hierarchy relationship between
+ * POM represented by model and its parents. The head of the list should be
+ * the child, while the tail should be the root parent, with the others
+ * in between.
+ */
+ public ManageDependenciesDialog(Shell parent, Model model, LinkedList<MavenProject> hierarchy, EditingDomain editingDomain) {
+ super(parent, DIALOG_SETTINGS);
+
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ setTitle(Messages.ManageDependenciesDialog_dialogTitle);
+
+ this.model = model;
+ this.projectHierarchy = hierarchy;
+ this.editingDomain = editingDomain;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createDialogArea(Composite parent) {
+ readSettings();
+
+ Composite composite = (Composite) super.createDialogArea(parent);
+
+ Label infoLabel = new Label(composite, SWT.WRAP);
+ infoLabel
+ .setText(Messages.ManageDependenciesDialog_dialogInfo);
+
+ Label horizontalBar = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
+
+ SashForm sashForm = new SashForm(composite, SWT.SMOOTH | SWT.HORIZONTAL);
+ Composite dependenciesComposite = new Composite(sashForm, SWT.NONE);
+
+ Label selectDependenciesLabel = new Label(dependenciesComposite, SWT.NONE);
+ selectDependenciesLabel.setText(Messages.ManageDependenciesDialog_selectDependenciesLabel);
+
+ final Table dependenciesTable = new Table(dependenciesComposite, SWT.FLAT | SWT.MULTI | SWT.BORDER);
+ final TableColumn column = new TableColumn(dependenciesTable, SWT.NONE);
+ dependenciesTable.addControlListener(new ControlAdapter() {
+ @Override
+ public void controlResized(ControlEvent e) {
+ column.setWidth(dependenciesTable.getClientArea().width);
+ }
+ });
+
+ Composite pomComposite = new Composite(sashForm, SWT.NONE);
+
+ Label selectPomLabel = new Label(pomComposite, SWT.NONE);
+ selectPomLabel.setText(Messages.ManageDependenciesDialog_selectPOMLabel);
+
+ Tree pomTree = new Tree(pomComposite, SWT.BORDER);
+
+ /*
+ * Configure layouts
+ */
+
+ GridLayout layout = new GridLayout(1, false);
+ composite.setLayout(layout);
+
+ GridData gridData = new GridData(SWT.FILL, SWT.NONE, true, false);
+ gridData.widthHint = 300;
+ infoLabel.setLayoutData(gridData);
+
+ gridData = new GridData(SWT.FILL, SWT.NONE, true, false);
+ horizontalBar.setLayoutData(gridData);
+
+ gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ sashForm.setLayoutData(gridData);
+
+ gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ dependenciesComposite.setLayoutData(gridData);
+
+ layout = new GridLayout(1, false);
+ dependenciesComposite.setLayout(layout);
+
+ gridData = new GridData(SWT.FILL, SWT.NONE, true, false);
+ selectDependenciesLabel.setLayoutData(gridData);
+
+ gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ dependenciesTable.setLayoutData(gridData);
+
+
+ gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ pomComposite.setLayoutData(gridData);
+
+ layout = new GridLayout(1, false);
+ pomComposite.setLayout(layout);
+
+ gridData = new GridData(SWT.FILL, SWT.NONE, true, false);
+ selectPomLabel.setLayoutData(gridData);
+
+ gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ pomTree.setLayoutData(gridData);
+
+ /*
+ * Set up list/tree viewers
+ */
+
+ dependenciesViewer = new TableViewer(dependenciesTable);
+ dependenciesViewer.setLabelProvider(new ManageDependencyLabelProvider());
+ dependenciesViewer.setContentProvider(new ListEditorContentProvider<Dependency>());
+ dependenciesViewer.setInput(model.getDependencies());
+ dependenciesViewer.addSelectionChangedListener(new DependenciesViewerSelectionListener());
+
+ pomsViewer = new TreeViewer(pomTree);
+
+ pomsViewer.setLabelProvider(new DepLabelProvider());
+
+ pomsViewer.setContentProvider(new ContentProvider());
+ pomsViewer.setInput(getProjectHierarchy());
+ pomsViewer.addSelectionChangedListener(new PomViewerSelectionChangedListener());
+ pomsViewer.expandAll();
+
+ return composite;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult()
+ */
+ protected void computeResult() {
+ MavenProject targetPOM = getTargetPOM();
+ IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectManager().getMavenProject(targetPOM.getGroupId(), targetPOM.getArtifactId(), targetPOM.getVersion());
+
+ /*
+ * Load the target model so we can make modifications to it
+ */
+ Model targetModel = null;
+ if (targetPOM.equals(getProjectHierarchy().getFirst())) {
+ //Editing the same models in both cases
+ targetModel = model;
+ } else {
+ targetModel = loadTargetModel(facade);
+ if (targetModel == null) {
+ return;
+ }
+ }
+
+ LinkedList<Dependency> dependencies = getDependenciesList();
+
+ /*
+ * 1) Remove version values from the dependencies from the current POM
+ * 2) Add dependencies to dependencyManagement of targetPOM
+ */
+
+ CompoundCommand command = new CompoundCommand();
+
+ //First we remove the version from the original dependency
+ for (Dependency dep : dependencies) {
+ Command unset = SetCommand.create(editingDomain, dep,
+ PomPackage.eINSTANCE.getDependency_Version(), SetCommand.UNSET_VALUE);
+ command.append(unset);
+ }
+
+ DependencyManagement management = targetModel.getDependencyManagement();
+ if (management == null) {
+ //Add dependency management element if it does not exist
+ management = PomFactory.eINSTANCE.createDependencyManagement();
+ Command createDepManagement = SetCommand.create(editingDomain, targetModel,
+ PomPackage.eINSTANCE.getModel_DependencyManagement(), management);
+ command.append(createDepManagement);
+ } else {
+ //Filter out of the list of dependencies for which we need new entries in the dependency management section.
+ for (Dependency depFromTarget : management.getDependencies()) {
+ Iterator<Dependency> iter = dependencies.iterator();
+ while (iter.hasNext()) {
+ Dependency depFromSource = iter.next();
+ if (depFromSource.getGroupId().equals(depFromTarget.getGroupId())
+ && depFromSource.getArtifactId().equals(depFromTarget.getArtifactId())) {
+ /*
+ * Dependency already exists in the target's dependencyManagement,
+ * so we don't need to add it.
+ */
+ iter.remove();
+ }
+ }
+ }
+ }
+
+ //Add new entry in dependency mgt section
+ for (Dependency dep : dependencies) {
+ Dependency clone = PomFactory.eINSTANCE.createDependency();
+ clone.setGroupId(dep.getGroupId());
+ clone.setArtifactId(dep.getArtifactId());
+ clone.setVersion(dep.getVersion());
+
+ Command addDepCommand = AddCommand.create(editingDomain, management,
+ PomPackage.eINSTANCE.getDependencyManagement_Dependencies(), clone);
+
+ command.append(addDepCommand);
+ }
+ editingDomain.getCommandStack().execute(command);
+
+ }
+
+ protected Model loadTargetModel(IMavenProjectFacade facade) {
+ Model targetModel;
+ PomResourceFactoryImpl factory = new PomResourceFactoryImpl();
+ PomResourceImpl resource = (PomResourceImpl) factory.createResource(
+ URI.createFileURI(facade.getPomFile().getPath()));
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ } catch(IOException e) {
+ MavenLogger.log("Can't load model " + facade.getPomFile().getPath(), e); //$NON-NLS-1$
+ return null;
+ }
+ targetModel = (Model) resource.getContents().get(0);
+ return targetModel;
+ }
+
+ protected LinkedList<Dependency> getDependenciesList() {
+ IStructuredSelection selection = (IStructuredSelection) dependenciesViewer.getSelection();
+
+ LinkedList<Dependency> dependencies = new LinkedList<Dependency>();
+
+ for (Object obj : selection.toArray()) {
+ dependencies.add((Dependency) obj);
+ }
+
+ return dependencies;
+ }
+
+ protected LinkedList<MavenProject> getProjectHierarchy() {
+ return this.projectHierarchy;
+ }
+
+ protected MavenProject getTargetPOM() {
+ IStructuredSelection selection = (IStructuredSelection) pomsViewer.getSelection();
+ return (MavenProject) selection.getFirstElement();
+ }
+
+ /**
+ * Compare the list of selected dependencies against the selected targetPOM.
+ * If one of the dependencies is already under dependencyManagement, but has
+ * a different version than the selected dependency, warn the user about this.
+ *
+ * returns true if the user has been warned (but this method updates the status itself)
+ *
+ * @param model
+ * @param dependencies
+ */
+ protected boolean checkDependencies(org.apache.maven.model.Model model, LinkedList<Dependency> dependencies) {
+ if (this.status != null && this.status.getCode() == IStatus.ERROR) {
+ //Don't warn the user if there is already an error
+ return false;
+ }
+ if (model == null || model.getDependencyManagement() == null
+ || model.getDependencyManagement().getDependencies() == null
+ || model.getDependencyManagement().getDependencies().isEmpty()) {
+ return false;
+ }
+
+ for (Dependency selectedDep : dependencies ) {
+ for (org.apache.maven.model.Dependency targetDep : model.getDependencyManagement().getDependencies()) {
+ if (selectedDep.getGroupId().equals(targetDep.getGroupId())
+ && selectedDep.getArtifactId().equals(targetDep.getArtifactId())
+ && !selectedDep.getVersion().equals(targetDep.getVersion())) {
+ String modelID = model.getGroupId()+":"+model.getArtifactId()+":"+model.getVersion(); //$NON-NLS-1$ //$NON-NLS-2$
+ if (targetDep.getLocation("") != null && targetDep.getLocation("").getSource() != null) { //$NON-NLS-1$ //$NON-NLS-2$
+ modelID = targetDep.getLocation("").getSource().getModelId(); //$NON-NLS-1$
+ }
+ Object[] arguments = {
+ selectedDep.getArtifactId()+"-"+selectedDep.getVersion(), //$NON-NLS-1$
+ targetDep.getVersion(),
+ modelID
+ };
+ String message = NLS.bind(Messages.ManageDependenciesDialog_dependencyExistsWarning, arguments);
+ updateStatus(new Status(IStatus.WARNING, MavenEditorPlugin.PLUGIN_ID, message));
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ protected void checkStatus(MavenProject targetProject, LinkedList<Dependency> selectedDependencies) {
+ if (targetProject == null) {
+ clearStatus();
+ return;
+ }
+ boolean error = false;
+ IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectManager().getMavenProject(targetProject.getGroupId(), targetProject.getArtifactId(), targetProject.getVersion());
+ if (facade == null) {
+ error = true;
+ updateStatus(new Status(IStatus.ERROR, MavenEditorPlugin.PLUGIN_ID, Messages.ManageDependenciesDialog_projectNotPresentError));
+ } else {
+ org.apache.maven.model.Model model = null;
+ if (facade.getMavenProject() == null || facade.getMavenProject().getModel() == null) {
+ try {
+ model = MavenPlugin.getDefault().getMavenModelManager().readMavenModel(facade.getPom());
+ } catch(CoreException e) {
+ Object[] arguments = { facade.getPom(), e.getLocalizedMessage() };
+ Status status = new Status(IStatus.ERROR, MavenEditorPlugin.PLUGIN_ID, NLS.bind(Messages.ManageDependenciesDialog_pomReadingError,arguments));
+ MavenPlugin.getDefault().getLog().log(status);
+ updateStatus(status);
+ error = true;
+ }
+ } else {
+ model = facade.getMavenProject().getModel();
+ }
+ if (model != null) {
+ error = checkDependencies(model, getDependenciesList());
+ }
+ }
+
+ if (!error) {
+ clearStatus();
+ }
+ }
+
+ protected void clearStatus() {
+ updateStatus(new Status(IStatus.OK, MavenEditorPlugin.PLUGIN_ID, "")); //$NON-NLS-1$
+ }
+
+ protected class DependenciesViewerSelectionListener implements ISelectionChangedListener {
+ public void selectionChanged(SelectionChangedEvent event) {
+ checkStatus(getTargetPOM(), getDependenciesList());
+ }
+ }
+
+ protected class PomViewerSelectionChangedListener implements ISelectionChangedListener {
+ public void selectionChanged(SelectionChangedEvent event) {
+ checkStatus(getTargetPOM(), getDependenciesList());
+ }
+ }
+
+ @Override
+ protected void updateStatus(IStatus status) {
+ this.status = status;
+ super.updateStatus(status);
+ }
+
+ public static class DepLabelProvider extends LabelProvider implements IColorProvider {
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object element) {
+ MavenProject project = null;
+ if (element instanceof MavenProject) {
+ project = (MavenProject) element;
+ } else if (element instanceof Object[]) {
+ project = (MavenProject) ((Object[]) element)[0];
+ } else {
+ return ""; //$NON-NLS-1$
+ }
+
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(project.getGroupId() + " : " + project.getArtifactId() + " : " +project.getVersion()); //$NON-NLS-1$ //$NON-NLS-2$
+ return buffer.toString();
+
+ }
+
+ public Color getForeground(Object element) {
+ if (element instanceof MavenProject) {
+ MavenProject project = (MavenProject) element;
+ IMavenProjectFacade search = MavenPlugin.getDefault().getMavenProjectManager().getMavenProject(project.getGroupId(), project.getArtifactId(), project.getVersion());
+ if (search == null) {
+ //This project is not in the workspace so we can't really modify it.
+ return Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
+ }
+ }
+ return null;
+ }
+
+ public Color getBackground(Object element) {
+ return null;
+ }
+ }
+
+ public class ContentProvider implements ITreeContentProvider {
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean hasChildren(Object element) {
+ Object[] children = getChildren(element);
+
+ return children.length != 0;
+ }
+
+ public Object getParent(Object element) {
+ if (element instanceof MavenProject){
+ MavenProject project = (MavenProject) element;
+ return project.getParent();
+ }
+ return null;
+ }
+
+ /*
+ * Return root element
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
+ */
+ public Object[] getElements(Object inputElement) {
+
+ if (inputElement instanceof LinkedList) {
+ LinkedList<MavenProject> projects = (LinkedList<MavenProject>) inputElement;
+ if (projects.isEmpty()) {
+ return new Object[0];
+ }
+ return new Object[] { projects.getLast() };
+ }
+
+ return new Object[0];
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof MavenProject) {
+ /*
+ * Walk the hierarchy list until we find the parentElement and
+ * return the previous element, which is the child.
+ */
+ MavenProject parent = (MavenProject) parentElement;
+
+ if (getProjectHierarchy().size() == 1) {
+ //No parent exists, only one element in the tree
+ return new Object[0];
+ }
+
+ if (getProjectHierarchy().getFirst().equals(parent)) {
+ //We are the final child
+ return new Object[0];
+ }
+
+ ListIterator<MavenProject> iter = getProjectHierarchy().listIterator();
+ while (iter.hasNext()) {
+ MavenProject next = iter.next();
+ if (next.equals(parent)) {
+ iter.previous();
+ MavenProject previous = iter.previous();
+ return new Object[] { previous };
+ }
+ }
+ }
+ return new Object[0];
+ }
+ }
+
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/Messages.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/Messages.java
new file mode 100644
index 00000000..dba6ae66
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/Messages.java
@@ -0,0 +1,30 @@
+
+package org.eclipse.m2e.editor.dialogs;
+
+import org.eclipse.osgi.util.NLS;
+
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.m2e.editor.dialogs.messages"; //$NON-NLS-1$
+
+ public static String ManageDependenciesDialog_dependencyExistsWarning;
+
+ public static String ManageDependenciesDialog_dialogInfo;
+
+ public static String ManageDependenciesDialog_dialogTitle;
+
+ public static String ManageDependenciesDialog_pomReadingError;
+
+ public static String ManageDependenciesDialog_projectNotPresentError;
+
+ public static String ManageDependenciesDialog_selectDependenciesLabel;
+
+ public static String ManageDependenciesDialog_selectPOMLabel;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/messages.properties b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/messages.properties
new file mode 100644
index 00000000..29ab0a6b
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/messages.properties
@@ -0,0 +1,7 @@
+ManageDependenciesDialog_dependencyExistsWarning=Dependency {0} already declared with version {1} under {2}''s dependencyManagement.
+ManageDependenciesDialog_dialogInfo=This will start managing the selected dependencies for all child POMs. You may select the POM that will manage these dependencies. The version information will then be moved to it.
+ManageDependenciesDialog_dialogTitle=Manage Dependencies
+ManageDependenciesDialog_pomReadingError=Error reading POM file {0}: {1}
+ManageDependenciesDialog_projectNotPresentError=The selected project cannot be chosen because it is not present in your workspace.
+ManageDependenciesDialog_selectDependenciesLabel=Select dependencies to manage:
+ManageDependenciesDialog_selectPOMLabel=Select the POM which will manage the dependencies:
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/Messages.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/Messages.java
new file mode 100644
index 00000000..bef6ce02
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/Messages.java
@@ -0,0 +1,578 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.m2e.editor.internal.messages"; //$NON-NLS-1$
+
+ public static String BuildComposite_btnFiltering;
+
+ public static String BuildComposite_lblDefaultGoal;
+
+ public static String BuildComposite_lblDirectory;
+
+ public static String BuildComposite_lblExcludes;
+
+ public static String BuildComposite_lblFilters;
+
+ public static String BuildComposite_lblFinalName;
+
+ public static String BuildComposite_lblIncludes;
+
+ public static String BuildComposite_lblTargetPath;
+
+ public static String BuildComposite_section_build;
+
+ public static String BuildComposite_sectionResourceDetails;
+
+ public static String BuildComposite_sectionResources;
+
+ public static String BuildComposite_sectionTestResources;
+
+ public static String BuildPage_action_addExtension;
+
+ public static String BuildPage_action_openWeb;
+
+ public static String BuildPage_action_selectExtension;
+
+ public static String BuildPage_action_showGroupId;
+
+ public static String BuildPage_form;
+
+ public static String BuildPage_lblArtifactId;
+
+ public static String BuildPage_lblGroupId;
+
+ public static String BuildPage_lblOutput;
+
+ public static String BuildPage_lblScripts;
+
+ public static String BuildPage_lblSources;
+
+ public static String BuildPage_lblTestOutput;
+
+ public static String BuildPage_lblTestSources;
+
+ public static String BuildPage_lblVersion;
+
+ public static String BuildPage_searchDialog_addExtension;
+
+ public static String BuildPage_searchDialog_selectExtension;
+
+ public static String BuildPage_section_extensionDetails;
+
+ public static String BuildPage_section_extensions;
+
+ public static String BuildPage_section_folders;
+
+ public static String BuildPage_title;
+
+ public static String CustomLifecycleParamsDialog_btnCopyFrom;
+
+ public static String CustomLifecycleParamsDialog_btnCreateEmpty;
+
+ public static String DefaultPluginConfigurationEditor_lblUseXml;
+
+ public static String DependenciesComposite_action_filter;
+
+ public static String DependenciesComposite_action_open_project_page;
+
+ public static String DependenciesComposite_action_selectDependency;
+
+ public static String DependenciesComposite_action_selectExclusion;
+
+ public static String DependenciesComposite_action_showgroupid;
+
+ public static String DependenciesComposite_action_showInheritedDependencies;
+
+ public static String DependenciesComposite_action_sortAlphabetically;
+
+ public static String DependenciesComposite_btnOptional;
+
+ public static String DependenciesComposite_btnSelect;
+
+ public static String DependenciesComposite_checkConsoleForErrors;
+
+ public static String DependenciesComposite_error;
+
+ public static String DependenciesComposite_fixProjectErrors;
+
+ public static String DependenciesComposite_lblArtifactId;
+
+ public static String DependenciesComposite_lblClassifier;
+
+ public static String DependenciesComposite_lblExclusionArtifactId;
+
+ public static String DependenciesComposite_lblExclusionGroupId;
+
+ public static String DependenciesComposite_lblGroupId;
+
+ public static String DependenciesComposite_lblScope;
+
+ public static String DependenciesComposite_lblSystemPath;
+
+ public static String DependenciesComposite_lblType;
+
+ public static String DependenciesComposite_lblVersion;
+
+ public static String DependenciesComposite_manageButton;
+
+ public static String DependenciesComposite_searchDialog_selectExclusion;
+
+ public static String DependenciesComposite_searchDialog_title;
+
+ public static String DependenciesComposite_searchTitle_addExclusion;
+
+ public static String DependenciesComposite_section_dependency_details;
+
+ public static String DependenciesComposite_section_ExclusionDetails;
+
+ public static String DependenciesComposite_sectionDependencies;
+
+ public static String DependenciesComposite_sectionDependencyManagement;
+
+ public static String DependenciesComposite_sectionExclusions;
+
+ public static String DependenciesPage_find;
+
+ public static String DependenciesPage_form;
+
+ public static String DependenciesPage_title;
+
+ public static String DependencyTreePage_0;
+
+ public static String DependencyTreePage_action_collapseAll;
+
+ public static String DependencyTreePage_action_expandAll;
+
+ public static String DependencyTreePage_action_filter;
+
+ public static String DependencyTreePage_action_filterSearch;
+
+ public static String DependencyTreePage_action_refresh;
+
+ public static String DependencyTreePage_action_showGroupId;
+
+ public static String DependencyTreePage_action_sort;
+
+ public static String DependencyTreePage_classpath;
+
+ public static String DependencyTreePage_find;
+
+ public static String DependencyTreePage_form_title;
+
+ public static String DependencyTreePage_job_loading;
+
+ public static String DependencyTreePage_job_reloading;
+
+ public static String DependencyTreePage_message_resolving;
+
+ public static String DependencyTreePage_message_updating;
+
+ public static String DependencyTreePage_scope_all;
+
+ public static String DependencyTreePage_scope_comp_runtime;
+
+ public static String DependencyTreePage_scope_compile;
+
+ public static String DependencyTreePage_scope_runtime;
+
+ public static String DependencyTreePage_section_hierarchy;
+
+ public static String DependencyTreePage_section_resolvedDeps;
+
+ public static String DependencyTreePage_title;
+
+ public static String FormUtils_click_for_details;
+
+ public static String FormUtils_error_info;
+
+ public static String FormUtils_pom_error;
+
+ public static String LifecyclePage_btnAdd;
+
+ public static String LifecyclePage_btnDisable;
+
+ public static String LifecyclePage_btnEdit;
+
+ public static String LifecyclePage_btnEnable;
+
+ public static String LifecyclePage_btnRemove;
+
+ public static String LifecyclePage_column_incremental;
+
+ public static String LifecyclePage_column_name;
+
+ public static String LifecyclePage_form_name;
+
+ public static String LifecyclePage_job_reloading;
+
+ public static String LifecyclePage_message_updating;
+
+ public static String LifecyclePage_scrolledForm;
+
+ public static String LifecyclePage_section_details;
+
+ public static String LifecyclePage_section_mapping;
+
+ public static String ListEditorComposite_btnAdd;
+
+ public static String ListEditorComposite_btnCreate;
+
+ public static String ListEditorComposite_btnRemove;
+
+ public static String ListEditorComposite_btnProperties;
+
+ public static String MavenPomEditor_action_advanced;
+
+ public static String MavenPomEditor_effective;
+
+ public static String MavenPomEditor_effective_pom;
+
+ public static String MavenPomEditor_error_failed_effective;
+
+ public static String MavenPomEditor_error_loading_effective_pom;
+
+ public static String MavenPomEditor_job_disposing;
+
+ public static String MavenPomEditor_job_saving;
+
+ public static String MavenPomEditor_loading;
+
+ public static String MavenPomEditor_task_reading;
+
+ public static String MavenPomEditorPage_actio_refresh;
+
+ public static String MavenPomEditorPage_action_open;
+
+ public static String MavenPomEditorPage_error_unknown;
+
+ public static String MavenPomEditorPage_job_opening;
+
+ public static String OverviewPage_action_new_module_project;
+
+ public static String OverviewPage_action_newModuleElement;
+
+ public static String OverviewPage_action_selectParent;
+
+ public static String OverviewPage_form;
+
+ public static String OverviewPage_job;
+
+ public static String OverviewPage_job_open;
+
+ public static String OverviewPage_lblArtifactId;
+
+ public static String OverviewPage_lblConnection;
+
+ public static String OverviewPage_lblDesc;
+
+ public static String OverviewPage_lblDev;
+
+ public static String OverviewPage_lblGroupId;
+
+ public static String OverviewPage_lblGroupId2;
+
+ public static String OverviewPage_lblInception;
+
+ public static String OverviewPage_lblName;
+
+ public static String OverviewPage_lblPackaging;
+
+ public static String OverviewPage_lblRelPath;
+
+ public static String OverviewPage_lblSystem;
+
+ public static String OverviewPage_lblTag;
+
+ public static String OverviewPage_lblUrl;
+
+ public static String OverviewPage_lblVersion;
+
+ public static String OverviewPage_lblVersion2;
+
+ public static String OverviewPage_msg_not_pom_packaging;
+
+ public static String OverviewPage_opening_editors;
+
+ public static String OverviewPage_searchDialog_selectParent;
+
+ public static String OverviewPage_section_artifact;
+
+ public static String OverviewPage_section_ci;
+
+ public static String OverviewPage_section_issueMan;
+
+ public static String OverviewPage_section_modules;
+
+ public static String OverviewPage_section_org;
+
+ public static String OverviewPage_section_parent;
+
+ public static String OverviewPage_section_project;
+
+ public static String OverviewPage_section_scm;
+
+ public static String OverviewPage_selectModuleProjects;
+
+ public static String OverviewPage_title;
+
+ public static String OverviewPage_updateModulePoms;
+
+ public static String PluginsComposite_action_Filter;
+
+ public static String PluginsComposite_action_openWeb;
+
+ public static String PluginsComposite_action_openXml;
+
+ public static String PluginsComposite_action_other;
+
+ public static String PluginsComposite_action_selectPlugin;
+
+ public static String PluginsComposite_action_showGroupId;
+
+ public static String PluginsComposite_btnExtensions;
+
+ public static String PluginsComposite_btnInherited;
+
+ public static String PluginsComposite_lblArtifactId;
+
+ public static String PluginsComposite_lblGoals;
+
+ public static String PluginsComposite_lblGroupId;
+
+ public static String PluginsComposite_lblId;
+
+ public static String PluginsComposite_lblPhase;
+
+ public static String PluginsComposite_lblVersion;
+
+ public static String PluginsComposite_linkConfiguration;
+
+ public static String PluginsComposite_seachDialog_selectPlugin;
+
+ public static String PluginsComposite_searchDialog_addPlugin;
+
+ public static String PluginsComposite_searchDialog_selectPlugin;
+
+ public static String PluginsComposite_section_configuration;
+
+ public static String PluginsComposite_section_executionDetails;
+
+ public static String PluginsComposite_section_Executions;
+
+ public static String PluginsComposite_section_pluginDetails;
+
+ public static String PluginsComposite_section_PluginDependencies;
+
+ public static String PluginsComposite_section_PluginManagent;
+
+ public static String PluginsComposite_section_Plugins;
+
+ public static String PluginsComposite_tooltip_addPlugin;
+
+ public static String PluginsPage_find;
+
+ public static String PluginsPage_form;
+
+ public static String PluginsPage_title;
+
+ public static String PomEditorMenuCreator_action_showDependencyHierarchy;
+
+ public static String ProfilesPage_action_newModuleProject;
+
+ public static String ProfilesPage_btnActivateByDefault;
+
+ public static String ProfilesPage_form;
+
+ public static String ProfilesPage_lblArchitecture;
+
+ public static String ProfilesPage_lblExists;
+
+ public static String ProfilesPage_lblFamily;
+
+ public static String ProfilesPage_lblJdk;
+
+ public static String ProfilesPage_lblMissing;
+
+ public static String ProfilesPage_lblName;
+
+ public static String ProfilesPage_lblValue;
+
+ public static String ProfilesPage_lblVersion;
+
+ public static String ProfilesPage_section_file;
+
+ public static String ProfilesPage_section_jdk;
+
+ public static String ProfilesPage_section_modules;
+
+ public static String ProfilesPage_section_os;
+
+ public static String ProfilesPage_section_profiles;
+
+ public static String ProfilesPage_section_property;
+
+ public static String ProfilesPage_tab_activation;
+
+ public static String ProfilesPage_tab_build;
+
+ public static String ProfilesPage_tab_dependencies;
+
+ public static String ProfilesPage_tab_plugins;
+
+ public static String ProfilesPage_tab_reporting;
+
+ public static String ProfilesPage_tab_repositories;
+
+ public static String ProfilesPage_title;
+
+ public static String PropertiesSection_section_properties;
+
+ public static String PropertiesSection_title_addProperty;
+
+ public static String PropertiesSection_title_editProperty;
+
+ public static String PropertyPairLabelProvider_0;
+
+ public static String ReportingComposite_action_filter;
+
+ public static String ReportingComposite_action_openWeb;
+
+ public static String ReportingComposite_action_selectReportingPlugin;
+
+ public static String ReportingComposite_action_showGroupId;
+
+ public static String ReportingComposite_btnExcludeDefaults;
+
+ public static String ReportingComposite_btnInherited;
+
+ public static String ReportingComposite_lblArtifactId;
+
+ public static String ReportingComposite_lblGroupId;
+
+ public static String ReportingComposite_lblOutputFolder;
+
+ public static String ReportingComposite_lblVersion;
+
+ public static String ReportingComposite_link_Configuration;
+
+ public static String ReportingComposite_searchDialog_addPlugin;
+
+ public static String ReportingComposite_searchDialog_selectPlugin;
+
+ public static String ReportingComposite_section_Content;
+
+ public static String ReportingComposite_section_reportingPluginDetails;
+
+ public static String ReportingComposite_section_reportSetReports;
+
+ public static String ReportingComposite_section_reportSets;
+
+ public static String ReportingComposite_sectionReportingPlugins;
+
+ public static String ReportingPage_find;
+
+ public static String ReportingPage_form;
+
+ public static String ReportingPage_title;
+
+ public static String RepositoriesComposite_btnEnableRelease;
+
+ public static String RepositoriesComposite_btnEnableSnapshots;
+
+ public static String RepositoriesComposite_btnUniqueVersion;
+
+ public static String RepositoriesComposite_lblArtifactid;
+
+ public static String RepositoriesComposite_lblChecksumPolicy;
+
+ public static String RepositoriesComposite_lblDownload;
+
+ public static String RepositoriesComposite_lblGroupId;
+
+ public static String RepositoriesComposite_lblId;
+
+ public static String RepositoriesComposite_lblLayout;
+
+ public static String RepositoriesComposite_lblMessage;
+
+ public static String RepositoriesComposite_lblName;
+
+ public static String RepositoriesComposite_lblRepoId;
+
+ public static String RepositoriesComposite_lblSiteId;
+
+ public static String RepositoriesComposite_lblUpdatePolicy;
+
+ public static String RepositoriesComposite_lblUrl;
+
+ public static String RepositoriesComposite_lblUrl2;
+
+ public static String RepositoriesComposite_lblVersion;
+
+ public static String RepositoriesComposite_section_pluginRepositories;
+
+ public static String RepositoriesComposite_section_projectSite;
+
+ public static String RepositoriesComposite_section_releaseDistRepo;
+
+ public static String RepositoriesComposite_section_repositories;
+
+ public static String RepositoriesComposite_section_repositoryDetails;
+
+ public static String RepositoriesComposite_section_snapshotDistRepo;
+
+ public static String RepositoriesComposite_sectionRelocation;
+
+ public static String RepositoriesPage_form;
+
+ public static String RepositoriesPage_title;
+
+ public static String SearchControl_lblSearch;
+
+ public static String ShowDependencyHierarchyAction_job_openPomEditor;
+
+ public static String TeamComposite_lblEmail;
+
+ public static String TeamComposite_lblId;
+
+ public static String TeamComposite_lblName;
+
+ public static String TeamComposite_lblTimezone;
+
+ public static String TeamComposite_lblUrl;
+
+ public static String TeamComposite_section_contributors;
+
+ public static String TeamComposite_section_developers;
+
+ public static String TeamComposite_section_organization;
+
+ public static String TeamComposite_section_roles;
+
+ public static String TeamComposite_section_userdetails;
+
+ public static String TeamPage_form;
+
+ public static String TeamPage_title;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/actions/PomEditorMenuCreator.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/actions/PomEditorMenuCreator.java
new file mode 100644
index 00000000..f2676969
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/actions/PomEditorMenuCreator.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.internal.actions;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.m2e.core.actions.AbstractMavenMenuCreator;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.internal.Messages;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class PomEditorMenuCreator extends AbstractMavenMenuCreator {
+
+ public void createMenu(IMenuManager mgr) {
+ int selectionType = SelectionUtil.getSelectionType(selection);
+ if(selectionType == SelectionUtil.JAR_FILE) {
+ mgr.appendToGroup(OPEN, getAction(new ShowDependencyHierarchyAction(), //
+ ShowDependencyHierarchyAction.ID,
+ Messages.PomEditorMenuCreator_action_showDependencyHierarchy, MavenEditorImages.HIERARCHY));
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/actions/ShowDependencyHierarchyAction.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/actions/ShowDependencyHierarchyAction.java
new file mode 100644
index 00000000..61ed4961
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/actions/ShowDependencyHierarchyAction.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.internal.actions;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.editor.pom.MavenPomEditor;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.actions.ActionDelegate;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class ShowDependencyHierarchyAction extends ActionDelegate {
+
+ public static final String ID = "org.eclipse.m2e.ShowDependencyHierarchy"; //$NON-NLS-1$
+
+ private IStructuredSelection selection;
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
+ } else {
+ this.selection = null;
+ }
+ }
+
+ public void run(IAction action) {
+ if(selection != null) {
+ Object element = this.selection.getFirstElement();
+ IMavenProjectFacade projectFacade = SelectionUtil.getType(element, IMavenProjectFacade.class);
+ if(projectFacade!=null) {
+ ArtifactKey artifactKey = SelectionUtil.getType(element, ArtifactKey.class);
+ if(artifactKey!=null) {
+ showDependencyHierarchy(projectFacade.getArtifactKey(), artifactKey);
+ }
+ }
+ }
+ }
+
+ private void showDependencyHierarchy(final ArtifactKey projectKey, final ArtifactKey artifactKey) {
+ if(artifactKey != null) {
+ new Job(Messages.ShowDependencyHierarchyAction_job_openPomEditor) {
+ protected IStatus run(IProgressMonitor monitor) {
+ final IEditorPart editor = OpenPomAction.openEditor(projectKey.getGroupId(), //
+ projectKey.getArtifactId(), projectKey.getVersion(), monitor);
+ if(editor instanceof MavenPomEditor) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ ((MavenPomEditor) editor).showDependencyHierarchy(artifactKey);
+ }
+ });
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/messages.properties b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/messages.properties
new file mode 100644
index 00000000..4b2f988b
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/messages.properties
@@ -0,0 +1,276 @@
+BuildComposite_btnFiltering=Filtering
+BuildComposite_lblDefaultGoal=Default Goal:
+BuildComposite_lblDirectory=Directory:
+BuildComposite_lblExcludes=Excludes:
+BuildComposite_lblFilters=Filters:
+BuildComposite_lblFinalName=Final Name:
+BuildComposite_lblIncludes=Includes:
+BuildComposite_lblTargetPath=Target Path:
+BuildComposite_section_build=Build
+BuildComposite_sectionResourceDetails=Resource Details
+BuildComposite_sectionResources=Resources
+BuildComposite_sectionTestResources=Test Resources
+BuildPage_action_addExtension=Add Extension
+BuildPage_action_openWeb=Open Web Page
+BuildPage_action_selectExtension=Select Extension
+BuildPage_action_showGroupId=Show GroupId
+BuildPage_form=Build
+BuildPage_lblArtifactId=Artifact Id:*
+BuildPage_lblGroupId=Group Id:*
+BuildPage_lblOutput=Output:
+BuildPage_lblScripts=Scripts:
+BuildPage_lblSources=Sources:
+BuildPage_lblTestOutput=Test Output:
+BuildPage_lblTestSources=Test Sources:
+BuildPage_lblVersion=Version:
+BuildPage_searchDialog_addExtension=Add Extension
+BuildPage_searchDialog_selectExtension=Select Extension
+BuildPage_section_extensionDetails=Extension Details
+BuildPage_section_extensions=Extensions
+BuildPage_section_folders=Folders
+BuildPage_title=Build
+CustomLifecycleParamsDialog_btnCopyFrom=Copy From
+CustomLifecycleParamsDialog_btnCreateEmpty=Create Empty
+DefaultPluginConfigurationEditor_lblUseXml=Use the XML tab to configure this plugin
+DependenciesComposite_action_filter=Filter
+DependenciesComposite_action_open_project_page=Open Project Page
+DependenciesComposite_action_selectDependency=Select Dependency
+DependenciesComposite_action_selectExclusion=Select Exclusion
+DependenciesComposite_action_showgroupid=Show GroupId
+DependenciesComposite_action_showInheritedDependencies=Show inherited dependencies
+DependenciesComposite_action_sortAlphabetically=Sort alphabetically
+DependenciesComposite_btnOptional=Optional
+DependenciesComposite_btnSelect=Select...
+DependenciesComposite_checkConsoleForErrors=Unable to read maven project. Check the console output for possible problems.
+DependenciesComposite_error=Error
+DependenciesComposite_fixProjectErrors=Unable to read project metadata. Please fix the project errors.
+DependenciesComposite_lblArtifactId=Artifact Id:
+DependenciesComposite_lblClassifier=Classifier:
+DependenciesComposite_lblExclusionArtifactId=Artifact Id:
+DependenciesComposite_lblExclusionGroupId=Group Id:
+DependenciesComposite_lblGroupId=Group Id:
+DependenciesComposite_lblScope=Scope:
+DependenciesComposite_lblSystemPath=System Path:
+DependenciesComposite_lblType=Type:
+DependenciesComposite_lblVersion=Version:
+DependenciesComposite_manageButton=Manage...
+DependenciesComposite_searchDialog_selectExclusion=Select Exclusion
+DependenciesComposite_searchDialog_title=Select Dependency
+DependenciesComposite_searchTitle_addExclusion=Add Exclusion
+DependenciesComposite_section_dependency_details=Dependency Details
+DependenciesComposite_section_ExclusionDetails=Exclusion Details
+DependenciesComposite_sectionDependencies=Dependencies
+DependenciesComposite_sectionDependencyManagement=Dependency Management
+DependenciesComposite_sectionExclusions=Exclusions
+DependenciesPage_find=Find
+DependenciesPage_form=Dependencies
+DependenciesPage_title=Dependencies
+DependencyTreePage_0=\ -
+DependencyTreePage_action_collapseAll=Collapse All
+DependencyTreePage_action_expandAll=Expand All
+DependencyTreePage_action_filter=Filter Search Results
+DependencyTreePage_action_filterSearch=Filter Search Results
+DependencyTreePage_action_refresh=Refresh
+DependencyTreePage_action_showGroupId=Show GroupId
+DependencyTreePage_action_sort=Sort
+DependencyTreePage_classpath=Classpath
+DependencyTreePage_find=Find
+DependencyTreePage_form_title=Dependency Hierarchy [{0}]
+DependencyTreePage_job_loading=Loading pom.xml
+DependencyTreePage_job_reloading=Reloading
+DependencyTreePage_message_resolving=Resolving dependencies...
+DependencyTreePage_message_updating=Updating dependencies...
+DependencyTreePage_scope_all=all (test)
+DependencyTreePage_scope_comp_runtime=compile+runtime
+DependencyTreePage_scope_compile=compile
+DependencyTreePage_scope_runtime=runtime
+DependencyTreePage_section_hierarchy=Dependency Hierarchy
+DependencyTreePage_section_resolvedDeps=Resolved Dependencies
+DependencyTreePage_title=Dependency Hierarchy
+FormUtils_click_for_details={0} (Click for more details)
+FormUtils_error_info=Error info:
+FormUtils_pom_error=The POM has the following error:
+LifecyclePage_btnAdd=Add
+LifecyclePage_btnDisable=Disable
+LifecyclePage_btnEdit=Edit...
+LifecyclePage_btnEnable=Enable
+LifecyclePage_btnRemove=Remove
+LifecyclePage_column_incremental=Incremental
+LifecyclePage_column_name=Name
+LifecyclePage_form_name=Lifecycle Mappings
+LifecyclePage_job_reloading=Reloading
+LifecyclePage_message_updating=Updating lifecycle mappings...
+LifecyclePage_scrolledForm=Lifecycle Mappings (experimental)
+LifecyclePage_section_details=Mapping Details
+LifecyclePage_section_mapping=Lifecycle Mapping
+ListEditorComposite_btnAdd=Add...
+ListEditorComposite_btnCreate=Create...
+ListEditorComposite_btnRemove=Remove
+ListEditorComposite_btnProperties=Properties...
+MavenPomEditor_action_advanced=Show Advanced Tabs
+MavenPomEditor_effective=\ [effective]
+MavenPomEditor_effective_pom=Effective POM
+MavenPomEditor_error_failed_effective=Failed to load Effective POM
+MavenPomEditor_error_loading_effective_pom=Unable to load Effective POM. See console for errors.
+MavenPomEditor_job_disposing=Disposing
+MavenPomEditor_job_saving=Saving
+MavenPomEditor_loading=Loading Effective POM...
+MavenPomEditor_task_reading=Reading project
+MavenPomEditorPage_actio_refresh=Refresh
+MavenPomEditorPage_action_open=Open Parent POM
+MavenPomEditorPage_error_unknown=Unknown error
+MavenPomEditorPage_job_opening=Opening POM
+OverviewPage_action_new_module_project=New module project
+OverviewPage_action_newModuleElement=New module element
+OverviewPage_action_selectParent=Select Parent
+OverviewPage_form=Overview
+OverviewPage_job=Opening {0}:{1}:{2}
+OverviewPage_job_open=Open Parent POM
+OverviewPage_lblArtifactId=Artifact Id:
+OverviewPage_lblConnection=Connection:
+OverviewPage_lblDesc=Description:
+OverviewPage_lblDev=Developer:
+OverviewPage_lblGroupId=Group Id:
+OverviewPage_lblGroupId2=Group Id:
+OverviewPage_lblInception=Inception:
+OverviewPage_lblName=Name:
+OverviewPage_lblPackaging=Packaging:
+OverviewPage_lblRelPath=Relative Path:
+OverviewPage_lblSystem=System:
+OverviewPage_lblTag=Tag:
+OverviewPage_lblUrl=URL:
+OverviewPage_lblVersion=Version:
+OverviewPage_lblVersion2=Version:
+OverviewPage_msg_not_pom_packaging=Only projects with 'pom' packaging can declare modules
+OverviewPage_opening_editors=Opening POM editors
+OverviewPage_searchDialog_selectParent=Select Parent
+OverviewPage_section_artifact=Artifact
+OverviewPage_section_ci=Continuous Integration
+OverviewPage_section_issueMan=Issue Management
+OverviewPage_section_modules=Modules
+OverviewPage_section_org=Organization
+OverviewPage_section_parent=Parent
+OverviewPage_section_project=Project
+OverviewPage_section_scm=SCM
+OverviewPage_selectModuleProjects=Select Module Projects
+OverviewPage_title=Overview
+OverviewPage_updateModulePoms=Update POM parent section in selected projects
+PluginsComposite_action_Filter=Filter
+PluginsComposite_action_openWeb=Open Web Page
+PluginsComposite_action_openXml=Open XML Configuration
+PluginsComposite_action_other=Other...
+PluginsComposite_action_selectPlugin=Select Plugin
+PluginsComposite_action_showGroupId=Show GroupId
+PluginsComposite_btnExtensions=Extensions
+PluginsComposite_btnInherited=Inherited
+PluginsComposite_lblArtifactId=Artifact Id:
+PluginsComposite_lblGoals=Goals:
+PluginsComposite_lblGroupId=Group Id:
+PluginsComposite_lblId=Id:
+PluginsComposite_lblPhase=Phase:
+PluginsComposite_lblVersion=Version:
+PluginsComposite_linkConfiguration=Configuration
+PluginsComposite_seachDialog_selectPlugin=Select Plugin
+PluginsComposite_searchDialog_addPlugin=Add Plugin
+PluginsComposite_searchDialog_selectPlugin=Select Plugin
+PluginsComposite_section_configuration=Configuration
+PluginsComposite_section_executionDetails=Execution Details
+PluginsComposite_section_Executions=Executions
+PluginsComposite_section_PluginDependencies=Plugin Dependencies
+PluginsComposite_section_pluginDetails=Plugin Details
+PluginsComposite_section_PluginManagent=Plugin Management
+PluginsComposite_section_Plugins=Plugins
+PluginsComposite_tooltip_addPlugin=Add Plugin
+PluginsPage_find=Find
+PluginsPage_form=Plugins
+PluginsPage_title=Plugins
+PomEditorMenuCreator_action_showDependencyHierarchy=Show Dependency Hierarchy
+ProfilesPage_action_newModuleProject=New module project
+ProfilesPage_btnActivateByDefault=Active by default
+ProfilesPage_form=Profiles
+ProfilesPage_lblArchitecture=Architecture:
+ProfilesPage_lblExists=Exist:
+ProfilesPage_lblFamily=Family:
+ProfilesPage_lblJdk=JDK:
+ProfilesPage_lblMissing=Missing:
+ProfilesPage_lblName=Name:
+ProfilesPage_lblValue=Value:
+ProfilesPage_lblVersion=Version:
+ProfilesPage_section_file=File
+ProfilesPage_section_jdk=JDK
+ProfilesPage_section_modules=Modules
+ProfilesPage_section_os=OS
+ProfilesPage_section_profiles=Profiles
+ProfilesPage_section_property=Property
+ProfilesPage_tab_activation=Activation
+ProfilesPage_tab_build=Build
+ProfilesPage_tab_dependencies=Dependencies
+ProfilesPage_tab_plugins=Plugins
+ProfilesPage_tab_reporting=Reporting
+ProfilesPage_tab_repositories=Repositories
+ProfilesPage_title=Profiles
+PropertiesSection_section_properties=Properties
+PropertiesSection_title_addProperty=Add property
+PropertiesSection_title_editProperty=Edit property
+PropertyPairLabelProvider_0={0} : {1}
+ReportingComposite_action_filter=Filter
+ReportingComposite_action_openWeb=Open Web Page
+ReportingComposite_action_selectReportingPlugin=Select Reporting Plugin
+ReportingComposite_action_showGroupId=Show GroupId
+ReportingComposite_btnExcludeDefaults=Exclude Defaults
+ReportingComposite_btnInherited=Inherited
+ReportingComposite_lblArtifactId=Artifact Id:
+ReportingComposite_lblGroupId=Group Id:
+ReportingComposite_lblOutputFolder=Output Folder:
+ReportingComposite_lblVersion=Version:
+ReportingComposite_link_Configuration=Configuration
+ReportingComposite_searchDialog_addPlugin=Add Plugin
+ReportingComposite_searchDialog_selectPlugin=Select Plugin
+ReportingComposite_section_Content=Content
+ReportingComposite_section_reportingPluginDetails=Reporting Plugin Details
+ReportingComposite_section_reportSetReports=Report Set Reports
+ReportingComposite_section_reportSets=Report Sets
+ReportingComposite_sectionReportingPlugins=Reporting Plugins
+ReportingPage_find=Find
+ReportingPage_form=Reporting
+ReportingPage_title=Reporting
+RepositoriesComposite_btnEnableRelease=Enable Releases
+RepositoriesComposite_btnEnableSnapshots=Enable Snapshots
+RepositoriesComposite_btnUniqueVersion=Unique Version
+RepositoriesComposite_lblArtifactid=Artifact Id:
+RepositoriesComposite_lblChecksumPolicy=Checksum Policy:
+RepositoriesComposite_lblDownload=Download:
+RepositoriesComposite_lblGroupId=Group Id:
+RepositoriesComposite_lblId=Id:*
+RepositoriesComposite_lblLayout=Layout:
+RepositoriesComposite_lblMessage=Message:
+RepositoriesComposite_lblName=Name:
+RepositoriesComposite_lblRepoId=Id:
+RepositoriesComposite_lblSiteId=Id:
+RepositoriesComposite_lblUpdatePolicy=Update Policy:
+RepositoriesComposite_lblUrl=URL:*
+RepositoriesComposite_lblUrl2=URL:
+RepositoriesComposite_lblVersion=Version:
+RepositoriesComposite_section_pluginRepositories=Plugin Repositories
+RepositoriesComposite_section_projectSite=Project Site
+RepositoriesComposite_section_releaseDistRepo=Release Distribution Repository
+RepositoriesComposite_section_repositories=Repositories
+RepositoriesComposite_section_repositoryDetails=Repository Details
+RepositoriesComposite_section_snapshotDistRepo=Snapshots Distribution Repository
+RepositoriesComposite_sectionRelocation=Relocation
+RepositoriesPage_form=Repositories
+RepositoriesPage_title=Repositories
+SearchControl_lblSearch=Search:
+ShowDependencyHierarchyAction_job_openPomEditor=Opening POM editor
+TeamComposite_lblEmail=Email:
+TeamComposite_lblId=Id:
+TeamComposite_lblName=Name:
+TeamComposite_lblTimezone=Timezone:
+TeamComposite_lblUrl=URL:
+TeamComposite_section_contributors=Contributors
+TeamComposite_section_developers=Developers
+TeamComposite_section_organization=Organization
+TeamComposite_section_roles=Roles
+TeamComposite_section_userdetails=Details
+TeamPage_form=Team
+TeamPage_title=Team
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/plugins/DefaultPluginConfigurationEditor.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/plugins/DefaultPluginConfigurationEditor.java
new file mode 100644
index 00000000..1574ec13
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/plugins/DefaultPluginConfigurationEditor.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.plugins;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.editor.pom.MavenPomEditorPage;
+import org.eclipse.m2e.model.edit.pom.Configuration;
+import org.eclipse.m2e.model.edit.pom.Plugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+public class DefaultPluginConfigurationEditor implements Adapter, IPluginConfigurationExtension {
+
+ protected Plugin plugin = null;
+ protected Configuration configuration = null;
+ protected MavenPomEditorPage pomEditor = null;
+ protected Notifier target;
+
+ public Composite createComposite(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(1, true));
+
+ Label label = new Label(composite, SWT.NONE);
+ label.setText(Messages.DefaultPluginConfigurationEditor_lblUseXml);
+ label.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false));
+ label.setEnabled(false);
+
+ return composite;
+ }
+
+ public void cleanup() {
+ if(this.configuration != null) {
+ this.configuration.eAdapters().remove(this);
+ this.configuration = null;
+ }
+ }
+
+ public void setPlugin(Plugin plugin) {
+ cleanup();
+ this.plugin = plugin;
+ this.configuration = plugin.getConfiguration();
+ if(this.configuration != null) {
+ this.configuration.eAdapters().add(this);
+ }
+ }
+
+ public void setPomEditor(MavenPomEditorPage editor) {
+ this.pomEditor = editor;
+ }
+
+ public Notifier getTarget() {
+ return target;
+ }
+
+ public void setTarget(Notifier newTarget) {
+ target = newTarget;
+ }
+
+ public boolean isAdapterForType(Object type) {
+ return DefaultPluginConfigurationEditor.class.equals(type);
+ }
+
+ public void notifyChanged(Notification notification) {
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/plugins/IPluginConfigurationExtension.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/plugins/IPluginConfigurationExtension.java
new file mode 100644
index 00000000..6d0905ef
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/plugins/IPluginConfigurationExtension.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.plugins;
+
+import org.eclipse.m2e.editor.pom.MavenPomEditorPage;
+import org.eclipse.m2e.model.edit.pom.Plugin;
+import org.eclipse.swt.widgets.Composite;
+
+public interface IPluginConfigurationExtension {
+ public void setPlugin(Plugin plugin);
+ public void setPomEditor(MavenPomEditorPage editor);
+ public Composite createComposite(Composite parent);
+ public void cleanup();
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/plugins/PluginExtensionDescriptor.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/plugins/PluginExtensionDescriptor.java
new file mode 100644
index 00000000..3520034b
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/plugins/PluginExtensionDescriptor.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.plugins;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+
+public class PluginExtensionDescriptor {
+ public static final String ARTIFACT_ID = "artifactId"; //$NON-NLS-1$
+ public static final String GROUP_ID = "groupId"; //$NON-NLS-1$
+ public static final String NAME = "name"; //$NON-NLS-1$
+
+ private String artifactId;
+ private String groupId;
+ private String name;
+
+ private IPluginConfigurationExtension extension = null;
+
+ public PluginExtensionDescriptor(IConfigurationElement element) {
+ artifactId = element.getAttribute(ARTIFACT_ID);
+ groupId = element.getAttribute(GROUP_ID);
+ name = element.getAttribute(NAME);
+
+ Object o;
+ try {
+ o = element.createExecutableExtension(AbstractProjectConfigurator.ATTR_CLASS);
+ extension = (IPluginConfigurationExtension) o;
+ } catch(CoreException e) {
+ // TODO Auto-generated catch block
+ MavenLogger.log(e);
+ }
+ }
+
+ public void setArtifactId(String artifactId) {
+ this.artifactId = artifactId;
+ }
+ public String getArtifactId() {
+ return artifactId;
+ }
+ public void setGroupId(String groupId) {
+ this.groupId = groupId;
+ }
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public String toString() {
+ return groupId + ':' + artifactId;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public IPluginConfigurationExtension getExtension() {
+ return extension;
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/BuildPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/BuildPage.java
new file mode 100644
index 00000000..cbb5e643
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/BuildPage.java
@@ -0,0 +1,604 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import static org.eclipse.m2e.editor.pom.FormUtils.nvl;
+import static org.eclipse.m2e.editor.pom.FormUtils.setText;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.window.Window;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.actions.OpenUrlAction;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.ui.dialogs.MavenRepositorySearchDialog;
+import org.eclipse.m2e.core.util.ProposalUtil;
+import org.eclipse.m2e.core.util.search.Packaging;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.composites.BuildComposite;
+import org.eclipse.m2e.editor.composites.DependencyLabelProvider;
+import org.eclipse.m2e.editor.composites.ListEditorComposite;
+import org.eclipse.m2e.editor.composites.ListEditorContentProvider;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.model.edit.pom.Build;
+import org.eclipse.m2e.model.edit.pom.BuildBase;
+import org.eclipse.m2e.model.edit.pom.Extension;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class BuildPage extends MavenPomEditorPage {
+
+ // controls
+ Text extensionGroupIdText;
+ Text sourceText;
+ Text outputText;
+ Text testSourceText;
+ Text testOutputText;
+ Text scriptsSourceText;
+
+ ListEditorComposite<Extension> extensionsEditor;
+ BuildComposite buildComposite;
+ Text extensionArtifactIdText;
+ Text extensionVersionText;
+ Button extensionSelectButton;
+ Section foldersSection;
+ Section extensionsSection;
+ Section extensionDetailsSection;
+
+ Extension currentExtension;
+ protected boolean expandingTopSections;
+ private Action extensionSelectAction;
+ private Action extensionAddAction;
+ private Action openWebPageAction;
+
+
+ public BuildPage(MavenPomEditor pomEditor) {
+ super(pomEditor, IMavenConstants.PLUGIN_ID + ".pom.build", Messages.BuildPage_title); //$NON-NLS-1$
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ FormToolkit toolkit = managedForm.getToolkit();
+ ScrolledForm form = managedForm.getForm();
+ form.setText(Messages.BuildPage_form);
+ // form.setExpandHorizontal(true);
+
+ Composite body = form.getBody();
+ GridLayout gridLayout = new GridLayout(3, true);
+ gridLayout.horizontalSpacing = 3;
+ body.setLayout(gridLayout);
+ toolkit.paintBordersFor(body);
+
+ SashForm buildSash = new SashForm(body, SWT.NONE);
+ buildSash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 3, 1));
+ GridLayout buildSashLayout = new GridLayout();
+ buildSashLayout.horizontalSpacing = 3;
+ buildSashLayout.marginWidth = 0;
+ buildSashLayout.marginHeight = 0;
+ buildSashLayout.numColumns = 3;
+ buildSash.setLayout(buildSashLayout);
+ toolkit.adapt(buildSash);
+
+ createFoldersSection(buildSash, toolkit);
+ createExtensionsSection(buildSash, toolkit);
+ createExtensionDetailsSection(buildSash, toolkit);
+
+ buildComposite = new BuildComposite(body, SWT.NONE);
+ GridData buildCompositeData = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1);
+ buildCompositeData.heightHint = 270;
+ buildComposite.setLayoutData(buildCompositeData);
+ toolkit.adapt(buildComposite);
+
+// form.pack();
+
+ super.createFormContent(managedForm);
+ }
+
+ private void createFoldersSection(Composite buildSash, FormToolkit toolkit) {
+ foldersSection = toolkit.createSection(buildSash, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ foldersSection.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ foldersSection.setText(Messages.BuildPage_section_folders);
+ foldersSection.addExpansionListener(new ExpansionAdapter() {
+ public void expansionStateChanged(ExpansionEvent e) {
+ if(!expandingTopSections) {
+ expandingTopSections = true;
+ extensionsSection.setExpanded(foldersSection.isExpanded());
+ extensionDetailsSection.setExpanded(foldersSection.isExpanded());
+ expandingTopSections = false;
+ }
+ }
+ });
+
+ Composite composite = toolkit.createComposite(foldersSection, SWT.NONE);
+ GridLayout compositeLayout = new GridLayout(2, false);
+ compositeLayout.marginWidth = 2;
+ compositeLayout.marginHeight = 2;
+ composite.setLayout(compositeLayout);
+ toolkit.paintBordersFor(composite);
+ foldersSection.setClient(composite);
+
+ toolkit.createLabel(composite, Messages.BuildPage_lblSources, SWT.NONE);
+
+ sourceText = toolkit.createText(composite, null, SWT.NONE);
+ sourceText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ toolkit.createLabel(composite, Messages.BuildPage_lblOutput, SWT.NONE);
+
+ outputText = toolkit.createText(composite, null, SWT.NONE);
+ outputText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ toolkit.createLabel(composite, Messages.BuildPage_lblTestSources, SWT.NONE);
+
+ testSourceText = toolkit.createText(composite, null, SWT.NONE);
+ testSourceText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ toolkit.createLabel(composite, Messages.BuildPage_lblTestOutput, SWT.NONE);
+
+ testOutputText = toolkit.createText(composite, null, SWT.NONE);
+ testOutputText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ toolkit.createLabel(composite, Messages.BuildPage_lblScripts, SWT.NONE);
+
+ scriptsSourceText = toolkit.createText(composite, null, SWT.NONE);
+ scriptsSourceText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ }
+
+ private void createExtensionsSection(Composite buildSash, FormToolkit toolkit) {
+ extensionsSection = toolkit.createSection(buildSash, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ extensionsSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ extensionsSection.setText(Messages.BuildPage_section_extensions);
+ extensionsSection.addExpansionListener(new ExpansionAdapter() {
+ public void expansionStateChanged(ExpansionEvent e) {
+ if(!expandingTopSections) {
+ expandingTopSections = true;
+ foldersSection.setExpanded(extensionsSection.isExpanded());
+ extensionDetailsSection.setExpanded(extensionsSection.isExpanded());
+ expandingTopSections = false;
+ }
+ }
+ });
+
+ extensionsEditor = new ListEditorComposite<Extension>(extensionsSection, SWT.NONE);
+ toolkit.paintBordersFor(extensionsEditor);
+ toolkit.adapt(extensionsEditor);
+ extensionsSection.setClient(extensionsEditor);
+
+ final DependencyLabelProvider labelProvider = new DependencyLabelProvider();
+ extensionsEditor.setLabelProvider(labelProvider);
+ extensionsEditor.setContentProvider(new ListEditorContentProvider<Extension>());
+
+ extensionsEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<Extension> selection = extensionsEditor.getSelection();
+ updateExtensionDetails(selection.size()==1 ? selection.get(0) : null);
+ }
+ });
+
+ extensionsEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ createExtension(null, null, null);
+ }
+ });
+
+ extensionsEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = getEditingDomain();
+
+ List<Extension> list = extensionsEditor.getSelection();
+ for(Extension extension : list) {
+ Command removeCommand = RemoveCommand.create(editingDomain, model.getBuild(), //
+ POM_PACKAGE.getBuild_Extensions(), extension);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ updateExtensionDetails(null);
+ }
+ });
+
+ extensionAddAction = new Action(Messages.BuildPage_action_addExtension, MavenEditorImages.ADD_ARTIFACT) {
+ public void run() {
+ // XXX calculate list available extensions
+ Set<ArtifactKey> artifacts = Collections.emptySet();
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getEditorSite().getShell(), //
+ Messages.BuildPage_searchDialog_addExtension, IIndex.SEARCH_ARTIFACT, artifacts);
+ if(dialog.open() == Window.OK) {
+ IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+ if(af != null) {
+ createExtension(af.group, af.artifact, af.version);
+ }
+ }
+ }
+ };
+ extensionAddAction.setEnabled(false);
+
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+ toolBarManager.add(extensionAddAction);
+ toolBarManager.add(new Separator());
+
+ toolBarManager.add(new Action(Messages.BuildPage_action_showGroupId, MavenEditorImages.SHOW_GROUP) {
+ {
+ setChecked(true);
+ }
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+ public void run() {
+ labelProvider.setShowGroupId(isChecked());
+ extensionsEditor.getViewer().refresh();
+ }
+ });
+
+ Composite toolbarComposite = toolkit.createComposite(extensionsSection);
+ GridLayout toolbarLayout = new GridLayout(1, true);
+ toolbarLayout.marginHeight = 0;
+ toolbarLayout.marginWidth = 0;
+ toolbarComposite.setLayout(toolbarLayout);
+ toolbarComposite.setBackground(null);
+
+ toolBarManager.createControl(toolbarComposite);
+ extensionsSection.setTextClient(toolbarComposite);
+ }
+
+ private void createExtensionDetailsSection(Composite buildSash, FormToolkit toolkit) {
+ extensionDetailsSection = toolkit.createSection(buildSash, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ extensionDetailsSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ extensionDetailsSection.setText(Messages.BuildPage_section_extensionDetails);
+ extensionDetailsSection.addExpansionListener(new ExpansionAdapter() {
+ public void expansionStateChanged(ExpansionEvent e) {
+ if(!expandingTopSections) {
+ expandingTopSections = true;
+ foldersSection.setExpanded(extensionDetailsSection.isExpanded());
+ extensionsSection.setExpanded(extensionDetailsSection.isExpanded());
+ expandingTopSections = false;
+ }
+ }
+ });
+
+ Composite extensionDetialsComposite = toolkit.createComposite(extensionDetailsSection, SWT.NONE);
+ GridLayout extensionDetialsCompositeLayout = new GridLayout(2, false);
+ extensionDetialsCompositeLayout.marginWidth = 2;
+ extensionDetialsCompositeLayout.marginHeight = 2;
+ extensionDetialsComposite.setLayout(extensionDetialsCompositeLayout);
+ toolkit.paintBordersFor(extensionDetialsComposite);
+ extensionDetailsSection.setClient(extensionDetialsComposite);
+
+ toolkit.createLabel(extensionDetialsComposite, Messages.BuildPage_lblGroupId);
+
+ extensionGroupIdText = toolkit.createText(extensionDetialsComposite, null, SWT.FLAT);
+ extensionGroupIdText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ extensionGroupIdText.setData("name", "extensionGroupIdText"); //$NON-NLS-1$ //$NON-NLS-2$
+ ProposalUtil.addGroupIdProposal(getProject(), extensionGroupIdText, Packaging.ALL);
+
+ Hyperlink extensionArtifactIdHyperlink = toolkit.createHyperlink(extensionDetialsComposite, Messages.BuildPage_lblArtifactId, SWT.NONE);
+ extensionArtifactIdHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ final String groupId = extensionGroupIdText.getText();
+ final String artifactId = extensionArtifactIdText.getText();
+ final String version = extensionVersionText.getText();
+ new Job("Opening " + groupId + ":" + artifactId + ":" + version) {
+ protected IStatus run(IProgressMonitor arg0) {
+ OpenPomAction.openEditor(groupId, artifactId, version, null);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ });
+
+ extensionArtifactIdText = toolkit.createText(extensionDetialsComposite, null, SWT.FLAT);
+ extensionArtifactIdText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+ extensionArtifactIdText.setData("name", "extensionArtifactIdText"); //$NON-NLS-1$ //$NON-NLS-2$
+ ProposalUtil.addArtifactIdProposal(getProject(), extensionGroupIdText, extensionArtifactIdText, Packaging.ALL);
+
+ toolkit.createLabel(extensionDetialsComposite, Messages.BuildPage_lblVersion);
+
+ extensionVersionText = toolkit.createText(extensionDetialsComposite, null, SWT.FLAT);
+ extensionVersionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ extensionVersionText.setData("name", "extensionVersionText"); //$NON-NLS-1$ //$NON-NLS-2$
+ ProposalUtil.addVersionProposal(getProject(), extensionGroupIdText, extensionArtifactIdText, extensionVersionText, Packaging.ALL);
+ extensionDetialsComposite.setTabList(new Control[] {extensionGroupIdText, extensionArtifactIdText, extensionVersionText});
+
+// extensionSelectButton = toolkit.createButton(extensionDetialsComposite, "Select...", SWT.FLAT);
+// extensionSelectButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 2, 1));
+// extensionSelectButton.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent e) {
+// // TODO calculate current list of artifacts for the project
+// Set<Dependency> artifacts = Collections.emptySet();
+// MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getEditorSite().getShell(), //
+// "Add Dependency", IndexManager.SEARCH_ARTIFACT, artifacts);
+// if(dialog.open() == Window.OK) {
+// IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+// if(af != null) {
+// extensionGroupIdText.setText(nvl(af.group));
+// extensionArtifactIdText.setText(nvl(af.artifact));
+// extensionVersionText.setText(nvl(af.version));
+// }
+// }
+// }
+// });
+
+ extensionSelectAction = new Action(Messages.BuildPage_action_selectExtension, MavenEditorImages.SELECT_ARTIFACT) {
+ public void run() {
+ // XXX calculate list available extensions
+ Set<ArtifactKey> artifacts = Collections.emptySet();
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getEditorSite().getShell(), //
+ Messages.BuildPage_searchDialog_selectExtension, IIndex.SEARCH_ARTIFACT, artifacts);
+ if(dialog.open() == Window.OK) {
+ IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+ if(af != null) {
+ extensionGroupIdText.setText(nvl(af.group));
+ extensionArtifactIdText.setText(nvl(af.artifact));
+ extensionVersionText.setText(nvl(af.version));
+ }
+ }
+ }
+ };
+ extensionSelectAction.setEnabled(false);
+
+ openWebPageAction = new Action(Messages.BuildPage_action_openWeb, MavenEditorImages.WEB_PAGE) {
+ public void run() {
+ final String groupId = extensionGroupIdText.getText();
+ final String artifactId = extensionArtifactIdText.getText();
+ final String version = extensionVersionText.getText();
+ new Job("Opening " + groupId + ":" + artifactId + ":" + version) {
+ protected IStatus run(IProgressMonitor monitor) {
+ OpenUrlAction.openBrowser(OpenUrlAction.ID_PROJECT, groupId, artifactId, version, monitor);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+
+ }
+ };
+ openWebPageAction.setEnabled(false);
+
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+ toolBarManager.add(extensionSelectAction);
+ toolBarManager.add(new Separator());
+ toolBarManager.add(openWebPageAction);
+
+ Composite toolbarComposite = toolkit.createComposite(extensionDetailsSection);
+ GridLayout toolbarLayout = new GridLayout(1, true);
+ toolbarLayout.marginHeight = 0;
+ toolbarLayout.marginWidth = 0;
+ toolbarComposite.setLayout(toolbarLayout);
+ toolbarComposite.setBackground(null);
+
+ toolBarManager.createControl(toolbarComposite);
+ extensionDetailsSection.setTextClient(toolbarComposite);
+ }
+
+ public void loadData() {
+ loadBuild();
+ loadBuildBase();
+
+ extensionsEditor.setReadOnly(isReadOnly());
+
+ updateExtensionDetails(null);
+ }
+
+ void updateExtensionDetails(Extension extension) {
+ currentExtension = extension;
+
+ removeNotifyListener(extensionGroupIdText);
+ removeNotifyListener(extensionArtifactIdText);
+ removeNotifyListener(extensionVersionText);
+
+ if(extension==null) {
+ FormUtils.setEnabled(extensionDetailsSection, false);
+ extensionSelectAction.setEnabled(false);
+ openWebPageAction.setEnabled(false);
+
+ setText(extensionGroupIdText, ""); //$NON-NLS-1$
+ setText(extensionArtifactIdText, ""); //$NON-NLS-1$
+ setText(extensionVersionText, ""); //$NON-NLS-1$
+
+ return;
+ }
+
+ FormUtils.setEnabled(extensionDetailsSection, true);
+ FormUtils.setReadonly(extensionDetailsSection, isReadOnly());
+ extensionSelectAction.setEnabled(!isReadOnly());
+ openWebPageAction.setEnabled(true);
+
+ setText(extensionGroupIdText, extension.getGroupId());
+ setText(extensionArtifactIdText, extension.getArtifactId());
+ setText(extensionVersionText, extension.getVersion());
+
+ ValueProvider<Extension> extensionProvider = new ValueProvider.DefaultValueProvider<Extension>(extension);
+ setModifyListener(extensionGroupIdText, extensionProvider, POM_PACKAGE.getExtension_GroupId(), ""); //$NON-NLS-1$
+ setModifyListener(extensionArtifactIdText, extensionProvider, POM_PACKAGE.getExtension_ArtifactId(), ""); //$NON-NLS-1$
+ setModifyListener(extensionVersionText, extensionProvider, POM_PACKAGE.getExtension_Version(), ""); //$NON-NLS-1$
+
+ registerListeners();
+ }
+
+ private void loadBuild() {
+ removeNotifyListener(sourceText);
+ removeNotifyListener(outputText);
+ removeNotifyListener(testSourceText);
+ removeNotifyListener(testOutputText);
+ removeNotifyListener(scriptsSourceText);
+
+ Build build = model == null ? null : model.getBuild();
+ if(build==null) {
+ setText(sourceText, ""); //$NON-NLS-1$
+ setText(outputText, ""); //$NON-NLS-1$
+ setText(testSourceText, ""); //$NON-NLS-1$
+ setText(testOutputText, ""); //$NON-NLS-1$
+ setText(scriptsSourceText, ""); //$NON-NLS-1$
+
+ extensionsEditor.setInput(null);
+
+ } else {
+ setText(sourceText, build.getSourceDirectory());
+ setText(outputText, build.getOutputDirectory());
+ setText(testSourceText, build.getTestSourceDirectory());
+ setText(testOutputText, build.getTestOutputDirectory());
+ setText(scriptsSourceText, build.getScriptSourceDirectory());
+
+ extensionsEditor.setInput(build.getExtensions() == null ? null : build.getExtensions());
+ }
+
+ FormUtils.setReadonly(foldersSection, isReadOnly());
+ FormUtils.setReadonly(extensionsSection, isReadOnly());
+ extensionAddAction.setEnabled(!isReadOnly());
+
+ updateExtensionDetails(null);
+
+ ValueProvider<Build> modelProvider = new ValueProvider.ParentValueProvider<Build>(sourceText, outputText, testSourceText, testOutputText, scriptsSourceText) {
+ public Build getValue() {
+ return model.getBuild();
+ }
+ public Build create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ Build build = model.getBuild();
+ if(build==null) {
+ build = PomFactory.eINSTANCE.createBuild();
+ Command command = SetCommand.create(editingDomain, model, POM_PACKAGE.getModel_Build(), build);
+ compoundCommand.append(command);
+ }
+ return build;
+ }
+ };
+ setModifyListener(sourceText, modelProvider, POM_PACKAGE.getBuild_SourceDirectory(), ""); //$NON-NLS-1$
+ setModifyListener(outputText, modelProvider, POM_PACKAGE.getBuild_OutputDirectory(), ""); //$NON-NLS-1$
+ setModifyListener(testSourceText, modelProvider, POM_PACKAGE.getBuild_TestSourceDirectory(), ""); //$NON-NLS-1$
+ setModifyListener(testOutputText, modelProvider, POM_PACKAGE.getBuild_TestOutputDirectory(), ""); //$NON-NLS-1$
+ setModifyListener(scriptsSourceText, modelProvider, POM_PACKAGE.getBuild_ScriptSourceDirectory(), ""); //$NON-NLS-1$
+
+ loadBuildBase();
+ }
+
+ private void loadBuildBase() {
+ ValueProvider<BuildBase> buildProvider = new ValueProvider<BuildBase>() {
+ public Build getValue() {
+ return model.getBuild();
+ }
+ public Build create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ Build build = PomFactory.eINSTANCE.createBuild();
+ Command command = SetCommand.create(editingDomain, model, POM_PACKAGE.getModel_Build(), build);
+ compoundCommand.append(command);
+ return build;
+ }
+ };
+ buildComposite.loadData(this, buildProvider);
+ }
+
+ protected void doUpdate(Notification notification){
+ EObject object = (EObject) notification.getNotifier();
+ Object feature = notification.getFeature();
+ if (object instanceof Build) {
+ loadBuild();
+ }
+ if (object instanceof BuildBase) {
+ loadBuildBase();
+ }
+
+ if (feature == PomPackage.Literals.BUILD__EXTENSIONS) {
+ extensionsEditor.refresh();
+ }
+
+ if (object instanceof Extension) {
+ extensionsEditor.refresh();
+ if(currentExtension==object) {
+ updateExtensionDetails(currentExtension);
+ }
+ }
+
+ if(buildComposite!=null) {
+ buildComposite.updateView(this, notification);
+ }
+ }
+
+ public void updateView(final Notification notification) {
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run(){
+ doUpdate(notification);
+ }
+ });
+ }
+
+ void createExtension(String groupId, String artifactId, String version) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = getEditingDomain();
+
+ Build build = model.getBuild();
+ if(build == null) {
+ build = PomFactory.eINSTANCE.createBuild();
+ Command command = SetCommand.create(editingDomain, model, POM_PACKAGE.getModel_Build(), build);
+ compoundCommand.append(command);
+ }
+
+ Extension extension = PomFactory.eINSTANCE.createExtension();
+ extension.setGroupId(groupId);
+ extension.setArtifactId(artifactId);
+ extension.setVersion(version);
+
+ Command addCommand = AddCommand.create(editingDomain, build, //
+ POM_PACKAGE.getBuild_Extensions(), extension);
+ compoundCommand.append(addCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ extensionsEditor.setSelection(Collections.singletonList(extension));
+ extensionGroupIdText.setFocus();
+ }
+}
+
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependenciesPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependenciesPage.java
new file mode 100644
index 00000000..08347b0c
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependenciesPage.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.editor.composites.DependenciesComposite;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.model.edit.pom.DependencyManagement;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class DependenciesPage extends MavenPomEditorPage {
+
+ private DependenciesComposite dependenciesComposite;
+ private SearchControl searchControl;
+
+ public DependenciesPage(MavenPomEditor pomEditor) {
+ super(pomEditor, IMavenConstants.PLUGIN_ID + ".pom.dependencies", Messages.DependenciesPage_title); //$NON-NLS-1$
+ }
+
+ public void dispose() {
+ if(dependenciesComposite!=null) {
+ dependenciesComposite.dispose();
+ }
+ super.dispose();
+ }
+
+ public void setActive(boolean active) {
+ super.setActive(active);
+ if(active) {
+ dependenciesComposite.setSearchControl(searchControl);
+ searchControl.getSearchText().setEditable(true);
+ }
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ FormToolkit toolkit = managedForm.getToolkit();
+
+ ScrolledForm form = managedForm.getForm();
+ form.setText(Messages.DependenciesPage_form);
+
+ form.getBody().setLayout(new GridLayout(1, true));
+
+ dependenciesComposite = new DependenciesComposite(form.getBody(), this, SWT.NONE, pomEditor);
+ dependenciesComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ toolkit.adapt(dependenciesComposite);
+
+ searchControl = new SearchControl(Messages.DependenciesPage_find, managedForm);
+
+ IToolBarManager pageToolBarManager = form.getForm().getToolBarManager();
+ pageToolBarManager.add(searchControl);
+ pageToolBarManager.add(new Separator());
+
+ form.updateToolBar();
+
+// form.pack();
+
+ super.createFormContent(managedForm);
+ }
+
+ public void loadData() {
+
+
+ ValueProvider<DependencyManagement> dependencyManagementProvider = new ValueProvider<DependencyManagement>() {
+ public DependencyManagement getValue() {
+ return model.getDependencyManagement();
+ }
+
+ public DependencyManagement create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ DependencyManagement management = model.getDependencyManagement();
+ if(management==null) {
+ management = PomFactory.eINSTANCE.createDependencyManagement();
+ Command command = SetCommand.create(editingDomain, model, //
+ POM_PACKAGE.getModel_DependencyManagement(), management);
+ compoundCommand.append(command);
+ }
+
+ return management;
+ }
+ };
+
+ dependenciesComposite.loadData(model, dependencyManagementProvider);
+ }
+
+ public void updateView(final Notification notification) {
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run(){
+ dependenciesComposite.updateView(DependenciesPage.this, notification);
+ }
+ });
+
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java
new file mode 100644
index 00000000..a3290031
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java
@@ -0,0 +1,1063 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.project.MavenProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.progress.UIJob;
+import org.sonatype.aether.graph.DependencyNode;
+import org.sonatype.aether.graph.DependencyVisitor;
+
+
+/**
+ * @author Eugene Kuleshov
+ * @author Benjamin Bentmann
+ */
+public class DependencyTreePage extends FormPage implements IMavenProjectChangedListener, IPomFileChangedListener {
+
+ protected static final Object[] EMPTY = new Object[0];
+
+ final MavenPomEditor pomEditor;
+
+ TreeViewer treeViewer;
+
+ TableViewer listViewer;
+
+ SearchControl searchControl;
+
+ SearchMatcher searchMatcher;
+
+ DependencyFilter searchFilter;
+
+ ListSelectionFilter listSelectionFilter;
+
+ ViewerFilter currentFilter;
+
+ ArrayList<DependencyNode> dependencyNodes = new ArrayList<DependencyNode>();
+
+ Color searchHighlightColor;
+
+ MavenProject mavenProject;
+
+ boolean isSettingSelection = false;
+
+ Action hierarchyFilterAction;
+
+ private Job dataLoadingJob;
+
+ String currentClasspath = Artifact.SCOPE_TEST;
+
+ public DependencyTreePage(MavenPomEditor pomEditor) {
+ super(pomEditor, IMavenConstants.PLUGIN_ID + ".pom.dependencyTree", Messages.DependencyTreePage_title); //$NON-NLS-1$
+ this.pomEditor = pomEditor;
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ MavenPlugin.getDefault().getMavenProjectManager().addMavenProjectChangedListener(this);
+
+ FormToolkit formToolkit = managedForm.getToolkit();
+
+ searchHighlightColor = new Color(Display.getDefault(), 242, 218, 170);
+
+ ScrolledForm form = managedForm.getForm();
+ form.setText(formatFormTitle());
+ form.setExpandHorizontal(true);
+ form.setExpandVertical(true);
+
+ Composite body = form.getBody();
+ body.setLayout(new FillLayout());
+
+ SashForm sashForm = new SashForm(body, SWT.NONE);
+ formToolkit.adapt(sashForm);
+ formToolkit.adapt(sashForm, true, true);
+
+ createHierarchySection(sashForm, formToolkit);
+
+ createListSection(sashForm, formToolkit);
+
+ sashForm.setWeights(new int[] {1, 1});
+
+ createSearchBar(managedForm);
+
+ // compatibility proxy to support Eclipse 3.2
+ FormUtils.decorateHeader(managedForm.getToolkit(), form.getForm());
+
+ initPopupMenu(treeViewer, ".tree"); //$NON-NLS-1$
+ initPopupMenu(listViewer, ".list"); //$NON-NLS-1$
+
+ loadData(false);
+ }
+
+ private void initPopupMenu(Viewer viewer, String id) {
+ MenuManager menuMgr = new MenuManager("#PopupMenu-" + id); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+
+ Menu menu = menuMgr.createContextMenu(viewer.getControl());
+
+ viewer.getControl().setMenu(menu);
+
+ getEditorSite().registerContextMenu(MavenPomEditor.EDITOR_ID + id, menuMgr, viewer, false);
+ }
+
+ String formatFormTitle() {
+ return NLS.bind(Messages.DependencyTreePage_form_title, currentClasspath);
+ }
+
+ void loadData(final boolean force) {
+ // form.setMessage() forces the panel layout, which messes up the viewers
+ // (e.g. long entries in the tree cause it to expand horizontally so much
+ // doesn't fit into the editor anymore). Clearing the input in the viewers
+ // helps to ensure they won't change the size when the message is set.
+ treeViewer.setInput(null);
+ listViewer.setInput(null);
+ FormUtils.setMessage(getManagedForm().getForm(), Messages.DependencyTreePage_message_resolving, IMessageProvider.WARNING);
+
+ dataLoadingJob = new Job(Messages.DependencyTreePage_job_loading) {
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ mavenProject = pomEditor.readMavenProject(force, monitor);
+ if(mavenProject == null){
+ MavenLogger.log("Unable to read maven project. Dependencies not updated.", null); //$NON-NLS-1$
+ return Status.CANCEL_STATUS;
+ }
+
+ final DependencyNode dependencyNode = pomEditor.readDependencyTree(force, currentClasspath, monitor);
+ if(dependencyNode == null) {
+ return Status.CANCEL_STATUS;
+ }
+ dependencyNode.accept(new DependencyVisitor() {
+ public boolean visitEnter(DependencyNode node) {
+ if(node.getDependency() != null) {
+ dependencyNodes.add(node);
+ }
+ return true;
+ }
+
+ public boolean visitLeave(DependencyNode dependencynode) {
+ return true;
+ }
+ });
+
+ getPartControl().getDisplay().syncExec(new Runnable() {
+ public void run() {
+ FormUtils.setMessage(getManagedForm().getForm(), null, IMessageProvider.NONE);
+ treeViewer.setInput(dependencyNode);
+ treeViewer.expandAll();
+ listViewer.setInput(mavenProject);
+ }
+ });
+ } catch(final CoreException ex) {
+ MavenLogger.log(ex);
+ getPartControl().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ FormUtils.setMessage(getManagedForm().getForm(), ex.getMessage(), IMessageProvider.ERROR);
+ }
+ });
+ }
+
+ return Status.OK_STATUS;
+ }
+ };
+ dataLoadingJob.schedule();
+ }
+
+ private void createHierarchySection(Composite sashForm, FormToolkit formToolkit) {
+ Composite hierarchyComposite = formToolkit.createComposite(sashForm, SWT.NONE);
+ hierarchyComposite.setLayout(new GridLayout());
+
+ Section hierarchySection = formToolkit.createSection(hierarchyComposite, ExpandableComposite.TITLE_BAR);
+ hierarchySection.marginHeight = 1;
+ GridData gd_hierarchySection = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd_hierarchySection.widthHint = 100;
+ gd_hierarchySection.minimumWidth = 100;
+ hierarchySection.setLayoutData(gd_hierarchySection);
+ hierarchySection.setText(Messages.DependencyTreePage_section_hierarchy);
+ formToolkit.paintBordersFor(hierarchySection);
+
+ Tree tree = formToolkit.createTree(hierarchySection, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
+ hierarchySection.setClient(tree);
+
+ treeViewer = new TreeViewer(tree);
+ treeViewer.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.TRUE);
+
+ DependencyTreeLabelProvider treeLabelProvider = new DependencyTreeLabelProvider();
+ treeViewer.setContentProvider(new DependencyTreeContentProvider());
+ treeViewer.setLabelProvider(treeLabelProvider);
+
+ treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ if(!isSettingSelection) {
+ isSettingSelection = true;
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+ selectListElements(new DependencyNodeMatcher(selection));
+ isSettingSelection = false;
+ }
+ }
+ });
+
+ treeViewer.addOpenListener(new IOpenListener() {
+ public void open(OpenEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+ for(Iterator<?> it = selection.iterator(); it.hasNext();) {
+ Object o = it.next();
+ if(o instanceof DependencyNode) {
+ org.sonatype.aether.artifact.Artifact a = ((DependencyNode) o).getDependency().getArtifact();
+ OpenPomAction.openEditor(a.getGroupId(), a.getArtifactId(), a.getVersion(), null);
+ }
+ }
+ }
+ });
+
+ createHierarchyToolbar(hierarchySection, treeLabelProvider, formToolkit);
+ }
+
+ private void createHierarchyToolbar(Section hierarchySection, final DependencyTreeLabelProvider treeLabelProvider,
+ FormToolkit formToolkit) {
+ ToolBarManager hiearchyToolBarManager = new ToolBarManager(SWT.FLAT);
+
+ hiearchyToolBarManager.add(new Action(Messages.DependencyTreePage_action_collapseAll, MavenEditorImages.COLLAPSE_ALL) {
+ public void run() {
+ treeViewer.collapseAll();
+ }
+ });
+
+ hiearchyToolBarManager.add(new Action(Messages.DependencyTreePage_action_expandAll, MavenEditorImages.EXPAND_ALL) {
+ public void run() {
+ treeViewer.expandAll();
+ }
+ });
+
+ hiearchyToolBarManager.add(new Separator());
+
+ hiearchyToolBarManager.add(new Action(Messages.DependencyTreePage_action_sort, MavenEditorImages.SORT) {
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ public void run() {
+ if(treeViewer.getComparator() == null) {
+ treeViewer.setComparator(new ViewerComparator());
+ } else {
+ treeViewer.setComparator(null);
+ }
+ }
+ });
+
+ hiearchyToolBarManager.add(new Action(Messages.DependencyTreePage_action_showGroupId, MavenEditorImages.SHOW_GROUP) {
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ public void run() {
+ treeLabelProvider.setShowGroupId(isChecked());
+ treeViewer.refresh();
+ }
+ });
+
+ hierarchyFilterAction = new Action(Messages.DependencyTreePage_action_filterSearch, MavenEditorImages.FILTER) {
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ public void run() {
+ if(isChecked()) {
+ setTreeFilter(currentFilter, true);
+// treeViewer.setFilters(new ViewerFilter[] {searchFilter, listSelectionFilter});
+ } else {
+ treeViewer.removeFilter(searchFilter);
+ }
+ treeViewer.refresh();
+ treeViewer.expandAll();
+ }
+ };
+ hierarchyFilterAction.setChecked(true);
+ hiearchyToolBarManager.add(hierarchyFilterAction);
+
+ Composite toolbarComposite = formToolkit.createComposite(hierarchySection);
+ toolbarComposite.setBackground(null);
+ RowLayout rowLayout = new RowLayout();
+ rowLayout.wrap = false;
+ rowLayout.marginRight = 0;
+ rowLayout.marginLeft = 0;
+ rowLayout.marginTop = 0;
+ rowLayout.marginBottom = 0;
+ toolbarComposite.setLayout(rowLayout);
+
+ hiearchyToolBarManager.createControl(toolbarComposite);
+ hierarchySection.setTextClient(toolbarComposite);
+ }
+
+ private void createListSection(SashForm sashForm, FormToolkit formToolkit) {
+ Composite listComposite = formToolkit.createComposite(sashForm, SWT.NONE);
+ listComposite.setLayout(new GridLayout());
+
+ Section listSection = formToolkit.createSection(listComposite, ExpandableComposite.TITLE_BAR);
+ listSection.marginHeight = 1;
+ GridData gd_listSection = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd_listSection.widthHint = 100;
+ gd_listSection.minimumWidth = 100;
+ listSection.setLayoutData(gd_listSection);
+ listSection.setText(Messages.DependencyTreePage_section_resolvedDeps);
+ formToolkit.paintBordersFor(listSection);
+
+ final DependencyListLabelProvider listLabelProvider = new DependencyListLabelProvider();
+
+ Table table = formToolkit.createTable(listSection, SWT.FLAT | SWT.MULTI);
+ listSection.setClient(table);
+
+ // listViewer = new TableViewer(listSection, SWT.FLAT | SWT.MULTI);
+ listViewer = new TableViewer(table);
+ listViewer.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.TRUE);
+ listViewer.setContentProvider(new DependencyListContentProvider());
+ listViewer.setLabelProvider(listLabelProvider);
+ listViewer.setComparator(new ViewerComparator()); // by default is sorted
+
+ listSelectionFilter = new ListSelectionFilter();
+ listViewer.addSelectionChangedListener(listSelectionFilter);
+ listViewer.getTable().addFocusListener(listSelectionFilter);
+
+ listViewer.addOpenListener(new IOpenListener() {
+ public void open(OpenEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) listViewer.getSelection();
+ for(Iterator<?> it = selection.iterator(); it.hasNext();) {
+ Object o = it.next();
+ if(o instanceof Artifact) {
+ Artifact a = (Artifact) o;
+ OpenPomAction.openEditor(a.getGroupId(), a.getArtifactId(), a.getVersion(), null);
+ }
+ }
+ }
+ });
+
+ createListToolbar(listSection, listLabelProvider, formToolkit);
+
+ }
+
+ private void createListToolbar(Section listSection, final DependencyListLabelProvider listLabelProvider,
+ FormToolkit formToolkit) {
+ ToolBarManager listToolBarManager = new ToolBarManager(SWT.FLAT);
+
+ listToolBarManager.add(new Action(Messages.DependencyTreePage_action_sort, MavenEditorImages.SORT) {
+ {
+ setChecked(true);
+ }
+
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ public void run() {
+ if(listViewer.getComparator() == null) {
+ listViewer.setComparator(new ViewerComparator());
+ } else {
+ listViewer.setComparator(null);
+ }
+ }
+ });
+
+ listToolBarManager.add(new Action(Messages.DependencyTreePage_action_showGroupId, MavenEditorImages.SHOW_GROUP) {
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ public void run() {
+ listLabelProvider.setShowGroupId(isChecked());
+ listViewer.refresh();
+ }
+ });
+
+ listToolBarManager.add(new Action(Messages.DependencyTreePage_action_filter, MavenEditorImages.FILTER) {
+ public int getStyle() {
+ return AS_CHECK_BOX;
+ }
+
+ public void run() {
+ if(listViewer.getFilters() == null || listViewer.getFilters().length == 0) {
+ listViewer.addFilter(searchFilter);
+ } else {
+ listViewer.removeFilter(searchFilter);
+ }
+ }
+ });
+
+ Composite toolbarComposite = formToolkit.createComposite(listSection);
+ toolbarComposite.setBackground(null);
+ RowLayout rowLayout = new RowLayout();
+ rowLayout.wrap = false;
+ rowLayout.marginRight = 0;
+ rowLayout.marginLeft = 0;
+ rowLayout.marginTop = 0;
+ rowLayout.marginBottom = 0;
+ toolbarComposite.setLayout(rowLayout);
+
+ listToolBarManager.createControl(toolbarComposite);
+ listSection.setTextClient(toolbarComposite);
+ }
+
+ private void createSearchBar(IManagedForm managedForm) {
+ searchControl = new SearchControl(Messages.DependencyTreePage_find, managedForm);
+ searchMatcher = new SearchMatcher(searchControl);
+ searchFilter = new DependencyFilter(new SearchMatcher(searchControl));
+ treeViewer.addFilter(searchFilter); // by default is filtered
+
+ ScrolledForm form = managedForm.getForm();
+
+ IToolBarManager toolBarManager = form.getForm().getToolBarManager();
+ toolBarManager.add(searchControl);
+
+ class ClasspathDropdown extends Action implements IMenuCreator {
+ private Menu menu;
+
+ public ClasspathDropdown() {
+ setText(Messages.DependencyTreePage_classpath);
+ setImageDescriptor(MavenEditorImages.SCOPE);
+ setMenuCreator(this);
+ }
+
+ public Menu getMenu(Menu parent) {
+ return null;
+ }
+
+ public Menu getMenu(Control parent) {
+ if (menu != null) {
+ menu.dispose();
+ }
+
+ menu = new Menu(parent);
+ addToMenu(menu, Messages.DependencyTreePage_scope_all, Artifact.SCOPE_TEST, currentClasspath);
+ addToMenu(menu, Messages.DependencyTreePage_scope_comp_runtime, Artifact.SCOPE_COMPILE_PLUS_RUNTIME, currentClasspath);
+ addToMenu(menu, Messages.DependencyTreePage_scope_compile, Artifact.SCOPE_COMPILE, currentClasspath);
+ addToMenu(menu, Messages.DependencyTreePage_scope_runtime, Artifact.SCOPE_RUNTIME, currentClasspath);
+ return menu;
+ }
+
+ protected void addToMenu(Menu parent, String text, String scope, String currentScope) {
+ ClasspathAction action = new ClasspathAction(text, scope);
+ action.setChecked(scope.equals(currentScope));
+ new ActionContributionItem(action).fill(parent, -1);
+ }
+
+ public void dispose() {
+ if (menu != null) {
+ menu.dispose();
+ menu = null;
+ }
+ }
+ }
+ toolBarManager.add(new ClasspathDropdown());
+
+ toolBarManager.add(new Separator());
+ toolBarManager.add(new Action(Messages.DependencyTreePage_action_refresh, MavenEditorImages.REFRESH) {
+ public void run() {
+ loadData(true);
+ }
+ });
+
+ form.updateToolBar();
+
+ searchControl.getSearchText().addFocusListener(new FocusAdapter() {
+ public void focusGained(FocusEvent e) {
+ isSettingSelection = true;
+ selectListElements(searchMatcher);
+ selectTreeElements(searchMatcher);
+ setTreeFilter(searchFilter, false);
+ isSettingSelection = false;
+ }
+ });
+
+ searchControl.getSearchText().addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ isSettingSelection = true;
+ selectListElements(searchMatcher);
+ selectTreeElements(searchMatcher);
+ setTreeFilter(searchFilter, false);
+ isSettingSelection = false;
+ }
+ });
+ }
+
+ protected void setTreeFilter(ViewerFilter filter, boolean force) {
+ currentFilter = filter;
+ if(filter != null && (force || (treeViewer.getFilters().length > 0 && treeViewer.getFilters()[0] != filter))) {
+ treeViewer.addFilter(filter);
+ }
+ }
+
+ protected void selectListElements(Matcher matcher) {
+ DependencyListLabelProvider listLabelProvider = (DependencyListLabelProvider) listViewer.getLabelProvider();
+ listLabelProvider.setMatcher(matcher);
+ listViewer.refresh();
+
+ if(!matcher.isEmpty() && mavenProject != null) {
+ Set<Artifact> projectArtifacts = mavenProject.getArtifacts();
+ for(Artifact a : projectArtifacts) {
+ if(matcher.isMatchingArtifact(a.getGroupId(), a.getArtifactId())) {
+ listViewer.reveal(a);
+ break;
+ }
+ }
+ }
+ }
+
+ void selectTreeElements(Matcher matcher) {
+ DependencyTreeLabelProvider treeLabelProvider = (DependencyTreeLabelProvider) treeViewer.getLabelProvider();
+ treeLabelProvider.setMatcher(matcher);
+ treeViewer.refresh();
+ treeViewer.expandAll();
+
+ if(!matcher.isEmpty()) {
+ for(DependencyNode node : dependencyNodes) {
+ org.sonatype.aether.artifact.Artifact a = node.getDependency().getArtifact();
+ if(matcher.isMatchingArtifact(a.getGroupId(), a.getGroupId())) {
+ treeViewer.reveal(node);
+ break;
+ }
+ }
+ }
+ }
+
+ static class DependencyFilter extends ViewerFilter {
+ protected Matcher matcher;
+
+ public DependencyFilter(Matcher matcher) {
+ this.matcher = matcher;
+ }
+
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if(matcher != null && !matcher.isEmpty()) {
+ // matcher = new TextMatcher(searchControl.getSearchText().getText());
+ if(element instanceof Artifact) {
+ Artifact a = (Artifact) element;
+ return matcher.isMatchingArtifact(a.getGroupId(), a.getArtifactId());
+
+ } else if(element instanceof DependencyNode) {
+ DependencyNode node = (DependencyNode) element;
+ org.sonatype.aether.artifact.Artifact a = node.getDependency().getArtifact();
+ if(matcher.isMatchingArtifact(a.getGroupId(), a.getArtifactId())) {
+ return true;
+ }
+
+ class ChildMatcher implements DependencyVisitor {
+ protected boolean foundMatch = false;
+
+ public boolean visitEnter(DependencyNode node) {
+ org.sonatype.aether.artifact.Artifact a = node.getDependency().getArtifact();
+ if(matcher.isMatchingArtifact(a.getGroupId(), a.getArtifactId())) {
+ foundMatch = true;
+ return false;
+ }
+ return true;
+ }
+
+ public boolean visitLeave(DependencyNode node) {
+ return true;
+ }
+ }
+ ;
+
+ ChildMatcher childMatcher = new ChildMatcher();
+ node.accept(childMatcher);
+ return childMatcher.foundMatch;
+ }
+ }
+ return true;
+ }
+
+ }
+
+ class ListSelectionFilter extends DependencyFilter implements ISelectionChangedListener, FocusListener {
+
+ public ListSelectionFilter() {
+ super(null); // no filter by default
+ }
+
+ // ISelectionChangedListener
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ if(!isSettingSelection) {
+ isSettingSelection = true;
+ IStructuredSelection selection = (IStructuredSelection) listViewer.getSelection();
+ matcher = new ArtifactMatcher(selection);
+ selectTreeElements(matcher);
+ setTreeFilter(this, false);
+ isSettingSelection = false;
+ }
+ }
+
+ // FocusListener
+
+ public void focusGained(FocusEvent e) {
+ if(hierarchyFilterAction.isChecked()) {
+ setTreeFilter(this, false);
+// treeViewer.addFilter(this);
+ }
+ }
+
+ public void focusLost(FocusEvent e) {
+// treeViewer.removeFilter(this);
+ matcher = null;
+ }
+ }
+
+ final class DependencyTreeContentProvider implements ITreeContentProvider {
+
+ public Object[] getElements(Object input) {
+ return getChildren(input);
+ }
+
+ public Object[] getChildren(Object element) {
+ if(element instanceof DependencyNode) {
+ DependencyNode node = (DependencyNode) element;
+ List<DependencyNode> children = node.getChildren();
+ return children.toArray(new DependencyNode[children.size()]);
+ }
+ return new Object[0];
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ if(element instanceof DependencyNode) {
+ DependencyNode node = (DependencyNode) element;
+ return !node.getChildren().isEmpty();
+ }
+ return false;
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ }
+
+ final class DependencyTreeLabelProvider extends LabelProvider implements IColorProvider {
+
+ private boolean showGroupId = false;
+
+ private Matcher matcher = null;
+
+ public void setMatcher(Matcher matcher) {
+ this.matcher = matcher;
+ }
+
+ public void setShowGroupId(boolean showGroupId) {
+ this.showGroupId = showGroupId;
+ }
+
+ // IColorProvider
+
+ public Color getForeground(Object element) {
+ if(element instanceof DependencyNode) {
+ DependencyNode node = (DependencyNode) element;
+ String scope = node.getDependency().getScope();
+ if(scope != null && !"compile".equals(scope)) { //$NON-NLS-1$
+ return Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
+ }
+ }
+ return null;
+ }
+
+ public Color getBackground(Object element) {
+ if(matcher != null && !matcher.isEmpty() && element instanceof DependencyNode) {
+ org.sonatype.aether.artifact.Artifact a = ((DependencyNode) element).getDependency().getArtifact();
+ if(matcher.isMatchingArtifact(a.getGroupId(), a.getArtifactId())) {
+ return searchHighlightColor;
+ }
+ }
+ return null;
+ }
+
+ // LabelProvider
+
+ @Override
+ public String getText(Object element) {
+ if(element instanceof DependencyNode) {
+ DependencyNode node = (DependencyNode) element;
+
+ org.sonatype.aether.artifact.Artifact a = node.getDependency().getArtifact();
+
+ org.sonatype.aether.artifact.Artifact c = null;
+ if(!node.getAliases().isEmpty()) {
+ c = node.getAliases().iterator().next();
+ }
+
+ StringBuilder label = new StringBuilder(128);
+
+ if(showGroupId) {
+ label.append(a.getGroupId()).append(" : ");
+ }
+
+ label.append(a.getArtifactId()).append(" : ");
+
+ label.append(a.getBaseVersion());
+
+ if(node.getPremanagedVersion() != null && !node.getPremanagedVersion().equals(a.getBaseVersion())) {
+ label.append(" (managed from ").append(node.getPremanagedVersion()).append(")");
+ }
+
+ if(c != null) {
+ String version = c.getBaseVersion();
+ if(!a.getBaseVersion().equals(version)) {
+ label.append(" (omitted for conflict with ").append(version).append(")");
+ }
+ }
+
+ if(a.getClassifier().length() > 0) {
+ label.append(Messages.DependencyTreePage_0).append(a.getClassifier());
+ }
+
+ label.append(" [").append(node.getDependency().getScope()).append("]");
+
+ if(node.getPremanagedScope() != null) {
+ label.append(" (from ").append(node.getPremanagedScope()).append(")");
+ }
+
+ return label.toString();
+ }
+ return element.toString();
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ if(element instanceof DependencyNode) {
+ DependencyNode node = (DependencyNode) element;
+ org.sonatype.aether.artifact.Artifact a = node.getDependency().getArtifact();
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectFacade projectFacade = projectManager.getMavenProject(a.getGroupId(), //
+ a.getArtifactId(), //
+ a.getBaseVersion() == null ? a.getVersion() : a.getBaseVersion());
+ return projectFacade == null ? MavenEditorImages.IMG_JAR : MavenEditorImages.IMG_PROJECT;
+ }
+ return null;
+ }
+ }
+
+ public class DependencyListLabelProvider extends LabelProvider implements IColorProvider {
+
+ private boolean showGroupId = false;
+
+ private Matcher matcher = null;
+
+ public void setMatcher(Matcher matcher) {
+ this.matcher = matcher;
+ }
+
+ public void setShowGroupId(boolean showGroupId) {
+ this.showGroupId = showGroupId;
+ }
+
+ // IColorProvider
+
+ public Color getForeground(Object element) {
+ if(element instanceof Artifact) {
+ Artifact a = (Artifact) element;
+ String scope = a.getScope();
+ if(scope != null && !"compile".equals(scope)) { //$NON-NLS-1$
+ return Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
+ }
+ }
+ return null;
+ }
+
+ public Color getBackground(Object element) {
+ if(matcher != null && !matcher.isEmpty() && element instanceof Artifact) {
+ Artifact a = (Artifact) element;
+ if(matcher.isMatchingArtifact(a.getGroupId(), a.getArtifactId())) {
+ return searchHighlightColor;
+ }
+ }
+ return null;
+ }
+
+ // LabelProvider
+
+ @Override
+ public String getText(Object element) {
+ if(element instanceof Artifact) {
+ Artifact a = (Artifact) element;
+ StringBuilder label = new StringBuilder(64);
+
+ if(showGroupId) {
+ label.append(a.getGroupId()).append(" : ");
+ }
+
+ label.append(a.getArtifactId()).append(" : ").append(a.getVersion());
+
+ if(a.hasClassifier()) {
+ label.append(" - ").append(a.getClassifier());
+ }
+
+ if(a.getScope() != null) {
+ label.append(" [").append(a.getScope()).append("]");
+ }
+
+ return label.toString();
+ }
+ return super.getText(element);
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ if(element instanceof Artifact) {
+ Artifact a = (Artifact) element;
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectFacade projectFacade = projectManager.getMavenProject(a.getGroupId(), //
+ a.getArtifactId(), //
+ a.getBaseVersion() == null ? a.getVersion() : a.getBaseVersion());
+ return projectFacade == null ? MavenEditorImages.IMG_JAR : MavenEditorImages.IMG_PROJECT;
+ }
+ return null;
+ }
+
+ }
+
+ public class DependencyListContentProvider implements IStructuredContentProvider {
+
+ public Object[] getElements(Object input) {
+ if(input instanceof MavenProject) {
+ MavenProject project = (MavenProject) input;
+ List<Artifact> artifacts = new ArrayList<Artifact>();
+ ArtifactFilter filter = new org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter(currentClasspath);
+ for(Artifact artifact : project.getArtifacts()) {
+ if(filter.include(artifact)) {
+ artifacts.add(artifact);
+ }
+ }
+ return artifacts.toArray(new Artifact[artifacts.size()]);
+ }
+ return null;
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public void dispose() {
+ }
+
+ }
+
+ public static class ArtifactMatcher extends Matcher {
+
+ protected final HashSet<String> artifactKeys = new HashSet<String>();
+
+ public ArtifactMatcher(IStructuredSelection selection) {
+ for(Iterator<?> it = selection.iterator(); it.hasNext();) {
+ addArtifactKey(it.next());
+ }
+ }
+
+ public boolean isEmpty() {
+ return artifactKeys.isEmpty();
+ }
+
+ public boolean isMatchingArtifact(String groupId, String artifactId) {
+ return artifactKeys.contains(getKey(groupId, artifactId));
+ }
+
+ protected void addArtifactKey(Object o) {
+ if(o instanceof Artifact) {
+ Artifact a = (Artifact) o;
+ artifactKeys.add(getKey(a.getGroupId(), a.getArtifactId()));
+ }
+ }
+
+ protected String getKey(String groupId, String artifactId) {
+ return groupId + ":" + artifactId;
+ }
+
+ }
+
+ public static class DependencyNodeMatcher extends ArtifactMatcher {
+
+ public DependencyNodeMatcher(IStructuredSelection selection) {
+ super(selection);
+ }
+
+ @Override
+ protected void addArtifactKey(Object o) {
+ if(o instanceof DependencyNode) {
+ org.sonatype.aether.artifact.Artifact a = ((DependencyNode) o).getDependency().getArtifact();
+ artifactKeys.add(getKey(a.getGroupId(), a.getArtifactId()));
+ }
+ }
+
+ }
+
+ @Override
+ public void dispose() {
+ MavenPlugin.getDefault().getMavenProjectManager().removeMavenProjectChangedListener(this);
+
+ if(searchHighlightColor != null) {
+ searchHighlightColor.dispose();
+ }
+ super.dispose();
+ }
+
+ public void selectDepedency(ArtifactKey artifactKey) {
+ if(dataLoadingJob!=null && dataLoadingJob.getState()==Job.RUNNING) {
+ try {
+ dataLoadingJob.join();
+ } catch(InterruptedException ex) {
+ // ignore
+ }
+ }
+
+ if(mavenProject!=null) {
+ Artifact artifact = getArtifact(artifactKey);
+ if(artifact!=null) {
+ listViewer.getTable().setFocus();
+ listViewer.setSelection(new StructuredSelection(artifact), true);
+ }
+ }
+ }
+
+ private Artifact getArtifact(ArtifactKey artifactKey) {
+ Set<Artifact> artifacts = mavenProject.getArtifacts();
+ for(Artifact artifact : artifacts) {
+ if(artifactKey.equals(new ArtifactKey(artifact))) {
+ return artifact;
+ }
+ }
+ return null;
+ }
+
+
+ public class ClasspathAction extends Action {
+
+ private final String classpath;
+
+ public ClasspathAction(String text, String classpath) {
+ super(text, IAction.AS_RADIO_BUTTON);
+ this.classpath = classpath;
+ }
+
+ public void run() {
+ if(isChecked()) {
+ currentClasspath = classpath;
+ IManagedForm managedForm = DependencyTreePage.this.getManagedForm();
+ managedForm.getForm().setText(formatFormTitle());
+ loadData(false);
+ }
+ }
+ }
+
+ public void loadData() {
+ loadData(true);
+ }
+
+ public void mavenProjectChanged(MavenProjectChangedEvent[] events, IProgressMonitor monitor) {
+ if (getManagedForm() == null || getManagedForm().getForm() == null)
+ return;
+
+ for (int i=0; i<events.length; i++) {
+ if (events[i].getSource().equals(((MavenPomEditor) getEditor()).getPomFile())) {
+ // file has been changed. need to update graph
+ new UIJob(Messages.DependencyTreePage_job_reloading) {
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ loadData();
+ FormUtils.setMessage(getManagedForm().getForm(), null, IMessageProvider.WARNING);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ }
+ }
+
+ public void fileChanged() {
+ if (getManagedForm() == null || getManagedForm().getForm() == null)
+ return;
+
+ new UIJob(Messages.DependencyTreePage_job_reloading) {
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ FormUtils.setMessage(getManagedForm().getForm(), Messages.DependencyTreePage_message_updating, IMessageProvider.WARNING);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/FormUtils.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/FormUtils.java
new file mode 100644
index 00000000..9eee3953
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/FormUtils.java
@@ -0,0 +1,252 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.ui.dialogs.MavenMessageDialog;
+import org.eclipse.m2e.core.util.Util;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public abstract class FormUtils {
+ public static final int MAX_MSG_LENGTH = 80;
+
+ /**
+ * @deprecated use your own string.. this should not have been made ublic in the first place.
+ */
+ public static final String MORE_DETAILS = ""; //$NON-NLS-1$
+
+ public static void decorateHeader(FormToolkit toolkit, Form form) {
+ Util.proxy(toolkit, FormTooliktStub.class).decorateFormHeading(form);
+ }
+
+ /**
+ * Stub interface for API added to FormToolikt in Eclipse 3.3
+ */
+ private interface FormTooliktStub {
+ public void decorateFormHeading(Form form);
+ }
+
+ /**
+ * @param form
+ * @param message
+ * @param severity
+ * @return
+ */
+ public static boolean setMessage(ScrolledForm form, String message, int severity) {
+ if(message != null && message.length() > MAX_MSG_LENGTH) {
+ String truncMsg = message;
+ String[] lines = message.split("\n"); //$NON-NLS-1$
+ if(lines.length > 0) {
+ truncMsg = lines[0];
+ } else {
+ truncMsg = message.substring(0, MAX_MSG_LENGTH);
+ }
+ setMessageAndTTip(form, NLS.bind(Messages.FormUtils_click_for_details, truncMsg), message, severity);
+ return true;
+ } else {
+ setMessageAndTTip(form, message, message, severity);
+ return false;
+ }
+ }
+
+ public static void setMessageAndTTip(final ScrolledForm form, final String message, final String ttip,
+ final int severity) {
+ form.getForm().setMessage(message, severity);
+ addFormTitleListeners(form, message, ttip, severity);
+ }
+
+ public static String nvl(String s) {
+ return s == null ? "" : s; //$NON-NLS-1$
+ }
+
+ public static String nvl(String s, String defaultValue) {
+ return s == null ? defaultValue : s;
+ }
+
+ public static boolean isEmpty(String s) {
+ return s == null || s.length() == 0;
+ }
+
+ public static boolean isEmpty(Text t) {
+ return t == null || isEmpty(t.getText());
+ }
+
+ public static void setText(Text control, String text) {
+ if(control != null && !control.isDisposed() && !control.getText().equals(text)) {
+ control.setText(nvl(text));
+ control.setSelection(nvl(text).length());
+ }
+ }
+
+ public static void setText(CCombo control, String text) {
+ if(control != null && !control.isDisposed() && !control.getText().equals(text)) {
+ control.setText(nvl(text));
+ }
+ }
+
+ public static void setButton(Button control, boolean selection) {
+ if(control != null && !control.isDisposed() && control.getSelection() != selection) {
+ control.setSelection(selection);
+ }
+ }
+
+ public static void openHyperlink(String url) {
+ if(!isEmpty(url) && (url.startsWith("http://") || url.startsWith("https://"))) { //$NON-NLS-1$ //$NON-NLS-2$
+ url = url.trim();
+ try {
+ IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
+ IWebBrowser browser = browserSupport.createBrowser(IWorkbenchBrowserSupport.NAVIGATION_BAR
+ | IWorkbenchBrowserSupport.LOCATION_BAR, url, url, url);
+ browser.openURL(new URL(url));
+ } catch(PartInitException ex) {
+ MavenLogger.log(ex);
+ } catch(MalformedURLException ex) {
+ MavenLogger.log("Malformed url " + url, ex); //$NON-NLS-1$
+ }
+ }
+ }
+
+ public static void setEnabled(Composite composite, boolean enabled) {
+ if(composite != null && !composite.isDisposed()) {
+ composite.setEnabled(enabled);
+ for(Control control : composite.getChildren()) {
+ if(control instanceof Combo) {
+ control.setEnabled(enabled);
+
+ } else if(control instanceof CCombo) {
+ control.setEnabled(enabled);
+
+ } else if(control instanceof Hyperlink) {
+ control.setEnabled(enabled);
+
+ } else if(control instanceof Composite) {
+ setEnabled((Composite) control, enabled);
+
+ } else {
+ control.setEnabled(enabled);
+
+ }
+ }
+ }
+ }
+
+ public static void setReadonly(Composite composite, boolean readonly) {
+ if(composite != null) {
+ for(Control control : composite.getChildren()) {
+ if(control instanceof Text) {
+ ((Text) control).setEditable(!readonly);
+
+ } else if(control instanceof Combo) {
+ ((Combo) control).setEnabled(!readonly);
+
+ } else if(control instanceof CCombo) {
+ ((CCombo) control).setEnabled(!readonly);
+
+ } else if(control instanceof Button) {
+ ((Button) control).setEnabled(!readonly);
+
+ } else if(control instanceof Composite) {
+ setReadonly((Composite) control, readonly);
+
+ }
+ }
+ }
+ }
+
+ private static void cleanupMouseListeners(Control kid, int event) {
+ Listener[] listeners = kid.getListeners(event);
+ if(listeners != null) {
+ for(Listener list : listeners) {
+ kid.removeListener(event, list);
+ }
+ }
+ }
+
+ private static void addFormTitleListeners(final ScrolledForm form, final String message, final String ttip,
+ final int severity) {
+ if(ttip != null && ttip.length() > 0 && message != null && severity == IMessageProvider.ERROR) {
+ final Composite head = form.getForm().getHead();
+ Control[] kids = head.getChildren();
+ for(Control kid : kids) {
+ //want to get the title region only
+ //Note: doing this instead of adding a head 'client' control because that gets put
+ //on the second line of the title, and looks broken. instead, converting the title
+ //into a url
+ if(kid != form && kid instanceof Canvas) {
+ cleanupMouseListeners(kid, SWT.MouseUp);
+ cleanupMouseListeners(kid, SWT.MouseEnter);
+ cleanupMouseListeners(kid, SWT.MouseExit);
+ kid.addMouseListener(new MouseAdapter() {
+ public void mouseUp(MouseEvent e) {
+ MavenMessageDialog.openInfo(form.getShell(), Messages.FormUtils_error_info, Messages.FormUtils_pom_error, ttip);
+ }
+ });
+ kid.addMouseTrackListener(new MouseTrackAdapter() {
+ public void mouseEnter(MouseEvent e) {
+ head.setCursor(Display.getDefault().getSystemCursor(SWT.CURSOR_HAND));
+ }
+
+ public void mouseExit(MouseEvent e) {
+ head.setCursor(null);
+ }
+ });
+ }
+ }
+ } else {
+ //no ttip or message, make sure old listeners are cleaned up if errs are removed
+ final Composite head = form.getForm().getHead();
+ Control[] kids = head.getChildren();
+ for(Control kid : kids) {
+ //want to get the title region only
+ //Note: doing this instead of adding a head 'client' control because that gets put
+ //on the second line of the title, and looks broken. instead, converting the title
+ //into a url
+ if(kid != form && kid instanceof Canvas) {
+ cleanupMouseListeners(kid, SWT.MouseUp);
+ cleanupMouseListeners(kid, SWT.MouseEnter);
+ cleanupMouseListeners(kid, SWT.MouseExit);
+ }
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/IPomFileChangedListener.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/IPomFileChangedListener.java
new file mode 100644
index 00000000..d1b5fe6e
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/IPomFileChangedListener.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+public interface IPomFileChangedListener {
+
+ public void fileChanged();
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/Matcher.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/Matcher.java
new file mode 100644
index 00000000..d321de46
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/Matcher.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public abstract class Matcher {
+
+ public abstract boolean isMatchingArtifact(String groupId, String artifactId);
+
+ public abstract boolean isEmpty();
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
new file mode 100644
index 00000000..c8404c3d
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
@@ -0,0 +1,1214 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.IOUtil;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.ITextListener;
+import org.eclipse.jface.text.TextEvent;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.OpenPomAction.MavenPathStorageEditorInput;
+import org.eclipse.m2e.core.actions.OpenPomAction.MavenStorageEditorInput;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.MavenModelManager;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.util.Util;
+import org.eclipse.m2e.core.util.Util.FileStoreEditorInputStub;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.MavenEditorPlugin;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.util.PomResourceFactoryImpl;
+import org.eclipse.m2e.model.edit.pom.util.PomResourceImpl;
+import org.eclipse.search.ui.text.ISearchEditorAccess;
+import org.eclipse.search.ui.text.Match;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorActionBarContributor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IPartService;
+import org.eclipse.ui.IShowEditorInput;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.IWindowListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.IFormPage;
+import org.eclipse.ui.ide.IGotoMarker;
+import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
+import org.eclipse.ui.progress.UIJob;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.IDocumentProviderExtension3;
+import org.eclipse.ui.texteditor.ITextEditorActionConstants;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.xml.core.internal.emf2xml.EMF2DOMSSEAdapter;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.sonatype.aether.graph.DependencyNode;
+
+
+/**
+ * Maven POM editor
+ *
+ * @author Eugene Kuleshov
+ * @author Anton Kraev
+ */
+@SuppressWarnings("restriction")
+public class MavenPomEditor extends FormEditor implements IResourceChangeListener, IShowEditorInput, IGotoMarker,
+ ISearchEditorAccess, IEditingDomainProvider {
+
+ private static final String POM_XML = "pom.xml";
+
+ public static final String EDITOR_ID = "org.eclipse.m2e.editor.MavenPomEditor"; //$NON-NLS-1$
+
+ private static final String EXTENSION_FACTORIES = MavenEditorPlugin.PLUGIN_ID + ".pageFactories"; //$NON-NLS-1$
+
+ private static final String ELEMENT_PAGE = "factory"; //$NON-NLS-1$
+
+ private static final String EFFECTIVE_POM = Messages.MavenPomEditor_effective_pom;
+
+ IAction showAdvancedTabsAction;
+
+ OverviewPage overviewPage;
+
+ DependenciesPage dependenciesPage;
+
+ RepositoriesPage repositoriesPage;
+
+ BuildPage buildPage;
+
+ PluginsPage pluginsPage;
+
+ ReportingPage reportingPage;
+
+ ProfilesPage profilesPage;
+
+ TeamPage teamPage;
+
+ DependencyTreePage dependencyTreePage;
+
+ StructuredSourceTextEditor sourcePage;
+
+ StructuredTextEditor effectivePomSourcePage;
+
+ List<MavenPomEditorPage> pages = new ArrayList<MavenPomEditorPage>();
+
+ private Model projectDocument;
+
+ private Map<String, org.sonatype.aether.graph.DependencyNode> rootNodes = new HashMap<String, org.sonatype.aether.graph.DependencyNode>();
+
+ IStructuredModel structuredModel;
+
+ private MavenProject mavenProject;
+
+ AdapterFactory adapterFactory;
+
+ AdapterFactoryEditingDomain editingDomain;
+
+ private int sourcePageIndex;
+
+ NotificationCommandStack commandStack;
+
+ IModelManager modelManager;
+
+ IFile pomFile;
+
+ MavenPomActivationListener activationListener;
+
+ boolean dirty;
+
+ CommandStackListener commandStackListener;
+
+ BasicCommandStack sseCommandStack;
+
+ List<IPomFileChangedListener> fileChangeListeners = new ArrayList<IPomFileChangedListener>();
+
+ private LoadDependenciesJob loadDependenciesJob;
+
+ public MavenPomEditor() {
+ modelManager = StructuredModelManager.getModelManager();
+ }
+
+ // IResourceChangeListener
+
+ /**
+ * Closes all project files on project close.
+ */
+ public void resourceChanged(final IResourceChangeEvent event) {
+ if(pomFile == null) {
+ return;
+ }
+
+ //handle project delete
+ if(event.getType() == IResourceChangeEvent.PRE_CLOSE || event.getType() == IResourceChangeEvent.PRE_DELETE) {
+ if(pomFile.getProject().equals(event.getResource())) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ close(false);
+ }
+ });
+ }
+ return;
+ }
+ //handle pom delete
+ class RemovedResourceDeltaVisitor implements IResourceDeltaVisitor {
+ boolean removed = false;
+
+ public boolean visit(IResourceDelta delta) throws CoreException {
+ if(delta.getResource() == pomFile //
+ && (delta.getKind() & (IResourceDelta.REMOVED)) != 0) {
+ removed = true;
+ return false;
+ }
+ return true;
+ }
+ };
+
+ try {
+ RemovedResourceDeltaVisitor visitor = new RemovedResourceDeltaVisitor();
+ event.getDelta().accept(visitor);
+ if(visitor.removed) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ close(true);
+ }
+ });
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+
+ // Reload model if pom file was changed externally.
+ // TODO implement generic merge scenario (when file is externally changed and is dirty)
+
+ // suppress a prompt to reload the pom if modifications were caused by workspace actions
+ sourcePage.updateModificationStamp();
+
+ class ChangedResourceDeltaVisitor implements IResourceDeltaVisitor {
+
+ public boolean visit(IResourceDelta delta) throws CoreException {
+ if(delta.getResource().equals(pomFile)
+ && (delta.getKind() & IResourceDelta.CHANGED) != 0 && delta.getResource().exists()) {
+ int flags = delta.getFlags();
+ if ((flags & (IResourceDelta.CONTENT | flags & IResourceDelta.REPLACED)) != 0) {
+ handleContentChanged();
+ return false;
+ }
+ if ((flags & IResourceDelta.MARKERS) != 0) {
+ handleMarkersChanged();
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private void handleContentChanged() {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+/* MNGECLIPSE-1789: commented this out since forced model reload caused the XML editor to go crazy;
+ the model is already updated at this point so reloading from file is unnecessary;
+ externally originated file updates are checked in handleActivation() */
+// try {
+// structuredModel.reload(pomFile.getContents());
+ reload();
+// } catch(CoreException e) {
+// MavenLogger.log(e);
+// } catch(Exception e) {
+// MavenLogger.log("Error loading pom editor model.", e);
+// }
+ }
+ });
+ }
+ private void handleMarkersChanged() {
+ try {
+ IMarker[] markers = pomFile.findMarkers(IMavenConstants.MARKER_ID, true, IResource.DEPTH_ZERO);
+ final String msg = markers != null && markers.length > 0 //
+ ? markers[0].getAttribute(IMarker.MESSAGE, "Unknown error") : null;
+ final int severity = markers != null && markers.length > 0 ? (markers[0].getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR) == IMarker.SEVERITY_WARNING ? IMessageProvider.WARNING : IMessageProvider.ERROR) : IMessageProvider.NONE;
+
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ for(MavenPomEditorPage page : pages) {
+ page.setErrorMessage(msg, msg == null ? IMessageProvider.NONE : severity);
+ }
+ }
+ });
+ } catch (CoreException ex ) {
+ MavenLogger.log("Error updating pom file markers.", ex); //$NON-NLS-1$
+ }
+ }
+ };
+
+ try {
+ ChangedResourceDeltaVisitor visitor = new ChangedResourceDeltaVisitor();
+ event.getDelta().accept(visitor);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+
+ }
+
+ public void reload() {
+ if (projectDocument != null) {
+ projectDocument.eResource().unload();
+ }
+ projectDocument = null;
+ try {
+ readProjectDocument();
+ //fix for resetting the pom document after an external change
+// sourcePage.getDocumentProvider().resetDocument(sourcePage.getEditorInput());
+ } catch(CoreException e) {
+ MavenLogger.log(e);
+ }
+ for(MavenPomEditorPage page : pages) {
+ page.reload();
+ }
+ if(isEffectiveActive()){
+ loadEffectivePOM();
+ }
+ flushCommandStack();
+ }
+
+ private boolean isEffectiveActive(){
+ int active = getActivePage();
+ String name = getPageText(active);
+ return EFFECTIVE_POM.equals(name);
+ }
+
+ void flushCommandStack() {
+ dirty = false;
+ if (sseCommandStack != null)
+ sseCommandStack.saveIsDone();
+ if (getContainer() != null && !getContainer().isDisposed())
+ getContainer().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ editorDirtyStateChanged();
+ }
+ });
+ }
+
+ /**
+ * Show or hide the advanced pages within the editor (based on the default setting)
+ */
+ protected void showAdvancedPages(){
+ showAdvancedPages(MavenPlugin.getDefault().getPreferenceStore().getBoolean(PomEditorPreferencePage.P_SHOW_ADVANCED_TABS));
+ }
+
+ /**
+ * Show or hide the advanced pages within the editor (forced)
+ */
+ protected void showAdvancedPages(boolean showAdvancedTabs){
+ if(!showAdvancedTabs) {
+ return;
+ }
+
+ if(repositoriesPage == null){
+ showAdvancedTabsAction.setChecked(true);
+
+ repositoriesPage = new RepositoriesPage(this);
+ addPomPage(repositoriesPage);
+
+ buildPage = new BuildPage(this);
+ addPomPage(buildPage);
+
+ profilesPage = new ProfilesPage(this);
+ addPomPage(profilesPage);
+
+ teamPage = new TeamPage(this);
+ addPomPage(teamPage);
+
+ }
+ }
+
+ protected void addPages() {
+
+ showAdvancedTabsAction = new Action(Messages.MavenPomEditor_action_advanced, IAction.AS_RADIO_BUTTON) {
+ public void run() {
+ showAdvancedPages(showAdvancedTabsAction.isChecked());
+// pomEditor.reload();
+ }
+ };
+ showAdvancedTabsAction.setImageDescriptor(MavenEditorImages.ADVANCED_TABS);
+
+ overviewPage = new OverviewPage(this);
+ addPomPage(overviewPage);
+
+ dependenciesPage = new DependenciesPage(this);
+ addPomPage(dependenciesPage);
+
+ pluginsPage = new PluginsPage(this);
+ addPomPage(pluginsPage);
+
+ reportingPage = new ReportingPage(this);
+ addPomPage(reportingPage);
+
+ dependencyTreePage = new DependencyTreePage(this);
+ addPomPage(dependencyTreePage);
+
+ addSourcePage();
+
+ showAdvancedPages();
+
+ addEditorPageExtensions();
+ selectActivePage();
+ }
+
+ protected void selectActivePage(){
+ boolean showXML = MavenPlugin.getDefault().getPreferenceStore().getBoolean(PomEditorPreferencePage.P_DEFAULT_POM_EDITOR_PAGE);
+ if(showXML){
+ setActivePage(null);
+ }
+ }
+
+ protected void pageChange(int newPageIndex) {
+ String name = getPageText(newPageIndex);
+ if(EFFECTIVE_POM.equals(name)){
+ loadEffectivePOM();
+ }
+ if (POM_XML.equals(name)) {
+ //attempt to preload the maven project to have the caches hot for template proposals.
+ if (getEditorInput() instanceof IFileEditorInput) {
+ IFileEditorInput ei = (IFileEditorInput)getEditorInput();
+ final IFile file = ei.getFile();
+ IProject prj = file != null ? file.getProject() : null;
+ if (prj != null) {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ final IMavenProjectFacade mvnprj = projectManager.getProject(prj);
+ if (mvnprj != null && mvnprj.getMavenProject() == null) {
+ Job jb = new Job("load maven project") {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ mvnprj.getMavenProject(monitor);
+ } catch(CoreException e) {
+ //just ignore
+ MavenLogger.log("Unable to read maven project. Some content assists might not work as advertized.", e); //$NON-NLS-1$
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ jb.setSystem(true);
+ jb.schedule();
+ }
+ }
+ }
+ }
+ //The editor occassionally doesn't get
+ //closed if the project gets deleted. In this case, the editor
+ //stays open and very bad things happen if you select it
+ try{
+ super.pageChange(newPageIndex);
+ }catch(NullPointerException e){
+ MavenEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MavenEditorPlugin.PLUGIN_ID, "", e)); //$NON-NLS-1$
+ this.close(false);
+ }
+ // a workaround for editor pages not returned
+ IEditorActionBarContributor contributor = getEditorSite().getActionBarContributor();
+ if(contributor != null && contributor instanceof MultiPageEditorActionBarContributor) {
+ IEditorPart activeEditor = getActivePageInstance();
+ ((MultiPageEditorActionBarContributor) contributor).setActivePage(activeEditor);
+ }
+ }
+
+ private void addEditorPageExtensions() {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint indexesExtensionPoint = registry.getExtensionPoint(EXTENSION_FACTORIES);
+ if(indexesExtensionPoint != null) {
+ IExtension[] indexesExtensions = indexesExtensionPoint.getExtensions();
+ for(IExtension extension : indexesExtensions) {
+ for(IConfigurationElement element : extension.getConfigurationElements()) {
+ if(element.getName().equals(ELEMENT_PAGE)) {
+ try {
+ MavenPomEditorPageFactory factory;
+ factory = (MavenPomEditorPageFactory) element.createExecutableExtension("class"); //$NON-NLS-1$
+ factory.addPages(this);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public void loadDependencies(Callback callback, String classpath) {
+ if (this.loadDependenciesJob != null && this.loadDependenciesJob.dependencyNode != null) {
+ //Already loaded, we're done!
+ callback.onFinish(loadDependenciesJob.dependencyNode);
+ return;
+ } else if (this.loadDependenciesJob != null && this.loadDependenciesJob.getState() != Job.NONE) {
+ //Currently running
+ loadDependenciesJob.addCallback(callback);
+ return;
+ }
+
+ this.loadDependenciesJob = new LoadDependenciesJob(this, classpath, callback);
+ loadDependenciesJob.schedule();
+ }
+
+ public static interface Callback {
+ /**
+ * Called when the dependency tree is done loading. The node parameter
+ * points to the root of the tree.
+ * @param node
+ */
+ public void onFinish(DependencyNode node);
+
+ /**
+ * Called if an exception occurs while loading the dependency tree.
+ * @param ex
+ */
+ public void onException(CoreException ex);
+ }
+
+ /**
+ * Loads the dependency tree in a Job so as to not block the UI.
+ * Once the loading is done, it calls the provided callback with the root
+ * node of the dependency tree. If there is an error, it notifies the
+ * callback's onException method.
+ */
+ class LoadDependenciesJob extends Job {
+
+ private MavenPomEditor pomEditor;
+ private String classpath;
+ private List<Callback> callbacks = new LinkedList<MavenPomEditor.Callback>();
+ DependencyNode dependencyNode;
+
+ public LoadDependenciesJob(MavenPomEditor editor, String classpath, Callback callback) {
+ super("Resolving dependencies");
+ this.pomEditor = editor;
+ this.classpath = classpath;
+ this.callbacks.add( callback );
+ }
+
+ void addCallback(Callback callback) {
+ if (!this.callbacks.contains(callback)) {
+ this.callbacks.add( callback );
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected IStatus run(IProgressMonitor monitor) {
+ boolean force = false;
+ try {
+ final DependencyNode dependencyNode = pomEditor.readDependencyTree(force, classpath, monitor);
+
+ if(dependencyNode == null) {
+ return Status.CANCEL_STATUS;
+ }
+ this.dependencyNode = dependencyNode;
+ for (Callback callback : callbacks) {
+ callback.onFinish(dependencyNode);
+ }
+ } catch(final CoreException ex) {
+ for (Callback callback : callbacks) {
+ callback.onException(ex);
+ }
+ }
+
+ return Status.OK_STATUS;
+ }
+ }
+
+ /**
+ * Load the effective POM in a job and then update the effective pom page when its done
+ * @author dyocum
+ *
+ */
+ class LoadEffectivePomJob extends Job{
+
+ public LoadEffectivePomJob(String name) {
+ super(name);
+ }
+
+ private void showEffectivePomError(final String name){
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run(){
+ String error = Messages.MavenPomEditor_error_loading_effective_pom;
+ IEditorInput editorInput = new MavenPathStorageEditorInput(name, name, null, error.getBytes());
+ effectivePomSourcePage.setInput(editorInput);
+ }
+ });
+ }
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try{
+ StringWriter sw = new StringWriter();
+ final String name = getPartName() + Messages.MavenPomEditor_effective;
+ MavenProject mavenProject = SelectionUtil.getMavenProject(getEditorInput(), monitor);
+ if(mavenProject == null){
+ showEffectivePomError(name);
+ return Status.CANCEL_STATUS;
+ }
+ new MavenXpp3Writer().write(sw, mavenProject.getModel());
+ final String content = sw.toString();
+
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run() {
+ try{
+ IEditorInput editorInput = new MavenStorageEditorInput(name, name, null, content.getBytes("UTF-8")); //$NON-NLS-1$
+ effectivePomSourcePage.setInput(editorInput);
+ effectivePomSourcePage.update();
+ }catch(IOException ie){
+ MavenLogger.log(new Status(IStatus.ERROR, MavenEditorPlugin.PLUGIN_ID, -1, Messages.MavenPomEditor_error_failed_effective, ie));
+ }
+ }
+ });
+ return Status.OK_STATUS;
+ } catch(CoreException ce){
+ return new Status(IStatus.ERROR, MavenEditorPlugin.PLUGIN_ID, -1, Messages.MavenPomEditor_error_failed_effective, ce);
+ } catch(IOException ie){
+ return new Status(IStatus.ERROR, MavenEditorPlugin.PLUGIN_ID, -1, Messages.MavenPomEditor_error_failed_effective, ie);
+ }
+ }
+ }
+
+ /**
+ * Load the effective POM. Should only happen when tab is brought to front or tab
+ * is in front when a reload happens.
+ */
+ private void loadEffectivePOM(){
+ //put a msg in the editor saying that the effective pom is loading, in case this is a long running job
+ String content = Messages.MavenPomEditor_loading;
+ String name = getPartName() + Messages.MavenPomEditor_effective;
+ IEditorInput editorInput = new MavenStorageEditorInput(name, name, null, content.getBytes());
+ effectivePomSourcePage.setInput(editorInput);
+
+ //then start the load
+ LoadEffectivePomJob job = new LoadEffectivePomJob(Messages.MavenPomEditor_loading);
+ job.schedule();
+ }
+
+ protected class StructuredSourceTextEditor extends StructuredTextEditor {
+ private long fModificationStamp = -1;
+
+ protected void updateModificationStamp() {
+ IDocumentProvider p= getDocumentProvider();
+ if (p == null)
+ return;
+
+ if(p instanceof IDocumentProviderExtension3) {
+ fModificationStamp= p.getModificationStamp(getEditorInput());
+ }
+ }
+ protected void sanityCheckState(IEditorInput input) {
+
+ IDocumentProvider p= getDocumentProvider();
+ if (p == null)
+ return;
+
+ if (p instanceof IDocumentProviderExtension3) {
+
+ IDocumentProviderExtension3 p3= (IDocumentProviderExtension3) p;
+
+ long stamp= p.getModificationStamp(input);
+ if (stamp != fModificationStamp) {
+ fModificationStamp= stamp;
+ if (!p3.isSynchronized(input))
+ handleEditorInputChanged();
+ }
+
+ } else {
+
+ if (fModificationStamp == -1)
+ fModificationStamp= p.getSynchronizationStamp(input);
+
+ long stamp= p.getModificationStamp(input);
+ if (stamp != fModificationStamp) {
+ fModificationStamp= stamp;
+ if (stamp != p.getSynchronizationStamp(input))
+ handleEditorInputChanged();
+ }
+ }
+
+ updateState(getEditorInput());
+ updateStatusField(ITextEditorActionConstants.STATUS_CATEGORY_ELEMENT_STATE);
+ }
+ public void doSave(IProgressMonitor monitor) {
+ // always save text editor
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(MavenPomEditor.this);
+ try {
+ super.doSave(monitor);
+ flushCommandStack();
+ } finally {
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(MavenPomEditor.this);
+ }
+ }
+
+ private boolean oldDirty;
+ public boolean isDirty() {
+ if (oldDirty != dirty) {
+ oldDirty = dirty;
+ updatePropertyDependentActions();
+ }
+ return dirty;
+ }
+ }
+
+ private void addSourcePage() {
+ sourcePage = new StructuredSourceTextEditor();
+ sourcePage.setEditorPart(this);
+ //the page for showing the effective POM
+ effectivePomSourcePage = new StructuredTextEditor();
+ effectivePomSourcePage.setEditorPart(this);
+ try {
+ int dex = addPage(effectivePomSourcePage, getEditorInput());
+ setPageText(dex, EFFECTIVE_POM);
+
+ sourcePageIndex = addPage(sourcePage, getEditorInput());
+ setPageText(sourcePageIndex, POM_XML);
+ sourcePage.update();
+
+
+ IDocument doc = sourcePage.getDocumentProvider().getDocument(getEditorInput());
+
+ doc.addDocumentListener(new IDocumentListener(){
+
+ public void documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent event) {
+ }
+
+ public void documentChanged(org.eclipse.jface.text.DocumentEvent event) {
+ //recheck the read-only status if the document changes (will happen when xml page is edited)
+ if(MavenPomEditor.this.checkedWritableStatus && MavenPomEditor.this.readOnly){
+ MavenPomEditor.this.checkedWritableStatus = false;
+ }
+ }
+ });
+ structuredModel = modelManager.getExistingModelForEdit(doc);
+ if(structuredModel == null) {
+ structuredModel = modelManager.getModelForEdit((IStructuredDocument) doc);
+ }
+
+ commandStackListener = new CommandStackListener() {
+ public void commandStackChanged(EventObject event) {
+ boolean oldDirty = dirty;
+ dirty = sseCommandStack.isSaveNeeded();
+ if (dirty != oldDirty)
+ MavenPomEditor.this.editorDirtyStateChanged();
+ }
+ };
+
+ IStructuredTextUndoManager undoManager = structuredModel.getUndoManager();
+ if(undoManager != null) {
+ sseCommandStack = (BasicCommandStack) undoManager.getCommandStack();
+ if(sseCommandStack != null) {
+ sseCommandStack.addCommandStackListener(commandStackListener);
+ }
+ }
+
+ flushCommandStack();
+ try {
+ readProjectDocument();
+ } catch(CoreException e) {
+ MavenLogger.log(e);
+ }
+
+ // TODO activate xml source page if model is empty or have errors
+
+ if(doc instanceof IStructuredDocument) {
+ List<AdapterFactoryImpl> factories = new ArrayList<AdapterFactoryImpl>();
+ factories.add(new ResourceItemProviderAdapterFactory());
+ factories.add(new ReflectiveItemProviderAdapterFactory());
+
+ adapterFactory = new ComposedAdapterFactory(factories);
+ commandStack = new NotificationCommandStack(this);
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, //
+ commandStack, new HashMap<Resource, Boolean>());
+ }
+ } catch(PartInitException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+
+ public boolean isReadOnly() {
+ return !(getEditorInput() instanceof IFileEditorInput);
+ }
+
+ private int addPomPage(IFormPage page) {
+ try {
+ if(page instanceof MavenPomEditorPage) {
+ pages.add((MavenPomEditorPage) page);
+ }
+ if (page instanceof IPomFileChangedListener) {
+ fileChangeListeners.add((IPomFileChangedListener) page);
+ }
+ return addPage(page);
+ } catch(PartInitException ex) {
+ MavenLogger.log(ex);
+ return -1;
+ }
+ }
+
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ // XXX move to MavenModelManager (CommandStack and EditorDomain too)
+ public synchronized Model readProjectDocument() throws CoreException {
+ if(projectDocument == null) {
+ IEditorInput input = getEditorInput();
+ if(input instanceof IFileEditorInput) {
+ pomFile = ((IFileEditorInput) input).getFile();
+ pomFile.refreshLocal(1, null);
+
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
+ MavenModelManager modelManager = MavenPlugin.getDefault().getMavenModelManager();
+ PomResourceImpl resource = modelManager.loadResource(pomFile);
+ projectDocument = resource.getModel();
+
+ } else if(input instanceof IStorageEditorInput) {
+ IStorageEditorInput storageInput = (IStorageEditorInput) input;
+ IStorage storage = storageInput.getStorage();
+ IPath path = storage.getFullPath();
+ if(path == null || !new File(path.toOSString()).exists()) {
+ File tempPomFile = null;
+ InputStream is = null;
+ OutputStream os = null;
+ try {
+ tempPomFile = File.createTempFile("maven-pom", ".pom"); //$NON-NLS-1$ //$NON-NLS-2$
+ os = new FileOutputStream(tempPomFile);
+ is = storage.getContents();
+ IOUtil.copy(is, os);
+ projectDocument = loadModel(tempPomFile.getAbsolutePath());
+ } catch(IOException ex) {
+ MavenLogger.log("Can't close stream", ex); //$NON-NLS-1$
+ } finally {
+ IOUtil.close(is);
+ IOUtil.close(os);
+ if(tempPomFile != null) {
+ tempPomFile.delete();
+ }
+ }
+ } else {
+ projectDocument = loadModel(path.toOSString());
+ }
+
+ } else if(input.getClass().getName().endsWith("FileStoreEditorInput")) { //$NON-NLS-1$
+ projectDocument = loadModel(Util.proxy(input, FileStoreEditorInputStub.class).getURI().getPath());
+ }
+ }
+
+ return projectDocument;
+ }
+
+ private Model loadModel(String path) {
+ URI uri = URI.createFileURI(path);
+ PomResourceFactoryImpl factory = new PomResourceFactoryImpl();
+ PomResourceImpl resource = (PomResourceImpl) factory.createResource(uri);
+
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ return (Model)resource.getContents().get(0);
+
+ } catch(Exception ex) {
+ MavenLogger.log("Can't load model " + path, ex); //$NON-NLS-1$
+ return null;
+
+ }
+ }
+
+ public synchronized org.sonatype.aether.graph.DependencyNode readDependencyTree(boolean force, String classpath,
+ IProgressMonitor monitor) throws CoreException {
+ if(force || !rootNodes.containsKey(classpath)) {
+ monitor.setTaskName(Messages.MavenPomEditor_task_reading);
+ MavenProject mavenProject = readMavenProject(force, monitor);
+ if(mavenProject == null){
+ MavenLogger.log("Unable to read maven project. Dependencies not updated.", null); //$NON-NLS-1$
+ return null;
+ }
+
+ rootNodes.put(classpath,
+ MavenPlugin.getDefault().getMavenModelManager().readDependencyTree(mavenProject, classpath, monitor));
+ }
+
+ return rootNodes.get(classpath);
+ }
+
+ public MavenProject readMavenProject(boolean force, IProgressMonitor monitor) throws CoreException {
+ if(force || mavenProject == null) {
+ IEditorInput input = getEditorInput();
+
+ if(input instanceof IFileEditorInput) {
+ IFileEditorInput fileInput = (IFileEditorInput) input;
+ pomFile = fileInput.getFile();
+ pomFile.refreshLocal(1, null);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
+ }
+
+ mavenProject = SelectionUtil.getMavenProject(input, monitor);
+ }
+ return mavenProject;
+ }
+
+ public void dispose() {
+ new UIJob(Messages.MavenPomEditor_job_disposing) {
+ @SuppressWarnings("synthetic-access")
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ structuredModel.releaseFromEdit();
+ if (sseCommandStack != null)
+ sseCommandStack.removeCommandStackListener(commandStackListener);
+
+ if(activationListener != null) {
+ activationListener.dispose();
+ activationListener = null;
+ }
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(MavenPomEditor.this);
+
+ if(projectDocument != null) {
+ projectDocument.eResource().unload();
+ }
+ MavenPomEditor.super.dispose();
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+
+ /**
+ * Saves structured editor XXX form model need to be synchronized
+ */
+ public void doSave(IProgressMonitor monitor) {
+ new UIJob(Messages.MavenPomEditor_job_saving) {
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ sourcePage.doSave(monitor);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+
+ public void doSaveAs() {
+ // IEditorPart editor = getEditor(0);
+ // editor.doSaveAs();
+ // setPageText(0, editor.getTitle());
+ // setInput(editor.getEditorInput());
+ }
+
+ /*
+ * (non-Javadoc) Method declared on IEditorPart.
+ */
+ public boolean isSaveAsAllowed() {
+ return false;
+ }
+
+ public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
+// if(!(editorInput instanceof IStorageEditorInput)) {
+// throw new PartInitException("Unsupported editor input " + editorInput);
+// }
+
+ setPartName(editorInput.getToolTipText());
+ // setContentDescription(name);
+
+ super.init(site, editorInput);
+
+ activationListener = new MavenPomActivationListener(site.getWorkbenchWindow().getPartService());
+ }
+
+ public void showInSourceEditor(EObject o) {
+ IDOMElement element = getElement(o);
+ if(element != null) {
+ int start = element.getStartOffset();
+ int lenght = element.getLength();
+ setActivePage(sourcePageIndex);
+ sourcePage.selectAndReveal(start, lenght);
+ }
+ }
+
+ public IDOMElement getElement(EObject o) {
+ for(Adapter adapter : o.eAdapters()) {
+ if(adapter instanceof EMF2DOMSSEAdapter) {
+ EMF2DOMSSEAdapter a = (EMF2DOMSSEAdapter) adapter;
+ if(a.getNode() instanceof IDOMElement) {
+ return (IDOMElement) a.getNode();
+ }
+ break;
+ }
+ }
+ return null;
+ }
+
+ // IShowEditorInput
+
+ public void showEditorInput(IEditorInput editorInput) {
+ // could activate different tabs based on the editor input
+ }
+
+ // IGotoMarker
+
+ public void gotoMarker(IMarker marker) {
+ // TODO use selection to activate corresponding form page elements
+ setActivePage(sourcePageIndex);
+ IGotoMarker adapter = (IGotoMarker) sourcePage.getAdapter(IGotoMarker.class);
+ adapter.gotoMarker(marker);
+ }
+
+ // ISearchEditorAccess
+
+ public IDocument getDocument(Match match) {
+ return sourcePage.getDocumentProvider().getDocument(getEditorInput());
+ }
+
+ public IAnnotationModel getAnnotationModel(Match match) {
+ return sourcePage.getDocumentProvider().getAnnotationModel(getEditorInput());
+ }
+
+ public boolean isDirty() {
+ return sourcePage.isDirty();
+ }
+
+ public List<MavenPomEditorPage> getPages() {
+ return pages;
+ }
+
+ public void showDependencyHierarchy(ArtifactKey artifactKey) {
+ setActivePage(dependencyTreePage.getId());
+ dependencyTreePage.selectDepedency(artifactKey);
+ }
+
+ private boolean checkedWritableStatus;
+ private boolean readOnly;
+ /** read/write check for read only pom files -- called when the file is opened
+ * and will validateEdit -- so files will be checked out of src control, etc
+ * Note: this is actually done separately from isReadOnly() because there are 2 notions of 'read only'
+ * for a POM. The first is for a file downloaded from a repo, like maven central. That one
+ * is never editable. The second is for a local file that is read only because its been marked
+ * that way by an SCM, etc. This method will do a one-time check/validateEdit for the life of the POM
+ * editor.
+ **/
+ protected boolean checkReadOnly(){
+ if(checkedWritableStatus){
+ return readOnly;
+ }
+ checkedWritableStatus = true;
+ if(getPomFile() != null && getPomFile().isReadOnly()){
+ IStatus validateEdit = ResourcesPlugin.getWorkspace().validateEdit(new IFile[]{getPomFile()}, getEditorSite().getShell());
+ if(!validateEdit.isOK()){
+ readOnly = true;
+ } else {
+ readOnly = isReadOnly();
+ }
+ } else {
+ readOnly = isReadOnly();
+ }
+ return readOnly;
+ }
+
+ /**
+ * Adapted from <code>org.eclipse.ui.texteditor.AbstractTextEditor.ActivationListener</code>
+ */
+ class MavenPomActivationListener implements IPartListener, IWindowListener {
+
+ private IWorkbenchPart activePart;
+
+ private boolean isHandlingActivation = false;
+
+
+ public MavenPomActivationListener(IPartService partService) {
+ partService.addPartListener(this);
+ PlatformUI.getWorkbench().addWindowListener(this);
+ }
+
+ public void dispose() {
+ getSite().getWorkbenchWindow().getPartService().removePartListener(this);
+ PlatformUI.getWorkbench().removeWindowListener(this);
+ }
+
+
+ // IPartListener
+
+ public void partActivated(IWorkbenchPart part) {
+ activePart = part;
+ handleActivation();
+ checkReadOnly();
+ }
+
+ public void partBroughtToTop(IWorkbenchPart part) {
+ }
+
+ public void partClosed(IWorkbenchPart part) {
+ }
+
+ public void partDeactivated(IWorkbenchPart part) {
+ activePart = null;
+ }
+
+ public void partOpened(IWorkbenchPart part) {
+ }
+
+ // IWindowListener
+
+ public void windowActivated(IWorkbenchWindow window) {
+ if(window == getEditorSite().getWorkbenchWindow()) {
+ /*
+ * Workaround for problem described in
+ * http://dev.eclipse.org/bugs/show_bug.cgi?id=11731
+ * Will be removed when SWT has solved the problem.
+ */
+ window.getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ handleActivation();
+ }
+ });
+ }
+ }
+
+ public void windowDeactivated(IWorkbenchWindow window) {
+ }
+
+ public void windowClosed(IWorkbenchWindow window) {
+ }
+
+ public void windowOpened(IWorkbenchWindow window) {
+ }
+
+ /**
+ * Handles the activation triggering a element state check in the editor.
+ */
+ void handleActivation() {
+ if(isHandlingActivation) {
+ return;
+ }
+
+ if(activePart == MavenPomEditor.this) {
+ isHandlingActivation = true;
+ final boolean[] changed = new boolean[] {false};
+ try {
+
+ ITextListener listener = new ITextListener() {
+ public void textChanged(TextEvent event) {
+ changed[0] = true;
+ }
+ };
+ if (sourcePage != null && sourcePage.getTextViewer() != null) {
+ sourcePage.getTextViewer().addTextListener(listener);
+ try {
+ sourcePage.safelySanityCheckState(getEditorInput());
+ } finally {
+ sourcePage.getTextViewer().removeTextListener(listener);
+ }
+ sourcePage.update();
+ }
+
+ if(changed[0]) {
+ try {
+ pomFile.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch(CoreException e) {
+ MavenLogger.log(e);
+ }
+ }
+
+ } finally {
+ isHandlingActivation = false;
+
+ }
+ }
+ }
+ }
+
+ public StructuredTextEditor getSourcePage() {
+ return sourcePage;
+ }
+
+ @Override
+ public IFormPage setActivePage(String pageId) {
+ if(pageId == null) {
+ setActivePage(sourcePageIndex);
+ }
+ return super.setActivePage(pageId);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ Object result = super.getAdapter(adapter);
+ if(result != null && Display.getCurrent() == null) {
+ return result;
+ }
+ return sourcePage.getAdapter(adapter);
+ }
+
+ public IFile getPomFile() {
+ return pomFile;
+ }
+
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorContributor.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorContributor.java
new file mode 100644
index 00000000..d10be490
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorContributor.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.ide.IDEActionFactory;
+import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorActionConstants;
+
+/**
+ * Manages the installation/deinstallation of global actions for multi-page
+ * editors. Responsible for the redirection of global actions to the active
+ * editor. Multi-page contributor replaces the contributors for the individual
+ * editors in the multi-page editor.
+ */
+public class MavenPomEditorContributor extends MultiPageEditorActionBarContributor {
+ private MavenPomEditor editorPart;
+
+ public void setActiveEditor(IEditorPart targetEditor) {
+ if (targetEditor instanceof MavenPomEditor) {
+ editorPart = (MavenPomEditor) targetEditor;
+ setActivePage(editorPart.getActiveEditor());
+ }
+ }
+
+ public void setActivePage(IEditorPart part) {
+ //set the text editor
+ IActionBars actionBars = getActionBars();
+ if(editorPart !=null) {
+ if (actionBars != null) {
+ actionBars.clearGlobalActionHandlers();
+
+ // undo/redo always enabled
+ actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), //
+ getAction(ITextEditorActionConstants.UNDO));
+ actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), //
+ getAction(ITextEditorActionConstants.REDO));
+
+ // all other action, for text editor only (FormPage doesn't provide for these actions...)
+ if (part instanceof ITextEditor) {
+ actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), //
+ getAction(ITextEditorActionConstants.DELETE));
+ actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), //
+ getAction(ITextEditorActionConstants.CUT));
+ actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), //
+ getAction(ITextEditorActionConstants.COPY));
+ actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), //
+ getAction(ITextEditorActionConstants.PASTE));
+ actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), //
+ getAction(ITextEditorActionConstants.SELECT_ALL));
+ actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), //
+ getAction(ITextEditorActionConstants.FIND));
+ actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), //
+ getAction(IDEActionFactory.BOOKMARK.getId()));
+ }
+
+ actionBars.updateActionBars();
+ }
+ }
+
+ }
+
+ /**
+ * Returns the action registered with the given text editor.
+ *
+ * @return IAction or null if editor is null.
+ */
+ protected IAction getAction(String actionId) {
+ if(editorPart != null) {
+ try {
+ return editorPart.getSourcePage().getAction(actionId);
+ } catch (NullPointerException e) {
+ //editor has been disposed, ignore
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java
new file mode 100644
index 00000000..25a6dfa1
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java
@@ -0,0 +1,620 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import static org.eclipse.m2e.editor.pom.FormUtils.isEmpty;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.ui.dialogs.InputHistory;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.Parent;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+
+/**
+ * This class provides basic page editor functionality (event listeners, readonly, etc)
+ *
+ * @author Anton Kraev
+ * @author Eugene Kuleshov
+ */
+public abstract class MavenPomEditorPage extends FormPage implements Adapter {
+
+ // parent editor
+ protected final MavenPomEditor pomEditor;
+
+ // model
+ protected Model model;
+
+ // Notifier target
+ protected Notifier target;
+
+ // are we already updating model
+ protected boolean updatingModel;
+
+ // have we loaded data?
+ private boolean dataLoaded;
+
+ private InputHistory inputHistory;
+
+ protected static PomPackage POM_PACKAGE = PomPackage.eINSTANCE;
+
+ protected Map<Object, List<ModifyListener>> modifyListeners = new HashMap<Object, List<ModifyListener>>();
+
+ public MavenPomEditorPage(MavenPomEditor pomEditor, String id, String title) {
+ super(pomEditor, id, title);
+ this.pomEditor = pomEditor;
+ this.inputHistory = new InputHistory(id);
+ }
+
+ public MavenPomEditor getPomEditor() {
+ return pomEditor;
+ }
+
+ @Override
+ protected void createFormContent(IManagedForm managedForm) {
+ ScrolledForm form = managedForm.getForm();
+ IToolBarManager toolBarManager = form.getToolBarManager();
+
+// toolBarManager.add(pomEditor.showAdvancedTabsAction);
+
+ toolBarManager.add(new Action(Messages.MavenPomEditorPage_action_open, MavenEditorImages.PARENT_POM) {
+ public void run() {
+ // XXX listen to parent modification and accordingly enable/disable action
+ final Parent parent = model.getParent();
+ if(parent!=null && !isEmpty(parent.getGroupId()) && !isEmpty(parent.getArtifactId()) && !isEmpty(parent.getVersion())) {
+ new Job(Messages.MavenPomEditorPage_job_opening) {
+ protected IStatus run(IProgressMonitor monitor) {
+ OpenPomAction.openEditor(parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), monitor);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ }
+ });
+
+
+ toolBarManager.add(new Action(Messages.MavenPomEditorPage_actio_refresh, MavenEditorImages.REFRESH) {
+ public void run() {
+ pomEditor.reload();
+ }
+ });
+
+ form.updateToolBar();
+
+ // compatibility proxy to support Eclipse 3.2
+ FormUtils.decorateHeader(managedForm.getToolkit(), form.getForm());
+
+ inputHistory.load();
+ }
+
+ public void setActive(boolean active) {
+ super.setActive(active);
+ doLoadData(active);
+
+ boolean readOnly = pomEditor.checkReadOnly();
+ FormUtils.setReadonly((Composite) getPartControl(), readOnly);
+ }
+
+ public boolean isReadOnly() {
+ return pomEditor.isReadOnly();
+ }
+
+ private void doLoadData(boolean active) {
+ if(active && !dataLoaded) {
+ dataLoaded = true;
+// new Job("Loading pom.xml") {
+// protected IStatus run(IProgressMonitor monitor) {
+ try {
+ model = pomEditor.readProjectDocument();
+ if(model != null) {
+ if (getPartControl() != null) {
+ getPartControl().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ updatingModel = true;
+ try {
+ loadData();
+ registerListeners();
+ } catch(Throwable e) {
+ MavenLogger.log("Error loading data", e); //$NON-NLS-1$
+ } finally {
+ updatingModel = false;
+ }
+ }
+ });
+ }
+ }
+
+ IFile pomFile = pomEditor.getPomFile();
+ if(pomFile!=null) {
+ IMarker[] markers = pomFile.findMarkers(IMavenConstants.MARKER_ID, true, IResource.DEPTH_ZERO);
+ if(markers != null && markers.length > 0) {
+ int severity = markers[0].getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO) == IMarker.SEVERITY_WARNING ? IMessageProvider.WARNING : IMessageProvider.ERROR;
+ setErrorMessage(markers[0].getAttribute(IMarker.MESSAGE, Messages.MavenPomEditorPage_error_unknown), severity);
+ } else {
+ setErrorMessage(null, IMessageProvider.NONE);
+ }
+ }
+
+ } catch(final CoreException ex) {
+ MavenLogger.log(ex);
+ final String msg = ex.getMessage();
+ setErrorMessage(msg, IMessageProvider.ERROR);
+ }
+
+ }
+ }
+
+ public void setErrorMessage(final String msg, final int severity) {
+ if(getPartControl()!=null && !getPartControl().isDisposed()) {
+ getPartControl().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (!getManagedForm().getForm().isDisposed()) {
+
+ FormUtils.setMessage(getManagedForm().getForm(), msg, severity);
+ }
+ }
+ });
+ }
+ }
+
+ public Notifier getTarget() {
+ return target;
+ }
+
+ public boolean isAdapterForType(Object type) {
+ return false;
+ }
+
+ public void reload() {
+ deRegisterListeners();
+ boolean oldDataLoaded = dataLoaded;
+ dataLoaded = false;
+ doLoadData(oldDataLoaded);
+ }
+
+ public synchronized void notifyChanged(Notification notification) {
+ if(updatingModel) {
+ return;
+ }
+
+ updatingModel = true;
+ try {
+ switch(notification.getEventType()) {
+ //TODO: fine-grained notification?
+ case Notification.ADD:
+ case Notification.MOVE:
+ case Notification.REMOVE:
+ case Notification.SET:
+ case Notification.UNSET:
+ case Notification.ADD_MANY: //this is for properties (clear/addAll is used for any properties update)
+ case Notification.REMOVE_MANY:
+ if (getManagedForm() != null)
+ updateView(notification);
+ break;
+
+ default:
+ break;
+
+ // case Notification.ADD_MANY:
+ // case Notification.REMOVE_MANY:
+ }
+
+ } catch(Exception ex) {
+ MavenLogger.log("Can't update view", ex); //$NON-NLS-1$
+ } finally {
+ updatingModel = false;
+ }
+
+ registerListeners();
+ }
+
+ public void dispose() {
+ inputHistory.save();
+
+ deRegisterListeners();
+
+ for(Map.Entry<Object, List<ModifyListener>> e : modifyListeners.entrySet()) {
+ Object control = e.getKey();
+ for(ModifyListener listener : e.getValue()) {
+ if(control instanceof Text) {
+ Text textControl = (Text) control;
+ if(!textControl.isDisposed()) {
+ textControl.removeModifyListener(listener);
+ }
+ } else if(control instanceof Combo) {
+ Combo comboControl = (Combo) control;
+ if(!comboControl.isDisposed()) {
+ comboControl.removeModifyListener(listener);
+ }
+ } else if(control instanceof CCombo) {
+ CCombo comboControl = (CCombo) control;
+ if(!comboControl.isDisposed()) {
+ comboControl.removeModifyListener(listener);
+ }
+ } else if(control instanceof Combo) {
+ Button buttonControl = (Button) control;
+ if(!buttonControl.isDisposed()) {
+ buttonControl.removeSelectionListener((SelectionListener) listener);
+ }
+ }
+ }
+ }
+
+ super.dispose();
+ }
+
+ public void setTarget(Notifier newTarget) {
+ this.target = newTarget;
+ }
+
+ public Model getModel() {
+ return model;
+ }
+
+ public EditingDomain getEditingDomain() {
+ return pomEditor.getEditingDomain();
+ }
+
+ public abstract void loadData();
+
+ public abstract void updateView(Notification notification);
+
+ public void registerListeners() {
+ if(model!=null) {
+ doRegister(model);
+
+ for(Iterator<?> it = model.eAllContents(); it.hasNext();) {
+ Object next = it.next();
+ if (next instanceof EObject)
+ doRegister((EObject) next);
+ }
+ }
+ }
+
+ private void doRegister(EObject object) {
+ if (!object.eAdapters().contains(this)) {
+ object.eAdapters().add(this);
+ }
+ }
+
+ public void deRegisterListeners() {
+ if(model!=null) {
+ model.eAdapters().remove(this);
+ for(Iterator<?> it = model.eAllContents(); it.hasNext(); ) {
+ Object next = it.next();
+ if(next instanceof EObject) {
+ EObject object = (EObject) next;
+ object.eAdapters().remove(this);
+ }
+ }
+ }
+ }
+
+ public <T> void setModifyListener(final Text textControl, ValueProvider<T> owner, EStructuralFeature feature,
+ String defaultValue) {
+ if(textControl!=null && !textControl.isDisposed()) {
+ List<ModifyListener> listeners = getModifyListeners(textControl);
+ for(ModifyListener listener : listeners) {
+ textControl.removeModifyListener(listener);
+ }
+ listeners.clear();
+ ModifyListener listener = setModifyListener(new TextAdapter() {
+ public String getText() {
+ return textControl.getText();
+ }
+ public void addModifyListener(ModifyListener listener) {
+ textControl.addModifyListener(listener);
+ }
+ }, owner, feature, defaultValue);
+ listeners.add(listener);
+ }
+ }
+
+ public <T> void setModifyListener(final Combo control, ValueProvider<T> owner, EStructuralFeature feature) {
+ if(control!=null && !control.isDisposed()) {
+ List<ModifyListener> listeners = getModifyListeners(control);
+ for(ModifyListener listener : listeners) {
+ control.removeModifyListener(listener);
+ }
+ listeners.clear();
+ ModifyListener listener = setModifyListener(new TextAdapter() {
+ public String getText() {
+ return control.getText();
+ }
+ public void addModifyListener(ModifyListener listener) {
+ control.addModifyListener(listener);
+ }
+ }, owner, feature, null);
+ listeners.add(listener);
+ }
+ }
+
+ public <T> void setModifyListener(final CCombo control, ValueProvider<T> owner, EStructuralFeature feature,
+ String defaultValue) {
+ if(control!=null && !control.isDisposed()) {
+ List<ModifyListener> listeners = getModifyListeners(control);
+ for(ModifyListener listener : listeners) {
+ control.removeModifyListener(listener);
+ }
+ listeners.clear();
+ ModifyListener listener = setModifyListener(new TextAdapter() {
+ public String getText() {
+ return control.getText();
+ }
+ public void addModifyListener(ModifyListener listener) {
+ control.addModifyListener(listener);
+ }
+ }, owner, feature, defaultValue);
+ listeners.add(listener);
+ }
+ }
+
+ private <T> ModifyListener setModifyListener(final TextAdapter adapter, final ValueProvider<T> provider,
+ final EStructuralFeature feature, final String defaultValue) {
+ ModifyListener listener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ T owner = provider.getValue();
+ CompoundCommand compoundCommand = new CompoundCommand();
+ if(owner==null && !provider.isEmpty()) {
+ owner = provider.create(getEditingDomain(), compoundCommand);
+ }
+
+ Command command;
+ if(adapter.getText().equals(defaultValue) || isEmpty(adapter.getText())) {
+ command = SetCommand.create(getEditingDomain(), owner, feature, SetCommand.UNSET_VALUE);
+ } else {
+ command = SetCommand.create(getEditingDomain(), owner, feature, adapter.getText());
+ }
+ compoundCommand.append(command);
+ //MNGECLIPSE-1854
+ //the semantics of isEmpty() is probably not entirely correct for this context
+ // as it only takes the fields shown in ui into account, but there could be others, not
+ // managed by this valueprovider
+ if (provider.isEmpty() && owner != null) {
+ //in a way this stuff shall be recursive and remove everything that is empty all the way up..
+ command = RemoveCommand.create(getEditingDomain(), owner);
+ compoundCommand.append(command);
+ }
+ getEditingDomain().getCommandStack().execute(compoundCommand);
+ registerListeners();
+ }
+ };
+ adapter.addModifyListener(listener);
+ return listener;
+ }
+
+ public <T> void setModifyListener(final Button control, final ValueProvider<T> provider,
+ final EStructuralFeature feature, final String defaultValue) {
+ if(control!=null && !control.isDisposed()) {
+ List<ModifyListener> listeners = getModifyListeners(control);
+ for(ModifyListener listener : listeners) {
+ control.removeSelectionListener((SelectionListener) listener);
+ }
+
+ listeners.clear();
+
+ class ButtonModifyListener extends SelectionAdapter implements ModifyListener {
+ public void widgetSelected(SelectionEvent e) {
+ T owner = provider.getValue();
+ if(owner == null && !provider.isEmpty()) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ provider.create(getEditingDomain(), compoundCommand);
+ getEditingDomain().getCommandStack().execute(compoundCommand);
+ owner = provider.getValue();
+ }
+
+ String value = control.getSelection() ? "true" : "false";
+ Command command = SetCommand.create(getEditingDomain(), owner, feature, //
+ defaultValue.equals(value) ? null : value);
+ getEditingDomain().getCommandStack().execute(command);
+ registerListeners();
+ }
+
+ public void modifyText(ModifyEvent e) {
+ widgetSelected(null);
+ }
+ };
+
+ ButtonModifyListener listener = new ButtonModifyListener();
+ control.addSelectionListener(listener);
+
+ listeners.add(listener);
+ }
+ }
+
+ public void removeNotifyListener(Text control) {
+ List<ModifyListener> listeners = getModifyListeners(control);
+ for(ModifyListener listener : listeners) {
+ if(!control.isDisposed()) {
+ control.removeModifyListener(listener);
+ }
+ }
+ listeners.clear();
+ }
+
+ public void removeNotifyListener(CCombo control) {
+ List<ModifyListener> listeners = getModifyListeners(control);
+ for(ModifyListener listener : listeners) {
+ if(!control.isDisposed()) {
+ control.removeModifyListener(listener);
+ }
+ }
+ listeners.clear();
+ }
+
+ public void removeNotifyListener(Combo control) {
+ List<ModifyListener> listeners = getModifyListeners(control);
+ for(ModifyListener listener : listeners) {
+ if(!control.isDisposed()) {
+ control.removeModifyListener(listener);
+ }
+ }
+ listeners.clear();
+ }
+
+ public void removeNotifyListener(Button button) {
+ List<ModifyListener> listeners = getModifyListeners(button);
+ for(ModifyListener listener : listeners) {
+ if(!button.isDisposed()) {
+ button.removeSelectionListener((SelectionAdapter) listener);
+ }
+ }
+ listeners.clear();
+ }
+
+ private List<ModifyListener> getModifyListeners(Object control) {
+ List<ModifyListener> listeners = modifyListeners.get(control);
+ if (listeners == null) {
+ listeners = new ArrayList<ModifyListener>();
+ modifyListeners.put(control, listeners);
+ }
+ return listeners;
+ }
+
+ public IMavenProjectFacade findModuleProject(String moduleName) {
+ IFile pomFile = pomEditor.getPomFile();
+ if(pomFile != null) {
+ return findModuleProject(pomFile, moduleName);
+ }
+ return null;
+ }
+
+ private IMavenProjectFacade findModuleProject(IFile pomFile, String module) {
+ IPath modulePath = pomFile.getParent().getLocation();
+ if (modulePath == null) return null;
+ modulePath = modulePath.append(module);
+ //it's possible to have the pom file name in the module path..
+ if (!modulePath.lastSegment().endsWith("pom.xml")) { //$NON-NLS-1$
+ modulePath = modulePath.append("pom.xml"); //$NON-NLS-1$
+ }
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectFacade[] facades = projectManager.getProjects();
+ for(int i = 0; i < facades.length; i++ ) {
+ if(facades[i].getPom().getLocation().equals(modulePath)) {
+ return facades[i];
+ }
+ }
+ return null;
+ }
+
+ public IFile findModuleFile(String moduleName) {
+ IFile pomFile = pomEditor.getPomFile();
+ if(pomFile!=null) {
+ IPath modulePath = pomFile.getParent().getLocation();
+ if (modulePath == null) return null;
+ modulePath = modulePath.append(moduleName);
+ //it's possible to have the pom file name in the module path..
+ if (!modulePath.lastSegment().endsWith("pom.xml")) { //$NON-NLS-1$
+ modulePath = modulePath.append("pom.xml"); //$NON-NLS-1$
+ }
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(modulePath);
+ return file;
+ }
+ return null;
+ }
+
+ public void initPopupMenu(Viewer viewer, String id) {
+ MenuManager menuMgr = new MenuManager("#PopupMenu-" + id); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+
+ Menu menu = menuMgr.createContextMenu(viewer.getControl());
+
+ viewer.getControl().setMenu(menu);
+
+ getEditorSite().registerContextMenu(MavenPomEditor.EDITOR_ID + id, menuMgr, viewer, false);
+ }
+
+ /*
+ * returns added/removed/updated EObject from notification (convenience method for detail forms)
+ */
+ public static Object getFromNotification(Notification notification) {
+ if(notification.getFeature() != null && !(notification.getFeature() instanceof EAttribute)) {
+ // for structuralFeatures, return new value (for insert/delete)
+ return notification.getNewValue();
+ } else {
+ // for attributes, return the notifier as it contains all new attributes (attribute modified)
+ return notification.getNotifier();
+ }
+ }
+
+ /**
+ * Adapter for Text, Combo and CCombo widgets
+ */
+ public interface TextAdapter {
+ String getText();
+ void addModifyListener(ModifyListener listener);
+ }
+
+ public IProject getProject() {
+ IFile pomFile = pomEditor.getPomFile();
+ return pomFile != null? pomFile.getProject(): null;
+ }
+
+ protected void addToHistory(Control control) {
+ inputHistory.add(control);
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPageFactory.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPageFactory.java
new file mode 100644
index 00000000..1560d66c
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPageFactory.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+/**
+ * A factory for creating POMeditor pages
+ *
+ * @author Eugene Kuleshov
+ */
+public abstract class MavenPomEditorPageFactory {
+
+ public abstract void addPages(MavenPomEditor pomEditor);
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ModulesLabelProvider.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ModulesLabelProvider.java
new file mode 100644
index 00000000..3a1d3e48
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ModulesLabelProvider.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.composites.StringLabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+public class ModulesLabelProvider extends StringLabelProvider {
+
+ private final MavenPomEditorPage editorPage;
+
+ public ModulesLabelProvider(MavenPomEditorPage editorPage) {
+ super(MavenEditorImages.IMG_JAR);
+ this.editorPage = editorPage;
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ if(element instanceof String) {
+ String moduleName = (String) element;
+ IMavenProjectFacade projectFacade = editorPage.findModuleProject(moduleName);
+ if(projectFacade!=null) {
+ return MavenEditorImages.IMG_PROJECT;
+ }
+
+ IFile moduleFile = editorPage.findModuleFile(moduleName);
+ if(moduleFile!=null && moduleFile.isAccessible()) {
+ return MavenEditorImages.IMG_PROJECT;
+ }
+ }
+ return super.getImage(element);
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/NotificationCommandStack.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/NotificationCommandStack.java
new file mode 100644
index 00000000..c389d7b4
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/NotificationCommandStack.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.jface.text.IUndoManager;
+
+/**
+ * @author Anton Kraev
+ */
+public class NotificationCommandStack extends BasicCommandStack {
+
+ private MavenPomEditor editor;
+ private List<MavenPomEditorPage> pages;
+ private boolean isDirty = false;
+
+ public NotificationCommandStack(MavenPomEditor editor) {
+ this.editor = editor;
+ this.pages = editor.getPages();
+ }
+
+ @Override
+ public void execute(Command command) {
+ processCommand(command, false);
+
+ IUndoManager undoManager = editor.getSourcePage().getTextViewer().getUndoManager();
+ undoManager.beginCompoundChange();
+ try {
+ super.execute(command);
+ } finally {
+ undoManager.endCompoundChange();
+ }
+
+ processCommand(command, true);
+ fireDirty();
+ }
+
+ private void processCommand(Command command, boolean add) {
+ if (command instanceof CompoundCommand) {
+ CompoundCommand compoundCommand = (CompoundCommand) command;
+ Iterator<Command> commands = compoundCommand.getCommandList().iterator();
+ while (commands.hasNext()) {
+ processCommand(commands.next(), add);
+ }
+ }
+
+ if (command instanceof AddCommand) {
+ AddCommand addCommand = (AddCommand) command;
+ Iterator<?> it = addCommand.getCollection().iterator();
+ while (it.hasNext()) {
+ processListeners(it.next(), add);
+ }
+ }
+
+ if (command instanceof SetCommand) {
+ SetCommand setCommand = (SetCommand) command;
+ processListeners(setCommand.getValue(), add);
+ }
+
+ if (command instanceof RemoveCommand) {
+ RemoveCommand removeCommand = (RemoveCommand) command;
+ Collection<?> collection = removeCommand.getCollection();
+ if(collection!=null) {
+ Iterator<?> it = collection.iterator();
+ while (it.hasNext()) {
+ Object next = it.next();
+ if (next instanceof EObject) {
+ EObject object = (EObject) next;
+ for (int i=0; i<pages.size(); i++) {
+ object.eAdapters().remove(pages.get(i));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void processListeners(Object next, boolean add) {
+ if (next instanceof EObject) {
+ EObject object = (EObject) next;
+ for (int i=0; i<pages.size(); i++) {
+ if (add) {
+ if (!object.eAdapters().contains(pages.get(i)))
+ object.eAdapters().add(pages.get(i));
+ } else {
+ object.eAdapters().remove(pages.get(i));
+ }
+ }
+ }
+ }
+
+ @Override
+ public void redo() {
+ super.redo();
+ fireDirty();
+ }
+
+ private void fireDirty() {
+ if (isDirty != isSaveNeeded()) {
+ editor.editorDirtyStateChanged();
+ }
+ isDirty = isSaveNeeded();
+ }
+
+ @Override
+ public void undo() {
+ super.undo();
+ fireDirty();
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java
new file mode 100644
index 00000000..dc90abc6
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/OverviewPage.java
@@ -0,0 +1,1442 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import static org.eclipse.m2e.editor.pom.FormUtils.isEmpty;
+import static org.eclipse.m2e.editor.pom.FormUtils.nvl;
+import static org.eclipse.m2e.editor.pom.FormUtils.setText;
+
+import java.util.Collections;
+import java.util.HashSet;
+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.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.ProjectUpdater;
+import org.eclipse.m2e.core.index.IIndex;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.ui.dialogs.MavenRepositorySearchDialog;
+import org.eclipse.m2e.core.util.M2EUtils;
+import org.eclipse.m2e.core.util.ProposalUtil;
+import org.eclipse.m2e.core.util.search.Packaging;
+import org.eclipse.m2e.core.wizards.MavenModuleWizard;
+import org.eclipse.m2e.core.wizards.MavenProjectSelectionDialog;
+import org.eclipse.m2e.core.wizards.WidthGroup;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.composites.ListEditorComposite;
+import org.eclipse.m2e.editor.composites.ListEditorContentProvider;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.model.edit.pom.CiManagement;
+import org.eclipse.m2e.model.edit.pom.IssueManagement;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.Organization;
+import org.eclipse.m2e.model.edit.pom.Parent;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+import org.eclipse.m2e.model.edit.pom.Scm;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
+import org.eclipse.ui.forms.events.ExpansionEvent;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ResourceTransfer;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class OverviewPage extends MavenPomEditorPage {
+
+ //controls
+ Text artifactIdText;
+
+ Text artifactVersionText;
+
+ Text artifactGroupIdText;
+
+ CCombo artifactPackagingCombo;
+
+ Text parentVersionText;
+
+ Text parentArtifactIdText;
+
+ Text parentGroupIdText;
+
+ Text parentRelativePathText;
+
+ Text projectUrlText;
+
+ Text projectNameText;
+
+ Text projectDescriptionText;
+
+ Text inceptionYearText;
+
+ Text organizationUrlText;
+
+ Text organizationNameText;
+
+ Text scmUrlText;
+
+ Text scmDevConnectionText;
+
+ Text scmConnectionText;
+
+ Text scmTagText;
+
+ CCombo issueManagementSystemCombo;
+
+ CCombo issueManagementUrlCombo;
+
+ CCombo ciManagementUrlCombo;
+
+ CCombo ciManagementSystemCombo;
+
+ ListEditorComposite<String> modulesEditor;
+
+ PropertiesSection propertiesSection;
+
+ Section modulesSection;
+
+ Section parentSection;
+
+ Section projectSection;
+
+ Section organizationSection;
+
+ Section scmSection;
+
+ Section issueManagementSection;
+
+ Section ciManagementSection;
+
+// private Action newModuleProjectAction;
+
+ private Action newModuleElementAction;
+
+ private Action parentSelectAction;
+
+ private Action parentOpenAction;
+
+ private StackLayout modulesStack;
+
+ private Composite noModules;
+
+ private Composite modulesSectionComposite;
+
+ protected GridData projectSectionData;
+
+ public OverviewPage(MavenPomEditor pomEditor) {
+ super(pomEditor, IMavenConstants.PLUGIN_ID + ".pom.overview", Messages.OverviewPage_title); //$NON-NLS-1$
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ FormToolkit toolkit = managedForm.getToolkit();
+ ScrolledForm form = managedForm.getForm();
+ form.setText(Messages.OverviewPage_form);
+
+ Composite body = form.getBody();
+ GridLayout gridLayout = new GridLayout(2, true);
+ gridLayout.horizontalSpacing = 7;
+ body.setLayout(gridLayout);
+ toolkit.paintBordersFor(body);
+
+ Composite leftComposite = toolkit.createComposite(body, SWT.NONE);
+ leftComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ GridLayout leftCompositeLayout = new GridLayout();
+ leftCompositeLayout.marginWidth = 0;
+ leftCompositeLayout.marginHeight = 0;
+ leftComposite.setLayout(leftCompositeLayout);
+
+ WidthGroup leftWidthGroup = new WidthGroup();
+ leftComposite.addControlListener(leftWidthGroup);
+
+ createArtifactSection(toolkit, leftComposite, leftWidthGroup);
+ createParentsection(toolkit, leftComposite, leftWidthGroup);
+ createPropertiesSection(toolkit, leftComposite, leftWidthGroup);
+ createModulesSection(toolkit, leftComposite, leftWidthGroup);
+
+ Composite rightComposite = toolkit.createComposite(body, SWT.NONE);
+ rightComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ GridLayout rightCompositeLayout = new GridLayout();
+ rightCompositeLayout.marginWidth = 0;
+ rightCompositeLayout.marginHeight = 0;
+ rightComposite.setLayout(rightCompositeLayout);
+
+ WidthGroup rightWidthGroup = new WidthGroup();
+ rightComposite.addControlListener(rightWidthGroup);
+
+ createProjectSection(toolkit, rightComposite, rightWidthGroup);
+ createOrganizationSection(toolkit, rightComposite, rightWidthGroup);
+ createScmSection(toolkit, rightComposite, rightWidthGroup);
+ createIssueManagementSection(toolkit, rightComposite, rightWidthGroup);
+ createCiManagementSection(toolkit, rightComposite, rightWidthGroup);
+
+ toolkit.paintBordersFor(leftComposite);
+ toolkit.paintBordersFor(rightComposite);
+
+ super.createFormContent(managedForm);
+ }
+
+ private void createArtifactSection(FormToolkit toolkit, Composite composite, WidthGroup widthGroup) {
+ Section artifactSection = toolkit.createSection(composite, ExpandableComposite.TITLE_BAR);
+ artifactSection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ artifactSection.setText(Messages.OverviewPage_section_artifact);
+
+ Composite artifactComposite = toolkit.createComposite(artifactSection, SWT.NONE);
+ toolkit.adapt(artifactComposite);
+ GridLayout gridLayout = new GridLayout(2, false);
+ gridLayout.marginBottom = 5;
+ gridLayout.marginHeight = 2;
+ gridLayout.marginWidth = 1;
+ artifactComposite.setLayout(gridLayout);
+ artifactSection.setClient(artifactComposite);
+
+ Label groupIdLabel = toolkit.createLabel(artifactComposite, Messages.OverviewPage_lblGroupId, SWT.NONE);
+
+ artifactGroupIdText = toolkit.createText(artifactComposite, null, SWT.NONE);
+ artifactGroupIdText.setData("name", "groupId"); //$NON-NLS-1$ //$NON-NLS-2$
+ GridData gd_artifactGroupIdText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_artifactGroupIdText.horizontalIndent = 4;
+ artifactGroupIdText.setLayoutData(gd_artifactGroupIdText);
+ ProposalUtil.addGroupIdProposal(getProject(), artifactGroupIdText, Packaging.ALL);
+
+ Label artifactIdLabel = toolkit.createLabel(artifactComposite, Messages.OverviewPage_lblArtifactId, SWT.NONE);
+
+ artifactIdText = toolkit.createText(artifactComposite, null, SWT.NONE);
+ artifactIdText.setData("name", "artifactId"); //$NON-NLS-1$ //$NON-NLS-2$
+ GridData gd_artifactIdText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_artifactIdText.horizontalIndent = 4;
+ artifactIdText.setLayoutData(gd_artifactIdText);
+ M2EUtils.addRequiredDecoration(artifactIdText);
+
+ Label versionLabel = toolkit.createLabel(artifactComposite, Messages.OverviewPage_lblVersion, SWT.NONE);
+
+ artifactVersionText = toolkit.createText(artifactComposite, null, SWT.NONE);
+ GridData gd_versionText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_versionText.horizontalIndent = 4;
+ gd_versionText.widthHint = 200;
+ artifactVersionText.setLayoutData(gd_versionText);
+ artifactVersionText.setData("name", "version"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Label packagingLabel = toolkit.createLabel(artifactComposite, Messages.OverviewPage_lblPackaging, SWT.NONE);
+
+ artifactPackagingCombo = new CCombo(artifactComposite, SWT.FLAT);
+
+ artifactPackagingCombo.add("jar"); //$NON-NLS-1$
+ artifactPackagingCombo.add("war"); //$NON-NLS-1$
+ artifactPackagingCombo.add("ejb"); //MNGECLIPSE-688 : add EAR & EJB Support //$NON-NLS-1$
+ artifactPackagingCombo.add("ear"); //$NON-NLS-1$
+ artifactPackagingCombo.add("pom"); //$NON-NLS-1$
+ artifactPackagingCombo.add("maven-plugin"); //$NON-NLS-1$
+// uncomment this only if you are able to not to break the project
+// artifactPackagingCombo.add("osgi-bundle");
+// artifactPackagingCombo.add("eclipse-feature");
+
+ toolkit.adapt(artifactPackagingCombo, true, true);
+ GridData gd_packagingText = new GridData(SWT.LEFT, SWT.CENTER, true, false);
+ gd_packagingText.horizontalIndent = 4;
+ gd_packagingText.widthHint = 120;
+ artifactPackagingCombo.setLayoutData(gd_packagingText);
+ artifactPackagingCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ artifactPackagingCombo.setData("name", "packaging"); //$NON-NLS-1$ //$NON-NLS-2$
+ toolkit.paintBordersFor(artifactPackagingCombo);
+
+ widthGroup.addControl(groupIdLabel);
+ widthGroup.addControl(artifactIdLabel);
+ widthGroup.addControl(versionLabel);
+ widthGroup.addControl(packagingLabel);
+
+ toolkit.paintBordersFor(artifactComposite);
+ }
+
+ private void createParentsection(FormToolkit toolkit, Composite composite, WidthGroup widthGroup) {
+ parentSection = toolkit.createSection(composite, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ parentSection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ parentSection.setText(Messages.OverviewPage_section_parent);
+ parentSection.setData("name", "parentSection"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ parentSelectAction = new Action(Messages.OverviewPage_action_selectParent, MavenEditorImages.SELECT_ARTIFACT) {
+ public void run() {
+ // calculate current list of artifacts for the project - that's the current parent..
+ Set<ArtifactKey> current = new HashSet<ArtifactKey>();
+ String parentGroup = parentGroupIdText.getText();
+ String parentArtifact = parentArtifactIdText.getText();
+ String parentVersion = parentVersionText.getText();
+ if (parentGroup != null && parentArtifact != null && parentVersion != null) {
+ current.add(new ArtifactKey(parentGroup, parentArtifact, parentVersion, null));
+ }
+ MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getEditorSite().getShell(), //
+ Messages.OverviewPage_searchDialog_selectParent, IIndex.SEARCH_PARENTS,
+ current, Collections.<ArtifactKey>emptySet(), false);
+ if(parentGroup != null && parentGroup.trim().length() != 0) {
+ //chances are we will get good match by adding the groupid here..
+ dialog.setQuery(parentGroupIdText.getText());
+ } else if(artifactGroupIdText.getText() != null && artifactGroupIdText.getText().trim().length() != 0) {
+ //chances are we will get good match by adding the groupid here..
+ dialog.setQuery(artifactGroupIdText.getText());
+ }
+ if(dialog.open() == Window.OK) {
+ IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+ if(af != null) {
+ String grid = nvl(af.group);
+ String ver = nvl(af.version);
+ parentGroupIdText.setText(grid);
+ parentArtifactIdText.setText(nvl(af.artifact));
+ parentVersionText.setText(ver);
+
+ //promote good practices ->
+ if(grid.equals(artifactGroupIdText.getText())) {
+ //if the groupId is the same, just remove it in child.
+ artifactGroupIdText.setText(""); //$NON-NLS-1$
+ }
+ if(ver.equals(artifactVersionText.getText())) {
+ //if the version is the same, just remove it in child.
+ artifactVersionText.setText(""); //$NON-NLS-1$
+ }
+ parentSection.setExpanded(true);
+ }
+ }
+ }
+ };
+ parentSelectAction.setEnabled(false);
+
+ parentOpenAction = new Action(Messages.OverviewPage_job_open, MavenEditorImages.PARENT_POM) {
+ public void run() {
+ final String groupId = parentGroupIdText.getText();
+ final String artifactId = parentArtifactIdText.getText();
+ final String version = parentVersionText.getText();
+ new Job(NLS.bind(Messages.OverviewPage_job, new Object[] {groupId, artifactId, version})) {
+ protected IStatus run(IProgressMonitor monitor) {
+ OpenPomAction.openEditor(groupId, artifactId, version, monitor);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ };
+ parentOpenAction.setEnabled(false);
+
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+ toolBarManager.add(parentOpenAction);
+ toolBarManager.add(parentSelectAction);
+
+ Composite toolbarComposite = toolkit.createComposite(parentSection);
+ GridLayout toolbarLayout = new GridLayout(1, true);
+ toolbarLayout.marginHeight = 0;
+ toolbarLayout.marginWidth = 0;
+ toolbarComposite.setLayout(toolbarLayout);
+ toolbarComposite.setBackground(null);
+
+ toolBarManager.createControl(toolbarComposite);
+ parentSection.setTextClient(toolbarComposite);
+
+ Composite parentComposite = toolkit.createComposite(parentSection, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2, false);
+ gridLayout.marginBottom = 5;
+ gridLayout.marginWidth = 1;
+ gridLayout.marginHeight = 2;
+ parentComposite.setLayout(gridLayout);
+ parentSection.setClient(parentComposite);
+
+ Label parentGroupIdLabel = toolkit.createLabel(parentComposite, Messages.OverviewPage_lblGroupId2, SWT.NONE);
+
+ parentGroupIdText = toolkit.createText(parentComposite, null, SWT.NONE);
+ GridData gd_parentGroupIdText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_parentGroupIdText.horizontalIndent = 4;
+ parentGroupIdText.setLayoutData(gd_parentGroupIdText);
+ parentGroupIdText.setData("name", "parentGroupId"); //$NON-NLS-1$ //$NON-NLS-2$
+ ProposalUtil.addGroupIdProposal(getProject(), parentGroupIdText, Packaging.POM);
+ M2EUtils.addRequiredDecoration(parentGroupIdText);
+
+ final Label parentArtifactIdLabel = toolkit.createLabel(parentComposite, Messages.OverviewPage_lblArtifactId,
+ SWT.NONE);
+
+ parentArtifactIdText = toolkit.createText(parentComposite, null, SWT.NONE);
+ GridData gd_parentArtifactIdText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_parentArtifactIdText.horizontalIndent = 4;
+ parentArtifactIdText.setLayoutData(gd_parentArtifactIdText);
+ parentArtifactIdText.setData("name", "parentArtifactId"); //$NON-NLS-1$ //$NON-NLS-2$
+ ProposalUtil.addArtifactIdProposal(getProject(), parentGroupIdText, parentArtifactIdText, Packaging.POM);
+ M2EUtils.addRequiredDecoration(parentArtifactIdText);
+
+ Label parentVersionLabel = toolkit.createLabel(parentComposite, Messages.OverviewPage_lblVersion2, SWT.NONE);
+ parentVersionLabel.setLayoutData(new GridData());
+
+ parentVersionText = toolkit.createText(parentComposite, null, SWT.NONE);
+ GridData parentVersionTextData = new GridData(SWT.LEFT, SWT.CENTER, true, false);
+ parentVersionTextData.horizontalIndent = 4;
+ parentVersionTextData.widthHint = 200;
+ parentVersionText.setLayoutData(parentVersionTextData);
+ parentVersionText.setData("name", "parentVersion"); //$NON-NLS-1$ //$NON-NLS-2$
+ ProposalUtil.addVersionProposal(getProject(), parentGroupIdText, parentArtifactIdText, parentVersionText,
+ Packaging.POM);
+ M2EUtils.addRequiredDecoration(parentVersionText);
+
+ ModifyListener ml = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ String text1 = parentArtifactIdText.getText().trim();
+ String text2 = parentGroupIdText.getText().trim();
+ String text3 = parentVersionText.getText().trim();
+ if(text1.length() > 0 && text2.length() > 0 && text3.length() > 0) {
+ parentOpenAction.setEnabled(true);
+ } else {
+ parentOpenAction.setEnabled(false);
+ }
+ }
+ };
+ parentArtifactIdText.addModifyListener(ml);
+ parentVersionText.addModifyListener(ml);
+ parentGroupIdText.addModifyListener(ml);
+
+// Button parentSelectButton = toolkit.createButton(parentComposite, "Select...", SWT.NONE);
+// parentSelectButton.addSelectionListener(new SelectionAdapter() {
+// public void widgetSelected(SelectionEvent e) {
+// // TODO calculate current list of artifacts for the project
+// Set<Artifact> artifacts = Collections.emptySet();
+// MavenRepositorySearchDialog dialog = new MavenRepositorySearchDialog(getEditorSite().getShell(),
+// "Add Dependency", IndexManager.SEARCH_ARTIFACT, artifacts);
+// if(dialog.open() == Window.OK) {
+// IndexedArtifactFile af = (IndexedArtifactFile) dialog.getFirstResult();
+// if(af != null) {
+// parentGroupIdText.setText(nvl(af.group));
+// parentArtifactIdText.setText(nvl(af.artifact));
+// parentVersionText.setText(nvl(af.version));
+// }
+// }
+// }
+// });
+
+ Label parentRealtivePathLabel = toolkit.createLabel(parentComposite, Messages.OverviewPage_lblRelPath, SWT.NONE);
+
+ parentRelativePathText = toolkit.createText(parentComposite, null, SWT.NONE);
+ GridData gd_parentRelativePathText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_parentRelativePathText.horizontalIndent = 4;
+ parentRelativePathText.setLayoutData(gd_parentRelativePathText);
+ parentRelativePathText.setData("name", "parentRelativePath"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ widthGroup.addControl(parentGroupIdLabel);
+ widthGroup.addControl(parentArtifactIdLabel);
+ widthGroup.addControl(parentVersionLabel);
+ widthGroup.addControl(parentRealtivePathLabel);
+
+ toolkit.paintBordersFor(parentComposite);
+ parentComposite.setTabList(new Control[] {parentGroupIdText, parentArtifactIdText, parentVersionText,
+ parentRelativePathText});
+ }
+
+ private void createPropertiesSection(FormToolkit toolkit, Composite composite, WidthGroup widthGroup) {
+ propertiesSection = new PropertiesSection(toolkit, composite, getEditingDomain());
+ }
+
+ private void createModulesSection(FormToolkit toolkit, Composite composite, WidthGroup widthGroup) {
+ // XXX should disable Modules actions based on artifact packaging and only add modules when packaging is "pom"
+
+ modulesSection = toolkit.createSection(composite, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ modulesSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ modulesSection.setText(Messages.OverviewPage_section_modules);
+ modulesSection.setData("name", "modulesSection"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ modulesSectionComposite = toolkit.createComposite(modulesSection);
+ modulesStack = new StackLayout();
+ modulesSectionComposite.setLayout(modulesStack);
+ modulesSection.setClient(modulesSectionComposite);
+
+ noModules = toolkit.createComposite(modulesSectionComposite);
+ noModules.setLayout(new GridLayout(1, false));
+
+ Label label = toolkit.createLabel(noModules, Messages.OverviewPage_msg_not_pom_packaging);
+ GridData gd_label = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
+ gd_label.verticalIndent = 12;
+ gd_label.horizontalIndent = 12;
+ label.setLayoutData(gd_label);
+
+ modulesEditor = new ListEditorComposite<String>(modulesSectionComposite, SWT.NONE, true);
+ modulesEditor.getViewer().getTable().setData("name", "modulesEditor"); //$NON-NLS-1$ //$NON-NLS-2$
+ toolkit.paintBordersFor(modulesEditor);
+ toolkit.adapt(modulesEditor);
+
+ modulesEditor.setContentProvider(new ListEditorContentProvider<String>());
+ modulesEditor.setLabelProvider(new ModulesLabelProvider(this));
+
+ modulesEditor.setOpenListener(new IOpenListener() {
+ public void open(OpenEvent openevent) {
+ final List<String> selection = modulesEditor.getSelection();
+ new Job(Messages.OverviewPage_opening_editors) {
+ protected IStatus run(IProgressMonitor monitor) {
+ for(String module : selection) {
+ IMavenProjectFacade projectFacade = findModuleProject(module);
+ if(projectFacade != null) {
+ ArtifactKey key = projectFacade.getArtifactKey();
+ OpenPomAction.openEditor(key.getGroupId(), key.getArtifactId(), key.getVersion(), monitor);
+ } else {
+ IFile modulePom = findModuleFile(module);
+ if(modulePom != null && modulePom.isAccessible()) {
+ OpenPomAction.openEditor(new FileEditorInput(modulePom), "pom.xml"); //$NON-NLS-1$
+ }
+ }
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ });
+
+ modulesEditor.setAddButtonListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ final Set<Object> moduleContainers = new HashSet<Object>();
+ for(String module : model.getModules()) {
+ IMavenProjectFacade facade = findModuleProject(module);
+ if(facade != null) {
+ moduleContainers.add(facade.getProject().getLocation());
+ }
+ IFile file = findModuleFile(module);
+ if(file != null) {
+ moduleContainers.add(file.getParent().getLocation());
+ }
+ }
+ moduleContainers.add(getProject().getLocation());
+ final boolean[] updateParentSection = new boolean[] {true};
+
+ MavenProjectSelectionDialog dialog = new MavenProjectSelectionDialog(getSite().getShell(), true) {
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Control control = super.createDialogArea(parent);
+
+ final TreeViewer viewer = getViewer();
+ viewer.setLabelProvider(new ProjectLabelProvider());
+ viewer.getTree().addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if(e.detail == SWT.CHECK) {
+ TreeItem item = (TreeItem) e.item;
+ Object data = item.getData();
+ if(item.getChecked() && data instanceof IResource
+ && moduleContainers.contains(((IResource) data).getLocation())) {
+ item.setChecked(false);
+ }
+ }
+ }
+ });
+ viewer.getTree().setFocus();
+
+ final Button checkbox = new Button((Composite) control, SWT.CHECK);
+ checkbox.setSelection(false);
+ checkbox.setText(Messages.OverviewPage_updateModulePoms);
+ checkbox.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateParentSection[0] = checkbox.getSelection();
+ }
+ });
+
+ return control;
+ }
+
+ class ProjectLabelProvider extends LabelProvider implements IColorProvider {
+ private ILabelProvider labelProvider = WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider();
+
+ @Override
+ public String getText(Object element) {
+ return labelProvider.getText(element);
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ return labelProvider.getImage(element);
+ }
+
+ public Color getForeground(Object element) {
+ if(element instanceof IResource && moduleContainers.contains(((IResource) element).getLocation())) {
+ return Display.getDefault().getSystemColor(SWT.COLOR_GRAY);
+ }
+ return null;
+ }
+
+ public Color getBackground(Object element) {
+ return null;
+ }
+
+ }
+ };
+ dialog.setTitle(Messages.OverviewPage_selectModuleProjects);
+
+ if(dialog.open() == Window.OK) {
+ addSelectedModules(dialog.getResult(), updateParentSection[0]);
+ }
+ }
+ });
+
+ modulesEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ IEditorInput editorInput = OverviewPage.this.pomEditor.getEditorInput();
+ if(editorInput instanceof FileEditorInput) {
+ MavenModuleWizard wizard = new MavenModuleWizard(true);
+ wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(((FileEditorInput) editorInput).getFile()));
+ WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+ int res = dialog.open();
+ if(res == Window.OK) {
+ createNewModule(wizard.getModuleName());
+ }
+ }
+ }
+ });
+
+ modulesEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = getEditingDomain();
+
+ int n = 0;
+ for(String module : modulesEditor.getSelection()) {
+ Command removeCommand = RemoveCommand.create(editingDomain, model, POM_PACKAGE.getModel_Modules(), module);
+ compoundCommand.append(removeCommand);
+ n++ ;
+ }
+ //MNGECLIPSE-1850 this is a partial fix, have the remove commands executed separately and
+ // then remove the whole <modules> section. Unfortunately that one doesn't work.
+ editingDomain.getCommandStack().execute(compoundCommand);
+ if(model.getModules().size() == 0) {
+ Command removeModules = SetCommand.create(editingDomain, model, POM_PACKAGE.getModel_Modules(), null);
+ editingDomain.getCommandStack().execute(removeModules);
+ }
+ // modulesEditor.refresh();
+ }
+ });
+
+ modulesEditor.setCellModifier(new ICellModifier() {
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+
+ public Object getValue(Object element, String property) {
+ return element;
+ }
+
+ public void modify(Object element, String property, Object value) {
+ int n = modulesEditor.getViewer().getTable().getSelectionIndex();
+ EList<String> modules = model.getModules();
+ if(!value.equals(modules.get(n))) {
+ EditingDomain editingDomain = getEditingDomain();
+ Command command = SetCommand.create(editingDomain, model, //
+ POM_PACKAGE.getModel_Modules(), value, n);
+ editingDomain.getCommandStack().execute(command);
+ // modulesEditor.refresh();
+ }
+ }
+ });
+
+ modulesEditor.getViewer().addDropSupport(DND.DROP_COPY | DND.DROP_LINK | DND.DROP_MOVE,
+ new Transfer[] {ResourceTransfer.getInstance()}, new DropTargetAdapter() {
+ @Override
+ public void dragEnter(DropTargetEvent event) {
+ event.detail = DND.DROP_LINK;
+ }
+
+ @Override
+ public void dragOperationChanged(DropTargetEvent event) {
+ event.detail = DND.DROP_LINK;
+ }
+
+ @Override
+ public void drop(DropTargetEvent event) {
+ if(event.data instanceof Object[]) {
+ addSelectedModules((Object[]) event.data, true);
+ }
+ }
+ });
+
+ newModuleElementAction = new Action(Messages.OverviewPage_action_newModuleElement, MavenImages.NEW_POM) {
+ public void run() {
+ createNewModule("?"); //$NON-NLS-1$
+ }
+ };
+
+// newModuleProjectAction = new Action(Messages.OverviewPage_action_new_module_project, MavenEditorImages.ADD_MODULE) {
+// public void run() {
+// IEditorInput editorInput = OverviewPage.this.pomEditor.getEditorInput();
+// if(editorInput instanceof FileEditorInput) {
+// MavenModuleWizard wizard = new MavenModuleWizard(true);
+// wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(((FileEditorInput) editorInput).getFile()));
+// WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+// int res = dialog.open();
+// if(res == Window.OK) {
+// createNewModule(wizard.getModuleName());
+// }
+// }
+// }
+// };
+
+ ToolBarManager modulesToolBarManager = new ToolBarManager(SWT.FLAT);
+ modulesToolBarManager.add(newModuleElementAction);
+// modulesToolBarManager.add(newModuleProjectAction);
+
+ Composite toolbarComposite = toolkit.createComposite(modulesSection);
+ GridLayout toolbarLayout = new GridLayout(1, true);
+ toolbarLayout.marginHeight = 0;
+ toolbarLayout.marginWidth = 0;
+ toolbarComposite.setLayout(toolbarLayout);
+ toolbarComposite.setBackground(null);
+
+ modulesToolBarManager.createControl(toolbarComposite);
+ modulesSection.setTextClient(toolbarComposite);
+
+ modulesEditor.setReadOnly(pomEditor.isReadOnly());
+ newModuleElementAction.setEnabled(!pomEditor.isReadOnly());
+// newModuleProjectAction.setEnabled(!pomEditor.isReadOnly());
+ }
+
+ // right side
+
+ private void createProjectSection(FormToolkit toolkit, Composite composite, WidthGroup widthGroup) {
+ projectSection = toolkit.createSection(composite, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ projectSectionData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ projectSection.setLayoutData(projectSectionData);
+ projectSection.setText(Messages.OverviewPage_section_project);
+ projectSection.setData("name", "projectSection"); //$NON-NLS-1$ //$NON-NLS-2$
+ projectSection.addExpansionListener(new ExpansionAdapter() {
+ public void expansionStateChanged(ExpansionEvent e) {
+ projectSectionData.grabExcessVerticalSpace = e.getState();
+ projectSection.getParent().layout();
+ }
+ });
+
+ Composite projectComposite = toolkit.createComposite(projectSection, SWT.NONE);
+ projectComposite.setLayout(new GridLayout(2, false));
+ projectSection.setClient(projectComposite);
+
+ Label nameLabel = toolkit.createLabel(projectComposite, Messages.OverviewPage_lblName, SWT.NONE);
+
+ projectNameText = toolkit.createText(projectComposite, null, SWT.NONE);
+ GridData gd_projectNameText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_projectNameText.widthHint = 150;
+ projectNameText.setLayoutData(gd_projectNameText);
+ projectNameText.setData("name", "projectName"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Hyperlink urlLabel = toolkit.createHyperlink(projectComposite, Messages.OverviewPage_lblUrl, SWT.NONE);
+ urlLabel.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ FormUtils.openHyperlink(projectUrlText.getText());
+ }
+ });
+
+ projectUrlText = toolkit.createText(projectComposite, null, SWT.NONE);
+ GridData gd_projectUrlText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_projectUrlText.widthHint = 150;
+ projectUrlText.setLayoutData(gd_projectUrlText);
+ projectUrlText.setData("name", "projectUrl"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Label descriptionLabel = toolkit.createLabel(projectComposite, Messages.OverviewPage_lblDesc, SWT.NONE);
+ descriptionLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
+
+ projectDescriptionText = toolkit.createText(projectComposite, null, SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);
+ GridData gd_descriptionText = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd_descriptionText.widthHint = 150;
+ gd_descriptionText.heightHint = 100;
+ gd_descriptionText.minimumHeight = 100;
+ projectDescriptionText.setLayoutData(gd_descriptionText);
+ projectDescriptionText.setData("name", "projectDescription"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Label inceptionYearLabel = toolkit.createLabel(projectComposite, Messages.OverviewPage_lblInception, SWT.NONE);
+
+ inceptionYearText = toolkit.createText(projectComposite, null, SWT.NONE);
+ GridData gd_inceptionYearText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_inceptionYearText.widthHint = 150;
+ inceptionYearText.setLayoutData(gd_inceptionYearText);
+ inceptionYearText.setData("name", "projectInceptionYear"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ widthGroup.addControl(nameLabel);
+ widthGroup.addControl(urlLabel);
+ widthGroup.addControl(descriptionLabel);
+ widthGroup.addControl(inceptionYearLabel);
+
+ toolkit.paintBordersFor(projectComposite);
+ projectComposite.setTabList(new Control[] {projectNameText, projectUrlText, projectDescriptionText,
+ inceptionYearText});
+ }
+
+ private void createOrganizationSection(FormToolkit toolkit, Composite composite, WidthGroup widthGroup) {
+ organizationSection = toolkit.createSection(composite, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ organizationSection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ organizationSection.setText(Messages.OverviewPage_section_org);
+ organizationSection.setData("name", "organizationSection"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Composite organizationComposite = toolkit.createComposite(organizationSection, SWT.NONE);
+ organizationComposite.setLayout(new GridLayout(2, false));
+ organizationSection.setClient(organizationComposite);
+
+ Label organizationNameLabel = toolkit.createLabel(organizationComposite, Messages.OverviewPage_lblName, SWT.NONE);
+
+ organizationNameText = toolkit.createText(organizationComposite, null, SWT.NONE);
+ GridData gd_organizationNameText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_organizationNameText.widthHint = 150;
+ organizationNameText.setLayoutData(gd_organizationNameText);
+ organizationNameText.setData("name", "organizationName"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Hyperlink organizationUrlLabel = toolkit.createHyperlink(organizationComposite, Messages.OverviewPage_lblUrl,
+ SWT.NONE);
+ organizationUrlLabel.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ FormUtils.openHyperlink(organizationUrlText.getText());
+ }
+ });
+
+ organizationUrlText = toolkit.createText(organizationComposite, null, SWT.NONE);
+ GridData gd_organizationUrlText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_organizationUrlText.widthHint = 150;
+ organizationUrlText.setLayoutData(gd_organizationUrlText);
+ organizationUrlText.setData("name", "organizationUrl"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ widthGroup.addControl(organizationNameLabel);
+ widthGroup.addControl(organizationUrlLabel);
+
+ toolkit.paintBordersFor(organizationComposite);
+ organizationComposite.setTabList(new Control[] {organizationNameText, organizationUrlText});
+ }
+
+ private void createScmSection(FormToolkit toolkit, Composite composite, WidthGroup widthGroup) {
+ scmSection = toolkit.createSection(composite, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ GridData gd_scmSection = new GridData(SWT.FILL, SWT.TOP, false, false);
+ scmSection.setLayoutData(gd_scmSection);
+ scmSection.setText(Messages.OverviewPage_section_scm);
+ scmSection.setData("name", "scmSection"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Composite scmComposite = toolkit.createComposite(scmSection, SWT.NONE);
+ scmComposite.setLayout(new GridLayout(2, false));
+ scmSection.setClient(scmComposite);
+
+ Hyperlink scmUrlLabel = toolkit.createHyperlink(scmComposite, Messages.OverviewPage_lblUrl, SWT.NONE);
+ scmUrlLabel.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ FormUtils.openHyperlink(scmUrlText.getText());
+ }
+ });
+
+ scmUrlText = toolkit.createText(scmComposite, null, SWT.NONE);
+ GridData gd_scmUrlText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_scmUrlText.widthHint = 150;
+ scmUrlText.setLayoutData(gd_scmUrlText);
+ scmUrlText.setData("name", "scmUrl"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Label scmConnectionLabel = toolkit.createLabel(scmComposite, Messages.OverviewPage_lblConnection, SWT.NONE);
+
+ scmConnectionText = toolkit.createText(scmComposite, null, SWT.NONE);
+ GridData gd_scmConnectionText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_scmConnectionText.widthHint = 150;
+ scmConnectionText.setLayoutData(gd_scmConnectionText);
+ scmConnectionText.setData("name", "scmConnection"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Label scmDevConnectionLabel = toolkit.createLabel(scmComposite, Messages.OverviewPage_lblDev, SWT.NONE);
+
+ scmDevConnectionText = toolkit.createText(scmComposite, null, SWT.NONE);
+ GridData gd_scmDevConnectionText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_scmDevConnectionText.widthHint = 150;
+ scmDevConnectionText.setLayoutData(gd_scmDevConnectionText);
+ scmDevConnectionText.setData("name", "scmDevConnection"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Label scmTagLabel = toolkit.createLabel(scmComposite, Messages.OverviewPage_lblTag, SWT.NONE);
+
+ scmTagText = toolkit.createText(scmComposite, null, SWT.NONE);
+ GridData gd_scmTagText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_scmTagText.widthHint = 150;
+ scmTagText.setLayoutData(gd_scmTagText);
+ scmTagText.setData("name", "scmTag"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ widthGroup.addControl(scmUrlLabel);
+ widthGroup.addControl(scmConnectionLabel);
+ widthGroup.addControl(scmDevConnectionLabel);
+ widthGroup.addControl(scmTagLabel);
+
+ toolkit.paintBordersFor(scmComposite);
+ }
+
+ private void createIssueManagementSection(FormToolkit toolkit, Composite composite, WidthGroup widthGroup) {
+ issueManagementSection = toolkit.createSection(composite, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ issueManagementSection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ issueManagementSection.setText(Messages.OverviewPage_section_issueMan);
+ issueManagementSection.setData("name", "issueManagementSection"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Composite issueManagementComposite = toolkit.createComposite(issueManagementSection, SWT.NONE);
+ issueManagementComposite.setLayout(new GridLayout(2, false));
+ issueManagementSection.setClient(issueManagementComposite);
+
+ Label issueManagementSystemLabel = toolkit.createLabel(issueManagementComposite, Messages.OverviewPage_lblSystem,
+ SWT.NONE);
+
+ issueManagementSystemCombo = new CCombo(issueManagementComposite, SWT.FLAT);
+ GridData gd_issueManagementSystemText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_issueManagementSystemText.widthHint = 150;
+ issueManagementSystemCombo.setLayoutData(gd_issueManagementSystemText);
+ issueManagementSystemCombo.setData("name", "issueManagementSystem"); //$NON-NLS-1$ //$NON-NLS-2$
+ issueManagementSystemCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ addToHistory(issueManagementSystemCombo);
+ toolkit.paintBordersFor(issueManagementSystemCombo);
+ toolkit.adapt(issueManagementSystemCombo, true, true);
+
+ Hyperlink issueManagementUrlLabel = toolkit.createHyperlink(issueManagementComposite, Messages.OverviewPage_lblUrl,
+ SWT.NONE);
+ issueManagementUrlLabel.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ FormUtils.openHyperlink(issueManagementUrlCombo.getText());
+ }
+ });
+
+ issueManagementUrlCombo = new CCombo(issueManagementComposite, SWT.FLAT);
+ GridData gd_issueManagementUrlText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_issueManagementUrlText.widthHint = 150;
+ issueManagementUrlCombo.setLayoutData(gd_issueManagementUrlText);
+ issueManagementUrlCombo.setData("name", "issueManagementUrl"); //$NON-NLS-1$ //$NON-NLS-2$
+ issueManagementUrlCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ addToHistory(issueManagementUrlCombo);
+ toolkit.paintBordersFor(issueManagementUrlCombo);
+ toolkit.adapt(issueManagementUrlCombo, true, true);
+
+ widthGroup.addControl(issueManagementSystemLabel);
+ widthGroup.addControl(issueManagementUrlLabel);
+
+ toolkit.paintBordersFor(issueManagementComposite);
+ issueManagementComposite.setTabList(new Control[] {issueManagementSystemCombo, issueManagementUrlCombo});
+ }
+
+ private void createCiManagementSection(FormToolkit toolkit, Composite composite, WidthGroup widthGroup) {
+ ciManagementSection = toolkit.createSection(composite, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ ciManagementSection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ ciManagementSection.setText(Messages.OverviewPage_section_ci);
+ ciManagementSection.setData("name", "continuousIntegrationSection"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Composite ciManagementComposite = toolkit.createComposite(ciManagementSection, SWT.NONE);
+ ciManagementComposite.setLayout(new GridLayout(2, false));
+ ciManagementSection.setClient(ciManagementComposite);
+
+ Label ciManagementSystemLabel = toolkit.createLabel(ciManagementComposite, Messages.OverviewPage_lblSystem,
+ SWT.NONE);
+
+ ciManagementSystemCombo = new CCombo(ciManagementComposite, SWT.FLAT);
+ GridData gd_ciManagementSystemText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_ciManagementSystemText.widthHint = 150;
+ ciManagementSystemCombo.setLayoutData(gd_ciManagementSystemText);
+ ciManagementSystemCombo.setData("name", "ciManagementSystem"); //$NON-NLS-1$ //$NON-NLS-2$
+ ciManagementSystemCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ addToHistory(ciManagementSystemCombo);
+ toolkit.paintBordersFor(ciManagementSystemCombo);
+ toolkit.adapt(ciManagementSystemCombo, true, true);
+
+ Hyperlink ciManagementUrlLabel = toolkit.createHyperlink(ciManagementComposite, Messages.OverviewPage_lblUrl,
+ SWT.NONE);
+ ciManagementUrlLabel.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ FormUtils.openHyperlink(ciManagementUrlCombo.getText());
+ }
+ });
+
+ ciManagementUrlCombo = new CCombo(ciManagementComposite, SWT.FLAT);
+ GridData gd_ciManagementUrlText = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ gd_ciManagementUrlText.widthHint = 150;
+ ciManagementUrlCombo.setLayoutData(gd_ciManagementUrlText);
+ ciManagementUrlCombo.setData("name", "ciManagementUrl"); //$NON-NLS-1$ //$NON-NLS-2$
+ ciManagementUrlCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
+ addToHistory(ciManagementUrlCombo);
+ toolkit.paintBordersFor(ciManagementUrlCombo);
+ toolkit.adapt(ciManagementUrlCombo, true, true);
+
+ widthGroup.addControl(ciManagementSystemLabel);
+ widthGroup.addControl(ciManagementUrlLabel);
+
+ toolkit.paintBordersFor(ciManagementComposite);
+ ciManagementComposite.setTabList(new Control[] {ciManagementSystemCombo, ciManagementUrlCombo});
+ }
+
+ protected void doUpdate(Notification notification) {
+ EObject object = (EObject) notification.getNotifier();
+ Object feature = notification.getFeature();
+
+ if(object instanceof Model) {
+ loadThis();
+ }
+
+ if(object instanceof PropertyElement) {
+ propertiesSection.refresh();
+ }
+
+ Object notificationObject = getFromNotification(notification);
+
+ if(feature == PomPackage.Literals.MODEL__PARENT
+ || (object instanceof Parent && (notificationObject == null || notificationObject instanceof Parent))) {
+ loadParent((Parent) notificationObject);
+ }
+
+ if(feature == PomPackage.Literals.MODEL__ORGANIZATION
+ || (object instanceof Organization && (notificationObject == null || notificationObject instanceof Organization))) {
+ loadOrganization((Organization) notificationObject);
+ }
+
+ if(feature == PomPackage.Literals.MODEL__SCM
+ || (object instanceof Scm && (notificationObject == null || notificationObject instanceof Scm))) {
+ loadScm((Scm) notificationObject);
+ }
+
+ if(object instanceof CiManagement && (notificationObject == null || notificationObject instanceof CiManagement)) {
+ loadCiManagement((CiManagement) notificationObject);
+ }
+
+ if(object instanceof IssueManagement
+ && (notificationObject == null || notificationObject instanceof IssueManagement)) {
+ loadIssueManagement((IssueManagement) notificationObject);
+ }
+
+ if(feature == PomPackage.Literals.MODEL__MODULES) {
+ modulesEditor.refresh();
+ }
+
+ if(feature == PomPackage.Literals.MODEL__PROPERTIES) {
+ propertiesSection.setModel(model, POM_PACKAGE.getModel_Properties());
+ }
+ }
+
+ public void updateView(final Notification notification) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ doUpdate(notification);
+ }
+ });
+ }
+
+ public void loadData() {
+ Parent parent = model.getParent();
+ Organization organization = model.getOrganization();
+ Scm scm = model.getScm();
+ IssueManagement issueManagement = model.getIssueManagement();
+ CiManagement ciManagement = model.getCiManagement();
+
+ loadThis();
+ loadParent(parent);
+ loadOrganization(organization);
+ loadScm(scm);
+ loadIssueManagement(issueManagement);
+ loadCiManagement(ciManagement);
+ loadModules(model.getModules());
+ propertiesSection.setModel(model, POM_PACKAGE.getModel_Properties());
+
+ boolean expandProjectSection = !isEmpty(model.getName()) || !isEmpty(model.getDescription())
+ || !isEmpty(model.getUrl()) || !isEmpty(model.getInceptionYear());
+ projectSectionData.grabExcessVerticalSpace = expandProjectSection;
+ projectSection.setExpanded(expandProjectSection);
+
+ parentSection.setExpanded(parent != null //
+ && (!isEmpty(parent.getGroupId()) || !isEmpty(parent.getArtifactId()) //
+ || !isEmpty(parent.getVersion())));
+
+ organizationSection.setExpanded(organization != null
+ && (!isEmpty(organization.getName()) || !isEmpty(organization.getUrl())));
+
+ scmSection.setExpanded(scm != null
+ && (!isEmpty(scm.getUrl()) || !isEmpty(scm.getConnection()) || !isEmpty(scm.getDeveloperConnection())));
+
+ ciManagementSection.setExpanded(ciManagement != null
+ && (!isEmpty(ciManagement.getSystem()) || !isEmpty(ciManagement.getUrl())));
+
+ issueManagementSection.setExpanded(issueManagement != null
+ && (!isEmpty(issueManagement.getSystem()) || !isEmpty(issueManagement.getUrl())));
+
+ propertiesSection.getSection().setExpanded(model.getProperties() != null && !model.getProperties().isEmpty());
+
+ // Modules modules = model.getModules();
+ // modulesSection.setExpanded(modules !=null && modules.getModule().size()>0);
+ }
+
+ private void loadThis() {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ removeNotifyListener(artifactGroupIdText);
+ removeNotifyListener(artifactIdText);
+ removeNotifyListener(artifactVersionText);
+ removeNotifyListener(artifactPackagingCombo);
+
+ removeNotifyListener(projectNameText);
+ removeNotifyListener(projectDescriptionText);
+ removeNotifyListener(projectUrlText);
+ removeNotifyListener(inceptionYearText);
+
+ setText(artifactGroupIdText, model.getGroupId());
+ setText(artifactIdText, model.getArtifactId());
+ setText(artifactVersionText, model.getVersion());
+ setText(artifactPackagingCombo, "".equals(nvl(model.getPackaging())) ? "jar" : nvl(model.getPackaging())); //$NON-NLS-1$ //$NON-NLS-2$
+ //show/hide modules section when packaging changes..
+ loadModules(model.getModules());
+
+ setText(projectNameText, model.getName());
+ setText(projectDescriptionText, model.getDescription());
+ setText(projectUrlText, model.getUrl());
+ setText(inceptionYearText, model.getInceptionYear());
+
+ ValueProvider<Model> modelProvider = new ValueProvider.DefaultValueProvider<Model>(model);
+ setModifyListener(artifactGroupIdText, modelProvider, POM_PACKAGE.getModel_GroupId(), ""); //$NON-NLS-1$
+ setModifyListener(artifactIdText, modelProvider, POM_PACKAGE.getModel_ArtifactId(), ""); //$NON-NLS-1$
+ setModifyListener(artifactVersionText, modelProvider, POM_PACKAGE.getModel_Version(), ""); //$NON-NLS-1$
+ setModifyListener(artifactPackagingCombo, modelProvider, POM_PACKAGE.getModel_Packaging(), "jar"); //$NON-NLS-1$
+
+ setModifyListener(projectNameText, modelProvider, POM_PACKAGE.getModel_Name(), ""); //$NON-NLS-1$
+ setModifyListener(projectDescriptionText, modelProvider, POM_PACKAGE.getModel_Description(), ""); //$NON-NLS-1$
+ setModifyListener(projectUrlText, modelProvider, POM_PACKAGE.getModel_Url(), ""); //$NON-NLS-1$
+ setModifyListener(inceptionYearText, modelProvider, POM_PACKAGE.getModel_InceptionYear(), ""); //$NON-NLS-1$
+ }
+ });
+
+ }
+
+ private void loadParent(Parent parent) {
+ removeNotifyListener(parentGroupIdText);
+ removeNotifyListener(parentArtifactIdText);
+ removeNotifyListener(parentVersionText);
+ removeNotifyListener(parentRelativePathText);
+
+ if(parent != null) {
+ setText(parentGroupIdText, parent.getGroupId());
+ setText(parentArtifactIdText, parent.getArtifactId());
+ setText(parentVersionText, parent.getVersion());
+ setText(parentRelativePathText, parent.getRelativePath());
+ } else {
+ setText(parentGroupIdText, ""); //$NON-NLS-1$
+ setText(parentArtifactIdText, ""); //$NON-NLS-1$
+ setText(parentVersionText, ""); //$NON-NLS-1$
+ setText(parentRelativePathText, ""); //$NON-NLS-1$
+ }
+
+// parentGroupIdText.setEditable(!isReadOnly());
+// parentArtifactIdText.setEditable(!isReadOnly());
+// parentVersionText.setEditable(!isReadOnly());
+// parentRelativePathText.setEditable(!isReadOnly());
+ parentSelectAction.setEnabled(!isReadOnly());
+ parentOpenAction.setEnabled(parent != null);
+
+ ValueProvider<Parent> parentProvider = new ValueProvider.ParentValueProvider<Parent>(parentGroupIdText,
+ parentArtifactIdText, parentVersionText, parentRelativePathText) {
+ public Parent getValue() {
+ return model.getParent();
+ }
+
+ public Parent create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ Parent parent = PomFactory.eINSTANCE.createParent();
+ compoundCommand.append(SetCommand.create(editingDomain, model, POM_PACKAGE.getModel_Parent(), parent));
+ return parent;
+ }
+ };
+ setModifyListener(parentGroupIdText, parentProvider, POM_PACKAGE.getParent_GroupId(), ""); //$NON-NLS-1$
+ setModifyListener(parentArtifactIdText, parentProvider, POM_PACKAGE.getParent_ArtifactId(), ""); //$NON-NLS-1$
+ setModifyListener(parentVersionText, parentProvider, POM_PACKAGE.getParent_Version(), ""); //$NON-NLS-1$
+ setModifyListener(parentRelativePathText, parentProvider, POM_PACKAGE.getParent_RelativePath(), ""); //$NON-NLS-1$
+ }
+
+ private void loadModules(EList<String> modules) {
+ modulesEditor.setInput(modules);
+ modulesEditor.setReadOnly(isReadOnly());
+ if("pom".equals(model.getPackaging()) && modulesStack.topControl != modulesEditor) { //$NON-NLS-1$
+ modulesStack.topControl = modulesEditor;
+ modulesSection.setExpanded(true);
+// newModuleProjectAction.setEnabled(!isReadOnly());
+ newModuleElementAction.setEnabled(!isReadOnly());
+ } else if(!"pom".equals(model.getPackaging()) && modulesStack.topControl != noModules) { //$NON-NLS-1$
+// newModuleProjectAction.setEnabled(false);
+ newModuleElementAction.setEnabled(false);
+ modulesStack.topControl = noModules;
+ modulesSection.setExpanded(false);
+ }
+ modulesSectionComposite.layout();
+ }
+
+ private void loadOrganization(Organization organization) {
+ removeNotifyListener(organizationNameText);
+ removeNotifyListener(organizationUrlText);
+
+ if(organization == null) {
+ setText(organizationNameText, ""); //$NON-NLS-1$
+ setText(organizationUrlText, ""); //$NON-NLS-1$
+ } else {
+ setText(organizationNameText, organization.getName());
+ setText(organizationUrlText, organization.getUrl());
+ }
+
+ ValueProvider<Organization> organizationProvider = new ValueProvider.ParentValueProvider<Organization>(
+ organizationNameText, organizationUrlText) {
+ public Organization getValue() {
+ return model.getOrganization();
+ }
+
+ public Organization create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ Organization organization = PomFactory.eINSTANCE.createOrganization();
+ compoundCommand.append(SetCommand.create(editingDomain, model, POM_PACKAGE.getModel_Organization(), //
+ organization));
+ return organization;
+ }
+ };
+ setModifyListener(organizationNameText, organizationProvider, POM_PACKAGE.getOrganization_Name(), ""); //$NON-NLS-1$
+ setModifyListener(organizationUrlText, organizationProvider, POM_PACKAGE.getOrganization_Url(), ""); //$NON-NLS-1$
+ }
+
+ private void loadScm(Scm scm) {
+ removeNotifyListener(scmUrlText);
+ removeNotifyListener(scmConnectionText);
+ removeNotifyListener(scmDevConnectionText);
+ removeNotifyListener(scmTagText);
+ if(scm == null) {
+ setText(scmUrlText, ""); //$NON-NLS-1$
+ setText(scmConnectionText, ""); //$NON-NLS-1$
+ setText(scmDevConnectionText, ""); //$NON-NLS-1$
+ setText(scmTagText, ""); //$NON-NLS-1$
+ } else {
+ setText(scmUrlText, scm.getUrl());
+ setText(scmConnectionText, scm.getConnection());
+ setText(scmDevConnectionText, scm.getDeveloperConnection());
+ setText(scmTagText, scm.getTag());
+ }
+
+ ValueProvider<Scm> scmProvider = new ValueProvider.ParentValueProvider<Scm>(scmUrlText, scmConnectionText,
+ scmDevConnectionText, scmTagText) {
+ public Scm getValue() {
+ return model.getScm();
+ }
+
+ public Scm create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ Scm scm = PomFactory.eINSTANCE.createScm();
+ compoundCommand.append(SetCommand.create(editingDomain, model, POM_PACKAGE.getModel_Scm(), scm));
+ return scm;
+ }
+ };
+ setModifyListener(scmUrlText, scmProvider, POM_PACKAGE.getScm_Url(), ""); //$NON-NLS-1$
+ setModifyListener(scmConnectionText, scmProvider, POM_PACKAGE.getScm_Connection(), ""); //$NON-NLS-1$
+ setModifyListener(scmDevConnectionText, scmProvider, POM_PACKAGE.getScm_DeveloperConnection(), ""); //$NON-NLS-1$
+ setModifyListener(scmTagText, scmProvider, POM_PACKAGE.getScm_Tag(), ""); //$NON-NLS-1$
+ }
+
+ private void loadCiManagement(CiManagement ciManagement) {
+ removeNotifyListener(ciManagementUrlCombo);
+ removeNotifyListener(ciManagementSystemCombo);
+
+ if(ciManagement == null) {
+ setText(ciManagementSystemCombo, ""); //$NON-NLS-1$
+ setText(ciManagementUrlCombo, ""); //$NON-NLS-1$
+ } else {
+ setText(ciManagementSystemCombo, ciManagement.getSystem());
+ setText(ciManagementUrlCombo, ciManagement.getUrl());
+ }
+
+ ValueProvider<CiManagement> ciManagementProvider = new ValueProvider.ParentValueProvider<CiManagement>(
+ ciManagementUrlCombo, ciManagementSystemCombo) {
+ public CiManagement getValue() {
+ return model.getCiManagement();
+ }
+
+ public CiManagement create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ CiManagement ciManagement = PomFactory.eINSTANCE.createCiManagement();
+ compoundCommand.append(SetCommand.create(editingDomain, model, POM_PACKAGE.getModel_CiManagement(), //
+ ciManagement));
+ return ciManagement;
+ }
+ };
+ setModifyListener(ciManagementUrlCombo, ciManagementProvider, POM_PACKAGE.getCiManagement_Url(), ""); //$NON-NLS-1$
+ setModifyListener(ciManagementSystemCombo, ciManagementProvider, POM_PACKAGE.getCiManagement_System(), ""); //$NON-NLS-1$
+ }
+
+ private void loadIssueManagement(IssueManagement issueManagement) {
+ removeNotifyListener(issueManagementUrlCombo);
+ removeNotifyListener(issueManagementSystemCombo);
+
+ if(issueManagement == null) {
+ setText(issueManagementSystemCombo, ""); //$NON-NLS-1$
+ setText(issueManagementUrlCombo, ""); //$NON-NLS-1$
+ } else {
+ setText(issueManagementSystemCombo, issueManagement.getSystem());
+ setText(issueManagementUrlCombo, issueManagement.getUrl());
+ }
+
+ ValueProvider<IssueManagement> issueManagementProvider = new ValueProvider.ParentValueProvider<IssueManagement>(
+ issueManagementUrlCombo, issueManagementSystemCombo) {
+ public IssueManagement getValue() {
+ return model.getIssueManagement();
+ }
+
+ public IssueManagement create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ IssueManagement issueManagement = PomFactory.eINSTANCE.createIssueManagement();
+ compoundCommand.append(SetCommand.create(editingDomain, model, POM_PACKAGE.getModel_IssueManagement(), //
+ issueManagement));
+ return issueManagement;
+ }
+ };
+ setModifyListener(issueManagementUrlCombo, issueManagementProvider, POM_PACKAGE.getIssueManagement_Url(), ""); //$NON-NLS-1$
+ setModifyListener(issueManagementSystemCombo, issueManagementProvider, POM_PACKAGE.getIssueManagement_System(), ""); //$NON-NLS-1$
+ }
+
+ protected void createNewModule(String moduleName) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = getEditingDomain();
+
+ Command addModule = AddCommand.create(editingDomain, model, POM_PACKAGE.getModel_Modules(), moduleName);
+ compoundCommand.append(addModule);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ modulesEditor.setInput(model.getModules());
+ }
+
+ protected void addSelectedModules(Object[] result, boolean updateParentSection) {
+ String groupId = model.getGroupId();
+ if(groupId == null) {
+ Parent parent = model.getParent();
+ if(parent != null) {
+ groupId = parent.getGroupId();
+ }
+ }
+
+ String version = model.getVersion();
+ if(version == null) {
+ Parent parent = model.getParent();
+ if(parent != null) {
+ version = parent.getVersion();
+ }
+ }
+
+ final String parentGroupId = groupId;
+ final String parentArtifactId = model.getArtifactId();
+ final String parentVersion = version;
+ final IPath projectPath = getProject().getLocation();
+
+ for(Object selection : result) {
+ IContainer container = null;
+ IFile pomFile = null;
+
+ if(selection instanceof IFile) {
+ pomFile = (IFile) selection;
+ if(!IMavenConstants.POM_FILE_NAME.equals(pomFile.getName())) {
+ continue;
+ }
+ container = pomFile.getParent();
+ } else if(selection instanceof IContainer && !selection.equals(getProject())) {
+ container = (IContainer) selection;
+ pomFile = container.getFile(new Path(IMavenConstants.POM_FILE_NAME));
+ }
+
+ if(pomFile == null || !pomFile.exists() || container == null) {
+ continue;
+ }
+
+ IPath resultPath = container.getLocation();
+ String path = resultPath.makeRelativeTo(projectPath).toString();
+
+ if(!model.getModules().contains(path)) {
+ if(updateParentSection) {
+ final String relativePath = projectPath.makeRelativeTo(resultPath).toString();
+ MavenPlugin.getDefault().getMavenModelManager().updateProject(pomFile, new ProjectUpdater() {
+ public void update(Model model) {
+ Parent parent = model.getParent();
+ if(parent == null) {
+ parent = PomFactory.eINSTANCE.createParent();
+ model.setParent(parent);
+ }
+ parent.setGroupId(parentGroupId);
+ parent.setArtifactId(parentArtifactId);
+ parent.setVersion(parentVersion);
+ parent.setRelativePath(relativePath);
+
+ if(model.getGroupId() == null || model.getGroupId().equals(parentGroupId)) {
+ model.setGroupId(null);
+
+ if(model.getVersion() != null && model.getVersion().equals(parentVersion)) {
+ model.setVersion(null);
+ }
+ }
+ }
+ });
+ }
+
+ createNewModule(path);
+ }
+ }
+ }
+
+ private boolean checkDrop() {
+ return true;
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PluginsPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PluginsPage.java
new file mode 100644
index 00000000..42268e45
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PluginsPage.java
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.editor.composites.PluginsComposite;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.model.edit.pom.Build;
+import org.eclipse.m2e.model.edit.pom.BuildBase;
+import org.eclipse.m2e.model.edit.pom.PluginManagement;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class PluginsPage extends MavenPomEditorPage {
+
+ private PluginsComposite pluginsComposite;
+ private SearchControl searchControl;
+
+ public PluginsPage(MavenPomEditor pomEditor) {
+ super(pomEditor, IMavenConstants.PLUGIN_ID + ".pom.plugins", Messages.PluginsPage_title); //$NON-NLS-1$
+ }
+
+ public void dispose() {
+ if(pluginsComposite != null) {
+ pluginsComposite.dispose();
+ }
+ super.dispose();
+ }
+
+ public void setActive(boolean active) {
+ super.setActive(active);
+ if(active) {
+ pluginsComposite.setSearchControl(searchControl);
+ searchControl.getSearchText().setEditable(true);
+ }
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ FormToolkit toolkit = managedForm.getToolkit();
+ ScrolledForm form = managedForm.getForm();
+ form.setText(Messages.PluginsPage_form);
+
+ Composite body = form.getBody();
+ toolkit.paintBordersFor(body);
+ GridLayout gridLayout = new GridLayout(1, true);
+ gridLayout.marginHeight = 0;
+ body.setLayout(gridLayout);
+
+ pluginsComposite = new PluginsComposite(body, this, SWT.NONE);
+ pluginsComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ toolkit.adapt(pluginsComposite);
+
+ searchControl = new SearchControl(Messages.PluginsPage_find, managedForm);
+
+ IToolBarManager pageToolBarManager = form.getForm().getToolBarManager();
+ pageToolBarManager.add(searchControl);
+ pageToolBarManager.add(new Separator());
+
+ form.updateToolBar();
+
+// form.pack();
+
+ super.createFormContent(managedForm);
+ }
+
+ public void loadData() {
+ ValueProvider<BuildBase> buildProvider = new ValueProvider<BuildBase>() {
+ public BuildBase getValue() {
+ BuildBase build = model.getBuild();
+ return build;
+ }
+
+ public BuildBase create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ Build build = model.getBuild();
+ if(build==null) {
+ build = PomFactory.eINSTANCE.createBuild();
+ Command command = SetCommand.create(editingDomain, model, POM_PACKAGE.getModel_Build(), build);
+ compoundCommand.append(command);
+ }
+
+ return build;
+ }
+ };
+
+ ValueProvider<PluginManagement> pluginManagementProvider = new ValueProvider<PluginManagement>() {
+ public PluginManagement getValue() {
+ Build build = model.getBuild();
+ PluginManagement management = build == null ? null : build.getPluginManagement();
+ return management;
+ }
+
+ public PluginManagement create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ Build build = model.getBuild();
+ if(build == null) {
+ build = PomFactory.eINSTANCE.createBuild();
+ Command command = SetCommand.create(editingDomain, model, POM_PACKAGE.getModel_Build(), build);
+ compoundCommand.append(command);
+ }
+
+ PluginManagement management = build.getPluginManagement();
+ if(management == null) {
+ management = PomFactory.eINSTANCE.createPluginManagement();
+ Command command = SetCommand.create(editingDomain, build, //
+ POM_PACKAGE.getBuildBase_PluginManagement(), management);
+ compoundCommand.append(command);
+ }
+
+ return management;
+ }
+ };
+
+ pluginsComposite.loadData(this, buildProvider, pluginManagementProvider);
+ }
+
+ public void updateView(final Notification notification) {
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run(){
+ pluginsComposite.updateView(PluginsPage.this, notification);
+ }
+ });
+
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java
new file mode 100644
index 00000000..8e8f7189
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+public class PomEditorPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public static final String P_DEFAULT_POM_EDITOR_PAGE = "eclipse.m2.defaultPomEditorPage"; //$NON-NLS-1$
+ public static final String P_SHOW_ADVANCED_TABS = "eclipse.m2.showAdvancedTabs"; //$NON-NLS-1$
+
+ final MavenPlugin plugin;
+ private Composite parent;
+
+ public PomEditorPreferencePage() {
+ super(GRID);
+ setPreferenceStore(MavenPlugin.getDefault().getPreferenceStore());
+
+ plugin = MavenPlugin.getDefault();
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+
+ /*
+ * Creates the field editors. Field editors are abstractions of the common GUI
+ * blocks needed to manipulate various types of preferences. Each field editor
+ * knows how to save and restore itself.
+ */
+ public void createFieldEditors() {
+ parent = getFieldEditorParent();
+ addField(new BooleanFieldEditor(P_DEFAULT_POM_EDITOR_PAGE, Messages.getString("pomEditor.defaultPage"), parent)); //$NON-NLS-1$
+// addField(new BooleanFieldEditor(P_SHOW_ADVANCED_TABS, Messages.getString("pomEditor.showAdvancedTabs"), parent)); //$NON-NLS-1$
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ProfilesPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ProfilesPage.java
new file mode 100644
index 00000000..4fe1fbee
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ProfilesPage.java
@@ -0,0 +1,933 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import static org.eclipse.m2e.editor.pom.FormUtils.isEmpty;
+import static org.eclipse.m2e.editor.pom.FormUtils.setButton;
+import static org.eclipse.m2e.editor.pom.FormUtils.setText;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.wizards.MavenModuleWizard;
+import org.eclipse.m2e.core.wizards.WidthGroup;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.composites.BuildComposite;
+import org.eclipse.m2e.editor.composites.DependenciesComposite;
+import org.eclipse.m2e.editor.composites.ListEditorComposite;
+import org.eclipse.m2e.editor.composites.ListEditorContentProvider;
+import org.eclipse.m2e.editor.composites.PluginsComposite;
+import org.eclipse.m2e.editor.composites.ReportingComposite;
+import org.eclipse.m2e.editor.composites.RepositoriesComposite;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.model.edit.pom.Activation;
+import org.eclipse.m2e.model.edit.pom.ActivationFile;
+import org.eclipse.m2e.model.edit.pom.ActivationOS;
+import org.eclipse.m2e.model.edit.pom.ActivationProperty;
+import org.eclipse.m2e.model.edit.pom.BuildBase;
+import org.eclipse.m2e.model.edit.pom.DependencyManagement;
+import org.eclipse.m2e.model.edit.pom.DistributionManagement;
+import org.eclipse.m2e.model.edit.pom.PluginManagement;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Profile;
+import org.eclipse.m2e.model.edit.pom.Reporting;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.part.FileEditorInput;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class ProfilesPage extends MavenPomEditorPage {
+
+ // controls
+ Button activeByDefaultbutton;
+ Text activationFileMissingText;
+ Text activationFileExistText;
+ Text activationPropertyValueText;
+ Text activationPropertyNameText;
+ Text activationOsVersionText;
+ Text activationOsArchitectureText;
+ Text activationOsFamilyText;
+ Text activationOsNameText;
+ Text activationJdkText;
+ ListEditorComposite<Profile> profilesEditor;
+ ListEditorComposite<String> modulesEditor;
+ Section modulesSection;
+ PropertiesSection propertiesSection;
+
+ CTabFolder tabFolder;
+ BuildComposite buildComposite;
+ PluginsComposite pluginsComposite;
+ DependenciesComposite dependenciesComposite;
+ RepositoriesComposite repositoriesComposite;
+ ReportingComposite reportingComposite;
+
+ Color defaultForegroundColor;
+ Color defaultSelectionColor;
+ Color disabledTabColor = Display.getDefault().getSystemColor(SWT.COLOR_GRAY);
+
+ // model
+ Profile currentProfile;
+ private IAction newModuleProjectAction;
+
+ public ProfilesPage(MavenPomEditor pomEditor) {
+ super(pomEditor, IMavenConstants.PLUGIN_ID + ".pom.profiles", Messages.ProfilesPage_title); //$NON-NLS-1$
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ FormToolkit toolkit = managedForm.getToolkit();
+ ScrolledForm form = managedForm.getForm();
+ form.setText(Messages.ProfilesPage_form);
+ // form.setExpandHorizontal(true);
+
+ Composite body = form.getBody();
+ GridLayout gridLayout = new GridLayout(2, true);
+ gridLayout.horizontalSpacing = 7;
+ body.setLayout(gridLayout);
+ toolkit.paintBordersFor(body);
+
+ createProfilesSection(toolkit, body);
+
+ createModulesSection(toolkit, body);
+ createPropertiesSection(toolkit, body);
+
+ tabFolder = new CTabFolder(body, SWT.FLAT | SWT.MULTI);
+ GridData tabFolderData = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
+ tabFolderData.verticalIndent = 5;
+ tabFolder.setLayoutData(tabFolderData);
+ toolkit.adapt(tabFolder, true, true);
+
+ toolkit.getColors().initializeSectionToolBarColors();
+ Color selectedColor = toolkit.getColors().getColor("org.eclipse.ui.forms.TB_BG"); //$NON-NLS-1$
+ tabFolder.setSelectionBackground(new Color[] {selectedColor, toolkit.getColors().getBackground()}, //
+ new int[] {100}, true);
+ defaultForegroundColor = tabFolder.getForeground();
+ defaultSelectionColor = tabFolder.getSelectionForeground();
+
+ tabFolder.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ // updateTabSelection();
+ }
+ });
+
+ createActivationTab(tabFolder, toolkit);
+ createDependenciesTab(tabFolder, toolkit);
+ createRepositoriesTab(toolkit, tabFolder);
+ createBuildTab(toolkit, tabFolder);
+ createPluginsTab(toolkit, tabFolder);
+ createReportsTab(toolkit, tabFolder);
+
+ tabFolder.setSelection(0);
+
+// form.pack();
+
+ super.createFormContent(managedForm);
+ }
+
+ private void createProfilesSection(FormToolkit toolkit, Composite body) {
+ Section profilesSection = toolkit.createSection(body, ExpandableComposite.TITLE_BAR);
+ profilesSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 3));
+ profilesSection.setText(Messages.ProfilesPage_section_profiles);
+ profilesEditor = new ListEditorComposite<Profile>(profilesSection, SWT.NONE);
+ profilesSection.setClient(profilesEditor);
+ toolkit.adapt(profilesEditor);
+ toolkit.paintBordersFor(profilesEditor);
+
+ profilesEditor.setContentProvider(new ListEditorContentProvider<Profile>());
+ profilesEditor.setLabelProvider(new LabelProvider() {
+ public String getText(Object element) {
+ if(element instanceof Profile) {
+ String profileId = ((Profile) element).getId();
+ return isEmpty(profileId) ? "?" : profileId;
+ }
+ return super.getText(element);
+ }
+
+ public Image getImage(Object element) {
+ return MavenEditorImages.IMG_PROFILE;
+ }
+ });
+
+ profilesEditor.addSelectionListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ List<Profile> selection = profilesEditor.getSelection();
+ updateProfileDetails(selection.size()==1 ? selection.get(0) : null);
+ }
+ });
+
+ profilesEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = getEditingDomain();
+
+ boolean created = false;
+
+ Profile profile = PomFactory.eINSTANCE.createProfile();
+ Command addCommand = AddCommand.create(editingDomain, model, POM_PACKAGE.getModel_Profiles(), profile);
+ compoundCommand.append(addCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ profilesEditor.setSelection(Collections.singletonList(profile));
+ }
+ });
+
+ profilesEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = getEditingDomain();
+
+ List<Profile> selection = profilesEditor.getSelection();
+ for(Profile filter : selection) {
+ Command removeCommand = RemoveCommand.create(editingDomain, model, //
+ POM_PACKAGE.getModel_Profiles(), filter);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ }
+ });
+
+ profilesEditor.setCellModifier(new ICellModifier() {
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+ public Object getValue(Object element, String property) {
+ if(element instanceof Profile) {
+ String id = ((Profile) element).getId();
+ return isEmpty(id) ? "" : id; //$NON-NLS-1$
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ public void modify(Object element, String property, Object value) {
+ int n = profilesEditor.getViewer().getTable().getSelectionIndex();
+ Profile profile = model.getProfiles().get(n);
+ if(!value.equals(profile.getId())) {
+ EditingDomain editingDomain = getEditingDomain();
+ Command command = SetCommand.create(editingDomain, profile, POM_PACKAGE.getProfile_Id(), value);
+ editingDomain.getCommandStack().execute(command);
+ profilesEditor.refresh();
+ }
+ }
+ });
+
+
+ profilesEditor.setReadOnly(pomEditor.isReadOnly());
+ }
+
+ private void createPropertiesSection(FormToolkit toolkit, Composite body) {
+ propertiesSection = new PropertiesSection(toolkit, body, getEditingDomain());
+ }
+
+ private void createModulesSection(FormToolkit toolkit, Composite body) {
+ modulesSection = toolkit.createSection(body, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ modulesSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 2));
+ modulesSection.setText(Messages.ProfilesPage_section_modules);
+
+ modulesEditor = new ListEditorComposite<String>(modulesSection, SWT.NONE);
+ modulesEditor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ modulesSection.setClient(modulesEditor);
+ toolkit.adapt(modulesEditor);
+ toolkit.paintBordersFor(modulesEditor);
+
+ modulesEditor.setContentProvider(new ListEditorContentProvider<String>());
+ modulesEditor.setLabelProvider(new ModulesLabelProvider(this));
+
+ modulesEditor.setOpenListener(new IOpenListener() {
+ public void open(OpenEvent openevent) {
+ List<String> selection = modulesEditor.getSelection();
+ for(String module : selection) {
+ IMavenProjectFacade projectFacade = findModuleProject(module);
+ if(projectFacade!=null) {
+ ArtifactKey mavenProject = projectFacade.getArtifactKey();
+ OpenPomAction.openEditor(mavenProject.getGroupId(), mavenProject.getArtifactId(), mavenProject.getVersion(), null);
+ }
+ }
+ }
+ });
+
+ modulesEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ createNewModule("?");
+ }
+ });
+
+ modulesEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = getEditingDomain();
+
+ List<String> selection = modulesEditor.getSelection();
+ for(String module : selection) {
+ Command removeCommand = RemoveCommand.create(editingDomain, currentProfile, //
+ POM_PACKAGE.getProfile_Modules(), module);
+ compoundCommand.append(removeCommand);
+ }
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+ }
+ });
+
+ modulesEditor.setCellModifier(new ICellModifier() {
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+
+ public Object getValue(Object element, String property) {
+ return element;
+ }
+
+ public void modify(Object element, String property, Object value) {
+ int n = modulesEditor.getViewer().getTable().getSelectionIndex();
+ EList<String> modules = currentProfile.getModules();
+ if(n >= 0 && n < modules.size() && !value.equals(modules.get(n))) {
+ EditingDomain editingDomain = getEditingDomain();
+ Command command = SetCommand.create(editingDomain, currentProfile, POM_PACKAGE.getProfile_Modules(), value, n);
+ editingDomain.getCommandStack().execute(command);
+ modulesEditor.refresh();
+ }
+ }
+ });
+
+ newModuleProjectAction = new Action(Messages.ProfilesPage_action_newModuleProject, MavenEditorImages.ADD_MODULE) {
+ public void run() {
+ IEditorInput editorInput = pomEditor.getEditorInput();
+ if(editorInput instanceof FileEditorInput) {
+ MavenModuleWizard wizard = new MavenModuleWizard(true);
+ wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(((FileEditorInput) editorInput).getFile()));
+ WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
+ int res = dialog.open();
+ if(res == Window.OK) {
+ createNewModule(wizard.getModuleName());
+ }
+ }
+ }
+ };
+
+ ToolBarManager modulesToolBarManager = new ToolBarManager(SWT.FLAT);
+ modulesToolBarManager.add(newModuleProjectAction);
+
+ Composite toolbarComposite = toolkit.createComposite(modulesSection);
+ GridLayout toolbarLayout = new GridLayout(1, true);
+ toolbarLayout.marginHeight = 0;
+ toolbarLayout.marginWidth = 0;
+ toolbarComposite.setLayout(toolbarLayout);
+ toolbarComposite.setBackground(null);
+
+ modulesToolBarManager.createControl(toolbarComposite);
+ modulesSection.setTextClient(toolbarComposite);
+
+ modulesEditor.setReadOnly(pomEditor.isReadOnly());
+ newModuleProjectAction.setEnabled(!pomEditor.isReadOnly());
+
+ }
+
+ protected void updateProfileDetails(Profile profile) {
+ currentProfile = profile;
+
+ if(profile==null) {
+ FormUtils.setEnabled(propertiesSection.getSection(), false);
+ FormUtils.setEnabled(modulesSection, false);
+ modulesEditor.setInput(null);
+ updateProfileTabs(profile);
+
+ return;
+ }
+
+ FormUtils.setEnabled(propertiesSection.getSection(), true);
+ FormUtils.setEnabled(modulesSection, true);
+
+ FormUtils.setReadonly(propertiesSection.getSection(), isReadOnly());
+ FormUtils.setReadonly(modulesSection, isReadOnly());
+
+ modulesEditor.setInput(profile.getModules());
+ modulesEditor.setReadOnly(isReadOnly());
+
+ propertiesSection.setModel(profile, POM_PACKAGE.getProfile_Properties());
+
+ updateProfileTabs(profile);
+ }
+
+ private void updateProfileTabs(Profile profile) {
+ if(profile==null) {
+ FormUtils.setEnabled(tabFolder, false);
+ tabFolder.setForeground(disabledTabColor);
+ tabFolder.setSelectionForeground(disabledTabColor);
+ } else {
+ FormUtils.setEnabled(tabFolder, true);
+ FormUtils.setReadonly(tabFolder, isReadOnly());
+ tabFolder.setForeground(defaultForegroundColor);
+ tabFolder.setSelectionForeground(defaultSelectionColor);
+ }
+
+ updateActivationTab();
+ updateDependenciesTab();
+ updateRepositoriesTab();
+ updateBuildTab();
+ updatePluginsTab();
+ updateReportsTab();
+ }
+
+ private void updateActivationTab() {
+ removeNotifyListener(activeByDefaultbutton);
+ removeNotifyListener(activationJdkText);
+ removeNotifyListener(activationPropertyNameText);
+ removeNotifyListener(activationPropertyValueText);
+ removeNotifyListener(activationFileExistText);
+ removeNotifyListener(activationFileMissingText);
+ removeNotifyListener(activationOsArchitectureText);
+ removeNotifyListener(activationOsFamilyText);
+ removeNotifyListener(activationOsNameText);
+ removeNotifyListener(activationOsVersionText);
+
+ Activation activation = currentProfile == null ? null : currentProfile.getActivation();
+ if(activation == null) {
+ setButton(activeByDefaultbutton, false);
+ setText(activationJdkText, ""); //$NON-NLS-1$
+
+ setText(activationPropertyNameText, ""); //$NON-NLS-1$
+ setText(activationPropertyValueText, ""); //$NON-NLS-1$
+
+ setText(activationFileExistText, ""); //$NON-NLS-1$
+ setText(activationFileMissingText, ""); //$NON-NLS-1$
+
+ setText(activationOsArchitectureText, ""); //$NON-NLS-1$
+ setText(activationOsFamilyText, ""); //$NON-NLS-1$
+ setText(activationOsNameText, ""); //$NON-NLS-1$
+ setText(activationOsVersionText, ""); //$NON-NLS-1$
+
+ } else {
+ setButton(activeByDefaultbutton, "true".equals(activation.getActiveByDefault()));
+ setText(activationJdkText, activation.getJdk());
+
+ ActivationProperty property = activation.getProperty();
+ if(property==null) {
+ setText(activationPropertyNameText, ""); //$NON-NLS-1$
+ setText(activationPropertyValueText, ""); //$NON-NLS-1$
+ } else {
+ setText(activationPropertyNameText, property.getName());
+ setText(activationPropertyValueText, property.getValue());
+ }
+
+ ActivationFile file = activation.getFile();
+ if(file==null) {
+ setText(activationFileExistText, ""); //$NON-NLS-1$
+ setText(activationFileMissingText, ""); //$NON-NLS-1$
+ } else {
+ setText(activationFileExistText, file.getExists());
+ setText(activationFileMissingText, file.getMissing());
+ }
+
+ ActivationOS os = activation.getOs();
+ if(os==null) {
+ setText(activationOsArchitectureText, ""); //$NON-NLS-1$
+ setText(activationOsFamilyText, ""); //$NON-NLS-1$
+ setText(activationOsNameText, ""); //$NON-NLS-1$
+ setText(activationOsVersionText, ""); //$NON-NLS-1$
+ } else {
+ setText(activationOsArchitectureText, os.getArch());
+ setText(activationOsFamilyText, os.getFamily());
+ setText(activationOsNameText, os.getName());
+ setText(activationOsVersionText, os.getVersion());
+ }
+ }
+
+ ValueProvider<Activation> activationProvider = new ValueProvider<Activation>() {
+ public Activation getValue() {
+ return currentProfile.getActivation();
+ }
+ public Activation create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ return createActivation(editingDomain, compoundCommand);
+ }
+ };
+ setModifyListener(activeByDefaultbutton, activationProvider, POM_PACKAGE.getActivation_ActiveByDefault(), "false");
+ setModifyListener(activationJdkText, activationProvider, POM_PACKAGE.getActivation_Jdk(), ""); //$NON-NLS-1$
+
+ ValueProvider<ActivationProperty> activationPropertyProvider = new ValueProvider<ActivationProperty>() {
+ public ActivationProperty getValue() {
+ Activation activation = currentProfile.getActivation();
+ return activation==null ? null : activation.getProperty();
+ }
+ public ActivationProperty create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ Activation activation = createActivation(editingDomain, compoundCommand);
+ ActivationProperty activationProperty = activation.getProperty();
+ if(activationProperty == null) {
+ activationProperty = PomFactory.eINSTANCE.createActivationProperty();
+ compoundCommand.append(SetCommand.create(editingDomain, activation, POM_PACKAGE.getActivation_Property(),
+ activationProperty));
+ }
+ return activationProperty;
+ }
+ };
+ setModifyListener(activationPropertyNameText, activationPropertyProvider, POM_PACKAGE.getActivationProperty_Name(), ""); //$NON-NLS-1$
+ setModifyListener(activationPropertyValueText, activationPropertyProvider, POM_PACKAGE.getActivationProperty_Value(), ""); //$NON-NLS-1$
+
+ ValueProvider<ActivationFile> activationFileProvider = new ValueProvider<ActivationFile>() {
+ public ActivationFile getValue() {
+ Activation activation = currentProfile.getActivation();
+ return activation==null ? null : activation.getFile();
+ }
+ public ActivationFile create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ Activation activation = createActivation(editingDomain, compoundCommand);
+ ActivationFile activationFile = activation.getFile();
+ if(activationFile == null) {
+ activationFile = PomFactory.eINSTANCE.createActivationFile();
+ compoundCommand.append(SetCommand.create(editingDomain, activation, POM_PACKAGE.getActivation_File(),
+ activationFile));
+ }
+ return activationFile;
+ }
+ };
+ setModifyListener(activationFileExistText, activationFileProvider, POM_PACKAGE.getActivationFile_Exists(), ""); //$NON-NLS-1$
+ setModifyListener(activationFileMissingText, activationFileProvider, POM_PACKAGE.getActivationFile_Missing(), ""); //$NON-NLS-1$
+
+ ValueProvider<ActivationOS> activationOsProvider = new ValueProvider<ActivationOS>() {
+ public ActivationOS getValue() {
+ Activation activation = currentProfile.getActivation();
+ return activation==null ? null : activation.getOs();
+ }
+ public ActivationOS create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ Activation activation = createActivation(editingDomain, compoundCommand);
+ ActivationOS activationOS = activation.getOs();
+ if(activationOS == null) {
+ activationOS = PomFactory.eINSTANCE.createActivationOS();
+ compoundCommand.append(SetCommand.create(editingDomain, activation, POM_PACKAGE.getActivation_Os(),
+ activationOS));
+ }
+ return activationOS;
+ }
+ };
+ setModifyListener(activationOsArchitectureText, activationOsProvider, POM_PACKAGE.getActivationOS_Arch(), ""); //$NON-NLS-1$
+ setModifyListener(activationOsFamilyText, activationOsProvider, POM_PACKAGE.getActivationOS_Family(), ""); //$NON-NLS-1$
+ setModifyListener(activationOsNameText, activationOsProvider, POM_PACKAGE.getActivationOS_Name(), ""); //$NON-NLS-1$
+ setModifyListener(activationOsVersionText, activationOsProvider, POM_PACKAGE.getActivationOS_Version(), ""); //$NON-NLS-1$
+
+ registerListeners();
+ }
+
+ Activation createActivation(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ Activation activation = currentProfile.getActivation();
+ if(activation == null) {
+ activation = PomFactory.eINSTANCE.createActivation();
+ compoundCommand.append(SetCommand.create(editingDomain, currentProfile, POM_PACKAGE.getProfile_Activation(),
+ activation));
+ }
+ return activation;
+ }
+
+ private void updateDependenciesTab() {
+ ValueProvider<DependencyManagement> dependencyManagementProvider = new ValueProvider<DependencyManagement>() {
+ public DependencyManagement getValue() {
+ DependencyManagement management = currentProfile == null ? null : currentProfile.getDependencyManagement();
+ return management;
+ }
+
+ public DependencyManagement create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ DependencyManagement management = currentProfile.getDependencyManagement();
+ if(management == null) {
+ management = PomFactory.eINSTANCE.createDependencyManagement();
+ Command command = SetCommand.create(editingDomain, currentProfile, //
+ POM_PACKAGE.getProfile_DependencyManagement(), management);
+ compoundCommand.append(command);
+ }
+
+ return management;
+ }
+ };
+
+ dependenciesComposite.loadData(model, dependencyManagementProvider);
+ }
+
+ private void updateRepositoriesTab() {
+ ValueProvider<DistributionManagement> dmProvider = new ValueProvider<DistributionManagement>() {
+ public DistributionManagement getValue() {
+ return currentProfile==null ? null : currentProfile.getDistributionManagement();
+ }
+
+ public DistributionManagement create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ DistributionManagement dm = PomFactory.eINSTANCE.createDistributionManagement();
+ Command command = SetCommand.create(editingDomain, currentProfile, //
+ POM_PACKAGE.getProfile_DistributionManagement(), dm);
+ compoundCommand.append(command);
+ return dm;
+ }
+ };
+
+ repositoriesComposite.loadData(this, model, dmProvider);
+ }
+
+ private void updateBuildTab() {
+ ValueProvider<BuildBase> buildProvider = new ValueProvider<BuildBase>() {
+ public BuildBase getValue() {
+ return currentProfile == null ? null : currentProfile.getBuild();
+ }
+
+ public BuildBase create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ BuildBase buildBase = PomFactory.eINSTANCE.createBuildBase();
+ Command command = SetCommand.create(editingDomain, currentProfile, POM_PACKAGE.getProfile_Build(), buildBase);
+ compoundCommand.append(command);
+ return buildBase;
+ }
+ };
+ buildComposite.loadData(this, buildProvider);
+ }
+
+ private void updatePluginsTab() {
+ ValueProvider<BuildBase> buildProvider = new ValueProvider<BuildBase>() {
+ public BuildBase getValue() {
+ BuildBase build = currentProfile == null ? null : currentProfile.getBuild();
+ return build;
+ }
+
+ public BuildBase create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ BuildBase build = currentProfile.getBuild();
+ if(build == null) {
+ build = PomFactory.eINSTANCE.createBuild();
+ Command command = SetCommand.create(editingDomain, currentProfile, POM_PACKAGE.getProfile_Build(), build);
+ compoundCommand.append(command);
+ }
+
+ return build;
+ }
+ };
+
+ ValueProvider<PluginManagement> pluginManagementProvider = new ValueProvider<PluginManagement>() {
+ public PluginManagement getValue() {
+ BuildBase build = currentProfile == null ? null : currentProfile.getBuild();
+ PluginManagement management = build == null ? null : build.getPluginManagement();
+ return management;
+ }
+
+ public PluginManagement create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ BuildBase build = currentProfile.getBuild();
+ if(build == null) {
+ build = PomFactory.eINSTANCE.createBuild();
+ Command command = SetCommand.create(editingDomain, currentProfile, POM_PACKAGE.getProfile_Build(), build);
+ compoundCommand.append(command);
+ }
+
+ PluginManagement management = build.getPluginManagement();
+ if(management == null) {
+ management = PomFactory.eINSTANCE.createPluginManagement();
+ Command command = SetCommand.create(editingDomain, build, //
+ POM_PACKAGE.getBuildBase_PluginManagement(), management);
+ compoundCommand.append(command);
+ }
+
+ return management;
+ }
+ };
+
+ pluginsComposite.loadData(this, buildProvider, pluginManagementProvider);
+ }
+
+ private void updateReportsTab() {
+ ValueProvider<Reporting> reportingProvider = new ValueProvider<Reporting>() {
+
+ public Reporting getValue() {
+ return currentProfile==null ? null : currentProfile.getReporting();
+ }
+
+ public Reporting create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ Reporting reporting = currentProfile.getReporting();
+ if(reporting == null) {
+ reporting = PomFactory.eINSTANCE.createReporting();
+ Command command = SetCommand.create(editingDomain, currentProfile, POM_PACKAGE.getProfile_Reporting(), reporting);
+ compoundCommand.append(command);
+ }
+ return reporting;
+ }
+ };
+
+ reportingComposite.loadData(this, reportingProvider);
+ }
+
+ private void createBuildTab(FormToolkit toolkit, CTabFolder tabFolder) {
+ CTabItem buildTabItem = new CTabItem(tabFolder, SWT.NONE);
+ buildTabItem.setText(Messages.ProfilesPage_tab_build);
+
+ buildComposite = new BuildComposite(tabFolder, SWT.NONE);
+ buildTabItem.setControl(buildComposite);
+ toolkit.adapt(buildComposite);
+ }
+
+ private void createPluginsTab(FormToolkit toolkit, CTabFolder tabFolder) {
+ CTabItem pluginsTabItem = new CTabItem(tabFolder, SWT.NONE);
+ pluginsTabItem.setText(Messages.ProfilesPage_tab_plugins);
+
+ pluginsComposite = new PluginsComposite(tabFolder, this, SWT.NONE);
+ pluginsTabItem.setControl(pluginsComposite);
+ toolkit.adapt(pluginsComposite);
+ }
+
+ private void createDependenciesTab(CTabFolder tabFolder, FormToolkit toolkit) {
+ CTabItem dependenciesTabItem = new CTabItem(tabFolder, SWT.NONE);
+ dependenciesTabItem.setText(Messages.ProfilesPage_tab_dependencies);
+
+ dependenciesComposite = new DependenciesComposite(tabFolder, this, SWT.NONE, pomEditor);
+ dependenciesTabItem.setControl(dependenciesComposite);
+ toolkit.adapt(dependenciesComposite);
+ }
+
+ private void createRepositoriesTab(FormToolkit toolkit, CTabFolder tabFolder) {
+ CTabItem repositoriesTabItem = new CTabItem(tabFolder, SWT.NONE);
+ repositoriesTabItem.setText(Messages.ProfilesPage_tab_repositories);
+
+ repositoriesComposite = new RepositoriesComposite(tabFolder, SWT.NONE);
+ repositoriesTabItem.setControl(repositoriesComposite);
+ toolkit.adapt(repositoriesComposite);
+ }
+
+ private void createReportsTab(FormToolkit toolkit, CTabFolder tabFolder) {
+ CTabItem reportingTabItem = new CTabItem(tabFolder, SWT.NONE);
+ reportingTabItem.setText(Messages.ProfilesPage_tab_reporting);
+
+ reportingComposite = new ReportingComposite(tabFolder, this, SWT.NONE);
+ toolkit.adapt(reportingComposite);
+ reportingTabItem.setControl(reportingComposite);
+ }
+
+ private void createActivationTab(CTabFolder tabFolder, FormToolkit toolkit) {
+ CTabItem activationTabItem = new CTabItem(tabFolder, SWT.NONE);
+ activationTabItem.setText(Messages.ProfilesPage_tab_activation);
+
+ Composite activationComposite = new Composite(tabFolder, SWT.NONE);
+ toolkit.paintBordersFor(activationComposite);
+ GridLayout activationLayout = new GridLayout(2, false);
+ activationLayout.marginWidth = 0;
+ activationComposite.setLayout(activationLayout);
+ activationTabItem.setControl(activationComposite);
+ toolkit.adapt(activationComposite);
+
+ activeByDefaultbutton = toolkit.createButton(activationComposite, Messages.ProfilesPage_btnActivateByDefault, SWT.CHECK);
+ activeByDefaultbutton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
+
+ Section propertySection = toolkit.createSection(activationComposite, ExpandableComposite.TITLE_BAR);
+ propertySection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ propertySection.setText(Messages.ProfilesPage_section_property);
+
+ Composite propertyComposite = toolkit.createComposite(propertySection, SWT.NONE);
+ GridLayout propertyLayout = new GridLayout(2, false);
+ propertyLayout.marginHeight = 2;
+ propertyLayout.marginWidth = 1;
+ propertyComposite.setLayout(propertyLayout);
+ propertySection.setClient(propertyComposite);
+ toolkit.paintBordersFor(propertyComposite);
+
+ Label propertyNameLabel = toolkit.createLabel(propertyComposite, Messages.ProfilesPage_lblName, SWT.NONE);
+
+ activationPropertyNameText = toolkit.createText(propertyComposite, null, SWT.NONE);
+ activationPropertyNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Label propertyValueLabel = toolkit.createLabel(propertyComposite, Messages.ProfilesPage_lblValue, SWT.NONE);
+
+ activationPropertyValueText = toolkit.createText(propertyComposite, null, SWT.NONE);
+ activationPropertyValueText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Section osSection = toolkit.createSection(activationComposite, ExpandableComposite.TITLE_BAR);
+ osSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 3));
+ osSection.setText(Messages.ProfilesPage_section_os);
+
+ Composite osComposite = new Composite(osSection, SWT.NONE);
+ GridLayout osLayout = new GridLayout(2, false);
+ osLayout.marginWidth = 1;
+ osLayout.marginHeight = 2;
+ osComposite.setLayout(osLayout);
+ toolkit.paintBordersFor(osComposite);
+ toolkit.adapt(osComposite);
+ osSection.setClient(osComposite);
+
+ toolkit.createLabel(osComposite, Messages.ProfilesPage_lblName, SWT.NONE);
+
+ activationOsNameText = toolkit.createText(osComposite, null, SWT.NONE);
+ activationOsNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ toolkit.createLabel(osComposite, Messages.ProfilesPage_lblFamily, SWT.NONE);
+
+ activationOsFamilyText = toolkit.createText(osComposite, null, SWT.NONE);
+ activationOsFamilyText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ toolkit.createLabel(osComposite, Messages.ProfilesPage_lblArchitecture, SWT.NONE);
+
+ activationOsArchitectureText = toolkit.createText(osComposite, null, SWT.NONE);
+ activationOsArchitectureText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ toolkit.createLabel(osComposite, Messages.ProfilesPage_lblVersion, SWT.NONE);
+
+ activationOsVersionText = toolkit.createText(osComposite, null, SWT.NONE);
+ activationOsVersionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Section fileSection = toolkit.createSection(activationComposite, ExpandableComposite.TITLE_BAR);
+ GridData fileGridData = new GridData(SWT.FILL, SWT.TOP, false, false);
+ fileGridData.verticalIndent = 5;
+ fileSection.setLayoutData(fileGridData);
+ fileSection.setText(Messages.ProfilesPage_section_file);
+
+ Composite fileComposite = toolkit.createComposite(fileSection, SWT.NONE);
+ GridLayout fileCompositeLayout = new GridLayout();
+ fileCompositeLayout.marginWidth = 1;
+ fileCompositeLayout.marginHeight = 2;
+ fileCompositeLayout.numColumns = 2;
+ fileComposite.setLayout(fileCompositeLayout);
+ toolkit.paintBordersFor(fileComposite);
+ fileSection.setClient(fileComposite);
+
+ Label fileExistLabel = toolkit.createLabel(fileComposite, Messages.ProfilesPage_lblExists, SWT.NONE);
+
+ activationFileExistText = toolkit.createText(fileComposite, null, SWT.NONE);
+ activationFileExistText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Label fileMissingLabel = toolkit.createLabel(fileComposite, Messages.ProfilesPage_lblMissing, SWT.NONE);
+
+ activationFileMissingText = toolkit.createText(fileComposite, null, SWT.NONE);
+ activationFileMissingText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Section jdkSection = toolkit.createSection(activationComposite, ExpandableComposite.TITLE_BAR);
+ jdkSection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ jdkSection.setText(Messages.ProfilesPage_section_jdk);
+
+ Composite composite = toolkit.createComposite(jdkSection, SWT.NONE);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.marginHeight = 2;
+ gridLayout.marginWidth = 1;
+ gridLayout.numColumns = 2;
+ composite.setLayout(gridLayout);
+ toolkit.paintBordersFor(composite);
+ jdkSection.setClient(composite);
+
+ Label jdkLabel = toolkit.createLabel(composite, Messages.ProfilesPage_lblJdk, SWT.NONE);
+
+ activationJdkText = toolkit.createText(composite, null, SWT.NONE);
+ activationJdkText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ WidthGroup widthGroup = new WidthGroup();
+ activationComposite.addControlListener(widthGroup);
+ widthGroup.addControl(propertyNameLabel);
+ widthGroup.addControl(propertyValueLabel);
+ widthGroup.addControl(fileExistLabel);
+ widthGroup.addControl(fileMissingLabel);
+ widthGroup.addControl(jdkLabel);
+ }
+
+ public void loadData() {
+ profilesEditor.setInput(model.getProfiles());
+ }
+
+ protected void doUpdate(Notification notification){
+ Object object = notification.getNotifier();
+ Object feature = notification.getFeature();
+
+ if(feature == PomPackage.Literals.MODEL__PROFILES) {
+ profilesEditor.refresh();
+ }
+
+ if(object instanceof Profile) {
+ profilesEditor.refresh();
+ if(currentProfile == object)
+ updateProfileDetails((Profile) object);
+ }
+
+ if(feature == PomPackage.Literals.PROFILE__MODULES) {
+ modulesEditor.refresh();
+ }
+
+ if(object instanceof Activation) {
+ EObject container = ((Activation) object).eContainer();
+ if(container==currentProfile) {
+ updateActivationTab();
+ }
+ }
+
+ if(object instanceof ActivationFile || object instanceof ActivationOS || object instanceof ActivationProperty) {
+ Activation activation = (Activation) ((EObject) object).eContainer();
+ EObject container = activation.eContainer();
+ if(container == currentProfile) {
+ updateActivationTab();
+ }
+ }
+ dependenciesComposite.updateView(this, notification);
+ repositoriesComposite.updateView(this, notification);
+ buildComposite.updateView(this, notification);
+ pluginsComposite.updateView(this, notification);
+ reportingComposite.updateView(this, notification);
+ }
+
+ public void updateView(final Notification notification) {
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run(){
+ doUpdate(notification);
+ }
+ });
+
+ }
+
+ void createNewModule(String moduleName) {
+ CompoundCommand compoundCommand = new CompoundCommand();
+ EditingDomain editingDomain = getEditingDomain();
+
+ Command addCommand = AddCommand.create(editingDomain, currentProfile, POM_PACKAGE.getProfile_Modules(), moduleName);
+ compoundCommand.append(addCommand);
+
+ editingDomain.getCommandStack().execute(compoundCommand);
+
+ modulesEditor.setSelection(Collections.singletonList(moduleName));
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PropertiesSection.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PropertiesSection.java
new file mode 100644
index 00000000..9f17525c
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PropertiesSection.java
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import java.util.List;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.xml.type.internal.DataValue.XMLChar;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.m2e.core.ui.dialogs.MavenPropertyDialog;
+import org.eclipse.m2e.editor.composites.ListEditorComposite;
+import org.eclipse.m2e.editor.composites.ListEditorContentProvider;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * This is properties editor (double click edits the property)
+ *
+ * @author Anton Kraev
+ */
+public class PropertiesSection {
+ protected static PomPackage POM_PACKAGE = PomPackage.eINSTANCE;
+
+ private EditingDomain editingDomain;
+ private EObject model;
+ private EStructuralFeature feature;
+ private FormToolkit toolkit;
+ private Composite composite;
+ private Section propertiesSection;
+ ListEditorComposite<PropertyElement> propertiesEditor;
+
+ private VerifyListener listener = new VerifyListener() {
+ public void verifyText(VerifyEvent e) {
+ e.doit = XMLChar.isValidName(e.text);
+ }
+ };
+
+ public PropertiesSection(FormToolkit toolkit, Composite composite, EditingDomain editingDomain) {
+ this.toolkit = toolkit;
+ this.composite = composite;
+ this.editingDomain = editingDomain;
+ createSection();
+ }
+
+ public void setModel(EObject model, EStructuralFeature feature) {
+ this.model = model;
+ this.feature = feature;
+ this.propertiesEditor.setInput(getProperties());
+ }
+
+ private EList<PropertyElement> getProperties() {
+ return (EList<PropertyElement>) model.eGet(feature);
+ }
+
+ private Section createSection() {
+ propertiesSection = toolkit.createSection(composite, //
+ ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
+ propertiesSection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ propertiesSection.setText(Messages.PropertiesSection_section_properties);
+ propertiesSection.setText("Properties");
+ propertiesSection.setData("name", "propertiesSection"); //$NON-NLS-1$ //$NON-NLS-2$
+ toolkit.paintBordersFor(propertiesSection);
+
+ propertiesEditor = new ListEditorComposite<PropertyElement>(propertiesSection, SWT.NONE);
+ propertiesSection.setClient(propertiesEditor);
+ propertiesEditor.getViewer().getTable().setData("name", "properties"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ propertiesEditor.setContentProvider(new ListEditorContentProvider<PropertyElement>());
+ propertiesEditor.setLabelProvider(new PropertyPairLabelProvider());
+
+ propertiesEditor.setCreateButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ createNewProperty();
+ }
+ });
+ propertiesEditor.setRemoveButtonListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ deleteProperties(propertiesEditor.getSelection());
+ }
+ });
+ propertiesEditor.setDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ editProperty(propertiesEditor.getSelection());
+ }
+ }) ;
+
+ toolkit.paintBordersFor(propertiesEditor);
+ toolkit.adapt(propertiesEditor);
+
+ return propertiesSection;
+ }
+
+ public void refresh() {
+ propertiesEditor.refresh();
+ }
+
+ void editProperty(List<PropertyElement> list) {
+ if (list.size() != 1) {
+ return;
+ }
+
+ PropertyElement pp = list.get(0);
+
+ MavenPropertyDialog dialog = new MavenPropertyDialog(propertiesSection.getShell(), //
+ Messages.PropertiesSection_title_editProperty, pp.getName(), pp.getValue(), listener);
+ if(dialog.open() == IDialogConstants.OK_ID) {
+ String key = dialog.getName();
+ String value = dialog.getValue();
+ CompoundCommand command = new CompoundCommand();
+ if (!key.equals(pp.getName())) {
+ command.append(SetCommand.create(editingDomain, pp, POM_PACKAGE.getPropertyElement_Name(), key));
+ }
+ if (!value.equals(pp.getValue())) {
+ command.append(SetCommand.create(editingDomain, pp, POM_PACKAGE.getPropertyElement_Value(), value));
+ }
+ editingDomain.getCommandStack().execute(command);
+ propertiesEditor.setInput(getProperties());
+ }
+ }
+
+ void createNewProperty() {
+ MavenPropertyDialog dialog = new MavenPropertyDialog(propertiesSection.getShell(), //
+ Messages.PropertiesSection_title_addProperty, "", "", listener); //$NON-NLS-2$ //$NON-NLS-3$
+ if(dialog.open() == IDialogConstants.OK_ID) {
+ CompoundCommand command = new CompoundCommand();
+
+ PropertyElement propertyPair = PomFactory.eINSTANCE.createPropertyElement();
+ propertyPair.setName(dialog.getName());
+ propertyPair.setValue(dialog.getValue());
+ command.append(AddCommand.create(editingDomain, model, feature, //
+ propertyPair, getProperties().size()));
+
+ editingDomain.getCommandStack().execute(command);
+ propertiesEditor.setInput(getProperties());
+ }
+ }
+
+ void deleteProperties(List<PropertyElement> selection) {
+ Command deleteProperties = RemoveCommand.create(editingDomain, model, feature, selection);
+ editingDomain.getCommandStack().execute(deleteProperties);
+ propertiesEditor.setInput(getProperties());
+ }
+
+ public ExpandableComposite getSection() {
+ return propertiesSection;
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PropertyPairLabelProvider.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PropertyPairLabelProvider.java
new file mode 100644
index 00000000..b3866afa
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PropertyPairLabelProvider.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Label provider for <code>PropertyPair</code>
+ *
+ * @author Eugene Kuleshov
+ */
+public class PropertyPairLabelProvider extends LabelProvider {
+
+ public String getText(Object element) {
+ if(element instanceof PropertyElement) {
+ PropertyElement pair = (PropertyElement) element;
+ return NLS.bind(Messages.PropertyPairLabelProvider_0, pair.getName(), pair.getValue());
+ }
+ return super.getText(element);
+ }
+
+ public Image getImage(Object element) {
+ return MavenEditorImages.IMG_PROPERTY;
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ReportingPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ReportingPage.java
new file mode 100644
index 00000000..85de7e06
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ReportingPage.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.editor.composites.ReportingComposite;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.Reporting;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class ReportingPage extends MavenPomEditorPage {
+
+ private ReportingComposite reportingComposite;
+
+ private SearchControl searchControl;
+
+ public ReportingPage(MavenPomEditor pomEditor) {
+ super(pomEditor, IMavenConstants.PLUGIN_ID + ".pom.reporting", Messages.ReportingPage_title); //$NON-NLS-1$
+ }
+
+ public void setActive(boolean active) {
+ super.setActive(active);
+ if(active) {
+ reportingComposite.setSearchControl(searchControl);
+ searchControl.getSearchText().setEditable(true);
+ }
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ FormToolkit toolkit = managedForm.getToolkit();
+ ScrolledForm form = managedForm.getForm();
+ form.setText(Messages.ReportingPage_form);
+
+ Composite body = form.getBody();
+ GridLayout gridLayout = new GridLayout(1, true);
+ gridLayout.marginHeight = 0;
+ body.setLayout(gridLayout);
+ toolkit.paintBordersFor(body);
+
+ reportingComposite = new ReportingComposite(body, this, SWT.NONE);
+ reportingComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ toolkit.adapt(reportingComposite);
+
+ searchControl = new SearchControl(Messages.ReportingPage_find, managedForm);
+
+ IToolBarManager pageToolBarManager = form.getForm().getToolBarManager();
+ pageToolBarManager.add(searchControl);
+ pageToolBarManager.add(new Separator());
+
+ form.updateToolBar();
+
+// form.pack();
+
+ super.createFormContent(managedForm);
+ }
+
+ public void loadData() {
+ ValueProvider<Reporting> reportingProvider = new ValueProvider<Reporting>() {
+ public Reporting getValue() {
+ return model.getReporting();
+ }
+
+ public Reporting create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ Reporting reporting = PomFactory.eINSTANCE.createReporting();
+ Command createReportingCommand = SetCommand.create(editingDomain, model, POM_PACKAGE.getModel_Reporting(),
+ reporting);
+ compoundCommand.append(createReportingCommand);
+ return reporting;
+ }
+ };
+ reportingComposite.loadData(this, reportingProvider);
+ }
+
+ public void updateView(final Notification notification) {
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run(){
+ reportingComposite.updateView(ReportingPage.this, notification);
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/RepositoriesPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/RepositoriesPage.java
new file mode 100644
index 00000000..e6c855eb
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/RepositoriesPage.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.editor.composites.RepositoriesComposite;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.m2e.model.edit.pom.DistributionManagement;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class RepositoriesPage extends MavenPomEditorPage {
+
+ private RepositoriesComposite repositoriesComposite;
+
+ public RepositoriesPage(MavenPomEditor pomEditor) {
+ super(pomEditor, IMavenConstants.PLUGIN_ID + ".pom.repositories", Messages.RepositoriesPage_title); //$NON-NLS-1$
+ }
+
+ public void dispose() {
+ if(repositoriesComposite!=null) {
+ repositoriesComposite.dispose();
+ }
+ super.dispose();
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ FormToolkit toolkit = managedForm.getToolkit();
+
+ ScrolledForm form = managedForm.getForm();
+ form.setText(Messages.RepositoriesPage_form);
+
+ Composite body = form.getBody();
+ body.setLayout(new GridLayout(1, true));
+
+ repositoriesComposite = new RepositoriesComposite(body, SWT.NONE);
+ repositoriesComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ toolkit.adapt(repositoriesComposite);
+
+ // form.pack();
+
+ super.createFormContent(managedForm);
+ }
+
+ public void loadData() {
+ ValueProvider<DistributionManagement> distributionManagementProvider = new ValueProvider<DistributionManagement>() {
+ public DistributionManagement getValue() {
+ return model.getDistributionManagement();
+ }
+
+ public DistributionManagement create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ DistributionManagement dm = PomFactory.eINSTANCE.createDistributionManagement();
+ Command command = SetCommand.create(editingDomain, model, POM_PACKAGE.getModel_DistributionManagement(), dm);
+ compoundCommand.append(command);
+ return dm;
+ }
+ };
+
+ repositoriesComposite.loadData(this, model, distributionManagementProvider);
+ }
+
+ public void updateView(final Notification notification) {
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run(){
+ repositoriesComposite.updateView(RepositoriesPage.this, notification);
+ }
+ });
+
+ }
+
+
+// public static class PairNode {
+// final String label;
+// final Object value;
+//
+// public PairNode(String label, Object value) {
+// this.label = label;
+// this.value = value;
+// }
+// }
+//
+//
+// public static class ExclusionsNode {
+//
+// final String label;
+// final Exclusion exclusions;
+//
+// public ExclusionsNode(String label, Exclusion exclusions) {
+// this.label = label;
+// this.exclusions = exclusions;
+// }
+//
+// }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ScopeArtifactFilter.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ScopeArtifactFilter.java
new file mode 100644
index 00000000..124e90a1
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ScopeArtifactFilter.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+
+/**
+ * An artifact filter supporting all dependency scopes
+ *
+ * @author Eugene Kuleshov
+ */
+public class ScopeArtifactFilter implements ArtifactFilter {
+ private final boolean compileScope;
+ private final boolean runtimeScope;
+ private final boolean testScope;
+ private final boolean providedScope;
+ private final boolean systemScope;
+
+ public ScopeArtifactFilter(String scope) {
+ if(Artifact.SCOPE_COMPILE.equals(scope)) {
+ systemScope = true;
+ providedScope = true;
+ compileScope = true;
+ runtimeScope = false;
+ testScope = false;
+ } else if(Artifact.SCOPE_RUNTIME.equals(scope)) {
+ systemScope = false;
+ providedScope = false;
+ compileScope = true;
+ runtimeScope = true;
+ testScope = false;
+ } else if(Artifact.SCOPE_TEST.equals(scope)) {
+ systemScope = true;
+ providedScope = true;
+ compileScope = true;
+ runtimeScope = true;
+ testScope = true;
+ } else if(Artifact.SCOPE_PROVIDED.equals(scope)) {
+ systemScope = false;
+ providedScope = true;
+ compileScope = false;
+ runtimeScope = false;
+ testScope = false;
+ } else if(Artifact.SCOPE_SYSTEM.equals(scope)) {
+ systemScope = true;
+ providedScope = false;
+ compileScope = false;
+ runtimeScope = false;
+ testScope = false;
+ } else {
+ systemScope = false;
+ providedScope = false;
+ compileScope = false;
+ runtimeScope = false;
+ testScope = false;
+ }
+ }
+
+ public boolean include(Artifact artifact) {
+ if(Artifact.SCOPE_COMPILE.equals(artifact.getScope())) {
+ return compileScope;
+ } else if(Artifact.SCOPE_RUNTIME.equals(artifact.getScope())) {
+ return runtimeScope;
+ } else if(Artifact.SCOPE_TEST.equals(artifact.getScope())) {
+ return testScope;
+ } else if(Artifact.SCOPE_PROVIDED.equals(artifact.getScope())) {
+ return providedScope;
+ } else if(Artifact.SCOPE_SYSTEM.equals(artifact.getScope())) {
+ return systemScope;
+ }
+ return true;
+ }
+
+}
+
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/SearchControl.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/SearchControl.java
new file mode 100644
index 00000000..d74b39b0
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/SearchControl.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import org.eclipse.jface.action.ControlContribution;
+import org.eclipse.m2e.editor.MavenEditorImages;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class SearchControl extends ControlContribution {
+ private final IManagedForm managedForm;
+
+ Text searchText;
+
+ public SearchControl(String id, IManagedForm managedForm) {
+ super(id);
+ this.managedForm = managedForm;
+ }
+
+ public Text getSearchText() {
+ return searchText;
+ }
+
+ private boolean isMac(){
+ String os =System.getProperty("os.name"); //$NON-NLS-1$
+ return os != null && os.startsWith("Mac"); //$NON-NLS-1$
+ }
+
+ protected Control createControl(Composite parent) {
+ if(parent instanceof ToolBar) {
+ // the FormHeading class sets the toolbar cursor to hand for some reason,
+ // we change it back so the input control can use a proper I-beam cursor
+ parent.setCursor(null);
+ }
+
+ FormToolkit toolkit = managedForm.getToolkit();
+ Composite composite = toolkit.createComposite(parent);
+
+ GridLayout layout = new GridLayout(3, false);
+ layout.marginWidth = 0;
+ //gross, but on the Mac the search controls are cut off on the bottom,
+ //so they need to be bumped up a little. other OSs are fine.
+ if(isMac()){
+ layout.marginHeight = -1;
+ }
+ layout.verticalSpacing = 0;
+ composite.setLayout(layout);
+ composite.setBackground(null);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ Control label = toolkit.createLabel(composite, Messages.SearchControl_lblSearch);
+ label.setBackground(null);
+
+ searchText = toolkit.createText(composite, "", SWT.FLAT | SWT.SEARCH); //$NON-NLS-1$
+ searchText.setData(FormToolkit.TEXT_BORDER, Boolean.TRUE);
+
+ searchText.setLayoutData(new GridData(200, -1));
+ ToolBar cancelBar = new ToolBar(composite, SWT.FLAT);
+
+ final ToolItem clearToolItem = new ToolItem(cancelBar, SWT.NONE);
+ clearToolItem.setEnabled(false);
+ clearToolItem.setImage(MavenEditorImages.IMG_CLEAR);
+ clearToolItem.setDisabledImage(MavenEditorImages.IMG_CLEAR_DISABLED);
+ clearToolItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ searchText.setText(""); //$NON-NLS-1$
+ }
+ });
+
+ searchText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ clearToolItem.setEnabled(searchText.getText().length() > 0);
+ }
+ });
+
+ toolkit.paintBordersFor(composite);
+
+ return composite;
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/SearchMatcher.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/SearchMatcher.java
new file mode 100644
index 00000000..2e244fea
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/SearchMatcher.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class SearchMatcher extends Matcher {
+
+ private final SearchControl searchControl;
+
+ public SearchMatcher(SearchControl searchControl) {
+ this.searchControl = searchControl;
+ }
+
+ public boolean isMatchingArtifact(String groupId, String artifactId) {
+ String text = searchControl.getSearchText().getText();
+ return (groupId != null && groupId.indexOf(text) > -1) //
+ || (artifactId != null && artifactId.indexOf(text) > -1);
+ }
+
+ public boolean isEmpty() {
+ return searchControl.getSearchText().getText() == null //
+ || searchControl.getSearchText().getText().trim().length() == 0;
+ }
+
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/TeamPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/TeamPage.java
new file mode 100644
index 00000000..a8e5a86d
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/TeamPage.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.editor.composites.TeamComposite;
+import org.eclipse.m2e.editor.internal.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class TeamPage extends MavenPomEditorPage {
+
+ private TeamComposite teamComposite;
+
+ public TeamPage(MavenPomEditor pomEditor) {
+ super(pomEditor, IMavenConstants.PLUGIN_ID + ".pom.team", Messages.TeamPage_title); //$NON-NLS-1$
+ }
+
+ public void dispose() {
+ if(teamComposite!=null) {
+ teamComposite.dispose();
+ }
+ super.dispose();
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ FormToolkit toolkit = managedForm.getToolkit();
+
+ ScrolledForm form = managedForm.getForm();
+ form.setText(Messages.TeamPage_form);
+
+ form.getBody().setLayout(new GridLayout(1, true));
+
+ teamComposite = new TeamComposite(this, form.getBody(), SWT.NONE);
+ teamComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ toolkit.adapt(teamComposite);
+
+// form.pack();
+
+ super.createFormContent(managedForm);
+ }
+
+ public void loadData() {
+ teamComposite.loadData(model );
+ }
+
+ public void updateView(final Notification notification) {
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run(){
+ if(teamComposite!=null) {
+ teamComposite.updateView(notification);
+ }
+ }
+ });
+
+ }
+}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ValueProvider.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ValueProvider.java
new file mode 100644
index 00000000..4517a5b2
--- /dev/null
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/ValueProvider.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.editor.pom;
+
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Value provider for retrieving and creating holder element values
+ *
+ * @author Eugene Kuleshov
+ */
+public abstract class ValueProvider<T> {
+
+ public abstract T getValue();
+
+ public T create(EditingDomain editingDomain, CompoundCommand compoundCommand) {
+ return null;
+ }
+
+ public boolean isEmpty() {
+ return false;
+ }
+
+
+ /**
+ * Default value provider
+ */
+ public static class DefaultValueProvider<T> extends ValueProvider<T> {
+ private T value;
+
+ public DefaultValueProvider(T value) {
+ this.value = value;
+ }
+
+ public T getValue() {
+ return value;
+ }
+ }
+
+ /**
+ * Default value provider
+ */
+ public abstract static class ParentValueProvider<T> extends ValueProvider<T> {
+ private final Control[] controls;
+
+ public ParentValueProvider(Control... controls) {
+ this.controls = controls;
+ }
+
+ public final boolean isEmpty() {
+ for(Control control : controls) {
+ if(control instanceof Text) {
+ if(!FormUtils.isEmpty(((Text) control).getText())) {
+ return false;
+ }
+ } else if(control instanceof CCombo) {
+ if(!FormUtils.isEmpty(((CCombo) control).getText())) {
+ return false;
+ }
+ } else if(control instanceof Button) {
+ if(!((Button) control).getSelection()) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.feature/.gitignore b/org.eclipse.m2e.feature/.gitignore
new file mode 100644
index 00000000..ea8c4bf7
--- /dev/null
+++ b/org.eclipse.m2e.feature/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/org.eclipse.m2e.feature/.project b/org.eclipse.m2e.feature/.project
new file mode 100644
index 00000000..a3e398b0
--- /dev/null
+++ b/org.eclipse.m2e.feature/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.feature/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.m2e.feature/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 00000000..75d00071
--- /dev/null
+++ b/org.eclipse.m2e.feature/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Thu Aug 28 19:43:07 EDT 2008
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
diff --git a/org.eclipse.m2e.feature/.settings/org.eclipse.mylyn.team.ui.prefs b/org.eclipse.m2e.feature/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 00000000..d28cb648
--- /dev/null
+++ b/org.eclipse.m2e.feature/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Thu Jan 10 02:40:41 EST 2008
+commit.comment.template=${task.key}\: ${task.description}
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.feature/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.feature/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..6eb70a5d
--- /dev/null
+++ b/org.eclipse.m2e.feature/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:21 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.feature/build.properties b/org.eclipse.m2e.feature/build.properties
new file mode 100644
index 00000000..502d3c5e
--- /dev/null
+++ b/org.eclipse.m2e.feature/build.properties
@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2008-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
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
+bin.includes = feature.xml,\
+ p2.inf,\
+ about.ini,\
+ about.properties,\
+ epl-v10.html,\
+ feature.properties,\
+ license.html
diff --git a/org.eclipse.m2e.feature/epl-v10.html b/org.eclipse.m2e.feature/epl-v10.html
new file mode 100644
index 00000000..ed4b1966
--- /dev/null
+++ b/org.eclipse.m2e.feature/epl-v10.html
@@ -0,0 +1,328 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 9">
+<meta name=Originator content="Microsoft Word 9">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor (&quot;Commercial
+Contributor&quot;) hereby agrees to defend and indemnify every other
+Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
+costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
+
+</div>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/org.eclipse.m2e.feature/feature.properties b/org.eclipse.m2e.feature/feature.properties
new file mode 100644
index 00000000..c0e68dac
--- /dev/null
+++ b/org.eclipse.m2e.feature/feature.properties
@@ -0,0 +1,170 @@
+###############################################################################
+# Copyright (c) 2008, 2010 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 Eclipse (Required)
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse m2e
+
+# "updateSiteName" property - label for the update site
+#updateSiteName=The Eclipse Project Updates
+
+# "description" property - description of the feature
+description=Maven integration. Launching Maven from Eclipse, dependency management and search.
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2008-2010 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
+################ 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=license.html
+
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=\
+Eclipse Foundation Software User Agreement\n\
+April 14, 2010\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+ 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+ the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+ extending or updating the functionality of an Eclipse-based product.\n\
+ 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+ Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+ 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+ govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+ Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+ with the Specification. Such Installable Software Agreement must inform the user of the\n\
+ terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+ the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+ indication of agreement by the user, the provisioning Technology will complete installation\n\
+ of the Installable Software.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
+########### end of license property ##########################################\] \ No newline at end of file
diff --git a/org.eclipse.m2e.feature/feature.xml b/org.eclipse.m2e.feature/feature.xml
new file mode 100644
index 00000000..b8edf6f2
--- /dev/null
+++ b/org.eclipse.m2e.feature/feature.xml
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.m2e.feature"
+ label="%featureName"
+ version="0.13.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.eclipse.m2e.core">
+ <install-handler/>
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <requires>
+ <import plugin="org.eclipse.emf.ecore"/>
+ <import plugin="org.eclipse.emf.ecore.xmi"/>
+ <import plugin="org.eclipse.emf.edit"/>
+ <import plugin="org.eclipse.emf.ecore.edit"/>
+ <import plugin="org.eclipse.wst.common.emf"/>
+ <import plugin="org.eclipse.wst.sse.core"/>
+ <import plugin="org.eclipse.wst.xml.core"/>
+ <import plugin="org.eclipse.jem.util"/>
+ <import feature="org.eclipse.platform" version="3.4.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.rcp" version="3.4.0" match="greaterOrEqual"/>
+ <import feature="org.eclipse.jdt" version="3.4.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.m2e.archetype.common"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.m2e.maven.indexer"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.m2e.model.edit"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.m2e.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.m2e.launching"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.m2e.jdt"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.m2e.editor"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.m2e.editor.xml"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.m2e.maven.runtime"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.m2e.refactoring"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/org.eclipse.m2e.feature/license.html b/org.eclipse.m2e.feature/license.html
new file mode 100644
index 00000000..61d632d9
--- /dev/null
+++ b/org.eclipse.m2e.feature/license.html
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.m2e.feature/p2.inf b/org.eclipse.m2e.feature/p2.inf
new file mode 100644
index 00000000..1459e727
--- /dev/null
+++ b/org.eclipse.m2e.feature/p2.inf
@@ -0,0 +1,13 @@
+units.1.id=org.maven.ide.eclipse
+units.1.properties.0.name=org.eclipse.equinox.p2.name
+units.1.properties.0.value=This version of m2eclipse cannot be installed on top of the already installed m2eclipse. Uninstall the previous version of m2eclipse and try the install again.
+units.1.version=$version$
+units.1.singleton=true
+units.1.provides.0.namespace=osgi.bundle
+units.1.provides.0.name=org.maven.ide.eclipse
+units.1.provides.0.version=$version$
+
+requires.0.namespace=osgi.bundle
+requires.0.name=org.maven.ide.eclipse
+requires.0.range=[$version$, $version$]
+
diff --git a/org.eclipse.m2e.feature/pom.xml b/org.eclipse.m2e.feature/pom.xml
new file mode 100644
index 00000000..4d0e6408
--- /dev/null
+++ b/org.eclipse.m2e.feature/pom.xml
@@ -0,0 +1,24 @@
+<?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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.feature</artifactId>
+ <packaging>eclipse-feature</packaging>
+
+ <name>Maven Integration for Eclipse</name>
+
+</project>
diff --git a/org.eclipse.m2e.jdt/.classpath b/org.eclipse.m2e.jdt/.classpath
new file mode 100644
index 00000000..798048dd
--- /dev/null
+++ b/org.eclipse.m2e.jdt/.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>
diff --git a/org.eclipse.m2e.jdt/.gitignore b/org.eclipse.m2e.jdt/.gitignore
new file mode 100644
index 00000000..4dc00917
--- /dev/null
+++ b/org.eclipse.m2e.jdt/.gitignore
@@ -0,0 +1,2 @@
+/target
+/bin
diff --git a/org.eclipse.m2e.jdt/.options b/org.eclipse.m2e.jdt/.options
new file mode 100644
index 00000000..df7eb573
--- /dev/null
+++ b/org.eclipse.m2e.jdt/.options
@@ -0,0 +1,11 @@
+# Debugging options for the org.eclipse.m2e.jdt plugin.
+
+# Turn on debugging for the org.eclipse.m2e.jdt plugin.
+org.eclipse.m2e.jdt/debug=false
+
+# Plugin initialization
+org.eclipse.m2e.jdt/debug/initialization=false
+
+# Maven compilation participant
+org.eclipse.m2e.jdt/debug/compilationParticipant=false
+
diff --git a/org.eclipse.m2e.jdt/.project b/org.eclipse.m2e.jdt/.project
new file mode 100644
index 00000000..e3aeb613
--- /dev/null
+++ b/org.eclipse.m2e.jdt/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.jdt</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.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.jdt/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.jdt/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..6d183aba
--- /dev/null
+++ b/org.eclipse.m2e.jdt/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,360 @@
+#Thu Feb 04 10:56:11 EST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,HIGH
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=2
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=1
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=2
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/org.eclipse.m2e.jdt/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.m2e.jdt/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000..1475a796
--- /dev/null
+++ b/org.eclipse.m2e.jdt/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,14 @@
+#Tue Nov 30 18:52:17 EST 2010
+eclipse.preferences.version=1
+formatter_profile=_m2 plugin
+formatter_settings_version=11
+org.eclipse.jdt.ui.exception.name=ex
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;org.w3c;org.xml;org.apache;com;junit;org.eclipse;org.codehaus;org.apache.lucene;org.apache.maven;org.sonatype;org.eclipse.m2e;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.keywordthis=true
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=false
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return Returns the ${bare_field_name}.\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} The ${bare_field_name} to set.\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************&\#13;\n * Copyright (c) 2010 Sonatype, Inc.&\#13;\n * All rights reserved. This program and the accompanying materials&\#13;\n * are made available under the terms of the Eclipse Public License v1.0&\#13;\n * which accompanies this distribution, and is available at&\#13;\n * http\://www.eclipse.org/legal/epl-v10.html&\#13;\n *&\#13;\n * Contributors\:&\#13;\n * Sonatype, Inc. - initial API and implementation&\#13;\n *******************************************************************************/</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * ${type_name}\n *\n * @author ${user}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\nMavenLogger.log(${exception_var});</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method ${enclosing_method}\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\nMavenLogger.log(${exception_var});</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/org.eclipse.m2e.jdt/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.m2e.jdt/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 00000000..c22247a8
--- /dev/null
+++ b/org.eclipse.m2e.jdt/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Fri Aug 01 10:04:25 EDT 2008
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
diff --git a/org.eclipse.m2e.jdt/.settings/org.eclipse.mylyn.team.ui.prefs b/org.eclipse.m2e.jdt/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 00000000..2b36dd4a
--- /dev/null
+++ b/org.eclipse.m2e.jdt/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Fri Aug 01 10:04:25 EDT 2008
+commit.comment.template=${task.key}\: ${task.description}
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.jdt/.settings/org.eclipse.pde.core.prefs b/org.eclipse.m2e.jdt/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 00000000..da324b13
--- /dev/null
+++ b/org.eclipse.m2e.jdt/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+#Fri Oct 26 19:41:18 EDT 2007
+eclipse.preferences.version=1
+resolve.requirebundle=false
diff --git a/org.eclipse.m2e.jdt/.settings/org.eclipse.pde.prefs b/org.eclipse.m2e.jdt/.settings/org.eclipse.pde.prefs
new file mode 100644
index 00000000..94ae750a
--- /dev/null
+++ b/org.eclipse.m2e.jdt/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,23 @@
+#Sat Jul 05 10:00:23 EDT 2008
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.deprecated=2
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.jdt/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.jdt/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..0029eebb
--- /dev/null
+++ b/org.eclipse.m2e.jdt/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:19 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.jdt/META-INF/MANIFEST.MF b/org.eclipse.m2e.jdt/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..c3c66e14
--- /dev/null
+++ b/org.eclipse.m2e.jdt/META-INF/MANIFEST.MF
@@ -0,0 +1,30 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.m2e.jdt;singleton:=true
+Bundle-Version: 0.13.0.qualifier
+Bundle-Localization: plugin
+Export-Package: org.eclipse.m2e.jdt,
+ org.eclipse.m2e.jdt.internal;x-friends:="org.eclipse.m2e.tests",
+ org.eclipse.m2e.jdt.internal.launch;x-friends:="org.eclipse.m2e.tests"
+Require-Bundle: org.eclipse.core.resources,
+ org.eclipse.core.runtime,
+ org.eclipse.jface,
+ org.eclipse.jface.text,
+ org.eclipse.debug.core,
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.launching,
+ org.eclipse.jdt.ui,
+ org.eclipse.ui.workbench,
+ org.eclipse.ui.ide,
+ org.eclipse.ltk.core.refactoring,
+ org.eclipse.search,
+ org.eclipse.m2e.maven.runtime;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.model.edit;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.core;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.ui.console
+Eclipse-LazyStart: true
+Bundle-Activator: org.eclipse.m2e.jdt.MavenJdtPlugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6
+Bundle-Vendor: %Bundle-Vendor
diff --git a/org.eclipse.m2e.jdt/about.html b/org.eclipse.m2e.jdt/about.html
new file mode 100644
index 00000000..70e4b67c
--- /dev/null
+++ b/org.eclipse.m2e.jdt/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>October 29, 2010</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/org.eclipse.m2e.jdt/build.properties b/org.eclipse.m2e.jdt/build.properties
new file mode 100644
index 00000000..14da2312
--- /dev/null
+++ b/org.eclipse.m2e.jdt/build.properties
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2008-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
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
+bin.includes = META-INF/,\
+ plugin.xml,\
+ plugin.properties,\
+ .,\
+ about.html
+jars.compile.order = .
+source.. = src/
+output.. = target/classes/
diff --git a/org.eclipse.m2e.jdt/icons/javadoc.gif b/org.eclipse.m2e.jdt/icons/javadoc.gif
new file mode 100644
index 00000000..c43c5d51
--- /dev/null
+++ b/org.eclipse.m2e.jdt/icons/javadoc.gif
Binary files differ
diff --git a/org.eclipse.m2e.jdt/icons/m2.gif b/org.eclipse.m2e.jdt/icons/m2.gif
new file mode 100644
index 00000000..4b0c0589
--- /dev/null
+++ b/org.eclipse.m2e.jdt/icons/m2.gif
Binary files differ
diff --git a/org.eclipse.m2e.jdt/plugin.properties b/org.eclipse.m2e.jdt/plugin.properties
new file mode 100644
index 00000000..52745875
--- /dev/null
+++ b/org.eclipse.m2e.jdt/plugin.properties
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2007, 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
+#
+
+m2.classpath-container.name=Maven Classpath Container
+m2.classpath-container.page.name=Maven Classpath Container Page
+m2.classpath-container.page.dependencies.name=Maven Managed Dependencies
+
+m2.popup.menu.label=Maven
+
+
+Bundle-Vendor = Sonatype, Inc.
+Bundle-Name = Maven Integration for Eclipse JDT
+configurator.jdt.name = JDT
+filter.description = Filters module folders from the Maven projects
+filter.name = Maven modules filter
+action.label = label
+action.javadoc.label = Open JavaDoc
+action.javadoc2.label = Open JavaDoc
+action.javadoc3.label = Open JavaDoc
+action.javadoc4.label = Open JavaDoc
+lifecycleMapping.jar.name = Jar Lifecycle Mapping \ No newline at end of file
diff --git a/org.eclipse.m2e.jdt/plugin.xml b/org.eclipse.m2e.jdt/plugin.xml
new file mode 100644
index 00000000..0299bbbc
--- /dev/null
+++ b/org.eclipse.m2e.jdt/plugin.xml
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2007, 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
+-->
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.m2e.core.lifecycleMappings">
+ <lifecycleMapping
+ class="org.eclipse.m2e.jdt.internal.JarLifecycleMapping"
+ id="jar"
+ name="%lifecycleMapping.jar.name"
+ packaging-type="jar">
+ <mojo
+ artifactId="maven-compiler-plugin"
+ goals="compile,testCompile"
+ groupId="org.apache.maven.plugins"
+ versionRange="[2.0,)">
+ <configurator
+ id="org.eclipse.m2e.jdt.javaConfigurator">
+ </configurator>
+ </mojo>
+ <mojo
+ artifactId="maven-resources-plugin"
+ goals="resources,testResources"
+ groupId="org.apache.maven.plugins"
+ versionRange="[2.4,)">
+ <configurator
+ id="org.eclipse.m2e.core.project.configurator.MavenResourcesProjectConfigurator">
+ </configurator>
+ </mojo>
+ </lifecycleMapping>
+ </extension>
+
+ <extension point="org.eclipse.jdt.core.classpathContainerInitializer"
+ id="maven2ClasspathContainer"
+ name="%m2.classpath-container.name">
+ <classpathContainerInitializer
+ id="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"
+ class="org.eclipse.m2e.jdt.internal.MavenClasspathContainerInitializer"/>
+ </extension>
+
+ <extension point="org.eclipse.jdt.ui.classpathContainerPage"
+ id="maven2ClasspathContainerPage"
+ name="%m2.classpath-container.page.name">
+ <classpathContainerPage
+ id="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"
+ name="%m2.classpath-container.page.dependencies.name"
+ class="org.eclipse.m2e.jdt.internal.ui.MavenClasspathContainerPage"/>
+ </extension>
+
+ <extension point="org.eclipse.jdt.launching.classpathProviders">
+ <classpathProvider
+ id="org.eclipse.m2e.launchconfig.classpathProvider"
+ class="org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider"/>
+ <classpathProvider
+ id="org.eclipse.m2e.launchconfig.sourcepathProvider"
+ class="org.eclipse.m2e.jdt.internal.launch.MavenSourcePathProvider"/>
+ </extension>
+
+ <extension point="org.eclipse.m2e.core.projectConfigurators">
+ <configurator
+ class="org.eclipse.m2e.jdt.internal.JavaProjectConfigurator"
+ id="org.eclipse.m2e.jdt.javaConfigurator"
+ name="%configurator.jdt.name">
+ </configurator>
+ </extension>
+
+ <extension point="org.eclipse.jdt.core.classpathVariableInitializer">
+ <classpathVariableInitializer variable="M2_REPO" readOnly="true"
+ class="org.eclipse.m2e.jdt.internal.MavenClasspathVariableInitializer"/>
+ </extension>
+
+ <extension point="org.eclipse.core.runtime.adapters">
+ <factory adaptableType="org.eclipse.jdt.core.IPackageFragmentRoot"
+ class="org.eclipse.m2e.jdt.internal.JavaElementsAdapterFactory">
+ <adapter type="org.eclipse.m2e.core.embedder.ArtifactKey"/>
+ <adapter type="org.eclipse.core.runtime.IPath"/>
+ <adapter type="org.eclipse.m2e.core.project.IMavenProjectFacade"/>
+ </factory>
+ <factory adaptableType="org.eclipse.jdt.core.IJavaProject"
+ class="org.eclipse.m2e.jdt.internal.JavaElementsAdapterFactory">
+ <adapter type="org.eclipse.m2e.core.embedder.ArtifactKey"/>
+ <adapter type="org.eclipse.core.runtime.IPath"/>
+ <adapter type="org.eclipse.m2e.core.project.IMavenProjectFacade"/>
+ </factory>
+ <factory adaptableType="org.eclipse.jdt.internal.ui.packageview.ClassPathContainer$RequiredProjectWrapper"
+ class="org.eclipse.m2e.jdt.internal.JavaElementsAdapterFactory">
+ <adapter type="org.eclipse.m2e.core.embedder.ArtifactKey"/>
+ <adapter type="org.eclipse.core.runtime.IPath"/>
+ <adapter type="org.eclipse.m2e.core.project.IMavenProjectFacade"/>
+ </factory>
+ </extension>
+
+ <extension point="org.eclipse.jdt.core.compilationParticipant">
+ <compilationParticipant
+ id="org.eclipse.m2e.compilationParticipant"
+ class="org.eclipse.m2e.jdt.internal.JDTCompilationParticipant"
+ createsProblems="false"
+ modifiesEnvironment="false"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.popupMenus">
+ <objectContribution id="org.eclipse.m2e.classpathMenu"
+ objectClass="org.eclipse.jdt.core.IPackageFragmentRoot"
+ adaptable="true">
+ <action id="org.eclipse.m2e.classpathMenu.action"
+ class="org.eclipse.m2e.core.actions.MavenMenuAction"
+ label="%m2.popup.menu.label"
+ style="pulldown"
+ menubarPath="additions"
+ enablesFor="1"
+ icon="icons/m2.gif"/>
+ </objectContribution>
+ <objectContribution id="org.eclipse.m2e.classpathMenuWrapper"
+ objectClass="org.eclipse.jdt.internal.ui.packageview.ClassPathContainer$RequiredProjectWrapper"
+ adaptable="true">
+ <action id="org.eclipse.m2e.classpathMenu.action"
+ class="org.eclipse.m2e.core.actions.MavenMenuAction"
+ label="%m2.popup.menu.label"
+ style="pulldown"
+ menubarPath="additions"
+ enablesFor="1"
+ icon="icons/m2.gif"/>
+ </objectContribution>
+ </extension>
+
+ <extension point="org.eclipse.m2e.core.m2menu">
+ <factory class="org.eclipse.m2e.jdt.internal.ui.MavenJdtMenuCreator"/>
+ </extension>
+
+ <extension point="org.eclipse.jdt.ui.javaElementFilters">
+ <filter id="org.eclipse.m2e.MavenModuleFilter"
+ targetId="org.eclipse.jdt.ui.PackageExplorer"
+ class="org.eclipse.m2e.ui.internal.filter.MavenModuleFilter"
+ description="%filter.description"
+ name="%filter.name"
+ enabled="false"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.editorActions">
+ <editorContribution id="org.eclipse.m2e.jdt.downloadSourcesContribution"
+ targetID="org.eclipse.jdt.ui.ClassFileEditor">
+ <action id="org.eclipse.m2e.jdt.downloadSourcesAction"
+ class="org.eclipse.m2e.jdt.DownloadSourcesActionDelegate"
+ label="%action.label" style="push"/>
+ </editorContribution>
+ </extension>
+
+ <extension point="org.eclipse.ui.popupMenus">
+ <objectContribution id="org.eclipse.m2e.openJavaDocArtifact"
+ objectClass="org.apache.maven.artifact.Artifact"
+ adaptable="false">
+ <action id="org.eclipse.m2e.ui.openJavaDocArtifact"
+ class="org.eclipse.m2e.jdt.internal.actions.OpenJavaDocAction"
+ label="%action.javadoc.label"
+ enablesFor="1" icon="icons/javadoc.gif"/>
+ </objectContribution>
+ <objectContribution id="org.eclipse.m2e.openJavaDocDependencyNode"
+ objectClass="org.apache.maven.shared.dependency.tree.DependencyNode"
+ adaptable="false">
+ <action id="org.eclipse.m2e.ui.openJavaDocDependencyNode"
+ class="org.eclipse.m2e.jdt.internal.actions.OpenJavaDocAction"
+ label="%action.javadoc2.label"
+ enablesFor="1" icon="icons/javadoc.gif"/>
+ </objectContribution>
+ <objectContribution id="org.eclipse.m2e.openJavaDocDependencyNodeAether"
+ objectClass="org.sonatype.aether.graph.DependencyNode"
+ adaptable="false">
+ <action id="org.eclipse.m2e.ui.openJavaDocDependencyNode"
+ class="org.eclipse.m2e.jdt.internal.actions.OpenJavaDocAction"
+ label="%action.javadoc3.label"
+ enablesFor="1" icon="icons/javadoc.gif"/>
+ </objectContribution>
+ <objectContribution id="org.eclipse.m2e.openJavaDocDependency"
+ objectClass="org.eclipse.m2e.model.edit.pom.Dependency"
+ adaptable="false">
+ <action id="org.eclipse.m2e.ui.openJavaDocDependency"
+ class="org.eclipse.m2e.jdt.internal.actions.OpenJavaDocAction"
+ label="%action.javadoc4.label"
+ enablesFor="1"/>
+ </objectContribution>
+ </extension>
+ <extension
+ point="org.eclipse.m2e.core.lifecycleMappingPropertyPage">
+ <lifecycleMappingPropertyPage
+ class="org.eclipse.m2e.core.ui.internal.preferences.CustomizableLifecycleMappingPropertyPage"
+ lifecycleMappingId="jar">
+ </lifecycleMappingPropertyPage>
+ </extension>
+
+</plugin>
diff --git a/org.eclipse.m2e.jdt/pom.xml b/org.eclipse.m2e.jdt/pom.xml
new file mode 100644
index 00000000..3f5901c8
--- /dev/null
+++ b/org.eclipse.m2e.jdt/pom.xml
@@ -0,0 +1,24 @@
+<?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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.jdt</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>Maven Integration for Eclipse JDT</name>
+
+</project>
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/BuildPathManager.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/BuildPathManager.java
new file mode 100644
index 00000000..d6ef5063
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/BuildPathManager.java
@@ -0,0 +1,923 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.ElementChangedEvent;
+import org.eclipse.jdt.core.IClasspathAttribute;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IElementChangedListener;
+import org.eclipse.jdt.core.IJavaElementDelta;
+import org.eclipse.jdt.core.IJavaModel;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.DeltaProcessingState;
+import org.eclipse.jdt.internal.core.JavaElementDelta;
+import org.eclipse.jdt.internal.core.JavaModelManager;
+import org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.index.IndexedArtifactFile;
+import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+import org.eclipse.m2e.jdt.internal.ClasspathDescriptor;
+import org.eclipse.m2e.jdt.internal.DefaultClasspathManagerDelegate;
+import org.eclipse.m2e.jdt.internal.MavenClasspathContainer;
+import org.eclipse.m2e.jdt.internal.MavenClasspathContainerSaveHelper;
+import org.eclipse.m2e.jdt.internal.Messages;
+
+/**
+ * This class is responsible for mapping Maven classpath to JDT and back.
+ *
+ * @deprecated this classes is internal implementation and should be replaced with IClasspathManager before 1.0
+ */
+@SuppressWarnings("restriction")
+public class BuildPathManager implements IMavenProjectChangedListener, IResourceChangeListener {
+
+ // container settings
+ public static final String CONTAINER_ID = "org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"; //$NON-NLS-1$
+
+ // entry attributes
+ public static final String GROUP_ID_ATTRIBUTE = "maven.groupId"; //$NON-NLS-1$
+
+ public static final String ARTIFACT_ID_ATTRIBUTE = "maven.artifactId"; //$NON-NLS-1$
+
+ public static final String VERSION_ATTRIBUTE = "maven.version"; //$NON-NLS-1$
+
+ public static final String CLASSIFIER_ATTRIBUTE = "maven.classifier"; //$NON-NLS-1$
+
+ public static final String SCOPE_ATTRIBUTE = "maven.scope"; //$NON-NLS-1$
+
+ // local repository variable
+ public static final String M2_REPO = "M2_REPO"; //$NON-NLS-1$
+
+ private static final String PROPERTY_SRC_ROOT = ".srcRoot"; //$NON-NLS-1$
+
+ private static final String PROPERTY_SRC_PATH = ".srcPath"; //$NON-NLS-1$
+
+ private static final String PROPERTY_JAVADOC_URL = ".javadoc"; //$NON-NLS-1$
+
+ static final String CLASSIFIER_SOURCES = "sources"; //$NON-NLS-1$
+
+ static final String CLASSIFIER_JAVADOC = "javadoc"; //$NON-NLS-1$
+
+ static final String CLASSIFIER_TESTS = "tests"; //$NON-NLS-1$
+
+ static final String CLASSIFIER_TESTSOURCES = "test-sources"; //$NON-NLS-1$
+
+ public static final int CLASSPATH_TEST = 0;
+
+ public static final int CLASSPATH_RUNTIME = 1;
+
+ // test is the widest possible scope, and this is what we need by default
+ public static final int CLASSPATH_DEFAULT = CLASSPATH_TEST;
+
+ public static final ArtifactFilter SCOPE_FILTER_RUNTIME = new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME);
+
+ public static final ArtifactFilter SCOPE_FILTER_TEST = new ScopeArtifactFilter(Artifact.SCOPE_TEST);
+
+ final MavenConsole console;
+
+ final MavenProjectManager projectManager;
+
+ final IMavenConfiguration mavenConfiguration;
+
+ final IndexManager indexManager;
+
+ final BundleContext bundleContext;
+
+ final IMaven maven;
+
+ final File stateLocationDir;
+
+ private String jdtVersion;
+
+ private final DownloadSourcesJob downloadSourcesJob;
+
+ private final DefaultClasspathManagerDelegate defaultDelegate;
+
+ public BuildPathManager(MavenConsole console, MavenProjectManager projectManager, IndexManager indexManager,
+ BundleContext bundleContext, File stateLocationDir) {
+ this.console = console;
+ this.projectManager = projectManager;
+ this.indexManager = indexManager;
+ this.mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+ this.bundleContext = bundleContext;
+ this.stateLocationDir = stateLocationDir;
+ this.maven = MavenPlugin.getDefault().getMaven();
+ this.downloadSourcesJob = new DownloadSourcesJob(this);
+ this.defaultDelegate = new DefaultClasspathManagerDelegate();
+ }
+
+ public static boolean isMaven2ClasspathContainer(IPath containerPath) {
+ return containerPath != null && containerPath.segmentCount() > 0
+ && CONTAINER_ID.equals(containerPath.segment(0));
+ }
+
+ public static IClasspathEntry getDefaultContainerEntry() {
+ return JavaCore.newContainerEntry(new Path(CONTAINER_ID));
+ }
+
+ public static IClasspathEntry getMavenContainerEntry(IJavaProject javaProject) {
+ if(javaProject != null) {
+ try {
+ for(IClasspathEntry entry : javaProject.getRawClasspath()) {
+ if(isMaven2ClasspathContainer(entry.getPath())) {
+ return entry;
+ }
+ }
+ } catch(JavaModelException ex) {
+ return null;
+ }
+ }
+ return null;
+ }
+
+ /**
+ XXX In Eclipse 3.3, changes to resolved classpath are not announced by JDT Core
+ and PackageExplorer does not properly refresh when we update Maven
+ classpath container.
+ As a temporary workaround, send F_CLASSPATH_CHANGED notifications
+ to all PackageExplorerContentProvider instances listening to
+ java ElementChangedEvent.
+ Note that even with this hack, build clean is sometimes necessary to
+ reconcile PackageExplorer with actual classpath
+ See https://bugs.eclipse.org/bugs/show_bug.cgi?id=154071
+ */
+ private void forcePackageExplorerRefresh(IJavaProject javaProject) {
+ if(getJDTVersion().startsWith("3.3")) { //$NON-NLS-1$
+ DeltaProcessingState state = JavaModelManager.getJavaModelManager().deltaState;
+ synchronized(state) {
+ for(IElementChangedListener listener : state.elementChangedListeners) {
+ if(listener instanceof PackageExplorerContentProvider) {
+ JavaElementDelta delta = new JavaElementDelta(javaProject);
+ delta.changed(IJavaElementDelta.F_CLASSPATH_CHANGED);
+ listener.elementChanged(new ElementChangedEvent(delta, ElementChangedEvent.POST_CHANGE));
+ }
+ }
+ }
+ }
+ }
+
+ // XXX should inject version instead of looking it up
+ private synchronized String getJDTVersion() {
+ if(jdtVersion == null) {
+ Bundle[] bundles = bundleContext.getBundles();
+ for(int i = 0; i < bundles.length; i++ ) {
+ if(JavaCore.PLUGIN_ID.equals(bundles[i].getSymbolicName())) {
+ jdtVersion = (String) bundles[i].getHeaders().get(Constants.BUNDLE_VERSION);
+ break;
+ }
+ }
+ }
+ return jdtVersion;
+ }
+
+ public static IClasspathContainer getMaven2ClasspathContainer(IJavaProject project) throws JavaModelException {
+ IClasspathEntry[] entries = project.getRawClasspath();
+ for(int i = 0; i < entries.length; i++ ) {
+ IClasspathEntry entry = entries[i];
+ if(entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER && isMaven2ClasspathContainer(entry.getPath())) {
+ return JavaCore.getClasspathContainer(entry.getPath(), project);
+ }
+ }
+ return null;
+ }
+
+ public void mavenProjectChanged(MavenProjectChangedEvent[] events, IProgressMonitor monitor) {
+ Set<IProject> projects = new HashSet<IProject>();
+ monitor.setTaskName(Messages.BuildPathManager_monitor_setting_cp);
+ for(int i = 0; i < events.length; i++ ) {
+ MavenProjectChangedEvent event = events[i];
+ IFile pom = event.getSource();
+ IProject project = pom.getProject();
+ if(project.isAccessible() && projects.add(project)) {
+ updateClasspath(project, monitor);
+ }
+ }
+ }
+
+ public void updateClasspath(IProject project, IProgressMonitor monitor) {
+ IJavaProject javaProject = JavaCore.create(project);
+ if(javaProject != null) {
+ try {
+ IClasspathEntry containerEntry = getMavenContainerEntry(javaProject);
+ IPath path = containerEntry != null ? containerEntry.getPath() : new Path(CONTAINER_ID);
+ IClasspathEntry[] classpath = getClasspath(project, monitor);
+ IClasspathContainer container = new MavenClasspathContainer(path, classpath);
+ JavaCore.setClasspathContainer(container.getPath(), new IJavaProject[] {javaProject},
+ new IClasspathContainer[] {container}, monitor);
+ forcePackageExplorerRefresh(javaProject);
+ saveContainerState(project, container);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+
+ private void saveContainerState(IProject project, IClasspathContainer container) {
+ File containerStateFile = getContainerStateFile(project);
+ FileOutputStream is = null;
+ try {
+ is = new FileOutputStream(containerStateFile);
+ new MavenClasspathContainerSaveHelper().writeContainer(container, is);
+ } catch(IOException ex) {
+ MavenLogger.log("Can't save classpath container state for " + project.getName(), ex); //$NON-NLS-1$
+ } finally {
+ if(is != null) {
+ try {
+ is.close();
+ } catch(IOException ex) {
+ MavenLogger.log("Can't close output stream for " + containerStateFile.getAbsolutePath(), ex); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ public IClasspathContainer getSavedContainer(IProject project) throws CoreException {
+ File containerStateFile = getContainerStateFile(project);
+ if(!containerStateFile.exists()) {
+ return null;
+ }
+
+ FileInputStream is = null;
+ try {
+ is = new FileInputStream(containerStateFile);
+ return new MavenClasspathContainerSaveHelper().readContainer(is);
+ } catch(IOException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, MavenJdtPlugin.PLUGIN_ID, -1, //
+ "Can't read classpath container state for " + project.getName(), ex));
+ } catch(ClassNotFoundException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, MavenJdtPlugin.PLUGIN_ID, -1, //
+ "Can't read classpath container state for " + project.getName(), ex));
+ } finally {
+ if(is != null) {
+ try {
+ is.close();
+ } catch(IOException ex) {
+ MavenLogger.log("Can't close output stream for " + containerStateFile.getAbsolutePath(), ex); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ private IClasspathEntry[] getClasspath(IMavenProjectFacade projectFacade, final int kind,
+ final Properties sourceAttachment, boolean uniquePaths, final IProgressMonitor monitor) throws CoreException {
+
+ IJavaProject javaProject = JavaCore.create(projectFacade.getProject());
+
+ final ClasspathDescriptor classpath = new ClasspathDescriptor(javaProject);
+
+ getDelegate(projectFacade, monitor).populateClasspath(classpath, projectFacade, kind, monitor);
+
+ configureAttchedSourcesAndJavadoc(projectFacade, sourceAttachment, classpath, monitor);
+
+ IClasspathEntry[] entries = classpath.getEntries();
+
+ if(uniquePaths) {
+ Map<IPath, IClasspathEntry> paths = new LinkedHashMap<IPath, IClasspathEntry>();
+ for(IClasspathEntry entry : entries) {
+ if(!paths.containsKey(entry.getPath())) {
+ paths.put(entry.getPath(), entry);
+ }
+ }
+ return paths.values().toArray(new IClasspathEntry[paths.size()]);
+ }
+
+ return entries;
+ }
+
+ private IClasspathManagerDelegate getDelegate(IMavenProjectFacade projectFacade, IProgressMonitor monitor)
+ throws CoreException {
+ ILifecycleMapping lifecycleMapping = projectFacade.getLifecycleMapping(monitor);
+ if(lifecycleMapping instanceof IClasspathManagerDelegate) {
+ return (IClasspathManagerDelegate) lifecycleMapping;
+ }
+ return defaultDelegate;
+ }
+
+ private void configureAttchedSourcesAndJavadoc(IMavenProjectFacade facade, Properties sourceAttachment,
+ ClasspathDescriptor classpath, IProgressMonitor monitor) throws CoreException {
+ for(IClasspathEntryDescriptor desc : classpath.getEntryDescriptors()) {
+ if(IClasspathEntry.CPE_LIBRARY == desc.getEntryKind() && desc.getSourceAttachmentPath() == null) {
+ ArtifactKey a = desc.getArtifactKey();
+ String key = desc.getPath().toPortableString();
+
+ IPath srcPath = desc.getSourceAttachmentPath();
+ IPath srcRoot = desc.getSourceAttachmentRootPath();
+ if(srcPath == null && sourceAttachment != null && sourceAttachment.containsKey(key + PROPERTY_SRC_PATH)) {
+ srcPath = Path.fromPortableString((String) sourceAttachment.get(key + PROPERTY_SRC_PATH));
+ if(sourceAttachment.containsKey(key + PROPERTY_SRC_ROOT)) {
+ srcRoot = Path.fromPortableString((String) sourceAttachment.get(key + PROPERTY_SRC_ROOT));
+ }
+ }
+ if(srcPath == null && a != null) {
+ srcPath = getSourcePath(a);
+ }
+
+ // configure javadocs if available
+ String javaDocUrl = desc.getJavadocUrl();
+ if(javaDocUrl == null && sourceAttachment != null && sourceAttachment.containsKey(key + PROPERTY_JAVADOC_URL)) {
+ javaDocUrl = (String) sourceAttachment.get(key + PROPERTY_JAVADOC_URL);
+ }
+ if(javaDocUrl == null && a != null) {
+ javaDocUrl = getJavaDocUrl(a);
+ }
+
+ desc.setSourceAttachment(srcPath, srcRoot);
+ desc.setJavadocUrl(javaDocUrl);
+
+ ArtifactKey aKey = desc.getArtifactKey();
+ if (aKey != null) { // maybe we should try to find artifactKey little harder here?
+ boolean downloadSources = desc.getSourceAttachmentPath() == null && srcPath == null
+ && mavenConfiguration.isDownloadSources();
+ boolean downloadJavaDoc = desc.getJavadocUrl() == null && javaDocUrl == null
+ && mavenConfiguration.isDownloadJavaDoc();
+
+ scheduleDownload(facade.getProject(), facade.getMavenProject(), aKey, downloadSources, downloadJavaDoc);
+ }
+ }
+ }
+ }
+
+ private boolean isUnavailable(ArtifactKey a, List<ArtifactRepository> repositories) throws CoreException {
+ return maven.isUnavailable(a.getGroupId(), a.getArtifactId(), a.getVersion(), "jar" /*type*/, a.getClassifier(), repositories); //$NON-NLS-1$
+ }
+
+// public void downloadSources(IProject project, ArtifactKey artifact, boolean downloadSources, boolean downloadJavaDoc) throws CoreException {
+// List<ArtifactRepository> repositories = null;
+// IMavenProjectFacade facade = projectManager.getProject(project);
+// if (facade != null) {
+// MavenProject mavenProject = facade.getMavenProject();
+// if (mavenProject != null) {
+// repositories = mavenProject.getRemoteArtifactRepositories();
+// }
+// }
+// doDownloadSources(project, artifact, downloadSources, downloadJavaDoc, repositories);
+// }
+
+ public IClasspathEntry[] getClasspath(IProject project, int scope, IProgressMonitor monitor) throws CoreException {
+ return getClasspath(project, scope, true, monitor);
+ }
+
+ public IClasspathEntry[] getClasspath(IProject project, int scope, boolean uniquePaths, IProgressMonitor monitor) throws CoreException {
+ IMavenProjectFacade facade = projectManager.create(project, monitor);
+ if(facade == null) {
+ return new IClasspathEntry[0];
+ }
+ try {
+ Properties props = new Properties();
+ File file = getSourceAttachmentPropertiesFile(project);
+ if(file.canRead()) {
+ InputStream is = new BufferedInputStream(new FileInputStream(file));
+ try {
+ props.load(is);
+ } finally {
+ is.close();
+ }
+ }
+ return getClasspath(facade, scope, props, uniquePaths, monitor);
+ } catch(IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, MavenJdtPlugin.PLUGIN_ID, -1, //
+ "Can't save classpath container changes", e));
+ }
+ }
+
+ public IClasspathEntry[] getClasspath(IProject project, IProgressMonitor monitor) throws CoreException {
+ return getClasspath(project, CLASSPATH_DEFAULT, monitor);
+ }
+
+ /**
+ * Downloads artifact sources using background job.
+ *
+ * If path is null, downloads sources for all classpath entries of the project,
+ * otherwise downloads sources for the first classpath entry with the
+ * given path.
+ */
+// public void downloadSources(IProject project, IPath path) throws CoreException {
+// downloadSourcesJob.scheduleDownload(project, path, findArtifacts(project, path), true, false);
+// }
+
+ /**
+ * Downloads artifact JavaDocs using background job.
+ *
+ * If path is null, downloads sources for all classpath entries of the project,
+ * otherwise downloads sources for the first classpath entry with the
+ * given path.
+ */
+// public void downloadJavaDoc(IProject project, IPath path) throws CoreException {
+// downloadSourcesJob.scheduleDownload(project, path, findArtifacts(project, path), false, true);
+// }
+
+ private Set<ArtifactKey> findArtifacts(IProject project, IPath path) throws CoreException {
+ ArrayList<IClasspathEntry> entries = findClasspathEntries(project, path);
+
+ Set<ArtifactKey> artifacts = new LinkedHashSet<ArtifactKey>();
+
+ for(IClasspathEntry entry : entries) {
+ ArtifactKey artifact = findArtifactByArtifactKey(entry);
+
+ if(artifact == null) {
+ artifact = findArtifactInIndex(project, entry);
+ if(artifact == null) {
+ // console.logError("Can't find artifact for " + entry.getPath());
+ } else {
+ // console.logMessage("Found indexed artifact " + artifact + " for " + entry.getPath());
+ artifacts.add(artifact);
+ }
+ } else {
+ // console.logMessage("Found artifact " + artifact + " for " + entry.getPath());
+ artifacts.add(artifact);
+ }
+ }
+
+ return artifacts;
+ }
+
+ public ArtifactKey findArtifact(IProject project, IPath path) throws CoreException {
+ if(path != null) {
+ Set<ArtifactKey> artifacts = findArtifacts(project, path);
+ // it is not possible to have more than one classpath entry with the same path
+ if(artifacts.size() > 0) {
+ return artifacts.iterator().next();
+ }
+ }
+ return null;
+ }
+
+ private ArtifactKey findArtifactByArtifactKey(IClasspathEntry entry) {
+ IClasspathAttribute[] attributes = entry.getExtraAttributes();
+ String groupId = null;
+ String artifactId = null;
+ String version = null;
+ String classifier = null;
+ for(int j = 0; j < attributes.length; j++ ) {
+ if(GROUP_ID_ATTRIBUTE.equals(attributes[j].getName())) {
+ groupId = attributes[j].getValue();
+ } else if(ARTIFACT_ID_ATTRIBUTE.equals(attributes[j].getName())) {
+ artifactId = attributes[j].getValue();
+ } else if(VERSION_ATTRIBUTE.equals(attributes[j].getName())) {
+ version = attributes[j].getValue();
+ } else if(CLASSIFIER_ATTRIBUTE.equals(attributes[j].getName())) {
+ classifier = attributes[j].getValue();
+ }
+ }
+
+ if(groupId != null && artifactId != null && version != null) {
+ return new ArtifactKey(groupId, artifactId, version, classifier);
+ }
+ return null;
+ }
+
+ private ArtifactKey findArtifactInIndex(IProject project, IClasspathEntry entry) throws CoreException {
+ IFile jarFile = project.getWorkspace().getRoot().getFile(entry.getPath());
+ File file = jarFile==null || jarFile.getLocation()==null ? entry.getPath().toFile() : jarFile.getLocation().toFile();
+
+ IndexedArtifactFile iaf = indexManager.getIndex(project).identify(file);
+ if(iaf != null) {
+ return new ArtifactKey(iaf.group, iaf.artifact, iaf.version, iaf.classifier);
+ }
+
+ return null;
+ }
+
+ // TODO should it be just one entry?
+ private ArrayList<IClasspathEntry> findClasspathEntries(IProject project, IPath path) throws JavaModelException {
+ ArrayList<IClasspathEntry> entries = new ArrayList<IClasspathEntry>();
+
+ IJavaProject javaProject = JavaCore.create(project);
+ addEntries(entries, javaProject.getRawClasspath(), path);
+
+ IClasspathContainer container = getMaven2ClasspathContainer(javaProject);
+ if(container != null) {
+ addEntries(entries, container.getClasspathEntries(), path);
+ }
+ return entries;
+ }
+
+ private void addEntries(Collection<IClasspathEntry> collection, IClasspathEntry[] entries, IPath path) {
+ for(IClasspathEntry entry : entries) {
+ if(entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY && (path == null || path.equals(entry.getPath()))) {
+ collection.add(entry);
+ }
+ }
+ }
+
+ /**
+ * Extracts and persists custom source/javadoc attachment info
+ */
+ public void persistAttachedSourcesAndJavadoc(IJavaProject project, IClasspathContainer containerSuggestion,
+ IProgressMonitor monitor) throws CoreException {
+ IFile pom = project.getProject().getFile(IMavenConstants.POM_FILE_NAME);
+ IMavenProjectFacade facade = projectManager.create(pom, false, null);
+ if(facade == null) {
+ return;
+ }
+
+ // collect all source/javadoc attachement
+ Properties props = new Properties();
+ IClasspathEntry[] entries = containerSuggestion.getClasspathEntries();
+ for(int i = 0; i < entries.length; i++ ) {
+ IClasspathEntry entry = entries[i];
+ if(IClasspathEntry.CPE_LIBRARY == entry.getEntryKind()) {
+ String path = entry.getPath().toPortableString();
+ if(entry.getSourceAttachmentPath() != null) {
+ props.put(path + PROPERTY_SRC_PATH, entry.getSourceAttachmentPath().toPortableString());
+ }
+ if(entry.getSourceAttachmentRootPath() != null) {
+ props.put(path + PROPERTY_SRC_ROOT, entry.getSourceAttachmentRootPath().toPortableString());
+ }
+ String javadocUrl = getJavadocLocation(entry);
+ if(javadocUrl != null) {
+ props.put(path + PROPERTY_JAVADOC_URL, javadocUrl);
+ }
+ }
+ }
+
+ // eliminate all "standard" source/javadoc attachement we get from local repo
+ entries = getClasspath(facade, CLASSPATH_DEFAULT, null, true, monitor);
+ for(int i = 0; i < entries.length; i++ ) {
+ IClasspathEntry entry = entries[i];
+ if(IClasspathEntry.CPE_LIBRARY == entry.getEntryKind()) {
+ String path = entry.getPath().toPortableString();
+ String value = (String) props.get(path + PROPERTY_SRC_PATH);
+ if (value != null && entry.getSourceAttachmentPath() != null && value.equals(entry.getSourceAttachmentPath().toPortableString())) {
+ props.remove(path + PROPERTY_SRC_PATH);
+ }
+ value = (String) props.get(path + PROPERTY_SRC_ROOT);
+ if (value != null && entry.getSourceAttachmentRootPath() != null && value.equals(entry.getSourceAttachmentRootPath().toPortableString())) {
+ props.remove(path + PROPERTY_SRC_ROOT);
+ }
+ }
+ }
+
+ // persist custom source/javadoc attachement info
+ File file = getSourceAttachmentPropertiesFile(project.getProject());
+ try {
+ OutputStream os = new BufferedOutputStream(new FileOutputStream(file));
+ try {
+ props.store(os, null);
+ } finally {
+ os.close();
+ }
+ } catch(IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, MavenJdtPlugin.PLUGIN_ID, -1, "Can't save classpath container changes", e));
+ }
+
+ // update classpath container. suboptimal as this will re-calculate classpath
+ updateClasspath(project.getProject(), monitor);
+ }
+
+ /** public for unit tests only */
+ public String getJavadocLocation(IClasspathEntry entry) {
+ IClasspathAttribute[] attributes = entry.getExtraAttributes();
+ for(int j = 0; j < attributes.length; j++ ) {
+ IClasspathAttribute attribute = attributes[j];
+ if(IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME.equals(attribute.getName())) {
+ return attribute.getValue();
+ }
+ }
+ return null;
+ }
+
+ /** public for unit tests only */
+ public File getSourceAttachmentPropertiesFile(IProject project) {
+ return new File(stateLocationDir, project.getName() + ".sources"); //$NON-NLS-1$
+ }
+
+ /** public for unit tests only */
+ public File getContainerStateFile(IProject project) {
+ return new File(stateLocationDir, project.getName() + ".container"); //$NON-NLS-1$
+ }
+
+ public void resourceChanged(IResourceChangeEvent event) {
+ int type = event.getType();
+ if(IResourceChangeEvent.PRE_DELETE == type) {
+ // remove custom source and javadoc configuration
+ File attachmentProperties = getSourceAttachmentPropertiesFile((IProject) event.getResource());
+ if(attachmentProperties.exists() && !attachmentProperties.delete()) {
+ MavenLogger.log("Can't delete " + attachmentProperties.getAbsolutePath(), null); //$NON-NLS-1$
+ }
+
+ // remove classpath container state
+ File containerState = getContainerStateFile((IProject) event.getResource());
+ if(containerState.exists() && !containerState.delete()) {
+ MavenLogger.log("Can't delete " + containerState.getAbsolutePath(), null); //$NON-NLS-1$
+ }
+ }
+ }
+
+ public boolean setupVariables() {
+ boolean changed = false;
+ try {
+ File localRepositoryDir = new File(maven.getLocalRepository().getBasedir());
+ IPath oldPath = JavaCore.getClasspathVariable(M2_REPO);
+ IPath newPath = new Path(localRepositoryDir.getAbsolutePath());
+ JavaCore.setClasspathVariable(M2_REPO, //
+ newPath, //
+ new NullProgressMonitor());
+ changed = !newPath.equals(oldPath);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ changed = false;
+ }
+ return changed;
+ }
+
+ public boolean variablesAreInUse() {
+ try {
+ IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
+ IJavaProject[] projects = model.getJavaProjects();
+ for(int i = 0; i < projects.length; i++ ) {
+ IClasspathEntry[] entries = projects[i].getRawClasspath();
+ for(int k = 0; k < entries.length; k++ ) {
+ IClasspathEntry curr = entries[k];
+ if(curr.getEntryKind() == IClasspathEntry.CPE_VARIABLE) {
+ String var = curr.getPath().segment(0);
+ if(M2_REPO.equals(var)) {
+ return true;
+ }
+ }
+ }
+ }
+ } catch(JavaModelException e) {
+ return true;
+ }
+ return false;
+ }
+
+ static String getSourcesClassifier(String baseClassifier) {
+ return BuildPathManager.CLASSIFIER_TESTS.equals(baseClassifier) ? BuildPathManager.CLASSIFIER_TESTSOURCES
+ : BuildPathManager.CLASSIFIER_SOURCES;
+ }
+
+ private IPath getSourcePath(ArtifactKey a) {
+ File file = getAttachedArtifactFile(a, getSourcesClassifier(a.getClassifier()));
+
+ if(file != null) {
+ return Path.fromOSString(file.getAbsolutePath());
+ }
+
+ return null;
+ }
+
+ /**
+ * Resolves artifact from local repository. Returns null if the artifact is not available locally
+ */
+ private File getAttachedArtifactFile(ArtifactKey a, String classifier) {
+ // can't use Maven resolve methods since they mark artifacts as not-found even if they could be resolved remotely
+ try {
+ ArtifactRepository localRepository = maven.getLocalRepository();
+ String relPath = maven.getArtifactPath(localRepository, a.getGroupId(), a.getArtifactId(), a.getVersion(),
+ "jar", classifier); //$NON-NLS-1$
+ File file = new File(localRepository.getBasedir(), relPath).getCanonicalFile();
+ if(file.canRead()) {
+ return file;
+ }
+ } catch(CoreException ex) {
+ // fall through
+ } catch(IOException ex) {
+ // fall through
+ }
+ return null;
+ }
+
+ private String getJavaDocUrl(ArtifactKey base) {
+ File file = getAttachedArtifactFile(base, CLASSIFIER_JAVADOC);
+
+ return getJavaDocUrl(file);
+ }
+
+ static String getJavaDocUrl(File file) {
+ try {
+ if(file != null) {
+ URL fileUrl = file.toURL();
+ return "jar:" + fileUrl.toExternalForm() + "!/" + getJavaDocPathInArchive(file); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ } catch(MalformedURLException ex) {
+ // fall through
+ }
+
+ return null;
+ }
+
+ private static String getJavaDocPathInArchive(File file) {
+ ZipFile jarFile = null;
+ try {
+ jarFile = new ZipFile(file);
+ String marker = "package-list"; //$NON-NLS-1$
+ for(Enumeration<? extends ZipEntry> en = jarFile.entries(); en.hasMoreElements();) {
+ ZipEntry entry = en.nextElement();
+ String entryName = entry.getName();
+ if(entryName.endsWith(marker)) {
+ return entry.getName().substring(0, entryName.length() - marker.length());
+ }
+ }
+ } catch(IOException ex) {
+ // ignore
+ } finally {
+ try {
+ if(jarFile != null)
+ jarFile.close();
+ } catch(IOException ex) {
+ //
+ }
+ }
+
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * this is for unit tests only!
+ */
+ public Job getDownloadSourcesJob() {
+ return downloadSourcesJob;
+ }
+
+ public void scheduleDownload(IPackageFragmentRoot fragment, boolean downloadSources, boolean downloadJavadoc) {
+ ArtifactKey artifact = (ArtifactKey) fragment.getAdapter(ArtifactKey.class);
+
+ if(artifact == null) {
+ // we don't know anything about this JAR/ZIP
+ return;
+ }
+
+ IProject project = fragment.getJavaProject().getProject();
+
+ try {
+ if(project.hasNature(IMavenConstants.NATURE_ID)) {
+ IMavenProjectFacade facade = projectManager.getProject(project);
+ MavenProject mavenProject = facade != null ? facade.getMavenProject() : null;
+ if(mavenProject != null) {
+ scheduleDownload(project, mavenProject, artifact, downloadSources, downloadJavadoc);
+ } else {
+ downloadSourcesJob.scheduleDownload(project, artifact, downloadSources, downloadJavadoc);
+ }
+ } else {
+ // this is a non-maven project
+ List<ArtifactRepository> repositories = maven.getArtifactRepositories();
+ ArtifactKey[] attached = getAttachedSourcesAndJavadoc(artifact, repositories, downloadSources, downloadJavadoc);
+
+ if(attached[0] != null || attached[1] != null) {
+ downloadSourcesJob.scheduleDownload(fragment, artifact, downloadSources, downloadJavadoc);
+ }
+ }
+ } catch(CoreException e) {
+ MavenLogger.log("Could not schedule sources/javadoc download", e); //$NON-NLS-1$
+ }
+
+ }
+
+ public void scheduleDownload(final IProject project, final boolean downloadSources, final boolean downloadJavadoc) {
+ try {
+ if(project != null && project.isAccessible() && project.hasNature(IMavenConstants.NATURE_ID)) {
+ IMavenProjectFacade facade = projectManager.getProject(project);
+ MavenProject mavenProject = facade != null ? facade.getMavenProject() : null;
+ if(mavenProject != null) {
+ for(Artifact artifact : mavenProject.getArtifacts()) {
+ ArtifactKey artifactKey = new ArtifactKey(artifact.getGroupId(), artifact.getArtifactId(), artifact.getBaseVersion(), artifact.getClassifier());
+ scheduleDownload(project, mavenProject, artifactKey, downloadSources, downloadJavadoc);
+ }
+ } else {
+ // project is not in the cache, push all processing to the background job
+ downloadSourcesJob.scheduleDownload(project, null, downloadSources, downloadJavadoc);
+ }
+ }
+ } catch(CoreException e) {
+ MavenLogger.log("Could not schedule sources/javadoc download", e); //$NON-NLS-1$
+ }
+ }
+
+ private void scheduleDownload(IProject project, MavenProject mavenProject, ArtifactKey artifact, boolean downloadSources, boolean downloadJavadoc) throws CoreException {
+ ArtifactKey[] attached = getAttachedSourcesAndJavadoc(artifact, mavenProject.getRemoteArtifactRepositories(), downloadSources, downloadJavadoc);
+
+ if(attached[0] != null || attached[1] != null) {
+ downloadSourcesJob.scheduleDownload(project, artifact, downloadSources, downloadJavadoc);
+ }
+ }
+
+ ArtifactKey[] getAttachedSourcesAndJavadoc(ArtifactKey a, List<ArtifactRepository> repositories, boolean downloadSources, boolean downloadJavaDoc) throws CoreException {
+ ArtifactKey sourcesArtifact = new ArtifactKey(a.getGroupId(), a.getArtifactId(), a.getVersion(), getSourcesClassifier(a.getClassifier()));
+ ArtifactKey javadocArtifact = new ArtifactKey(a.getGroupId(), a.getArtifactId(), a.getVersion(), CLASSIFIER_JAVADOC);
+
+ if(repositories != null) {
+ downloadSources &= !isUnavailable(sourcesArtifact, repositories);
+ downloadJavaDoc &= !isUnavailable(javadocArtifact, repositories);
+ }
+
+ ArtifactKey[] result = new ArtifactKey[2];
+
+ if(downloadSources) {
+ result[0] = sourcesArtifact;
+ }
+
+ if(downloadJavaDoc) {
+ result[1] = javadocArtifact;
+ }
+
+ return result;
+ }
+
+ void attachSourcesAndJavadoc(IPackageFragmentRoot fragment, File sources, File javadoc, IProgressMonitor monitor) {
+ IJavaProject javaProject = fragment.getJavaProject();
+
+ IPath srcPath = sources != null ? Path.fromOSString(sources.getAbsolutePath()) : null;
+ String javaDocUrl = getJavaDocUrl(javadoc);
+
+ try {
+ IClasspathEntry[] cp = javaProject.getRawClasspath();
+ for(int i = 0; i < cp.length; i++ ) {
+ IClasspathEntry entry = cp[i];
+ if(IClasspathEntry.CPE_LIBRARY == entry.getEntryKind() && entry.equals(fragment.getRawClasspathEntry())) {
+ List<IClasspathAttribute> attributes = new ArrayList<IClasspathAttribute>(Arrays.asList(entry.getExtraAttributes()));
+
+ if(srcPath == null) {
+ // configure javadocs if available
+ if(javaDocUrl != null) {
+ attributes.add(JavaCore.newClasspathAttribute(IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME,
+ javaDocUrl));
+ }
+ }
+
+ cp[i] = JavaCore.newLibraryEntry(entry.getPath(), srcPath, null, entry.getAccessRules(), //
+ attributes.toArray(new IClasspathAttribute[attributes.size()]), //
+ entry.isExported());
+
+ break;
+ }
+ }
+
+ javaProject.setRawClasspath(cp, monitor);
+ } catch(CoreException e) {
+ MavenLogger.log(e);
+ }
+ }
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/DownloadSourcesActionDelegate.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/DownloadSourcesActionDelegate.java
new file mode 100644
index 00000000..c9b1428f
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/DownloadSourcesActionDelegate.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.m2e.jdt;
+
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.internal.ui.javaeditor.IClassFileEditorInput;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+
+import org.eclipse.m2e.core.core.MavenLogger;
+
+/**
+ *
+ * DownloadSourcesActionDelegate
+ *
+ * @author Anton Kraev
+ */
+
+@SuppressWarnings("restriction")
+public class DownloadSourcesActionDelegate implements IEditorActionDelegate {
+
+ public void setActiveEditor(IAction action, IEditorPart part) {
+
+ if (part != null) {
+ try {
+ BuildPathManager buildpathManager = MavenJdtPlugin .getDefault().getBuildpathManager();
+
+ IClassFileEditorInput input = (IClassFileEditorInput) part.getEditorInput();
+ IJavaElement element = input.getClassFile();
+ while (element.getParent() != null) {
+ element = element.getParent();
+ if (element instanceof IPackageFragmentRoot) {
+ IPackageFragmentRoot root = (IPackageFragmentRoot) element;
+
+ if (root.getSourceAttachmentPath() != null) {
+ // do nothing if sources attached already
+ break;
+ }
+
+ buildpathManager.scheduleDownload(root, true/*sources*/, false/*javadoc*/);
+ }
+ }
+ } catch(Exception ex) {
+ MavenLogger.log("Could not schedule source download", ex); //$NON-NLS-1$
+ }
+ }
+ }
+
+ public void run(IAction action) {
+ // no need to do anything
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ // no need to do anything
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/DownloadSourcesJob.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/DownloadSourcesJob.java
new file mode 100644
index 00000000..737fd9bb
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/DownloadSourcesJob.java
@@ -0,0 +1,270 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.jobs.IBackgroundProcessingQueue;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.jdt.internal.Messages;
+
+
+/**
+ * DownloadSourcesJob
+ *
+ * @author igor
+ */
+class DownloadSourcesJob extends Job implements IBackgroundProcessingQueue {
+
+ private static class DownloadRequest {
+ final IProject project;
+
+ final IPackageFragmentRoot fragment;
+
+ final ArtifactKey artifact;
+
+ final boolean downloadSources;
+
+ final boolean downloadJavaDoc;
+
+ public DownloadRequest(IProject project, IPackageFragmentRoot fragment, ArtifactKey artifact, boolean downloadSources,
+ boolean downloadJavaDoc) {
+ this.project = project;
+ this.fragment = fragment;
+ this.artifact = artifact;
+ this.downloadSources = downloadSources;
+ this.downloadJavaDoc = downloadJavaDoc;
+ }
+
+ public int hashCode() {
+ int hash = 17;
+ hash = hash * 31 + project.hashCode();
+ hash = hash * 31 + (fragment != null? fragment.hashCode(): 0);
+ hash = hash * 31 + (artifact != null? artifact.hashCode(): 0);
+ hash = hash * 31 + (downloadSources ? 1 : 0);
+ hash = hash * 31 + (downloadJavaDoc ? 1 : 0);
+ return hash;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof DownloadRequest)) {
+ return false;
+ }
+ DownloadRequest other = (DownloadRequest) o;
+
+ return project.equals(other.project)
+ && (fragment != null? fragment.equals(other.fragment): other.fragment == null)
+ && (artifact != null? artifact.equals(other.artifact): other.artifact == null)
+ && downloadSources == other.downloadSources
+ && downloadJavaDoc == other.downloadJavaDoc;
+ }
+ }
+
+ private final IMaven maven;
+
+ private final BuildPathManager manager;
+
+ private final MavenConsole console;
+
+ private final MavenProjectManager projectManager;
+
+ private final ArrayList<DownloadRequest> queue = new ArrayList<DownloadRequest>();
+
+ public DownloadSourcesJob(BuildPathManager manager) {
+ super(Messages.DownloadSourcesJob_job_download);
+ this.manager = manager;
+
+ this.maven = MavenPlugin.getDefault().getMaven();
+
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ this.projectManager = plugin.getMavenProjectManager();
+ this.console = plugin.getConsole();
+ }
+
+ public IStatus run(IProgressMonitor monitor) {
+ ArrayList<DownloadRequest> downloadRequests;
+
+ synchronized(this.queue) {
+ downloadRequests = new ArrayList<DownloadRequest>(this.queue);
+ this.queue.clear();
+ }
+
+ ArrayList<IStatus> exceptions = new ArrayList<IStatus>();
+
+ Set<IProject> mavenProjects = new LinkedHashSet<IProject>();
+ Map<IPackageFragmentRoot, File[]> nonMavenProjects = new LinkedHashMap<IPackageFragmentRoot, File[]>();
+
+ for(DownloadRequest request : downloadRequests) {
+ if ( request.artifact != null ) try {
+ IMavenProjectFacade projectFacade = projectManager.create(request.project, monitor);
+
+ if (projectFacade != null) {
+ downloadMaven(projectFacade, request.artifact, request.downloadSources, request.downloadJavaDoc, monitor);
+ mavenProjects.add(request.project);
+ } else {
+ List<ArtifactRepository> repositories = maven.getArtifactRepositories();
+
+ File[] files = downloadAttachments(request.artifact, repositories, request.downloadSources, request.downloadJavaDoc, monitor);
+
+ nonMavenProjects.put(request.fragment, files);
+ }
+ } catch(CoreException ex) {
+ exceptions.add(ex.getStatus());
+ }
+ }
+
+ if(!mavenProjects.isEmpty() || !nonMavenProjects.isEmpty()) {
+ ISchedulingRule schedulingRule = ResourcesPlugin.getWorkspace().getRuleFactory().buildRule();
+ getJobManager().beginRule(schedulingRule, monitor);
+ try {
+ for (IProject mavenProject : mavenProjects) {
+ manager.updateClasspath(mavenProject, monitor);
+ }
+
+ for (Map.Entry<IPackageFragmentRoot, File[]> entry : nonMavenProjects.entrySet()) {
+ File[] files = entry.getValue();
+ manager.attachSourcesAndJavadoc(entry.getKey(), files[0], files[1], monitor);
+ }
+ } finally {
+ getJobManager().endRule(schedulingRule);
+ }
+ }
+
+ if(!exceptions.isEmpty()) {
+ IStatus[] problems = exceptions.toArray(new IStatus[exceptions.size()]);
+ return new MultiStatus(MavenJdtPlugin.PLUGIN_ID, -1, problems, "Could not download sources or javadoc", null);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ private void downloadMaven(IMavenProjectFacade projectFacade, ArtifactKey artifact, boolean downloadSources, boolean downloadJavadoc, IProgressMonitor monitor) throws CoreException {
+ MavenProject mavenProject = projectFacade.getMavenProject(monitor);
+ List<ArtifactRepository> repositories = mavenProject.getRemoteArtifactRepositories();
+
+ if (artifact != null) {
+ downloadAttachments(artifact, repositories, downloadSources, downloadJavadoc, monitor);
+ } else {
+ for (Artifact a : mavenProject.getArtifacts()) {
+ ArtifactKey aKey = new ArtifactKey(a.getGroupId(), a.getArtifactId(), a.getBaseVersion(), a.getClassifier());
+ downloadAttachments(aKey, repositories, downloadSources, downloadJavadoc, monitor);
+ }
+ }
+ }
+
+ private File[] downloadAttachments(ArtifactKey artifact, List<ArtifactRepository> repositories, boolean downloadSources,
+ boolean downloadJavadoc, IProgressMonitor monitor) throws CoreException {
+
+ ArtifactKey[] attached = manager.getAttachedSourcesAndJavadoc(artifact, repositories, downloadSources, downloadJavadoc);
+
+ File[] files = new File[2];
+
+ if (attached[0] != null) {
+ try {
+ files[0] = download(attached[0], repositories, monitor);
+ console.logMessage("Downloaded sources for " + artifact.toString());
+ } catch (CoreException e) {
+ logMessage("Could not download sources for " + artifact.toString(), e); //$NON-NLS-1$
+ }
+ }
+
+ if (attached[1] != null) {
+ try {
+ files[1] = download(attached[1], repositories, monitor);
+ console.logMessage("Downloaded javadoc for " + artifact.toString());
+ } catch (CoreException e) {
+ logMessage("Could not download sources for " + artifact.toString(), e); //$NON-NLS-1$
+ }
+ }
+
+ return files;
+ }
+
+ private File download(ArtifactKey artifact, List<ArtifactRepository> repositories, IProgressMonitor monitor) throws CoreException {
+ Artifact resolved = maven.resolve(artifact.getGroupId(), //
+ artifact.getArtifactId(), //
+ artifact.getVersion(), //
+ "jar" /*type*/, // //$NON-NLS-1$
+ artifact.getClassifier(), //
+ repositories, //
+ monitor);
+ return resolved.getFile();
+ }
+
+ private void logMessage(String msg, CoreException e) {
+ MavenLogger.log(msg, e);
+ console.logMessage(msg);
+ }
+
+ private void scheduleDownload(IProject project, IPackageFragmentRoot fragment, ArtifactKey artifact, boolean downloadSources, boolean downloadJavadoc) {
+ if (project == null || !project.isAccessible()) {
+ return;
+ }
+
+ synchronized(this.queue) {
+ queue.add(new DownloadRequest(project, fragment, artifact, downloadSources, downloadJavadoc));
+ }
+
+ schedule(1000L);
+ }
+
+ /**
+ * If artifact is not null, download sources and/or javadoc of this artifact.
+ * If artifact is null, download sources and/or javadoc of all project dependencies.
+ * Entire project classpath is updated after download.
+ * Does nothing if both downloadSources and downloadJavadoc are false.
+ */
+ public void scheduleDownload(IProject project, ArtifactKey artifact, boolean downloadSources, boolean downloadJavadoc) {
+ scheduleDownload(project, null, artifact, downloadSources, downloadJavadoc);
+ }
+
+ public void scheduleDownload(IPackageFragmentRoot fragment, ArtifactKey artifact, boolean downloadSources, boolean downloadJavadoc) {
+ IProject project = fragment.getJavaProject().getProject();
+ scheduleDownload(project, fragment, artifact, downloadSources, downloadJavadoc);
+ }
+
+ public boolean isEmpty() {
+ synchronized(queue) {
+ return queue.isEmpty();
+ }
+ }
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathDescriptor.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathDescriptor.java
new file mode 100644
index 00000000..426dd3aa
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathDescriptor.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IClasspathEntry;
+
+import org.apache.maven.artifact.Artifact;
+
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+
+/**
+ * Instances of this class can be used to incrementally define IClasspathEntry[] arrays used by JDT to decribe Java
+ * Project classpath and contents of Java classpath containers.
+ *
+ * @author igor
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IClasspathDescriptor {
+
+ public static interface EntryFilter {
+ public boolean accept(IClasspathEntryDescriptor descriptor);
+ }
+
+ /**
+ * @return true if classpath contains entry with specified path, false otherwise.
+ */
+ public boolean containsPath(IPath path);
+
+ /**
+ * Convenience method, equivalent to
+ * <code>addSourceEntry(sourcePath, outputLocation, new IPath[0], new IPath[0], generated)</code>
+ */
+ public IClasspathEntryDescriptor addSourceEntry(IPath sourcePath, IPath outputLocation, boolean generated);
+
+ /**
+ * Adds project source folder to the classpath. The source folder must exist in the workspace unless generated is
+ * true. In the latter case, the source classpath entry will be marked as optional.
+ */
+ public IClasspathEntryDescriptor addSourceEntry(IPath sourcePath, IPath outputLocation, IPath[] inclusion,
+ IPath[] exclusion, boolean generated);
+
+ /**
+ * Adds fully populated IClasspathEntry instance to the classpath.
+ */
+ public IClasspathEntryDescriptor addEntry(IClasspathEntry entry);
+
+ /**
+ * Adds and returns new project classpath entry.
+ */
+ public IClasspathEntryDescriptor addProjectEntry(IPath entryPath);
+
+ /**
+ * Adds and returns new library entry to the classpath
+ */
+ public IClasspathEntryDescriptor addLibraryEntry(IPath entryPath);
+
+ /**
+ * Removes entry with specified path from the classpath. That this can remove multiple entries because classpath does
+ * not enforce uniqueness of entry paths
+ *
+ * @TODO should really be removeEntries (i.e. plural)
+ */
+ public List<IClasspathEntryDescriptor> removeEntry(IPath path);
+
+ /**
+ * Removed entries that match EntryFilter (i.e. EntryFilter#accept(entry) returns true) from the classpath
+ *
+ * @TODO should really be removeEntries (i.e. plural)
+ */
+ public List<IClasspathEntryDescriptor> removeEntry(EntryFilter filter);
+
+ /**
+ * Renders classpath as IClasspathEntry[] array
+ *
+ * @TODO should really be toEntriesArray
+ */
+ public IClasspathEntry[] getEntries();
+
+ /**
+ * Returns underlying "live" list of IClasspathEntryDescriptor instances. Changes to the list will be immediately
+ * reflected in the classpath.
+ */
+ public List<IClasspathEntryDescriptor> getEntryDescriptors();
+
+ // deprecated, to be removed before 1.0
+
+ /**
+ * Adds Maven artifact with corresponding sources and javadoc paths to the classpath.
+ *
+ * @deprecated this method exposes Maven core classes, which are not part of m2eclipse-jdt API
+ */
+ public IClasspathEntryDescriptor addLibraryEntry(Artifact artifact, IPath srcPath, IPath srcRoot, String javaDocUrl);
+
+ /**
+ * Adds worksapce Maven project dependency to the classpath
+ *
+ * @deprecated this method exposes Maven core classes, which are not part of m2eclipse-jdt API
+ */
+ public IClasspathEntryDescriptor addProjectEntry(Artifact artifact, IMavenProjectFacade projectFacade);
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathEntryDescriptor.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathEntryDescriptor.java
new file mode 100644
index 00000000..47cf3343
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathEntryDescriptor.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IAccessRule;
+import org.eclipse.jdt.core.IClasspathAttribute;
+import org.eclipse.jdt.core.IClasspathEntry;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+
+
+/**
+ * Mutable version of IClasspathEntry with additional Maven specific attributes.
+ *
+ * @author igor
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IClasspathEntryDescriptor {
+
+ // classpath entry getters and setters (open a bug if you need any of the missing getters/setters)
+
+ public void setClasspathAttribute(String name, String value);
+
+ public IPath getPath();
+
+ public int getEntryKind();
+
+ public void setSourceAttachment(IPath srcPath, IPath srcRoot);
+
+ public void setJavadocUrl(String javaDocUrl);
+
+ public IPath getSourceAttachmentPath();
+
+ public IPath getSourceAttachmentRootPath();
+
+ public String getJavadocUrl();
+
+ public void setOutputLocation(IPath outputLocation);
+
+ public void setInclusionPatterns(IPath[] inclusionPatterns);
+
+ public void addInclusionPattern(IPath pattern);
+
+ public void setExclusionPatterns(IPath[] exclusionPatterns);
+
+ public IPath[] getInclusionPatterns();
+
+ public void addExclusionPattern(IPath pattern);
+
+ public IPath[] getExclusionPatterns();
+
+ // maven-specific getters and setters
+
+ /**
+ * Short for getArtifactKey().getGroupId(), with appropriate null check
+ */
+ public String getGroupId();
+
+ public void addAccessRule(IAccessRule rule);
+
+ /**
+ * Short for getArtifactKey().getArtifactId(), with appropriate null check
+ */
+ public String getArtifactId();
+
+ public ArtifactKey getArtifactKey();
+
+ public void setArtifactKey(ArtifactKey artifactKey);
+
+ /**
+ * @return true if this entry corresponds to an optional maven dependency, false otherwise
+ */
+ public boolean isOptionalDependency();
+
+ public void setOptionalDependency(boolean optional);
+
+ public String getScope();
+
+ public void setScope(String scope);
+
+ //
+
+ /**
+ * Create IClasspathEntry with information collected in this descriptor
+ */
+ public IClasspathEntry toClasspathEntry();
+
+ // deprecated methods, to be removed before 1.0
+
+ /**
+ * @deprecated use individual setter methods instead
+ */
+ public void setClasspathEntry(IClasspathEntry entry);
+
+ /**
+ * @deprecated use {@link #setClasspathAttribute(String, String)} instead
+ */
+ public void addClasspathAttribute(IClasspathAttribute attribute);
+
+ /**
+ * @deprecated use {@link #toClasspathEntry()} instead
+ */
+ public IClasspathEntry getClasspathEntry();
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathManagerDelegate.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathManagerDelegate.java
new file mode 100644
index 00000000..28035f07
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IClasspathManagerDelegate.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+/**
+ * IBuildPathManagerDelegate
+ *
+ * @author igor
+ */
+public interface IClasspathManagerDelegate {
+
+ public void populateClasspath(IClasspathDescriptor classpath, IMavenProjectFacade projectFacade, int kind,
+ IProgressMonitor monitor) throws CoreException;
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IJavaProjectConfigurator.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IJavaProjectConfigurator.java
new file mode 100644
index 00000000..bcbb8bc2
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/IJavaProjectConfigurator.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
+
+
+/**
+ * IJavaProjectConfigurator
+ *
+ * @author igor
+ */
+public interface IJavaProjectConfigurator {
+
+ /**
+ * Configures *Maven* project classpath, i.e. content of Maven Dependencies classpath container.
+ */
+ public void configureClasspath(IMavenProjectFacade facade, IClasspathDescriptor classpath, IProgressMonitor monitor) throws CoreException;
+
+ /**
+ * Configures *JDT* project classpath, i.e. project-level entries like source folders, JRE and Maven Dependencies
+ * classpath container.
+ */
+ public void configureRawClasspath(ProjectConfigurationRequest request, IClasspathDescriptor classpath,
+ IProgressMonitor monitor) throws CoreException;
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/MavenJdtPlugin.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/MavenJdtPlugin.java
new file mode 100644
index 00000000..3f269c61
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/MavenJdtPlugin.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt;
+
+import java.io.File;
+
+import org.osgi.framework.BundleContext;
+
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.embedder.AbstractMavenConfigurationChangeListener;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.embedder.MavenConfigurationChangeEvent;
+import org.eclipse.m2e.core.index.IndexManager;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.jdt.internal.Messages;
+import org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener;
+
+
+public class MavenJdtPlugin extends AbstractUIPlugin {
+
+ public static String PLUGIN_ID = "org.eclipse.m2e.jdt"; //$NON-NLS-1$
+
+ private static MavenJdtPlugin instance;
+
+ MavenLaunchConfigurationListener launchConfigurationListener;
+ BuildPathManager buildpathManager;
+
+ public MavenJdtPlugin() {
+ instance = this;
+
+ if(Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID + "/debug/initialization"))) { //$NON-NLS-1$
+ System.err.println("### executing constructor " + PLUGIN_ID); //$NON-NLS-1$
+ new Throwable().printStackTrace();
+ }
+ }
+
+ public void start(BundleContext bundleContext) throws Exception {
+ if(Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID + "/debug/initialization"))) { //$NON-NLS-1$
+ System.err.println("### executing start() " + PLUGIN_ID); //$NON-NLS-1$
+ new Throwable().printStackTrace();
+ }
+
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ MavenPlugin mavenPlugin = MavenPlugin.getDefault();
+
+ MavenProjectManager projectManager = mavenPlugin.getMavenProjectManager();
+ MavenConsole console = mavenPlugin.getConsole();
+ IndexManager indexManager = mavenPlugin.getIndexManager();
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+
+ File stateLocationDir = mavenPlugin.getStateLocation().toFile(); // TODO migrate JDT settings to this plugin's store
+
+ this.buildpathManager = new BuildPathManager(console, projectManager, indexManager, bundleContext, stateLocationDir);
+ workspace.addResourceChangeListener(buildpathManager, IResourceChangeEvent.PRE_DELETE);
+
+ projectManager.addMavenProjectChangedListener(this.buildpathManager);
+
+ mavenConfiguration.addConfigurationChangeListener(new AbstractMavenConfigurationChangeListener() {
+ public void mavenConfigutationChange(MavenConfigurationChangeEvent event) {
+ if (!MavenConfigurationChangeEvent.P_USER_SETTINGS_FILE.equals(event.getKey())) {
+ return;
+ }
+
+ if (buildpathManager.setupVariables() && buildpathManager.variablesAreInUse()) {
+ WorkspaceJob job = new WorkspaceJob(Messages.MavenJdtPlugin_job_name) {
+
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
+ return Status.OK_STATUS;
+ }
+
+ };
+ job.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().buildRule());
+ job.schedule();
+ }}});
+
+ this.launchConfigurationListener = new MavenLaunchConfigurationListener();
+ DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(launchConfigurationListener);
+ projectManager.addMavenProjectChangedListener(launchConfigurationListener);
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ MavenPlugin mavenPlugin = MavenPlugin.getDefault();
+
+ MavenProjectManager projectManager = mavenPlugin.getMavenProjectManager();
+ projectManager.removeMavenProjectChangedListener(buildpathManager);
+
+ workspace.removeResourceChangeListener(this.buildpathManager);
+
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(launchConfigurationListener);
+ projectManager.removeMavenProjectChangedListener(launchConfigurationListener);
+
+ this.buildpathManager = null;
+ this.launchConfigurationListener = null;
+ }
+
+ public static MavenJdtPlugin getDefault() {
+ return instance;
+ }
+
+ public BuildPathManager getBuildpathManager() {
+ return buildpathManager;
+ }
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
new file mode 100644
index 00000000..1683672c
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
@@ -0,0 +1,481 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFolder;
+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.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
+import org.eclipse.jdt.launching.environments.IExecutionEnvironmentsManager;
+
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.PluginExecution;
+import org.apache.maven.model.Resource;
+import org.apache.maven.plugin.MojoExecution;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.IProjectConfigurationManager;
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
+import org.eclipse.m2e.core.util.Util;
+import org.eclipse.m2e.jdt.BuildPathManager;
+import org.eclipse.m2e.jdt.IClasspathDescriptor;
+import org.eclipse.m2e.jdt.IClasspathEntryDescriptor;
+import org.eclipse.m2e.jdt.IJavaProjectConfigurator;
+import org.eclipse.m2e.jdt.MavenJdtPlugin;
+
+
+/**
+ * AbstractJavaProjectConfigurator
+ *
+ * @author igor
+ */
+public abstract class AbstractJavaProjectConfigurator extends AbstractProjectConfigurator {
+
+ protected static final List<String> SOURCES = Arrays.asList("1.1,1.2,1.3,1.4,1.5,1.6,1.7".split(",")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ protected static final List<String> TARGETS = Arrays.asList("1.1,1.2,1.3,1.4,jsr14,1.5,1.6,1.7".split(",")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ protected static final LinkedHashMap<String, String> ENVIRONMENTS = new LinkedHashMap<String, String>();
+
+ static {
+ ENVIRONMENTS.put("1.1", "JRE-1.1"); //$NON-NLS-1$ //$NON-NLS-2$
+ ENVIRONMENTS.put("1.2", "J2SE-1.2"); //$NON-NLS-1$ //$NON-NLS-2$
+ ENVIRONMENTS.put("1.3", "J2SE-1.3"); //$NON-NLS-1$ //$NON-NLS-2$
+ ENVIRONMENTS.put("1.4", "J2SE-1.4"); //$NON-NLS-1$ //$NON-NLS-2$
+ ENVIRONMENTS.put("1.5", "J2SE-1.5"); //$NON-NLS-1$ //$NON-NLS-2$
+ ENVIRONMENTS.put("jsr14", "J2SE-1.5"); //$NON-NLS-1$ //$NON-NLS-2$
+ ENVIRONMENTS.put("1.6", "JavaSE-1.6"); //$NON-NLS-1$ //$NON-NLS-2$
+ ENVIRONMENTS.put("1.7", "JavaSE-1.7"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ protected static final String DEFAULT_COMPILER_LEVEL = "1.4"; //$NON-NLS-1$
+
+ public void configure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException {
+ IProject project = request.getProject();
+
+ monitor.setTaskName(Messages.AbstractJavaProjectConfigurator_task_name + project.getName());
+
+ addJavaNature(project, monitor);
+
+ IJavaProject javaProject = JavaCore.create(project);
+
+ MavenProject mavenProject = getMavenProject(request, monitor);
+
+ Map<String, String> options = new HashMap<String, String>();
+
+ addJavaProjectOptions(options, request, mavenProject, monitor);
+
+ IClasspathDescriptor classpath = new ClasspathDescriptor(javaProject);
+
+ addProjectSourceFolders(classpath, request, mavenProject, monitor);
+
+ String environmentId = getExecutionEnvironmentId(options);
+
+ addJREClasspathContainer(classpath, environmentId);
+
+ addMavenClasspathContainer(classpath);
+
+ addCustomClasspathEntries(javaProject, classpath);
+
+ invokeJavaProjectConfigurators(classpath, request, monitor);
+
+ // now apply new configuration
+
+ // A single setOptions call erases everything else from an existing settings file.
+ // Must invoke setOption individually to preserve previous options.
+ for(Map.Entry<String, String> option : options.entrySet()) {
+ javaProject.setOption(option.getKey(), option.getValue());
+ }
+
+ IContainer classesFolder = getFolder(project, mavenProject.getBuild().getOutputDirectory());
+
+ javaProject.setRawClasspath(classpath.getEntries(), classesFolder.getFullPath(), monitor);
+
+ MavenJdtPlugin.getDefault().getBuildpathManager().updateClasspath(project, monitor);
+ }
+
+ protected String getExecutionEnvironmentId(Map<String, String> options) {
+ return ENVIRONMENTS.get(options.get(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM));
+ }
+
+ protected void addJavaNature(IProject project, IProgressMonitor monitor) throws CoreException {
+ addNature(project, JavaCore.NATURE_ID, monitor);
+ }
+
+ protected void addCustomClasspathEntries(IJavaProject javaProject, IClasspathDescriptor classpath)
+ throws JavaModelException {
+ //Preserve existing libraries and classpath order (sort of)
+ // as other containers would have been added AFTER the JRE and M2 ones anyway
+ IClasspathEntry[] cpEntries = javaProject.getRawClasspath();
+ if(cpEntries != null && cpEntries.length > 0) {
+ for(IClasspathEntry entry : cpEntries) {
+ if(IClasspathEntry.CPE_CONTAINER == entry.getEntryKind()
+ && !JavaRuntime.JRE_CONTAINER.equals(entry.getPath().segment(0))
+ && !BuildPathManager.isMaven2ClasspathContainer(entry.getPath())) {
+ classpath.addEntry(entry);
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("unused")
+ protected MavenProject getMavenProject(ProjectConfigurationRequest request, IProgressMonitor monitor)
+ throws CoreException {
+ return request.getMavenProject();
+ }
+
+ protected void invokeJavaProjectConfigurators(IClasspathDescriptor classpath, ProjectConfigurationRequest request,
+ final IProgressMonitor monitor) throws CoreException {
+ IMavenProjectFacade facade = request.getMavenProjectFacade();
+ IProjectConfigurationManager configurationManager = MavenPlugin.getDefault().getProjectConfigurationManager();
+ ILifecycleMapping lifecycleMapping = configurationManager.getLifecycleMapping(facade, monitor);
+ for(AbstractProjectConfigurator configurator : lifecycleMapping.getProjectConfigurators(facade, monitor)) {
+ if(configurator instanceof IJavaProjectConfigurator) {
+ ((IJavaProjectConfigurator) configurator).configureRawClasspath(request, classpath, monitor);
+ }
+ }
+ }
+
+ private void addJREClasspathContainer(IClasspathDescriptor classpath, String environmentId) {
+ // remove existing JRE entry
+ classpath.removeEntry(new ClasspathDescriptor.EntryFilter() {
+ public boolean accept(IClasspathEntryDescriptor descriptor) {
+ return JavaRuntime.JRE_CONTAINER.equals(descriptor.getPath().segment(0));
+ }
+ });
+
+ IClasspathEntry cpe;
+ IExecutionEnvironment executionEnvironment = getExecutionEnvironment(environmentId);
+ if(executionEnvironment == null) {
+ cpe = JavaRuntime.getDefaultJREContainerEntry();
+ } else {
+ IPath containerPath = JavaRuntime.newJREContainerPath(executionEnvironment);
+ cpe = JavaCore.newContainerEntry(containerPath);
+ }
+
+ classpath.addEntry(cpe);
+ }
+
+ private IExecutionEnvironment getExecutionEnvironment(String environmentId) {
+ IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager();
+ for(IExecutionEnvironment environment : manager.getExecutionEnvironments()) {
+ if(environment.getId().equals(environmentId)) {
+ return environment;
+ }
+ }
+ return null;
+ }
+
+ private void addMavenClasspathContainer(IClasspathDescriptor classpath) {
+ // remove any old maven classpath container entries
+ classpath.removeEntry(new ClasspathDescriptor.EntryFilter() {
+ public boolean accept(IClasspathEntryDescriptor entry) {
+ return BuildPathManager.isMaven2ClasspathContainer(entry.getPath());
+ }
+ });
+
+ // add new entry
+ IClasspathEntry cpe = BuildPathManager.getDefaultContainerEntry();
+ classpath.addEntry(cpe);
+ }
+
+ protected void addProjectSourceFolders(IClasspathDescriptor classpath, ProjectConfigurationRequest request,
+ MavenProject mavenProject, IProgressMonitor monitor) throws CoreException {
+ IProject project = request.getProject();
+
+ IFolder classes = getFolder(project, mavenProject.getBuild().getOutputDirectory());
+ IFolder testClasses = getFolder(project, mavenProject.getBuild().getTestOutputDirectory());
+
+ Util.createFolder(classes, true);
+ Util.createFolder(testClasses, true);
+
+ IPath[] inclusion = new IPath[0];
+ IPath[] exclusion = new IPath[0];
+
+ IPath[] inclusionTest = new IPath[0];
+ IPath[] exclusionTest = new IPath[0];
+
+ for(Plugin plugin : mavenProject.getBuildPlugins()) {
+ if(isJavaCompilerExecution(plugin)) {
+ for(PluginExecution execution : plugin.getExecutions()) {
+ for(String goal : execution.getGoals()) {
+ if("compile".equals(goal)) { //$NON-NLS-1$
+ try {
+ inclusion = toPaths(maven.getMojoParameterValue("includes", String[].class, request.getMavenSession(), //$NON-NLS-1$
+ plugin, execution, goal));
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ console.logError("Failed to determine compiler inclusions, assuming defaults");
+ }
+ try {
+ exclusion = toPaths(maven.getMojoParameterValue("excludes", String[].class, request.getMavenSession(), //$NON-NLS-1$
+ plugin, execution, goal));
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ console.logError("Failed to determine compiler exclusions, assuming defaults");
+ }
+ } else if("testCompile".equals(goal)) { //$NON-NLS-1$
+ try {
+ inclusionTest = toPaths(maven.getMojoParameterValue("testIncludes", String[].class, //$NON-NLS-1$
+ request.getMavenSession(), plugin, execution, goal));
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ console.logError("Failed to determine compiler test inclusions, assuming defaults");
+ }
+ try {
+ exclusionTest = toPaths(maven.getMojoParameterValue("testExcludes", String[].class, //$NON-NLS-1$
+ request.getMavenSession(), plugin, execution, goal));
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ console.logError("Failed to determine compiler test exclusions, assuming defaults");
+ }
+ }
+ }
+ }
+ }
+ }
+
+ addSourceDirs(classpath, project, mavenProject.getCompileSourceRoots(), classes.getFullPath(), inclusion, exclusion);
+ addResourceDirs(classpath, project, mavenProject.getBuild().getResources(), classes.getFullPath());
+
+ addSourceDirs(classpath, project, mavenProject.getTestCompileSourceRoots(), testClasses.getFullPath(),
+ inclusionTest, exclusionTest);
+ addResourceDirs(classpath, project, mavenProject.getBuild().getTestResources(), testClasses.getFullPath());
+ }
+
+ private IPath[] toPaths(String[] values) {
+ if(values == null) {
+ return new IPath[0];
+ }
+ IPath[] paths = new IPath[values.length];
+ for(int i = 0; i < values.length; i++ ) {
+ paths[i] = new Path(values[i]);
+ }
+ return paths;
+ }
+
+ private void addSourceDirs(IClasspathDescriptor classpath, IProject project, List<String> sourceRoots,
+ IPath outputPath, IPath[] inclusion, IPath[] exclusion) throws CoreException {
+ for(String sourceRoot : sourceRoots) {
+ IFolder sourceFolder = getFolder(project, sourceRoot);
+
+ if(sourceFolder != null && sourceFolder.exists() && sourceFolder.getProject().equals(project)) {
+ IClasspathEntryDescriptor cped = getEnclosingEntryDescriptor(classpath, sourceFolder.getFullPath());
+ if (cped == null) {
+ console.logMessage("Adding source folder " + sourceFolder.getFullPath());
+ classpath.addSourceEntry(sourceFolder.getFullPath(), outputPath, inclusion, exclusion, false);
+ } else {
+ console.logMessage("Not adding source folder " + sourceFolder.getFullPath() + " because it overlaps with " + cped.getPath());
+ }
+
+ } else {
+ if(sourceFolder != null) {
+ classpath.removeEntry(sourceFolder.getFullPath());
+ }
+ }
+ }
+ }
+
+ private IClasspathEntryDescriptor getEnclosingEntryDescriptor(IClasspathDescriptor classpath, IPath fullPath) {
+ for(IClasspathEntryDescriptor cped : classpath.getEntryDescriptors()) {
+ if(cped.getPath().isPrefixOf(fullPath)) {
+ return cped;
+ }
+ }
+ return null;
+ }
+
+ private void addResourceDirs(IClasspathDescriptor classpath, IProject project, List<Resource> resources,
+ IPath outputPath) throws CoreException {
+
+ for(Resource resource : resources) {
+ File resourceDirectory = new File(resource.getDirectory());
+ if(resourceDirectory.exists() && resourceDirectory.isDirectory()) {
+ IPath relativePath = getProjectRelativePath(project, resource.getDirectory());
+ IResource r = project.findMember(relativePath);
+ if(r == project) {
+ /*
+ * Workaround for the Java Model Exception:
+ * Cannot nest output folder 'xxx/src/main/resources' inside output folder 'xxx'
+ * when pom.xml have something like this:
+ *
+ * <build>
+ * <resources>
+ * <resource>
+ * <directory>${basedir}</directory>
+ * <targetPath>META-INF</targetPath>
+ * <includes>
+ * <include>LICENSE</include>
+ * </includes>
+ * </resource>
+ */
+ console.logError("Skipping resource folder " + r.getFullPath());
+ } else if(r != null && r.getProject().equals(project)) {
+ IClasspathEntryDescriptor cped = getEnclosingEntryDescriptor(classpath, r.getFullPath());
+ if(cped == null) {
+ console.logMessage("Adding resource folder " + r.getFullPath());
+ classpath.addSourceEntry(r.getFullPath(), outputPath, new IPath[0] /*inclusions*/, new IPath[] {new Path(
+ "**")} /*exclusion*/, false /*optional*/);
+ } else {
+ // resources and sources folders overlap. make sure JDT only processes java sources.
+ console.logMessage("Resources folder " + r.getFullPath() + " overlaps with sources folder "
+ + cped.getPath());
+ cped.addInclusionPattern(new Path("**/*.java"));
+ }
+ } else {
+ console.logMessage("Not adding resources folder " + resourceDirectory.getAbsolutePath());
+ }
+ }
+ }
+ }
+
+
+ protected void addJavaProjectOptions(Map<String, String> options, ProjectConfigurationRequest request, MavenProject mavenProject,
+ IProgressMonitor monitor) {
+ MavenSession mavenSession = request.getMavenSession();
+
+ String source = null, target = null;
+
+ for(Plugin plugin : mavenProject.getBuildPlugins()) {
+ if(isJavaCompilerExecution(plugin)) {
+ for(PluginExecution execution : plugin.getExecutions()) {
+ for(String goal : execution.getGoals()) {
+ source = getCompilerLevel(mavenSession, plugin, execution, goal, "source", source, SOURCES); //$NON-NLS-1$
+ target = getCompilerLevel(mavenSession, plugin, execution, goal, "target", target, TARGETS); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ if(source == null) {
+ source = DEFAULT_COMPILER_LEVEL;
+ console.logMessage("Could not determine source level, using default " + source);
+ }
+
+ if(target == null) {
+ target = DEFAULT_COMPILER_LEVEL;
+ console.logMessage("Could not determine target level, using default " + target);
+ }
+
+ options.put(JavaCore.COMPILER_SOURCE, source);
+ options.put(JavaCore.COMPILER_COMPLIANCE, source);
+ options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, target);
+ options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, "warning"); //$NON-NLS-1$
+ }
+
+ private String getCompilerLevel(MavenSession session, Plugin plugin, PluginExecution execution, String goal,
+ String parameter, String source, List<String> levels) {
+
+ int levelIdx = getLevelIndex(source, levels);
+
+ try {
+ source = maven.getMojoParameterValue(parameter, String.class, session, plugin, execution, goal);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ console.logError("Failed to determine compiler " + parameter + " setting, assuming default");
+ }
+
+ int newLevelIdx = getLevelIndex(source, levels);
+
+ if(newLevelIdx > levelIdx) {
+ levelIdx = newLevelIdx;
+ }
+
+ if(levelIdx < 0) {
+ return DEFAULT_COMPILER_LEVEL;
+ }
+
+ return levels.get(levelIdx);
+ }
+
+ private int getLevelIndex(String level, List<String> levels) {
+ return level != null ? levels.indexOf(level) : -1;
+ }
+
+ private boolean isJavaCompilerExecution(Plugin plugin) {
+ return isJavaCompilerPlugin(plugin.getGroupId(), plugin.getArtifactId());
+ }
+
+ private boolean isJavaCompilerPlugin(String groupId, String artifactId) {
+ return "org.apache.maven.plugins".equals(groupId) && "maven-compiler-plugin".equals(artifactId); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void unconfigure(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException {
+ super.unconfigure(request, monitor);
+ removeMavenClasspathContainer(request.getProject());
+ }
+
+ private void removeMavenClasspathContainer(IProject project) throws JavaModelException {
+ IJavaProject javaProject = JavaCore.create(project);
+ if(javaProject != null) {
+ // remove classpatch container from JavaProject
+ ArrayList<IClasspathEntry> newEntries = new ArrayList<IClasspathEntry>();
+ for(IClasspathEntry entry : javaProject.getRawClasspath()) {
+ if(!BuildPathManager.isMaven2ClasspathContainer(entry.getPath())) {
+ newEntries.add(entry);
+ }
+ }
+ javaProject.setRawClasspath(newEntries.toArray(new IClasspathEntry[newEntries.size()]), null);
+ }
+ }
+
+ protected IFolder getFolder(IProject project, String absolutePath) {
+ return project.getFolder(getProjectRelativePath(project, absolutePath));
+ }
+
+ protected IPath getProjectRelativePath(IProject project, String absolutePath) {
+ File basedir = project.getLocation().toFile();
+ String relative;
+ if(absolutePath.equals(basedir.getAbsolutePath())) {
+ relative = "."; //$NON-NLS-1$
+ } else if(absolutePath.startsWith(basedir.getAbsolutePath())) {
+ relative = absolutePath.substring(basedir.getAbsolutePath().length() + 1);
+ } else {
+ relative = absolutePath;
+ }
+ return new Path(relative.replace('\\', '/')); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Override
+ public boolean isSupportedExecution(MojoExecution mojoExecution) {
+ // Supports java compiler plugins by default
+ if(isJavaCompilerPlugin(mojoExecution.getGroupId(), mojoExecution.getArtifactId())) {
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathDescriptor.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathDescriptor.java
new file mode 100644
index 00000000..470a2c9d
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathDescriptor.java
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathAttribute;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+
+import org.apache.maven.artifact.Artifact;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.jdt.IClasspathDescriptor;
+import org.eclipse.m2e.jdt.IClasspathEntryDescriptor;
+
+
+/**
+ * This class is an attempt to encapsulate list of IClasspathEntry's and operations on the list such as "removeEntry",
+ * "addSourceEntry" and "addEntryAttribute". The idea is to provide JavaProjectConfigurator's classpath whiteboard they
+ * can use to incrementally define classpath in a consistent manner.
+ *
+ * @author igor
+ */
+public class ClasspathDescriptor implements IClasspathDescriptor {
+
+ private final ArrayList<IClasspathEntryDescriptor> entries = new ArrayList<IClasspathEntryDescriptor>();
+
+ public ClasspathDescriptor(IJavaProject project) {
+ }
+
+ /**
+ * @return true if classpath contains entry with specified path, false otherwise.
+ */
+ public boolean containsPath(IPath path) {
+ for(IClasspathEntryDescriptor descriptor : entries) {
+ if(path.equals(descriptor.getPath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public ClasspathEntryDescriptor addSourceEntry(IPath sourcePath, IPath outputLocation, boolean generated) {
+ return addSourceEntry(sourcePath, //
+ outputLocation, //
+ new IPath[0] /* inclusion */, //
+ new IPath[0] /* exclusion */, //
+ generated);
+ }
+
+ public List<IClasspathEntryDescriptor> removeEntry(final IPath path) {
+ return removeEntry(new EntryFilter() {
+ public boolean accept(IClasspathEntryDescriptor descriptor) {
+ return path.equals(descriptor.getPath());
+ }
+ });
+ }
+
+ public List<IClasspathEntryDescriptor> removeEntry(EntryFilter filter) {
+ ArrayList<IClasspathEntryDescriptor> result = new ArrayList<IClasspathEntryDescriptor>();
+
+ Iterator<IClasspathEntryDescriptor> iter = entries.iterator();
+ while(iter.hasNext()) {
+ IClasspathEntryDescriptor descriptor = iter.next();
+ if(filter.accept(descriptor)) {
+ result.add(descriptor);
+ iter.remove();
+ }
+ }
+
+ return result;
+ }
+
+ public ClasspathEntryDescriptor addSourceEntry(IPath sourcePath, IPath outputLocation, IPath[] inclusion,
+ IPath[] exclusion, boolean generated) {
+// IWorkspaceRoot workspaceRoot = project.getProject().getWorkspace().getRoot();
+//
+// Util.createFolder(workspaceRoot.getFolder(sourcePath), generated);
+
+ ClasspathEntryDescriptor descriptor = new ClasspathEntryDescriptor(IClasspathEntry.CPE_SOURCE, sourcePath);
+ descriptor.setOutputLocation(outputLocation);
+ descriptor.setInclusionPatterns(inclusion);
+ descriptor.setExclusionPatterns(exclusion);
+ if(generated) {
+ descriptor.setClasspathAttribute(IClasspathAttribute.OPTIONAL, "true"); //$NON-NLS-1$
+ }
+
+ entries.add(descriptor);
+
+ return descriptor;
+ }
+
+ public IClasspathEntry[] getEntries() {
+ IClasspathEntry[] result = new IClasspathEntry[entries.size()];
+
+ for(int i = 0; i < entries.size(); i++ ) {
+ result[i] = entries.get(i).toClasspathEntry();
+ }
+
+ return result;
+ }
+
+ public List<IClasspathEntryDescriptor> getEntryDescriptors() {
+ return entries;
+ }
+
+ public ClasspathEntryDescriptor addEntry(IClasspathEntry cpe) {
+ ClasspathEntryDescriptor entry = new ClasspathEntryDescriptor(cpe);
+ entries.add(entry);
+ return entry;
+ }
+
+ @SuppressWarnings("deprecation")
+ public ClasspathEntryDescriptor addProjectEntry(Artifact a, IMavenProjectFacade projectFacade) {
+ ClasspathEntryDescriptor entry = addProjectEntry(projectFacade.getFullPath());
+ entry.setArtifactKey(new ArtifactKey(a.getGroupId(), a.getArtifactId(), a.getBaseVersion(), a.getClassifier()));
+ entry.setScope(a.getScope());
+ entry.setOptionalDependency(a.isOptional());
+ return entry;
+ }
+
+ public ClasspathEntryDescriptor addProjectEntry(IPath entryPath) {
+ ClasspathEntryDescriptor entry = new ClasspathEntryDescriptor(IClasspathEntry.CPE_PROJECT, entryPath);
+
+ entries.add(entry);
+
+ return entry;
+ }
+
+ @SuppressWarnings("deprecation")
+ public ClasspathEntryDescriptor addLibraryEntry(Artifact artifact, IPath srcPath, IPath srcRoot, String javaDocUrl) {
+ ArtifactKey artifactKey = new ArtifactKey(artifact);
+ IPath entryPath = new Path(artifact.getFile().getAbsolutePath());
+
+ ClasspathEntryDescriptor entry = addLibraryEntry(entryPath);
+ entry.setArtifactKey(artifactKey);
+
+ if(javaDocUrl != null) {
+ entry.setClasspathAttribute(IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, javaDocUrl);
+ }
+
+ return entry;
+ }
+
+ public ClasspathEntryDescriptor addLibraryEntry(IPath entryPath) {
+ ClasspathEntryDescriptor entry = new ClasspathEntryDescriptor(IClasspathEntry.CPE_LIBRARY, entryPath);
+
+ entries.add(entry);
+
+ return entry;
+ }
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java
new file mode 100644
index 00000000..4262a22a
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ClasspathEntryDescriptor.java
@@ -0,0 +1,290 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IAccessRule;
+import org.eclipse.jdt.core.IClasspathAttribute;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.JavaCore;
+
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.jdt.BuildPathManager;
+import org.eclipse.m2e.jdt.IClasspathEntryDescriptor;
+
+
+/**
+ * ClasspathEntryDescriptor
+ *
+ * @author igor
+ */
+public class ClasspathEntryDescriptor implements IClasspathEntryDescriptor {
+
+ private int entryKind;
+
+ private IPath path;
+
+ private boolean exported;
+
+ private IPath outputLocation;
+
+ private List<IAccessRule> accessRules = new ArrayList<IAccessRule>();
+
+ private LinkedHashMap<String, String> attributes = new LinkedHashMap<String, String>();
+
+ private IPath sourceAttachmentPath;
+
+ private IPath sourceAttachmentRootPath;
+
+ private LinkedHashSet<IPath> inclusionPatterns;
+
+ private LinkedHashSet<IPath> exclusionPatterns;
+
+ private boolean combineAccessRules;
+
+ // maven specific attributes below
+
+ private ArtifactKey artifactKey;
+
+ private String scope;
+
+ private boolean optionalDependency;
+
+ public ClasspathEntryDescriptor(int entryKind, IPath path) {
+ this.entryKind = entryKind;
+ this.path = path;
+ }
+
+ public ClasspathEntryDescriptor(IClasspathEntry entry) {
+ setClasspathEntry(entry);
+ }
+
+ @SuppressWarnings("deprecation")
+ public IClasspathEntry getClasspathEntry() {
+ return toClasspathEntry();
+ }
+
+ public IClasspathEntry toClasspathEntry() {
+ Map<String, String> attributes = new LinkedHashMap<String, String>(this.attributes);
+
+ if(artifactKey != null) {
+ attributes.put(BuildPathManager.GROUP_ID_ATTRIBUTE, artifactKey.getGroupId());
+ attributes.put(BuildPathManager.ARTIFACT_ID_ATTRIBUTE, artifactKey.getArtifactId());
+ attributes.put(BuildPathManager.VERSION_ATTRIBUTE, artifactKey.getVersion());
+ if(artifactKey.getClassifier() != null) {
+ attributes.put(BuildPathManager.CLASSIFIER_ATTRIBUTE, artifactKey.getClassifier());
+ }
+ }
+ if(scope != null) {
+ attributes.put(BuildPathManager.SCOPE_ATTRIBUTE, scope);
+ }
+
+ IClasspathAttribute[] attributesArray = new IClasspathAttribute[attributes.size()];
+ int attributeIndex = 0;
+ for(Map.Entry<String, String> attribute : attributes.entrySet()) {
+ attributesArray[attributeIndex++ ] = JavaCore.newClasspathAttribute(attribute.getKey(), attribute.getValue());
+ }
+
+ IAccessRule[] accessRulesArray = accessRules.toArray(new IAccessRule[accessRules.size()]);
+ IClasspathEntry entry;
+ switch(entryKind) {
+ case IClasspathEntry.CPE_CONTAINER:
+ entry = JavaCore.newContainerEntry(path, //
+ accessRulesArray, //
+ attributesArray, //
+ exported);
+ break;
+ case IClasspathEntry.CPE_LIBRARY:
+ entry = JavaCore.newLibraryEntry(path, //
+ sourceAttachmentPath, //
+ sourceAttachmentRootPath, //
+ accessRulesArray, //
+ attributesArray, //
+ exported);
+ break;
+ case IClasspathEntry.CPE_SOURCE:
+ entry = JavaCore.newSourceEntry(path, //
+ getInclusionPatterns(), //
+ getExclusionPatterns(), //
+ outputLocation, //
+ attributesArray);
+ break;
+ case IClasspathEntry.CPE_PROJECT:
+ entry = JavaCore.newProjectEntry(path, //
+ accessRulesArray, //
+ combineAccessRules, //
+ attributesArray, //
+ exported);
+ break;
+ default:
+ throw new IllegalArgumentException("Unsupported IClasspathEntry kind=" + entryKind); //$NON-NLS-1$
+ }
+ return entry;
+ }
+
+ public String getScope() {
+ return scope;
+ }
+
+ /**
+ * @return true if this entry corresponds to an optional maven dependency, false otherwise
+ */
+ public boolean isOptionalDependency() {
+ return optionalDependency;
+ }
+
+ @SuppressWarnings("deprecation")
+ public void addClasspathAttribute(IClasspathAttribute attribute) {
+ setClasspathAttribute(attribute.getName(), attribute.getValue());
+ }
+
+ public void setClasspathAttribute(String name, String value) {
+ if(name == null) {
+ throw new NullPointerException(); // fail fast
+ }
+ if(value != null) {
+ attributes.put(name, value);
+ } else {
+ attributes.remove(name);
+ }
+ }
+
+ public String getGroupId() {
+ return artifactKey != null ? artifactKey.getGroupId() : null;
+ }
+
+ @SuppressWarnings("deprecation")
+ public void setClasspathEntry(IClasspathEntry entry) {
+ this.entryKind = entry.getEntryKind();
+ this.path = entry.getPath();
+ this.exported = entry.isExported();
+ this.outputLocation = entry.getOutputLocation();
+
+ this.accessRules = new ArrayList<IAccessRule>();
+ for(IAccessRule rule : entry.getAccessRules()) {
+ this.accessRules.add(rule);
+ }
+
+ this.attributes = new LinkedHashMap<String, String>();
+ for(IClasspathAttribute attribute : entry.getExtraAttributes()) {
+ attributes.put(attribute.getName(), attribute.getValue());
+ }
+
+ this.sourceAttachmentPath = entry.getSourceAttachmentPath();
+ this.sourceAttachmentRootPath = entry.getSourceAttachmentRootPath();
+ setInclusionPatterns(entry.getInclusionPatterns());
+ setExclusionPatterns(entry.getExclusionPatterns());
+ this.combineAccessRules = entry.combineAccessRules();
+ }
+
+ public String getArtifactId() {
+ return artifactKey != null ? artifactKey.getArtifactId() : null;
+ }
+
+ public IPath getPath() {
+ return path;
+ }
+
+ public int getEntryKind() {
+ return entryKind;
+ }
+
+ public ArtifactKey getArtifactKey() {
+ return artifactKey;
+ }
+
+ public void setArtifactKey(ArtifactKey artifactKey) {
+ this.artifactKey = artifactKey;
+ }
+
+ public void setSourceAttachment(IPath srcPath, IPath srcRoot) {
+ this.sourceAttachmentPath = srcPath;
+ this.sourceAttachmentRootPath = srcRoot;
+ }
+
+ public void setJavadocUrl(String javaDocUrl) {
+ setClasspathAttribute(IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME, javaDocUrl);
+ }
+
+ public IPath getSourceAttachmentPath() {
+ return sourceAttachmentPath;
+ }
+
+ public IPath getSourceAttachmentRootPath() {
+ return sourceAttachmentRootPath;
+ }
+
+ public String getJavadocUrl() {
+ return attributes.get(IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME);
+ }
+
+ public void setScope(String scope) {
+ this.scope = scope;
+ }
+
+ public void setOptionalDependency(boolean optional) {
+ this.optionalDependency = optional;
+ }
+
+ public void addAccessRule(IAccessRule rule) {
+ this.accessRules.add(rule);
+ }
+
+ public void setOutputLocation(IPath outputLocation) {
+ this.outputLocation = outputLocation;
+ }
+
+ public void setInclusionPatterns(IPath[] inclusionPatterns) {
+ if (inclusionPatterns!=null) {
+ this.inclusionPatterns = new LinkedHashSet<IPath>(Arrays.asList(inclusionPatterns));
+ } else {
+ this.inclusionPatterns = null;
+ }
+ }
+
+ public void addInclusionPattern(IPath pattern) {
+ if (inclusionPatterns == null) {
+ inclusionPatterns = new LinkedHashSet<IPath>();
+ }
+ inclusionPatterns.add(pattern);
+ }
+
+ public IPath[] getInclusionPatterns() {
+ return inclusionPatterns != null? inclusionPatterns.toArray(new IPath[inclusionPatterns.size()]) : null;
+ }
+
+ public void setExclusionPatterns(IPath[] exclusionPatterns) {
+ if (exclusionPatterns!=null) {
+ this.exclusionPatterns = new LinkedHashSet<IPath>(Arrays.asList(exclusionPatterns));
+ } else {
+ this.exclusionPatterns = null;
+ }
+ }
+
+ public void addExclusionPattern(IPath pattern) {
+ if (exclusionPatterns == null) {
+ exclusionPatterns = new LinkedHashSet<IPath>();
+ }
+ exclusionPatterns.add(pattern);
+ }
+
+ public IPath[] getExclusionPatterns() {
+ return exclusionPatterns != null? exclusionPatterns.toArray(new IPath[exclusionPatterns.size()]) : null;
+ }
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java
new file mode 100644
index 00000000..9b9c6a71
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.IProjectConfigurationManager;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
+import org.eclipse.m2e.core.project.configurator.ILifecycleMapping;
+import org.eclipse.m2e.jdt.BuildPathManager;
+import org.eclipse.m2e.jdt.IClasspathDescriptor;
+import org.eclipse.m2e.jdt.IClasspathEntryDescriptor;
+import org.eclipse.m2e.jdt.IClasspathManagerDelegate;
+import org.eclipse.m2e.jdt.IJavaProjectConfigurator;
+
+
+/**
+ * DefaultClasspathManagerDelegate
+ *
+ * @author igor
+ */
+public class DefaultClasspathManagerDelegate implements IClasspathManagerDelegate {
+ private final IProjectConfigurationManager configurationManager;
+
+ private final MavenProjectManager projectManager;
+
+ public DefaultClasspathManagerDelegate() {
+ this.configurationManager = MavenPlugin.getDefault().getProjectConfigurationManager();
+ this.projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ }
+
+ public void populateClasspath(final IClasspathDescriptor classpath, IMavenProjectFacade projectFacade,
+ final int kind, final IProgressMonitor monitor) throws CoreException {
+
+ addClasspathEntries(classpath, projectFacade, kind, monitor);
+
+ for(IJavaProjectConfigurator configurator : getJavaProjectConfigurators(projectFacade, monitor)) {
+ configurator.configureClasspath(projectFacade, classpath, monitor);
+ }
+ }
+
+ private List<IJavaProjectConfigurator> getJavaProjectConfigurators(IMavenProjectFacade projectFacade,
+ final IProgressMonitor monitor) throws CoreException {
+
+ ArrayList<IJavaProjectConfigurator> configurators = new ArrayList<IJavaProjectConfigurator>();
+
+ ILifecycleMapping lifecycleMapping = configurationManager.getLifecycleMapping(projectFacade, monitor);
+
+ for(AbstractProjectConfigurator configurator : lifecycleMapping.getProjectConfigurators(projectFacade, monitor)) {
+ if(configurator instanceof IJavaProjectConfigurator) {
+ configurators.add((IJavaProjectConfigurator) configurator);
+ }
+ }
+
+ return configurators;
+ }
+
+ void addClasspathEntries(IClasspathDescriptor classpath, IMavenProjectFacade facade, int kind,
+ IProgressMonitor monitor) throws CoreException {
+ ArtifactFilter scopeFilter;
+
+ if(BuildPathManager.CLASSPATH_RUNTIME == kind) {
+ // ECLIPSE-33: runtime+provided scope
+ // ECLIPSE-85: adding system scope
+ scopeFilter = new ArtifactFilter() {
+ public boolean include(Artifact artifact) {
+ return BuildPathManager.SCOPE_FILTER_RUNTIME.include(artifact)
+ || Artifact.SCOPE_PROVIDED.equals(artifact.getScope())
+ || Artifact.SCOPE_SYSTEM.equals(artifact.getScope());
+ }
+ };
+ } else {
+ // ECLIPSE-33: test scope (already includes provided)
+ scopeFilter = BuildPathManager.SCOPE_FILTER_TEST;
+ }
+
+ MavenProject mavenProject = facade.getMavenProject(monitor);
+ Set<Artifact> artifacts = mavenProject.getArtifacts();
+ for(Artifact a : artifacts) {
+ if(!scopeFilter.include(a) || !a.getArtifactHandler().isAddedToClasspath()) {
+ continue;
+ }
+
+ // project
+ IMavenProjectFacade dependency = projectManager
+ .getMavenProject(a.getGroupId(), a.getArtifactId(), a.getVersion());
+ if(dependency != null && dependency.getProject().equals(facade.getProject())) {
+ continue;
+ }
+
+ IClasspathEntryDescriptor entry = null;
+
+ if(dependency != null && dependency.getFullPath(a.getFile()) != null) {
+ entry = classpath.addProjectEntry(dependency.getFullPath());
+ } else {
+ File artifactFile = a.getFile();
+ if(artifactFile != null /*&& artifactFile.canRead()*/) {
+ entry = classpath.addLibraryEntry(Path.fromOSString(artifactFile.getAbsolutePath()));
+ }
+ }
+
+ if(entry != null) {
+ entry.setArtifactKey(new ArtifactKey(a.getGroupId(), a.getArtifactId(), a.getBaseVersion(), a.getClassifier()));
+ entry.setScope(a.getScope());
+ entry.setOptionalDependency(a.isOptional());
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JDTCompilationParticipant.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JDTCompilationParticipant.java
new file mode 100644
index 00000000..f3114012
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JDTCompilationParticipant.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+import java.util.Date;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.compiler.BuildContext;
+import org.eclipse.jdt.core.compiler.CompilationParticipant;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.jdt.MavenJdtPlugin;
+
+
+public class JDTCompilationParticipant extends CompilationParticipant {
+
+ public static boolean DEBUG = MavenPlugin.getDefault().isDebugging()
+ & Boolean.parseBoolean(Platform.getDebugOption(MavenJdtPlugin.PLUGIN_ID + "/debug/compilationParticipant")); //$NON-NLS-1$
+
+ @Override
+ public synchronized void cleanStarting(IJavaProject project) {
+ if(DEBUG) {
+ System.out.println("\nRequested clean for " + project.getProject() //$NON-NLS-1$
+ + " @ " + new Date(System.currentTimeMillis())); //$NON-NLS-1$
+ }
+
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ IMavenConfiguration configuration = MavenPlugin.getDefault().getMavenConfiguration();
+ if (configuration.isDebugOutput()) {
+ MavenConsole console = plugin.getConsole();
+ console.logMessage("Maven compilation participant: clean starting");
+ }
+
+ super.cleanStarting(project);
+
+ try {
+ plugin.getMavenProjectManager().requestFullMavenBuild(project.getProject());
+ } catch(CoreException ex) {
+ MavenLogger.log("Exception requesting full Maven build", ex);
+ }
+ }
+
+ public void buildStarting(BuildContext[] files, boolean isBatch) {
+ }
+
+ // 3.4
+ public void buildFinished(IJavaProject project) {
+ }
+
+ public boolean isActive(IJavaProject project) {
+ return true;
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JarLifecycleMapping.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JarLifecycleMapping.java
new file mode 100644
index 00000000..0659161d
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JarLifecycleMapping.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+import org.eclipse.m2e.core.project.configurator.DefaultLifecycleMapping;
+
+/**
+ * @author igor
+ */
+public class JarLifecycleMapping extends DefaultLifecycleMapping {
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java
new file mode 100644
index 00000000..bed3b4da
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaElementsAdapterFactory.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.internal.ui.packageview.ClassPathContainer;
+import org.eclipse.jdt.internal.ui.packageview.ClassPathContainer.RequiredProjectWrapper;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.jdt.MavenJdtPlugin;
+
+
+/**
+ * Adapter factory for Java elements
+ *
+ * @author Igor Fedorenko
+ * @author Eugene Kuleshov
+ */
+@SuppressWarnings({"unchecked", "restriction"})
+public class JavaElementsAdapterFactory implements IAdapterFactory {
+
+ private static final Class[] ADAPTER_LIST = new Class[] {ArtifactKey.class, IPath.class, IMavenProjectFacade.class};
+
+ public Class[] getAdapterList() {
+ return ADAPTER_LIST;
+ }
+
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if(adapterType == ArtifactKey.class) {
+ if(adaptableObject instanceof IPackageFragmentRoot) {
+ IPackageFragmentRoot fragment = (IPackageFragmentRoot) adaptableObject;
+ IProject project = fragment.getJavaProject().getProject();
+ if(project.isAccessible() && fragment.isArchive()) {
+ try {
+ return MavenJdtPlugin.getDefault().getBuildpathManager().findArtifact(project, fragment.getPath());
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ MavenPlugin.getDefault().getConsole().logError("Can't find artifact for " + fragment);
+ return null;
+ }
+ }
+
+ } else if(adaptableObject instanceof RequiredProjectWrapper) {
+ IMavenProjectFacade projectFacade = getProjectFacade(adaptableObject);
+ if(projectFacade!=null) {
+ return projectFacade.getArtifactKey();
+ }
+
+ } else if(adaptableObject instanceof IJavaProject) {
+ return ((IJavaProject) adaptableObject).getProject().getAdapter(ArtifactKey.class);
+
+ }
+
+ } else if(adapterType == IPath.class) {
+ if(adaptableObject instanceof IJavaElement) {
+ IResource resource = ((IJavaElement) adaptableObject).getResource();
+ if(resource != null) {
+ return resource.getLocation();
+ }
+ }
+
+ } else if(adapterType == IMavenProjectFacade.class) {
+ if(adaptableObject instanceof IJavaElement) {
+ IProject project = ((IJavaElement) adaptableObject).getJavaProject().getProject();
+ IMavenProjectFacade projectFacade = getProjectFacade(project);
+ if(projectFacade != null) {
+ return projectFacade;
+ }
+
+ } else if(adaptableObject instanceof RequiredProjectWrapper) {
+ ClassPathContainer container = ((RequiredProjectWrapper) adaptableObject).getParentClassPathContainer();
+ IProject project = container.getJavaProject().getProject();
+ IMavenProjectFacade projectFacade = getProjectFacade(project);
+ if(projectFacade != null) {
+ return projectFacade;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private IMavenProjectFacade getProjectFacade(Object adaptableObject) {
+ RequiredProjectWrapper wrapper = (RequiredProjectWrapper) adaptableObject;
+ return getProjectFacade(wrapper.getProject().getProject());
+ }
+
+ private IMavenProjectFacade getProjectFacade(IProject project) {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ return projectManager.create(project, new NullProgressMonitor());
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaProjectConfigurator.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaProjectConfigurator.java
new file mode 100644
index 00000000..81d0633f
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/JavaProjectConfigurator.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+/**
+ * DefaultJavaConfigurator
+ *
+ * @author igor
+ */
+public class JavaProjectConfigurator extends AbstractJavaProjectConfigurator {
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainer.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainer.java
new file mode 100644
index 00000000..62ceedfe
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainer.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+import java.io.Serializable;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+
+/**
+ * Maven classpath container
+ */
+public class MavenClasspathContainer implements IClasspathContainer, Serializable {
+ private static final long serialVersionUID = -5976726121300869771L;
+
+ private final IClasspathEntry[] entries;
+ private final IPath path;
+
+ public MavenClasspathContainer(IPath path, IClasspathEntry[] entries) {
+ this.path = path;
+ this.entries = entries;
+ }
+
+ public String getDescription() {
+ return Messages.MavenClasspathContainer_description;
+ }
+
+ public int getKind() {
+ return IClasspathContainer.K_APPLICATION;
+ }
+
+ public synchronized IClasspathEntry[] getClasspathEntries() {
+ return entries;
+ }
+
+ public IPath getPath() {
+ return path;
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java
new file mode 100644
index 00000000..b6ae8fe3
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerInitializer.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.ClasspathContainerInitializer;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.MavenUpdateRequest;
+import org.eclipse.m2e.jdt.BuildPathManager;
+import org.eclipse.m2e.jdt.MavenJdtPlugin;
+
+
+/**
+ * MavenClasspathContainerInitializer
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenClasspathContainerInitializer extends ClasspathContainerInitializer {
+
+ public void initialize(IPath containerPath, IJavaProject project) {
+ if(BuildPathManager.isMaven2ClasspathContainer(containerPath)) {
+ try {
+ IClasspathContainer mavenContainer = getBuildPathManager().getSavedContainer(project.getProject());
+ if(mavenContainer != null) {
+ JavaCore.setClasspathContainer(containerPath, new IJavaProject[] {project},
+ new IClasspathContainer[] {mavenContainer}, new NullProgressMonitor());
+ return;
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log("Exception initializing classpath container " + containerPath.toString(), ex);
+ }
+
+ // force refresh if can't read persisted state
+ IMavenConfiguration configuration = MavenPlugin.getDefault().getMavenConfiguration();
+ MavenUpdateRequest request = new MavenUpdateRequest(project.getProject(), configuration.isOffline(), false);
+ getMavenProjectManager().refresh(request);
+ }
+ }
+
+ public boolean canUpdateClasspathContainer(IPath containerPath, IJavaProject project) {
+ return true;
+ }
+
+ public void requestClasspathContainerUpdate(IPath containerPath, final IJavaProject project,
+ final IClasspathContainer containerSuggestion) {
+ // one job per request. assumption that users are not going to change hundreds of containers simultaneously.
+ new Job(Messages.MavenClasspathContainerInitializer_job_name) {
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ getBuildPathManager().persistAttachedSourcesAndJavadoc(project, containerSuggestion, monitor);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ return new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, 0, Messages.MavenClasspathContainerInitializer_error_cannot_persist, ex);
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+
+ BuildPathManager getBuildPathManager() {
+ return MavenJdtPlugin.getDefault().getBuildpathManager();
+ }
+
+ MavenProjectManager getMavenProjectManager() {
+ return MavenPlugin.getDefault().getMavenProjectManager();
+ }
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerSaveHelper.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerSaveHelper.java
new file mode 100644
index 00000000..c82fb60a
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathContainerSaveHelper.java
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.io.Serializable;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IAccessRule;
+import org.eclipse.jdt.core.IClasspathAttribute;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.JavaCore;
+
+
+/**
+ * BuildPath save helper
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenClasspathContainerSaveHelper {
+
+ public IClasspathContainer readContainer(InputStream input) throws IOException, ClassNotFoundException {
+ ObjectInputStream is = new ObjectInputStream(new BufferedInputStream(input)) {
+ {
+ enableResolveObject(true);
+ }
+ protected Object resolveObject(Object o) throws IOException {
+ if(o instanceof ProjectEntryReplace) {
+ return ((ProjectEntryReplace) o).getEntry();
+ } else if(o instanceof LibraryEntryReplace) {
+ return ((LibraryEntryReplace) o).getEntry();
+ } else if(o instanceof ClasspathAttributeReplace) {
+ return ((ClasspathAttributeReplace) o).getAttribute();
+ } else if(o instanceof AccessRuleReplace) {
+ return ((AccessRuleReplace) o).getAccessRule();
+ } else if(o instanceof PathReplace) {
+ return ((PathReplace) o).getPath();
+ }
+ return super.resolveObject(o);
+ }
+ };
+ return (IClasspathContainer) is.readObject();
+ }
+
+ public void writeContainer(IClasspathContainer container, OutputStream output) throws IOException {
+ ObjectOutputStream os = new ObjectOutputStream(new BufferedOutputStream(output)) {
+ {
+ enableReplaceObject(true);
+ }
+
+ protected Object replaceObject(Object o) throws IOException {
+ if(o instanceof IClasspathEntry) {
+ IClasspathEntry e = (IClasspathEntry) o;
+ if(e.getEntryKind()==IClasspathEntry.CPE_PROJECT) {
+ return new ProjectEntryReplace(e);
+ } else if(e.getEntryKind()==IClasspathEntry.CPE_LIBRARY) {
+ return new LibraryEntryReplace(e);
+ }
+ } else if(o instanceof IClasspathAttribute) {
+ return new ClasspathAttributeReplace((IClasspathAttribute) o);
+ } else if(o instanceof IAccessRule) {
+ return new AccessRuleReplace((IAccessRule) o);
+ } else if(o instanceof IPath) {
+ return new PathReplace((IPath) o);
+ }
+ return super.replaceObject(o);
+ }
+ };
+ os.writeObject(container);
+ os.flush();
+ }
+
+ /**
+ * A library IClasspathEntry replacement used for object serialization
+ */
+ static final class LibraryEntryReplace implements Serializable {
+ private static final long serialVersionUID = 3901667379326978799L;
+
+ private final IPath path;
+ private final IPath sourceAttachmentPath;
+ private final IPath sourceAttachmentRootPath;
+ private final IClasspathAttribute[] extraAttributes;
+ private final boolean exported;
+ private final IAccessRule[] accessRules;
+
+ LibraryEntryReplace(IClasspathEntry entry) {
+ this.path = entry.getPath();
+ this.sourceAttachmentPath = entry.getSourceAttachmentPath();
+ this.sourceAttachmentRootPath = entry.getSourceAttachmentRootPath();
+ this.accessRules = entry.getAccessRules();
+ this.extraAttributes = entry.getExtraAttributes();
+ this.exported = entry.isExported();
+ }
+
+ IClasspathEntry getEntry() {
+ return JavaCore.newLibraryEntry(path, sourceAttachmentPath, sourceAttachmentRootPath, //
+ accessRules, extraAttributes, exported);
+ }
+ }
+
+ /**
+ * A project IClasspathEntry replacement used for object serialization
+ */
+ static final class ProjectEntryReplace implements Serializable {
+ private static final long serialVersionUID = -2397483865904288762L;
+
+ private final IPath path;
+ private final IClasspathAttribute[] extraAttributes;
+ private final IAccessRule[] accessRules;
+ private final boolean exported;
+ private final boolean combineAccessRules;
+
+ ProjectEntryReplace(IClasspathEntry entry) {
+ this.path = entry.getPath();
+ this.accessRules = entry.getAccessRules();
+ this.extraAttributes = entry.getExtraAttributes();
+ this.exported = entry.isExported();
+ this.combineAccessRules = entry.combineAccessRules();
+ }
+
+ IClasspathEntry getEntry() {
+ return JavaCore.newProjectEntry(path, accessRules, //
+ combineAccessRules, extraAttributes, exported);
+ }
+ }
+
+ /**
+ * An IClasspathAttribute replacement used for object serialization
+ */
+ static final class ClasspathAttributeReplace implements Serializable {
+ private static final long serialVersionUID = 6370039352012628029L;
+
+ private final String name;
+ private final String value;
+
+ ClasspathAttributeReplace(IClasspathAttribute attribute) {
+ this.name = attribute.getName();
+ this.value = attribute.getValue();
+ }
+
+ IClasspathAttribute getAttribute() {
+ return JavaCore.newClasspathAttribute(name, value);
+ }
+ }
+
+ /**
+ * An IAccessRule replacement used for object serialization
+ */
+ static final class AccessRuleReplace implements Serializable {
+ private static final long serialVersionUID = 7315582893941374715L;
+
+ private final IPath pattern;
+ private final int kind;
+
+ AccessRuleReplace(IAccessRule accessRule) {
+ pattern = accessRule.getPattern();
+ kind = accessRule.getKind();
+ }
+
+ IAccessRule getAccessRule() {
+ return JavaCore.newAccessRule(pattern, kind);
+ }
+ }
+
+ /**
+ * An IPath replacement used for object serialization
+ */
+ static final class PathReplace implements Serializable {
+ private static final long serialVersionUID = -2361259525684491181L;
+
+ private final String path;
+
+ PathReplace(IPath path) {
+ this.path = path.toPortableString();
+ }
+
+ IPath getPath() {
+ return Path.fromPortableString(path);
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathVariableInitializer.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathVariableInitializer.java
new file mode 100644
index 00000000..fe976056
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenClasspathVariableInitializer.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+
+import org.eclipse.jdt.core.ClasspathVariableInitializer;
+
+import org.eclipse.m2e.jdt.MavenJdtPlugin;
+
+/**
+ * Maven classpath variable initializer is used to handle M2_REPO variable.
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenClasspathVariableInitializer extends ClasspathVariableInitializer {
+
+ public MavenClasspathVariableInitializer() {
+ }
+
+ public void initialize(String variable) {
+ MavenJdtPlugin.getDefault().getBuildpathManager().setupVariables();
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenJdtImages.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenJdtImages.java
new file mode 100644
index 00000000..fb741584
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/MavenJdtImages.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.jdt.MavenJdtPlugin;
+
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class MavenJdtImages {
+
+ // object images
+
+ // public static final Image IMG_CLEAR = createImage("clear.gif");
+
+ // descriptors
+
+ public static final ImageDescriptor JAVA_DOC = create("javadoc.gif"); //$NON-NLS-1$
+
+
+ private static ImageDescriptor create(String key) {
+ try {
+ ImageRegistry imageRegistry = getImageRegistry();
+ if(imageRegistry != null) {
+ ImageDescriptor imageDescriptor = imageRegistry.getDescriptor(key);
+ if(imageDescriptor==null) {
+ imageDescriptor = createDescriptor(key);
+ imageRegistry.put(key, imageDescriptor);
+ }
+ return imageDescriptor;
+ }
+ } catch(Exception ex) {
+ MavenLogger.log(key, ex);
+ }
+ return null;
+ }
+
+// private static Image createImage(String key) {
+// create(key);
+// ImageRegistry imageRegistry = getImageRegistry();
+// return imageRegistry == null ? null : imageRegistry.get(key);
+// }
+
+ private static ImageRegistry getImageRegistry() {
+ MavenJdtPlugin plugin = MavenJdtPlugin.getDefault();
+ return plugin == null ? null : plugin.getImageRegistry();
+ }
+
+ private static ImageDescriptor createDescriptor(String image) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(IMavenConstants.PLUGIN_ID, "icons/" + image); //$NON-NLS-1$
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/Messages.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/Messages.java
new file mode 100644
index 00000000..8a2d3e2f
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/Messages.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+
+/**
+ * Messages
+ *
+ * @author mkleint
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.m2e.jdt.internal.messages"; //$NON-NLS-1$
+
+ public static String AbstractJavaProjectConfigurator_task_name;
+
+ public static String BuildPathManager_monitor_setting_cp;
+
+ public static String DownloadSourcesJob_job_download;
+
+ public static String GenericJavaProjectConfigurator_subtask;
+
+ public static String GenericJavaProjectConfigurator_subtask_refreshing;
+
+ public static String MavenClasspathContainer_description;
+
+ public static String MavenClasspathContainerInitializer_error_cannot_persist;
+
+ public static String MavenClasspathContainerInitializer_job_name;
+
+ public static String MavenClasspathContainerPage_control_desc;
+
+ public static String MavenClasspathContainerPage_control_title;
+
+ public static String MavenClasspathContainerPage_link;
+
+ public static String MavenClasspathContainerPage_title;
+
+ public static String MavenDependencyResolver_additional_info;
+
+ public static String MavenDependencyResolver_error_message;
+
+ public static String MavenDependencyResolver_error_message2;
+
+ public static String MavenDependencyResolver_error_message3;
+
+ public static String MavenDependencyResolver_error_message4;
+
+ public static String MavenDependencyResolver_error_message5;
+
+ public static String MavenDependencyResolver_error_message6;
+
+ public static String MavenDependencyResolver_error_message7;
+
+ public static String MavenDependencyResolver_error_title;
+
+ public static String MavenDependencyResolver_proposal_search;
+
+ public static String MavenDependencyResolver_searchDialog_title;
+
+ public static String MavenJdtMenuCreator_action_downloadJavadoc;
+
+ public static String MavenJdtMenuCreator_action_downloadSources;
+
+ public static String MavenJdtMenuCreator_action_javadoc;
+
+ public static String MavenJdtMenuCreator_action_materialize1;
+
+ public static String MavenJdtMenuCreator_action_materializeMany;
+
+ public static String MavenJdtMenuCreator_action_open_issue;
+
+ public static String MavenJdtMenuCreator_action_openCI;
+
+ public static String MavenJdtMenuCreator_action_openJavadoc;
+
+ public static String MavenJdtMenuCreator_action_openPom;
+
+ public static String MavenJdtMenuCreator_action_openProject;
+
+ public static String MavenJdtMenuCreator_action_sources;
+
+ public static String MavenJdtMenuCreator_axtion_openScm;
+
+ public static String MavenJdtPlugin_job_name;
+
+ public static String MavenQueryParticipant_job_name;
+
+ public static String MavenQueryParticipant_searchDialog_title;
+
+ public static String MavenRuntimeClasspathProvider_error_unsupported;
+ public static String OpenJavaDocAction_error_download;
+
+ public static String OpenJavaDocAction_error_message;
+
+ public static String OpenJavaDocAction_error_title;
+
+ public static String OpenJavaDocAction_info_title;
+
+ public static String OpenJavaDocAction_job_open_javadoc;
+
+ public static String OpenJavaDocAction_message1;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/DownloadSourcesAction.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/DownloadSourcesAction.java
new file mode 100644
index 00000000..e3316183
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/DownloadSourcesAction.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal.actions;
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkingSet;
+
+import org.eclipse.m2e.jdt.BuildPathManager;
+import org.eclipse.m2e.jdt.MavenJdtPlugin;
+
+
+
+public class DownloadSourcesAction implements IObjectActionDelegate {
+
+ public static final String ID_SOURCES = "org.eclipse.m2e.downloadSourcesAction"; //$NON-NLS-1$
+
+ public static final String ID_JAVADOC = "org.eclipse.m2e.downloadJavaDocAction"; //$NON-NLS-1$
+
+ private IStructuredSelection selection;
+
+ private String id;
+
+ public DownloadSourcesAction(String id) {
+ this.id = id;
+ }
+
+ public void run(IAction action) {
+ if(selection != null) {
+ BuildPathManager buildpathManager = MavenJdtPlugin.getDefault().getBuildpathManager();
+ for(Iterator<?> it = selection.iterator(); it.hasNext();) {
+ Object element = it.next();
+ if(element instanceof IProject) {
+ IProject project = (IProject) element;
+ buildpathManager.scheduleDownload(project, ID_SOURCES.equals(id), !ID_SOURCES.equals(id));
+ } else if(element instanceof IPackageFragmentRoot) {
+ IPackageFragmentRoot fragment = (IPackageFragmentRoot) element;
+ buildpathManager.scheduleDownload(fragment, ID_SOURCES.equals(id), !ID_SOURCES.equals(id));
+ } else if(element instanceof IWorkingSet) {
+ IWorkingSet workingSet = (IWorkingSet) element;
+ for(IAdaptable adaptable : workingSet.getElements()) {
+ IProject project = (IProject) adaptable.getAdapter(IProject.class);
+ buildpathManager.scheduleDownload(project, ID_SOURCES.equals(id), !ID_SOURCES.equals(id));
+ }
+ }
+ }
+ }
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
+ } else {
+ this.selection = null;
+ }
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java
new file mode 100644
index 00000000..43877de7
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/actions/OpenJavaDocAction.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal.actions;
+
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionDelegate;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.jdt.internal.Messages;
+
+/**
+ * Open JavaDoc action
+ *
+ * @author Eugene Kuleshov
+ */
+public class OpenJavaDocAction extends ActionDelegate {
+
+ public static final String ID = "org.eclipse.m2e.openJavaDocAction"; //$NON-NLS-1$
+
+ private IStructuredSelection selection;
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
+ } else {
+ this.selection = null;
+ }
+ }
+
+ public void run(IAction action) {
+ if(selection != null) {
+ try {
+ final ArtifactKey ak = SelectionUtil.getArtifactKey(this.selection.getFirstElement());
+ if(ak == null) {
+ openDialog(Messages.OpenJavaDocAction_message1);
+ return;
+ }
+
+ new Job(NLS.bind(Messages.OpenJavaDocAction_job_open_javadoc,ak)) {
+ protected IStatus run(IProgressMonitor monitor) {
+ openJavaDoc(ak.getGroupId(), ak.getArtifactId(), ak.getVersion(), monitor);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(), //
+ Messages.OpenJavaDocAction_error_title, Messages.OpenJavaDocAction_error_message);
+ }
+ });
+ }
+ }
+ }
+
+ protected void openJavaDoc(String groupId, String artifactId, String version, IProgressMonitor monitor) {
+ final String name = groupId + ":" + artifactId + ":" + version + ":javadoc"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ try {
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+
+ List<ArtifactRepository> artifactRepositories = maven.getArtifactRepositories();
+
+ Artifact artifact = maven.resolve(groupId, artifactId, version, "javadoc", "javadoc", artifactRepositories, monitor); //$NON-NLS-1$ //$NON-NLS-2$
+
+ final File file = artifact.getFile();
+ if(file == null) {
+ openDialog(NLS.bind(Messages.OpenJavaDocAction_error_download, name));
+ return;
+ }
+
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ String url = "jar:" + file.toURI().toString() + "!/index.html"; //$NON-NLS-1$ //$NON-NLS-2$
+ URL helpUrl = PlatformUI.getWorkbench().getHelpSystem().resolve(url, true);
+
+ IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
+ IWebBrowser browser = browserSupport.createBrowser(IWorkbenchBrowserSupport.NAVIGATION_BAR, //
+ name, name, name);
+ browser.openURL(helpUrl);
+ } catch(PartInitException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ });
+
+ } catch(CoreException ex) {
+ MavenLogger.log("Can't download JavaDoc for " + name, ex);
+ openDialog(NLS.bind(Messages.OpenJavaDocAction_error_download,name));
+ // TODO search index and offer to select other version
+ }
+
+ }
+
+ private static void openDialog(final String msg) {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(), //
+ Messages.OpenJavaDocAction_info_title, msg);
+ }
+ });
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenLaunchConfigurationListener.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenLaunchConfigurationListener.java
new file mode 100644
index 00000000..71690b46
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenLaunchConfigurationListener.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal.launch;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationListener;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.launching.JavaRuntime;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
+import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
+
+public class MavenLaunchConfigurationListener implements ILaunchConfigurationListener, IMavenProjectChangedListener {
+
+ public void launchConfigurationAdded(ILaunchConfiguration configuration) {
+ updateLaunchConfiguration(configuration);
+ }
+
+ public void launchConfigurationChanged(ILaunchConfiguration configuration) {
+ updateLaunchConfiguration(configuration);
+ }
+
+ public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
+ // do nothing
+ }
+
+ private void updateLaunchConfiguration(ILaunchConfiguration configuration) {
+ try {
+ if (!MavenRuntimeClasspathProvider.isSupportedType(configuration.getType().getIdentifier())) {
+ return;
+ }
+ if (configuration.getAttributes().containsKey(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER)) {
+ return;
+ }
+ IJavaProject javaProject = JavaRuntime.getJavaProject(configuration);
+ if (javaProject != null && javaProject.getProject().hasNature(IMavenConstants.NATURE_ID)) {
+ MavenRuntimeClasspathProvider.enable(configuration);
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+
+ public void mavenProjectChanged(MavenProjectChangedEvent[] events, IProgressMonitor monitor) {
+ for (MavenProjectChangedEvent event : events) {
+ try {
+ switch (event.getKind()) {
+ case MavenProjectChangedEvent.KIND_ADDED:
+ MavenRuntimeClasspathProvider.enable(event.getMavenProject().getProject());
+ break;
+ case MavenProjectChangedEvent.KIND_REMOVED:
+ MavenRuntimeClasspathProvider.disable(event.getOldMavenProject().getProject());
+ break;
+ default:
+ break;
+ }
+ } catch (Exception e) {
+ MavenLogger.log("Could not update launch configuration", e);
+ }
+ }
+ }
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenRuntimeClasspathProvider.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenRuntimeClasspathProvider.java
new file mode 100644
index 00000000..b65adf58
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenRuntimeClasspathProvider.java
@@ -0,0 +1,359 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal.launch;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jdt.core.IClasspathAttribute;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jdt.launching.StandardClasspathProvider;
+import org.eclipse.osgi.util.NLS;
+
+import org.apache.maven.model.Build;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+import org.eclipse.m2e.jdt.BuildPathManager;
+import org.eclipse.m2e.jdt.MavenJdtPlugin;
+import org.eclipse.m2e.jdt.internal.Messages;
+
+
+public class MavenRuntimeClasspathProvider extends StandardClasspathProvider {
+
+ public static final String MAVEN_SOURCEPATH_PROVIDER = "org.eclipse.m2e.launchconfig.sourcepathProvider"; //$NON-NLS-1$
+
+ public static final String MAVEN_CLASSPATH_PROVIDER = "org.eclipse.m2e.launchconfig.classpathProvider"; //$NON-NLS-1$
+
+ private static final String TESTS_PROJECT_CLASSIFIER = "tests"; //$NON-NLS-1$
+
+ private static final String THIS_PROJECT_CLASSIFIER = ""; //$NON-NLS-1$
+
+ public static final String JDT_JUNIT_TEST = "org.eclipse.jdt.junit.launchconfig"; //$NON-NLS-1$
+
+ public static final String JDT_JAVA_APPLICATION = "org.eclipse.jdt.launching.localJavaApplication"; //$NON-NLS-1$
+
+ public static final String JDT_TESTNG_TEST = "org.testng.eclipse.launchconfig"; //$NON-NLS-1$
+
+ private static final Set<String> supportedTypes = new HashSet<String>();
+ static {
+ // not exactly nice, but works with eclipse 3.2, 3.3 and 3.4M3
+ supportedTypes.add(MavenRuntimeClasspathProvider.JDT_JAVA_APPLICATION);
+ supportedTypes.add(MavenRuntimeClasspathProvider.JDT_JUNIT_TEST);
+ supportedTypes.add(MavenRuntimeClasspathProvider.JDT_TESTNG_TEST);
+ }
+
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+
+ public IRuntimeClasspathEntry[] computeUnresolvedClasspath(final ILaunchConfiguration configuration) throws CoreException {
+ boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true);
+ if (useDefault) {
+ IJavaProject javaProject = JavaRuntime.getJavaProject(configuration);
+ IRuntimeClasspathEntry jreEntry = JavaRuntime.computeJREEntry(configuration);
+ IRuntimeClasspathEntry projectEntry = JavaRuntime.newProjectRuntimeClasspathEntry(javaProject);
+ IRuntimeClasspathEntry mavenEntry = JavaRuntime.newRuntimeContainerClasspathEntry(new Path(BuildPathManager.CONTAINER_ID), IRuntimeClasspathEntry.USER_CLASSES);
+
+ if(jreEntry == null) {
+ return new IRuntimeClasspathEntry[] {projectEntry, mavenEntry};
+ }
+
+ return new IRuntimeClasspathEntry[] {jreEntry, projectEntry, mavenEntry};
+ }
+
+ return recoverRuntimePath(configuration, IJavaLaunchConfigurationConstants.ATTR_CLASSPATH);
+ }
+
+ public IRuntimeClasspathEntry[] resolveClasspath(IRuntimeClasspathEntry[] entries, ILaunchConfiguration configuration)
+ throws CoreException {
+ IProgressMonitor monitor = new NullProgressMonitor(); // XXX
+ int scope = getArtifactScope(configuration);
+ Set<IRuntimeClasspathEntry> all = new LinkedHashSet<IRuntimeClasspathEntry>(entries.length);
+ for(IRuntimeClasspathEntry entry : entries) {
+ if (entry.getType() == IRuntimeClasspathEntry.CONTAINER && BuildPathManager.isMaven2ClasspathContainer(entry.getPath())) {
+ addMavenClasspathEntries(all, entry, configuration, scope, monitor);
+ } else if (entry.getType() == IRuntimeClasspathEntry.PROJECT) {
+ IJavaProject javaProject = JavaRuntime.getJavaProject(configuration);
+ if (javaProject.getPath().equals(entry.getPath())) {
+ addProjectEntries(all, entry.getPath(), scope, THIS_PROJECT_CLASSIFIER, configuration, monitor);
+ } else {
+ addStandardClasspathEntries(all, entry, configuration);
+ }
+ } else {
+ addStandardClasspathEntries(all, entry, configuration);
+ }
+ }
+ return all.toArray(new IRuntimeClasspathEntry[all.size()]);
+ }
+
+ private void addStandardClasspathEntries(Set<IRuntimeClasspathEntry> all, IRuntimeClasspathEntry entry, ILaunchConfiguration configuration)
+ throws CoreException
+ {
+ IRuntimeClasspathEntry[] resolved = JavaRuntime.resolveRuntimeClasspathEntry(entry, configuration);
+ for (int j = 0; j < resolved.length; j++) {
+ all.add(resolved[j]);
+ }
+ }
+
+ private void addMavenClasspathEntries(Set<IRuntimeClasspathEntry> resolved, IRuntimeClasspathEntry runtimeClasspathEntry,
+ ILaunchConfiguration configuration, int scope, IProgressMonitor monitor) throws CoreException
+ {
+ IJavaProject javaProject = JavaRuntime.getJavaProject(configuration);
+ MavenJdtPlugin plugin = MavenJdtPlugin.getDefault();
+ BuildPathManager buildpathManager = plugin.getBuildpathManager();
+ IClasspathEntry[] cp = buildpathManager.getClasspath(javaProject.getProject(), scope, false, new NullProgressMonitor());
+ for(IClasspathEntry entry : cp) {
+ switch (entry.getEntryKind()) {
+ case IClasspathEntry.CPE_PROJECT:
+ addProjectEntries(resolved, entry.getPath(), scope, getArtifactClassifier(entry), configuration, monitor);
+ break;
+ case IClasspathEntry.CPE_LIBRARY:
+ resolved.add(JavaRuntime.newArchiveRuntimeClasspathEntry(entry.getPath()));
+ break;
+// case IClasspathEntry.CPE_SOURCE:
+// resolved.add(newSourceClasspathEntry(javaProject, cp[i]));
+// break;
+ }
+ }
+ }
+
+ protected int getArtifactScope(ILaunchConfiguration configuration) throws CoreException {
+ String typeid = configuration.getType().getAttribute("id"); //$NON-NLS-1$
+ if (JDT_JAVA_APPLICATION.equals(typeid)) {
+ IResource[] resources = configuration.getMappedResources();
+
+ // MNGECLIPSE-530: NPE starting openarchitecture workflow
+ if (resources == null || resources.length == 0) {
+ return BuildPathManager.CLASSPATH_RUNTIME;
+ }
+
+ // ECLIPSE-33: applications from test sources should use test scope
+ final Set<IPath> testSources = new HashSet<IPath>();
+ IJavaProject javaProject = JavaRuntime.getJavaProject(configuration);
+ IMavenProjectFacade facade = projectManager.create(javaProject.getProject(), new NullProgressMonitor());
+ if (facade == null) {
+ return BuildPathManager.CLASSPATH_RUNTIME;
+ }
+
+ testSources.addAll(Arrays.asList(facade.getTestCompileSourceLocations()));
+
+ for (int i = 0; i < resources.length; i++) {
+ for (IPath testPath : testSources) {
+ if (testPath.isPrefixOf(resources[i].getProjectRelativePath())) {
+ return BuildPathManager.CLASSPATH_TEST;
+ }
+ }
+ }
+ return BuildPathManager.CLASSPATH_RUNTIME;
+ } else if(JDT_JUNIT_TEST.equals(typeid) || JDT_TESTNG_TEST.equals(typeid)) {
+ return BuildPathManager.CLASSPATH_TEST;
+ } else {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, 0,
+ NLS.bind(Messages.MavenRuntimeClasspathProvider_error_unsupported, typeid), null));
+ }
+ }
+
+ protected void addProjectEntries(Set<IRuntimeClasspathEntry> resolved, IPath path, int scope, String classifier, ILaunchConfiguration launchConfiguration, final IProgressMonitor monitor) throws CoreException {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IProject project = root.getProject(path.segment(0));
+
+ IMavenProjectFacade projectFacade = projectManager.create(project, monitor);
+ if(projectFacade == null) {
+ return;
+ }
+
+ ResolverConfiguration configuration = projectFacade.getResolverConfiguration();
+ if (configuration == null) {
+ return;
+ }
+
+ final Set<IPath> allClasses = new LinkedHashSet<IPath>();
+ final Set<IPath> allTestClasses = new LinkedHashSet<IPath>();
+
+ Build build = projectFacade.getMavenProject(monitor).getBuild();
+ allClasses.add(projectFacade.getProjectRelativePath(build.getOutputDirectory()));
+ allTestClasses.add(projectFacade.getProjectRelativePath(build.getTestOutputDirectory()));
+
+ IJavaProject javaProject = JavaCore.create(project);
+
+ boolean projectResolved = false;
+ for(IClasspathEntry entry : javaProject.getRawClasspath()) {
+ IRuntimeClasspathEntry rce = null;
+ switch (entry.getEntryKind()) {
+ case IClasspathEntry.CPE_SOURCE:
+ if (!projectResolved) {
+ if (BuildPathManager.CLASSPATH_TEST == scope && isTestClassifier(classifier)) {
+ // ECLIPSE-19: test classes come infront on the rest
+ addFolders(resolved, project, allTestClasses);
+ }
+ if (isMainClassifier(classifier)) {
+ addFolders(resolved, project, allClasses);
+ }
+ projectResolved = true;
+ }
+ break;
+ case IClasspathEntry.CPE_CONTAINER:
+ IClasspathContainer container = JavaCore.getClasspathContainer(entry.getPath(), javaProject);
+ if (container != null && !BuildPathManager.isMaven2ClasspathContainer(entry.getPath())) {
+ switch (container.getKind()) {
+ case IClasspathContainer.K_APPLICATION:
+ rce = JavaRuntime.newRuntimeContainerClasspathEntry(container.getPath(), IRuntimeClasspathEntry.USER_CLASSES, javaProject);
+ break;
+// case IClasspathContainer.K_DEFAULT_SYSTEM:
+// unresolved.add(JavaRuntime.newRuntimeContainerClasspathEntry(container.getPath(), IRuntimeClasspathEntry.STANDARD_CLASSES, javaProject));
+// break;
+// case IClasspathContainer.K_SYSTEM:
+// unresolved.add(JavaRuntime.newRuntimeContainerClasspathEntry(container.getPath(), IRuntimeClasspathEntry.BOOTSTRAP_CLASSES, javaProject));
+// break;
+ }
+ }
+ break;
+ case IClasspathEntry.CPE_LIBRARY:
+ rce = JavaRuntime.newArchiveRuntimeClasspathEntry(entry.getPath());
+ break;
+ case IClasspathEntry.CPE_VARIABLE:
+ if (!JavaRuntime.JRELIB_VARIABLE.equals(entry.getPath().segment(0))) {
+ rce = JavaRuntime.newVariableRuntimeClasspathEntry(entry.getPath());
+ }
+ break;
+ case IClasspathEntry.CPE_PROJECT:
+ IProject res = root.getProject(entry.getPath().segment(0));
+ if (res != null) {
+ IJavaProject otherProject = JavaCore.create(res);
+ if (otherProject != null) {
+ rce = JavaRuntime.newDefaultProjectClasspathEntry(otherProject);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ if (rce != null) {
+ addStandardClasspathEntries(resolved, rce, launchConfiguration);
+ }
+ }
+ }
+
+ private boolean isMainClassifier(String classifier) {
+ return THIS_PROJECT_CLASSIFIER.equals(classifier) // main project
+ || classifier == null; // default classifier
+ }
+
+ private boolean isTestClassifier(String classifier) {
+ return THIS_PROJECT_CLASSIFIER.equals(classifier) // main project
+ || TESTS_PROJECT_CLASSIFIER.equals(classifier) // tests classifier
+ || classifier != null; // unknown classifier
+ }
+
+ private void addFolders(Set<IRuntimeClasspathEntry> resolved, IProject project, Set<IPath> folders) {
+ for(IPath folder : folders) {
+ IResource member = project.findMember(folder); // only returns existing members
+ if(member instanceof IFolder) { // must exist and be a folder
+ resolved.add(JavaRuntime.newArchiveRuntimeClasspathEntry(member.getFullPath()));
+ }
+ }
+ }
+
+ public static boolean isSupportedType(String id) {
+ return supportedTypes.contains(id);
+ }
+
+ public static void enable(ILaunchConfiguration config) throws CoreException {
+ if (config instanceof ILaunchConfigurationWorkingCopy) {
+ enable((ILaunchConfigurationWorkingCopy) config);
+ } else {
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ enable(wc);
+ wc.doSave();
+ }
+ }
+
+ private static void enable(ILaunchConfigurationWorkingCopy wc) {
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, MAVEN_CLASSPATH_PROVIDER);
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER, MAVEN_SOURCEPATH_PROVIDER);
+ }
+
+ public static void disable(ILaunchConfiguration config) throws CoreException {
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, (String) null);
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER, (String) null);
+ wc.doSave();
+ }
+
+ private static String getArtifactClassifier(IClasspathEntry entry) {
+ IClasspathAttribute[] attributes = entry.getExtraAttributes();
+ for(IClasspathAttribute attribute : attributes) {
+ if(BuildPathManager.CLASSIFIER_ATTRIBUTE.equals(attribute.getName())) {
+ return attribute.getValue();
+ }
+ }
+ return null;
+ }
+
+ public static void enable(IProject project) throws CoreException {
+ for(ILaunchConfiguration config : getLaunchConfiguration(project)) {
+ if(isSupportedType(config.getType().getIdentifier())) {
+ enable(config);
+ }
+ }
+ }
+
+ public static void disable(IProject project) throws CoreException {
+ for(ILaunchConfiguration config : getLaunchConfiguration(project)) {
+ if(isSupportedType(config.getType().getIdentifier())) {
+ disable(config);
+ }
+ }
+ }
+
+ private static List<ILaunchConfiguration> getLaunchConfiguration(IProject project) throws CoreException {
+ ArrayList<ILaunchConfiguration> result = new ArrayList<ILaunchConfiguration>();
+ ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfiguration[] configurations = launchManager.getLaunchConfigurations();
+ for(ILaunchConfiguration config : configurations) {
+ String projectName = config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null);
+ if (project.getName().equals(projectName)) {
+ result.add(config);
+ }
+ }
+ return result;
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenSourcePathProvider.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenSourcePathProvider.java
new file mode 100644
index 00000000..d13145ab
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/launch/MavenSourcePathProvider.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal.launch;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
+import org.eclipse.jdt.launching.JavaRuntime;
+
+
+
+public class MavenSourcePathProvider extends MavenRuntimeClasspathProvider {
+
+ public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration) throws CoreException {
+ boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_SOURCE_PATH, true);
+ if(useDefault) {
+ // the default source lookup path is the same as the classpath
+ return super.computeUnresolvedClasspath(configuration);
+ }
+ // recover persisted source path
+ return recoverRuntimePath(configuration, IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH);
+ }
+
+ @Override
+ protected void addProjectEntries(Set<IRuntimeClasspathEntry> resolved, IPath path, int scope, String classifier, ILaunchConfiguration launchConfiguration, final IProgressMonitor monitor) {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IProject project = root.getProject(path.segment(0));
+ IJavaProject javaProject = JavaCore.create(project);
+ resolved.add(JavaRuntime.newProjectRuntimeClasspathEntry(javaProject));
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/messages.properties b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/messages.properties
new file mode 100644
index 00000000..799b0b3d
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/messages.properties
@@ -0,0 +1,45 @@
+AbstractJavaProjectConfigurator_task_name=Configuring java project
+BuildPathManager_monitor_setting_cp=Setting classpath containers
+DownloadSourcesJob_job_download=Download sources and javadoc
+GenericJavaProjectConfigurator_subtask=reading {0}
+GenericJavaProjectConfigurator_subtask_refreshing=refreshing
+MavenClasspathContainer_description=Maven Dependencies
+MavenClasspathContainerInitializer_error_cannot_persist=Can't persist classpath container
+MavenClasspathContainerInitializer_job_name=Persist classpath container changes
+MavenClasspathContainerPage_control_desc=Set the dependency resolver configuration
+MavenClasspathContainerPage_control_title=Maven Managed Dependencies
+MavenClasspathContainerPage_link=Use <a href="\#maven">Maven Project settings</a> to configure Maven dependency resolution
+MavenClasspathContainerPage_title=Maven Dependencies
+MavenDependencyResolver_additional_info=Resolve dependencies from Maven repositories
+MavenDependencyResolver_error_message=Unable to retrieve corresponding resource
+MavenDependencyResolver_error_message2=Project does not have pom.xml
+MavenDependencyResolver_error_message3=Unable to read project natures
+MavenDependencyResolver_error_message4=Unable to read Maven project
+MavenDependencyResolver_error_message5=Unable to locate pom.xml for {0}
+MavenDependencyResolver_error_message6=Unable to locate pom.xml for {0}
+MavenDependencyResolver_error_message7=Unable to add import statement for {0}
+MavenDependencyResolver_error_title=Add Dependency
+MavenDependencyResolver_proposal_search=Search dependency for {0}
+MavenDependencyResolver_searchDialog_title=Search in Maven repositories
+MavenJdtMenuCreator_action_downloadJavadoc=Download JavaDoc
+MavenJdtMenuCreator_action_downloadSources=Download Sources
+MavenJdtMenuCreator_action_javadoc=Download JavaDoc
+MavenJdtMenuCreator_action_materialize1=Import Project
+MavenJdtMenuCreator_action_materializeMany=Import Projects
+MavenJdtMenuCreator_action_open_issue=Open Issue Tracker
+MavenJdtMenuCreator_action_openCI=Open Continuous Integration
+MavenJdtMenuCreator_action_openJavadoc=Open JavaDoc
+MavenJdtMenuCreator_action_openPom=Open POM
+MavenJdtMenuCreator_action_openProject=Open Project Page
+MavenJdtMenuCreator_action_sources=Download Sources
+MavenJdtMenuCreator_axtion_openScm=Open Source Control
+MavenJdtPlugin_job_name=Building...
+MavenQueryParticipant_job_name=Opening {0}
+MavenQueryParticipant_searchDialog_title=Open Type from Maven
+MavenRuntimeClasspathProvider_error_unsupported=Unsupported launch configuration type {0}
+OpenJavaDocAction_error_download=Can't download JavaDoc for {0}
+OpenJavaDocAction_error_message=Unable to read Maven project
+OpenJavaDocAction_error_title=Open JavaDoc
+OpenJavaDocAction_info_title=Show JavaDoc
+OpenJavaDocAction_job_open_javadoc=Opening JavaDoc for {0}
+OpenJavaDocAction_message1=Unable to identify Maven artifact
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/MavenClasspathContainerPage.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/MavenClasspathContainerPage.java
new file mode 100644
index 00000000..e199d703
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/MavenClasspathContainerPage.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal.ui;
+
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.ui.wizards.IClasspathContainerPage;
+import org.eclipse.jdt.ui.wizards.IClasspathContainerPageExtension;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.jdt.internal.Messages;
+
+
+/**
+ * MavenClasspathContainerPage
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenClasspathContainerPage extends WizardPage implements IClasspathContainerPage,
+ IClasspathContainerPageExtension {
+
+ IJavaProject javaProject;
+
+ private IClasspathEntry containerEntry;
+
+ public MavenClasspathContainerPage() {
+ super(Messages.MavenClasspathContainerPage_title);
+ }
+
+ // IClasspathContainerPageExtension
+
+ public void initialize(IJavaProject javaProject, IClasspathEntry[] currentEntries) {
+ this.javaProject = javaProject;
+ // this.currentEntries = currentEntries;
+ }
+
+ // IClasspathContainerPage
+
+ public IClasspathEntry getSelection() {
+ return this.containerEntry;
+ }
+
+ public void setSelection(IClasspathEntry containerEntry) {
+ this.containerEntry = containerEntry;
+ }
+
+ public void createControl(Composite parent) {
+ setTitle(Messages.MavenClasspathContainerPage_control_title);
+ setDescription(Messages.MavenClasspathContainerPage_control_desc);
+
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout());
+ setControl(composite);
+
+ Link link = new Link(composite, SWT.NONE);
+ link.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ link.setText(Messages.MavenClasspathContainerPage_link);
+ link.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ // IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) getContainer();
+ // container.openPage(MavenProjectPreferencePage.ID, javaProject.getProject());
+
+ PreferencesUtil.createPropertyDialogOn(getShell(), javaProject.getProject(), //
+ IMavenConstants.PREFERENCE_PAGE_ID, new String[] {IMavenConstants.PREFERENCE_PAGE_ID}, null).open();
+ }
+ });
+ }
+
+ public boolean finish() {
+ return true;
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/MavenJdtMenuCreator.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/MavenJdtMenuCreator.java
new file mode 100644
index 00000000..c4c83e63
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/MavenJdtMenuCreator.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.jdt.internal.ui;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.actions.AbstractMavenMenuCreator;
+import org.eclipse.m2e.core.actions.MaterializeAction;
+import org.eclipse.m2e.core.actions.OpenPomAction;
+import org.eclipse.m2e.core.actions.OpenUrlAction;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.jdt.internal.MavenJdtImages;
+import org.eclipse.m2e.jdt.internal.Messages;
+import org.eclipse.m2e.jdt.internal.actions.DownloadSourcesAction;
+import org.eclipse.m2e.jdt.internal.actions.OpenJavaDocAction;
+
+
+/**
+ * Maven menu creator for JDT
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenJdtMenuCreator extends AbstractMavenMenuCreator {
+
+ private static final String ID_SOURCES = "org.eclipse.m2e.downloadSourcesAction"; //$NON-NLS-1$
+
+ private static final String ID_JAVADOC = "org.eclipse.m2e.downloadJavaDocAction"; //$NON-NLS-1$
+
+ /* (non-Javadoc)
+ * @see org.eclipse.m2e.internal.actions.AbstractMavenMenuCreator#createMenu(org.eclipse.jface.action.MenuManager)
+ */
+ public void createMenu(IMenuManager mgr) {
+ int selectionType = SelectionUtil.getSelectionType(selection);
+ if(selectionType == SelectionUtil.UNSUPPORTED) {
+ return;
+ }
+
+ if(selectionType == SelectionUtil.PROJECT_WITH_NATURE) {
+ mgr.appendToGroup(UPDATE, getAction(new DownloadSourcesAction(ID_JAVADOC), //
+ DownloadSourcesAction.ID_JAVADOC, Messages.MavenJdtMenuCreator_action_javadoc));
+ mgr.appendToGroup(UPDATE, getAction(new DownloadSourcesAction(ID_SOURCES), //
+ DownloadSourcesAction.ID_SOURCES, Messages.MavenJdtMenuCreator_action_sources));
+ }
+
+ if(selectionType == SelectionUtil.JAR_FILE) {
+ boolean isProject = false;
+ if(selection.size() == 1) {
+ ArtifactKey key = SelectionUtil.getType(selection.getFirstElement(), ArtifactKey.class);
+ if(key != null) {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectFacade mavenProject = null;
+ mavenProject = projectManager.getMavenProject( //
+ key.getGroupId(), key.getArtifactId(), key.getVersion());
+ if(mavenProject!=null) {
+ isProject = true;
+ }
+ }
+ }
+
+ if(!isProject) {
+ mgr.appendToGroup(UPDATE, getAction(new DownloadSourcesAction(ID_SOURCES), //
+ DownloadSourcesAction.ID_SOURCES, Messages.MavenJdtMenuCreator_action_sources));
+ mgr.appendToGroup(UPDATE, getAction(new DownloadSourcesAction(ID_JAVADOC), //
+ DownloadSourcesAction.ID_JAVADOC, Messages.MavenJdtMenuCreator_action_javadoc));
+ mgr.prependToGroup(OPEN, new Separator());
+ }
+
+ mgr.appendToGroup(OPEN, getAction(new OpenPomAction(), OpenPomAction.ID, Messages.MavenJdtMenuCreator_action_openPom));
+ mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_PROJECT), //
+ OpenUrlAction.ID_PROJECT, Messages.MavenJdtMenuCreator_action_openProject));
+ mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_ISSUES), //
+ OpenUrlAction.ID_ISSUES, Messages.MavenJdtMenuCreator_action_open_issue));
+ mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_SCM), //
+ OpenUrlAction.ID_SCM, Messages.MavenJdtMenuCreator_axtion_openScm));
+ mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_CI), //
+ OpenUrlAction.ID_CI, Messages.MavenJdtMenuCreator_action_openCI));
+ mgr.appendToGroup(OPEN, getAction(new OpenJavaDocAction(), //
+ OpenJavaDocAction.ID, Messages.MavenJdtMenuCreator_action_openJavadoc, MavenJdtImages.JAVA_DOC));
+
+ if(!isProject) {
+ mgr.prependToGroup(IMPORT, new Separator());
+ mgr.appendToGroup(IMPORT, getAction(new MaterializeAction(), //
+ MaterializeAction.ID, //
+ selection.size() == 1 ? Messages.MavenJdtMenuCreator_action_materialize1 : Messages.MavenJdtMenuCreator_action_materializeMany, "icons/import_m2_project.gif")); //$NON-NLS-3$
+ }
+ }
+
+ if(selectionType == SelectionUtil.WORKING_SET) {
+ mgr.appendToGroup(UPDATE, getAction(new DownloadSourcesAction(ID_SOURCES), //
+ DownloadSourcesAction.ID_SOURCES, Messages.MavenJdtMenuCreator_action_downloadSources));
+ mgr.appendToGroup(UPDATE, getAction(new DownloadSourcesAction(ID_JAVADOC), //
+ DownloadSourcesAction.ID_JAVADOC, Messages.MavenJdtMenuCreator_action_downloadJavadoc));
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/ui/internal/filter/MavenModuleFilter.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/ui/internal/filter/MavenModuleFilter.java
new file mode 100644
index 00000000..c75dd1c5
--- /dev/null
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/ui/internal/filter/MavenModuleFilter.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.ui.internal.filter;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+import org.apache.maven.project.MavenProject;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+
+/**
+ * MavenModuleFilter
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenModuleFilter extends ViewerFilter {
+
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if(element instanceof IFolder) {
+ IFolder folder = (IFolder) element;
+ IProject project = folder.getProject();
+ try {
+ if(project.hasNature(IMavenConstants.NATURE_ID)) {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+
+ IMavenProjectFacade projectFacade = projectManager.create(project, null);
+ if(projectFacade != null) {
+ // XXX implement corner cases
+ // modules have ".." in the path
+ // modules have more then one segment in the path
+ // modules not imported in workspace
+ MavenProject mavenProject = projectFacade.getMavenProject(null);
+ IPath folderPath = folder.getFullPath();
+
+ // workspace-relative path sans project name
+ String folderName = folderPath.removeFirstSegments(1).toPortableString();
+
+ if(mavenProject.getModules().contains(folderName)) {
+ return false;
+ }
+ }
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+
+ }
+ return true;
+ }
+
+}
+
diff --git a/org.eclipse.m2e.launching/.classpath b/org.eclipse.m2e.launching/.classpath
new file mode 100644
index 00000000..798048dd
--- /dev/null
+++ b/org.eclipse.m2e.launching/.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>
diff --git a/org.eclipse.m2e.launching/.gitignore b/org.eclipse.m2e.launching/.gitignore
new file mode 100644
index 00000000..ea8c4bf7
--- /dev/null
+++ b/org.eclipse.m2e.launching/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/org.eclipse.m2e.launching/.project b/org.eclipse.m2e.launching/.project
new file mode 100644
index 00000000..52e707b7
--- /dev/null
+++ b/org.eclipse.m2e.launching/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.launching</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.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.launching/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.launching/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..ed1100b1
--- /dev/null
+++ b/org.eclipse.m2e.launching/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,338 @@
+#Thu Feb 04 10:56:11 EST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=2
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=1
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=2
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
diff --git a/org.eclipse.m2e.launching/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.m2e.launching/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000..76adeec1
--- /dev/null
+++ b/org.eclipse.m2e.launching/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,10 @@
+#Tue Nov 30 18:52:25 EST 2010
+eclipse.preferences.version=1
+formatter_profile=_m2 plugin
+formatter_settings_version=11
+org.eclipse.jdt.ui.exception.name=ex
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.overrideannotation=false
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\n * Copyright (c) 2010 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 *******************************************************************************/</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/org.eclipse.m2e.launching/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.m2e.launching/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 00000000..954ec19d
--- /dev/null
+++ b/org.eclipse.m2e.launching/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Fri Oct 17 19:35:37 EDT 2008
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
diff --git a/org.eclipse.m2e.launching/.settings/org.eclipse.mylyn.team.ui.prefs b/org.eclipse.m2e.launching/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 00000000..397560fc
--- /dev/null
+++ b/org.eclipse.m2e.launching/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Fri Oct 17 19:35:37 EDT 2008
+commit.comment.template=${task.key}\: ${task.description}
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.launching/.settings/org.eclipse.pde.prefs b/org.eclipse.m2e.launching/.settings/org.eclipse.pde.prefs
new file mode 100644
index 00000000..86f0a2f7
--- /dev/null
+++ b/org.eclipse.m2e.launching/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,22 @@
+#Fri Oct 17 19:33:03 EDT 2008
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.deprecated=2
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=2
+compilers.p.no-required-att=1
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=1
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.launching/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.launching/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..ac87b894
--- /dev/null
+++ b/org.eclipse.m2e.launching/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:18 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.launching/META-INF/MANIFEST.MF b/org.eclipse.m2e.launching/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..2b972fcd
--- /dev/null
+++ b/org.eclipse.m2e.launching/META-INF/MANIFEST.MF
@@ -0,0 +1,32 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.m2e.launching;singleton:=true
+Bundle-Version: 0.13.0.qualifier
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.resources,
+ org.eclipse.core.runtime,
+ org.eclipse.core.variables,
+ org.eclipse.jface,
+ org.eclipse.jface.text,
+ org.eclipse.ui.externaltools,
+ org.eclipse.ui.console,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.workbench,
+ org.eclipse.ui.ide,
+ org.eclipse.debug.core,
+ org.eclipse.debug.ui,
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.launching,
+ org.eclipse.jdt.ui,
+ org.eclipse.jdt.debug.ui,
+ org.eclipse.jdt.junit,
+ org.eclipse.m2e.maven.runtime;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.core;bundle-version="[0.13.0,0.14.0)",
+ com.ibm.icu;bundle-version="4.0.1"
+Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6
+Bundle-Vendor: %Bundle-Vendor
+Export-Package: org.eclipse.m2e.actions;x-internal:=true
+Bundle-Activator: org.eclipse.m2e.internal.launch.MavenLaunchPlugin
diff --git a/org.eclipse.m2e.launching/about.html b/org.eclipse.m2e.launching/about.html
new file mode 100644
index 00000000..70e4b67c
--- /dev/null
+++ b/org.eclipse.m2e.launching/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>October 29, 2010</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/org.eclipse.m2e.launching/build.properties b/org.eclipse.m2e.launching/build.properties
new file mode 100644
index 00000000..76e37f3e
--- /dev/null
+++ b/org.eclipse.m2e.launching/build.properties
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2008-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
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
+bin.includes = META-INF/,\
+ plugin.xml,\
+ .,\
+ plugin.properties,\
+ icons/,\
+ org.eclipse.m2e.cliresolver.jar,\
+ org.eclipse.m2e.cliresolver30.jar,\
+ about.html
+jars.compile.order = .
+source.. = src/
+output.. = target/classes/
diff --git a/org.eclipse.m2e.launching/icons/m2.gif b/org.eclipse.m2e.launching/icons/m2.gif
new file mode 100644
index 00000000..4b0c0589
--- /dev/null
+++ b/org.eclipse.m2e.launching/icons/m2.gif
Binary files differ
diff --git a/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver.jar b/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver.jar
new file mode 100644
index 00000000..ee932519
--- /dev/null
+++ b/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver.jar
Binary files differ
diff --git a/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver30.jar b/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver30.jar
new file mode 100644
index 00000000..84445d39
--- /dev/null
+++ b/org.eclipse.m2e.launching/org.eclipse.m2e.cliresolver30.jar
Binary files differ
diff --git a/org.eclipse.m2e.launching/plugin.properties b/org.eclipse.m2e.launching/plugin.properties
new file mode 100644
index 00000000..526b2dfa
--- /dev/null
+++ b/org.eclipse.m2e.launching/plugin.properties
@@ -0,0 +1,32 @@
+#
+# Copyright (c) 2007, 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
+#
+
+m2.popup.pomFile.label=Maven build
+m2.popup.pomFileWithDialog.label=Maven build...
+
+m2.popup.lifecycle.package=Maven package
+m2.popup.lifecycle.install=Maven install
+m2.popup.lifecycle.source=Maven source:jar
+m2.popup.lifecycle.clean=Maven clean
+m2.popup.lifecycle.test=Maven test
+m2.popup.lifecycle.generate-sources=Maven generate-sources
+m2.popup.lifecycle.assembly=Maven assembly:assembly
+
+m2.shortcut.description.run=Run Maven Build
+m2.shortcut.description.install=Run Maven Install
+m2.shortcut.description.clean=Run Maven Clean
+m2.shortcut.description.test=Run Maven Test
+m2.shortcut.description.generate-sources=Run Maven Generate Sources
+
+m2.launch.type.name=Maven Build
+m2.launch.type.builder.name=Maven Build
+
+
+Bundle-Vendor = Sonatype, Inc.
+Bundle-Name = Maven Integration for Eclipse Launching
+sourceLocator.name = Maven source locator \ No newline at end of file
diff --git a/org.eclipse.m2e.launching/plugin.xml b/org.eclipse.m2e.launching/plugin.xml
new file mode 100644
index 00000000..68cbb39a
--- /dev/null
+++ b/org.eclipse.m2e.launching/plugin.xml
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2007, 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
+-->
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension point="org.eclipse.ui.commands">
+ <command id="org.eclipse.m2e.core.pomFileAction.run"
+ categoryId="org.eclipse.debug.ui.category.run"
+ name="%m2.shortcut.description.run"
+ description="%m2.shortcut.description.run"/>
+ <command id="org.eclipse.m2e.actions.LifeCycleInstall.run"
+ categoryId="org.eclipse.debug.ui.category.run"
+ name="%m2.shortcut.description.install"
+ description="%m2.shortcut.description.install"/>
+ <command id="org.eclipse.m2e.actions.LifeCycleClean.run"
+ categoryId="org.eclipse.debug.ui.category.run"
+ name="%m2.shortcut.description.clean"
+ description="%m2.shortcut.description.clean"/>
+ <command id="org.eclipse.m2e.actions.LifeCycleTest.run"
+ categoryId="org.eclipse.debug.ui.category.run"
+ name="%m2.shortcut.description.test"
+ description="%m2.shortcut.description.test"/>
+ <command id="org.eclipse.m2e.actions.LifeCycleGenerateSources.run"
+ name="%m2.shortcut.description.generate-sources"
+ description="%m2.shortcut.description.generate-sources"
+ categoryId="org.eclipse.debug.ui.category.run"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.bindings">
+ <key sequence="M3+M2+X M"
+ contextId="org.eclipse.ui.contexts.window"
+ commandId="org.eclipse.m2e.core.pomFileAction.run"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
+ <key sequence="M2+M3+P"
+ commandId="org.eclipse.m2e.core.ui.command.openPom"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
+ </extension>
+
+ <extension point="org.eclipse.debug.ui.launchShortcuts">
+ <shortcut id="org.eclipse.m2e.core.pomFileAction"
+ class="org.eclipse.m2e.actions.ExecutePomAction"
+ icon="icons/m2.gif"
+ label="%m2.popup.pomFile.label"
+ modes="run,debug">
+ <contextualLaunch>
+ <contextLabel label="%m2.popup.pomFile.label" mode="run"/>
+ <contextLabel label="%m2.popup.pomFile.label" mode="debug"/>
+ <enablement>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate>
+ <and>
+ <test property="org.eclipse.m2e.launchable"/>
+ <adapt type="org.eclipse.core.runtime.IAdaptable"/>
+ </and>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ </shortcut>
+ <shortcut id="org.eclipse.m2e.core.pomFileActionWithDialog"
+ class="org.eclipse.m2e.actions.ExecutePomAction:WITH_DIALOG"
+ icon="icons/m2.gif"
+ label="%m2.popup.pomFileWithDialog.label"
+ modes="run,debug">
+ <contextualLaunch>
+ <contextLabel label="%m2.popup.pomFileWithDialog.label" mode="run"/>
+ <contextLabel label="%m2.popup.pomFileWithDialog.label" mode="debug"/>
+ <enablement>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate>
+ <and>
+ <test property="org.eclipse.m2e.launchable"/>
+ <adapt type="org.eclipse.core.runtime.IAdaptable"/>
+ </and>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ </shortcut>
+ <shortcut id="org.eclipse.m2e.actions.LifeCycleInstall"
+ class="org.eclipse.m2e.actions.ExecutePomAction:install"
+ icon="icons/m2.gif"
+ label="%m2.popup.lifecycle.install"
+ modes="run,debug">
+ <contextualLaunch>
+ <contextLabel label="%m2.popup.lifecycle.install" mode="run"/>
+ <contextLabel label="%m2.popup.lifecycle.install" mode="debug"/>
+ <enablement>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate>
+ <and>
+ <test property="org.eclipse.m2e.launchable"/>
+ <adapt type="org.eclipse.core.runtime.IAdaptable"/>
+ </and>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ </shortcut>
+ <shortcut id="org.eclipse.m2e.actions.LifeCycleTest"
+ class="org.eclipse.m2e.actions.ExecutePomAction:test"
+ icon="icons/m2.gif"
+ label="%m2.popup.lifecycle.test"
+ modes="run,debug">
+ <contextualLaunch>
+ <contextLabel label="%m2.popup.lifecycle.test" mode="run"/>
+ <contextLabel label="%m2.popup.lifecycle.test" mode="debug"/>
+ <enablement>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate>
+ <and>
+ <test property="org.eclipse.m2e.launchable"/>
+ <adapt type="org.eclipse.core.runtime.IAdaptable"/>
+ </and>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ </shortcut>
+ <shortcut id="org.eclipse.m2e.actions.LifeCycleGenerateSources"
+ class="org.eclipse.m2e.actions.ExecutePomAction:generate-sources"
+ icon="icons/m2.gif"
+ label="%m2.popup.lifecycle.generate-sources"
+ modes="run,debug">
+ <contextualLaunch>
+ <contextLabel label="%m2.popup.lifecycle.generate-sources" mode="run"/>
+ <contextLabel label="%m2.popup.lifecycle.generate-sources" mode="debug"/>
+ <enablement>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate>
+ <and>
+ <test property="org.eclipse.m2e.launchable"/>
+ <adapt type="org.eclipse.core.runtime.IAdaptable"/>
+ </and>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ </shortcut>
+ <shortcut id="org.eclipse.m2e.actions.LifeCycleClean"
+ class="org.eclipse.m2e.actions.ExecutePomAction:clean"
+ icon="icons/m2.gif"
+ label="%m2.popup.lifecycle.clean"
+ modes="run,debug">
+ <contextualLaunch>
+ <contextLabel label="%m2.popup.lifecycle.clean" mode="run"/>
+ <contextLabel label="%m2.popup.lifecycle.clean" mode="debug"/>
+ <enablement>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate>
+ <and>
+ <test property="org.eclipse.m2e.launchable"/>
+ <adapt type="org.eclipse.core.runtime.IAdaptable"/>
+ </and>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ </shortcut>
+ </extension>
+
+ <!-- m2 LaunchGroup -->
+ <extension point="org.eclipse.debug.core.launchConfigurationTypes">
+ <!-- careful when changing id, it's used to locate launch configuration from the java code! -->
+ <!-- category="org.eclipse.ui.externaltools" -->
+ <launchConfigurationType
+ id="org.eclipse.m2e.Maven2LaunchConfigurationType"
+ delegate="org.eclipse.m2e.internal.launch.MavenLaunchDelegate"
+ sourceLocatorId="org.eclipse.m2e.launching.MavenSourceLocator"
+ sourcePathComputerId="org.eclipse.m2e.launching.MavenSourceComputer"
+ name="%m2.launch.type.name"
+ modes="run,debug" public="true"/>
+ </extension>
+
+ <extension point="org.eclipse.debug.core.sourceLocators">
+ <sourceLocator
+ id="org.eclipse.m2e.launching.MavenSourceLocator"
+ class="org.eclipse.m2e.internal.launch.MavenSourceLocator"
+ name="%sourceLocator.name"/>
+ </extension>
+
+ <extension point="org.eclipse.debug.core.sourcePathComputers">
+ <sourcePathComputer
+ id="org.eclipse.m2e.launching.MavenSourceComputer"
+ class="org.eclipse.m2e.internal.launch.MavenSourcePathComputer"/>
+ </extension>
+
+ <extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
+ <launchConfigurationTabGroup id="org.eclipse.m2e.LaunchConfigurationTabGroup"
+ type="org.eclipse.m2e.Maven2LaunchConfigurationType"
+ class="org.eclipse.m2e.ui.internal.launch.MavenLaunchConfigurationTabGroup"/>
+ </extension>
+
+ <!-- Maven launcher configuration type image -->
+ <extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
+ <launchConfigurationTypeImage
+ icon="icons/m2.gif"
+ configTypeID="org.eclipse.m2e.Maven2LaunchConfigurationType"
+ id="org.eclipse.m2e.launch.Maven2LaunchConfigurationTypeImage"/>
+ </extension>
+
+ <extension point="org.eclipse.debug.ui.consoleLineTrackers">
+ <consoleLineTracker id="org.eclipse.m2e.console.MavenConsoleLineTracker"
+ class="org.eclipse.m2e.internal.launch.MavenConsoleLineTracker"
+ processType="java"/>
+ </extension>
+
+</plugin>
diff --git a/org.eclipse.m2e.launching/pom.xml b/org.eclipse.m2e.launching/pom.xml
new file mode 100644
index 00000000..b846bad2
--- /dev/null
+++ b/org.eclipse.m2e.launching/pom.xml
@@ -0,0 +1,24 @@
+<?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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.launching</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>Maven Integration for Eclipse Launching</name>
+
+</project>
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
new file mode 100644
index 00000000..894f4619
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/ExecutePomAction.java
@@ -0,0 +1,374 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.actions;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugModelPresentation;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.ILaunchShortcut;
+import org.eclipse.debug.ui.RefreshTab;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.internal.launch.Messages;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.ResolverConfiguration;
+import org.eclipse.m2e.ui.internal.launch.MavenLaunchMainTab;
+import org.eclipse.m2e.core.util.Util;
+
+
+/**
+ * Maven launch shortcut
+ *
+ * @author Dmitri Maximovich
+ * @author Eugene Kuleshov
+ */
+public class ExecutePomAction implements ILaunchShortcut, IExecutableExtension {
+
+ private boolean showDialog = false;
+
+ private String goalName = null;
+
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
+ if("WITH_DIALOG".equals(data)) { //$NON-NLS-1$
+ this.showDialog = true;
+ } else {
+ this.goalName = (String) data;
+ }
+ }
+
+ public void launch(IEditorPart editor, String mode) {
+ IEditorInput editorInput = editor.getEditorInput();
+ if(editorInput instanceof IFileEditorInput) {
+ launch(((IFileEditorInput) editorInput).getFile().getParent(), mode);
+ }
+ }
+
+ public void launch(ISelection selection, String mode) {
+ if(selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ Object object = structuredSelection.getFirstElement();
+
+ IContainer basedir = null;
+ if(object instanceof IProject || object instanceof IFolder) {
+ basedir = (IContainer) object;
+ } else if(object instanceof IFile) {
+ basedir = ((IFile) object).getParent();
+ } else if(object instanceof IAdaptable) {
+ IAdaptable adaptable = (IAdaptable) object;
+ Object adapter = adaptable.getAdapter(IProject.class);
+ if(adapter != null) {
+ basedir = (IContainer) adapter;
+ } else {
+ adapter = adaptable.getAdapter(IFolder.class);
+ if(adapter != null) {
+ basedir = (IContainer) adapter;
+ } else {
+ adapter = adaptable.getAdapter(IFile.class);
+ if(adapter != null) {
+ basedir = ((IFile) object).getParent();
+ }
+ }
+ }
+ }
+
+ launch(basedir, mode);
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ private void launch(IContainer basecon, String mode) {
+ if(basecon == null) {
+ return;
+ }
+
+ IContainer basedir = findPomXmlBasedir(basecon);
+
+ ILaunchConfiguration launchConfiguration = getLaunchConfiguration(basedir, mode);
+ if(launchConfiguration == null) {
+ return;
+ }
+
+ boolean openDialog = showDialog;
+ if(!openDialog) {
+ try {
+ // if no goals specified
+ String goals = launchConfiguration.getAttribute(MavenLaunchConstants.ATTR_GOALS, (String) null);
+ openDialog = goals == null || goals.trim().length() == 0;
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+
+ if(openDialog) {
+ DebugUITools.saveBeforeLaunch();
+ // ILaunchGroup group = DebugUITools.getLaunchGroup(launchConfiguration, mode);
+ DebugUITools.openLaunchConfigurationDialog(getShell(), launchConfiguration,
+ MavenLaunchMainTab.ID_EXTERNAL_TOOLS_LAUNCH_GROUP, null);
+ } else {
+ DebugUITools.launch(launchConfiguration, mode);
+ }
+ }
+
+ private Shell getShell() {
+ return MavenPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
+ }
+
+ private IContainer findPomXmlBasedir(IContainer dir) {
+ if(dir == null) {
+ return null;
+ }
+
+ try {
+ // loop upwards through the parents as long as we do not cross the project boundary
+ while(dir.exists() && dir.getProject() != null && dir.getProject() != dir) {
+ // see if pom.xml exists
+ if(dir.getType() == IResource.FOLDER) {
+ IFolder folder = (IFolder) dir;
+ if(folder.findMember(IMavenConstants.POM_FILE_NAME) != null) {
+ return folder;
+ }
+ } else if(dir.getType() == IResource.FILE) {
+ if(((IFile) dir).getName().equals(IMavenConstants.POM_FILE_NAME)) {
+ return dir.getParent();
+ }
+ }
+ dir = dir.getParent();
+ }
+ } catch(Exception e) {
+ return dir;
+ }
+ return dir;
+ }
+
+ private ILaunchConfiguration createLaunchConfiguration(IContainer basedir, String goal) {
+ try {
+ ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType launchConfigurationType = launchManager
+ .getLaunchConfigurationType(MavenLaunchConstants.LAUNCH_CONFIGURATION_TYPE_ID);
+
+ String launchSafeGoalName = goal.replace(':', '-');
+
+ ILaunchConfigurationWorkingCopy workingCopy = launchConfigurationType.newInstance(null, //
+ NLS.bind(Messages.ExecutePomAction_executing, launchSafeGoalName, basedir.getLocation().toString().replace('/', '-')));
+ workingCopy.setAttribute(MavenLaunchConstants.ATTR_POM_DIR, basedir.getLocation().toOSString());
+ workingCopy.setAttribute(MavenLaunchConstants.ATTR_GOALS, goal);
+ workingCopy.setAttribute(IDebugUIConstants.ATTR_PRIVATE, true);
+ workingCopy.setAttribute(RefreshTab.ATTR_REFRESH_SCOPE, "${project}"); //$NON-NLS-1$
+ workingCopy.setAttribute(RefreshTab.ATTR_REFRESH_RECURSIVE, true);
+
+ setProjectConfiguration(workingCopy, basedir);
+
+ IPath path = getJREContainerPath(basedir);
+ if(path != null) {
+ workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, path.toPortableString());
+ }
+
+ // TODO when launching Maven with debugger consider to add the following property
+ // -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE"
+
+ return workingCopy;
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ return null;
+ }
+
+ private void setProjectConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IContainer basedir) {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IFile pomFile = basedir.getFile(new Path(IMavenConstants.POM_FILE_NAME));
+ IMavenProjectFacade projectFacade = projectManager.create(pomFile, false, new NullProgressMonitor());
+ if(projectFacade != null) {
+ ResolverConfiguration configuration = projectFacade.getResolverConfiguration();
+
+ String activeProfiles = configuration.getActiveProfiles();
+ if(activeProfiles != null && activeProfiles.length() > 0) {
+ workingCopy.setAttribute(MavenLaunchConstants.ATTR_PROFILES, activeProfiles);
+ }
+ }
+ }
+
+ // TODO ideally it should use MavenProject, but it is faster to scan IJavaProjects
+ private IPath getJREContainerPath(IContainer basedir) throws CoreException {
+ IProject project = basedir.getProject();
+ if(project != null && project.hasNature(JavaCore.NATURE_ID)) {
+ IJavaProject javaProject = JavaCore.create(project);
+ IClasspathEntry[] entries = javaProject.getRawClasspath();
+ for(int i = 0; i < entries.length; i++ ) {
+ IClasspathEntry entry = entries[i];
+ if(JavaRuntime.JRE_CONTAINER.equals(entry.getPath().segment(0))) {
+ return entry.getPath();
+ }
+ }
+ }
+ return null;
+ }
+
+ private ILaunchConfiguration getLaunchConfiguration(IContainer basedir, String mode) {
+ if(goalName != null) {
+ return createLaunchConfiguration(basedir, goalName);
+ }
+
+ ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType launchConfigurationType = launchManager
+ .getLaunchConfigurationType(MavenLaunchConstants.LAUNCH_CONFIGURATION_TYPE_ID);
+
+ // scan existing launch configurations
+ IPath basedirLocation = basedir.getLocation();
+ if(!showDialog) {
+ try {
+// ILaunch[] launches = launchManager.getLaunches();
+// ILaunchConfiguration[] launchConfigurations = null;
+// if(launches.length > 0) {
+// for(int i = 0; i < launches.length; i++ ) {
+// ILaunchConfiguration config = launches[i].getLaunchConfiguration();
+// if(config != null && launchConfigurationType.equals(config.getType())) {
+// launchConfigurations = new ILaunchConfiguration[] {config};
+// }
+// }
+// }
+// if(launchConfigurations == null) {
+// launchConfigurations = launchManager.getLaunchConfigurations(launchConfigurationType);
+// }
+
+ ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(launchConfigurationType);
+ ArrayList<ILaunchConfiguration> matchingConfigs = new ArrayList<ILaunchConfiguration>();
+ for(ILaunchConfiguration configuration : launchConfigurations) {
+ // substitute variables
+ String workDir = Util.substituteVar(configuration.getAttribute(MavenLaunchConstants.ATTR_POM_DIR, (String) null));
+ if(workDir == null) {
+ continue;
+ }
+ IPath workPath = new Path(workDir);
+ if(basedirLocation.equals(workPath)) {
+ matchingConfigs.add(configuration);
+ }
+ }
+
+ if(matchingConfigs.size()==1) {
+ MavenPlugin.getDefault().getConsole().logMessage("Using existing launch configuration");
+ return matchingConfigs.get(0);
+ } else if(matchingConfigs.size()>1) {
+ final IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
+ ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), //
+ new ILabelProvider() {
+ public Image getImage(Object element) {
+ return labelProvider.getImage(element);
+ }
+
+ public String getText(Object element) {
+ if(element instanceof ILaunchConfiguration) {
+ ILaunchConfiguration configuration = (ILaunchConfiguration) element;
+ try {
+ return labelProvider.getText(element) + " : "
+ + configuration.getAttribute(MavenLaunchConstants.ATTR_GOALS, "");
+ } catch(CoreException ex) {
+ // ignore
+ }
+ }
+ return labelProvider.getText(element);
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return labelProvider.isLabelProperty(element, property);
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ labelProvider.addListener(listener);
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ labelProvider.removeListener(listener);
+ }
+
+ public void dispose() {
+ labelProvider.dispose();
+ }
+ });
+ dialog.setElements(matchingConfigs.toArray(new ILaunchConfiguration[matchingConfigs.size()]));
+ dialog.setTitle(Messages.ExecutePomAction_dialog_title);
+ if (mode.equals(ILaunchManager.DEBUG_MODE)) {
+ dialog.setMessage(Messages.ExecutePomAction_dialog_debug_message);
+ } else {
+ dialog.setMessage(Messages.ExecutePomAction_dialog_run_message);
+ }
+ dialog.setMultipleSelection(false);
+ int result = dialog.open();
+ labelProvider.dispose();
+ return result == Window.OK ? (ILaunchConfiguration) dialog.getFirstResult() : null;
+ }
+
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+
+ MavenPlugin.getDefault().getConsole().logMessage("Creating new launch configuration");
+
+ String newName = launchManager.generateUniqueLaunchConfigurationNameFrom(basedirLocation.lastSegment());
+ try {
+ ILaunchConfigurationWorkingCopy workingCopy = launchConfigurationType.newInstance(null, newName);
+ workingCopy.setAttribute(MavenLaunchConstants.ATTR_POM_DIR, basedirLocation.toString());
+
+ setProjectConfiguration(workingCopy, basedir);
+
+ // set other defaults if needed
+ // MavenLaunchMainTab maintab = new MavenLaunchMainTab();
+ // maintab.setDefaults(workingCopy);
+ // maintab.dispose();
+
+ return workingCopy.doSave();
+ } catch(Exception ex) {
+ MavenLogger.log("Error creating new launch configuration", ex);
+ }
+ return null;
+ }
+
+}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/MavenLaunchConstants.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/MavenLaunchConstants.java
new file mode 100644
index 00000000..0d48f535
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/actions/MavenLaunchConstants.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.actions;
+
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+
+public interface MavenLaunchConstants {
+ // this should correspond with launchConfigurationType.id attribute in plugin.xml!
+ public final String LAUNCH_CONFIGURATION_TYPE_ID = "org.eclipse.m2e.Maven2LaunchConfigurationType"; //$NON-NLS-1$
+ public final String BUILDER_CONFIGURATION_TYPE_ID = "org.eclipse.m2e.Maven2BuilderConfigurationType"; //$NON-NLS-1$
+
+ // pom directory automatically became working directory for maven embedder launch
+ public final String ATTR_POM_DIR = IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY;
+
+ public final String ATTR_GOALS = "M2_GOALS"; //$NON-NLS-1$
+ public final String ATTR_GOALS_AUTO_BUILD = "M2_GOALS_AUTO_BUILD"; //$NON-NLS-1$
+ public final String ATTR_GOALS_MANUAL_BUILD = "M2_GOALS_MANUAL_BUILD"; //$NON-NLS-1$
+ public final String ATTR_GOALS_CLEAN = "M2_GOALS_CLEAN"; //$NON-NLS-1$
+ public final String ATTR_GOALS_AFTER_CLEAN = "M2_GOALS_AFTER_CLEAN"; //$NON-NLS-1$
+
+ public final String ATTR_PROFILES = "M2_PROFILES"; //$NON-NLS-1$
+ public final String ATTR_PROPERTIES = "M2_PROPERTIES"; //$NON-NLS-1$
+
+ public final String ATTR_OFFLINE = "M2_OFFLINE"; //$NON-NLS-1$
+ public final String ATTR_UPDATE_SNAPSHOTS = "M2_UPDATE_SNAPSHOTS"; //$NON-NLS-1$
+ public final String ATTR_DEBUG_OUTPUT = "M2_DEBUG_OUTPUT"; //$NON-NLS-1$
+ public final String ATTR_SKIP_TESTS = "M2_SKIP_TESTS"; //$NON-NLS-1$
+ public final String ATTR_NON_RECURSIVE = "M2_NON_RECURSIVE"; //$NON-NLS-1$
+ public final String ATTR_WORKSPACE_RESOLUTION = "M2_WORKSPACE_RESOLUTION"; //$NON-NLS-1$
+
+ public final String ATTR_USER_SETTINGS = "M2_USER_SETTINGS"; //$NON-NLS-1$
+
+ public final String ATTR_RUNTIME = "M2_RUNTIME"; //$NON-NLS-1$
+
+ // hidden (for now) list of workspace components to be pushed into maven runtime
+ public final String ATTR_FORCED_COMPONENTS_LIST = "M2_FORCED_COMPONENTS_LIST"; //$NON-NLS-1$
+}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java
new file mode 100644
index 00000000..7023f497
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenConsoleLineTracker.java
@@ -0,0 +1,281 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.internal.launch;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.codehaus.plexus.util.DirectoryScanner;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.console.IConsole;
+import org.eclipse.debug.ui.console.IConsoleLineTracker;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.m2e.actions.MavenLaunchConstants;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.IHyperlink;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+
+
+/**
+ * Maven Console line tracker
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenConsoleLineTracker implements IConsoleLineTracker {
+
+ private static final String PLUGIN_ID = "org.eclipse.m2e.launching"; //$NON-NLS-1$
+
+ private static final String LISTENING_MARKER = "Listening for transport dt_socket at address: ";
+
+ private static final String RUNNING_MARKER = "Running ";
+
+ private static final String TEST_TEMPLATE = "(?: )test.+\\(([\\w\\.]+)\\)"; //$NON-NLS-1$
+
+ private static final Pattern PATTERN2 = Pattern.compile(TEST_TEMPLATE);
+
+ private IConsole console;
+
+ public void init(IConsole console) {
+ this.console = console;
+ }
+
+ public void lineAppended(IRegion line) {
+ IProcess process = console.getProcess();
+ ILaunch launch = process.getLaunch();
+ ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
+
+ if(launchConfiguration!=null && isMavenProcess(launchConfiguration)) {
+ try {
+ int offset = line.getOffset();
+ int length = line.getLength();
+
+ String text = console.getDocument().get(offset, length);
+
+ String testName = null;
+
+ int index = text.indexOf(RUNNING_MARKER);
+ if(index > -1) {
+ testName = text.substring(RUNNING_MARKER.length());
+ offset += RUNNING_MARKER.length();
+
+ } else if(text.startsWith(LISTENING_MARKER)) {
+ // create and start remote Java app launch configuration
+ String baseDir = getBaseDir(launchConfiguration);
+ if(baseDir!=null) {
+ String portString = text.substring(LISTENING_MARKER.length()).trim();
+ MavenDebugHyperLink link = new MavenDebugHyperLink(baseDir, portString);
+ console.addLink(link, offset, LISTENING_MARKER.length() + portString.length());
+ // launchRemoteJavaApp(baseDir, portString);
+ }
+
+ } else {
+ Matcher m = PATTERN2.matcher(text);
+ if(m.find()) {
+ testName = m.group(1);
+ offset += m.start(1);
+ }
+ }
+
+ if(testName != null) {
+ String baseDir = getBaseDir(launchConfiguration);
+ if(baseDir!=null) {
+ MavenConsoleHyperLink link = new MavenConsoleHyperLink(baseDir, testName);
+ console.addLink(link, offset, testName.length());
+ }
+ }
+
+ } catch(BadLocationException ex) {
+ // ignore
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+
+ private String getBaseDir(ILaunchConfiguration launchConfiguration) throws CoreException {
+ return launchConfiguration.getAttribute(MavenLaunchConstants.ATTR_POM_DIR, (String) null);
+ }
+
+ public void dispose() {
+ }
+
+ private boolean isMavenProcess(ILaunchConfiguration launchConfiguration) {
+ try {
+ ILaunchConfigurationType type = launchConfiguration.getType();
+ return PLUGIN_ID.equals(type.getPluginIdentifier());
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ return false;
+ }
+ }
+
+ static void launchRemoteJavaApp(String baseDir, String portString) throws CoreException {
+ ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType launchConfigurationType = launchManager
+ .getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_REMOTE_JAVA_APPLICATION);
+
+ /*
+ <launchConfiguration type="org.eclipse.jdt.launching.remoteJavaApplication">
+ <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="foo-launch"/>
+ <stringAttribute key="org.eclipse.jdt.launching.VM_CONNECTOR_ID" value="org.eclipse.jdt.launching.socketAttachConnector"/>
+ <booleanAttribute key="org.eclipse.jdt.launching.ALLOW_TERMINATE" value="false"/>
+ <mapAttribute key="org.eclipse.jdt.launching.CONNECT_MAP">
+ <mapEntry key="port" value="8000"/>
+ <mapEntry key="hostname" value="localhost"/>
+ </mapAttribute>
+
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+ <listEntry value="/foo-launch"/>
+ </listAttribute>
+ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+ <listEntry value="4"/>
+ </listAttribute>
+
+ <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+ <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+ </listAttribute>
+ */
+
+ ILaunchConfigurationWorkingCopy workingCopy = launchConfigurationType.newInstance(null, //
+ "Connecting debugger to port " + portString);
+ workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_ALLOW_TERMINATE, false);
+ workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_CONNECTOR, IJavaLaunchConfigurationConstants.ID_SOCKET_ATTACH_VM_CONNECTOR);
+
+ Map<String, String> connectMap = new HashMap<String, String>();
+ connectMap.put("port", portString); //$NON-NLS-1$
+ connectMap.put("hostname", "localhost"); //$NON-NLS-1$ //$NON-NLS-2$
+ workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CONNECT_MAP, connectMap);
+
+ IProject project = getProject(baseDir);
+ if(project!=null) {
+ workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
+ }
+
+ DebugUITools.launch(workingCopy, "debug"); //$NON-NLS-1$
+ }
+
+ static IProject getProject(String baseDir) {
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ for(IMavenProjectFacade projectFacade : projectManager.getProjects()) {
+ IContainer base = projectFacade.getPom().getParent();
+ String baseLocation = base.getLocation().toPortableString();
+ if(baseDir.equals(baseLocation)) {
+ return projectFacade.getProject();
+ }
+ }
+ return null;
+ }
+
+
+ /**
+ * Opens a text editor for Maven test report
+ */
+ public class MavenConsoleHyperLink implements IHyperlink {
+
+ private final String baseDir;
+ private final String testName;
+
+ public MavenConsoleHyperLink(String baseDir, String testName) {
+ this.baseDir = baseDir;
+ this.testName = testName;
+ }
+
+ public void linkActivated() {
+ DirectoryScanner ds = new DirectoryScanner();
+ ds.setBasedir(baseDir);
+ ds.setIncludes(new String[] {"**/" + testName + ".txt"}); //$NON-NLS-1$ //$NON-NLS-2$
+ ds.scan();
+ String[] includedFiles = ds.getIncludedFiles();
+
+ // TODO show selection dialog when there is more then one result found
+ if(includedFiles != null && includedFiles.length > 0) {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = window.getActivePage();
+
+ IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor("foo.txt"); //$NON-NLS-1$
+
+ File reportFile = new File(baseDir, includedFiles[0]);
+
+ try {
+ IDE.openEditor(page, new MavenFileEditorInput(reportFile.getAbsolutePath()), desc.getId());
+ } catch(PartInitException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ }
+
+ public void linkEntered() {
+ }
+
+ public void linkExited() {
+ }
+
+ }
+
+ /**
+ * Creates debug launch configuration for remote Java application. For example,
+ * with surefire plugin the following property can be specified:
+ * -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE"
+ */
+ public class MavenDebugHyperLink implements IHyperlink {
+
+ private final String baseDir;
+ private final String portString;
+
+ public MavenDebugHyperLink(String baseDir, String portString) {
+ this.baseDir = baseDir;
+ this.portString = portString;
+ }
+
+ public void linkActivated() {
+ try {
+ launchRemoteJavaApp(baseDir, portString);
+ } catch (CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+
+ public void linkEntered() {
+ }
+
+ public void linkExited() {
+ }
+
+ }
+
+}
+
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenFileEditorInput.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenFileEditorInput.java
new file mode 100644
index 00000000..56fffd5c
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenFileEditorInput.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.internal.launch;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.editors.text.ILocationProvider;
+
+import org.eclipse.m2e.core.core.IMavenConstants;
+
+/**
+ * Maven file editor input
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenFileEditorInput implements IStorageEditorInput {
+ final String fileName;
+
+ public MavenFileEditorInput(String fileName) {
+ this.fileName = fileName;
+ }
+
+ public boolean exists() {
+ return true;
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ public String getName() {
+ return new File(this.fileName).getName();
+ }
+
+ public String getToolTipText() {
+ return this.fileName;
+ }
+
+ public IStorage getStorage() {
+ return new IStorage() {
+
+ public InputStream getContents() throws CoreException {
+ try {
+ return new FileInputStream(fileName);
+ } catch(FileNotFoundException ex) {
+ throw new CoreException(new Status(IStatus.ERROR, //
+ IMavenConstants.PLUGIN_ID, -1, NLS.bind(Messages.MavenFileEditorInput_0, fileName), ex));
+ }
+ }
+
+ public IPath getFullPath() {
+ return Path.fromOSString(fileName);
+ }
+
+ public String getName() {
+ return fileName;
+ }
+
+ public boolean isReadOnly() {
+ return false;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+ };
+ }
+
+ public IPersistableElement getPersistable() {
+ return null;
+// return new IPersistableElement() {
+//
+// public String getFactoryId() {
+// return MavenEditorInputFactory.ID;
+// }
+//
+// public void saveState(IMemento memento) {
+// memento.putString("fileName", fileName);
+// }
+// };
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if(adapter==ILocationProvider.class) {
+ return new ILocationProvider() {
+ public IPath getPath(Object element) {
+ return Path.fromOSString(fileName);
+ }
+ };
+ }
+ return null;
+ }
+}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
new file mode 100644
index 00000000..d8b1728e
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchDelegate.java
@@ -0,0 +1,349 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.internal.launch;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IDebugEventSetListener;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.ui.RefreshTab;
+import org.eclipse.jdt.launching.IVMRunner;
+import org.eclipse.jdt.launching.JavaLaunchDelegate;
+import org.eclipse.jdt.launching.VMRunnerConfiguration;
+import org.eclipse.m2e.actions.MavenLaunchConstants;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenConsole;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
+import org.eclipse.m2e.core.util.Util;
+
+
+public class MavenLaunchDelegate extends JavaLaunchDelegate implements MavenLaunchConstants {
+
+ private static final String LAUNCHER_TYPE = "org.codehaus.classworlds.Launcher"; //$NON-NLS-1$
+ private static final String LAUNCHER_TYPE3 = "org.codehaus.plexus.classworlds.launcher.Launcher"; // classwordls 2.0 //$NON-NLS-1$
+ private static final String LAUNCH_M2CONF_FILE = "org.eclipse.m2e.internal.launch.M2_CONF"; //$NON-NLS-1$
+
+ private org.eclipse.m2e.core.embedder.MavenRuntime runtime;
+ private MavenLauncherConfigurationHandler m2conf;
+ private File confFile;
+
+ public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException {
+ MavenConsole console = MavenPlugin.getDefault().getConsole();
+ console.logMessage("" + getWorkingDirectory(configuration)); //$NON-NLS-1$
+ console.logMessage(" mvn" + getProgramArguments(configuration)); //$NON-NLS-1$
+
+ runtime = MavenLaunchUtils.getMavenRuntime(configuration);
+
+ m2conf = new MavenLauncherConfigurationHandler();
+ if (shouldResolveWorkspaceArtifacts(configuration)) {
+ m2conf.addArchiveEntry(MavenLaunchUtils.getCliResolver(runtime));
+ }
+ MavenLaunchUtils.addUserComponents(configuration, m2conf);
+ runtime.createLauncherConfiguration(m2conf, new NullProgressMonitor());
+
+ File state = MavenPlugin.getDefault().getStateLocation().toFile();
+ try {
+ File dir = new File(state, "launches"); //$NON-NLS-1$
+ dir.mkdirs();
+ confFile = File.createTempFile("m2conf", ".tmp", dir); //$NON-NLS-1$ //$NON-NLS-2$
+ launch.setAttribute(LAUNCH_M2CONF_FILE, confFile.getCanonicalPath());
+ OutputStream os = new FileOutputStream(confFile);
+ try {
+ m2conf.save(os);
+ } finally {
+ os.close();
+ }
+ } catch (IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.MavenLaunchDelegate_error_cannot_create_conf, e));
+ }
+
+ super.launch(configuration, mode, launch, monitor);
+ }
+
+ public IVMRunner getVMRunner(final ILaunchConfiguration configuration, String mode) throws CoreException {
+ final IVMRunner runner = super.getVMRunner(configuration, mode);
+
+ return new IVMRunner() {
+ public void run(VMRunnerConfiguration runnerConfiguration, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException {
+ runner.run(runnerConfiguration, launch, monitor);
+
+ IProcess[] processes = launch.getProcesses();
+ if(processes!=null && processes.length>0) {
+ BackgroundResourceRefresher refresher = new BackgroundResourceRefresher(configuration, launch);
+ refresher.init();
+ } else {
+ removeTempFiles(launch);
+ }
+ }
+ };
+ }
+
+ public String getMainTypeName(ILaunchConfiguration configuration) throws CoreException {
+ return runtime.getVersion().startsWith("3.0")? LAUNCHER_TYPE3: LAUNCHER_TYPE; //$NON-NLS-1$
+ }
+
+ public String[] getClasspath(ILaunchConfiguration configuration) throws CoreException {
+ List<String> cp = m2conf.getRealmEntries(IMavenLauncherConfiguration.LAUNCHER_REALM);
+ return cp.toArray(new String[cp.size()]);
+ }
+
+ public String getProgramArguments(ILaunchConfiguration configuration) throws CoreException {
+ return getProperties(configuration) + //
+ getPreferences(configuration) + " " + // //$NON-NLS-1$
+ getGoals(configuration);
+ }
+
+ public String getVMArguments(ILaunchConfiguration configuration) throws CoreException {
+ /*
+ * <pre>
+ * %MAVEN_JAVA_EXE% %MAVEN_OPTS%
+ * -classpath %CLASSWORLDS_JAR%
+ * "-Dclassworlds.conf=%M2_HOME%\bin\m2.conf"
+ * "-Dmaven.home=%M2_HOME%"
+ * org.codehaus.classworlds.Launcher
+ * %MAVEN_CMD_LINE_ARGS%
+ * </pre>
+ */
+
+ StringBuffer sb = new StringBuffer();
+
+ // workspace artifact resolution
+ if (shouldResolveWorkspaceArtifacts(configuration)) {
+ File state = MavenPlugin.getDefault().getMavenProjectManager().getWorkspaceStateFile();
+ sb.append("-Dm2eclipse.workspace.state=").append(quote(state.getAbsolutePath())); //$NON-NLS-1$
+ }
+
+ // maven.home
+ String location = runtime.getLocation();
+ if (location != null) {
+ sb.append(" -Dmaven.home=").append(quote(location)); //$NON-NLS-1$
+ }
+
+ // m2.conf
+ sb.append(" -Dclassworlds.conf=").append(quote(confFile.getAbsolutePath())); //$NON-NLS-1$
+
+ // user configured entries
+ sb.append(" ").append(super.getVMArguments(configuration)); //$NON-NLS-1$
+
+ return sb.toString();
+ }
+
+ private String quote(String string) {
+ return string.indexOf(' ') > -1 ? "\"" + string + "\"" : string; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ private boolean shouldResolveWorkspaceArtifacts(ILaunchConfiguration configuration) throws CoreException {
+ return configuration.getAttribute(ATTR_WORKSPACE_RESOLUTION, false);
+ }
+
+ protected String getGoals(ILaunchConfiguration configuration) throws CoreException {
+ return configuration.getAttribute(MavenLaunchConstants.ATTR_GOALS, ""); //$NON-NLS-1$
+ }
+
+ public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) {
+ return false;
+ }
+
+ /**
+ * Construct string with properties to pass to JVM as system properties
+ */
+ private String getProperties(ILaunchConfiguration configuration) {
+ StringBuffer sb = new StringBuffer();
+
+ try {
+ @SuppressWarnings("unchecked")
+ List<String> properties = configuration.getAttribute(ATTR_PROPERTIES, Collections.EMPTY_LIST);
+ for(String property : properties) {
+ int n = property.indexOf('=');
+ String name = property;
+ String value = null;
+
+ if(n > -1) {
+ name = property.substring(0, n);
+ if(n > 1) {
+ value = Util.substituteVar(property.substring(n + 1));
+ }
+ }
+
+ sb.append(" -D").append(name); //$NON-NLS-1$
+ if(value != null) {
+ sb.append('=').append(quote(value));
+ }
+ }
+ } catch(CoreException e) {
+ String msg = "Exception while getting configuration attribute " + ATTR_PROPERTIES;
+ MavenLogger.log(msg, e);
+ }
+
+ try {
+ String profiles = configuration.getAttribute(ATTR_PROFILES, (String) null);
+ if(profiles != null && profiles.trim().length() > 0) {
+ sb.append(" -P").append(profiles.replaceAll("\\s+", ",")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ } catch(CoreException ex) {
+ String msg = "Exception while getting configuration attribute " + ATTR_PROFILES;
+ MavenLogger.log(msg, ex);
+ }
+
+ return sb.toString();
+ }
+
+ /**
+ * Construct string with preferences to pass to JVM as system properties
+ */
+ private String getPreferences(ILaunchConfiguration configuration) throws CoreException {
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+
+ StringBuffer sb = new StringBuffer();
+
+ sb.append(" -B"); //$NON-NLS-1$
+
+ if(configuration.getAttribute(MavenLaunchConstants.ATTR_DEBUG_OUTPUT, mavenConfiguration.isDebugOutput())) {
+ sb.append(" -X").append(" -e"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ // sb.append(" -D").append(MavenPreferenceConstants.P_DEBUG_OUTPUT).append("=").append(debugOutput);
+
+ if(configuration.getAttribute(MavenLaunchConstants.ATTR_OFFLINE, mavenConfiguration.isOffline())) {
+ sb.append(" -o"); //$NON-NLS-1$
+ }
+ // sb.append(" -D").append(MavenPreferenceConstants.P_OFFLINE).append("=").append(offline);
+
+ if(configuration.getAttribute(MavenLaunchConstants.ATTR_UPDATE_SNAPSHOTS, false)) {
+ sb.append(" -U"); //$NON-NLS-1$
+ }
+
+ if(configuration.getAttribute(MavenLaunchConstants.ATTR_NON_RECURSIVE, false)) {
+ sb.append(" -N"); //$NON-NLS-1$
+ }
+
+ if(configuration.getAttribute(MavenLaunchConstants.ATTR_SKIP_TESTS, false)) {
+ sb.append(" -Dmaven.test.skip=true"); //$NON-NLS-1$
+ }
+
+ String settings = configuration.getAttribute(MavenLaunchConstants.ATTR_USER_SETTINGS, (String) null);
+ if(settings == null || settings.trim().length() <= 0) {
+ settings = mavenConfiguration.getUserSettingsFile();
+ if(settings != null && settings.trim().length() > 0 && !new File(settings.trim()).exists()) {
+ settings = null;
+ }
+ }
+ if(settings != null && settings.trim().length() > 0) {
+ sb.append(" -s ").append(quote(settings)); //$NON-NLS-1$
+ }
+
+ // boolean b = preferenceStore.getBoolean(MavenPreferenceConstants.P_CHECK_LATEST_PLUGIN_VERSION);
+ // sb.append(" -D").append(MavenPreferenceConstants.P_CHECK_LATEST_PLUGIN_VERSION).append("=").append(b);
+
+ // b = preferenceStore.getBoolean(MavenPreferenceConstants.P_UPDATE_SNAPSHOTS);
+ // sb.append(" -D").append(MavenPreferenceConstants.P_UPDATE_SNAPSHOTS).append("=").append(b);
+
+ // String s = preferenceStore.getString(MavenPreferenceConstants.P_GLOBAL_CHECKSUM_POLICY);
+ // if(s != null && s.trim().length() > 0) {
+ // sb.append(" -D").append(MavenPreferenceConstants.P_GLOBAL_CHECKSUM_POLICY).append("=").append(s);
+ // }
+
+ return sb.toString();
+ }
+
+ static void removeTempFiles(ILaunch launch) {
+ String m2confName = launch.getAttribute(LAUNCH_M2CONF_FILE);
+ if (m2confName != null) {
+ new File(m2confName).delete();
+ }
+ }
+
+ /**
+ * Refreshes resources as specified by a launch configuration, when
+ * an associated process terminates.
+ *
+ * Adapted from org.eclipse.ui.externaltools.internal.program.launchConfigurations.BackgroundResourceRefresher
+ */
+ public static class BackgroundResourceRefresher implements IDebugEventSetListener {
+ final ILaunchConfiguration configuration;
+ final IProcess process;
+ final ILaunch launch;
+
+ public BackgroundResourceRefresher(ILaunchConfiguration configuration, ILaunch launch) {
+ this.configuration = configuration;
+ this.process = launch.getProcesses()[0];
+ this.launch = launch;
+ }
+
+ /**
+ * If the process has already terminated, resource refreshing is done
+ * immediately in the current thread. Otherwise, refreshing is done when the
+ * process terminates.
+ */
+ public void init() {
+ synchronized (process) {
+ if (process.isTerminated()) {
+ processResources();
+ } else {
+ DebugPlugin.getDefault().addDebugEventListener(this);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
+ */
+ public void handleDebugEvents(DebugEvent[] events) {
+ for (int i = 0; i < events.length; i++) {
+ DebugEvent event = events[i];
+ if (event.getSource() == process && event.getKind() == DebugEvent.TERMINATE) {
+ DebugPlugin.getDefault().removeDebugEventListener(this);
+ processResources();
+ break;
+ }
+ }
+ }
+
+ protected void processResources() {
+ removeTempFiles(launch);
+
+ Job job = new Job(Messages.MavenLaunchDelegate_job_name) {
+ public IStatus run(IProgressMonitor monitor) {
+ try {
+ RefreshTab.refreshResources(configuration, monitor);
+ return Status.OK_STATUS;
+ } catch (CoreException e) {
+ MavenLogger.log(e);
+ return e.getStatus();
+ }
+ }
+ };
+ job.schedule();
+ }
+ }
+
+
+}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchPlugin.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchPlugin.java
new file mode 100644
index 00000000..17fb637e
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchPlugin.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.internal.launch;
+
+import org.eclipse.core.runtime.Plugin;
+
+public class MavenLaunchPlugin extends Plugin {
+
+ private static MavenLaunchPlugin instance;
+
+ public MavenLaunchPlugin() {
+ instance = this;
+ }
+
+ public static MavenLaunchPlugin getDefault() {
+ return instance;
+ }
+}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java
new file mode 100644
index 00000000..6b8e5532
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLaunchUtils.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.internal.launch;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.m2e.actions.MavenLaunchConstants;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
+import org.eclipse.m2e.core.embedder.MavenRuntime;
+import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.osgi.util.NLS;
+
+import com.ibm.icu.util.StringTokenizer;
+
+/**
+ * MavenLaunchUtils
+ *
+ * @author Igor Fedorenko
+ */
+public class MavenLaunchUtils {
+
+ public static MavenRuntime getMavenRuntime(ILaunchConfiguration configuration) throws CoreException {
+ MavenRuntimeManager runtimeManager = MavenPlugin.getDefault().getMavenRuntimeManager();
+ String location = configuration.getAttribute(MavenLaunchConstants.ATTR_RUNTIME, ""); //$NON-NLS-1$
+ MavenRuntime runtime = runtimeManager.getRuntime(location);
+ if(runtime == null) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, //
+ NLS.bind(Messages.MavenLaunchUtils_error_no_maven_install, location), null));
+ }
+ return runtime;
+ }
+
+ public static String getCliResolver(MavenRuntime runtime) throws CoreException {
+ String jarname;
+ String runtimeVersion = runtime.getVersion();
+ if (runtimeVersion.startsWith("3.")) { //$NON-NLS-1$
+ jarname = "org.eclipse.m2e.cliresolver30.jar"; //$NON-NLS-1$
+ } else {
+ jarname = "org.eclipse.m2e.cliresolver.jar"; //$NON-NLS-1$
+ }
+ URL url = MavenLaunchPlugin.getDefault().getBundle().getEntry(jarname);
+ try {
+ URL fileURL = FileLocator.toFileURL(url);
+ // MNGECLIPSE-804 workaround for spaces in the original path
+ URI fileURI = new URI(fileURL.getProtocol(), fileURL.getHost(), fileURL.getPath(), fileURL.getQuery());
+ return new File(fileURI).getCanonicalPath();
+ } catch(Exception ex) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, ex.getMessage(), ex));
+ }
+ }
+
+ public static void addUserComponents(ILaunchConfiguration configuration, IMavenLauncherConfiguration collector)
+ throws CoreException {
+ @SuppressWarnings("unchecked")
+ List<String> list = configuration.getAttribute(MavenLaunchConstants.ATTR_FORCED_COMPONENTS_LIST, new ArrayList());
+ if(list == null) {
+ return;
+ }
+
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+ for(String gav : list) {
+ // groupId:artifactId:version
+ StringTokenizer st = new StringTokenizer(gav, ":"); //$NON-NLS-1$
+ String groupId = st.nextToken();
+ String artifactId = st.nextToken();
+ String version = st.nextToken();
+
+ IMavenProjectFacade facade = projectManager.getMavenProject(groupId, artifactId, version);
+
+ if(facade != null) {
+ collector.addProjectEntry(facade);
+ } else {
+ String name = groupId + ":" + artifactId + ":" + version; //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ Artifact artifact = maven.resolve(groupId, artifactId, version, "jar", null, null, null); //$NON-NLS-1$
+ File file = artifact.getFile();
+ if(file != null) {
+ collector.addArchiveEntry(file.getAbsolutePath());
+ }
+ } catch(CoreException ex) {
+ MavenLogger.log("Artifact not found " + name, ex);
+ }
+ }
+ }
+ }
+}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLauncherConfigurationHandler.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLauncherConfigurationHandler.java
new file mode 100644
index 00000000..2bc6b171
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenLauncherConfigurationHandler.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.internal.launch;
+
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * MavenLauncherConfigurationHandler
+ *
+ * @author Igor Fedorenko
+ */
+public class MavenLauncherConfigurationHandler implements IMavenLauncherConfiguration {
+
+ private String mainType;
+ private String mainRealm;
+ private LinkedHashMap<String, List<String>> realms = new LinkedHashMap<String, List<String>>();
+ private List<String> forcedEntries = new ArrayList<String>();
+ private List<String> curEntries = forcedEntries;
+
+ public void addArchiveEntry(String entry) {
+ curEntries.add(entry);
+ }
+
+ public void addProjectEntry(IMavenProjectFacade facade) {
+ final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IFolder output = root.getFolder(facade.getOutputLocation());
+ if (output.isAccessible()) {
+ addArchiveEntry(output.getLocation().toFile().getAbsolutePath());
+ }
+ }
+
+ public void addRealm(String realm) {
+ if (!realms.containsKey(realm)) {
+ curEntries = new ArrayList<String>();
+ realms.put(realm, curEntries);
+ }
+ }
+
+ public void setMainType(String type, String realm) {
+ this.mainType = type;
+ this.mainRealm = realm;
+ }
+
+ public void save(OutputStream os) throws IOException {
+ BufferedWriter out = new BufferedWriter(new OutputStreamWriter(os, "UTF-8")); //$NON-NLS-1$
+ out.write(NLS.bind("main is {0} from {1}\n", mainType, mainRealm));
+ for (Map.Entry<String, List<String>> realm : realms.entrySet()) {
+ if (LAUNCHER_REALM.equals(realm.getKey())) {
+ continue;
+ }
+ out.write(NLS.bind("[{0}]\n", realm.getKey()));
+ if (mainRealm.equals(realm.getKey())) {
+ for (String entry : forcedEntries) {
+ out.write(NLS.bind("load {0}\n", entry));
+ }
+ }
+ for (String entry : realm.getValue()) {
+ out.write(NLS.bind("load {0}\n", entry));
+ }
+ }
+ out.flush();
+ }
+
+ public String getMainReal() {
+ return mainRealm;
+ }
+
+ public List<String> getRealmEntries(String realm) {
+ return realms.get(realm);
+ }
+}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourceLocator.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourceLocator.java
new file mode 100644
index 00000000..581e969e
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourceLocator.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.internal.launch;
+
+import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
+import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant;
+import org.eclipse.jdt.launching.sourcelookup.containers.JavaSourceLookupParticipant;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class MavenSourceLocator extends AbstractSourceLookupDirector {
+
+ public void initializeParticipants() {
+ addParticipants(new ISourceLookupParticipant[] {new JavaSourceLookupParticipant()});
+ }
+
+}
+
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java
new file mode 100644
index 00000000..bb317e82
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/MavenSourcePathComputer.java
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.internal.launch;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+import org.apache.maven.artifact.Artifact;
+import org.codehaus.plexus.util.DirectoryScanner;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.sourcelookup.ISourceContainer;
+import org.eclipse.debug.core.sourcelookup.ISourcePathComputer;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.embedder.IMavenLauncherConfiguration;
+import org.eclipse.m2e.core.embedder.MavenRuntime;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+
+
+/**
+ * Computes Maven launch configuration default source lookup path.
+ *
+ * Default source lookup includes Maven core libraries only.
+ * It does not (and cannot) include entries for any Maven plugins
+ * which are loaded dynamically at runtime.
+ *
+ * @author Eugene Kuleshov
+ */
+public class MavenSourcePathComputer implements ISourcePathComputer {
+
+ public MavenSourcePathComputer() {
+ }
+
+ public String getId() {
+ return "org.eclipse.m2e.launching.MavenSourceComputer"; //$NON-NLS-1$
+ }
+
+ public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor)
+ throws CoreException {
+ final List<IRuntimeClasspathEntry> entries = new ArrayList<IRuntimeClasspathEntry>();
+
+ IRuntimeClasspathEntry jreEntry = JavaRuntime.computeJREEntry(configuration);
+ if(jreEntry != null) {
+ entries.add(jreEntry);
+ }
+
+ MavenRuntime runtime = MavenLaunchUtils.getMavenRuntime(configuration);
+ IMavenLauncherConfiguration collector = new IMavenLauncherConfiguration() {
+ public void addArchiveEntry(String entry) throws CoreException {
+ addArchiveRuntimeClasspathEntry(entries, entry);
+ }
+ public void addProjectEntry(IMavenProjectFacade facade) {
+ IJavaProject javaProject = JavaCore.create(facade.getProject());
+ if(javaProject != null) {
+ entries.add(JavaRuntime.newDefaultProjectClasspathEntry(javaProject));
+ }
+ }
+ public void addRealm(String world) {
+ }
+ public void setMainType(String type, String world) {
+ }
+ };
+
+ collector.addArchiveEntry(MavenLaunchUtils.getCliResolver(runtime));
+ MavenLaunchUtils.addUserComponents(configuration, collector);
+ runtime.createLauncherConfiguration(collector, monitor);
+
+ IRuntimeClasspathEntry[] resolved = JavaRuntime.resolveSourceLookupPath( //
+ entries.toArray(new IRuntimeClasspathEntry[entries.size()]), configuration);
+ return JavaRuntime.getSourceContainers(resolved);
+ }
+
+ protected void addArchiveRuntimeClasspathEntry(List<IRuntimeClasspathEntry> entries, String entryPath) throws CoreException {
+ File entryFile = new File(entryPath);
+
+ if (!entryFile.exists()) {
+ return;
+ }
+
+ if (entryFile.isDirectory()) {
+ DirectoryScanner ds = new DirectoryScanner();
+ ds.setBasedir(entryFile);
+ ds.setIncludes(new String[] {
+ "META-INF/maven/*/*/pom.properties", //$NON-NLS-1$
+ });
+ ds.scan();
+ String[] files = ds.getIncludedFiles();
+ for (String file : files) {
+ try {
+ BufferedInputStream is = new BufferedInputStream(new FileInputStream(new File(entryFile, file)));
+ try {
+ addArchiveRuntimeClasspathEntry(entries, entryPath, is);
+ } finally {
+ is.close();
+ }
+ } catch (IOException e) {
+ // ignore it
+ }
+
+ }
+ } else {
+ try {
+ JarFile jar = new JarFile(entryFile);
+ try {
+ Enumeration<JarEntry> zes = jar.entries();
+ while (zes.hasMoreElements()) {
+ JarEntry ze = zes.nextElement();
+ String name = ze.getName();
+ if (!ze.isDirectory() && name.startsWith("META-INF/maven/") && name.endsWith("pom.properties")) { //$NON-NLS-1$ //$NON-NLS-2$
+ addArchiveRuntimeClasspathEntry(entries, entryPath, jar.getInputStream(ze));
+ }
+ }
+ } finally {
+ jar.close();
+ }
+ } catch (IOException e) {
+ // ignore it
+ }
+ }
+
+ }
+
+ private void addArchiveRuntimeClasspathEntry(List<IRuntimeClasspathEntry> entries, String entryPath, InputStream is) throws IOException, CoreException {
+ Properties p = new Properties();
+ p.load(is);
+
+ String groupId = p.getProperty("groupId"); //$NON-NLS-1$
+ String artifactId = p.getProperty("artifactId"); //$NON-NLS-1$
+ String version = p.getProperty("version"); //$NON-NLS-1$
+
+ File sourcesJar = getSourcesJar(groupId, artifactId, version);
+ if (sourcesJar != null) {
+ IRuntimeClasspathEntry entry = null;
+ entry = JavaRuntime.newArchiveRuntimeClasspathEntry(Path.fromOSString(entryPath));
+ entry.setSourceAttachmentPath(Path.fromOSString(sourcesJar.getAbsolutePath()));
+ entries.add(entry);
+ }
+ }
+
+ private File getSourcesJar(String groupId, String artifactId, String version) {
+ if (groupId != null && artifactId != null && version != null) {
+ IMaven maven = MavenPlugin.getDefault().getMaven();
+
+ try {
+ Artifact artifact = maven.resolve(groupId, artifactId, version, "jar", "sources", null, null); //$NON-NLS-1$ //$NON-NLS-2$
+ File file = artifact.getFile();
+
+ if (file != null && file.exists() && file.canRead()) {
+ return file;
+ }
+ } catch(CoreException ex) {
+ // artifact not found, most likely...
+ // TODO add special status code so it is possible to know for sure
+ }
+ }
+
+ return null;
+ }
+
+}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/Messages.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/Messages.java
new file mode 100644
index 00000000..0aac3eab
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/Messages.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+
+package org.eclipse.m2e.internal.launch;
+
+import org.eclipse.osgi.util.NLS;
+
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.m2e.internal.launch.messages"; //$NON-NLS-1$
+
+ public static String ExecutePomAction_dialog_debug_message;
+
+ public static String ExecutePomAction_dialog_run_message;
+
+ public static String ExecutePomAction_dialog_title;
+
+ public static String ExecutePomAction_executing;
+
+ public static String MavenFileEditorInput_0;
+
+ public static String MavenLaunchDelegate_error_cannot_create_conf;
+
+ public static String MavenLaunchDelegate_job_name;
+
+ public static String MavenLaunchMainTab_btnAfterClean;
+
+ public static String MavenLaunchMainTab_btnAutoBuild;
+
+ public static String MavenLaunchMainTab_btnCleanBuild;
+
+ public static String MavenLaunchMainTab_btnConfigure;
+
+ public static String MavenLaunchMainTab_btnDebugOutput;
+
+ public static String MavenLaunchMainTab_btnManualBuild;
+
+ public static String MavenLaunchMainTab_btnNotRecursive;
+
+ public static String MavenLaunchMainTab_btnOffline;
+
+ public static String MavenLaunchMainTab_btnResolveWorkspace;
+
+ public static String MavenLaunchMainTab_btnSkipTests;
+
+ public static String MavenLaunchMainTab_btnUpdateSnapshots;
+
+ public static String MavenLaunchMainTab_lblAfterClean;
+
+ public static String MavenLaunchMainTab_lblAutoBuildGoals;
+
+ public static String MavenLaunchMainTab_lblCleanBuild;
+
+ public static String MavenLaunchMainTab_lblManualGoals;
+
+ public static String MavenLaunchMainTab_lblRuntime;
+
+ public static String MavenLaunchMainTab_property_dialog_edit_title;
+
+ public static String MavenLaunchMainTab_property_dialog_title;
+
+ public static String MavenLaunchUtils_error_no_maven_install;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/messages.properties b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/messages.properties
new file mode 100644
index 00000000..dfa50c7a
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/internal/launch/messages.properties
@@ -0,0 +1,26 @@
+ExecutePomAction_dialog_debug_message=Select a launch configuration to debug:
+ExecutePomAction_dialog_run_message=Select a launch configuration to run:
+ExecutePomAction_dialog_title=Select Configuration
+ExecutePomAction_executing=Executing {0} in {1}
+MavenFileEditorInput_0=Unable to open {0}
+MavenLaunchDelegate_error_cannot_create_conf=Can't create m2.conf
+MavenLaunchDelegate_job_name=Refreshing resources...
+MavenLaunchMainTab_btnAfterClean=Selec&t...
+MavenLaunchMainTab_btnAutoBuild=&Select...
+MavenLaunchMainTab_btnCleanBuild=Se&lect...
+MavenLaunchMainTab_btnConfigure=Configure...
+MavenLaunchMainTab_btnDebugOutput=Debu&g Output
+MavenLaunchMainTab_btnManualBuild=S&elect...
+MavenLaunchMainTab_btnNotRecursive=Non-recursive
+MavenLaunchMainTab_btnOffline=&Offline
+MavenLaunchMainTab_btnResolveWorkspace=Resolve Workspace artifacts
+MavenLaunchMainTab_btnSkipTests=S&kip Tests
+MavenLaunchMainTab_btnUpdateSnapshots=&Update Snapshots
+MavenLaunchMainTab_lblAfterClean=A&fter a Clean Goals:
+MavenLaunchMainTab_lblAutoBuildGoals=Auto &Build Goals:
+MavenLaunchMainTab_lblCleanBuild=&During a Clean Goals:
+MavenLaunchMainTab_lblManualGoals=Ma&nual Build Goals:
+MavenLaunchMainTab_lblRuntime=Maven Runt&ime:
+MavenLaunchMainTab_property_dialog_edit_title=Edit Parameter
+MavenLaunchMainTab_property_dialog_title=Add Parameter
+MavenLaunchUtils_error_no_maven_install=Can't find Maven installation {0}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenBuilderConfigurationTabGroup.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenBuilderConfigurationTabGroup.java
new file mode 100644
index 00000000..19e24ce9
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenBuilderConfigurationTabGroup.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.ui.internal.launch;
+
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.EnvironmentTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.RefreshTab;
+
+public class MavenBuilderConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
+
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
+ new MavenLaunchMainTab(true),
+ new MavenJRETab(),
+ new RefreshTab(),
+ new EnvironmentTab(),
+ new CommonTab()};
+ setTabs(tabs);
+ }
+
+}
+
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenJRETab.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenJRETab.java
new file mode 100644
index 00000000..8c3022ae
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenJRETab.java
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.ui.internal.launch;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab;
+import org.eclipse.jdt.internal.debug.ui.launcher.VMArgumentsBlock;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+
+
+@SuppressWarnings("restriction")
+public class MavenJRETab extends JavaJRETab {
+
+ private VMArgumentsBlock vmArgumentsBlock = new VMArgumentsBlock();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+
+ Composite comp = (Composite) fJREBlock.getControl();
+ ((GridData) comp.getLayoutData()).grabExcessVerticalSpace = true;
+ ((GridData) comp.getLayoutData()).verticalAlignment = SWT.FILL;
+
+ vmArgumentsBlock.createControl(comp);
+ ((GridData) vmArgumentsBlock.getControl().getLayoutData()).horizontalSpan = 2;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ super.performApply(configuration);
+ vmArgumentsBlock.performApply(configuration);
+ setLaunchConfigurationWorkingCopy(configuration);
+ }
+
+// private boolean useDefaultSeparateJRE(ILaunchConfigurationWorkingCopy configuration) {
+// boolean deflt = false;
+// String vmInstallType = null;
+// String jreContainerPath = null;
+// try {
+// vmInstallType = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, (String) null);
+// jreContainerPath = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH,
+// (String) null);
+// } catch(CoreException e) {
+// }
+// if(vmInstallType != null) {
+// configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, (String) null);
+// }
+// if(jreContainerPath != null) {
+// configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, (String) null);
+// }
+// IVMInstall defaultVMInstall = getDefaultVMInstall(configuration);
+// if(defaultVMInstall != null) {
+// IVMInstall vm = fJREBlock.getJRE();
+// deflt = defaultVMInstall.equals(vm);
+// }
+//
+// if(vmInstallType != null) {
+// configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, vmInstallType);
+// }
+// if(jreContainerPath != null) {
+// configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, jreContainerPath);
+// }
+// return deflt;
+// }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ super.initializeFrom(configuration);
+ vmArgumentsBlock.initializeFrom(configuration);
+ // fVMArgumentsBlock.setEnabled(!fJREBlock.isDefaultJRE());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setLaunchConfigurationDialog(org.eclipse.debug.ui.ILaunchConfigurationDialog)
+ */
+ public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog) {
+ super.setLaunchConfigurationDialog(dialog);
+ vmArgumentsBlock.setLaunchConfigurationDialog(dialog);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
+ public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
+ setLaunchConfigurationWorkingCopy(workingCopy);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
+ public void setDefaults(ILaunchConfigurationWorkingCopy config) {
+ super.setDefaults(config);
+ IVMInstall defaultVMInstall = getDefaultVMInstall(config);
+ if(defaultVMInstall != null) {
+ setDefaultVMInstallAttributes(defaultVMInstall, config);
+ }
+
+ }
+
+ private IVMInstall getDefaultVMInstall(ILaunchConfiguration config) {
+ IVMInstall defaultVMInstall;
+ try {
+ defaultVMInstall = JavaRuntime.computeVMInstall(config);
+ } catch(CoreException e) {
+ //core exception thrown for non-Java project
+ defaultVMInstall = JavaRuntime.getDefaultVMInstall();
+ }
+ return defaultVMInstall;
+ }
+
+ @SuppressWarnings("deprecation")
+ private void setDefaultVMInstallAttributes(IVMInstall defaultVMInstall, ILaunchConfigurationWorkingCopy config) {
+ String vmName = defaultVMInstall.getName();
+ String vmTypeID = defaultVMInstall.getVMInstallType().getId();
+ config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME, vmName);
+ config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, vmTypeID);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
+ public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
+ }
+}
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchConfigurationTabGroup.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchConfigurationTabGroup.java
new file mode 100644
index 00000000..0326c590
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchConfigurationTabGroup.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.ui.internal.launch;
+
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
+import org.eclipse.debug.ui.CommonTab;
+import org.eclipse.debug.ui.EnvironmentTab;
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.debug.ui.RefreshTab;
+
+public class MavenLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
+
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
+ new MavenLaunchMainTab(false),
+ new MavenJRETab(),
+ new RefreshTab(),
+ new EnvironmentTab(),
+ new CommonTab()};
+ setTabs(tabs);
+ }
+
+}
+
diff --git a/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
new file mode 100644
index 00000000..697cdaa7
--- /dev/null
+++ b/org.eclipse.m2e.launching/src/org/eclipse/m2e/ui/internal/launch/MavenLaunchMainTab.java
@@ -0,0 +1,785 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.ui.internal.launch;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.variables.VariablesPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.debug.ui.StringVariableSelectionDialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ComboViewer;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.m2e.actions.MavenLaunchConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
+import org.eclipse.m2e.core.MavenImages;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.core.Messages;
+import org.eclipse.m2e.core.embedder.IMavenConfiguration;
+import org.eclipse.m2e.core.embedder.MavenRuntime;
+import org.eclipse.m2e.core.embedder.MavenRuntimeManager;
+import org.eclipse.m2e.core.ui.dialogs.MavenGoalSelectionDialog;
+import org.eclipse.m2e.core.ui.dialogs.MavenPropertyDialog;
+import org.eclipse.m2e.core.util.Util;
+
+
+/**
+ * Maven Launch dialog Main tab
+ *
+ * @author Dmitri Maximovich
+ * @author Eugene Kuleshov
+ */
+@SuppressWarnings("restriction")
+public class MavenLaunchMainTab extends AbstractLaunchConfigurationTab implements MavenLaunchConstants {
+
+ public static final String ID_EXTERNAL_TOOLS_LAUNCH_GROUP = "org.eclipse.ui.externaltools.launchGroup"; //$NON-NLS-1$
+
+ private final boolean isBuilder;
+
+ protected Text pomDirNameText;
+
+ protected Text goalsText;
+ protected Text goalsAutoBuildText;
+ protected Text goalsManualBuildText;
+ protected Text goalsCleanText;
+ protected Text goalsAfterCleanText;
+
+ protected Text profilesText;
+ protected Table propsTable;
+
+ private Button offlineButton;
+
+ private Button updateSnapshotsButton;
+
+ private Button debugOutputButton;
+
+ private Button skipTestsButton;
+
+ private Button nonRecursiveButton;
+
+ private Button enableWorkspaceResolution;
+
+ private Button removePropButton;
+
+ private Button editPropButton;
+
+ ComboViewer runtimeComboViewer;
+
+
+ public MavenLaunchMainTab(boolean isBuilder) {
+ this.isBuilder = isBuilder;
+ }
+
+ public Image getImage() {
+ return MavenImages.IMG_LAUNCH_MAIN;
+ }
+
+ public void createControl(Composite parent) {
+ Composite mainComposite = new Composite(parent, SWT.NONE);
+ setControl(mainComposite);
+ //PlatformUI.getWorkbench().getHelpSystem().setHelp(mainComposite, IAntUIHelpContextIds.ANT_MAIN_TAB);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 5;
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+ mainComposite.setLayout(layout);
+ mainComposite.setLayoutData(gridData);
+ mainComposite.setFont(parent.getFont());
+
+ class Listener implements ModifyListener, SelectionListener {
+ public void modifyText(ModifyEvent e) {
+ entriesChanged();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ entriesChanged();
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ entriesChanged();
+ }
+ }
+ Listener modyfyingListener = new Listener();
+
+ Label label = new Label(mainComposite, SWT.NONE);
+ label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 5, 1));
+ label.setText(Messages.getString("launch.pomGroup"));
+
+ this.pomDirNameText = new Text(mainComposite, SWT.BORDER);
+ this.pomDirNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 5, 1));
+ this.pomDirNameText.addModifyListener(modyfyingListener);
+
+ final Composite pomDirButtonsComposite = new Composite(mainComposite, SWT.NONE);
+ pomDirButtonsComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 5, 1));
+ final GridLayout pomDirButtonsGridLayout = new GridLayout();
+ pomDirButtonsGridLayout.marginWidth = 0;
+ pomDirButtonsGridLayout.marginHeight = 0;
+ pomDirButtonsGridLayout.numColumns = 3;
+ pomDirButtonsComposite.setLayout(pomDirButtonsGridLayout);
+
+ final Button browseWorkspaceButton = new Button(pomDirButtonsComposite, SWT.NONE);
+ browseWorkspaceButton.setText(Messages.getString("launch.browseWorkspace")); //$NON-NLS-1$
+ browseWorkspaceButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), //
+ ResourcesPlugin.getWorkspace().getRoot(), false, Messages.getString("launch.choosePomDir")); //$NON-NLS-1$
+ dialog.showClosedProjects(false);
+
+ int buttonId = dialog.open();
+ if(buttonId == IDialogConstants.OK_ID) {
+ Object[] resource = dialog.getResult();
+ if(resource != null && resource.length > 0) {
+ String fileLoc = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression(
+ "workspace_loc", ((IPath) resource[0]).toString()); //$NON-NLS-1$
+ pomDirNameText.setText(fileLoc);
+ entriesChanged();
+ }
+ }
+ }
+ });
+
+ final Button browseFilesystemButton = new Button(pomDirButtonsComposite, SWT.NONE);
+ browseFilesystemButton.setText(Messages.getString("launch.browseFs")); //$NON-NLS-1$
+ browseFilesystemButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.NONE);
+ dialog.setFilterPath(pomDirNameText.getText());
+ String text = dialog.open();
+ if(text != null) {
+ pomDirNameText.setText(text);
+ entriesChanged();
+ }
+ }
+ });
+
+ final Button browseVariablesButton = new Button(pomDirButtonsComposite, SWT.NONE);
+ browseVariablesButton.setText(Messages.getString("launch.browseVariables")); //$NON-NLS-1$
+ browseVariablesButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
+ dialog.open();
+ String variable = dialog.getVariableExpression();
+ if(variable != null) {
+ pomDirNameText.insert(variable);
+ }
+ }
+ });
+
+ // pom file
+
+ // goals
+
+ if(isBuilder) {
+ Label autoBuildGoalsLabel = new Label(mainComposite, SWT.NONE);
+ GridData gd_autoBuildGoalsLabel = new GridData();
+ gd_autoBuildGoalsLabel.verticalIndent = 7;
+ autoBuildGoalsLabel.setLayoutData(gd_autoBuildGoalsLabel);
+ autoBuildGoalsLabel.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_lblAutoBuildGoals);
+ goalsAutoBuildText = new Text(mainComposite, SWT.BORDER);
+ GridData gd_goalsAutoBuildText = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1);
+ gd_goalsAutoBuildText.verticalIndent = 7;
+ goalsAutoBuildText.setLayoutData(gd_goalsAutoBuildText);
+ goalsAutoBuildText.addModifyListener(modyfyingListener);
+ goalsAutoBuildText.addFocusListener(new GoalsFocusListener(goalsAutoBuildText));
+ Button goalsAutoBuildButton = new Button(mainComposite, SWT.NONE);
+ GridData gd_goalsAutoBuildButton = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ gd_goalsAutoBuildButton.verticalIndent = 7;
+ goalsAutoBuildButton.setLayoutData(gd_goalsAutoBuildButton);
+ goalsAutoBuildButton.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_btnAutoBuild);
+ goalsAutoBuildButton.addSelectionListener(new GoalSelectionAdapter(goalsAutoBuildText));
+
+ Label manualBuildGoalsLabel = new Label(mainComposite, SWT.NONE);
+ manualBuildGoalsLabel.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_lblManualGoals);
+ goalsManualBuildText = new Text(mainComposite, SWT.BORDER);
+ goalsManualBuildText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+ goalsManualBuildText.addModifyListener(modyfyingListener);
+ goalsManualBuildText.addFocusListener(new GoalsFocusListener(goalsManualBuildText));
+ Button goalsManualBuildButton = new Button(mainComposite, SWT.NONE);
+ goalsManualBuildButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ goalsManualBuildButton.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_btnManualBuild);
+ goalsManualBuildButton.addSelectionListener(new GoalSelectionAdapter(goalsManualBuildText));
+
+ Label cleanBuildGoalsLabel = new Label(mainComposite, SWT.NONE);
+ cleanBuildGoalsLabel.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_lblCleanBuild);
+ goalsCleanText = new Text(mainComposite, SWT.BORDER);
+ goalsCleanText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+ goalsCleanText.addModifyListener(modyfyingListener);
+ goalsCleanText.addFocusListener(new GoalsFocusListener(goalsCleanText));
+ Button goalsCleanButton = new Button(mainComposite, SWT.NONE);
+ goalsCleanButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ goalsCleanButton.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_btnCleanBuild);
+ goalsCleanButton.addSelectionListener(new GoalSelectionAdapter(goalsCleanText));
+
+ Label afterCleanGoalsLabel = new Label(mainComposite, SWT.NONE);
+ afterCleanGoalsLabel.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_lblAfterClean);
+ goalsAfterCleanText = new Text(mainComposite, SWT.BORDER);
+ goalsAfterCleanText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+ goalsAfterCleanText.addModifyListener(modyfyingListener);
+ goalsAfterCleanText.addFocusListener(new GoalsFocusListener(goalsAfterCleanText));
+ Button goalsAfterCleanButton = new Button(mainComposite, SWT.NONE);
+ goalsAfterCleanButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ goalsAfterCleanButton.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_btnAfterClean);
+ goalsAfterCleanButton.addSelectionListener(new GoalSelectionAdapter(goalsAfterCleanText));
+
+ } else {
+ Label goalsLabel = new Label(mainComposite, SWT.NONE);
+ GridData gd_goalsLabel = new GridData();
+ gd_goalsLabel.verticalIndent = 7;
+ goalsLabel.setLayoutData(gd_goalsLabel);
+ goalsLabel.setText(Messages.getString("launch.goalsLabel")); //$NON-NLS-1$
+ goalsText = new Text(mainComposite, SWT.BORDER);
+ goalsText.setData("name", "goalsText"); //$NON-NLS-1$ //$NON-NLS-2$
+ GridData gd_goalsText = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1);
+ gd_goalsText.verticalIndent = 7;
+ goalsText.setLayoutData(gd_goalsText);
+ goalsText.addModifyListener(modyfyingListener);
+ goalsText.addFocusListener(new GoalsFocusListener(goalsText));
+
+ Button selectGoalsButton = new Button(mainComposite, SWT.NONE);
+ GridData gd_selectGoalsButton = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ gd_selectGoalsButton.verticalIndent = 7;
+ selectGoalsButton.setLayoutData(gd_selectGoalsButton);
+ selectGoalsButton.setText(Messages.getString("launch.goals")); //$NON-NLS-1$
+ selectGoalsButton.addSelectionListener(new GoalSelectionAdapter(goalsText));
+ }
+
+ Label profilesLabel = new Label(mainComposite, SWT.NONE);
+ profilesLabel.setText(Messages.getString("launch.profilesLabel")); //$NON-NLS-1$
+ // profilesLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+
+ profilesText = new Text(mainComposite, SWT.BORDER);
+ profilesText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1));
+ profilesText.addModifyListener(modyfyingListener);
+ new Label(mainComposite, SWT.NONE);
+
+ offlineButton = new Button(mainComposite, SWT.CHECK);
+ offlineButton.setToolTipText("-o"); //$NON-NLS-1$
+ GridData gd_offlineButton = new GridData();
+ offlineButton.setLayoutData(gd_offlineButton);
+ offlineButton.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_btnOffline);
+ offlineButton.addSelectionListener(modyfyingListener);
+
+ updateSnapshotsButton = new Button(mainComposite, SWT.CHECK);
+ updateSnapshotsButton.setToolTipText("-U"); //$NON-NLS-1$
+ updateSnapshotsButton.addSelectionListener(modyfyingListener);
+ GridData gd_updateSnapshotsButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
+ gd_updateSnapshotsButton.horizontalIndent = 10;
+ updateSnapshotsButton.setLayoutData(gd_updateSnapshotsButton);
+ updateSnapshotsButton.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_btnUpdateSnapshots);
+ new Label(mainComposite, SWT.NONE);
+
+ debugOutputButton = new Button(mainComposite, SWT.CHECK);
+ debugOutputButton.setToolTipText("-X -e"); //$NON-NLS-1$
+ debugOutputButton.addSelectionListener(modyfyingListener);
+ debugOutputButton.setLayoutData(new GridData());
+ debugOutputButton.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_btnDebugOutput);
+
+ skipTestsButton = new Button(mainComposite, SWT.CHECK);
+ skipTestsButton.setToolTipText("-Dmaven.test.skip=true"); //$NON-NLS-1$
+ skipTestsButton.addSelectionListener(modyfyingListener);
+ GridData gd_skipTestsButton = new GridData();
+ gd_skipTestsButton.horizontalIndent = 10;
+ skipTestsButton.setLayoutData(gd_skipTestsButton);
+ skipTestsButton.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_btnSkipTests);
+
+ nonRecursiveButton = new Button(mainComposite, SWT.CHECK);
+ GridData gd_nonrecursiveButton = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
+ gd_nonrecursiveButton.horizontalIndent = 10;
+ nonRecursiveButton.setLayoutData(gd_nonrecursiveButton);
+ nonRecursiveButton.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_btnNotRecursive);
+ nonRecursiveButton.setToolTipText("-N"); //$NON-NLS-1$
+ nonRecursiveButton.setData("name", "nonRecursiveButton"); //$NON-NLS-1$ //$NON-NLS-2$
+ nonRecursiveButton.addSelectionListener(modyfyingListener);
+
+ new Label(mainComposite, SWT.NONE);
+
+ enableWorkspaceResolution = new Button(mainComposite, SWT.CHECK);
+ enableWorkspaceResolution.addSelectionListener(modyfyingListener);
+ enableWorkspaceResolution.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
+ enableWorkspaceResolution.setData("name", "enableWorkspaceResolution"); //$NON-NLS-1$ //$NON-NLS-2$
+ enableWorkspaceResolution.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_btnResolveWorkspace);
+
+ TableViewer tableViewer = new TableViewer(mainComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
+ tableViewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ TableItem[] selection = propsTable.getSelection();
+ if(selection.length == 1) {
+ editProperty(selection[0].getText(0), selection[0].getText(1));
+ }
+ }
+ });
+ tableViewer.addSelectionChangedListener(new ISelectionChangedListener(){
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ TableItem[] items = propsTable.getSelection();
+ if(items == null || items.length == 0){
+ editPropButton.setEnabled(false);
+ removePropButton.setEnabled(false);
+ } else if(items.length == 1){
+ editPropButton.setEnabled(true);
+ removePropButton.setEnabled(true);
+ } else {
+ editPropButton.setEnabled(false);
+ removePropButton.setEnabled(true);
+ }
+ }
+
+ });
+
+ this.propsTable = tableViewer.getTable();
+ //this.tProps.setItemCount(10);
+ this.propsTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 3));
+ this.propsTable.setLinesVisible(true);
+ this.propsTable.setHeaderVisible(true);
+
+ final TableColumn propColumn = new TableColumn(this.propsTable, SWT.NONE, 0);
+ propColumn.setWidth(120);
+ propColumn.setText(Messages.getString("launch.propName")); //$NON-NLS-1$
+
+ final TableColumn valueColumn = new TableColumn(this.propsTable, SWT.NONE, 1);
+ valueColumn.setWidth(200);
+ valueColumn.setText(Messages.getString("launch.propValue")); //$NON-NLS-1$
+
+ final Button addPropButton = new Button(mainComposite, SWT.NONE);
+ addPropButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ addPropButton.setText(Messages.getString("launch.propAddButton")); //$NON-NLS-1$
+ addPropButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ addProperty();
+ }
+ });
+ editPropButton = new Button(mainComposite, SWT.NONE);
+ editPropButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ editPropButton.setText(Messages.getString("launch.propEditButton")); //$NON-NLS-1$
+ editPropButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if(propsTable.getSelectionCount() > 0) {
+ TableItem[] selection = propsTable.getSelection();
+ if(selection.length == 1) {
+ editProperty(selection[0].getText(0), selection[0].getText(1));
+ }
+ }
+ }
+ });
+ editPropButton.setEnabled(false);
+ removePropButton = new Button(mainComposite, SWT.NONE);
+ removePropButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ removePropButton.setText(Messages.getString("launch.propRemoveButton")); //$NON-NLS-1$
+ removePropButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if(propsTable.getSelectionCount() > 0) {
+ propsTable.remove(propsTable.getSelectionIndices());
+ entriesChanged();
+ }
+ }
+ });
+ removePropButton.setEnabled(false);
+
+ {
+ Composite composite = new Composite(mainComposite, SWT.NONE);
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 4, 1));
+ GridLayout gridLayout = new GridLayout(2, false);
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ composite.setLayout(gridLayout);
+
+ Label mavenRuntimeLabel = new Label(composite, SWT.NONE);
+ mavenRuntimeLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+ mavenRuntimeLabel.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_lblRuntime);
+
+ runtimeComboViewer = new ComboViewer(composite, SWT.BORDER | SWT.READ_ONLY);
+ runtimeComboViewer.getCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ runtimeComboViewer.setContentProvider(new IStructuredContentProvider() {
+
+ public Object[] getElements(Object input) {
+ return ((List<?>) input).toArray();
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public void dispose() {
+ }
+
+ });
+
+ runtimeComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ entriesChanged();
+ }
+ });
+
+ MavenRuntimeManager runtimeManager = MavenPlugin.getDefault().getMavenRuntimeManager();
+ runtimeComboViewer.setInput(runtimeManager.getMavenRuntimes());
+ runtimeComboViewer.setSelection(new StructuredSelection(runtimeManager.getDefaultRuntime()));
+ }
+
+ Button configureRuntimesButton = new Button(mainComposite, SWT.NONE);
+ GridData gd_configureRuntimesButton = new GridData(SWT.FILL, SWT.CENTER, false, false);
+ configureRuntimesButton.setLayoutData(gd_configureRuntimesButton);
+ configureRuntimesButton.setText(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_btnConfigure);
+ configureRuntimesButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ PreferencesUtil.createPreferenceDialogOn(getShell(),
+ "org.eclipse.m2e.preferences.MavenInstallationsPreferencePage", null, null).open(); //$NON-NLS-1$
+ MavenRuntimeManager runtimeManager = MavenPlugin.getDefault().getMavenRuntimeManager();
+ runtimeComboViewer.setInput(runtimeManager.getMavenRuntimes());
+ runtimeComboViewer.setSelection(new StructuredSelection(runtimeManager.getDefaultRuntime()));
+ }
+ });
+
+ if(isBuilder) {
+ goalsAutoBuildText.setFocus();
+ } else {
+ goalsText.setFocus();
+ }
+ }
+
+ protected Shell getShell() {
+ return super.getShell();
+ }
+
+ void addProperty() {
+ MavenPropertyDialog dialog = getMavenPropertyDialog(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_property_dialog_title, "", ""); //$NON-NLS-2$ //$NON-NLS-3$
+ if(dialog.open() == IDialogConstants.OK_ID) {
+ TableItem item = new TableItem(propsTable, SWT.NONE);
+ item.setText(0, dialog.getName());
+ item.setText(1, dialog.getValue());
+ entriesChanged();
+ }
+ }
+
+ void editProperty(String name, String value) {
+ MavenPropertyDialog dialog = getMavenPropertyDialog(org.eclipse.m2e.internal.launch.Messages.MavenLaunchMainTab_property_dialog_edit_title, name, value);
+ if(dialog.open() == IDialogConstants.OK_ID) {
+ TableItem[] item = propsTable.getSelection();
+ item[0].setText(0, dialog.getName());
+ item[0].setText(1, dialog.getValue());
+ entriesChanged();
+ }
+ }
+
+ private MavenPropertyDialog getMavenPropertyDialog(String title, String initName, String initValue) {
+ return new MavenPropertyDialog(getShell(), title, initName, initValue, null) {
+ protected Control createDialogArea(Composite parent) {
+ Composite comp = (Composite) super.createDialogArea(parent);
+
+ Button variablesButton = new Button(comp, SWT.PUSH);
+ GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
+ gd.horizontalSpan = 2;
+ gd.widthHint = Math.max(convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH), //
+ variablesButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
+ variablesButton.setLayoutData(gd);
+ variablesButton.setFont(comp.getFont());
+ variablesButton.setText(Messages.getString("launch.propertyDialog.browseVariables")); //$NON-NLS-1$;
+
+ variablesButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent se) {
+ StringVariableSelectionDialog variablesDialog = new StringVariableSelectionDialog(getShell());
+ if(variablesDialog.open() == IDialogConstants.OK_ID) {
+ String variable = variablesDialog.getVariableExpression();
+ if(variable != null) {
+ valueText.insert(variable.trim());
+ }
+ }
+ }
+ });
+
+ return comp;
+ }
+ };
+ }
+
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ String pomDirName = getAttribute(configuration, ATTR_POM_DIR, ""); //$NON-NLS-1$
+ if(isBuilder && pomDirName.length()==0) {
+ pomDirName = "${workspace_loc:/" + configuration.getFile().getProject().getName() + "}"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ this.pomDirNameText.setText(pomDirName);
+
+ if(isBuilder) {
+ this.goalsAutoBuildText.setText(getAttribute(configuration, ATTR_GOALS_AUTO_BUILD, "install")); //$NON-NLS-1$
+ this.goalsManualBuildText.setText(getAttribute(configuration, ATTR_GOALS_MANUAL_BUILD, "install")); //$NON-NLS-1$
+ this.goalsCleanText.setText(getAttribute(configuration, ATTR_GOALS_CLEAN, "clean")); //$NON-NLS-1$
+ this.goalsAfterCleanText.setText(getAttribute(configuration, ATTR_GOALS_AFTER_CLEAN, "install")); //$NON-NLS-1$
+ } else {
+ this.goalsText.setText(getAttribute(configuration, ATTR_GOALS, "")); //$NON-NLS-1$
+ }
+
+ this.profilesText.setText(getAttribute(configuration, ATTR_PROFILES, "")); //$NON-NLS-1$
+ try {
+
+ MavenPlugin plugin = MavenPlugin.getDefault();
+ MavenRuntimeManager runtimeManager = plugin.getMavenRuntimeManager();
+ IMavenConfiguration mavenConfiguration = MavenPlugin.getDefault().getMavenConfiguration();
+
+ this.offlineButton.setSelection(getAttribute(configuration, ATTR_OFFLINE, mavenConfiguration.isOffline()));
+ this.debugOutputButton.setSelection(getAttribute(configuration, ATTR_DEBUG_OUTPUT, mavenConfiguration.isDebugOutput()));
+
+ this.updateSnapshotsButton.setSelection(getAttribute(configuration, ATTR_UPDATE_SNAPSHOTS, false));
+ this.skipTestsButton.setSelection(getAttribute(configuration, ATTR_SKIP_TESTS, false));
+ this.nonRecursiveButton.setSelection(getAttribute(configuration, ATTR_NON_RECURSIVE, false));
+ this.enableWorkspaceResolution.setSelection(getAttribute(configuration, ATTR_WORKSPACE_RESOLUTION, false));
+
+ String location = getAttribute(configuration, ATTR_RUNTIME, ""); //$NON-NLS-1$
+ MavenRuntime runtime = runtimeManager.getRuntime(location);
+ if(runtime != null){
+ this.runtimeComboViewer.setSelection(new StructuredSelection(runtime));
+ }
+ propsTable.removeAll();
+
+ @SuppressWarnings("unchecked")
+ List<String> properties = configuration.getAttribute(ATTR_PROPERTIES, Collections.EMPTY_LIST);
+ for(String property : properties) {
+ int n = property.indexOf('=');
+ String name = property;
+ String value = ""; //$NON-NLS-1$
+ if(n > -1) {
+ name = property.substring(0, n);
+ if(n > 1) {
+ value = property.substring(n + 1);
+ }
+ }
+
+ TableItem item = new TableItem(propsTable, SWT.NONE);
+ item.setText(0, name);
+ item.setText(1, value);
+ }
+ } catch(CoreException ex) {
+ // XXX should we at least log something here?
+ }
+ setDirty(false);
+ }
+
+ private String getAttribute(ILaunchConfiguration configuration, String name, String defaultValue) {
+ try {
+ return configuration.getAttribute(name, defaultValue);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ return defaultValue;
+ }
+ }
+
+ private boolean getAttribute(ILaunchConfiguration configuration, String name, boolean defaultValue) {
+ try {
+ return configuration.getAttribute(name, defaultValue);
+ } catch(CoreException ex) {
+ return defaultValue;
+ }
+ }
+
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ }
+
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ configuration.setAttribute(ATTR_POM_DIR, this.pomDirNameText.getText());
+
+ if(isBuilder) {
+ configuration.setAttribute(ATTR_GOALS_AUTO_BUILD, goalsAutoBuildText.getText());
+ configuration.setAttribute(ATTR_GOALS_MANUAL_BUILD, this.goalsManualBuildText.getText());
+ configuration.setAttribute(ATTR_GOALS_CLEAN, this.goalsCleanText.getText());
+ configuration.setAttribute(ATTR_GOALS_AFTER_CLEAN, this.goalsAfterCleanText.getText());
+
+ StringBuffer sb = new StringBuffer();
+ if(goalsAfterCleanText.getText().trim().length()>0) {
+ sb.append(IExternalToolConstants.BUILD_TYPE_FULL).append(',');
+ }
+ if(goalsManualBuildText.getText().trim().length()>0) {
+ sb.append(IExternalToolConstants.BUILD_TYPE_INCREMENTAL).append(',');
+ }
+ if(goalsAutoBuildText.getText().trim().length()>0) {
+ sb.append(IExternalToolConstants.BUILD_TYPE_AUTO).append(',');
+ }
+ if(goalsCleanText.getText().trim().length()>0) {
+ sb.append(IExternalToolConstants.BUILD_TYPE_CLEAN);
+ }
+ configuration.setAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, sb.toString());
+
+ } else {
+ configuration.setAttribute(ATTR_GOALS, this.goalsText.getText());
+ }
+
+ configuration.setAttribute(ATTR_PROFILES, this.profilesText.getText());
+
+ configuration.setAttribute(ATTR_OFFLINE, this.offlineButton.getSelection());
+ configuration.setAttribute(ATTR_UPDATE_SNAPSHOTS, this.updateSnapshotsButton.getSelection());
+ configuration.setAttribute(ATTR_SKIP_TESTS, this.skipTestsButton.getSelection());
+ configuration.setAttribute(ATTR_NON_RECURSIVE, this.nonRecursiveButton.getSelection());
+ configuration.setAttribute(ATTR_WORKSPACE_RESOLUTION, this.enableWorkspaceResolution.getSelection());
+ configuration.setAttribute(ATTR_DEBUG_OUTPUT, this.debugOutputButton.getSelection());
+
+ IStructuredSelection selection = (IStructuredSelection) runtimeComboViewer.getSelection();
+ MavenRuntime runtime = (MavenRuntime) selection.getFirstElement();
+ configuration.setAttribute(ATTR_RUNTIME, runtime.getLocation());
+
+ // store as String in "param=value" format
+ List<String> properties = new ArrayList<String>();
+ for(TableItem item : this.propsTable.getItems()) {
+ String p = item.getText(0);
+ String v = item.getText(1);
+ if(p != null && p.trim().length() > 0) {
+ String prop = p.trim() + "=" + (v == null ? "" : v); //$NON-NLS-1$ //$NON-NLS-2$
+ properties.add(prop);
+ }
+ }
+ configuration.setAttribute(ATTR_PROPERTIES, properties);
+ }
+
+ public String getName() {
+ return Messages.getString("launch.mainTabName"); //$NON-NLS-1$
+ }
+
+ public boolean isValid(ILaunchConfiguration launchConfig) {
+ setErrorMessage(null);
+
+ String pomFileName = this.pomDirNameText.getText();
+ if(pomFileName == null || pomFileName.trim().length() == 0) {
+ setErrorMessage(Messages.getString("launch.pomDirectoryEmpty"));
+ return false;
+ }
+ if(!isDirectoryExist(pomFileName)) {
+ setErrorMessage(Messages.getString("launch.pomDirectoryDoesntExist"));
+ return false;
+ }
+ return true;
+ }
+
+ protected boolean isDirectoryExist(String name) {
+ if(name == null || name.trim().length() == 0) {
+ return false;
+ }
+ String dirName = Util.substituteVar(name);
+ if(dirName == null) {
+ return false;
+ }
+ File pomDir = new File(dirName);
+ if(!pomDir.exists()) {
+ return false;
+ }
+ if(!pomDir.isDirectory()) {
+ return false;
+ }
+ return true;
+ }
+
+ void entriesChanged() {
+ setDirty(true);
+ updateLaunchConfigurationDialog();
+ }
+
+
+ private static final class GoalsFocusListener extends FocusAdapter {
+ private Text text;
+
+ public GoalsFocusListener(Text text) {
+ this.text = text;
+ }
+
+ public void focusGained(FocusEvent e) {
+ super.focusGained(e);
+ text.setData("focus"); //$NON-NLS-1$
+ }
+ }
+
+
+ private final class GoalSelectionAdapter extends SelectionAdapter {
+ private Text text;
+
+ public GoalSelectionAdapter(Text text) {
+ this.text = text;
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+// String fileName = Util.substituteVar(fPomDirName.getText());
+// if(!isDirectoryExist(fileName)) {
+// MessageDialog.openError(getShell(), Messages.getString("launch.errorPomMissing"),
+// Messages.getString("launch.errorSelectPom")); //$NON-NLS-1$ //$NON-NLS-2$
+// return;
+// }
+ MavenGoalSelectionDialog dialog = new MavenGoalSelectionDialog(getShell());
+ int rc = dialog.open();
+ if(rc == IDialogConstants.OK_ID) {
+ text.insert(""); // clear selected text //$NON-NLS-1$
+
+ String txt = text.getText();
+ int len = txt.length();
+ int pos = text.getCaretPosition();
+
+ StringBuffer sb = new StringBuffer();
+ if((pos > 0 && txt.charAt(pos - 1) != ' ')) {
+ sb.append(' ');
+ }
+
+ String sep = ""; //$NON-NLS-1$
+ Object[] o = dialog.getResult();
+ for(int i = 0; i < o.length; i++ ) {
+ if(o[i] instanceof MavenGoalSelectionDialog.Entry) {
+ if(dialog.isQualifiedName()) {
+ sb.append(sep).append(((MavenGoalSelectionDialog.Entry) o[i]).getQualifiedName());
+ } else {
+ sb.append(sep).append(((MavenGoalSelectionDialog.Entry) o[i]).getName());
+ }
+ }
+ sep = " "; //$NON-NLS-1$
+ }
+
+ if(pos < len && txt.charAt(pos) != ' ') {
+ sb.append(' ');
+ }
+
+ text.insert(sb.toString());
+ text.setFocus();
+ entriesChanged();
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.maven.indexer/.classpath b/org.eclipse.m2e.maven.indexer/.classpath
new file mode 100644
index 00000000..a7a33f20
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/.classpath
@@ -0,0 +1,10 @@
+<?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 exported="true" kind="lib" path="jars/indexer-artifact-3.1.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/indexer-core-3.1.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/lucene-core-2.4.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/lucene-highlighter-2.4.1.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.m2e.maven.indexer/.gitignore b/org.eclipse.m2e.maven.indexer/.gitignore
new file mode 100644
index 00000000..ea8c4bf7
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/org.eclipse.m2e.maven.indexer/.project b/org.eclipse.m2e.maven.indexer/.project
new file mode 100644
index 00000000..7be22e20
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.maven.indexer</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.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.maven.indexer/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.maven.indexer/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..a413c41a
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Thu Feb 04 10:56:12 EST 2010
+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
diff --git a/org.eclipse.m2e.maven.indexer/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.m2e.maven.indexer/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 00000000..72112b8a
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Thu Aug 28 19:39:47 EDT 2008
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
diff --git a/org.eclipse.m2e.maven.indexer/.settings/org.eclipse.mylyn.team.ui.prefs b/org.eclipse.m2e.maven.indexer/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 00000000..44b479a2
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Thu Aug 28 19:39:47 EDT 2008
+commit.comment.template=${task.key}\: ${task.description}
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.maven.indexer/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.maven.indexer/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..58e131a1
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:17 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.maven.indexer/META-INF/MANIFEST.MF b/org.eclipse.m2e.maven.indexer/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..1266629d
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/META-INF/MANIFEST.MF
@@ -0,0 +1,45 @@
+Manifest-Version: 1.0
+Export-Package: META-INF.plexus,
+ org.apache.lucene,
+ org.apache.lucene.analysis,
+ org.apache.lucene.analysis.standard,
+ org.apache.lucene.document,
+ org.apache.lucene.index,
+ org.apache.lucene.queryParser,
+ org.apache.lucene.search,
+ org.apache.lucene.search.function,
+ org.apache.lucene.search.payloads,
+ org.apache.lucene.search.spans,
+ org.apache.lucene.store,
+ org.apache.lucene.util,
+ org.apache.lucene.util.cache,
+ org.apache.maven.index,
+ org.apache.maven.index.archetype,
+ org.apache.maven.index.artifact,
+ org.apache.maven.index.cli,
+ org.apache.maven.index.context,
+ org.apache.maven.index.creator,
+ org.apache.maven.index.fs,
+ org.apache.maven.index.incremental,
+ org.apache.maven.index.locator,
+ org.apache.maven.index.packer,
+ org.apache.maven.index.search.grouping,
+ org.apache.maven.index.treeview,
+ org.apache.maven.index.updater
+Bundle-ClassPath: jars/indexer-artifact-3.1.0-SNAPSHOT.jar,
+ jars/indexer-core-3.1.0-SNAPSHOT.jar,
+ jars/lucene-core-2.4.1.jar,
+ jars/lucene-highlighter-2.4.1.jar
+Bundle-Name: %Bundle-Name
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6
+Require-Bundle: org.eclipse.m2e.maven.runtime;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.archetype.common;bundle-version="[0.13.0,0.14.0)"
+Bundle-Vendor: %Bundle-Vendor
+MavenArtifact-BaseVersion: 2.0.4-SNAPSHOT
+Bundle-Version: 0.13.0.qualifier
+MavenArtifact-GroupId: org.eclipse.m2e
+MavenArtifact-ArtifactId: org.eclipse.m2e.maven.indexer
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.m2e.maven.indexer;singleton:=true
+
diff --git a/org.eclipse.m2e.maven.indexer/META-INF/plexus/.gitignore b/org.eclipse.m2e.maven.indexer/META-INF/plexus/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/META-INF/plexus/.gitignore
diff --git a/org.eclipse.m2e.maven.indexer/OSGI-INF/l10n/bundle.properties b/org.eclipse.m2e.maven.indexer/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000..3e3d39a6
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.m2e.maven.indexer
+Bundle-Vendor = Eclipse m2e
+Bundle-Name = Nexus Indexer Bundle \ No newline at end of file
diff --git a/org.eclipse.m2e.maven.indexer/build.properties b/org.eclipse.m2e.maven.indexer/build.properties
new file mode 100644
index 00000000..016ba093
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/build.properties
@@ -0,0 +1,17 @@
+#
+# Copyright (c) 2008-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
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
+bin.includes = META-INF/,\
+ jars/,\
+ OSGI-INF/l10n/bundle.properties,\
+ jars/indexer-artifact-3.1.0-SNAPSHOT.jar,\
+ jars/indexer-core-3.1.0-SNAPSHOT.jar,\
+ jars/lucene-core-2.4.1.jar
diff --git a/org.eclipse.m2e.maven.indexer/jars/indexer-artifact-3.1.0-SNAPSHOT.jar b/org.eclipse.m2e.maven.indexer/jars/indexer-artifact-3.1.0-SNAPSHOT.jar
new file mode 100644
index 00000000..c82fd6dd
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/jars/indexer-artifact-3.1.0-SNAPSHOT.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.indexer/jars/indexer-core-3.1.0-SNAPSHOT.jar b/org.eclipse.m2e.maven.indexer/jars/indexer-core-3.1.0-SNAPSHOT.jar
new file mode 100644
index 00000000..2787e85c
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/jars/indexer-core-3.1.0-SNAPSHOT.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.indexer/jars/lucene-core-2.4.1.jar b/org.eclipse.m2e.maven.indexer/jars/lucene-core-2.4.1.jar
new file mode 100644
index 00000000..a2dbdd18
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/jars/lucene-core-2.4.1.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.indexer/jars/lucene-highlighter-2.4.1.jar b/org.eclipse.m2e.maven.indexer/jars/lucene-highlighter-2.4.1.jar
new file mode 100644
index 00000000..ee386dac
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/jars/lucene-highlighter-2.4.1.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.indexer/pom.xml b/org.eclipse.m2e.maven.indexer/pom.xml
new file mode 100644
index 00000000..b9584515
--- /dev/null
+++ b/org.eclipse.m2e.maven.indexer/pom.xml
@@ -0,0 +1,118 @@
+<?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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.maven.indexer</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>Nexus Indexer Bundle</name>
+
+ <!--
+ To include new nexus-indexer,
+
+ * run the command below from CLI (use proper Tycho version, see below)
+ * right-click on the project in Eclipse, PDE->Update Classpath
+
+ /opt/maven/bin/mvn -o \
+ -Dtycho.mode=maven -Pupdate-dependencies \
+ clean org.sonatype.tycho:maven-osgi-packaging-plugin:generate-bundle
+ -->
+ <profiles>
+ <profile>
+ <id>update-dependencies</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.sonatype.nexus</groupId>
+ <artifactId>nexus-indexer</artifactId>
+ <version>${nexus_indexer.version}</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>jars</directory>
+ <followSymlinks>false</followSymlinks>
+ <includes>
+ <include>**/*.jar</include>
+ </includes>
+ </fileset>
+ <fileset>
+ <directory>META-INF</directory>
+ <followSymlinks>false</followSymlinks>
+ <includes>
+ <include>**/MANIFEST.MF</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-packaging-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>generate-bundle</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <packageSources>false</packageSources>
+ <includes>
+ <include>
+ <groupId>org.sonatype.nexus</groupId>
+ <artifactId>nexus-indexer</artifactId>
+ </include>
+ <include>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-core</artifactId>
+ </include>
+ </includes>
+ <exportPackages>
+ org.maven.sonatype.nexus.*,
+ org.apache.lucene.*,
+ META-INF.plexus,
+ </exportPackages>
+ <manifestAttributes>
+ <Bundle-RequiredExecutionEnvironment>J2SE-1.5, JavaSE-1.6</Bundle-RequiredExecutionEnvironment>
+ </manifestAttributes>
+ <requireBundles>
+ <requireBundle>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.maven.runtime</artifactId>
+ <version>${maven_embedder.version}</version>
+ </requireBundle>
+ <requireBundle>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.archetype_common</artifactId>
+ <version>${archetype_common.version}</version>
+ </requireBundle>
+ </requireBundles>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/org.eclipse.m2e.maven.runtime/.classpath b/org.eclipse.m2e.maven.runtime/.classpath
new file mode 100644
index 00000000..8c8368da
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/.classpath
@@ -0,0 +1,51 @@
+<?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 exported="true" kind="lib" path="jars/maven-embedder-3.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/maven-settings-3.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/maven-plugin-api-3.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/maven-model-builder-3.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/plexus-sec-dispatcher-1.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/plexus-cipher-1.4.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/maven-core-3.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/maven-model-3.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/maven-settings-builder-3.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/maven-repository-metadata-3.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/maven-artifact-3.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/maven-aether-provider-3.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/aether-impl-1.7.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/plexus-interpolation-1.14.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/maven-compat-3.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/commons-cli-1.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/wagon-file-1.0-beta-6.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/aether-connector-wagon-1.7.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/wagon-ahc-1.0.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/wagon-provider-api-1.0-beta-6.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/plexus-utils-2.0.4.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/plexus-build-api-0.0.6.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/async-http-client-1.3.4.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/netty-3.2.3.Final.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/aether-connector-http-1.7.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/aether-api-1.7.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/aether-spi-1.7.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/aether-util-1.7.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/javax.inject-1.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/asm-3.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/guice-bean-binders-1.4.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/guice-bean-converters-1.4.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/guice-bean-inject-1.4.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/guice-bean-locators-1.4.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/guice-bean-reflect-1.4.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/guice-bean-scanners-1.4.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/guice-plexus-binders-1.4.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/plexus-component-annotations-1.5.5.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/guice-plexus-converters-1.4.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/guice-plexus-locators-1.4.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/plexus-classworlds-2.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/guice-plexus-metadata-1.4.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/guice-plexus-scanners-1.4.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/guice-plexus-shim-1.4.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="jars/sisu-guice-2.1.7-noaop.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.m2e.maven.runtime/.gitignore b/org.eclipse.m2e.maven.runtime/.gitignore
new file mode 100644
index 00000000..ea8c4bf7
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/org.eclipse.m2e.maven.runtime/.project b/org.eclipse.m2e.maven.runtime/.project
new file mode 100644
index 00000000..e60ea867
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.maven.runtime</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.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.maven.runtime/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.maven.runtime/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..b4fff146
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,9 @@
+#Fri Aug 27 20:06:11 CEST 2010
+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.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/org.eclipse.m2e.maven.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.m2e.maven.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 00000000..2babca24
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Thu Aug 28 19:39:21 EDT 2008
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
diff --git a/org.eclipse.m2e.maven.runtime/.settings/org.eclipse.mylyn.team.ui.prefs b/org.eclipse.m2e.maven.runtime/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 00000000..3f28b9ed
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Thu Aug 28 19:39:21 EDT 2008
+commit.comment.template=${task.key}\: ${task.description}
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.maven.runtime/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.maven.runtime/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..58e131a1
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:17 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.maven.runtime/META-INF/MANIFEST.MF b/org.eclipse.m2e.maven.runtime/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..1e786633
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/META-INF/MANIFEST.MF
@@ -0,0 +1,239 @@
+Manifest-Version: 1.0
+Export-Package: META-INF.plexus,
+ com.google.inject,
+ com.google.inject.binder,
+ com.google.inject.internal,
+ com.google.inject.internal.util,
+ com.google.inject.matcher,
+ com.google.inject.name,
+ com.google.inject.spi,
+ com.google.inject.util,
+ com.ning.http.client,
+ org.apache.maven,
+ org.apache.maven.artifact,
+ org.apache.maven.artifact.deployer,
+ org.apache.maven.artifact.factory,
+ org.apache.maven.artifact.handler,
+ org.apache.maven.artifact.handler.manager,
+ org.apache.maven.artifact.installer,
+ org.apache.maven.artifact.manager,
+ org.apache.maven.artifact.metadata,
+ org.apache.maven.artifact.repository,
+ org.apache.maven.artifact.repository.layout,
+ org.apache.maven.artifact.repository.metadata,
+ org.apache.maven.artifact.repository.metadata.io,
+ org.apache.maven.artifact.repository.metadata.io.xpp3,
+ org.apache.maven.artifact.resolver,
+ org.apache.maven.artifact.resolver.filter,
+ org.apache.maven.artifact.versioning,
+ org.apache.maven.classrealm,
+ org.apache.maven.cli,
+ org.apache.maven.configuration,
+ org.apache.maven.configuration.internal,
+ org.apache.maven.exception,
+ org.apache.maven.execution,
+ org.apache.maven.lifecycle,
+ org.apache.maven.lifecycle.internal,
+ org.apache.maven.lifecycle.mapping,
+ org.apache.maven.messages,
+ org.apache.maven.model,
+ org.apache.maven.model.building,
+ org.apache.maven.model.composition,
+ org.apache.maven.model.inheritance,
+ org.apache.maven.model.interpolation,
+ org.apache.maven.model.io,
+ org.apache.maven.model.io.xpp3,
+ org.apache.maven.model.locator,
+ org.apache.maven.model.management,
+ org.apache.maven.model.merge,
+ org.apache.maven.model.normalization,
+ org.apache.maven.model.path,
+ org.apache.maven.model.plugin,
+ org.apache.maven.model.profile,
+ org.apache.maven.model.profile.activation,
+ org.apache.maven.model.resolution,
+ org.apache.maven.model.superpom,
+ org.apache.maven.model.validation,
+ org.apache.maven.monitor.event,
+ org.apache.maven.monitor.logging,
+ org.apache.maven.plugin,
+ org.apache.maven.plugin.descriptor,
+ org.apache.maven.plugin.internal,
+ org.apache.maven.plugin.lifecycle,
+ org.apache.maven.plugin.lifecycle.io.xpp3,
+ org.apache.maven.plugin.logging,
+ org.apache.maven.plugin.prefix,
+ org.apache.maven.plugin.prefix.internal,
+ org.apache.maven.plugin.version,
+ org.apache.maven.plugin.version.internal,
+ org.apache.maven.profiles,
+ org.apache.maven.profiles.activation,
+ org.apache.maven.profiles.io.xpp3,
+ org.apache.maven.project,
+ org.apache.maven.project.artifact,
+ org.apache.maven.project.inheritance,
+ org.apache.maven.project.interpolation,
+ org.apache.maven.project.path,
+ org.apache.maven.project.validation,
+ org.apache.maven.properties.internal,
+ org.apache.maven.reporting,
+ org.apache.maven.repository,
+ org.apache.maven.repository.internal,
+ org.apache.maven.repository.legacy,
+ org.apache.maven.repository.legacy.metadata,
+ org.apache.maven.repository.legacy.repository,
+ org.apache.maven.repository.legacy.resolver,
+ org.apache.maven.repository.legacy.resolver.conflict,
+ org.apache.maven.repository.legacy.resolver.transform,
+ org.apache.maven.repository.metadata,
+ org.apache.maven.settings,
+ org.apache.maven.settings.building,
+ org.apache.maven.settings.crypto,
+ org.apache.maven.settings.io,
+ org.apache.maven.settings.io.xpp3,
+ org.apache.maven.settings.merge,
+ org.apache.maven.settings.validation,
+ org.apache.maven.toolchain,
+ org.apache.maven.toolchain.java,
+ org.apache.maven.toolchain.model,
+ org.apache.maven.toolchain.model.io.xpp3,
+ org.apache.maven.usability.plugin,
+ org.apache.maven.usability.plugin.io.xpp3,
+ org.apache.maven.wagon,
+ org.apache.maven.wagon.authentication,
+ org.apache.maven.wagon.authorization,
+ org.apache.maven.wagon.events,
+ org.apache.maven.wagon.observers,
+ org.apache.maven.wagon.providers.file,
+ org.apache.maven.wagon.proxy,
+ org.apache.maven.wagon.repository,
+ org.apache.maven.wagon.resource,
+ org.codehaus.plexus,
+ org.codehaus.plexus.classworlds,
+ org.codehaus.plexus.classworlds.launcher,
+ org.codehaus.plexus.classworlds.realm,
+ org.codehaus.plexus.classworlds.strategy,
+ org.codehaus.plexus.component,
+ org.codehaus.plexus.component.annotations,
+ org.codehaus.plexus.component.composition,
+ org.codehaus.plexus.component.configurator,
+ org.codehaus.plexus.component.configurator.converters,
+ org.codehaus.plexus.component.configurator.converters.basic,
+ org.codehaus.plexus.component.configurator.converters.composite,
+ org.codehaus.plexus.component.configurator.converters.lookup,
+ org.codehaus.plexus.component.configurator.converters.special,
+ org.codehaus.plexus.component.configurator.expression,
+ org.codehaus.plexus.component.factory,
+ org.codehaus.plexus.component.repository,
+ org.codehaus.plexus.component.repository.exception,
+ org.codehaus.plexus.configuration,
+ org.codehaus.plexus.configuration.xml,
+ org.codehaus.plexus.context,
+ org.codehaus.plexus.interpolation,
+ org.codehaus.plexus.interpolation.multi,
+ org.codehaus.plexus.interpolation.object,
+ org.codehaus.plexus.interpolation.os,
+ org.codehaus.plexus.interpolation.reflection,
+ org.codehaus.plexus.interpolation.util,
+ org.codehaus.plexus.logging,
+ org.codehaus.plexus.logging.console,
+ org.codehaus.plexus.personality.plexus.lifecycle.phase,
+ org.codehaus.plexus.util,
+ org.codehaus.plexus.util.cli,
+ org.codehaus.plexus.util.cli.shell,
+ org.codehaus.plexus.util.dag,
+ org.codehaus.plexus.util.introspection,
+ org.codehaus.plexus.util.io,
+ org.codehaus.plexus.util.reflection,
+ org.codehaus.plexus.util.xml,
+ org.codehaus.plexus.util.xml.pull,
+ org.sonatype.aether,
+ org.sonatype.aether.artifact,
+ org.sonatype.aether.collection,
+ org.sonatype.aether.connector.async,
+ org.sonatype.aether.connector.wagon,
+ org.sonatype.aether.deployment,
+ org.sonatype.aether.graph,
+ org.sonatype.aether.impl,
+ org.sonatype.aether.impl.internal,
+ org.sonatype.aether.installation,
+ org.sonatype.aether.metadata,
+ org.sonatype.aether.repository,
+ org.sonatype.aether.resolution,
+ org.sonatype.aether.spi.connector,
+ org.sonatype.aether.spi.io,
+ org.sonatype.aether.spi.locator,
+ org.sonatype.aether.spi.log,
+ org.sonatype.aether.transfer,
+ org.sonatype.aether.util,
+ org.sonatype.aether.util.artifact,
+ org.sonatype.aether.util.filter,
+ org.sonatype.aether.util.graph,
+ org.sonatype.aether.util.graph.manager,
+ org.sonatype.aether.util.graph.selector,
+ org.sonatype.aether.util.graph.transformer,
+ org.sonatype.aether.util.graph.traverser,
+ org.sonatype.aether.util.layout,
+ org.sonatype.aether.util.listener,
+ org.sonatype.aether.util.metadata,
+ org.sonatype.aether.util.repository,
+ org.sonatype.aether.util.version,
+ org.sonatype.aether.version,
+ org.sonatype.plexus.build.incremental,
+ org.sonatype.plexus.components.cipher,
+ org.sonatype.plexus.components.sec.dispatcher,
+ org.sonatype.plexus.components.sec.dispatcher.model,
+ org.sonatype.plexus.components.sec.dispatcher.model.io.xpp3
+Bundle-Vendor: Sonatype
+Bundle-ClassPath: jars/maven-embedder-3.0.jar,
+ jars/maven-settings-3.0.jar,
+ jars/maven-plugin-api-3.0.jar,
+ jars/maven-model-builder-3.0.jar,
+ jars/plexus-sec-dispatcher-1.3.jar,
+ jars/plexus-cipher-1.4.jar,
+ jars/maven-core-3.0.jar,
+ jars/maven-model-3.0.jar,
+ jars/maven-settings-builder-3.0.jar,
+ jars/maven-repository-metadata-3.0.jar,
+ jars/maven-artifact-3.0.jar,
+ jars/maven-aether-provider-3.0.jar,
+ jars/aether-impl-1.7.jar,
+ jars/plexus-interpolation-1.14.jar,
+ jars/maven-compat-3.0.jar,
+ jars/commons-cli-1.2.jar,
+ jars/wagon-file-1.0-beta-6.jar,
+ jars/aether-connector-wagon-1.7.jar,
+ jars/wagon-ahc-1.0.0.jar,
+ jars/wagon-provider-api-1.0-beta-6.jar,
+ jars/plexus-utils-2.0.4.jar,
+ jars/plexus-build-api-0.0.6.jar,
+ jars/async-http-client-1.3.4.jar,
+ jars/netty-3.2.3.Final.jar,
+ jars/aether-connector-http-1.7.0.jar,
+ jars/aether-api-1.7.jar,
+ jars/aether-spi-1.7.jar,
+ jars/aether-util-1.7.jar,
+ jars/javax.inject-1.jar,
+ jars/asm-3.2.jar,
+ jars/guice-bean-binders-1.4.2.jar,
+ jars/guice-bean-converters-1.4.2.jar,
+ jars/guice-bean-inject-1.4.2.jar,
+ jars/guice-bean-locators-1.4.2.jar,
+ jars/guice-bean-reflect-1.4.2.jar,
+ jars/guice-bean-scanners-1.4.2.jar,
+ jars/guice-plexus-binders-1.4.2.jar,
+ jars/plexus-component-annotations-1.5.5.jar,
+ jars/guice-plexus-converters-1.4.2.jar,
+ jars/guice-plexus-locators-1.4.2.jar,
+ jars/plexus-classworlds-2.3.jar,
+ jars/guice-plexus-metadata-1.4.2.jar,
+ jars/guice-plexus-scanners-1.4.2.jar,
+ jars/guice-plexus-shim-1.4.2.jar,
+ jars/sisu-guice-2.1.7-noaop.jar
+Bundle-Version: 0.13.0.qualifier
+Bundle-Name: Maven Embedder Bundle
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.m2e.maven.runtime;singleton:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6
+
diff --git a/org.eclipse.m2e.maven.runtime/META-INF/plexus/.gitignore b/org.eclipse.m2e.maven.runtime/META-INF/plexus/.gitignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/META-INF/plexus/.gitignore
diff --git a/org.eclipse.m2e.maven.runtime/build.properties b/org.eclipse.m2e.maven.runtime/build.properties
new file mode 100644
index 00000000..c41c5b4e
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/build.properties
@@ -0,0 +1,13 @@
+#
+# Copyright (c) 2008-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
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
+bin.includes = META-INF/,\
+ jars/
diff --git a/org.eclipse.m2e.maven.runtime/jars/aether-api-1.7.jar b/org.eclipse.m2e.maven.runtime/jars/aether-api-1.7.jar
new file mode 100644
index 00000000..04addb15
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/aether-api-1.7.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/aether-connector-http-1.7.0.jar b/org.eclipse.m2e.maven.runtime/jars/aether-connector-http-1.7.0.jar
new file mode 100644
index 00000000..17ffffe7
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/aether-connector-http-1.7.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/aether-connector-wagon-1.7.jar b/org.eclipse.m2e.maven.runtime/jars/aether-connector-wagon-1.7.jar
new file mode 100644
index 00000000..05770388
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/aether-connector-wagon-1.7.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/aether-impl-1.7.jar b/org.eclipse.m2e.maven.runtime/jars/aether-impl-1.7.jar
new file mode 100644
index 00000000..c96139d1
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/aether-impl-1.7.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/aether-spi-1.7.jar b/org.eclipse.m2e.maven.runtime/jars/aether-spi-1.7.jar
new file mode 100644
index 00000000..5e293cd4
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/aether-spi-1.7.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/aether-util-1.7.jar b/org.eclipse.m2e.maven.runtime/jars/aether-util-1.7.jar
new file mode 100644
index 00000000..033c40fa
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/aether-util-1.7.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/asm-3.2.jar b/org.eclipse.m2e.maven.runtime/jars/asm-3.2.jar
new file mode 100644
index 00000000..ca9f8d28
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/asm-3.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/async-http-client-1.3.4.jar b/org.eclipse.m2e.maven.runtime/jars/async-http-client-1.3.4.jar
new file mode 100644
index 00000000..61d77263
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/async-http-client-1.3.4.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/commons-cli-1.2.jar b/org.eclipse.m2e.maven.runtime/jars/commons-cli-1.2.jar
new file mode 100644
index 00000000..ce4b9fff
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/commons-cli-1.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/guice-bean-binders-1.4.2.jar b/org.eclipse.m2e.maven.runtime/jars/guice-bean-binders-1.4.2.jar
new file mode 100644
index 00000000..66be3622
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/guice-bean-binders-1.4.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/guice-bean-converters-1.4.2.jar b/org.eclipse.m2e.maven.runtime/jars/guice-bean-converters-1.4.2.jar
new file mode 100644
index 00000000..ff171dbb
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/guice-bean-converters-1.4.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/guice-bean-inject-1.4.2.jar b/org.eclipse.m2e.maven.runtime/jars/guice-bean-inject-1.4.2.jar
new file mode 100644
index 00000000..a9e4b9d7
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/guice-bean-inject-1.4.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/guice-bean-locators-1.4.2.jar b/org.eclipse.m2e.maven.runtime/jars/guice-bean-locators-1.4.2.jar
new file mode 100644
index 00000000..be857a01
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/guice-bean-locators-1.4.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/guice-bean-reflect-1.4.2.jar b/org.eclipse.m2e.maven.runtime/jars/guice-bean-reflect-1.4.2.jar
new file mode 100644
index 00000000..0a0db76d
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/guice-bean-reflect-1.4.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/guice-bean-scanners-1.4.2.jar b/org.eclipse.m2e.maven.runtime/jars/guice-bean-scanners-1.4.2.jar
new file mode 100644
index 00000000..c11f2b21
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/guice-bean-scanners-1.4.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/guice-plexus-binders-1.4.2.jar b/org.eclipse.m2e.maven.runtime/jars/guice-plexus-binders-1.4.2.jar
new file mode 100644
index 00000000..ba346d2d
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/guice-plexus-binders-1.4.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/guice-plexus-converters-1.4.2.jar b/org.eclipse.m2e.maven.runtime/jars/guice-plexus-converters-1.4.2.jar
new file mode 100644
index 00000000..f46e9061
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/guice-plexus-converters-1.4.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/guice-plexus-locators-1.4.2.jar b/org.eclipse.m2e.maven.runtime/jars/guice-plexus-locators-1.4.2.jar
new file mode 100644
index 00000000..6af041c6
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/guice-plexus-locators-1.4.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/guice-plexus-metadata-1.4.2.jar b/org.eclipse.m2e.maven.runtime/jars/guice-plexus-metadata-1.4.2.jar
new file mode 100644
index 00000000..b2ed74eb
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/guice-plexus-metadata-1.4.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/guice-plexus-scanners-1.4.2.jar b/org.eclipse.m2e.maven.runtime/jars/guice-plexus-scanners-1.4.2.jar
new file mode 100644
index 00000000..d38d109a
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/guice-plexus-scanners-1.4.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/guice-plexus-shim-1.4.2.jar b/org.eclipse.m2e.maven.runtime/jars/guice-plexus-shim-1.4.2.jar
new file mode 100644
index 00000000..faaebe7d
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/guice-plexus-shim-1.4.2.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/javax.inject-1.jar b/org.eclipse.m2e.maven.runtime/jars/javax.inject-1.jar
new file mode 100644
index 00000000..b2a9d0bf
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/javax.inject-1.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/maven-aether-provider-3.0.jar b/org.eclipse.m2e.maven.runtime/jars/maven-aether-provider-3.0.jar
new file mode 100644
index 00000000..adb55ec7
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/maven-aether-provider-3.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/maven-artifact-3.0.jar b/org.eclipse.m2e.maven.runtime/jars/maven-artifact-3.0.jar
new file mode 100644
index 00000000..824aec54
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/maven-artifact-3.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/maven-compat-3.0.jar b/org.eclipse.m2e.maven.runtime/jars/maven-compat-3.0.jar
new file mode 100644
index 00000000..29c4db13
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/maven-compat-3.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/maven-core-3.0.jar b/org.eclipse.m2e.maven.runtime/jars/maven-core-3.0.jar
new file mode 100644
index 00000000..9698cdd0
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/maven-core-3.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/maven-embedder-3.0.jar b/org.eclipse.m2e.maven.runtime/jars/maven-embedder-3.0.jar
new file mode 100644
index 00000000..75b4fe6c
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/maven-embedder-3.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/maven-model-3.0.jar b/org.eclipse.m2e.maven.runtime/jars/maven-model-3.0.jar
new file mode 100644
index 00000000..79936996
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/maven-model-3.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/maven-model-builder-3.0.jar b/org.eclipse.m2e.maven.runtime/jars/maven-model-builder-3.0.jar
new file mode 100644
index 00000000..ea9a50fb
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/maven-model-builder-3.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/maven-plugin-api-3.0.jar b/org.eclipse.m2e.maven.runtime/jars/maven-plugin-api-3.0.jar
new file mode 100644
index 00000000..bbb4f008
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/maven-plugin-api-3.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/maven-repository-metadata-3.0.jar b/org.eclipse.m2e.maven.runtime/jars/maven-repository-metadata-3.0.jar
new file mode 100644
index 00000000..f28813cf
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/maven-repository-metadata-3.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/maven-settings-3.0.jar b/org.eclipse.m2e.maven.runtime/jars/maven-settings-3.0.jar
new file mode 100644
index 00000000..6b8f98fb
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/maven-settings-3.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/maven-settings-builder-3.0.jar b/org.eclipse.m2e.maven.runtime/jars/maven-settings-builder-3.0.jar
new file mode 100644
index 00000000..daffe290
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/maven-settings-builder-3.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/netty-3.2.3.Final.jar b/org.eclipse.m2e.maven.runtime/jars/netty-3.2.3.Final.jar
new file mode 100644
index 00000000..7672fcd8
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/netty-3.2.3.Final.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/plexus-build-api-0.0.6.jar b/org.eclipse.m2e.maven.runtime/jars/plexus-build-api-0.0.6.jar
new file mode 100644
index 00000000..ab7f3fe1
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/plexus-build-api-0.0.6.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/plexus-cipher-1.4.jar b/org.eclipse.m2e.maven.runtime/jars/plexus-cipher-1.4.jar
new file mode 100644
index 00000000..9227205c
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/plexus-cipher-1.4.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/plexus-classworlds-2.3.jar b/org.eclipse.m2e.maven.runtime/jars/plexus-classworlds-2.3.jar
new file mode 100644
index 00000000..7c654105
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/plexus-classworlds-2.3.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/plexus-component-annotations-1.5.5.jar b/org.eclipse.m2e.maven.runtime/jars/plexus-component-annotations-1.5.5.jar
new file mode 100644
index 00000000..e4de16fe
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/plexus-component-annotations-1.5.5.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/plexus-interpolation-1.14.jar b/org.eclipse.m2e.maven.runtime/jars/plexus-interpolation-1.14.jar
new file mode 100644
index 00000000..eee5c573
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/plexus-interpolation-1.14.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/plexus-sec-dispatcher-1.3.jar b/org.eclipse.m2e.maven.runtime/jars/plexus-sec-dispatcher-1.3.jar
new file mode 100644
index 00000000..9dc9f64b
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/plexus-sec-dispatcher-1.3.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/plexus-utils-2.0.4.jar b/org.eclipse.m2e.maven.runtime/jars/plexus-utils-2.0.4.jar
new file mode 100644
index 00000000..2a6972cc
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/plexus-utils-2.0.4.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/sisu-guice-2.1.7-noaop.jar b/org.eclipse.m2e.maven.runtime/jars/sisu-guice-2.1.7-noaop.jar
new file mode 100644
index 00000000..aa668444
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/sisu-guice-2.1.7-noaop.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/wagon-ahc-1.0.0.jar b/org.eclipse.m2e.maven.runtime/jars/wagon-ahc-1.0.0.jar
new file mode 100644
index 00000000..215ae097
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/wagon-ahc-1.0.0.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/wagon-file-1.0-beta-6.jar b/org.eclipse.m2e.maven.runtime/jars/wagon-file-1.0-beta-6.jar
new file mode 100644
index 00000000..12c554e5
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/wagon-file-1.0-beta-6.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/jars/wagon-provider-api-1.0-beta-6.jar b/org.eclipse.m2e.maven.runtime/jars/wagon-provider-api-1.0-beta-6.jar
new file mode 100644
index 00000000..b0dfde6a
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/jars/wagon-provider-api-1.0-beta-6.jar
Binary files differ
diff --git a/org.eclipse.m2e.maven.runtime/pom.xml b/org.eclipse.m2e.maven.runtime/pom.xml
new file mode 100644
index 00000000..98089b2e
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/pom.xml
@@ -0,0 +1,24 @@
+<?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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.maven.runtime</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <name>Embedded Maven Runtime Bundle</name>
+
+</project>
diff --git a/org.eclipse.m2e.maven.runtime/update-jars-pom.xml b/org.eclipse.m2e.maven.runtime/update-jars-pom.xml
new file mode 100644
index 00000000..5b2f7884
--- /dev/null
+++ b/org.eclipse.m2e.maven.runtime/update-jars-pom.xml
@@ -0,0 +1,218 @@
+<?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>
+
+ <!--
+ To include new embedded runtime,
+
+ * update <maven.version/> and related properties
+ * run the command below from CLI
+ * right-click on the project in Eclipse, PDE->Update Classpath
+ * project->clean...->all
+
+ rm -f jars/*; /opt/maven/bin/mvn -e -f update-jars-pom.xml process-classes
+ -->
+
+ <properties>
+ <!-- maven core version -->
+ <maven.version>3.0.1-RC1</maven.version>
+
+ <!-- the following MUST match <maven.version/> above. I wish I could make scope=import do this for me -->
+ <sisu.version>1.4.3.1</sisu.version>
+ <classworlds.version>2.4</classworlds.version>
+ <aether.version>1.8</aether.version>
+ <sisu-guice.version>2.9.1</sisu-guice.version>
+
+ <!-- below are m2e-specific addons -->
+ <plexus-build-api.version>0.0.6</plexus-build-api.version>
+ <wagon-ahc.version>1.0.0</wagon-ahc.version>
+ </properties>
+
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.maven.runtime</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <name>Embedded Maven Runtime Bundle</name>
+ <organization>
+ <name>Eclipse.org</name>
+ <url>www.eclipse.org</url>
+ </organization>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>apache-maven</artifactId>
+ <version>${maven.version}</version>
+ <classifier>bin</classifier>
+ <type>tar.gz</type>
+ <exclusions>
+ <exclusion>
+ <artifactId>wagon-http-lightweight</artifactId>
+ <groupId>org.apache.maven.wagon</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>sisu-inject-plexus</artifactId>
+ <groupId>org.sonatype.sisu</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.sonatype.sisu.inject</groupId>
+ <artifactId>guice-bean-binders</artifactId>
+ <version>${sisu.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.sisu.inject</groupId>
+ <artifactId>guice-bean-inject</artifactId>
+ <version>${sisu.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.sonatype.sisu.inject</groupId>
+ <artifactId>guice-plexus-binders</artifactId>
+ <version>${sisu.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.sisu.inject</groupId>
+ <artifactId>guice-plexus-converters</artifactId>
+ <version>${sisu.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.sisu.inject</groupId>
+ <artifactId>guice-plexus-locators</artifactId>
+ <version>${sisu.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.sisu.inject</groupId>
+ <artifactId>guice-plexus-shim</artifactId>
+ <version>${sisu.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.sonatype.sisu</groupId>
+ <artifactId>sisu-guice</artifactId>
+ <version>${sisu-guice.version}</version>
+ <classifier>noaop</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>org.sonatype.plexus</groupId>
+ <artifactId>plexus-build-api</artifactId>
+ <version>${plexus-build-api.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-connector-asynchttpclient</artifactId>
+ <version>${aether.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.maven</groupId>
+ <artifactId>wagon-ahc</artifactId>
+ <version>${wagon-ahc.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven</artifactId>
+ <version>${maven.version}</version>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-classworlds</artifactId>
+ <version>${classworlds.version}</version>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-packaging-plugin</artifactId>
+ <version>0.11.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>generate-bundle</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <packageSources>false</packageSources>
+ <exportPackages>
+ org.apache.maven.*,
+ org.codehaus.plexus.*,
+ org.sonatype.plexus.*,
+ org.sonatype.aether.*,
+ com.google.inject.*,
+ com.ning.http.client,
+ META-INF.plexus,
+ </exportPackages>
+ <manifestAttributes>
+ <Bundle-RequiredExecutionEnvironment>J2SE-1.5, JavaSE-1.6</Bundle-RequiredExecutionEnvironment>
+ </manifestAttributes>
+
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>apache-maven</artifactId>
+ <classifier>bin</classifier>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>aopalliance</groupId>
+ <artifactId>aopalliance</artifactId>
+ </exclusion>
+ <exclusion>
+ <artifactId>sisu-guice</artifactId>
+ <groupId>org.sonatype.sisu</groupId>
+ </exclusion>
+ </exclusions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>m2e</id>
+ <activation>
+ <property>
+ <name>m2e.version</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.maven.ide.eclipse</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>0.10.0</version>
+ <configuration>
+ <mappingId>customizable</mappingId>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git a/org.eclipse.m2e.model.edit/.classpath b/org.eclipse.m2e.model.edit/.classpath
new file mode 100644
index 00000000..9722f202
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/.classpath
@@ -0,0 +1,8 @@
+<?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/main/java/"/>
+ <classpathentry kind="src" path="src/main/xsd/"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.m2e.model.edit/.gitignore b/org.eclipse.m2e.model.edit/.gitignore
new file mode 100644
index 00000000..4dc00917
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/.gitignore
@@ -0,0 +1,2 @@
+/target
+/bin
diff --git a/org.eclipse.m2e.model.edit/.project b/org.eclipse.m2e.model.edit/.project
new file mode 100644
index 00000000..d7b32353
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.model.edit</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.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.model.edit/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.model.edit/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..9340da8b
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,337 @@
+#Thu Feb 04 10:56:12 EST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=2
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=1
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=2
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
diff --git a/org.eclipse.m2e.model.edit/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.m2e.model.edit/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000..760d135c
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,10 @@
+#Tue Nov 30 18:52:40 EST 2010
+eclipse.preferences.version=1
+formatter_profile=_m2 plugin
+formatter_settings_version=11
+org.eclipse.jdt.ui.exception.name=ex
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.overrideannotation=false
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\n * Copyright (c) 2010 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 *******************************************************************************/</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/org.eclipse.m2e.model.edit/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.m2e.model.edit/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 00000000..d78e0f5a
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Thu Aug 28 19:39:29 EDT 2008
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
diff --git a/org.eclipse.m2e.model.edit/.settings/org.eclipse.mylyn.team.ui.prefs b/org.eclipse.m2e.model.edit/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 00000000..f9c8c53c
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Thu Aug 28 19:39:29 EDT 2008
+commit.comment.template=${task.key}\: ${task.description}
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.model.edit/.settings/org.eclipse.pde.prefs b/org.eclipse.m2e.model.edit/.settings/org.eclipse.pde.prefs
new file mode 100644
index 00000000..ea5ef56d
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,22 @@
+#Thu Aug 28 19:44:35 EDT 2008
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.deprecated=2
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=2
+compilers.p.no-required-att=1
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=1
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.model.edit/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.model.edit/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..58e131a1
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:17 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.model.edit/META-INF/MANIFEST.MF b/org.eclipse.m2e.model.edit/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..28095003
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-Name: %Bundle-Name
+Bundle-RequiredExecutionEnvironment: J2SE-1.5, JavaSE-1.6
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Version: 0.13.0.qualifier
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.m2e.model.edit;singleton:=true
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.emf.ecore.xmi;visibility:=reexport,
+ org.eclipse.emf.edit;visibility:=reexport,
+ org.eclipse.emf.ecore.edit;visibility:=reexport,
+ org.eclipse.wst.common.emf;visibility:=reexport,
+ org.eclipse.wst.sse.core;visibility:=reexport,
+ org.eclipse.wst.xml.core;visibility:=reexport,
+ org.eclipse.wst.xsd.core;visibility:=reexport,
+ org.eclipse.jem.util;visibility:=reexport,
+ com.ibm.icu;bundle-version="4.0.1"
+Eclipse-LazyStart: true
+Export-Package: org.eclipse.m2e.model.edit.pom,
+ org.eclipse.m2e.model.edit.pom.impl,
+ org.eclipse.m2e.model.edit.pom.provider,
+ org.eclipse.m2e.model.edit.pom.util
+Bundle-ClassPath: .
diff --git a/org.eclipse.m2e.model.edit/OSGI-INF/l10n/bundle.properties b/org.eclipse.m2e.model.edit/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000..36d31208
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.m2e.model.edit
+Bundle-Vendor = Eclipse m2e
+Bundle-Name = Maven Project Model Edit Bundle \ No newline at end of file
diff --git a/org.eclipse.m2e.model.edit/about.html b/org.eclipse.m2e.model.edit/about.html
new file mode 100644
index 00000000..70e4b67c
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>October 29, 2010</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/org.eclipse.m2e.model.edit/build.properties b/org.eclipse.m2e.model.edit/build.properties
new file mode 100644
index 00000000..a096fe82
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/build.properties
@@ -0,0 +1,28 @@
+#
+# Copyright (c) 2008-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
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
+
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+bin.includes = .,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties,\
+ xsd/,\
+ about.html,\
+ OSGI-INF/l10n/bundle.properties
+jars.compile.order = .
+source.. = src/main/java/,\
+ src/main/xsd/
+output.. = target/classes/
diff --git a/org.eclipse.m2e.model.edit/icons/full/obj16/PropertyPair.gif b/org.eclipse.m2e.model.edit/icons/full/obj16/PropertyPair.gif
new file mode 100644
index 00000000..1e5345fb
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/icons/full/obj16/PropertyPair.gif
Binary files differ
diff --git a/org.eclipse.m2e.model.edit/plugin.properties b/org.eclipse.m2e.model.edit/plugin.properties
new file mode 100644
index 00000000..bf6d0f47
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/plugin.properties
@@ -0,0 +1,348 @@
+# <copyright>
+# Copyright (c) 2009 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
+# </copyright>
+
+# ====================================================================
+# To code developer:
+# Do NOT change the properties between this line and the
+# "%%% END OF TRANSLATED PROPERTIES %%%" line.
+# Make a new property name, append to the end of the file and change
+# the code to use the new property.
+# ====================================================================
+
+# ====================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# ====================================================================
+
+pluginName = Pom Model
+providerName = www.example.org
+_UI_CreateChild_text = {0}
+_UI_CreateChild_text2 = {1} {0}
+_UI_CreateChild_text3 = {1}
+_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
+_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
+_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
+
+_UI_PropertyDescriptor_description = The {0} of the {1}
+
+_UI_Activation_type = Activation
+_UI_ActivationFile_type = Activation File
+_UI_ActivationOS_type = Activation OS
+_UI_ActivationProperty_type = Activation Property
+_UI_Build_type = Build
+_UI_BuildBase_type = Build Base
+_UI_CiManagement_type = Ci Management
+_UI_Configuration_type = Configuration
+_UI_Contributor_type = Contributor
+_UI_ContributorsType_type = Contributors Type
+_UI_Dependencies_type = Dependencies
+_UI_Dependency_type = Dependency
+_UI_DependencyManagement_type = Dependency Management
+_UI_DeploymentRepository_type = Deployment Repository
+_UI_Developer_type = Developer
+_UI_DevelopersType_type = Developers Type
+_UI_DistributionManagement_type = Distribution Management
+_UI_DocumentRoot_type = Document Root
+_UI_ExcludesType_type = Excludes Type
+_UI_Exclusion_type = Exclusion
+_UI_ExclusionsType_type = Exclusions Type
+_UI_ExecutionsType_type = Executions Type
+_UI_Extension_type = Extension
+_UI_ExtensionsType_type = Extensions Type
+_UI_Filters_type = Filters
+_UI_Goals_type = Goals
+_UI_IncludesType_type = Includes Type
+_UI_IssueManagement_type = Issue Management
+_UI_License_type = License
+_UI_LicensesType_type = Licenses Type
+_UI_MailingList_type = Mailing List
+_UI_MailingListsType_type = Mailing Lists Type
+_UI_Model_type = Model
+_UI_Modules_type = Modules
+_UI_Notifier_type = Notifier
+_UI_NotifiersType_type = Notifiers Type
+_UI_Organization_type = Organization
+_UI_OtherArchivesType_type = Other Archives Type
+_UI_Parent_type = Parent
+_UI_Plugin_type = Plugin
+_UI_PluginExecution_type = Plugin Execution
+_UI_PluginManagement_type = Plugin Management
+_UI_PluginRepositories_type = Plugin Repositories
+_UI_Plugins_type = Plugins
+_UI_Prerequisites_type = Prerequisites
+_UI_Profile_type = Profile
+_UI_ProfilesType_type = Profiles Type
+_UI_Properties_type = Properties
+_UI_Relocation_type = Relocation
+_UI_Reporting_type = Reporting
+_UI_ReportPlugin_type = Report Plugin
+_UI_ReportPlugins_type = Report Plugins
+_UI_Reports_type = Reports
+_UI_ReportSet_type = Report Set
+_UI_ReportSetsType_type = Report Sets Type
+_UI_Repositories_type = Repositories
+_UI_Repository_type = Repository
+_UI_RepositoryPolicy_type = Repository Policy
+_UI_Resource_type = Resource
+_UI_Resources_type = Resources
+_UI_Roles_type = Roles
+_UI_Scm_type = Scm
+_UI_Site_type = Site
+_UI_StringGoals_type = String Goals
+_UI_StringModules_type = String Modules
+_UI_StringReports_type = String Reports
+_UI_TestResources_type = Test Resources
+_UI_Unknown_type = Object
+
+_UI_Unknown_datatype= Value
+
+_UI_Activation_activeByDefault_feature = Active By Default
+_UI_Activation_jdk_feature = Jdk
+_UI_Activation_os_feature = Os
+_UI_Activation_property_feature = Property
+_UI_Activation_file_feature = File
+_UI_ActivationFile_missing_feature = Missing
+_UI_ActivationFile_exists_feature = Exists
+_UI_ActivationOS_name_feature = Name
+_UI_ActivationOS_family_feature = Family
+_UI_ActivationOS_arch_feature = Arch
+_UI_ActivationOS_version_feature = Version
+_UI_ActivationProperty_name_feature = Name
+_UI_ActivationProperty_value_feature = Value
+_UI_Build_sourceDirectory_feature = Source Directory
+_UI_Build_scriptSourceDirectory_feature = Script Source Directory
+_UI_Build_testSourceDirectory_feature = Test Source Directory
+_UI_Build_outputDirectory_feature = Output Directory
+_UI_Build_testOutputDirectory_feature = Test Output Directory
+_UI_Build_extensions_feature = Extensions
+_UI_Build_defaultGoal_feature = Default Goal
+_UI_Build_resources_feature = Resources
+_UI_Build_testResources_feature = Test Resources
+_UI_Build_directory_feature = Directory
+_UI_Build_finalName_feature = Final Name
+_UI_Build_filters_feature = Filters
+_UI_Build_pluginManagement_feature = Plugin Management
+_UI_Build_plugins_feature = Plugins
+_UI_BuildBase_defaultGoal_feature = Default Goal
+_UI_BuildBase_resources_feature = Resources
+_UI_BuildBase_testResources_feature = Test Resources
+_UI_BuildBase_directory_feature = Directory
+_UI_BuildBase_finalName_feature = Final Name
+_UI_BuildBase_filters_feature = Filters
+_UI_BuildBase_pluginManagement_feature = Plugin Management
+_UI_BuildBase_plugins_feature = Plugins
+_UI_CiManagement_system_feature = System
+_UI_CiManagement_url_feature = Url
+_UI_CiManagement_notifiers_feature = Notifiers
+_UI_Configuration_any_feature = Any
+_UI_Contributor_name_feature = Name
+_UI_Contributor_email_feature = Email
+_UI_Contributor_url_feature = Url
+_UI_Contributor_organization_feature = Organization
+_UI_Contributor_organizationUrl_feature = Organization Url
+_UI_Contributor_roles_feature = Roles
+_UI_Contributor_timezone_feature = Timezone
+_UI_Contributor_properties_feature = Properties
+_UI_ContributorsType_contributor_feature = Contributor
+_UI_Dependencies_dependency_feature = Dependency
+_UI_Dependency_groupId_feature = Group Id
+_UI_Dependency_artifactId_feature = Artifact Id
+_UI_Dependency_version_feature = Version
+_UI_Dependency_type_feature = Type
+_UI_Dependency_classifier_feature = Classifier
+_UI_Dependency_scope_feature = Scope
+_UI_Dependency_systemPath_feature = System Path
+_UI_Dependency_exclusions_feature = Exclusions
+_UI_Dependency_optional_feature = Optional
+_UI_DependencyManagement_dependencies_feature = Dependencies
+_UI_DeploymentRepository_uniqueVersion_feature = Unique Version
+_UI_DeploymentRepository_id_feature = Id
+_UI_DeploymentRepository_name_feature = Name
+_UI_DeploymentRepository_url_feature = Url
+_UI_DeploymentRepository_layout_feature = Layout
+_UI_Developer_id_feature = Id
+_UI_Developer_name_feature = Name
+_UI_Developer_email_feature = Email
+_UI_Developer_url_feature = Url
+_UI_Developer_organization_feature = Organization
+_UI_Developer_organizationUrl_feature = Organization Url
+_UI_Developer_roles_feature = Roles
+_UI_Developer_timezone_feature = Timezone
+_UI_Developer_properties_feature = Properties
+_UI_DevelopersType_developer_feature = Developer
+_UI_DistributionManagement_repository_feature = Repository
+_UI_DistributionManagement_snapshotRepository_feature = Snapshot Repository
+_UI_DistributionManagement_site_feature = Site
+_UI_DistributionManagement_downloadUrl_feature = Download Url
+_UI_DistributionManagement_relocation_feature = Relocation
+_UI_DistributionManagement_status_feature = Status
+_UI_DocumentRoot_mixed_feature = Mixed
+_UI_DocumentRoot_xMLNSPrefixMap_feature = XMLNS Prefix Map
+_UI_DocumentRoot_xSISchemaLocation_feature = XSI Schema Location
+_UI_DocumentRoot_project_feature = Project
+_UI_ExcludesType_exclude_feature = Exclude
+_UI_Exclusion_artifactId_feature = Artifact Id
+_UI_Exclusion_groupId_feature = Group Id
+_UI_ExclusionsType_exclusion_feature = Exclusion
+_UI_ExecutionsType_execution_feature = Execution
+_UI_Extension_groupId_feature = Group Id
+_UI_Extension_artifactId_feature = Artifact Id
+_UI_Extension_version_feature = Version
+_UI_ExtensionsType_extension_feature = Extension
+_UI_Filters_filter_feature = Filter
+_UI_Goals_any_feature = Any
+_UI_IncludesType_include_feature = Include
+_UI_IssueManagement_system_feature = System
+_UI_IssueManagement_url_feature = Url
+_UI_License_name_feature = Name
+_UI_License_url_feature = Url
+_UI_License_distribution_feature = Distribution
+_UI_License_comments_feature = Comments
+_UI_LicensesType_license_feature = License
+_UI_MailingList_name_feature = Name
+_UI_MailingList_subscribe_feature = Subscribe
+_UI_MailingList_unsubscribe_feature = Unsubscribe
+_UI_MailingList_post_feature = Post
+_UI_MailingList_archive_feature = Archive
+_UI_MailingList_otherArchives_feature = Other Archives
+_UI_MailingListsType_mailingList_feature = Mailing List
+_UI_Model_parent_feature = Parent
+_UI_Model_modelVersion_feature = Model Version
+_UI_Model_groupId_feature = Group Id
+_UI_Model_artifactId_feature = Artifact Id
+_UI_Model_packaging_feature = Packaging
+_UI_Model_name_feature = Name
+_UI_Model_version_feature = Version
+_UI_Model_description_feature = Description
+_UI_Model_url_feature = Url
+_UI_Model_prerequisites_feature = Prerequisites
+_UI_Model_issueManagement_feature = Issue Management
+_UI_Model_ciManagement_feature = Ci Management
+_UI_Model_inceptionYear_feature = Inception Year
+_UI_Model_mailingLists_feature = Mailing Lists
+_UI_Model_developers_feature = Developers
+_UI_Model_contributors_feature = Contributors
+_UI_Model_licenses_feature = Licenses
+_UI_Model_scm_feature = Scm
+_UI_Model_organization_feature = Organization
+_UI_Model_build_feature = Build
+_UI_Model_profiles_feature = Profiles
+_UI_Model_modules_feature = Modules
+_UI_Model_repositories_feature = Repositories
+_UI_Model_pluginRepositories_feature = Plugin Repositories
+_UI_Model_dependencies_feature = Dependencies
+_UI_Model_reports_feature = Reports
+_UI_Model_reporting_feature = Reporting
+_UI_Model_dependencyManagement_feature = Dependency Management
+_UI_Model_distributionManagement_feature = Distribution Management
+_UI_Model_properties_feature = Properties
+_UI_Modules_module_feature = Module
+_UI_Notifier_type_feature = Type
+_UI_Notifier_sendOnError_feature = Send On Error
+_UI_Notifier_sendOnFailure_feature = Send On Failure
+_UI_Notifier_sendOnSuccess_feature = Send On Success
+_UI_Notifier_sendOnWarning_feature = Send On Warning
+_UI_Notifier_address_feature = Address
+_UI_Notifier_configuration_feature = Configuration
+_UI_NotifiersType_notifier_feature = Notifier
+_UI_Organization_name_feature = Name
+_UI_Organization_url_feature = Url
+_UI_OtherArchivesType_otherArchive_feature = Other Archive
+_UI_Parent_artifactId_feature = Artifact Id
+_UI_Parent_groupId_feature = Group Id
+_UI_Parent_version_feature = Version
+_UI_Parent_relativePath_feature = Relative Path
+_UI_Plugin_groupId_feature = Group Id
+_UI_Plugin_artifactId_feature = Artifact Id
+_UI_Plugin_version_feature = Version
+_UI_Plugin_extensions_feature = Extensions
+_UI_Plugin_executions_feature = Executions
+_UI_Plugin_dependencies_feature = Dependencies
+_UI_Plugin_goals_feature = Goals
+_UI_Plugin_inherited_feature = Inherited
+_UI_Plugin_configuration_feature = Configuration
+_UI_PluginExecution_id_feature = Id
+_UI_PluginExecution_phase_feature = Phase
+_UI_PluginExecution_goals_feature = Goals
+_UI_PluginExecution_inherited_feature = Inherited
+_UI_PluginExecution_configuration_feature = Configuration
+_UI_PluginManagement_plugins_feature = Plugins
+_UI_PluginRepositories_pluginRepository_feature = Plugin Repository
+_UI_Plugins_plugin_feature = Plugin
+_UI_Prerequisites_maven_feature = Maven
+_UI_Profile_id_feature = Id
+_UI_Profile_activation_feature = Activation
+_UI_Profile_build_feature = Build
+_UI_Profile_modules_feature = Modules
+_UI_Profile_repositories_feature = Repositories
+_UI_Profile_pluginRepositories_feature = Plugin Repositories
+_UI_Profile_dependencies_feature = Dependencies
+_UI_Profile_reports_feature = Reports
+_UI_Profile_reporting_feature = Reporting
+_UI_Profile_dependencyManagement_feature = Dependency Management
+_UI_Profile_distributionManagement_feature = Distribution Management
+_UI_Profile_properties_feature = Properties
+_UI_ProfilesType_profile_feature = Profile
+_UI_Properties_any_feature = Any
+_UI_Relocation_groupId_feature = Group Id
+_UI_Relocation_artifactId_feature = Artifact Id
+_UI_Relocation_version_feature = Version
+_UI_Relocation_message_feature = Message
+_UI_Reporting_excludeDefaults_feature = Exclude Defaults
+_UI_Reporting_outputDirectory_feature = Output Directory
+_UI_Reporting_plugins_feature = Plugins
+_UI_ReportPlugin_groupId_feature = Group Id
+_UI_ReportPlugin_artifactId_feature = Artifact Id
+_UI_ReportPlugin_version_feature = Version
+_UI_ReportPlugin_inherited_feature = Inherited
+_UI_ReportPlugin_configuration_feature = Configuration
+_UI_ReportPlugin_reportSets_feature = Report Sets
+_UI_ReportPlugins_plugin_feature = Plugin
+_UI_Reports_any_feature = Any
+_UI_ReportSet_id_feature = Id
+_UI_ReportSet_configuration_feature = Configuration
+_UI_ReportSet_inherited_feature = Inherited
+_UI_ReportSet_reports_feature = Reports
+_UI_ReportSetsType_reportSet_feature = Report Set
+_UI_Repositories_repository_feature = Repository
+_UI_Repository_releases_feature = Releases
+_UI_Repository_snapshots_feature = Snapshots
+_UI_Repository_id_feature = Id
+_UI_Repository_name_feature = Name
+_UI_Repository_url_feature = Url
+_UI_Repository_layout_feature = Layout
+_UI_RepositoryPolicy_enabled_feature = Enabled
+_UI_RepositoryPolicy_updatePolicy_feature = Update Policy
+_UI_RepositoryPolicy_checksumPolicy_feature = Checksum Policy
+_UI_Resource_targetPath_feature = Target Path
+_UI_Resource_filtering_feature = Filtering
+_UI_Resource_directory_feature = Directory
+_UI_Resource_includes_feature = Includes
+_UI_Resource_excludes_feature = Excludes
+_UI_Resources_resource_feature = Resource
+_UI_Roles_role_feature = Role
+_UI_Scm_connection_feature = Connection
+_UI_Scm_developerConnection_feature = Developer Connection
+_UI_Scm_tag_feature = Tag
+_UI_Scm_url_feature = Url
+_UI_Site_id_feature = Id
+_UI_Site_name_feature = Name
+_UI_Site_url_feature = Url
+_UI_StringGoals_goal_feature = Goal
+_UI_StringModules_module_feature = Module
+_UI_StringReports_report_feature = Report
+_UI_TestResources_testResource_feature = Test Resource
+_UI_XMLTypeDocumentRoot_comment_feature = Comment
+_UI_XMLTypeDocumentRoot_text_feature = Text
+_UI_XMLTypeDocumentRoot_processingInstruction_feature = Processing Instruction
+_UI_Unknown_feature = Unspecified
+
+
+_UI_PropertyPair_type = Property Pair
+_UI_Properties_property_feature = Property
+_UI_PropertyPair_key_feature = Key
+_UI_PropertyPair_value_feature = Value
diff --git a/org.eclipse.m2e.model.edit/plugin.xml b/org.eclipse.m2e.model.edit/plugin.xml
new file mode 100644
index 00000000..41a2b58f
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/plugin.xml
@@ -0,0 +1,42 @@
+<?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
+-->
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <package uri="http://maven.apache.org/POM/4.0.0"
+ class="org.eclipse.m2e.model.edit.pom.PomPackage"
+ genModel="src/main/xsd/org/apache/maven/pom/pom.genmodel"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.ecore.extension_parser">
+ <parser type="pom"
+ class="org.eclipse.m2e.model.edit.pom.util.PomResourceFactoryImpl"/>
+ </extension>
+
+ <extension point="org.eclipse.wst.xml.core.catalogContributions">
+ <catalogContribution>
+ <system systemId="http://maven.apache.org/maven-v4_0_0.xsd"
+ uri="xsd/maven-v4_0_0.xsd"/>
+ <system systemId="http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ uri="xsd/maven-v4_0_0.xsd"/>
+ <system systemId="http://maven.apache.org/xsd/settings-1.0.0.xsd"
+ uri="xsd/settings-v1_0_0.xsd"/>
+ <system systemId="http://maven.apache.org/xsd/profiles-1.0.0.xsd"
+ uri="xsd/profiles-v1_0_0.xsd"/>
+ <system systemId="http://maven.apache.org/xsd/archetype-1.0.0.xsd"
+ uri="xsd/archetype-1.0.0.xsd"/>
+ <system systemId="http://maven.apache.org/xsd/archetype-catalog-1.0.0.xsd"
+ uri="xsd/archetype-catalog-1.0.0.xsd"/>
+ <system systemId="http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
+ uri="xsd/archetype-descriptor-1.0.0.xsd"/>
+ </catalogContribution>
+ </extension>
+
+</plugin>
diff --git a/org.eclipse.m2e.model.edit/pom.xml b/org.eclipse.m2e.model.edit/pom.xml
new file mode 100644
index 00000000..a57b568c
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/pom.xml
@@ -0,0 +1,35 @@
+<?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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.model.edit</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>Maven Project Model Edit Bundle</name>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>xsd/*</include>
+ </includes>
+ </resource>
+ </resources>
+ </build>
+
+</project>
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Activation.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Activation.java
new file mode 100644
index 00000000..22647170
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Activation.java
@@ -0,0 +1,326 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Activation</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0
+ *
+ * The conditions within the build runtime environment which will trigger the
+ * automatic inclusion of the build profile.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Activation#getActiveByDefault <em>
+ * Active By Default</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Activation#getJdk <em>Jdk</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Activation#getOs <em>Os</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Activation#getProperty <em>Property
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Activation#getFile <em>File</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivation()
+ * @model extendedMetaData="name='Activation' kind='elementOnly'"
+ * @generated
+ */
+public interface Activation extends EObject {
+ /**
+ * Returns the value of the '<em><b>Active By Default</b></em>' attribute.
+ * The default value is <code>"false"</code>. <!-- begin-user-doc --> <!--
+ * end-user-doc --> <!-- begin-model-doc --> 4.0.0 Flag specifying whether
+ * this profile is active by default. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Active By Default</em>' attribute.
+ * @see #isSetActiveByDefault()
+ * @see #unsetActiveByDefault()
+ * @see #setActiveByDefault(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivation_ActiveByDefault()
+ * @model default="false" unsettable="true"
+ * dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='activeByDefault' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getActiveByDefault();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getActiveByDefault
+ * <em>Active By Default</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Active By Default</em>' attribute.
+ * @see #isSetActiveByDefault()
+ * @see #unsetActiveByDefault()
+ * @see #getActiveByDefault()
+ * @generated
+ */
+ void setActiveByDefault(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getActiveByDefault
+ * <em>Active By Default</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetActiveByDefault()
+ * @see #getActiveByDefault()
+ * @see #setActiveByDefault(String)
+ * @generated
+ */
+ void unsetActiveByDefault();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getActiveByDefault
+ * <em>Active By Default</em>}' attribute is set. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Active By Default</em>' attribute
+ * is set.
+ * @see #unsetActiveByDefault()
+ * @see #getActiveByDefault()
+ * @see #setActiveByDefault(String)
+ * @generated
+ */
+ boolean isSetActiveByDefault();
+
+ /**
+ * Returns the value of the '<em><b>Jdk</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Specifies that this profile will be activated when a matching JDK is
+ * detected. For example, &lt;code&gt;1.4&lt;/code&gt; only activates on
+ * JDKs versioned 1.4, while &lt;code&gt;!1.4&lt;/code&gt; matches any JDK
+ * that is not version 1.4.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Jdk</em>' attribute.
+ * @see #setJdk(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivation_Jdk()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='jdk' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getJdk();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getJdk <em>Jdk</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Jdk</em>' attribute.
+ * @see #getJdk()
+ * @generated
+ */
+ void setJdk(String value);
+
+ /**
+ * Returns the value of the '<em><b>Os</b></em>' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Specifies that this profile will be activated when matching operating
+ * system attributes are detected.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Os</em>' containment reference.
+ * @see #isSetOs()
+ * @see #unsetOs()
+ * @see #setOs(ActivationOS)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivation_Os()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='os' namespace='##targetNamespace'"
+ * @generated
+ */
+ ActivationOS getOs();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getOs <em>Os</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Os</em>' containment reference.
+ * @see #isSetOs()
+ * @see #unsetOs()
+ * @see #getOs()
+ * @generated
+ */
+ void setOs(ActivationOS value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getOs <em>Os</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetOs()
+ * @see #getOs()
+ * @see #setOs(ActivationOS)
+ * @generated
+ */
+ void unsetOs();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getOs <em>Os</em>}'
+ * containment reference is set. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return whether the value of the '<em>Os</em>' containment reference is
+ * set.
+ * @see #unsetOs()
+ * @see #getOs()
+ * @see #setOs(ActivationOS)
+ * @generated
+ */
+ boolean isSetOs();
+
+ /**
+ * Returns the value of the '<em><b>Property</b></em>' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0
+ *
+ * Specifies that this profile will be activated when this system property
+ * is specified.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Property</em>' containment reference.
+ * @see #isSetProperty()
+ * @see #unsetProperty()
+ * @see #setProperty(ActivationProperty)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivation_Property()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='property' namespace='##targetNamespace'"
+ * @generated
+ */
+ ActivationProperty getProperty();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getProperty
+ * <em>Property</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Property</em>' containment
+ * reference.
+ * @see #isSetProperty()
+ * @see #unsetProperty()
+ * @see #getProperty()
+ * @generated
+ */
+ void setProperty(ActivationProperty value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getProperty
+ * <em>Property</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetProperty()
+ * @see #getProperty()
+ * @see #setProperty(ActivationProperty)
+ * @generated
+ */
+ void unsetProperty();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getProperty
+ * <em>Property</em>}' containment reference is set. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Property</em>' containment
+ * reference is set.
+ * @see #unsetProperty()
+ * @see #getProperty()
+ * @see #setProperty(ActivationProperty)
+ * @generated
+ */
+ boolean isSetProperty();
+
+ /**
+ * Returns the value of the '<em><b>File</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc -->
+ * 4.0.0
+ *
+ * Specifies that this profile will be activated based on existence of a
+ * file.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>File</em>' containment reference.
+ * @see #isSetFile()
+ * @see #unsetFile()
+ * @see #setFile(ActivationFile)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivation_File()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='file' namespace='##targetNamespace'"
+ * @generated
+ */
+ ActivationFile getFile();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getFile <em>File</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>File</em>' containment reference.
+ * @see #isSetFile()
+ * @see #unsetFile()
+ * @see #getFile()
+ * @generated
+ */
+ void setFile(ActivationFile value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getFile <em>File</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetFile()
+ * @see #getFile()
+ * @see #setFile(ActivationFile)
+ * @generated
+ */
+ void unsetFile();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getFile <em>File</em>}'
+ * containment reference is set. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return whether the value of the '<em>File</em>' containment reference is
+ * set.
+ * @see #unsetFile()
+ * @see #getFile()
+ * @see #setFile(ActivationFile)
+ * @generated
+ */
+ boolean isSetFile();
+
+} // Activation
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationFile.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationFile.java
new file mode 100644
index 00000000..6eb8426f
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationFile.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Activation File</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0
+ *
+ * This is the file specification used to activate the profile. The missing
+ * value will be the location of a file that needs to exist, and if it doesn't
+ * the profile will be activated. On the other hand exists will test for the
+ * existence of the file and if it is there the profile will be activated.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ActivationFile#getMissing <em>Missing
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ActivationFile#getExists <em>Exists
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivationFile()
+ * @model extendedMetaData="name='ActivationFile' kind='elementOnly'"
+ * @generated
+ */
+public interface ActivationFile extends EObject {
+ /**
+ * Returns the value of the '<em><b>Missing</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The name of the file that must be missing to activate the profile. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Missing</em>' attribute.
+ * @see #setMissing(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivationFile_Missing()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='missing' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getMissing();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationFile#getMissing
+ * <em>Missing</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Missing</em>' attribute.
+ * @see #getMissing()
+ * @generated
+ */
+ void setMissing(String value);
+
+ /**
+ * Returns the value of the '<em><b>Exists</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The name of the file that must exist to activate the profile. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Exists</em>' attribute.
+ * @see #setExists(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivationFile_Exists()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='exists' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getExists();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationFile#getExists
+ * <em>Exists</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Exists</em>' attribute.
+ * @see #getExists()
+ * @generated
+ */
+ void setExists(String value);
+
+} // ActivationFile
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationOS.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationOS.java
new file mode 100644
index 00000000..44cb43bb
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationOS.java
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Activation OS</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0
+ *
+ * This is an activator which will detect an operating system's attributes in
+ * order to activate its profile.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ActivationOS#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ActivationOS#getFamily <em>Family
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ActivationOS#getArch <em>Arch</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ActivationOS#getVersion <em>Version
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivationOS()
+ * @model extendedMetaData="name='ActivationOS' kind='elementOnly'"
+ * @generated
+ */
+public interface ActivationOS extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The name of the operating system to be used to activate the profile. This
+ * must be an exact match of the &lt;code&gt;${os.name}&lt;/code&gt; Java
+ * property, such as &lt;code&gt;Windows XP&lt;/code&gt;. <!-- end-model-doc
+ * -->
+ *
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivationOS_Name()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='name' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationOS#getName <em>Name</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Family</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The general family of the OS to be used to activate the profile, such as
+ * &lt;code&gt;windows&lt;/code&gt; or &lt;code&gt;unix&lt;/code&gt;. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Family</em>' attribute.
+ * @see #setFamily(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivationOS_Family()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='family' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getFamily();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationOS#getFamily
+ * <em>Family</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Family</em>' attribute.
+ * @see #getFamily()
+ * @generated
+ */
+ void setFamily(String value);
+
+ /**
+ * Returns the value of the '<em><b>Arch</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The architecture of the operating system to be used to activate the
+ * profile. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Arch</em>' attribute.
+ * @see #setArch(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivationOS_Arch()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='arch' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getArch();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationOS#getArch <em>Arch</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Arch</em>' attribute.
+ * @see #getArch()
+ * @generated
+ */
+ void setArch(String value);
+
+ /**
+ * Returns the value of the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The version of the operating system to be used to activate the profile.
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Version</em>' attribute.
+ * @see #setVersion(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivationOS_Version()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='version' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getVersion();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationOS#getVersion
+ * <em>Version</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Version</em>' attribute.
+ * @see #getVersion()
+ * @generated
+ */
+ void setVersion(String value);
+
+} // ActivationOS
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationProperty.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationProperty.java
new file mode 100644
index 00000000..c90e5db9
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ActivationProperty.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Activation Property</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0
+ *
+ * This is the property specification used to activate a profile. If the value
+ * field is empty, then the existence of the named property will activate the
+ * profile, otherwise it does a case-sensitive match against the property value
+ * as well.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ActivationProperty#getName <em>Name
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ActivationProperty#getValue <em>Value
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivationProperty()
+ * @model extendedMetaData="name='ActivationProperty' kind='elementOnly'"
+ * @generated
+ */
+public interface ActivationProperty extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The name of the property to be used to activate a profile. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivationProperty_Name()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='name' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationProperty#getName
+ * <em>Name</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Value</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The value of the property required to activate a profile. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Value</em>' attribute.
+ * @see #setValue(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getActivationProperty_Value()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='value' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getValue();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationProperty#getValue
+ * <em>Value</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Value</em>' attribute.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(String value);
+
+} // ActivationProperty
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Build.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Build.java
new file mode 100644
index 00000000..7abb1fb8
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Build.java
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Build</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 3.0.0+ <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Build#getSourceDirectory <em>Source
+ * Directory</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Build#getScriptSourceDirectory <em>
+ * Script Source Directory</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Build#getTestSourceDirectory <em>Test
+ * Source Directory</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Build#getOutputDirectory <em>Output
+ * Directory</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Build#getTestOutputDirectory <em>Test
+ * Output Directory</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Build#getExtensions <em>Extensions
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuild()
+ * @model extendedMetaData="name='Build' kind='elementOnly'"
+ * @generated
+ */
+public interface Build extends BuildBase {
+ /**
+ * Returns the value of the '<em><b>Source Directory</b></em>' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc -->
+ * 3.0.0+
+ *
+ * This element specifies a directory containing the source of the project.
+ * The generated build system will compile the source in this directory when
+ * the project is built. The path given is relative to the project
+ * descriptor.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Source Directory</em>' attribute.
+ * @see #setSourceDirectory(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuild_SourceDirectory()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='sourceDirectory' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getSourceDirectory();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Build#getSourceDirectory
+ * <em>Source Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Source Directory</em>' attribute.
+ * @see #getSourceDirectory()
+ * @generated
+ */
+ void setSourceDirectory(String value);
+
+ /**
+ * Returns the value of the '<em><b>Script Source Directory</b></em>'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0
+ *
+ * This element specifies a directory containing the script sources of the
+ * project. This directory is meant to be different from the
+ * sourceDirectory, in that its contents will be copied to the output
+ * directory in most cases (since scripts are interpreted rather than
+ * compiled).
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Script Source Directory</em>' attribute.
+ * @see #setScriptSourceDirectory(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuild_ScriptSourceDirectory()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='scriptSourceDirectory' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getScriptSourceDirectory();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Build#getScriptSourceDirectory
+ * <em>Script Source Directory</em>}' attribute. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Script Source Directory</em>'
+ * attribute.
+ * @see #getScriptSourceDirectory()
+ * @generated
+ */
+ void setScriptSourceDirectory(String value);
+
+ /**
+ * Returns the value of the '<em><b>Test Source Directory</b></em>'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0
+ *
+ * This element specifies a directory containing the unit test source of the
+ * project. The generated build system will compile these directories when
+ * the project is being tested. The path given is relative to the project
+ * descriptor.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Test Source Directory</em>' attribute.
+ * @see #setTestSourceDirectory(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuild_TestSourceDirectory()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='testSourceDirectory' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getTestSourceDirectory();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Build#getTestSourceDirectory
+ * <em>Test Source Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Test Source Directory</em>'
+ * attribute.
+ * @see #getTestSourceDirectory()
+ * @generated
+ */
+ void setTestSourceDirectory(String value);
+
+ /**
+ * Returns the value of the '<em><b>Output Directory</b></em>' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc -->
+ * 4.0.0
+ *
+ * The directory where compiled application classes are placed.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Output Directory</em>' attribute.
+ * @see #setOutputDirectory(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuild_OutputDirectory()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='outputDirectory' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getOutputDirectory();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Build#getOutputDirectory
+ * <em>Output Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Output Directory</em>' attribute.
+ * @see #getOutputDirectory()
+ * @generated
+ */
+ void setOutputDirectory(String value);
+
+ /**
+ * Returns the value of the '<em><b>Test Output Directory</b></em>'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0
+ *
+ * The directory where compiled test classes are placed.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Test Output Directory</em>' attribute.
+ * @see #setTestOutputDirectory(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuild_TestOutputDirectory()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='testOutputDirectory' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getTestOutputDirectory();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Build#getTestOutputDirectory
+ * <em>Test Output Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Test Output Directory</em>'
+ * attribute.
+ * @see #getTestOutputDirectory()
+ * @generated
+ */
+ void setTestOutputDirectory(String value);
+
+ /**
+ * Returns the value of the '<em><b>Extensions</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Extension}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0 A set of build
+ * extensions to use from this project. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Extensions</em>' containment reference
+ * list.
+ * @see #isSetExtensions()
+ * @see #unsetExtensions()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuild_Extensions()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='extensions' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Extension> getExtensions();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Build#getExtensions
+ * <em>Extensions</em>}' containment reference list. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetExtensions()
+ * @see #getExtensions()
+ * @generated
+ */
+ void unsetExtensions();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Build#getExtensions
+ * <em>Extensions</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Extensions</em>' containment
+ * reference list is set.
+ * @see #unsetExtensions()
+ * @see #getExtensions()
+ * @generated
+ */
+ boolean isSetExtensions();
+
+} // Build
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/BuildBase.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/BuildBase.java
new file mode 100644
index 00000000..3c3580f3
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/BuildBase.java
@@ -0,0 +1,371 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Build Base</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 3.0.0+ <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.BuildBase#getDefaultGoal <em>Default
+ * Goal</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.BuildBase#getResources <em>Resources
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.BuildBase#getTestResources <em>Test
+ * Resources</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.BuildBase#getDirectory <em>Directory
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.BuildBase#getFinalName <em>Final Name
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.BuildBase#getPluginManagement <em>
+ * Plugin Management</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.BuildBase#getPlugins <em>Plugins
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.BuildBase#getFilters <em>Filters
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuildBase()
+ * @model extendedMetaData="name='BuildBase' kind='elementOnly'"
+ * @generated
+ */
+public interface BuildBase extends EObject {
+ /**
+ * Returns the value of the '<em><b>Default Goal</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The default goal (or phase in Maven 2) to execute when none is specified
+ * for the project.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Default Goal</em>' attribute.
+ * @see #setDefaultGoal(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuildBase_DefaultGoal()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='defaultGoal' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getDefaultGoal();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase#getDefaultGoal
+ * <em>Default Goal</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Default Goal</em>' attribute.
+ * @see #getDefaultGoal()
+ * @generated
+ */
+ void setDefaultGoal(String value);
+
+ /**
+ * Returns the value of the '<em><b>Resources</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Resource}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * This element describes all of the classpath resources such as properties
+ * files associated with a project. These resources are often included in
+ * the final package.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Resources</em>' containment reference list.
+ * @see #isSetResources()
+ * @see #unsetResources()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuildBase_Resources()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='resources' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Resource> getResources();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase#getResources
+ * <em>Resources</em>}' containment reference list. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetResources()
+ * @see #getResources()
+ * @generated
+ */
+ void unsetResources();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase#getResources
+ * <em>Resources</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Resources</em>' containment
+ * reference list is set.
+ * @see #unsetResources()
+ * @see #getResources()
+ * @generated
+ */
+ boolean isSetResources();
+
+ /**
+ * Returns the value of the '<em><b>Test Resources</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Resource}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * This element describes all of the classpath resources such as properties
+ * files associated with a project's unit tests.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Test Resources</em>' containment reference
+ * list.
+ * @see #isSetTestResources()
+ * @see #unsetTestResources()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuildBase_TestResources()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='testResources' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Resource> getTestResources();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase#getTestResources
+ * <em>Test Resources</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetTestResources()
+ * @see #getTestResources()
+ * @generated
+ */
+ void unsetTestResources();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase#getTestResources
+ * <em>Test Resources</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Test Resources</em>' containment
+ * reference list is set.
+ * @see #unsetTestResources()
+ * @see #getTestResources()
+ * @generated
+ */
+ boolean isSetTestResources();
+
+ /**
+ * Returns the value of the '<em><b>Directory</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The directory where all files generated by the build are placed.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Directory</em>' attribute.
+ * @see #setDirectory(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuildBase_Directory()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='directory' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getDirectory();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase#getDirectory
+ * <em>Directory</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Directory</em>' attribute.
+ * @see #getDirectory()
+ * @generated
+ */
+ void setDirectory(String value);
+
+ /**
+ * Returns the value of the '<em><b>Final Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The filename (excluding the extension, and with no path information) that
+ * the produced artifact will be called. The default value is
+ * &lt;code&gt;${artifactId}-${version}&lt;/code&gt;.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Final Name</em>' attribute.
+ * @see #setFinalName(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuildBase_FinalName()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='finalName' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getFinalName();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase#getFinalName
+ * <em>Final Name</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Final Name</em>' attribute.
+ * @see #getFinalName()
+ * @generated
+ */
+ void setFinalName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Plugin Management</b></em>' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0
+ *
+ * Default plugin information to be made available for reference by projects
+ * derived from this one. This plugin configuration will not be resolved or
+ * bound to the lifecycle unless referenced. Any local configuration for a
+ * given plugin will override the plugin's entire definition here.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Plugin Management</em>' containment
+ * reference.
+ * @see #isSetPluginManagement()
+ * @see #unsetPluginManagement()
+ * @see #setPluginManagement(PluginManagement)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuildBase_PluginManagement()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='pluginManagement' namespace='##targetNamespace'"
+ * @generated
+ */
+ PluginManagement getPluginManagement();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase#getPluginManagement
+ * <em>Plugin Management</em>}' containment reference. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Plugin Management</em>' containment
+ * reference.
+ * @see #isSetPluginManagement()
+ * @see #unsetPluginManagement()
+ * @see #getPluginManagement()
+ * @generated
+ */
+ void setPluginManagement(PluginManagement value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase#getPluginManagement
+ * <em>Plugin Management</em>}' containment reference. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetPluginManagement()
+ * @see #getPluginManagement()
+ * @see #setPluginManagement(PluginManagement)
+ * @generated
+ */
+ void unsetPluginManagement();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase#getPluginManagement
+ * <em>Plugin Management</em>}' containment reference is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Plugin Management</em>' containment
+ * reference is set.
+ * @see #unsetPluginManagement()
+ * @see #getPluginManagement()
+ * @see #setPluginManagement(PluginManagement)
+ * @generated
+ */
+ boolean isSetPluginManagement();
+
+ /**
+ * Returns the value of the '<em><b>Plugins</b></em>' containment reference
+ * list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin}. <!-- begin-user-doc --> <!--
+ * end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The list of plugins to use.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Plugins</em>' containment reference list.
+ * @see #isSetPlugins()
+ * @see #unsetPlugins()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuildBase_Plugins()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='plugins' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Plugin> getPlugins();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase#getPlugins
+ * <em>Plugins</em>}' containment reference list. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetPlugins()
+ * @see #getPlugins()
+ * @generated
+ */
+ void unsetPlugins();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase#getPlugins
+ * <em>Plugins</em>}' containment reference list is set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Plugins</em>' containment reference
+ * list is set.
+ * @see #unsetPlugins()
+ * @see #getPlugins()
+ * @generated
+ */
+ boolean isSetPlugins();
+
+ /**
+ * Returns the value of the '<em><b>Filters</b></em>' attribute list. The
+ * list contents are of type {@link java.lang.String}. <!-- begin-user-doc
+ * -->
+ * <p>
+ * If the meaning of the '<em>Filters</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Filters</em>' attribute list.
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getBuildBase_Filters()
+ * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * @generated
+ */
+ EList<String> getFilters();
+
+} // BuildBase
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/CiManagement.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/CiManagement.java
new file mode 100644
index 00000000..2557f80e
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/CiManagement.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Ci Management</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0 <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.CiManagement#getSystem <em>System
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.CiManagement#getUrl <em>Url</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.CiManagement#getNotifiers <em>
+ * Notifiers</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getCiManagement()
+ * @model extendedMetaData="name='CiManagement' kind='elementOnly'"
+ * @generated
+ */
+public interface CiManagement extends EObject {
+ /**
+ * Returns the value of the '<em><b>System</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The name of the continuous integration system, e.g.
+ * &lt;code&gt;continuum&lt;/code&gt;. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>System</em>' attribute.
+ * @see #setSystem(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getCiManagement_System()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='system' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getSystem();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.CiManagement#getSystem
+ * <em>System</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>System</em>' attribute.
+ * @see #getSystem()
+ * @generated
+ */
+ void setSystem(String value);
+
+ /**
+ * Returns the value of the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * URL for the continuous integration system used by the project if it has a
+ * web interface. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Url</em>' attribute.
+ * @see #setUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getCiManagement_Url()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='url' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUrl();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.CiManagement#getUrl <em>Url</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Url</em>' attribute.
+ * @see #getUrl()
+ * @generated
+ */
+ void setUrl(String value);
+
+ /**
+ * Returns the value of the '<em><b>Notifiers</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Configuration for notifying developers/users when a build is
+ * unsuccessful, including user information and notification mode.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Notifiers</em>' containment reference list.
+ * @see #isSetNotifiers()
+ * @see #unsetNotifiers()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getCiManagement_Notifiers()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='notifiers' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Notifier> getNotifiers();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.CiManagement#getNotifiers
+ * <em>Notifiers</em>}' containment reference list. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetNotifiers()
+ * @see #getNotifiers()
+ * @generated
+ */
+ void unsetNotifiers();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.CiManagement#getNotifiers
+ * <em>Notifiers</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Notifiers</em>' containment
+ * reference list is set.
+ * @see #unsetNotifiers()
+ * @see #getNotifiers()
+ * @generated
+ */
+ boolean isSetNotifiers();
+
+} // CiManagement
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Configuration.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Configuration.java
new file mode 100644
index 00000000..56441884
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Configuration.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.w3c.dom.Node;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Configuration</b></em>'. <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Configuration#getNode <em>Node</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getConfiguration()
+ * @model
+ * @generated NOT
+ */
+public interface Configuration extends EObject {
+ public Node getConfigurationNode();
+
+ public String getStringValue(String xpath);
+
+ public void setStringValue(String xpath, String value);
+
+ List<String> getListValue(String xpath);
+
+ List<Node> getListNodes(String xpath);
+
+ Node getNode(String xpath);
+
+ void setNodeValues(String xpath, String name, String[] values);
+
+ void setNodeValues(String xpath, String[] names, String[] values);
+
+ void setNodeValues(Node node, String xpath, String[] names, String[] values);
+
+ Node createNode(String xpath);
+
+ void removeNode(String xpath);
+
+} // Configuration
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Contributor.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Contributor.java
new file mode 100644
index 00000000..3f1b6aa0
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Contributor.java
@@ -0,0 +1,305 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Contributor</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 3.0.0+
+ *
+ * Description of a person who has contributed to the project, but who does not
+ * have commit privileges. Usually, these contributions come in the form of
+ * patches submitted.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Contributor#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Contributor#getEmail <em>Email</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Contributor#getUrl <em>Url</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Contributor#getOrganization <em>
+ * Organization</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Contributor#getOrganizationUrl <em>
+ * Organization Url</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Contributor#getTimezone <em>Timezone
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Contributor#getProperties <em>
+ * Properties</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Contributor#getRoles <em>Roles</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getContributor()
+ * @model extendedMetaData="name='Contributor' kind='elementOnly'"
+ * @generated
+ */
+public interface Contributor extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The full name of the contributor. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getContributor_Name()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='name' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor#getName <em>Name</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Email</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The email address of the contributor. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Email</em>' attribute.
+ * @see #setEmail(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getContributor_Email()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='email' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getEmail();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor#getEmail <em>Email</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Email</em>' attribute.
+ * @see #getEmail()
+ * @generated
+ */
+ void setEmail(String value);
+
+ /**
+ * Returns the value of the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The URL for the homepage of the contributor. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Url</em>' attribute.
+ * @see #setUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getContributor_Url()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='url' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUrl();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor#getUrl <em>Url</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Url</em>' attribute.
+ * @see #getUrl()
+ * @generated
+ */
+ void setUrl(String value);
+
+ /**
+ * Returns the value of the '<em><b>Organization</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The organization to which the contributor belongs. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Organization</em>' attribute.
+ * @see #setOrganization(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getContributor_Organization()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='organization' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getOrganization();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor#getOrganization
+ * <em>Organization</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Organization</em>' attribute.
+ * @see #getOrganization()
+ * @generated
+ */
+ void setOrganization(String value);
+
+ /**
+ * Returns the value of the '<em><b>Organization Url</b></em>' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc -->
+ * 3.0.0+ The URL of the organization. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Organization Url</em>' attribute.
+ * @see #setOrganizationUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getContributor_OrganizationUrl()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='organizationUrl' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getOrganizationUrl();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor#getOrganizationUrl
+ * <em>Organization Url</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Organization Url</em>' attribute.
+ * @see #getOrganizationUrl()
+ * @generated
+ */
+ void setOrganizationUrl(String value);
+
+ /**
+ * Returns the value of the '<em><b>Timezone</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The timezone the contributor is in. This is a number in the range -11 to
+ * 12.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Timezone</em>' attribute.
+ * @see #setTimezone(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getContributor_Timezone()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='timezone' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getTimezone();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor#getTimezone
+ * <em>Timezone</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Timezone</em>' attribute.
+ * @see #getTimezone()
+ * @generated
+ */
+ void setTimezone(String value);
+
+ /**
+ * Returns the value of the '<em><b>Properties</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.PropertyElement}. <!-- begin-user-doc
+ * --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * Properties about the contributor, such as an instant messenger handle.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Properties</em>' containment reference
+ * list.
+ * @see #isSetProperties()
+ * @see #unsetProperties()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getContributor_Properties()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='properties' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<PropertyElement> getProperties();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor#getProperties
+ * <em>Properties</em>}' containment reference list. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetProperties()
+ * @see #getProperties()
+ * @generated
+ */
+ void unsetProperties();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor#getProperties
+ * <em>Properties</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Properties</em>' containment
+ * reference list is set.
+ * @see #unsetProperties()
+ * @see #getProperties()
+ * @generated
+ */
+ boolean isSetProperties();
+
+ /**
+ * Returns the value of the '<em><b>Roles</b></em>' attribute list. The list
+ * contents are of type {@link java.lang.String}. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Roles</em>' attribute list isn't clear, there
+ * really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Roles</em>' attribute list.
+ * @see #isSetRoles()
+ * @see #unsetRoles()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getContributor_Roles()
+ * @model unique="false" unsettable="true"
+ * dataType="org.eclipse.emf.ecore.xml.type.String"
+ * @generated
+ */
+ EList<String> getRoles();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor#getRoles <em>Roles</em>}'
+ * attribute list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetRoles()
+ * @see #getRoles()
+ * @generated
+ */
+ void unsetRoles();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor#getRoles <em>Roles</em>}'
+ * attribute list is set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Roles</em>' attribute list is set.
+ * @see #unsetRoles()
+ * @see #getRoles()
+ * @generated
+ */
+ boolean isSetRoles();
+
+} // Contributor
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Dependency.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Dependency.java
new file mode 100644
index 00000000..348c07cd
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Dependency.java
@@ -0,0 +1,429 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Dependency</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 3.0.0+ <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Dependency#getGroupId <em>Group Id
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Dependency#getArtifactId <em>Artifact
+ * Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Dependency#getVersion <em>Version
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Dependency#getType <em>Type</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Dependency#getClassifier <em>
+ * Classifier</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Dependency#getScope <em>Scope</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Dependency#getSystemPath <em>System
+ * Path</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Dependency#getExclusions <em>
+ * Exclusions</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Dependency#getOptional <em>Optional
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDependency()
+ * @model extendedMetaData="name='Dependency' kind='elementOnly'"
+ * @generated
+ */
+public interface Dependency extends EObject {
+ /**
+ * Returns the value of the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The project group that produced the dependency, e.g.
+ * &lt;code&gt;org.apache.maven&lt;/code&gt;.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Group Id</em>' attribute.
+ * @see #setGroupId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDependency_GroupId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='groupId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getGroupId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getGroupId
+ * <em>Group Id</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Group Id</em>' attribute.
+ * @see #getGroupId()
+ * @generated
+ */
+ void setGroupId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The unique id for an artifact produced by the project group, e.g.
+ * &lt;code&gt;maven-artifact&lt;/code&gt;.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Artifact Id</em>' attribute.
+ * @see #setArtifactId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDependency_ArtifactId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='artifactId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getArtifactId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getArtifactId
+ * <em>Artifact Id</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Artifact Id</em>' attribute.
+ * @see #getArtifactId()
+ * @generated
+ */
+ void setArtifactId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The version of the dependency, e.g. &lt;code&gt;3.2.1&lt;/code&gt;. In
+ * Maven 2, this can also be specified as a range of versions.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Version</em>' attribute.
+ * @see #setVersion(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDependency_Version()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='version' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getVersion();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getVersion
+ * <em>Version</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Version</em>' attribute.
+ * @see #getVersion()
+ * @generated
+ */
+ void setVersion(String value);
+
+ /**
+ * Returns the value of the '<em><b>Type</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The type of dependency. This defaults to &lt;code&gt;jar&lt;/code&gt;.
+ * While it usually represents the extension on the filename of the
+ * dependency, that is not always the case. A type can be mapped to a
+ * different extension and a classifier. The type often correspongs to the
+ * packaging used, though this is also not always the case. Some examples
+ * are &lt;code&gt;jar&lt;/code&gt;, &lt;code&gt;war&lt;/code&gt;,
+ * &lt;code&gt;ejb-client&lt;/code&gt; and
+ * &lt;code&gt;test-jar&lt;/code&gt;. New types can be defined by plugins
+ * that set &lt;code&gt;extensions&lt;/code&gt; to
+ * &lt;code&gt;true&lt;/code&gt;, so this is not a complete list.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Type</em>' attribute.
+ * @see #isSetType()
+ * @see #unsetType()
+ * @see #setType(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDependency_Type()
+ * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * extendedMetaData
+ * ="kind='element' name='type' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getType();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getType <em>Type</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Type</em>' attribute.
+ * @see #isSetType()
+ * @see #unsetType()
+ * @see #getType()
+ * @generated
+ */
+ void setType(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getType <em>Type</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetType()
+ * @see #getType()
+ * @see #setType(String)
+ * @generated
+ */
+ void unsetType();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getType <em>Type</em>}'
+ * attribute is set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Type</em>' attribute is set.
+ * @see #unsetType()
+ * @see #getType()
+ * @see #setType(String)
+ * @generated
+ */
+ boolean isSetType();
+
+ /**
+ * Returns the value of the '<em><b>Classifier</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The classifier of the dependency. This allows distinguishing two
+ * artifacts that belong to the same POM but were built differently, and is
+ * appended to the filename after the version. For example,
+ * &lt;code&gt;jdk14&lt;/code&gt; and &lt;code&gt;jdk15&lt;/code&gt;.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Classifier</em>' attribute.
+ * @see #setClassifier(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDependency_Classifier()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='classifier' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getClassifier();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getClassifier
+ * <em>Classifier</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Classifier</em>' attribute.
+ * @see #getClassifier()
+ * @generated
+ */
+ void setClassifier(String value);
+
+ /**
+ * Returns the value of the '<em><b>Scope</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The scope of the dependency - &lt;code&gt;compile&lt;/code&gt;,
+ * &lt;code&gt;runtime&lt;/code&gt;, &lt;code&gt;test&lt;/code&gt;,
+ * &lt;code&gt;system&lt;/code&gt;, and &lt;code&gt;provided&lt;/code&gt;.
+ * Used to calculate the various classpaths used for compilation, testing,
+ * and so on. It also assists in determining which artifacts to include in a
+ * distribution of this project. For more information, see &lt;a href="http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html"
+ * &gt;the dependency mechanism&lt;/a&gt;.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Scope</em>' attribute.
+ * @see #setScope(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDependency_Scope()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='scope' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getScope();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getScope <em>Scope</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Scope</em>' attribute.
+ * @see #getScope()
+ * @generated
+ */
+ void setScope(String value);
+
+ /**
+ * Returns the value of the '<em><b>System Path</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * FOR SYSTEM SCOPE ONLY. Note that use of this property is
+ * &lt;b&gt;discouraged&lt;/b&gt; and may be replaced in later versions.
+ * This specifies the path on the filesystem for this dependency. Requires
+ * an absolute path for the value, not relative. Use a property that gives
+ * the machine specific absolute path, e.g.
+ * &lt;code&gt;${java.home}&lt;/code&gt;.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>System Path</em>' attribute.
+ * @see #setSystemPath(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDependency_SystemPath()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='systemPath' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getSystemPath();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getSystemPath
+ * <em>System Path</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>System Path</em>' attribute.
+ * @see #getSystemPath()
+ * @generated
+ */
+ void setSystemPath(String value);
+
+ /**
+ * Returns the value of the '<em><b>Exclusions</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Exclusion}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Lists a set of artifacts that should be excluded from this dependency's
+ * artifact list when it comes to calculating transitive dependencies.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Exclusions</em>' containment reference
+ * list.
+ * @see #isSetExclusions()
+ * @see #unsetExclusions()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDependency_Exclusions()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='exclusions' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Exclusion> getExclusions();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getExclusions
+ * <em>Exclusions</em>}' containment reference list. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetExclusions()
+ * @see #getExclusions()
+ * @generated
+ */
+ void unsetExclusions();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getExclusions
+ * <em>Exclusions</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Exclusions</em>' containment
+ * reference list is set.
+ * @see #unsetExclusions()
+ * @see #getExclusions()
+ * @generated
+ */
+ boolean isSetExclusions();
+
+ /**
+ * Returns the value of the '<em><b>Optional</b></em>' attribute. The
+ * default value is <code>"false"</code>. <!-- begin-user-doc --> <!--
+ * end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Indicates the dependency is optional for use of this library. While the
+ * version of the dependency will be taken into account for dependency
+ * calculation if the library is used elsewhere, it will not be passed on
+ * transitively.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Optional</em>' attribute.
+ * @see #isSetOptional()
+ * @see #unsetOptional()
+ * @see #setOptional(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDependency_Optional()
+ * @model default="false" unsettable="true"
+ * dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='optional' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getOptional();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getOptional
+ * <em>Optional</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Optional</em>' attribute.
+ * @see #isSetOptional()
+ * @see #unsetOptional()
+ * @see #getOptional()
+ * @generated
+ */
+ void setOptional(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getOptional
+ * <em>Optional</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #isSetOptional()
+ * @see #getOptional()
+ * @see #setOptional(String)
+ * @generated
+ */
+ void unsetOptional();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency#getOptional
+ * <em>Optional</em>}' attribute is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Optional</em>' attribute is set.
+ * @see #unsetOptional()
+ * @see #getOptional()
+ * @see #setOptional(String)
+ * @generated
+ */
+ boolean isSetOptional();
+
+} // Dependency
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DependencyManagement.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DependencyManagement.java
new file mode 100644
index 00000000..20c84d8a
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DependencyManagement.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Dependency Management</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0
+ *
+ * Section for management of default dependency information for use in a group
+ * of POMs.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.DependencyManagement#getDependencies
+ * <em>Dependencies</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDependencyManagement()
+ * @model extendedMetaData="name='DependencyManagement' kind='elementOnly'"
+ * @generated
+ */
+public interface DependencyManagement extends EObject {
+ /**
+ * Returns the value of the '<em><b>Dependencies</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The dependencies specified here are not used until they are referenced in
+ * a POM within the group. This allows the specification of a "standard"
+ * version for a particular dependency.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Dependencies</em>' containment reference
+ * list.
+ * @see #isSetDependencies()
+ * @see #unsetDependencies()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDependencyManagement_Dependencies()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='dependencies' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Dependency> getDependencies();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DependencyManagement#getDependencies
+ * <em>Dependencies</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetDependencies()
+ * @see #getDependencies()
+ * @generated
+ */
+ void unsetDependencies();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DependencyManagement#getDependencies
+ * <em>Dependencies</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Dependencies</em>' containment
+ * reference list is set.
+ * @see #unsetDependencies()
+ * @see #getDependencies()
+ * @generated
+ */
+ boolean isSetDependencies();
+
+} // DependencyManagement
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DeploymentRepository.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DeploymentRepository.java
new file mode 100644
index 00000000..14569bc0
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DeploymentRepository.java
@@ -0,0 +1,265 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Deployment Repository</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0
+ *
+ * Repository contains the information needed for deploying to the remote
+ * repoistory.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getUniqueVersion
+ * <em>Unique Version</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getId <em>Id
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getName <em>Name
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getUrl <em>Url
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getLayout <em>
+ * Layout</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeploymentRepository()
+ * @model extendedMetaData="name='DeploymentRepository' kind='elementOnly'"
+ * @generated
+ */
+public interface DeploymentRepository extends EObject {
+ /**
+ * Returns the value of the '<em><b>Unique Version</b></em>' attribute. The
+ * default value is <code>"true"</code>. <!-- begin-user-doc --> <!--
+ * end-user-doc --> <!-- begin-model-doc --> 4.0.0 Whether to assign
+ * snapshots a unique version comprised of the timestamp and build number,
+ * or to use the same version each time <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Unique Version</em>' attribute.
+ * @see #isSetUniqueVersion()
+ * @see #unsetUniqueVersion()
+ * @see #setUniqueVersion(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeploymentRepository_UniqueVersion()
+ * @model default="true" unsettable="true"
+ * dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='uniqueVersion' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUniqueVersion();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getUniqueVersion
+ * <em>Unique Version</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Unique Version</em>' attribute.
+ * @see #isSetUniqueVersion()
+ * @see #unsetUniqueVersion()
+ * @see #getUniqueVersion()
+ * @generated
+ */
+ void setUniqueVersion(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getUniqueVersion
+ * <em>Unique Version</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetUniqueVersion()
+ * @see #getUniqueVersion()
+ * @see #setUniqueVersion(String)
+ * @generated
+ */
+ void unsetUniqueVersion();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getUniqueVersion
+ * <em>Unique Version</em>}' attribute is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Unique Version</em>' attribute is
+ * set.
+ * @see #unsetUniqueVersion()
+ * @see #getUniqueVersion()
+ * @see #setUniqueVersion(String)
+ * @generated
+ */
+ boolean isSetUniqueVersion();
+
+ /**
+ * Returns the value of the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * A unique identifier for a repository. This is used to match the
+ * repository to configuration in the &lt;code&gt;settings.xml&lt;/code&gt;
+ * file, for example.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Id</em>' attribute.
+ * @see #setId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeploymentRepository_Id()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='id' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getId
+ * <em>Id</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Id</em>' attribute.
+ * @see #getId()
+ * @generated
+ */
+ void setId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Human readable name of the repository.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeploymentRepository_Name()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='name' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getName
+ * <em>Name</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The url of the repository, in the form
+ * &lt;code&gt;protocol://hostname/path&lt;/code&gt;.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Url</em>' attribute.
+ * @see #setUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeploymentRepository_Url()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='url' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUrl();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getUrl
+ * <em>Url</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Url</em>' attribute.
+ * @see #getUrl()
+ * @generated
+ */
+ void setUrl(String value);
+
+ /**
+ * Returns the value of the '<em><b>Layout</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The type of layout this repository uses for locating and storing
+ * artifacts - can be &lt;code&gt;legacy&lt;/code&gt; or
+ * &lt;code&gt;default&lt;/code&gt;.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Layout</em>' attribute.
+ * @see #isSetLayout()
+ * @see #unsetLayout()
+ * @see #setLayout(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeploymentRepository_Layout()
+ * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * extendedMetaData
+ * ="kind='element' name='layout' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getLayout();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getLayout
+ * <em>Layout</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Layout</em>' attribute.
+ * @see #isSetLayout()
+ * @see #unsetLayout()
+ * @see #getLayout()
+ * @generated
+ */
+ void setLayout(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getLayout
+ * <em>Layout</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #isSetLayout()
+ * @see #getLayout()
+ * @see #setLayout(String)
+ * @generated
+ */
+ void unsetLayout();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getLayout
+ * <em>Layout</em>}' attribute is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Layout</em>' attribute is set.
+ * @see #unsetLayout()
+ * @see #getLayout()
+ * @see #setLayout(String)
+ * @generated
+ */
+ boolean isSetLayout();
+
+} // DeploymentRepository
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Developer.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Developer.java
new file mode 100644
index 00000000..6c22b137
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Developer.java
@@ -0,0 +1,330 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Developer</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 3.0.0+
+ *
+ * Information about one of the committers on this project.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Developer#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Developer#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Developer#getEmail <em>Email</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Developer#getUrl <em>Url</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Developer#getOrganization <em>
+ * Organization</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Developer#getOrganizationUrl <em>
+ * Organization Url</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Developer#getTimezone <em>Timezone
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Developer#getProperties <em>
+ * Properties</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Developer#getRoles <em>Roles</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeveloper()
+ * @model extendedMetaData="name='Developer' kind='elementOnly'"
+ * @generated
+ */
+public interface Developer extends EObject {
+ /**
+ * Returns the value of the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The unique ID of the developer in the SCM. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Id</em>' attribute.
+ * @see #setId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeveloper_Id()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='id' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getId <em>Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Id</em>' attribute.
+ * @see #getId()
+ * @generated
+ */
+ void setId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The full name of the contributor. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeveloper_Name()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='name' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getName <em>Name</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Email</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The email address of the contributor. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Email</em>' attribute.
+ * @see #setEmail(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeveloper_Email()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='email' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getEmail();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getEmail <em>Email</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Email</em>' attribute.
+ * @see #getEmail()
+ * @generated
+ */
+ void setEmail(String value);
+
+ /**
+ * Returns the value of the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The URL for the homepage of the contributor. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Url</em>' attribute.
+ * @see #setUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeveloper_Url()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='url' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUrl();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getUrl <em>Url</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Url</em>' attribute.
+ * @see #getUrl()
+ * @generated
+ */
+ void setUrl(String value);
+
+ /**
+ * Returns the value of the '<em><b>Organization</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The organization to which the contributor belongs. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Organization</em>' attribute.
+ * @see #setOrganization(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeveloper_Organization()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='organization' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getOrganization();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getOrganization
+ * <em>Organization</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Organization</em>' attribute.
+ * @see #getOrganization()
+ * @generated
+ */
+ void setOrganization(String value);
+
+ /**
+ * Returns the value of the '<em><b>Organization Url</b></em>' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc -->
+ * 3.0.0+ The URL of the organization. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Organization Url</em>' attribute.
+ * @see #setOrganizationUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeveloper_OrganizationUrl()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='organizationUrl' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getOrganizationUrl();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getOrganizationUrl
+ * <em>Organization Url</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Organization Url</em>' attribute.
+ * @see #getOrganizationUrl()
+ * @generated
+ */
+ void setOrganizationUrl(String value);
+
+ /**
+ * Returns the value of the '<em><b>Timezone</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The timezone the contributor is in. This is a number in the range -11 to
+ * 12.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Timezone</em>' attribute.
+ * @see #setTimezone(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeveloper_Timezone()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='timezone' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getTimezone();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getTimezone
+ * <em>Timezone</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Timezone</em>' attribute.
+ * @see #getTimezone()
+ * @generated
+ */
+ void setTimezone(String value);
+
+ /**
+ * Returns the value of the '<em><b>Properties</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.PropertyElement}. <!-- begin-user-doc
+ * --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * Properties about the contributor, such as an instant messenger handle.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Properties</em>' containment reference
+ * list.
+ * @see #isSetProperties()
+ * @see #unsetProperties()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeveloper_Properties()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='properties' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<PropertyElement> getProperties();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getProperties
+ * <em>Properties</em>}' containment reference list. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetProperties()
+ * @see #getProperties()
+ * @generated
+ */
+ void unsetProperties();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getProperties
+ * <em>Properties</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Properties</em>' containment
+ * reference list is set.
+ * @see #unsetProperties()
+ * @see #getProperties()
+ * @generated
+ */
+ boolean isSetProperties();
+
+ /**
+ * Returns the value of the '<em><b>Roles</b></em>' attribute list. The list
+ * contents are of type {@link java.lang.String}. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Roles</em>' attribute list isn't clear, there
+ * really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Roles</em>' attribute list.
+ * @see #isSetRoles()
+ * @see #unsetRoles()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDeveloper_Roles()
+ * @model unique="false" unsettable="true"
+ * dataType="org.eclipse.emf.ecore.xml.type.String"
+ * @generated
+ */
+ EList<String> getRoles();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getRoles <em>Roles</em>}'
+ * attribute list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetRoles()
+ * @see #getRoles()
+ * @generated
+ */
+ void unsetRoles();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getRoles <em>Roles</em>}'
+ * attribute list is set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Roles</em>' attribute list is set.
+ * @see #unsetRoles()
+ * @see #getRoles()
+ * @generated
+ */
+ boolean isSetRoles();
+
+} // Developer
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DistributionManagement.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DistributionManagement.java
new file mode 100644
index 00000000..0c0cfa52
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DistributionManagement.java
@@ -0,0 +1,382 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Distribution Management</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0
+ *
+ * This elements describes all that pertains to distribution for a project. It
+ * is primarily used for deployment of artifacts and the site produced by the
+ * build.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getRepository
+ * <em>Repository</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getSnapshotRepository
+ * <em>Snapshot Repository</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getSite <em>
+ * Site</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getDownloadUrl
+ * <em>Download Url</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getRelocation
+ * <em>Relocation</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getStatus <em>
+ * Status</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDistributionManagement()
+ * @model extendedMetaData="name='DistributionManagement' kind='elementOnly'"
+ * @generated
+ */
+public interface DistributionManagement extends EObject {
+ /**
+ * Returns the value of the '<em><b>Repository</b></em>' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0
+ *
+ * Information needed to deploy the artifacts generated by the project to a
+ * remote repository.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Repository</em>' containment reference.
+ * @see #isSetRepository()
+ * @see #unsetRepository()
+ * @see #setRepository(DeploymentRepository)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDistributionManagement_Repository()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='repository' namespace='##targetNamespace'"
+ * @generated
+ */
+ DeploymentRepository getRepository();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getRepository
+ * <em>Repository</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Repository</em>' containment
+ * reference.
+ * @see #isSetRepository()
+ * @see #unsetRepository()
+ * @see #getRepository()
+ * @generated
+ */
+ void setRepository(DeploymentRepository value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getRepository
+ * <em>Repository</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetRepository()
+ * @see #getRepository()
+ * @see #setRepository(DeploymentRepository)
+ * @generated
+ */
+ void unsetRepository();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getRepository
+ * <em>Repository</em>}' containment reference is set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Repository</em>' containment
+ * reference is set.
+ * @see #unsetRepository()
+ * @see #getRepository()
+ * @see #setRepository(DeploymentRepository)
+ * @generated
+ */
+ boolean isSetRepository();
+
+ /**
+ * Returns the value of the '<em><b>Snapshot Repository</b></em>'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0
+ *
+ * Where to deploy snapshots of artifacts to. If not given, it defaults to
+ * the &lt;code&gt;repository&lt;/code&gt; element.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Snapshot Repository</em>' containment
+ * reference.
+ * @see #isSetSnapshotRepository()
+ * @see #unsetSnapshotRepository()
+ * @see #setSnapshotRepository(DeploymentRepository)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDistributionManagement_SnapshotRepository()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='snapshotRepository' namespace='##targetNamespace'"
+ * @generated
+ */
+ DeploymentRepository getSnapshotRepository();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getSnapshotRepository
+ * <em>Snapshot Repository</em>}' containment reference. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Snapshot Repository</em>'
+ * containment reference.
+ * @see #isSetSnapshotRepository()
+ * @see #unsetSnapshotRepository()
+ * @see #getSnapshotRepository()
+ * @generated
+ */
+ void setSnapshotRepository(DeploymentRepository value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getSnapshotRepository
+ * <em>Snapshot Repository</em>}' containment reference. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetSnapshotRepository()
+ * @see #getSnapshotRepository()
+ * @see #setSnapshotRepository(DeploymentRepository)
+ * @generated
+ */
+ void unsetSnapshotRepository();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getSnapshotRepository
+ * <em>Snapshot Repository</em>}' containment reference is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Snapshot Repository</em>'
+ * containment reference is set.
+ * @see #unsetSnapshotRepository()
+ * @see #getSnapshotRepository()
+ * @see #setSnapshotRepository(DeploymentRepository)
+ * @generated
+ */
+ boolean isSetSnapshotRepository();
+
+ /**
+ * Returns the value of the '<em><b>Site</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc -->
+ * 4.0.0
+ *
+ * Information needed for deploying the web site of the project.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Site</em>' containment reference.
+ * @see #isSetSite()
+ * @see #unsetSite()
+ * @see #setSite(Site)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDistributionManagement_Site()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='site' namespace='##targetNamespace'"
+ * @generated
+ */
+ Site getSite();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getSite
+ * <em>Site</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Site</em>' containment reference.
+ * @see #isSetSite()
+ * @see #unsetSite()
+ * @see #getSite()
+ * @generated
+ */
+ void setSite(Site value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getSite
+ * <em>Site</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetSite()
+ * @see #getSite()
+ * @see #setSite(Site)
+ * @generated
+ */
+ void unsetSite();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getSite
+ * <em>Site</em>}' containment reference is set. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Site</em>' containment reference is
+ * set.
+ * @see #unsetSite()
+ * @see #getSite()
+ * @see #setSite(Site)
+ * @generated
+ */
+ boolean isSetSite();
+
+ /**
+ * Returns the value of the '<em><b>Download Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0+
+ *
+ * The URL of the project's download page. If not given users will be
+ * referred to the homepage given by &lt;code&gt;url&lt;/code&gt;. This is
+ * given to assist in locating artifacts that are not in the repository due
+ * to licensing restrictions.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Download Url</em>' attribute.
+ * @see #setDownloadUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDistributionManagement_DownloadUrl()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='downloadUrl' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getDownloadUrl();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getDownloadUrl
+ * <em>Download Url</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Download Url</em>' attribute.
+ * @see #getDownloadUrl()
+ * @generated
+ */
+ void setDownloadUrl(String value);
+
+ /**
+ * Returns the value of the '<em><b>Relocation</b></em>' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0
+ *
+ * Relocation information of the artifact if it has been moved to a new
+ * group ID and/or artifact ID.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Relocation</em>' containment reference.
+ * @see #isSetRelocation()
+ * @see #unsetRelocation()
+ * @see #setRelocation(Relocation)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDistributionManagement_Relocation()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='relocation' namespace='##targetNamespace'"
+ * @generated
+ */
+ Relocation getRelocation();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getRelocation
+ * <em>Relocation</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Relocation</em>' containment
+ * reference.
+ * @see #isSetRelocation()
+ * @see #unsetRelocation()
+ * @see #getRelocation()
+ * @generated
+ */
+ void setRelocation(Relocation value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getRelocation
+ * <em>Relocation</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetRelocation()
+ * @see #getRelocation()
+ * @see #setRelocation(Relocation)
+ * @generated
+ */
+ void unsetRelocation();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getRelocation
+ * <em>Relocation</em>}' containment reference is set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Relocation</em>' containment
+ * reference is set.
+ * @see #unsetRelocation()
+ * @see #getRelocation()
+ * @see #setRelocation(Relocation)
+ * @generated
+ */
+ boolean isSetRelocation();
+
+ /**
+ * Returns the value of the '<em><b>Status</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Gives the status of this artifact in the remote repository. This must not
+ * be set in your local project, as it is updated by tools placing it in the
+ * reposiory. Valid values are: &lt;code&gt;none&lt;/code&gt; (default),
+ * &lt;code&gt;converted&lt;/code&gt; (repository manager converted this
+ * from an Maven 1 POM), &lt;code&gt;partner&lt;/code&gt; (directly synced
+ * from a partner Maven 2 repository), &lt;code&gt;deployed&lt;/code&gt;
+ * (was deployed from a Maven 2 instance), &lt;code&gt;verified&lt;/code&gt;
+ * (has been hand verified as correct and final).
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Status</em>' attribute.
+ * @see #setStatus(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDistributionManagement_Status()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='status' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getStatus();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getStatus
+ * <em>Status</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Status</em>' attribute.
+ * @see #getStatus()
+ * @generated
+ */
+ void setStatus(String value);
+
+} // DistributionManagement
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DocumentRoot.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DocumentRoot.java
new file mode 100644
index 00000000..f7cb524d
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/DocumentRoot.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EMap;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.util.FeatureMap;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Document Root</b></em>'. <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.DocumentRoot#getMixed <em>Mixed</em>}
+ * </li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.DocumentRoot#getXMLNSPrefixMap <em>
+ * XMLNS Prefix Map</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.DocumentRoot#getXSISchemaLocation
+ * <em>XSI Schema Location</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.DocumentRoot#getProject <em>Project
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDocumentRoot()
+ * @model extendedMetaData="name='' kind='mixed'"
+ * @generated
+ */
+public interface DocumentRoot extends EObject {
+ /**
+ * Returns the value of the '<em><b>Mixed</b></em>' attribute list. The list
+ * contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Mixed</em>' attribute list isn't clear, there
+ * really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Mixed</em>' attribute list.
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDocumentRoot_Mixed()
+ * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry"
+ * many="true"
+ * extendedMetaData="kind='elementWildcard' name=':mixed'"
+ * @generated
+ */
+ FeatureMap getMixed();
+
+ /**
+ * Returns the value of the '<em><b>XMLNS Prefix Map</b></em>' map. The key
+ * is of type {@link java.lang.String}, and the value is of type
+ * {@link java.lang.String}, <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>XMLNS Prefix Map</em>' map isn't clear, there
+ * really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>XMLNS Prefix Map</em>' map.
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDocumentRoot_XMLNSPrefixMap()
+ * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>"
+ * transient="true"
+ * extendedMetaData="kind='attribute' name='xmlns:prefix'"
+ * @generated
+ */
+ EMap<String, String> getXMLNSPrefixMap();
+
+ /**
+ * Returns the value of the '<em><b>XSI Schema Location</b></em>' map. The
+ * key is of type {@link java.lang.String}, and the value is of type
+ * {@link java.lang.String}, <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>XSI Schema Location</em>' map isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>XSI Schema Location</em>' map.
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDocumentRoot_XSISchemaLocation()
+ * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry<org.eclipse.emf.ecore.EString, org.eclipse.emf.ecore.EString>"
+ * transient="true"
+ * extendedMetaData="kind='attribute' name='xsi:schemaLocation'"
+ * @generated
+ */
+ EMap<String, String> getXSISchemaLocation();
+
+ /**
+ * Returns the value of the '<em><b>Project</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc -->
+ * 3.0.0+
+ *
+ * The &lt;code&gt;&amp;lt;project&amp;gt;&lt;/code&gt; element is the root
+ * of the descriptor. The following table lists all of the possible child
+ * elements.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Project</em>' containment reference.
+ * @see #setProject(Model)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getDocumentRoot_Project()
+ * @model containment="true" upper="-2" transient="true" volatile="true"
+ * derived="true" extendedMetaData=
+ * "kind='element' name='project' namespace='##targetNamespace'"
+ * @generated
+ */
+ Model getProject();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.DocumentRoot#getProject
+ * <em>Project</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Project</em>' containment reference.
+ * @see #getProject()
+ * @generated
+ */
+ void setProject(Model value);
+
+} // DocumentRoot
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Exclusion.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Exclusion.java
new file mode 100644
index 00000000..90ee1feb
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Exclusion.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Exclusion</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0 <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Exclusion#getArtifactId <em>Artifact
+ * Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Exclusion#getGroupId <em>Group Id
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getExclusion()
+ * @model extendedMetaData="name='Exclusion' kind='elementOnly'"
+ * @generated
+ */
+public interface Exclusion extends EObject {
+ /**
+ * Returns the value of the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The artifact ID of the project to exclude. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Artifact Id</em>' attribute.
+ * @see #setArtifactId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getExclusion_ArtifactId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='artifactId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getArtifactId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Exclusion#getArtifactId
+ * <em>Artifact Id</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Artifact Id</em>' attribute.
+ * @see #getArtifactId()
+ * @generated
+ */
+ void setArtifactId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The group ID of the project to exclude. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Group Id</em>' attribute.
+ * @see #setGroupId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getExclusion_GroupId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='groupId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getGroupId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Exclusion#getGroupId
+ * <em>Group Id</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Group Id</em>' attribute.
+ * @see #getGroupId()
+ * @generated
+ */
+ void setGroupId(String value);
+
+} // Exclusion
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Extension.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Extension.java
new file mode 100644
index 00000000..aaca9e41
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Extension.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Extension</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0 Describes a build extension to utilise. <!--
+ * end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Extension#getGroupId <em>Group Id
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Extension#getArtifactId <em>Artifact
+ * Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Extension#getVersion <em>Version
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getExtension()
+ * @model extendedMetaData="name='Extension' kind='elementOnly'"
+ * @generated
+ */
+public interface Extension extends EObject {
+ /**
+ * Returns the value of the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The group ID of the extension's artifact. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Group Id</em>' attribute.
+ * @see #setGroupId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getExtension_GroupId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='groupId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getGroupId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Extension#getGroupId
+ * <em>Group Id</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Group Id</em>' attribute.
+ * @see #getGroupId()
+ * @generated
+ */
+ void setGroupId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The artifact ID of the extension. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Artifact Id</em>' attribute.
+ * @see #setArtifactId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getExtension_ArtifactId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='artifactId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getArtifactId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Extension#getArtifactId
+ * <em>Artifact Id</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Artifact Id</em>' attribute.
+ * @see #getArtifactId()
+ * @generated
+ */
+ void setArtifactId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The version of the extension. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Version</em>' attribute.
+ * @see #setVersion(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getExtension_Version()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='version' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getVersion();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Extension#getVersion
+ * <em>Version</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Version</em>' attribute.
+ * @see #getVersion()
+ * @generated
+ */
+ void setVersion(String value);
+
+} // Extension
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/IssueManagement.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/IssueManagement.java
new file mode 100644
index 00000000..ed7485eb
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/IssueManagement.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Issue Management</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0
+ *
+ * Information about the issue tracking (or bug tracking) system used to manage
+ * this project.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.IssueManagement#getSystem <em>System
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.IssueManagement#getUrl <em>Url</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getIssueManagement()
+ * @model extendedMetaData="name='IssueManagement' kind='elementOnly'"
+ * @generated
+ */
+public interface IssueManagement extends EObject {
+ /**
+ * Returns the value of the '<em><b>System</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The name of the issue management system, e.g. Bugzilla <!-- end-model-doc
+ * -->
+ *
+ * @return the value of the '<em>System</em>' attribute.
+ * @see #setSystem(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getIssueManagement_System()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='system' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getSystem();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.IssueManagement#getSystem
+ * <em>System</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>System</em>' attribute.
+ * @see #getSystem()
+ * @generated
+ */
+ void setSystem(String value);
+
+ /**
+ * Returns the value of the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * URL for the issue management system used by the project. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Url</em>' attribute.
+ * @see #setUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getIssueManagement_Url()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='url' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUrl();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.IssueManagement#getUrl <em>Url</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Url</em>' attribute.
+ * @see #getUrl()
+ * @generated
+ */
+ void setUrl(String value);
+
+} // IssueManagement
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/License.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/License.java
new file mode 100644
index 00000000..4dad70d0
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/License.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>License</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 3.0.0+
+ *
+ * Describes the licenses for this project. This is used to generate the license
+ * page of the project's web site, as well as being taken into consideration in
+ * other reporting and validation. The licenses listed for the project are that
+ * of the project itself, and not of dependencies.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.License#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.License#getUrl <em>Url</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.License#getDistribution <em>
+ * Distribution</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.License#getComments <em>Comments
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getLicense()
+ * @model extendedMetaData="name='License' kind='elementOnly'"
+ * @generated
+ */
+public interface License extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The full legal name of the license. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getLicense_Name()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='name' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.License#getName <em>Name</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The official url for the license text. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Url</em>' attribute.
+ * @see #setUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getLicense_Url()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='url' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUrl();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.License#getUrl <em>Url</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Url</em>' attribute.
+ * @see #getUrl()
+ * @generated
+ */
+ void setUrl(String value);
+
+ /**
+ * Returns the value of the '<em><b>Distribution</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The primary method by which this project may be distributed. &lt;dl&gt;
+ * &lt;dt&gt;repo&lt;/dt&gt; &lt;dd&gt;may be downloaded from the Maven
+ * repository&lt;/dd&gt; &lt;dt&gt;manual&lt;/dt&gt; &lt;dd&gt;user must
+ * manually download and install the dependency.&lt;/dd&gt; &lt;/dl&gt;
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Distribution</em>' attribute.
+ * @see #setDistribution(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getLicense_Distribution()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='distribution' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getDistribution();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.License#getDistribution
+ * <em>Distribution</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Distribution</em>' attribute.
+ * @see #getDistribution()
+ * @generated
+ */
+ void setDistribution(String value);
+
+ /**
+ * Returns the value of the '<em><b>Comments</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * Addendum information pertaining to this license.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Comments</em>' attribute.
+ * @see #setComments(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getLicense_Comments()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='comments' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getComments();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.License#getComments
+ * <em>Comments</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Comments</em>' attribute.
+ * @see #getComments()
+ * @generated
+ */
+ void setComments(String value);
+
+} // License
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/MailingList.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/MailingList.java
new file mode 100644
index 00000000..11913cd9
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/MailingList.java
@@ -0,0 +1,246 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Mailing List</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 3.0.0+
+ *
+ * This element describes all of the mailing lists associated with a project.
+ * The auto-generated site references this information.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.MailingList#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.MailingList#getSubscribe <em>
+ * Subscribe</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.MailingList#getUnsubscribe <em>
+ * Unsubscribe</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.MailingList#getPost <em>Post</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.MailingList#getArchive <em>Archive
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.MailingList#getOtherArchives <em>
+ * Other Archives</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getMailingList()
+ * @model extendedMetaData="name='MailingList' kind='elementOnly'"
+ * @generated
+ */
+public interface MailingList extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The name of the mailing list. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getMailingList_Name()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='name' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.MailingList#getName <em>Name</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Subscribe</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The email address or link that can be used to subscribe to the mailing
+ * list. If this is an email address, a &lt;code&gt;mailto:&lt;/code&gt;
+ * link will automatically be created when the documentation is created.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Subscribe</em>' attribute.
+ * @see #setSubscribe(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getMailingList_Subscribe()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='subscribe' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getSubscribe();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.MailingList#getSubscribe
+ * <em>Subscribe</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Subscribe</em>' attribute.
+ * @see #getSubscribe()
+ * @generated
+ */
+ void setSubscribe(String value);
+
+ /**
+ * Returns the value of the '<em><b>Unsubscribe</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The email address or link that can be used to unsubscribe to the mailing
+ * list. If this is an email address, a &lt;code&gt;mailto:&lt;/code&gt;
+ * link will automatically be created when the documentation is created.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Unsubscribe</em>' attribute.
+ * @see #setUnsubscribe(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getMailingList_Unsubscribe()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='unsubscribe' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUnsubscribe();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.MailingList#getUnsubscribe
+ * <em>Unsubscribe</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Unsubscribe</em>' attribute.
+ * @see #getUnsubscribe()
+ * @generated
+ */
+ void setUnsubscribe(String value);
+
+ /**
+ * Returns the value of the '<em><b>Post</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The email address or link that can be used to post to the mailing list.
+ * If this is an email address, a &lt;code&gt;mailto:&lt;/code&gt; link will
+ * automatically be created when the documentation is created.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Post</em>' attribute.
+ * @see #setPost(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getMailingList_Post()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='post' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getPost();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.MailingList#getPost <em>Post</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Post</em>' attribute.
+ * @see #getPost()
+ * @generated
+ */
+ void setPost(String value);
+
+ /**
+ * Returns the value of the '<em><b>Archive</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The link to a URL where you can browse the mailing list archive.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Archive</em>' attribute.
+ * @see #setArchive(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getMailingList_Archive()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='archive' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getArchive();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.MailingList#getArchive
+ * <em>Archive</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Archive</em>' attribute.
+ * @see #getArchive()
+ * @generated
+ */
+ void setArchive(String value);
+
+ /**
+ * Returns the value of the '<em><b>Other Archives</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}. <!--
+ * begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Other Archives</em>' attribute list isn't
+ * clear, there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Other Archives</em>' attribute list.
+ * @see #isSetOtherArchives()
+ * @see #unsetOtherArchives()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getMailingList_OtherArchives()
+ * @model unique="false" unsettable="true"
+ * @generated
+ */
+ EList<String> getOtherArchives();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.MailingList#getOtherArchives
+ * <em>Other Archives</em>}' attribute list. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetOtherArchives()
+ * @see #getOtherArchives()
+ * @generated
+ */
+ void unsetOtherArchives();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.MailingList#getOtherArchives
+ * <em>Other Archives</em>}' attribute list is set. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Other Archives</em>' attribute list
+ * is set.
+ * @see #unsetOtherArchives()
+ * @see #getOtherArchives()
+ * @generated
+ */
+ boolean isSetOtherArchives();
+
+} // MailingList
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Model.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Model.java
new file mode 100644
index 00000000..98edd91d
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Model.java
@@ -0,0 +1,1448 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Model</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 3.0.0+
+ *
+ * The &lt;code&gt;&amp;lt;project&amp;gt;&lt;/code&gt; element is the root of
+ * the descriptor. The following table lists all of the possible child elements.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getParent <em>Parent</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getModelVersion <em>Model
+ * Version</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getGroupId <em>Group Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getArtifactId <em>Artifact Id
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getPackaging <em>Packaging
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getVersion <em>Version</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getDescription <em>Description
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getUrl <em>Url</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getPrerequisites <em>
+ * Prerequisites</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getIssueManagement <em>Issue
+ * Management</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getCiManagement <em>Ci
+ * Management</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getInceptionYear <em>Inception
+ * Year</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getMailingLists <em>Mailing
+ * Lists</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getDevelopers <em>Developers
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getContributors <em>
+ * Contributors</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getLicenses <em>Licenses</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getScm <em>Scm</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getOrganization <em>
+ * Organization</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getBuild <em>Build</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getProfiles <em>Profiles</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getRepositories <em>
+ * Repositories</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getPluginRepositories <em>
+ * Plugin Repositories</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getDependencies <em>
+ * Dependencies</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getReporting <em>Reporting
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getDependencyManagement <em>
+ * Dependency Management</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getDistributionManagement <em>
+ * Distribution Management</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getProperties <em>Properties
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Model#getModules <em>Modules</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel()
+ * @model extendedMetaData="name='Model' kind='elementOnly'"
+ * @generated
+ */
+public interface Model extends EObject {
+ /**
+ * Returns the value of the '<em><b>Parent</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc -->
+ * 4.0.0
+ *
+ * The location of the parent project, if one exists. Values from the parent
+ * project will be the default for this project if they are left
+ * unspecified. The location is given as a group ID, artifact ID and
+ * version.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Parent</em>' containment reference.
+ * @see #isSetParent()
+ * @see #unsetParent()
+ * @see #setParent(Parent)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Parent()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='parent' namespace='##targetNamespace'"
+ * @generated
+ */
+ Parent getParent();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getParent <em>Parent</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Parent</em>' containment reference.
+ * @see #isSetParent()
+ * @see #unsetParent()
+ * @see #getParent()
+ * @generated
+ */
+ void setParent(Parent value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getParent <em>Parent</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetParent()
+ * @see #getParent()
+ * @see #setParent(Parent)
+ * @generated
+ */
+ void unsetParent();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getParent <em>Parent</em>}'
+ * containment reference is set. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return whether the value of the '<em>Parent</em>' containment reference
+ * is set.
+ * @see #unsetParent()
+ * @see #getParent()
+ * @see #setParent(Parent)
+ * @generated
+ */
+ boolean isSetParent();
+
+ /**
+ * Returns the value of the '<em><b>Model Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * Declares to which version of project descriptor this POM conforms. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Model Version</em>' attribute.
+ * @see #setModelVersion(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_ModelVersion()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='modelVersion' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getModelVersion();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getModelVersion
+ * <em>Model Version</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Model Version</em>' attribute.
+ * @see #getModelVersion()
+ * @generated
+ */
+ void setModelVersion(String value);
+
+ /**
+ * Returns the value of the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * A universally unique identifier for a project. It is normal to use a
+ * fully-qualified package name to distinguish it from other projects with a
+ * similar name (eg. &lt;code&gt;org.apache.maven&lt;/code&gt;).
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Group Id</em>' attribute.
+ * @see #setGroupId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_GroupId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='groupId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getGroupId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getGroupId <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Group Id</em>' attribute.
+ * @see #getGroupId()
+ * @generated
+ */
+ void setGroupId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The identifier for this artifact that is unique within the group given by
+ * the group ID. An artifact is something that is either produced or used by
+ * a project. Examples of artifacts produced by Maven for a project include:
+ * JARs, source and binary distributions, and WARs.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Artifact Id</em>' attribute.
+ * @see #setArtifactId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_ArtifactId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='artifactId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getArtifactId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getArtifactId
+ * <em>Artifact Id</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Artifact Id</em>' attribute.
+ * @see #getArtifactId()
+ * @generated
+ */
+ void setArtifactId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Packaging</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The type of artifact this project produces, for example
+ * &lt;code&gt;jar&lt;/code&gt; &lt;code&gt;war&lt;/code&gt;
+ * &lt;code&gt;ear&lt;/code&gt; &lt;code&gt;pom&lt;/code&gt;. Plugins can
+ * create their own packaging, and therefore their own packaging types, so
+ * this list does not contain all possible types.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Packaging</em>' attribute.
+ * @see #isSetPackaging()
+ * @see #unsetPackaging()
+ * @see #setPackaging(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Packaging()
+ * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * extendedMetaData
+ * ="kind='element' name='packaging' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getPackaging();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getPackaging
+ * <em>Packaging</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Packaging</em>' attribute.
+ * @see #isSetPackaging()
+ * @see #unsetPackaging()
+ * @see #getPackaging()
+ * @generated
+ */
+ void setPackaging(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getPackaging
+ * <em>Packaging</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #isSetPackaging()
+ * @see #getPackaging()
+ * @see #setPackaging(String)
+ * @generated
+ */
+ void unsetPackaging();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getPackaging
+ * <em>Packaging</em>}' attribute is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Packaging</em>' attribute is set.
+ * @see #unsetPackaging()
+ * @see #getPackaging()
+ * @see #setPackaging(String)
+ * @generated
+ */
+ boolean isSetPackaging();
+
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The full name of the project.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Name()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='name' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.m2e.model.edit.pom.Model#getName
+ * <em>Name</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The current version of the artifact produced by this project.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Version</em>' attribute.
+ * @see #setVersion(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Version()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='version' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getVersion();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getVersion <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Version</em>' attribute.
+ * @see #getVersion()
+ * @generated
+ */
+ void setVersion(String value);
+
+ /**
+ * Returns the value of the '<em><b>Description</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * A detailed description of the project, used by Maven whenever it needs to
+ * describe the project, such as on the web site. While this element can be
+ * specified as CDATA to enable the use of HTML tags within the description,
+ * it is discouraged to allow plain text representation. If you need to
+ * modify the index page of the generated web site, you are able to specify
+ * your own instead of adjusting this text.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Description</em>' attribute.
+ * @see #setDescription(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Description()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='description' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getDescription();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getDescription
+ * <em>Description</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Description</em>' attribute.
+ * @see #getDescription()
+ * @generated
+ */
+ void setDescription(String value);
+
+ /**
+ * Returns the value of the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The URL to the project's homepage.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Url</em>' attribute.
+ * @see #setUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Url()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='url' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUrl();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.m2e.model.edit.pom.Model#getUrl
+ * <em>Url</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Url</em>' attribute.
+ * @see #getUrl()
+ * @generated
+ */
+ void setUrl(String value);
+
+ /**
+ * Returns the value of the '<em><b>Prerequisites</b></em>' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0
+ *
+ * Describes the prerequisites in the build environment for this project.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Prerequisites</em>' containment reference.
+ * @see #isSetPrerequisites()
+ * @see #unsetPrerequisites()
+ * @see #setPrerequisites(Prerequisites)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Prerequisites()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='prerequisites' namespace='##targetNamespace'"
+ * @generated
+ */
+ Prerequisites getPrerequisites();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getPrerequisites
+ * <em>Prerequisites</em>}' containment reference. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Prerequisites</em>' containment
+ * reference.
+ * @see #isSetPrerequisites()
+ * @see #unsetPrerequisites()
+ * @see #getPrerequisites()
+ * @generated
+ */
+ void setPrerequisites(Prerequisites value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getPrerequisites
+ * <em>Prerequisites</em>}' containment reference. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetPrerequisites()
+ * @see #getPrerequisites()
+ * @see #setPrerequisites(Prerequisites)
+ * @generated
+ */
+ void unsetPrerequisites();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getPrerequisites
+ * <em>Prerequisites</em>}' containment reference is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Prerequisites</em>' containment
+ * reference is set.
+ * @see #unsetPrerequisites()
+ * @see #getPrerequisites()
+ * @see #setPrerequisites(Prerequisites)
+ * @generated
+ */
+ boolean isSetPrerequisites();
+
+ /**
+ * Returns the value of the '<em><b>Issue Management</b></em>' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0 The project's issue management system
+ * information. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Issue Management</em>' containment
+ * reference.
+ * @see #isSetIssueManagement()
+ * @see #unsetIssueManagement()
+ * @see #setIssueManagement(IssueManagement)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_IssueManagement()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='issueManagement' namespace='##targetNamespace'"
+ * @generated
+ */
+ IssueManagement getIssueManagement();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getIssueManagement
+ * <em>Issue Management</em>}' containment reference. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Issue Management</em>' containment
+ * reference.
+ * @see #isSetIssueManagement()
+ * @see #unsetIssueManagement()
+ * @see #getIssueManagement()
+ * @generated
+ */
+ void setIssueManagement(IssueManagement value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getIssueManagement
+ * <em>Issue Management</em>}' containment reference. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetIssueManagement()
+ * @see #getIssueManagement()
+ * @see #setIssueManagement(IssueManagement)
+ * @generated
+ */
+ void unsetIssueManagement();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getIssueManagement
+ * <em>Issue Management</em>}' containment reference is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Issue Management</em>' containment
+ * reference is set.
+ * @see #unsetIssueManagement()
+ * @see #getIssueManagement()
+ * @see #setIssueManagement(IssueManagement)
+ * @generated
+ */
+ boolean isSetIssueManagement();
+
+ /**
+ * Returns the value of the '<em><b>Ci Management</b></em>' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0 The project's continuous integration
+ * information. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Ci Management</em>' containment reference.
+ * @see #isSetCiManagement()
+ * @see #unsetCiManagement()
+ * @see #setCiManagement(CiManagement)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_CiManagement()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='ciManagement' namespace='##targetNamespace'"
+ * @generated
+ */
+ CiManagement getCiManagement();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getCiManagement
+ * <em>Ci Management</em>}' containment reference. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Ci Management</em>' containment
+ * reference.
+ * @see #isSetCiManagement()
+ * @see #unsetCiManagement()
+ * @see #getCiManagement()
+ * @generated
+ */
+ void setCiManagement(CiManagement value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getCiManagement
+ * <em>Ci Management</em>}' containment reference. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetCiManagement()
+ * @see #getCiManagement()
+ * @see #setCiManagement(CiManagement)
+ * @generated
+ */
+ void unsetCiManagement();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getCiManagement
+ * <em>Ci Management</em>}' containment reference is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Ci Management</em>' containment
+ * reference is set.
+ * @see #unsetCiManagement()
+ * @see #getCiManagement()
+ * @see #setCiManagement(CiManagement)
+ * @generated
+ */
+ boolean isSetCiManagement();
+
+ /**
+ * Returns the value of the '<em><b>Inception Year</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * The year of the project's inception, specified with 4 digits. This value
+ * is used when generating copyright notices as well as being informational.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Inception Year</em>' attribute.
+ * @see #setInceptionYear(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_InceptionYear()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='inceptionYear' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getInceptionYear();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getInceptionYear
+ * <em>Inception Year</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Inception Year</em>' attribute.
+ * @see #getInceptionYear()
+ * @generated
+ */
+ void setInceptionYear(String value);
+
+ /**
+ * Returns the value of the '<em><b>Mailing Lists</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.MailingList}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * Contains information about a project's mailing lists.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Mailing Lists</em>' containment reference
+ * list.
+ * @see #isSetMailingLists()
+ * @see #unsetMailingLists()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_MailingLists()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='mailingLists' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<MailingList> getMailingLists();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getMailingLists
+ * <em>Mailing Lists</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetMailingLists()
+ * @see #getMailingLists()
+ * @generated
+ */
+ void unsetMailingLists();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getMailingLists
+ * <em>Mailing Lists</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Mailing Lists</em>' containment
+ * reference list is set.
+ * @see #unsetMailingLists()
+ * @see #getMailingLists()
+ * @generated
+ */
+ boolean isSetMailingLists();
+
+ /**
+ * Returns the value of the '<em><b>Developers</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Developer}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * Describes the committers of a project.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Developers</em>' containment reference
+ * list.
+ * @see #isSetDevelopers()
+ * @see #unsetDevelopers()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Developers()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='developers' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Developer> getDevelopers();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getDevelopers
+ * <em>Developers</em>}' containment reference list. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetDevelopers()
+ * @see #getDevelopers()
+ * @generated
+ */
+ void unsetDevelopers();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getDevelopers
+ * <em>Developers</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Developers</em>' containment
+ * reference list is set.
+ * @see #unsetDevelopers()
+ * @see #getDevelopers()
+ * @generated
+ */
+ boolean isSetDevelopers();
+
+ /**
+ * Returns the value of the '<em><b>Contributors</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * Describes the contributors to a project that are not yet committers.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Contributors</em>' containment reference
+ * list.
+ * @see #isSetContributors()
+ * @see #unsetContributors()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Contributors()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='contributors' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Contributor> getContributors();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getContributors
+ * <em>Contributors</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetContributors()
+ * @see #getContributors()
+ * @generated
+ */
+ void unsetContributors();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getContributors
+ * <em>Contributors</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Contributors</em>' containment
+ * reference list is set.
+ * @see #unsetContributors()
+ * @see #getContributors()
+ * @generated
+ */
+ boolean isSetContributors();
+
+ /**
+ * Returns the value of the '<em><b>Licenses</b></em>' containment reference
+ * list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.License}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * This element describes all of the licenses for this project. Each license
+ * is described by a &lt;code&gt;license&lt;/code&gt; element, which is then
+ * described by additional elements. Projects should only list the
+ * license(s) that applies to the project and not the licenses that apply to
+ * dependencies. If multiple licenses are listed, it is assumed that the
+ * user can select any of them, not that they must accept all.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Licenses</em>' containment reference list.
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Licenses()
+ * @model containment="true" extendedMetaData=
+ * "kind='element' name='licenses' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<License> getLicenses();
+
+ /**
+ * Returns the value of the '<em><b>Scm</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc -->
+ * 4.0.0
+ *
+ * Specification for the SCM used by the project, such as CVS, Subversion,
+ * etc. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Scm</em>' containment reference.
+ * @see #isSetScm()
+ * @see #unsetScm()
+ * @see #setScm(Scm)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Scm()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='scm' namespace='##targetNamespace'"
+ * @generated
+ */
+ Scm getScm();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.m2e.model.edit.pom.Model#getScm
+ * <em>Scm</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Scm</em>' containment reference.
+ * @see #isSetScm()
+ * @see #unsetScm()
+ * @see #getScm()
+ * @generated
+ */
+ void setScm(Scm value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getScm <em>Scm</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetScm()
+ * @see #getScm()
+ * @see #setScm(Scm)
+ * @generated
+ */
+ void unsetScm();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getScm <em>Scm</em>}'
+ * containment reference is set. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return whether the value of the '<em>Scm</em>' containment reference is
+ * set.
+ * @see #unsetScm()
+ * @see #getScm()
+ * @see #setScm(Scm)
+ * @generated
+ */
+ boolean isSetScm();
+
+ /**
+ * Returns the value of the '<em><b>Organization</b></em>' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 3.0.0+
+ *
+ * This element describes various attributes of the organization to which
+ * the project belongs. These attributes are utilized when documentation is
+ * created (for copyright notices and links).
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Organization</em>' containment reference.
+ * @see #isSetOrganization()
+ * @see #unsetOrganization()
+ * @see #setOrganization(Organization)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Organization()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='organization' namespace='##targetNamespace'"
+ * @generated
+ */
+ Organization getOrganization();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getOrganization
+ * <em>Organization</em>}' containment reference. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Organization</em>' containment
+ * reference.
+ * @see #isSetOrganization()
+ * @see #unsetOrganization()
+ * @see #getOrganization()
+ * @generated
+ */
+ void setOrganization(Organization value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getOrganization
+ * <em>Organization</em>}' containment reference. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetOrganization()
+ * @see #getOrganization()
+ * @see #setOrganization(Organization)
+ * @generated
+ */
+ void unsetOrganization();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getOrganization
+ * <em>Organization</em>}' containment reference is set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Organization</em>' containment
+ * reference is set.
+ * @see #unsetOrganization()
+ * @see #getOrganization()
+ * @see #setOrganization(Organization)
+ * @generated
+ */
+ boolean isSetOrganization();
+
+ /**
+ * Returns the value of the '<em><b>Build</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc -->
+ * 3.0.0+ Information required to build the project. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Build</em>' containment reference.
+ * @see #isSetBuild()
+ * @see #unsetBuild()
+ * @see #setBuild(Build)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Build()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='build' namespace='##targetNamespace'"
+ * @generated
+ */
+ Build getBuild();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getBuild <em>Build</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Build</em>' containment reference.
+ * @see #isSetBuild()
+ * @see #unsetBuild()
+ * @see #getBuild()
+ * @generated
+ */
+ void setBuild(Build value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getBuild <em>Build</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetBuild()
+ * @see #getBuild()
+ * @see #setBuild(Build)
+ * @generated
+ */
+ void unsetBuild();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getBuild <em>Build</em>}'
+ * containment reference is set. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return whether the value of the '<em>Build</em>' containment reference
+ * is set.
+ * @see #unsetBuild()
+ * @see #getBuild()
+ * @see #setBuild(Build)
+ * @generated
+ */
+ boolean isSetBuild();
+
+ /**
+ * Returns the value of the '<em><b>Profiles</b></em>' containment reference
+ * list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Profile}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * A listing of project-local build profiles which will modify the build
+ * process when activated.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Profiles</em>' containment reference list.
+ * @see #isSetProfiles()
+ * @see #unsetProfiles()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Profiles()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='profiles' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Profile> getProfiles();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getProfiles <em>Profiles</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetProfiles()
+ * @see #getProfiles()
+ * @generated
+ */
+ void unsetProfiles();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getProfiles <em>Profiles</em>}'
+ * containment reference list is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Profiles</em>' containment
+ * reference list is set.
+ * @see #unsetProfiles()
+ * @see #getProfiles()
+ * @generated
+ */
+ boolean isSetProfiles();
+
+ /**
+ * Returns the value of the '<em><b>Repositories</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Repository}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0 The lists of the
+ * remote repositories for discovering dependencies and extensions. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Repositories</em>' containment reference
+ * list.
+ * @see #isSetRepositories()
+ * @see #unsetRepositories()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Repositories()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='repositories' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Repository> getRepositories();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getRepositories
+ * <em>Repositories</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetRepositories()
+ * @see #getRepositories()
+ * @generated
+ */
+ void unsetRepositories();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getRepositories
+ * <em>Repositories</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Repositories</em>' containment
+ * reference list is set.
+ * @see #unsetRepositories()
+ * @see #getRepositories()
+ * @generated
+ */
+ boolean isSetRepositories();
+
+ /**
+ * Returns the value of the '<em><b>Plugin Repositories</b></em>'
+ * containment reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Repository}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The lists of the remote repositories for discovering plugins for builds
+ * and reports. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Plugin Repositories</em>' containment
+ * reference list.
+ * @see #isSetPluginRepositories()
+ * @see #unsetPluginRepositories()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_PluginRepositories()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='pluginRepositories' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Repository> getPluginRepositories();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getPluginRepositories
+ * <em>Plugin Repositories</em>}' containment reference list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetPluginRepositories()
+ * @see #getPluginRepositories()
+ * @generated
+ */
+ void unsetPluginRepositories();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getPluginRepositories
+ * <em>Plugin Repositories</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Plugin Repositories</em>'
+ * containment reference list is set.
+ * @see #unsetPluginRepositories()
+ * @see #getPluginRepositories()
+ * @generated
+ */
+ boolean isSetPluginRepositories();
+
+ /**
+ * Returns the value of the '<em><b>Dependencies</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * This element describes all of the dependencies associated with a project.
+ * These dependencies are used to construct a classpath for your project
+ * during the build process. They are automatically downloaded from the
+ * repositories defined in this project. See &lt;a href="http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html"
+ * &gt;the dependency mechanism&lt;/a&gt; for more information.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Dependencies</em>' containment reference
+ * list.
+ * @see #isSetDependencies()
+ * @see #unsetDependencies()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Dependencies()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='dependencies' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Dependency> getDependencies();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getDependencies
+ * <em>Dependencies</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetDependencies()
+ * @see #getDependencies()
+ * @generated
+ */
+ void unsetDependencies();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getDependencies
+ * <em>Dependencies</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Dependencies</em>' containment
+ * reference list is set.
+ * @see #unsetDependencies()
+ * @see #getDependencies()
+ * @generated
+ */
+ boolean isSetDependencies();
+
+ /**
+ * Returns the value of the '<em><b>Reporting</b></em>' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0
+ *
+ * This element includes the specification of report plugins to use to
+ * generate the reports on the Maven-generated site. These reports will be
+ * run when a user executes &lt;code&gt;mvn site&lt;/code&gt;. All of the
+ * reports will be included in the navigation bar for browsing.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Reporting</em>' containment reference.
+ * @see #isSetReporting()
+ * @see #unsetReporting()
+ * @see #setReporting(Reporting)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Reporting()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='reporting' namespace='##targetNamespace'"
+ * @generated
+ */
+ Reporting getReporting();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getReporting
+ * <em>Reporting</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Reporting</em>' containment
+ * reference.
+ * @see #isSetReporting()
+ * @see #unsetReporting()
+ * @see #getReporting()
+ * @generated
+ */
+ void setReporting(Reporting value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getReporting
+ * <em>Reporting</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetReporting()
+ * @see #getReporting()
+ * @see #setReporting(Reporting)
+ * @generated
+ */
+ void unsetReporting();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getReporting
+ * <em>Reporting</em>}' containment reference is set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Reporting</em>' containment
+ * reference is set.
+ * @see #unsetReporting()
+ * @see #getReporting()
+ * @see #setReporting(Reporting)
+ * @generated
+ */
+ boolean isSetReporting();
+
+ /**
+ * Returns the value of the '<em><b>Dependency Management</b></em>'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0
+ *
+ * Default dependency information for projects that inherit from this one.
+ * The dependencies in this section are not immediately resolved. Instead,
+ * when a POM derived from this one declares a dependency described by a
+ * matching groupId and artifactId, the version and other values from this
+ * section are used for that dependency if they were not already specified.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Dependency Management</em>' containment
+ * reference.
+ * @see #isSetDependencyManagement()
+ * @see #unsetDependencyManagement()
+ * @see #setDependencyManagement(DependencyManagement)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_DependencyManagement()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='dependencyManagement' namespace='##targetNamespace'"
+ * @generated
+ */
+ DependencyManagement getDependencyManagement();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getDependencyManagement
+ * <em>Dependency Management</em>}' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Dependency Management</em>'
+ * containment reference.
+ * @see #isSetDependencyManagement()
+ * @see #unsetDependencyManagement()
+ * @see #getDependencyManagement()
+ * @generated
+ */
+ void setDependencyManagement(DependencyManagement value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getDependencyManagement
+ * <em>Dependency Management</em>}' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetDependencyManagement()
+ * @see #getDependencyManagement()
+ * @see #setDependencyManagement(DependencyManagement)
+ * @generated
+ */
+ void unsetDependencyManagement();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getDependencyManagement
+ * <em>Dependency Management</em>}' containment reference is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Dependency Management</em>'
+ * containment reference is set.
+ * @see #unsetDependencyManagement()
+ * @see #getDependencyManagement()
+ * @see #setDependencyManagement(DependencyManagement)
+ * @generated
+ */
+ boolean isSetDependencyManagement();
+
+ /**
+ * Returns the value of the '<em><b>Distribution Management</b></em>'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0 Distribution information for a project that
+ * enables deployment of the site and artifacts to remote web servers and
+ * repositories respectively. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Distribution Management</em>' containment
+ * reference.
+ * @see #isSetDistributionManagement()
+ * @see #unsetDistributionManagement()
+ * @see #setDistributionManagement(DistributionManagement)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_DistributionManagement()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='distributionManagement' namespace='##targetNamespace'"
+ * @generated
+ */
+ DistributionManagement getDistributionManagement();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getDistributionManagement
+ * <em>Distribution Management</em>}' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Distribution Management</em>'
+ * containment reference.
+ * @see #isSetDistributionManagement()
+ * @see #unsetDistributionManagement()
+ * @see #getDistributionManagement()
+ * @generated
+ */
+ void setDistributionManagement(DistributionManagement value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getDistributionManagement
+ * <em>Distribution Management</em>}' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetDistributionManagement()
+ * @see #getDistributionManagement()
+ * @see #setDistributionManagement(DistributionManagement)
+ * @generated
+ */
+ void unsetDistributionManagement();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getDistributionManagement
+ * <em>Distribution Management</em>}' containment reference is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Distribution Management</em>'
+ * containment reference is set.
+ * @see #unsetDistributionManagement()
+ * @see #getDistributionManagement()
+ * @see #setDistributionManagement(DistributionManagement)
+ * @generated
+ */
+ boolean isSetDistributionManagement();
+
+ /**
+ * Returns the value of the '<em><b>Properties</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.PropertyElement}. <!-- begin-user-doc
+ * --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Properties that can be used throughout the POM as a substitution, and are
+ * used as filters in resources if enabled. The format is
+ * &lt;code&gt;&amp;lt;name&amp;gt;value&amp;lt;/name&amp;gt;&lt;/code&gt;.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Properties</em>' containment reference
+ * list.
+ * @see #isSetProperties()
+ * @see #unsetProperties()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Properties()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='properties' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<PropertyElement> getProperties();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getProperties
+ * <em>Properties</em>}' containment reference list. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetProperties()
+ * @see #getProperties()
+ * @generated
+ */
+ void unsetProperties();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getProperties
+ * <em>Properties</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Properties</em>' containment
+ * reference list is set.
+ * @see #unsetProperties()
+ * @see #getProperties()
+ * @generated
+ */
+ boolean isSetProperties();
+
+ /**
+ * Returns the value of the '<em><b>Modules</b></em>' attribute list. The
+ * list contents are of type {@link java.lang.String}. <!-- begin-user-doc
+ * -->
+ * <p>
+ * If the meaning of the '<em>Modules</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Modules</em>' attribute list.
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getModel_Modules()
+ * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * @generated
+ */
+ EList<String> getModules();
+
+} // Model
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Notifier.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Notifier.java
new file mode 100644
index 00000000..509365ac
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Notifier.java
@@ -0,0 +1,429 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Notifier</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0
+ *
+ * Configures one method for notifying users/developers when a build breaks.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Notifier#getType <em>Type</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnError <em>Send On
+ * Error</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnFailure <em>Send On
+ * Failure</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnSuccess <em>Send On
+ * Success</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnWarning <em>Send On
+ * Warning</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Notifier#getAddress <em>Address</em>}
+ * </li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Notifier#getConfiguration <em>
+ * Configuration</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getNotifier()
+ * @model extendedMetaData="name='Notifier' kind='elementOnly'"
+ * @generated
+ */
+public interface Notifier extends EObject {
+ /**
+ * Returns the value of the '<em><b>Type</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The mechanism used to deliver notifications. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Type</em>' attribute.
+ * @see #isSetType()
+ * @see #unsetType()
+ * @see #setType(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getNotifier_Type()
+ * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * extendedMetaData
+ * ="kind='element' name='type' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getType();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getType <em>Type</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Type</em>' attribute.
+ * @see #isSetType()
+ * @see #unsetType()
+ * @see #getType()
+ * @generated
+ */
+ void setType(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getType <em>Type</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetType()
+ * @see #getType()
+ * @see #setType(String)
+ * @generated
+ */
+ void unsetType();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getType <em>Type</em>}'
+ * attribute is set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Type</em>' attribute is set.
+ * @see #unsetType()
+ * @see #getType()
+ * @see #setType(String)
+ * @generated
+ */
+ boolean isSetType();
+
+ /**
+ * Returns the value of the '<em><b>Send On Error</b></em>' attribute. The
+ * default value is <code>"true"</code>. <!-- begin-user-doc --> <!--
+ * end-user-doc --> <!-- begin-model-doc --> 4.0.0 Whether to send
+ * notifications on error. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Send On Error</em>' attribute.
+ * @see #isSetSendOnError()
+ * @see #unsetSendOnError()
+ * @see #setSendOnError(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getNotifier_SendOnError()
+ * @model default="true" unsettable="true"
+ * dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='sendOnError' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getSendOnError();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnError
+ * <em>Send On Error</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Send On Error</em>' attribute.
+ * @see #isSetSendOnError()
+ * @see #unsetSendOnError()
+ * @see #getSendOnError()
+ * @generated
+ */
+ void setSendOnError(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnError
+ * <em>Send On Error</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetSendOnError()
+ * @see #getSendOnError()
+ * @see #setSendOnError(String)
+ * @generated
+ */
+ void unsetSendOnError();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnError
+ * <em>Send On Error</em>}' attribute is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Send On Error</em>' attribute is
+ * set.
+ * @see #unsetSendOnError()
+ * @see #getSendOnError()
+ * @see #setSendOnError(String)
+ * @generated
+ */
+ boolean isSetSendOnError();
+
+ /**
+ * Returns the value of the '<em><b>Send On Failure</b></em>' attribute. The
+ * default value is <code>"true"</code>. <!-- begin-user-doc --> <!--
+ * end-user-doc --> <!-- begin-model-doc --> 4.0.0 Whether to send
+ * notifications on failure. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Send On Failure</em>' attribute.
+ * @see #isSetSendOnFailure()
+ * @see #unsetSendOnFailure()
+ * @see #setSendOnFailure(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getNotifier_SendOnFailure()
+ * @model default="true" unsettable="true"
+ * dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='sendOnFailure' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getSendOnFailure();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnFailure
+ * <em>Send On Failure</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Send On Failure</em>' attribute.
+ * @see #isSetSendOnFailure()
+ * @see #unsetSendOnFailure()
+ * @see #getSendOnFailure()
+ * @generated
+ */
+ void setSendOnFailure(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnFailure
+ * <em>Send On Failure</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetSendOnFailure()
+ * @see #getSendOnFailure()
+ * @see #setSendOnFailure(String)
+ * @generated
+ */
+ void unsetSendOnFailure();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnFailure
+ * <em>Send On Failure</em>}' attribute is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Send On Failure</em>' attribute is
+ * set.
+ * @see #unsetSendOnFailure()
+ * @see #getSendOnFailure()
+ * @see #setSendOnFailure(String)
+ * @generated
+ */
+ boolean isSetSendOnFailure();
+
+ /**
+ * Returns the value of the '<em><b>Send On Success</b></em>' attribute. The
+ * default value is <code>"true"</code>. <!-- begin-user-doc --> <!--
+ * end-user-doc --> <!-- begin-model-doc --> 4.0.0 Whether to send
+ * notifications on success. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Send On Success</em>' attribute.
+ * @see #isSetSendOnSuccess()
+ * @see #unsetSendOnSuccess()
+ * @see #setSendOnSuccess(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getNotifier_SendOnSuccess()
+ * @model default="true" unsettable="true"
+ * dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='sendOnSuccess' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getSendOnSuccess();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnSuccess
+ * <em>Send On Success</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Send On Success</em>' attribute.
+ * @see #isSetSendOnSuccess()
+ * @see #unsetSendOnSuccess()
+ * @see #getSendOnSuccess()
+ * @generated
+ */
+ void setSendOnSuccess(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnSuccess
+ * <em>Send On Success</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetSendOnSuccess()
+ * @see #getSendOnSuccess()
+ * @see #setSendOnSuccess(String)
+ * @generated
+ */
+ void unsetSendOnSuccess();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnSuccess
+ * <em>Send On Success</em>}' attribute is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Send On Success</em>' attribute is
+ * set.
+ * @see #unsetSendOnSuccess()
+ * @see #getSendOnSuccess()
+ * @see #setSendOnSuccess(String)
+ * @generated
+ */
+ boolean isSetSendOnSuccess();
+
+ /**
+ * Returns the value of the '<em><b>Send On Warning</b></em>' attribute. The
+ * default value is <code>"true"</code>. <!-- begin-user-doc --> <!--
+ * end-user-doc --> <!-- begin-model-doc --> 4.0.0 Whether to send
+ * notifications on warning. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Send On Warning</em>' attribute.
+ * @see #isSetSendOnWarning()
+ * @see #unsetSendOnWarning()
+ * @see #setSendOnWarning(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getNotifier_SendOnWarning()
+ * @model default="true" unsettable="true"
+ * dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='sendOnWarning' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getSendOnWarning();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnWarning
+ * <em>Send On Warning</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Send On Warning</em>' attribute.
+ * @see #isSetSendOnWarning()
+ * @see #unsetSendOnWarning()
+ * @see #getSendOnWarning()
+ * @generated
+ */
+ void setSendOnWarning(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnWarning
+ * <em>Send On Warning</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetSendOnWarning()
+ * @see #getSendOnWarning()
+ * @see #setSendOnWarning(String)
+ * @generated
+ */
+ void unsetSendOnWarning();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnWarning
+ * <em>Send On Warning</em>}' attribute is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Send On Warning</em>' attribute is
+ * set.
+ * @see #unsetSendOnWarning()
+ * @see #getSendOnWarning()
+ * @see #setSendOnWarning(String)
+ * @generated
+ */
+ boolean isSetSendOnWarning();
+
+ /**
+ * Returns the value of the '<em><b>Address</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * &lt;b&gt;Deprecated&lt;/b&gt;. Where to send the notification to - eg
+ * email address.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Address</em>' attribute.
+ * @see #setAddress(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getNotifier_Address()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='address' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getAddress();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getAddress <em>Address</em>}
+ * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Address</em>' attribute.
+ * @see #getAddress()
+ * @generated
+ */
+ void setAddress(String value);
+
+ /**
+ * Returns the value of the '<em><b>Configuration</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.PropertyElement}. <!-- begin-user-doc
+ * -->
+ * <p>
+ * If the meaning of the '<em>Configuration</em>' containment reference list
+ * isn't clear, there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Configuration</em>' containment reference
+ * list.
+ * @see #isSetConfiguration()
+ * @see #unsetConfiguration()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getNotifier_Configuration()
+ * @model containment="true" unsettable="true"
+ * @generated
+ */
+ EList<PropertyElement> getConfiguration();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getConfiguration
+ * <em>Configuration</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetConfiguration()
+ * @see #getConfiguration()
+ * @generated
+ */
+ void unsetConfiguration();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier#getConfiguration
+ * <em>Configuration</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Configuration</em>' containment
+ * reference list is set.
+ * @see #unsetConfiguration()
+ * @see #getConfiguration()
+ * @generated
+ */
+ boolean isSetConfiguration();
+
+} // Notifier
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Organization.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Organization.java
new file mode 100644
index 00000000..655f39b0
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Organization.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Organization</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 3.0.0+ Specifies the organization that produces this
+ * project. <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Organization#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Organization#getUrl <em>Url</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getOrganization()
+ * @model extendedMetaData="name='Organization' kind='elementOnly'"
+ * @generated
+ */
+public interface Organization extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The full name of the organization. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getOrganization_Name()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='name' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Organization#getName <em>Name</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ * The URL to the organization's home page. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Url</em>' attribute.
+ * @see #setUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getOrganization_Url()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='url' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUrl();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Organization#getUrl <em>Url</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Url</em>' attribute.
+ * @see #getUrl()
+ * @generated
+ */
+ void setUrl(String value);
+
+} // Organization
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Parent.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Parent.java
new file mode 100644
index 00000000..f98f5fe9
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Parent.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Parent</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0 <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Parent#getArtifactId <em>Artifact Id
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Parent#getGroupId <em>Group Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Parent#getVersion <em>Version</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Parent#getRelativePath <em>Relative
+ * Path</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getParent()
+ * @model extendedMetaData="name='Parent' kind='elementOnly'"
+ * @generated
+ */
+public interface Parent extends EObject {
+ /**
+ * Returns the value of the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The artifact id of the parent project to inherit from. <!-- end-model-doc
+ * -->
+ *
+ * @return the value of the '<em>Artifact Id</em>' attribute.
+ * @see #setArtifactId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getParent_ArtifactId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='artifactId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getArtifactId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Parent#getArtifactId
+ * <em>Artifact Id</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Artifact Id</em>' attribute.
+ * @see #getArtifactId()
+ * @generated
+ */
+ void setArtifactId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The group id of the parent project to inherit from. <!-- end-model-doc
+ * -->
+ *
+ * @return the value of the '<em>Group Id</em>' attribute.
+ * @see #setGroupId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getParent_GroupId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='groupId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getGroupId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Parent#getGroupId <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Group Id</em>' attribute.
+ * @see #getGroupId()
+ * @generated
+ */
+ void setGroupId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The version of the parent project to inherit. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Version</em>' attribute.
+ * @see #setVersion(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getParent_Version()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='version' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getVersion();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Parent#getVersion <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Version</em>' attribute.
+ * @see #getVersion()
+ * @generated
+ */
+ void setVersion(String value);
+
+ /**
+ * Returns the value of the '<em><b>Relative Path</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The relative path of the parent &lt;code&gt;pom.xml&lt;/code&gt; file
+ * within the check out. The default value is
+ * &lt;code&gt;../pom.xml&lt;/code&gt;. Maven looks for the parent pom first
+ * in the reactor of currently building projects, then in this location on
+ * the filesystem, then the local repository, and lastly in the remote repo.
+ * &lt;code&gt;relativePath&lt;/code&gt; allows you to select a different
+ * location, for example when your structure is flat, or deeper without an
+ * intermediate parent pom. However, the group ID, artifact ID and version
+ * are still required, and must match the file in the location given or it
+ * will revert to the repository for the POM. This feature is only for
+ * enhancing the development in a local checkout of that project.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Relative Path</em>' attribute.
+ * @see #setRelativePath(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getParent_RelativePath()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='relativePath' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getRelativePath();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Parent#getRelativePath
+ * <em>Relative Path</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Relative Path</em>' attribute.
+ * @see #getRelativePath()
+ * @generated
+ */
+ void setRelativePath(String value);
+
+} // Parent
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Plugin.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Plugin.java
new file mode 100644
index 00000000..d12c5444
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Plugin.java
@@ -0,0 +1,370 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Plugin</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0 <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Plugin#getGroupId <em>Group Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Plugin#getArtifactId <em>Artifact Id
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Plugin#getVersion <em>Version</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Plugin#getExtensions <em>Extensions
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Plugin#getExecutions <em>Executions
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Plugin#getDependencies <em>
+ * Dependencies</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Plugin#getInherited <em>Inherited
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Plugin#getConfiguration <em>
+ * Configuration</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPlugin()
+ * @model extendedMetaData="name='Plugin' kind='elementOnly'"
+ * @generated
+ */
+public interface Plugin extends EObject {
+ /**
+ * Returns the value of the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The group ID of the plugin in the repository. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Group Id</em>' attribute.
+ * @see #isSetGroupId()
+ * @see #unsetGroupId()
+ * @see #setGroupId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPlugin_GroupId()
+ * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * extendedMetaData
+ * ="kind='element' name='groupId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getGroupId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getGroupId <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Group Id</em>' attribute.
+ * @see #isSetGroupId()
+ * @see #unsetGroupId()
+ * @see #getGroupId()
+ * @generated
+ */
+ void setGroupId(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getGroupId <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetGroupId()
+ * @see #getGroupId()
+ * @see #setGroupId(String)
+ * @generated
+ */
+ void unsetGroupId();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getGroupId <em>Group Id</em>}'
+ * attribute is set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Group Id</em>' attribute is set.
+ * @see #unsetGroupId()
+ * @see #getGroupId()
+ * @see #setGroupId(String)
+ * @generated
+ */
+ boolean isSetGroupId();
+
+ /**
+ * Returns the value of the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The artifact ID of the plugin in the repository. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Artifact Id</em>' attribute.
+ * @see #setArtifactId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPlugin_ArtifactId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='artifactId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getArtifactId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getArtifactId
+ * <em>Artifact Id</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Artifact Id</em>' attribute.
+ * @see #getArtifactId()
+ * @generated
+ */
+ void setArtifactId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The version (or valid range of verisons) of the plugin to be used. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Version</em>' attribute.
+ * @see #setVersion(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPlugin_Version()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='version' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getVersion();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getVersion <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Version</em>' attribute.
+ * @see #getVersion()
+ * @generated
+ */
+ void setVersion(String value);
+
+ /**
+ * Returns the value of the '<em><b>Extensions</b></em>' attribute. The
+ * default value is <code>"false"</code>. <!-- begin-user-doc --> <!--
+ * end-user-doc --> <!-- begin-model-doc --> 4.0.0 Whether to load Maven
+ * extensions (such as packaging and type handlers) from this plugin. For
+ * performance reasons, this should only be enabled when necessary. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Extensions</em>' attribute.
+ * @see #isSetExtensions()
+ * @see #unsetExtensions()
+ * @see #setExtensions(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPlugin_Extensions()
+ * @model default="false" unsettable="true"
+ * dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='extensions' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getExtensions();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getExtensions
+ * <em>Extensions</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Extensions</em>' attribute.
+ * @see #isSetExtensions()
+ * @see #unsetExtensions()
+ * @see #getExtensions()
+ * @generated
+ */
+ void setExtensions(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getExtensions
+ * <em>Extensions</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetExtensions()
+ * @see #getExtensions()
+ * @see #setExtensions(String)
+ * @generated
+ */
+ void unsetExtensions();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getExtensions
+ * <em>Extensions</em>}' attribute is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Extensions</em>' attribute is set.
+ * @see #unsetExtensions()
+ * @see #getExtensions()
+ * @see #setExtensions(String)
+ * @generated
+ */
+ boolean isSetExtensions();
+
+ /**
+ * Returns the value of the '<em><b>Executions</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.PluginExecution}. <!-- begin-user-doc
+ * --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0 Multiple
+ * specifications of a set of goals to execute during the build lifecycle,
+ * each having (possibly) different configuration. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Executions</em>' containment reference
+ * list.
+ * @see #isSetExecutions()
+ * @see #unsetExecutions()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPlugin_Executions()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='executions' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<PluginExecution> getExecutions();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getExecutions
+ * <em>Executions</em>}' containment reference list. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetExecutions()
+ * @see #getExecutions()
+ * @generated
+ */
+ void unsetExecutions();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getExecutions
+ * <em>Executions</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Executions</em>' containment
+ * reference list is set.
+ * @see #unsetExecutions()
+ * @see #getExecutions()
+ * @generated
+ */
+ boolean isSetExecutions();
+
+ /**
+ * Returns the value of the '<em><b>Dependencies</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0 Additional
+ * dependencies that this project needs to introduce to the plugin's
+ * classloader. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Dependencies</em>' containment reference
+ * list.
+ * @see #isSetDependencies()
+ * @see #unsetDependencies()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPlugin_Dependencies()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='dependencies' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Dependency> getDependencies();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getDependencies
+ * <em>Dependencies</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetDependencies()
+ * @see #getDependencies()
+ * @generated
+ */
+ void unsetDependencies();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getDependencies
+ * <em>Dependencies</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Dependencies</em>' containment
+ * reference list is set.
+ * @see #unsetDependencies()
+ * @see #getDependencies()
+ * @generated
+ */
+ boolean isSetDependencies();
+
+ /**
+ * Returns the value of the '<em><b>Inherited</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Whether any configuration should be propagated to child POMs. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Inherited</em>' attribute.
+ * @see #setInherited(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPlugin_Inherited()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='inherited' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getInherited();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getInherited
+ * <em>Inherited</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Inherited</em>' attribute.
+ * @see #getInherited()
+ * @generated
+ */
+ void setInherited(String value);
+
+ /**
+ * Returns the value of the '<em><b>Configuration</b></em>' reference. <!--
+ * begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Configuration</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Configuration</em>' reference.
+ * @see #setConfiguration(Configuration)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPlugin_Configuration()
+ * @model
+ * @generated
+ */
+ Configuration getConfiguration();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin#getConfiguration
+ * <em>Configuration</em>}' reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Configuration</em>' reference.
+ * @see #getConfiguration()
+ * @generated
+ */
+ void setConfiguration(Configuration value);
+
+} // Plugin
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PluginExecution.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PluginExecution.java
new file mode 100644
index 00000000..bd9ee962
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PluginExecution.java
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Plugin Execution</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0 <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.PluginExecution#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.PluginExecution#getPhase <em>Phase
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.PluginExecution#getInherited <em>
+ * Inherited</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.PluginExecution#getGoals <em>Goals
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.PluginExecution#getConfiguration <em>
+ * Configuration</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPluginExecution()
+ * @model extendedMetaData="name='PluginExecution' kind='elementOnly'"
+ * @generated
+ */
+public interface PluginExecution extends EObject {
+ /**
+ * Returns the value of the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The identifier of this execution for labelling the goals during the
+ * build, and for matching exections to merge during inheritance. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Id</em>' attribute.
+ * @see #isSetId()
+ * @see #unsetId()
+ * @see #setId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPluginExecution_Id()
+ * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * extendedMetaData
+ * ="kind='element' name='id' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.PluginExecution#getId <em>Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Id</em>' attribute.
+ * @see #isSetId()
+ * @see #unsetId()
+ * @see #getId()
+ * @generated
+ */
+ void setId(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.PluginExecution#getId <em>Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetId()
+ * @see #getId()
+ * @see #setId(String)
+ * @generated
+ */
+ void unsetId();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.PluginExecution#getId <em>Id</em>}'
+ * attribute is set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Id</em>' attribute is set.
+ * @see #unsetId()
+ * @see #getId()
+ * @see #setId(String)
+ * @generated
+ */
+ boolean isSetId();
+
+ /**
+ * Returns the value of the '<em><b>Phase</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The build lifecycle phase to bind the goals in this execution to. If
+ * omitted, the goals will be bound to the default specified in their
+ * metadata. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Phase</em>' attribute.
+ * @see #setPhase(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPluginExecution_Phase()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='phase' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getPhase();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.PluginExecution#getPhase
+ * <em>Phase</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Phase</em>' attribute.
+ * @see #getPhase()
+ * @generated
+ */
+ void setPhase(String value);
+
+ /**
+ * Returns the value of the '<em><b>Inherited</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Whether any configuration should be propagated to child POMs. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Inherited</em>' attribute.
+ * @see #setInherited(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPluginExecution_Inherited()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='inherited' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getInherited();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.PluginExecution#getInherited
+ * <em>Inherited</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Inherited</em>' attribute.
+ * @see #getInherited()
+ * @generated
+ */
+ void setInherited(String value);
+
+ /**
+ * Returns the value of the '<em><b>Goals</b></em>' attribute list. The list
+ * contents are of type {@link java.lang.String}. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Goals</em>' attribute list isn't clear, there
+ * really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Goals</em>' attribute list.
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPluginExecution_Goals()
+ * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * @generated
+ */
+ EList<String> getGoals();
+
+ /**
+ * Returns the value of the '<em><b>Configuration</b></em>' reference. <!--
+ * begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Configuration</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Configuration</em>' reference.
+ * @see #setConfiguration(Configuration)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPluginExecution_Configuration()
+ * @model
+ * @generated
+ */
+ Configuration getConfiguration();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.PluginExecution#getConfiguration
+ * <em>Configuration</em>}' reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Configuration</em>' reference.
+ * @see #getConfiguration()
+ * @generated
+ */
+ void setConfiguration(Configuration value);
+
+} // PluginExecution
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PluginManagement.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PluginManagement.java
new file mode 100644
index 00000000..0986847c
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PluginManagement.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Plugin Management</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0
+ *
+ * Section for management of default plugin information for use in a group of
+ * POMs.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.PluginManagement#getPlugins <em>
+ * Plugins</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPluginManagement()
+ * @model extendedMetaData="name='PluginManagement' kind='elementOnly'"
+ * @generated
+ */
+public interface PluginManagement extends EObject {
+ /**
+ * Returns the value of the '<em><b>Plugins</b></em>' containment reference
+ * list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin}. <!-- begin-user-doc --> <!--
+ * end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The list of plugins to use.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Plugins</em>' containment reference list.
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPluginManagement_Plugins()
+ * @model containment="true" extendedMetaData=
+ * "kind='element' name='plugins' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Plugin> getPlugins();
+
+} // PluginManagement
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PomFactory.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PomFactory.java
new file mode 100644
index 00000000..f5604704
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PomFactory.java
@@ -0,0 +1,393 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc --> The <b>Factory</b> for the model. It provides a
+ * create method for each non-abstract class of the model. <!-- end-user-doc -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage
+ * @generated
+ */
+public interface PomFactory extends EFactory {
+ /**
+ * The singleton instance of the factory. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ PomFactory eINSTANCE = org.eclipse.m2e.model.edit.pom.impl.PomFactoryImpl
+ .init();
+
+ /**
+ * Returns a new object of class '<em>Activation</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Activation</em>'.
+ * @generated
+ */
+ Activation createActivation();
+
+ /**
+ * Returns a new object of class '<em>Activation File</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Activation File</em>'.
+ * @generated
+ */
+ ActivationFile createActivationFile();
+
+ /**
+ * Returns a new object of class '<em>Activation OS</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Activation OS</em>'.
+ * @generated
+ */
+ ActivationOS createActivationOS();
+
+ /**
+ * Returns a new object of class '<em>Activation Property</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Activation Property</em>'.
+ * @generated
+ */
+ ActivationProperty createActivationProperty();
+
+ /**
+ * Returns a new object of class '<em>Build</em>'. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Build</em>'.
+ * @generated
+ */
+ Build createBuild();
+
+ /**
+ * Returns a new object of class '<em>Build Base</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Build Base</em>'.
+ * @generated
+ */
+ BuildBase createBuildBase();
+
+ /**
+ * Returns a new object of class '<em>Ci Management</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Ci Management</em>'.
+ * @generated
+ */
+ CiManagement createCiManagement();
+
+ /**
+ * Returns a new object of class '<em>Contributor</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Contributor</em>'.
+ * @generated
+ */
+ Contributor createContributor();
+
+ /**
+ * Returns a new object of class '<em>Dependency</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Dependency</em>'.
+ * @generated
+ */
+ Dependency createDependency();
+
+ /**
+ * Returns a new object of class '<em>Dependency Management</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Dependency Management</em>'.
+ * @generated
+ */
+ DependencyManagement createDependencyManagement();
+
+ /**
+ * Returns a new object of class '<em>Deployment Repository</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Deployment Repository</em>'.
+ * @generated
+ */
+ DeploymentRepository createDeploymentRepository();
+
+ /**
+ * Returns a new object of class '<em>Developer</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Developer</em>'.
+ * @generated
+ */
+ Developer createDeveloper();
+
+ /**
+ * Returns a new object of class '<em>Distribution Management</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Distribution Management</em>'.
+ * @generated
+ */
+ DistributionManagement createDistributionManagement();
+
+ /**
+ * Returns a new object of class '<em>Document Root</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Document Root</em>'.
+ * @generated
+ */
+ DocumentRoot createDocumentRoot();
+
+ /**
+ * Returns a new object of class '<em>Exclusion</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Exclusion</em>'.
+ * @generated
+ */
+ Exclusion createExclusion();
+
+ /**
+ * Returns a new object of class '<em>Extension</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Extension</em>'.
+ * @generated
+ */
+ Extension createExtension();
+
+ /**
+ * Returns a new object of class '<em>Issue Management</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Issue Management</em>'.
+ * @generated
+ */
+ IssueManagement createIssueManagement();
+
+ /**
+ * Returns a new object of class '<em>License</em>'. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>License</em>'.
+ * @generated
+ */
+ License createLicense();
+
+ /**
+ * Returns a new object of class '<em>Mailing List</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Mailing List</em>'.
+ * @generated
+ */
+ MailingList createMailingList();
+
+ /**
+ * Returns a new object of class '<em>Model</em>'. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Model</em>'.
+ * @generated
+ */
+ Model createModel();
+
+ /**
+ * Returns a new object of class '<em>Notifier</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Notifier</em>'.
+ * @generated
+ */
+ Notifier createNotifier();
+
+ /**
+ * Returns a new object of class '<em>Organization</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Organization</em>'.
+ * @generated
+ */
+ Organization createOrganization();
+
+ /**
+ * Returns a new object of class '<em>Parent</em>'. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Parent</em>'.
+ * @generated
+ */
+ Parent createParent();
+
+ /**
+ * Returns a new object of class '<em>Plugin</em>'. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Plugin</em>'.
+ * @generated
+ */
+ Plugin createPlugin();
+
+ /**
+ * Returns a new object of class '<em>Plugin Execution</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Plugin Execution</em>'.
+ * @generated
+ */
+ PluginExecution createPluginExecution();
+
+ /**
+ * Returns a new object of class '<em>Plugin Management</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Plugin Management</em>'.
+ * @generated
+ */
+ PluginManagement createPluginManagement();
+
+ /**
+ * Returns a new object of class '<em>Prerequisites</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Prerequisites</em>'.
+ * @generated
+ */
+ Prerequisites createPrerequisites();
+
+ /**
+ * Returns a new object of class '<em>Profile</em>'. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Profile</em>'.
+ * @generated
+ */
+ Profile createProfile();
+
+ /**
+ * Returns a new object of class '<em>Relocation</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Relocation</em>'.
+ * @generated
+ */
+ Relocation createRelocation();
+
+ /**
+ * Returns a new object of class '<em>Reporting</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Reporting</em>'.
+ * @generated
+ */
+ Reporting createReporting();
+
+ /**
+ * Returns a new object of class '<em>Report Plugin</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Report Plugin</em>'.
+ * @generated
+ */
+ ReportPlugin createReportPlugin();
+
+ /**
+ * Returns a new object of class '<em>Report Set</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Report Set</em>'.
+ * @generated
+ */
+ ReportSet createReportSet();
+
+ /**
+ * Returns a new object of class '<em>Repository</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Repository</em>'.
+ * @generated
+ */
+ Repository createRepository();
+
+ /**
+ * Returns a new object of class '<em>Repository Policy</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Repository Policy</em>'.
+ * @generated
+ */
+ RepositoryPolicy createRepositoryPolicy();
+
+ /**
+ * Returns a new object of class '<em>Resource</em>'. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Resource</em>'.
+ * @generated
+ */
+ Resource createResource();
+
+ /**
+ * Returns a new object of class '<em>Scm</em>'. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Scm</em>'.
+ * @generated
+ */
+ Scm createScm();
+
+ /**
+ * Returns a new object of class '<em>Site</em>'. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Site</em>'.
+ * @generated
+ */
+ Site createSite();
+
+ /**
+ * Returns a new object of class '<em>Property Element</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Property Element</em>'.
+ * @generated
+ */
+ PropertyElement createPropertyElement();
+
+ /**
+ * Returns a new object of class '<em>Configuration</em>'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Configuration</em>'.
+ * @generated
+ */
+ Configuration createConfiguration();
+
+ /**
+ * Returns the package supported by this factory. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the package supported by this factory.
+ * @generated
+ */
+ PomPackage getPomPackage();
+
+} // PomFactory
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PomPackage.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PomPackage.java
new file mode 100644
index 00000000..dd9def20
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PomPackage.java
@@ -0,0 +1,6917 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc --> The <b>Package</b> for the model. It contains
+ * accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.PomFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface PomPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "pom"; //$NON-NLS-1$
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://maven.apache.org/POM/4.0.0"; //$NON-NLS-1$
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "pom"; //$NON-NLS-1$
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ PomPackage eINSTANCE = org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl.init();
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ActivationImpl
+ * <em>Activation</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.ActivationImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getActivation()
+ * @generated
+ */
+ int ACTIVATION = 0;
+
+ /**
+ * The feature id for the '<em><b>Active By Default</b></em>' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION__ACTIVE_BY_DEFAULT = 0;
+
+ /**
+ * The feature id for the '<em><b>Jdk</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION__JDK = 1;
+
+ /**
+ * The feature id for the '<em><b>Os</b></em>' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION__OS = 2;
+
+ /**
+ * The feature id for the '<em><b>Property</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION__PROPERTY = 3;
+
+ /**
+ * The feature id for the '<em><b>File</b></em>' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION__FILE = 4;
+
+ /**
+ * The number of structural features of the '<em>Activation</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION_FEATURE_COUNT = 5;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.ActivationFileImpl <em>Activation File</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ActivationFileImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getActivationFile()
+ * @generated
+ */
+ int ACTIVATION_FILE = 1;
+
+ /**
+ * The feature id for the '<em><b>Missing</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION_FILE__MISSING = 0;
+
+ /**
+ * The feature id for the '<em><b>Exists</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION_FILE__EXISTS = 1;
+
+ /**
+ * The number of structural features of the '<em>Activation File</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION_FILE_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ActivationOSImpl
+ * <em>Activation OS</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.ActivationOSImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getActivationOS()
+ * @generated
+ */
+ int ACTIVATION_OS = 2;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION_OS__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Family</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION_OS__FAMILY = 1;
+
+ /**
+ * The feature id for the '<em><b>Arch</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION_OS__ARCH = 2;
+
+ /**
+ * The feature id for the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION_OS__VERSION = 3;
+
+ /**
+ * The number of structural features of the '<em>Activation OS</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION_OS_FEATURE_COUNT = 4;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.ActivationPropertyImpl <em>Activation Property</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ActivationPropertyImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getActivationProperty()
+ * @generated
+ */
+ int ACTIVATION_PROPERTY = 3;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION_PROPERTY__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Value</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION_PROPERTY__VALUE = 1;
+
+ /**
+ * The number of structural features of the '<em>Activation Property</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ACTIVATION_PROPERTY_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.BuildBaseImpl
+ * <em>Build Base</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.BuildBaseImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getBuildBase()
+ * @generated
+ */
+ int BUILD_BASE = 5;
+
+ /**
+ * The feature id for the '<em><b>Default Goal</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int BUILD_BASE__DEFAULT_GOAL = 0;
+
+ /**
+ * The feature id for the '<em><b>Resources</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BUILD_BASE__RESOURCES = 1;
+
+ /**
+ * The feature id for the '<em><b>Test Resources</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BUILD_BASE__TEST_RESOURCES = 2;
+
+ /**
+ * The feature id for the '<em><b>Directory</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int BUILD_BASE__DIRECTORY = 3;
+
+ /**
+ * The feature id for the '<em><b>Final Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int BUILD_BASE__FINAL_NAME = 4;
+
+ /**
+ * The feature id for the '<em><b>Plugin Management</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BUILD_BASE__PLUGIN_MANAGEMENT = 5;
+
+ /**
+ * The feature id for the '<em><b>Plugins</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BUILD_BASE__PLUGINS = 6;
+
+ /**
+ * The feature id for the '<em><b>Filters</b></em>' attribute list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int BUILD_BASE__FILTERS = 7;
+
+ /**
+ * The number of structural features of the '<em>Build Base</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BUILD_BASE_FEATURE_COUNT = 8;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.BuildImpl <em>Build</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.BuildImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getBuild()
+ * @generated
+ */
+ int BUILD = 4;
+
+ /**
+ * The feature id for the '<em><b>Default Goal</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int BUILD__DEFAULT_GOAL = BUILD_BASE__DEFAULT_GOAL;
+
+ /**
+ * The feature id for the '<em><b>Resources</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BUILD__RESOURCES = BUILD_BASE__RESOURCES;
+
+ /**
+ * The feature id for the '<em><b>Test Resources</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BUILD__TEST_RESOURCES = BUILD_BASE__TEST_RESOURCES;
+
+ /**
+ * The feature id for the '<em><b>Directory</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int BUILD__DIRECTORY = BUILD_BASE__DIRECTORY;
+
+ /**
+ * The feature id for the '<em><b>Final Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int BUILD__FINAL_NAME = BUILD_BASE__FINAL_NAME;
+
+ /**
+ * The feature id for the '<em><b>Plugin Management</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BUILD__PLUGIN_MANAGEMENT = BUILD_BASE__PLUGIN_MANAGEMENT;
+
+ /**
+ * The feature id for the '<em><b>Plugins</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BUILD__PLUGINS = BUILD_BASE__PLUGINS;
+
+ /**
+ * The feature id for the '<em><b>Filters</b></em>' attribute list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int BUILD__FILTERS = BUILD_BASE__FILTERS;
+
+ /**
+ * The feature id for the '<em><b>Source Directory</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int BUILD__SOURCE_DIRECTORY = BUILD_BASE_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Script Source Directory</b></em>' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BUILD__SCRIPT_SOURCE_DIRECTORY = BUILD_BASE_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Test Source Directory</b></em>' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BUILD__TEST_SOURCE_DIRECTORY = BUILD_BASE_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Output Directory</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int BUILD__OUTPUT_DIRECTORY = BUILD_BASE_FEATURE_COUNT + 3;
+
+ /**
+ * The feature id for the '<em><b>Test Output Directory</b></em>' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BUILD__TEST_OUTPUT_DIRECTORY = BUILD_BASE_FEATURE_COUNT + 4;
+
+ /**
+ * The feature id for the '<em><b>Extensions</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int BUILD__EXTENSIONS = BUILD_BASE_FEATURE_COUNT + 5;
+
+ /**
+ * The number of structural features of the '<em>Build</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int BUILD_FEATURE_COUNT = BUILD_BASE_FEATURE_COUNT + 6;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.CiManagementImpl
+ * <em>Ci Management</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.CiManagementImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getCiManagement()
+ * @generated
+ */
+ int CI_MANAGEMENT = 6;
+
+ /**
+ * The feature id for the '<em><b>System</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int CI_MANAGEMENT__SYSTEM = 0;
+
+ /**
+ * The feature id for the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int CI_MANAGEMENT__URL = 1;
+
+ /**
+ * The feature id for the '<em><b>Notifiers</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CI_MANAGEMENT__NOTIFIERS = 2;
+
+ /**
+ * The number of structural features of the '<em>Ci Management</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CI_MANAGEMENT_FEATURE_COUNT = 3;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ContributorImpl
+ * <em>Contributor</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.ContributorImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getContributor()
+ * @generated
+ */
+ int CONTRIBUTOR = 7;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int CONTRIBUTOR__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Email</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int CONTRIBUTOR__EMAIL = 1;
+
+ /**
+ * The feature id for the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int CONTRIBUTOR__URL = 2;
+
+ /**
+ * The feature id for the '<em><b>Organization</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int CONTRIBUTOR__ORGANIZATION = 3;
+
+ /**
+ * The feature id for the '<em><b>Organization Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int CONTRIBUTOR__ORGANIZATION_URL = 4;
+
+ /**
+ * The feature id for the '<em><b>Timezone</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int CONTRIBUTOR__TIMEZONE = 5;
+
+ /**
+ * The feature id for the '<em><b>Properties</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CONTRIBUTOR__PROPERTIES = 6;
+
+ /**
+ * The feature id for the '<em><b>Roles</b></em>' attribute list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int CONTRIBUTOR__ROLES = 7;
+
+ /**
+ * The number of structural features of the '<em>Contributor</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CONTRIBUTOR_FEATURE_COUNT = 8;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DependencyImpl
+ * <em>Dependency</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.DependencyImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getDependency()
+ * @generated
+ */
+ int DEPENDENCY = 8;
+
+ /**
+ * The feature id for the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEPENDENCY__GROUP_ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEPENDENCY__ARTIFACT_ID = 1;
+
+ /**
+ * The feature id for the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEPENDENCY__VERSION = 2;
+
+ /**
+ * The feature id for the '<em><b>Type</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEPENDENCY__TYPE = 3;
+
+ /**
+ * The feature id for the '<em><b>Classifier</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEPENDENCY__CLASSIFIER = 4;
+
+ /**
+ * The feature id for the '<em><b>Scope</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEPENDENCY__SCOPE = 5;
+
+ /**
+ * The feature id for the '<em><b>System Path</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEPENDENCY__SYSTEM_PATH = 6;
+
+ /**
+ * The feature id for the '<em><b>Exclusions</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DEPENDENCY__EXCLUSIONS = 7;
+
+ /**
+ * The feature id for the '<em><b>Optional</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEPENDENCY__OPTIONAL = 8;
+
+ /**
+ * The number of structural features of the '<em>Dependency</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DEPENDENCY_FEATURE_COUNT = 9;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.DependencyManagementImpl <em>Dependency Management</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.DependencyManagementImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getDependencyManagement()
+ * @generated
+ */
+ int DEPENDENCY_MANAGEMENT = 9;
+
+ /**
+ * The feature id for the '<em><b>Dependencies</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DEPENDENCY_MANAGEMENT__DEPENDENCIES = 0;
+
+ /**
+ * The number of structural features of the '<em>Dependency Management</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DEPENDENCY_MANAGEMENT_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.DeploymentRepositoryImpl <em>Deployment Repository</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.DeploymentRepositoryImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getDeploymentRepository()
+ * @generated
+ */
+ int DEPLOYMENT_REPOSITORY = 10;
+
+ /**
+ * The feature id for the '<em><b>Unique Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEPLOYMENT_REPOSITORY__UNIQUE_VERSION = 0;
+
+ /**
+ * The feature id for the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEPLOYMENT_REPOSITORY__ID = 1;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEPLOYMENT_REPOSITORY__NAME = 2;
+
+ /**
+ * The feature id for the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEPLOYMENT_REPOSITORY__URL = 3;
+
+ /**
+ * The feature id for the '<em><b>Layout</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEPLOYMENT_REPOSITORY__LAYOUT = 4;
+
+ /**
+ * The number of structural features of the '<em>Deployment Repository</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DEPLOYMENT_REPOSITORY_FEATURE_COUNT = 5;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.DeveloperImpl <em>Developer</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.DeveloperImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getDeveloper()
+ * @generated
+ */
+ int DEVELOPER = 11;
+
+ /**
+ * The feature id for the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEVELOPER__ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEVELOPER__NAME = 1;
+
+ /**
+ * The feature id for the '<em><b>Email</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEVELOPER__EMAIL = 2;
+
+ /**
+ * The feature id for the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEVELOPER__URL = 3;
+
+ /**
+ * The feature id for the '<em><b>Organization</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEVELOPER__ORGANIZATION = 4;
+
+ /**
+ * The feature id for the '<em><b>Organization Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEVELOPER__ORGANIZATION_URL = 5;
+
+ /**
+ * The feature id for the '<em><b>Timezone</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEVELOPER__TIMEZONE = 6;
+
+ /**
+ * The feature id for the '<em><b>Properties</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DEVELOPER__PROPERTIES = 7;
+
+ /**
+ * The feature id for the '<em><b>Roles</b></em>' attribute list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEVELOPER__ROLES = 8;
+
+ /**
+ * The number of structural features of the '<em>Developer</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DEVELOPER_FEATURE_COUNT = 9;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.DistributionManagementImpl <em>Distribution Management</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.DistributionManagementImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getDistributionManagement()
+ * @generated
+ */
+ int DISTRIBUTION_MANAGEMENT = 12;
+
+ /**
+ * The feature id for the '<em><b>Repository</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DISTRIBUTION_MANAGEMENT__REPOSITORY = 0;
+
+ /**
+ * The feature id for the '<em><b>Snapshot Repository</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY = 1;
+
+ /**
+ * The feature id for the '<em><b>Site</b></em>' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DISTRIBUTION_MANAGEMENT__SITE = 2;
+
+ /**
+ * The feature id for the '<em><b>Download Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DISTRIBUTION_MANAGEMENT__DOWNLOAD_URL = 3;
+
+ /**
+ * The feature id for the '<em><b>Relocation</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DISTRIBUTION_MANAGEMENT__RELOCATION = 4;
+
+ /**
+ * The feature id for the '<em><b>Status</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DISTRIBUTION_MANAGEMENT__STATUS = 5;
+
+ /**
+ * The number of structural features of the '<em>Distribution Management</em>' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DISTRIBUTION_MANAGEMENT_FEATURE_COUNT = 6;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DocumentRootImpl
+ * <em>Document Root</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.DocumentRootImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getDocumentRoot()
+ * @generated
+ */
+ int DOCUMENT_ROOT = 13;
+
+ /**
+ * The feature id for the '<em><b>Mixed</b></em>' attribute list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DOCUMENT_ROOT__MIXED = 0;
+
+ /**
+ * The feature id for the '<em><b>XMLNS Prefix Map</b></em>' map. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1;
+
+ /**
+ * The feature id for the '<em><b>XSI Schema Location</b></em>' map. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2;
+
+ /**
+ * The feature id for the '<em><b>Project</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DOCUMENT_ROOT__PROJECT = 3;
+
+ /**
+ * The number of structural features of the '<em>Document Root</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DOCUMENT_ROOT_FEATURE_COUNT = 4;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.ExclusionImpl <em>Exclusion</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ExclusionImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getExclusion()
+ * @generated
+ */
+ int EXCLUSION = 14;
+
+ /**
+ * The feature id for the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EXCLUSION__ARTIFACT_ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EXCLUSION__GROUP_ID = 1;
+
+ /**
+ * The number of structural features of the '<em>Exclusion</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EXCLUSION_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.ExtensionImpl <em>Extension</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ExtensionImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getExtension()
+ * @generated
+ */
+ int EXTENSION = 15;
+
+ /**
+ * The feature id for the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EXTENSION__GROUP_ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EXTENSION__ARTIFACT_ID = 1;
+
+ /**
+ * The feature id for the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EXTENSION__VERSION = 2;
+
+ /**
+ * The number of structural features of the '<em>Extension</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EXTENSION_FEATURE_COUNT = 3;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.IssueManagementImpl <em>Issue Management</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.IssueManagementImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getIssueManagement()
+ * @generated
+ */
+ int ISSUE_MANAGEMENT = 16;
+
+ /**
+ * The feature id for the '<em><b>System</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ISSUE_MANAGEMENT__SYSTEM = 0;
+
+ /**
+ * The feature id for the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ISSUE_MANAGEMENT__URL = 1;
+
+ /**
+ * The number of structural features of the '<em>Issue Management</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ISSUE_MANAGEMENT_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.LicenseImpl <em>License</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.LicenseImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getLicense()
+ * @generated
+ */
+ int LICENSE = 17;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int LICENSE__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int LICENSE__URL = 1;
+
+ /**
+ * The feature id for the '<em><b>Distribution</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int LICENSE__DISTRIBUTION = 2;
+
+ /**
+ * The feature id for the '<em><b>Comments</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int LICENSE__COMMENTS = 3;
+
+ /**
+ * The number of structural features of the '<em>License</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int LICENSE_FEATURE_COUNT = 4;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.MailingListImpl
+ * <em>Mailing List</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.MailingListImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getMailingList()
+ * @generated
+ */
+ int MAILING_LIST = 18;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MAILING_LIST__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Subscribe</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MAILING_LIST__SUBSCRIBE = 1;
+
+ /**
+ * The feature id for the '<em><b>Unsubscribe</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MAILING_LIST__UNSUBSCRIBE = 2;
+
+ /**
+ * The feature id for the '<em><b>Post</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MAILING_LIST__POST = 3;
+
+ /**
+ * The feature id for the '<em><b>Archive</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MAILING_LIST__ARCHIVE = 4;
+
+ /**
+ * The feature id for the '<em><b>Other Archives</b></em>' attribute list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MAILING_LIST__OTHER_ARCHIVES = 5;
+
+ /**
+ * The number of structural features of the '<em>Mailing List</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MAILING_LIST_FEATURE_COUNT = 6;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl <em>Model</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ModelImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getModel()
+ * @generated
+ */
+ int MODEL = 19;
+
+ /**
+ * The feature id for the '<em><b>Parent</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__PARENT = 0;
+
+ /**
+ * The feature id for the '<em><b>Model Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MODEL__MODEL_VERSION = 1;
+
+ /**
+ * The feature id for the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MODEL__GROUP_ID = 2;
+
+ /**
+ * The feature id for the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MODEL__ARTIFACT_ID = 3;
+
+ /**
+ * The feature id for the '<em><b>Packaging</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MODEL__PACKAGING = 4;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MODEL__NAME = 5;
+
+ /**
+ * The feature id for the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MODEL__VERSION = 6;
+
+ /**
+ * The feature id for the '<em><b>Description</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MODEL__DESCRIPTION = 7;
+
+ /**
+ * The feature id for the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MODEL__URL = 8;
+
+ /**
+ * The feature id for the '<em><b>Prerequisites</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__PREREQUISITES = 9;
+
+ /**
+ * The feature id for the '<em><b>Issue Management</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__ISSUE_MANAGEMENT = 10;
+
+ /**
+ * The feature id for the '<em><b>Ci Management</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__CI_MANAGEMENT = 11;
+
+ /**
+ * The feature id for the '<em><b>Inception Year</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MODEL__INCEPTION_YEAR = 12;
+
+ /**
+ * The feature id for the '<em><b>Mailing Lists</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__MAILING_LISTS = 13;
+
+ /**
+ * The feature id for the '<em><b>Developers</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__DEVELOPERS = 14;
+
+ /**
+ * The feature id for the '<em><b>Contributors</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__CONTRIBUTORS = 15;
+
+ /**
+ * The feature id for the '<em><b>Licenses</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__LICENSES = 16;
+
+ /**
+ * The feature id for the '<em><b>Scm</b></em>' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MODEL__SCM = 17;
+
+ /**
+ * The feature id for the '<em><b>Organization</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__ORGANIZATION = 18;
+
+ /**
+ * The feature id for the '<em><b>Build</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__BUILD = 19;
+
+ /**
+ * The feature id for the '<em><b>Profiles</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__PROFILES = 20;
+
+ /**
+ * The feature id for the '<em><b>Repositories</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__REPOSITORIES = 21;
+
+ /**
+ * The feature id for the '<em><b>Plugin Repositories</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__PLUGIN_REPOSITORIES = 22;
+
+ /**
+ * The feature id for the '<em><b>Dependencies</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__DEPENDENCIES = 23;
+
+ /**
+ * The feature id for the '<em><b>Reporting</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__REPORTING = 24;
+
+ /**
+ * The feature id for the '<em><b>Dependency Management</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__DEPENDENCY_MANAGEMENT = 25;
+
+ /**
+ * The feature id for the '<em><b>Distribution Management</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__DISTRIBUTION_MANAGEMENT = 26;
+
+ /**
+ * The feature id for the '<em><b>Properties</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int MODEL__PROPERTIES = 27;
+
+ /**
+ * The feature id for the '<em><b>Modules</b></em>' attribute list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MODEL__MODULES = 28;
+
+ /**
+ * The number of structural features of the '<em>Model</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int MODEL_FEATURE_COUNT = 29;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.NotifierImpl <em>Notifier</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.NotifierImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getNotifier()
+ * @generated
+ */
+ int NOTIFIER = 20;
+
+ /**
+ * The feature id for the '<em><b>Type</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int NOTIFIER__TYPE = 0;
+
+ /**
+ * The feature id for the '<em><b>Send On Error</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int NOTIFIER__SEND_ON_ERROR = 1;
+
+ /**
+ * The feature id for the '<em><b>Send On Failure</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int NOTIFIER__SEND_ON_FAILURE = 2;
+
+ /**
+ * The feature id for the '<em><b>Send On Success</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int NOTIFIER__SEND_ON_SUCCESS = 3;
+
+ /**
+ * The feature id for the '<em><b>Send On Warning</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int NOTIFIER__SEND_ON_WARNING = 4;
+
+ /**
+ * The feature id for the '<em><b>Address</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int NOTIFIER__ADDRESS = 5;
+
+ /**
+ * The feature id for the '<em><b>Configuration</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int NOTIFIER__CONFIGURATION = 6;
+
+ /**
+ * The number of structural features of the '<em>Notifier</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int NOTIFIER_FEATURE_COUNT = 7;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.OrganizationImpl
+ * <em>Organization</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.OrganizationImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getOrganization()
+ * @generated
+ */
+ int ORGANIZATION = 21;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ORGANIZATION__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int ORGANIZATION__URL = 1;
+
+ /**
+ * The number of structural features of the '<em>Organization</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ORGANIZATION_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.ParentImpl <em>Parent</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ParentImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getParent()
+ * @generated
+ */
+ int PARENT = 22;
+
+ /**
+ * The feature id for the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PARENT__ARTIFACT_ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PARENT__GROUP_ID = 1;
+
+ /**
+ * The feature id for the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PARENT__VERSION = 2;
+
+ /**
+ * The feature id for the '<em><b>Relative Path</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PARENT__RELATIVE_PATH = 3;
+
+ /**
+ * The number of structural features of the '<em>Parent</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PARENT_FEATURE_COUNT = 4;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.PluginImpl <em>Plugin</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.PluginImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getPlugin()
+ * @generated
+ */
+ int PLUGIN = 23;
+
+ /**
+ * The feature id for the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PLUGIN__GROUP_ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PLUGIN__ARTIFACT_ID = 1;
+
+ /**
+ * The feature id for the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PLUGIN__VERSION = 2;
+
+ /**
+ * The feature id for the '<em><b>Extensions</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PLUGIN__EXTENSIONS = 3;
+
+ /**
+ * The feature id for the '<em><b>Executions</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PLUGIN__EXECUTIONS = 4;
+
+ /**
+ * The feature id for the '<em><b>Dependencies</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PLUGIN__DEPENDENCIES = 5;
+
+ /**
+ * The feature id for the '<em><b>Inherited</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PLUGIN__INHERITED = 6;
+
+ /**
+ * The feature id for the '<em><b>Configuration</b></em>' reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PLUGIN__CONFIGURATION = 7;
+
+ /**
+ * The number of structural features of the '<em>Plugin</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PLUGIN_FEATURE_COUNT = 8;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.PluginExecutionImpl <em>Plugin Execution</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.PluginExecutionImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getPluginExecution()
+ * @generated
+ */
+ int PLUGIN_EXECUTION = 24;
+
+ /**
+ * The feature id for the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PLUGIN_EXECUTION__ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Phase</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PLUGIN_EXECUTION__PHASE = 1;
+
+ /**
+ * The feature id for the '<em><b>Inherited</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PLUGIN_EXECUTION__INHERITED = 2;
+
+ /**
+ * The feature id for the '<em><b>Goals</b></em>' attribute list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PLUGIN_EXECUTION__GOALS = 3;
+
+ /**
+ * The feature id for the '<em><b>Configuration</b></em>' reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PLUGIN_EXECUTION__CONFIGURATION = 4;
+
+ /**
+ * The number of structural features of the '<em>Plugin Execution</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PLUGIN_EXECUTION_FEATURE_COUNT = 5;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.PluginManagementImpl <em>Plugin Management</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.PluginManagementImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getPluginManagement()
+ * @generated
+ */
+ int PLUGIN_MANAGEMENT = 25;
+
+ /**
+ * The feature id for the '<em><b>Plugins</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PLUGIN_MANAGEMENT__PLUGINS = 0;
+
+ /**
+ * The number of structural features of the '<em>Plugin Management</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PLUGIN_MANAGEMENT_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.PrerequisitesImpl
+ * <em>Prerequisites</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.PrerequisitesImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getPrerequisites()
+ * @generated
+ */
+ int PREREQUISITES = 26;
+
+ /**
+ * The feature id for the '<em><b>Maven</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PREREQUISITES__MAVEN = 0;
+
+ /**
+ * The number of structural features of the '<em>Prerequisites</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PREREQUISITES_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl <em>Profile</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ProfileImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getProfile()
+ * @generated
+ */
+ int PROFILE = 27;
+
+ /**
+ * The feature id for the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PROFILE__ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Activation</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PROFILE__ACTIVATION = 1;
+
+ /**
+ * The feature id for the '<em><b>Build</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PROFILE__BUILD = 2;
+
+ /**
+ * The feature id for the '<em><b>Repositories</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PROFILE__REPOSITORIES = 3;
+
+ /**
+ * The feature id for the '<em><b>Plugin Repositories</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PROFILE__PLUGIN_REPOSITORIES = 4;
+
+ /**
+ * The feature id for the '<em><b>Dependencies</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PROFILE__DEPENDENCIES = 5;
+
+ /**
+ * The feature id for the '<em><b>Reports</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PROFILE__REPORTS = 6;
+
+ /**
+ * The feature id for the '<em><b>Dependency Management</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PROFILE__DEPENDENCY_MANAGEMENT = 7;
+
+ /**
+ * The feature id for the '<em><b>Distribution Management</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PROFILE__DISTRIBUTION_MANAGEMENT = 8;
+
+ /**
+ * The feature id for the '<em><b>Properties</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PROFILE__PROPERTIES = 9;
+
+ /**
+ * The feature id for the '<em><b>Modules</b></em>' attribute list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PROFILE__MODULES = 10;
+
+ /**
+ * The feature id for the '<em><b>Reporting</b></em>' reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PROFILE__REPORTING = 11;
+
+ /**
+ * The number of structural features of the '<em>Profile</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PROFILE_FEATURE_COUNT = 12;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.RelocationImpl
+ * <em>Relocation</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.RelocationImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getRelocation()
+ * @generated
+ */
+ int RELOCATION = 28;
+
+ /**
+ * The feature id for the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int RELOCATION__GROUP_ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int RELOCATION__ARTIFACT_ID = 1;
+
+ /**
+ * The feature id for the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int RELOCATION__VERSION = 2;
+
+ /**
+ * The feature id for the '<em><b>Message</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int RELOCATION__MESSAGE = 3;
+
+ /**
+ * The number of structural features of the '<em>Relocation</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int RELOCATION_FEATURE_COUNT = 4;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.ReportingImpl <em>Reporting</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ReportingImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getReporting()
+ * @generated
+ */
+ int REPORTING = 29;
+
+ /**
+ * The feature id for the '<em><b>Exclude Defaults</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPORTING__EXCLUDE_DEFAULTS = 0;
+
+ /**
+ * The feature id for the '<em><b>Output Directory</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPORTING__OUTPUT_DIRECTORY = 1;
+
+ /**
+ * The feature id for the '<em><b>Plugins</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REPORTING__PLUGINS = 2;
+
+ /**
+ * The number of structural features of the '<em>Reporting</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPORTING_FEATURE_COUNT = 3;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ReportPluginImpl
+ * <em>Report Plugin</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.ReportPluginImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getReportPlugin()
+ * @generated
+ */
+ int REPORT_PLUGIN = 30;
+
+ /**
+ * The feature id for the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPORT_PLUGIN__GROUP_ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPORT_PLUGIN__ARTIFACT_ID = 1;
+
+ /**
+ * The feature id for the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPORT_PLUGIN__VERSION = 2;
+
+ /**
+ * The feature id for the '<em><b>Inherited</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPORT_PLUGIN__INHERITED = 3;
+
+ /**
+ * The feature id for the '<em><b>Report Sets</b></em>' containment reference list.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REPORT_PLUGIN__REPORT_SETS = 4;
+
+ /**
+ * The feature id for the '<em><b>Configuration</b></em>' reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPORT_PLUGIN__CONFIGURATION = 5;
+
+ /**
+ * The number of structural features of the '<em>Report Plugin</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REPORT_PLUGIN_FEATURE_COUNT = 6;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ReportSetImpl
+ * <em>Report Set</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.ReportSetImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getReportSet()
+ * @generated
+ */
+ int REPORT_SET = 31;
+
+ /**
+ * The feature id for the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPORT_SET__ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Inherited</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPORT_SET__INHERITED = 1;
+
+ /**
+ * The feature id for the '<em><b>Reports</b></em>' attribute list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPORT_SET__REPORTS = 2;
+
+ /**
+ * The feature id for the '<em><b>Configuration</b></em>' reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPORT_SET__CONFIGURATION = 3;
+
+ /**
+ * The number of structural features of the '<em>Report Set</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REPORT_SET_FEATURE_COUNT = 4;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.RepositoryImpl
+ * <em>Repository</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.RepositoryImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getRepository()
+ * @generated
+ */
+ int REPOSITORY = 32;
+
+ /**
+ * The feature id for the '<em><b>Releases</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REPOSITORY__RELEASES = 0;
+
+ /**
+ * The feature id for the '<em><b>Snapshots</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REPOSITORY__SNAPSHOTS = 1;
+
+ /**
+ * The feature id for the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPOSITORY__ID = 2;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPOSITORY__NAME = 3;
+
+ /**
+ * The feature id for the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPOSITORY__URL = 4;
+
+ /**
+ * The feature id for the '<em><b>Layout</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPOSITORY__LAYOUT = 5;
+
+ /**
+ * The number of structural features of the '<em>Repository</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REPOSITORY_FEATURE_COUNT = 6;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.RepositoryPolicyImpl <em>Repository Policy</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.RepositoryPolicyImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getRepositoryPolicy()
+ * @generated
+ */
+ int REPOSITORY_POLICY = 33;
+
+ /**
+ * The feature id for the '<em><b>Enabled</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPOSITORY_POLICY__ENABLED = 0;
+
+ /**
+ * The feature id for the '<em><b>Update Policy</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPOSITORY_POLICY__UPDATE_POLICY = 1;
+
+ /**
+ * The feature id for the '<em><b>Checksum Policy</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int REPOSITORY_POLICY__CHECKSUM_POLICY = 2;
+
+ /**
+ * The number of structural features of the '<em>Repository Policy</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REPOSITORY_POLICY_FEATURE_COUNT = 3;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.ResourceImpl <em>Resource</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ResourceImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getResource()
+ * @generated
+ */
+ int RESOURCE = 34;
+
+ /**
+ * The feature id for the '<em><b>Target Path</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int RESOURCE__TARGET_PATH = 0;
+
+ /**
+ * The feature id for the '<em><b>Filtering</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int RESOURCE__FILTERING = 1;
+
+ /**
+ * The feature id for the '<em><b>Directory</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int RESOURCE__DIRECTORY = 2;
+
+ /**
+ * The feature id for the '<em><b>Includes</b></em>' attribute list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int RESOURCE__INCLUDES = 3;
+
+ /**
+ * The feature id for the '<em><b>Excludes</b></em>' attribute list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int RESOURCE__EXCLUDES = 4;
+
+ /**
+ * The number of structural features of the '<em>Resource</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int RESOURCE_FEATURE_COUNT = 5;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.ScmImpl <em>Scm</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ScmImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getScm()
+ * @generated
+ */
+ int SCM = 35;
+
+ /**
+ * The feature id for the '<em><b>Connection</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int SCM__CONNECTION = 0;
+
+ /**
+ * The feature id for the '<em><b>Developer Connection</b></em>' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SCM__DEVELOPER_CONNECTION = 1;
+
+ /**
+ * The feature id for the '<em><b>Tag</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int SCM__TAG = 2;
+
+ /**
+ * The feature id for the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int SCM__URL = 3;
+
+ /**
+ * The number of structural features of the '<em>Scm</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int SCM_FEATURE_COUNT = 4;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.SiteImpl <em>Site</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.SiteImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getSite()
+ * @generated
+ */
+ int SITE = 36;
+
+ /**
+ * The feature id for the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int SITE__ID = 0;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int SITE__NAME = 1;
+
+ /**
+ * The feature id for the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int SITE__URL = 2;
+
+ /**
+ * The number of structural features of the '<em>Site</em>' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int SITE_FEATURE_COUNT = 3;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.m2e.model.edit.pom.impl.PropertyElementImpl <em>Property Element</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.PropertyElementImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getPropertyElement()
+ * @generated
+ */
+ int PROPERTY_ELEMENT = 37;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PROPERTY_ELEMENT__NAME = 0;
+
+ /**
+ * The feature id for the '<em><b>Value</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int PROPERTY_ELEMENT__VALUE = 1;
+
+ /**
+ * The number of structural features of the '<em>Property Element</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PROPERTY_ELEMENT_FEATURE_COUNT = 2;
+
+ /**
+ * The meta object id for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ConfigurationImpl
+ * <em>Configuration</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.ConfigurationImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getConfiguration()
+ * @generated
+ */
+ int CONFIGURATION = 38;
+
+ /**
+ * The number of structural features of the '<em>Configuration</em>' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CONFIGURATION_FEATURE_COUNT = 0;
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.Activation <em>Activation</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Activation</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Activation
+ * @generated
+ */
+ EClass getActivation();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getActiveByDefault
+ * <em>Active By Default</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the attribute '<em>Active By Default</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Activation#getActiveByDefault()
+ * @see #getActivation()
+ * @generated
+ */
+ EAttribute getActivation_ActiveByDefault();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Activation#getJdk <em>Jdk</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Jdk</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Activation#getJdk()
+ * @see #getActivation()
+ * @generated
+ */
+ EAttribute getActivation_Jdk();
+
+ /**
+ * Returns the meta object for the containment reference '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation#getOs <em>Os</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the containment reference '<em>Os</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Activation#getOs()
+ * @see #getActivation()
+ * @generated
+ */
+ EReference getActivation_Os();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Activation#getProperty <em>Property</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Property</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Activation#getProperty()
+ * @see #getActivation()
+ * @generated
+ */
+ EReference getActivation_Property();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Activation#getFile <em>File</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>File</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Activation#getFile()
+ * @see #getActivation()
+ * @generated
+ */
+ EReference getActivation_File();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.ActivationFile <em>Activation File</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Activation File</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationFile
+ * @generated
+ */
+ EClass getActivationFile();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.ActivationFile#getMissing <em>Missing</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Missing</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationFile#getMissing()
+ * @see #getActivationFile()
+ * @generated
+ */
+ EAttribute getActivationFile_Missing();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.ActivationFile#getExists <em>Exists</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Exists</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationFile#getExists()
+ * @see #getActivationFile()
+ * @generated
+ */
+ EAttribute getActivationFile_Exists();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.ActivationOS <em>Activation OS</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Activation OS</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationOS
+ * @generated
+ */
+ EClass getActivationOS();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.ActivationOS#getName <em>Name</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationOS#getName()
+ * @see #getActivationOS()
+ * @generated
+ */
+ EAttribute getActivationOS_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.ActivationOS#getFamily <em>Family</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Family</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationOS#getFamily()
+ * @see #getActivationOS()
+ * @generated
+ */
+ EAttribute getActivationOS_Family();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.ActivationOS#getArch <em>Arch</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Arch</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationOS#getArch()
+ * @see #getActivationOS()
+ * @generated
+ */
+ EAttribute getActivationOS_Arch();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.ActivationOS#getVersion <em>Version</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Version</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationOS#getVersion()
+ * @see #getActivationOS()
+ * @generated
+ */
+ EAttribute getActivationOS_Version();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationProperty
+ * <em>Activation Property</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for class '<em>Activation Property</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationProperty
+ * @generated
+ */
+ EClass getActivationProperty();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.ActivationProperty#getName <em>Name</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationProperty#getName()
+ * @see #getActivationProperty()
+ * @generated
+ */
+ EAttribute getActivationProperty_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.ActivationProperty#getValue <em>Value</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Value</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationProperty#getValue()
+ * @see #getActivationProperty()
+ * @generated
+ */
+ EAttribute getActivationProperty_Value();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.Build <em>Build</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Build</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Build
+ * @generated
+ */
+ EClass getBuild();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Build#getSourceDirectory
+ * <em>Source Directory</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the attribute '<em>Source Directory</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Build#getSourceDirectory()
+ * @see #getBuild()
+ * @generated
+ */
+ EAttribute getBuild_SourceDirectory();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Build#getScriptSourceDirectory <em>Script Source Directory</em>}'.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @return the meta object for the attribute '<em>Script Source Directory</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Build#getScriptSourceDirectory()
+ * @see #getBuild()
+ * @generated
+ */
+ EAttribute getBuild_ScriptSourceDirectory();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Build#getTestSourceDirectory <em>Test Source Directory</em>}'.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @return the meta object for the attribute '<em>Test Source Directory</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Build#getTestSourceDirectory()
+ * @see #getBuild()
+ * @generated
+ */
+ EAttribute getBuild_TestSourceDirectory();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Build#getOutputDirectory
+ * <em>Output Directory</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the attribute '<em>Output Directory</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Build#getOutputDirectory()
+ * @see #getBuild()
+ * @generated
+ */
+ EAttribute getBuild_OutputDirectory();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Build#getTestOutputDirectory <em>Test Output Directory</em>}'.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @return the meta object for the attribute '<em>Test Output Directory</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Build#getTestOutputDirectory()
+ * @see #getBuild()
+ * @generated
+ */
+ EAttribute getBuild_TestOutputDirectory();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Build#getExtensions <em>Extensions</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Extensions</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Build#getExtensions()
+ * @see #getBuild()
+ * @generated
+ */
+ EReference getBuild_Extensions();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase <em>Build Base</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Build Base</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.BuildBase
+ * @generated
+ */
+ EClass getBuildBase();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.BuildBase#getDefaultGoal <em>Default Goal</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Default Goal</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.BuildBase#getDefaultGoal()
+ * @see #getBuildBase()
+ * @generated
+ */
+ EAttribute getBuildBase_DefaultGoal();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.BuildBase#getResources <em>Resources</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Resources</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.BuildBase#getResources()
+ * @see #getBuildBase()
+ * @generated
+ */
+ EReference getBuildBase_Resources();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.BuildBase#getTestResources <em>Test Resources</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Test Resources</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.BuildBase#getTestResources()
+ * @see #getBuildBase()
+ * @generated
+ */
+ EReference getBuildBase_TestResources();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.BuildBase#getDirectory <em>Directory</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Directory</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.BuildBase#getDirectory()
+ * @see #getBuildBase()
+ * @generated
+ */
+ EAttribute getBuildBase_Directory();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.BuildBase#getFinalName <em>Final Name</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Final Name</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.BuildBase#getFinalName()
+ * @see #getBuildBase()
+ * @generated
+ */
+ EAttribute getBuildBase_FinalName();
+
+ /**
+ * Returns the meta object for the containment reference '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase#getPluginManagement
+ * <em>Plugin Management</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the containment reference '
+ * <em>Plugin Management</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.BuildBase#getPluginManagement()
+ * @see #getBuildBase()
+ * @generated
+ */
+ EReference getBuildBase_PluginManagement();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.BuildBase#getPlugins <em>Plugins</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Plugins</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.BuildBase#getPlugins()
+ * @see #getBuildBase()
+ * @generated
+ */
+ EReference getBuildBase_Plugins();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.m2e.model.edit.pom.BuildBase#getFilters <em>Filters</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Filters</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.BuildBase#getFilters()
+ * @see #getBuildBase()
+ * @generated
+ */
+ EAttribute getBuildBase_Filters();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.CiManagement <em>Ci Management</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Ci Management</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.CiManagement
+ * @generated
+ */
+ EClass getCiManagement();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.CiManagement#getSystem <em>System</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>System</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.CiManagement#getSystem()
+ * @see #getCiManagement()
+ * @generated
+ */
+ EAttribute getCiManagement_System();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.CiManagement#getUrl <em>Url</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.CiManagement#getUrl()
+ * @see #getCiManagement()
+ * @generated
+ */
+ EAttribute getCiManagement_Url();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.CiManagement#getNotifiers <em>Notifiers</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Notifiers</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.CiManagement#getNotifiers()
+ * @see #getCiManagement()
+ * @generated
+ */
+ EReference getCiManagement_Notifiers();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.Contributor <em>Contributor</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Contributor</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Contributor
+ * @generated
+ */
+ EClass getContributor();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Contributor#getName <em>Name</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Contributor#getName()
+ * @see #getContributor()
+ * @generated
+ */
+ EAttribute getContributor_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Contributor#getEmail <em>Email</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Email</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Contributor#getEmail()
+ * @see #getContributor()
+ * @generated
+ */
+ EAttribute getContributor_Email();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Contributor#getUrl <em>Url</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Contributor#getUrl()
+ * @see #getContributor()
+ * @generated
+ */
+ EAttribute getContributor_Url();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Contributor#getOrganization <em>Organization</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Organization</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Contributor#getOrganization()
+ * @see #getContributor()
+ * @generated
+ */
+ EAttribute getContributor_Organization();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor#getOrganizationUrl
+ * <em>Organization Url</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the attribute '<em>Organization Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Contributor#getOrganizationUrl()
+ * @see #getContributor()
+ * @generated
+ */
+ EAttribute getContributor_OrganizationUrl();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Contributor#getTimezone <em>Timezone</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Timezone</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Contributor#getTimezone()
+ * @see #getContributor()
+ * @generated
+ */
+ EAttribute getContributor_Timezone();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Contributor#getProperties <em>Properties</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Properties</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Contributor#getProperties()
+ * @see #getContributor()
+ * @generated
+ */
+ EReference getContributor_Properties();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.m2e.model.edit.pom.Contributor#getRoles <em>Roles</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Roles</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Contributor#getRoles()
+ * @see #getContributor()
+ * @generated
+ */
+ EAttribute getContributor_Roles();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.Dependency <em>Dependency</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Dependency</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Dependency
+ * @generated
+ */
+ EClass getDependency();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Dependency#getGroupId <em>Group Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Group Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Dependency#getGroupId()
+ * @see #getDependency()
+ * @generated
+ */
+ EAttribute getDependency_GroupId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Dependency#getArtifactId <em>Artifact Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Artifact Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Dependency#getArtifactId()
+ * @see #getDependency()
+ * @generated
+ */
+ EAttribute getDependency_ArtifactId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Dependency#getVersion <em>Version</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Version</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Dependency#getVersion()
+ * @see #getDependency()
+ * @generated
+ */
+ EAttribute getDependency_Version();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Dependency#getType <em>Type</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Type</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Dependency#getType()
+ * @see #getDependency()
+ * @generated
+ */
+ EAttribute getDependency_Type();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Dependency#getClassifier <em>Classifier</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Classifier</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Dependency#getClassifier()
+ * @see #getDependency()
+ * @generated
+ */
+ EAttribute getDependency_Classifier();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Dependency#getScope <em>Scope</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Scope</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Dependency#getScope()
+ * @see #getDependency()
+ * @generated
+ */
+ EAttribute getDependency_Scope();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Dependency#getSystemPath <em>System Path</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>System Path</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Dependency#getSystemPath()
+ * @see #getDependency()
+ * @generated
+ */
+ EAttribute getDependency_SystemPath();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Dependency#getExclusions <em>Exclusions</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Exclusions</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Dependency#getExclusions()
+ * @see #getDependency()
+ * @generated
+ */
+ EReference getDependency_Exclusions();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Dependency#getOptional <em>Optional</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Optional</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Dependency#getOptional()
+ * @see #getDependency()
+ * @generated
+ */
+ EAttribute getDependency_Optional();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.DependencyManagement <em>Dependency Management</em>}'.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @return the meta object for class '<em>Dependency Management</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DependencyManagement
+ * @generated
+ */
+ EClass getDependencyManagement();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.DependencyManagement#getDependencies <em>Dependencies</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Dependencies</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DependencyManagement#getDependencies()
+ * @see #getDependencyManagement()
+ * @generated
+ */
+ EReference getDependencyManagement_Dependencies();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.DeploymentRepository <em>Deployment Repository</em>}'.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @return the meta object for class '<em>Deployment Repository</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DeploymentRepository
+ * @generated
+ */
+ EClass getDeploymentRepository();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getUniqueVersion <em>Unique Version</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Unique Version</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DeploymentRepository#getUniqueVersion()
+ * @see #getDeploymentRepository()
+ * @generated
+ */
+ EAttribute getDeploymentRepository_UniqueVersion();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getId <em>Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DeploymentRepository#getId()
+ * @see #getDeploymentRepository()
+ * @generated
+ */
+ EAttribute getDeploymentRepository_Id();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getName <em>Name</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DeploymentRepository#getName()
+ * @see #getDeploymentRepository()
+ * @generated
+ */
+ EAttribute getDeploymentRepository_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getUrl <em>Url</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DeploymentRepository#getUrl()
+ * @see #getDeploymentRepository()
+ * @generated
+ */
+ EAttribute getDeploymentRepository_Url();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.DeploymentRepository#getLayout <em>Layout</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Layout</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DeploymentRepository#getLayout()
+ * @see #getDeploymentRepository()
+ * @generated
+ */
+ EAttribute getDeploymentRepository_Layout();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer <em>Developer</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Developer</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Developer
+ * @generated
+ */
+ EClass getDeveloper();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getId <em>Id</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Developer#getId()
+ * @see #getDeveloper()
+ * @generated
+ */
+ EAttribute getDeveloper_Id();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Developer#getName <em>Name</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Developer#getName()
+ * @see #getDeveloper()
+ * @generated
+ */
+ EAttribute getDeveloper_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Developer#getEmail <em>Email</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Email</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Developer#getEmail()
+ * @see #getDeveloper()
+ * @generated
+ */
+ EAttribute getDeveloper_Email();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getUrl <em>Url</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Developer#getUrl()
+ * @see #getDeveloper()
+ * @generated
+ */
+ EAttribute getDeveloper_Url();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Developer#getOrganization <em>Organization</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Organization</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Developer#getOrganization()
+ * @see #getDeveloper()
+ * @generated
+ */
+ EAttribute getDeveloper_Organization();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer#getOrganizationUrl
+ * <em>Organization Url</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the attribute '<em>Organization Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Developer#getOrganizationUrl()
+ * @see #getDeveloper()
+ * @generated
+ */
+ EAttribute getDeveloper_OrganizationUrl();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Developer#getTimezone <em>Timezone</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Timezone</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Developer#getTimezone()
+ * @see #getDeveloper()
+ * @generated
+ */
+ EAttribute getDeveloper_Timezone();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Developer#getProperties <em>Properties</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Properties</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Developer#getProperties()
+ * @see #getDeveloper()
+ * @generated
+ */
+ EReference getDeveloper_Properties();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.m2e.model.edit.pom.Developer#getRoles <em>Roles</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Roles</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Developer#getRoles()
+ * @see #getDeveloper()
+ * @generated
+ */
+ EAttribute getDeveloper_Roles();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.DistributionManagement <em>Distribution Management</em>}'.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @return the meta object for class '<em>Distribution Management</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DistributionManagement
+ * @generated
+ */
+ EClass getDistributionManagement();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getRepository <em>Repository</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Repository</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DistributionManagement#getRepository()
+ * @see #getDistributionManagement()
+ * @generated
+ */
+ EReference getDistributionManagement_Repository();
+
+ /**
+ * Returns the meta object for the containment reference '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getSnapshotRepository
+ * <em>Snapshot Repository</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the containment reference '
+ * <em>Snapshot Repository</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DistributionManagement#getSnapshotRepository()
+ * @see #getDistributionManagement()
+ * @generated
+ */
+ EReference getDistributionManagement_SnapshotRepository();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getSite <em>Site</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Site</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DistributionManagement#getSite()
+ * @see #getDistributionManagement()
+ * @generated
+ */
+ EReference getDistributionManagement_Site();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getDownloadUrl <em>Download Url</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Download Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DistributionManagement#getDownloadUrl()
+ * @see #getDistributionManagement()
+ * @generated
+ */
+ EAttribute getDistributionManagement_DownloadUrl();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getRelocation <em>Relocation</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Relocation</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DistributionManagement#getRelocation()
+ * @see #getDistributionManagement()
+ * @generated
+ */
+ EReference getDistributionManagement_Relocation();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.DistributionManagement#getStatus <em>Status</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Status</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DistributionManagement#getStatus()
+ * @see #getDistributionManagement()
+ * @generated
+ */
+ EAttribute getDistributionManagement_Status();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.DocumentRoot <em>Document Root</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Document Root</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DocumentRoot
+ * @generated
+ */
+ EClass getDocumentRoot();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.m2e.model.edit.pom.DocumentRoot#getMixed <em>Mixed</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Mixed</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DocumentRoot#getMixed()
+ * @see #getDocumentRoot()
+ * @generated
+ */
+ EAttribute getDocumentRoot_Mixed();
+
+ /**
+ * Returns the meta object for the map '
+ * {@link org.eclipse.m2e.model.edit.pom.DocumentRoot#getXMLNSPrefixMap
+ * <em>XMLNS Prefix Map</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the map '<em>XMLNS Prefix Map</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DocumentRoot#getXMLNSPrefixMap()
+ * @see #getDocumentRoot()
+ * @generated
+ */
+ EReference getDocumentRoot_XMLNSPrefixMap();
+
+ /**
+ * Returns the meta object for the map '
+ * {@link org.eclipse.m2e.model.edit.pom.DocumentRoot#getXSISchemaLocation
+ * <em>XSI Schema Location</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the map '<em>XSI Schema Location</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DocumentRoot#getXSISchemaLocation()
+ * @see #getDocumentRoot()
+ * @generated
+ */
+ EReference getDocumentRoot_XSISchemaLocation();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.DocumentRoot#getProject <em>Project</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Project</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.DocumentRoot#getProject()
+ * @see #getDocumentRoot()
+ * @generated
+ */
+ EReference getDocumentRoot_Project();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.Exclusion <em>Exclusion</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Exclusion</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Exclusion
+ * @generated
+ */
+ EClass getExclusion();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Exclusion#getArtifactId <em>Artifact Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Artifact Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Exclusion#getArtifactId()
+ * @see #getExclusion()
+ * @generated
+ */
+ EAttribute getExclusion_ArtifactId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Exclusion#getGroupId <em>Group Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Group Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Exclusion#getGroupId()
+ * @see #getExclusion()
+ * @generated
+ */
+ EAttribute getExclusion_GroupId();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.Extension <em>Extension</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Extension</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Extension
+ * @generated
+ */
+ EClass getExtension();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Extension#getGroupId <em>Group Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Group Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Extension#getGroupId()
+ * @see #getExtension()
+ * @generated
+ */
+ EAttribute getExtension_GroupId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Extension#getArtifactId <em>Artifact Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Artifact Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Extension#getArtifactId()
+ * @see #getExtension()
+ * @generated
+ */
+ EAttribute getExtension_ArtifactId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Extension#getVersion <em>Version</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Version</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Extension#getVersion()
+ * @see #getExtension()
+ * @generated
+ */
+ EAttribute getExtension_Version();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.IssueManagement
+ * <em>Issue Management</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for class '<em>Issue Management</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.IssueManagement
+ * @generated
+ */
+ EClass getIssueManagement();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.IssueManagement#getSystem <em>System</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>System</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.IssueManagement#getSystem()
+ * @see #getIssueManagement()
+ * @generated
+ */
+ EAttribute getIssueManagement_System();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.IssueManagement#getUrl <em>Url</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.IssueManagement#getUrl()
+ * @see #getIssueManagement()
+ * @generated
+ */
+ EAttribute getIssueManagement_Url();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.License <em>License</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>License</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.License
+ * @generated
+ */
+ EClass getLicense();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.License#getName <em>Name</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.License#getName()
+ * @see #getLicense()
+ * @generated
+ */
+ EAttribute getLicense_Name();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.License#getUrl <em>Url</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.License#getUrl()
+ * @see #getLicense()
+ * @generated
+ */
+ EAttribute getLicense_Url();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.License#getDistribution <em>Distribution</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Distribution</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.License#getDistribution()
+ * @see #getLicense()
+ * @generated
+ */
+ EAttribute getLicense_Distribution();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.License#getComments <em>Comments</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Comments</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.License#getComments()
+ * @see #getLicense()
+ * @generated
+ */
+ EAttribute getLicense_Comments();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.MailingList <em>Mailing List</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Mailing List</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.MailingList
+ * @generated
+ */
+ EClass getMailingList();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.MailingList#getName <em>Name</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.MailingList#getName()
+ * @see #getMailingList()
+ * @generated
+ */
+ EAttribute getMailingList_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.MailingList#getSubscribe <em>Subscribe</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Subscribe</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.MailingList#getSubscribe()
+ * @see #getMailingList()
+ * @generated
+ */
+ EAttribute getMailingList_Subscribe();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.MailingList#getUnsubscribe <em>Unsubscribe</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Unsubscribe</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.MailingList#getUnsubscribe()
+ * @see #getMailingList()
+ * @generated
+ */
+ EAttribute getMailingList_Unsubscribe();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.MailingList#getPost <em>Post</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Post</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.MailingList#getPost()
+ * @see #getMailingList()
+ * @generated
+ */
+ EAttribute getMailingList_Post();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.MailingList#getArchive <em>Archive</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Archive</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.MailingList#getArchive()
+ * @see #getMailingList()
+ * @generated
+ */
+ EAttribute getMailingList_Archive();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.m2e.model.edit.pom.MailingList#getOtherArchives <em>Other Archives</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Other Archives</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.MailingList#getOtherArchives()
+ * @see #getMailingList()
+ * @generated
+ */
+ EAttribute getMailingList_OtherArchives();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.Model <em>Model</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Model</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model
+ * @generated
+ */
+ EClass getModel();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Model#getParent <em>Parent</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Parent</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getParent()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_Parent();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Model#getModelVersion <em>Model Version</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Model Version</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getModelVersion()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_ModelVersion();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Model#getGroupId <em>Group Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Group Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getGroupId()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_GroupId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Model#getArtifactId <em>Artifact Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Artifact Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getArtifactId()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_ArtifactId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Model#getPackaging <em>Packaging</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Packaging</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getPackaging()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_Packaging();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getName <em>Name</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getName()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Model#getVersion <em>Version</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Version</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getVersion()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_Version();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Model#getDescription <em>Description</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Description</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getDescription()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_Description();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getUrl <em>Url</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getUrl()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_Url();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Model#getPrerequisites <em>Prerequisites</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Prerequisites</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getPrerequisites()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_Prerequisites();
+
+ /**
+ * Returns the meta object for the containment reference '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getIssueManagement
+ * <em>Issue Management</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the containment reference '
+ * <em>Issue Management</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getIssueManagement()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_IssueManagement();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Model#getCiManagement <em>Ci Management</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Ci Management</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getCiManagement()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_CiManagement();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Model#getInceptionYear <em>Inception Year</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Inception Year</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getInceptionYear()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_InceptionYear();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Model#getMailingLists <em>Mailing Lists</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Mailing Lists</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getMailingLists()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_MailingLists();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Model#getDevelopers <em>Developers</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Developers</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getDevelopers()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_Developers();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Model#getContributors <em>Contributors</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Contributors</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getContributors()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_Contributors();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Model#getLicenses <em>Licenses</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Licenses</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getLicenses()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_Licenses();
+
+ /**
+ * Returns the meta object for the containment reference '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getScm <em>Scm</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the containment reference '<em>Scm</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getScm()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_Scm();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Model#getOrganization <em>Organization</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Organization</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getOrganization()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_Organization();
+
+ /**
+ * Returns the meta object for the containment reference '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getBuild <em>Build</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the containment reference '<em>Build</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getBuild()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_Build();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Model#getProfiles <em>Profiles</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Profiles</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getProfiles()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_Profiles();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Model#getRepositories <em>Repositories</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Repositories</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getRepositories()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_Repositories();
+
+ /**
+ * Returns the meta object for the containment reference list '
+ * {@link org.eclipse.m2e.model.edit.pom.Model#getPluginRepositories
+ * <em>Plugin Repositories</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the containment reference list '
+ * <em>Plugin Repositories</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getPluginRepositories()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_PluginRepositories();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Model#getDependencies <em>Dependencies</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Dependencies</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getDependencies()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_Dependencies();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Model#getReporting <em>Reporting</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Reporting</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getReporting()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_Reporting();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Model#getDependencyManagement <em>Dependency Management</em>}'.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @return the meta object for the containment reference '<em>Dependency Management</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getDependencyManagement()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_DependencyManagement();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Model#getDistributionManagement <em>Distribution Management</em>}'.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @return the meta object for the containment reference '<em>Distribution Management</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getDistributionManagement()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_DistributionManagement();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Model#getProperties <em>Properties</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Properties</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getProperties()
+ * @see #getModel()
+ * @generated
+ */
+ EReference getModel_Properties();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.m2e.model.edit.pom.Model#getModules <em>Modules</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Modules</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Model#getModules()
+ * @see #getModel()
+ * @generated
+ */
+ EAttribute getModel_Modules();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier <em>Notifier</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Notifier</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Notifier
+ * @generated
+ */
+ EClass getNotifier();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Notifier#getType <em>Type</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Type</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Notifier#getType()
+ * @see #getNotifier()
+ * @generated
+ */
+ EAttribute getNotifier_Type();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnError <em>Send On Error</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Send On Error</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Notifier#getSendOnError()
+ * @see #getNotifier()
+ * @generated
+ */
+ EAttribute getNotifier_SendOnError();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnFailure <em>Send On Failure</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Send On Failure</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Notifier#getSendOnFailure()
+ * @see #getNotifier()
+ * @generated
+ */
+ EAttribute getNotifier_SendOnFailure();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnSuccess <em>Send On Success</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Send On Success</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Notifier#getSendOnSuccess()
+ * @see #getNotifier()
+ * @generated
+ */
+ EAttribute getNotifier_SendOnSuccess();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Notifier#getSendOnWarning <em>Send On Warning</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Send On Warning</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Notifier#getSendOnWarning()
+ * @see #getNotifier()
+ * @generated
+ */
+ EAttribute getNotifier_SendOnWarning();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Notifier#getAddress <em>Address</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Address</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Notifier#getAddress()
+ * @see #getNotifier()
+ * @generated
+ */
+ EAttribute getNotifier_Address();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Notifier#getConfiguration <em>Configuration</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Configuration</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Notifier#getConfiguration()
+ * @see #getNotifier()
+ * @generated
+ */
+ EReference getNotifier_Configuration();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.Organization <em>Organization</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Organization</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Organization
+ * @generated
+ */
+ EClass getOrganization();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Organization#getName <em>Name</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Organization#getName()
+ * @see #getOrganization()
+ * @generated
+ */
+ EAttribute getOrganization_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Organization#getUrl <em>Url</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Organization#getUrl()
+ * @see #getOrganization()
+ * @generated
+ */
+ EAttribute getOrganization_Url();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.Parent <em>Parent</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Parent</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Parent
+ * @generated
+ */
+ EClass getParent();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Parent#getArtifactId <em>Artifact Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Artifact Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Parent#getArtifactId()
+ * @see #getParent()
+ * @generated
+ */
+ EAttribute getParent_ArtifactId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Parent#getGroupId <em>Group Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Group Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Parent#getGroupId()
+ * @see #getParent()
+ * @generated
+ */
+ EAttribute getParent_GroupId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Parent#getVersion <em>Version</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Version</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Parent#getVersion()
+ * @see #getParent()
+ * @generated
+ */
+ EAttribute getParent_Version();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Parent#getRelativePath <em>Relative Path</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Relative Path</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Parent#getRelativePath()
+ * @see #getParent()
+ * @generated
+ */
+ EAttribute getParent_RelativePath();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin <em>Plugin</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Plugin</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Plugin
+ * @generated
+ */
+ EClass getPlugin();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Plugin#getGroupId <em>Group Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Group Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Plugin#getGroupId()
+ * @see #getPlugin()
+ * @generated
+ */
+ EAttribute getPlugin_GroupId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Plugin#getArtifactId <em>Artifact Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Artifact Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Plugin#getArtifactId()
+ * @see #getPlugin()
+ * @generated
+ */
+ EAttribute getPlugin_ArtifactId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Plugin#getVersion <em>Version</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Version</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Plugin#getVersion()
+ * @see #getPlugin()
+ * @generated
+ */
+ EAttribute getPlugin_Version();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Plugin#getExtensions <em>Extensions</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Extensions</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Plugin#getExtensions()
+ * @see #getPlugin()
+ * @generated
+ */
+ EAttribute getPlugin_Extensions();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Plugin#getExecutions <em>Executions</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Executions</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Plugin#getExecutions()
+ * @see #getPlugin()
+ * @generated
+ */
+ EReference getPlugin_Executions();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Plugin#getDependencies <em>Dependencies</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Dependencies</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Plugin#getDependencies()
+ * @see #getPlugin()
+ * @generated
+ */
+ EReference getPlugin_Dependencies();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Plugin#getInherited <em>Inherited</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Inherited</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Plugin#getInherited()
+ * @see #getPlugin()
+ * @generated
+ */
+ EAttribute getPlugin_Inherited();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.m2e.model.edit.pom.Plugin#getConfiguration <em>Configuration</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Configuration</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Plugin#getConfiguration()
+ * @see #getPlugin()
+ * @generated
+ */
+ EReference getPlugin_Configuration();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.PluginExecution
+ * <em>Plugin Execution</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for class '<em>Plugin Execution</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.PluginExecution
+ * @generated
+ */
+ EClass getPluginExecution();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.PluginExecution#getId <em>Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.PluginExecution#getId()
+ * @see #getPluginExecution()
+ * @generated
+ */
+ EAttribute getPluginExecution_Id();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.PluginExecution#getPhase <em>Phase</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Phase</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.PluginExecution#getPhase()
+ * @see #getPluginExecution()
+ * @generated
+ */
+ EAttribute getPluginExecution_Phase();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.PluginExecution#getInherited <em>Inherited</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Inherited</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.PluginExecution#getInherited()
+ * @see #getPluginExecution()
+ * @generated
+ */
+ EAttribute getPluginExecution_Inherited();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.m2e.model.edit.pom.PluginExecution#getGoals <em>Goals</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Goals</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.PluginExecution#getGoals()
+ * @see #getPluginExecution()
+ * @generated
+ */
+ EAttribute getPluginExecution_Goals();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.m2e.model.edit.pom.PluginExecution#getConfiguration <em>Configuration</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Configuration</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.PluginExecution#getConfiguration()
+ * @see #getPluginExecution()
+ * @generated
+ */
+ EReference getPluginExecution_Configuration();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.PluginManagement
+ * <em>Plugin Management</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for class '<em>Plugin Management</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.PluginManagement
+ * @generated
+ */
+ EClass getPluginManagement();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.PluginManagement#getPlugins <em>Plugins</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Plugins</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.PluginManagement#getPlugins()
+ * @see #getPluginManagement()
+ * @generated
+ */
+ EReference getPluginManagement_Plugins();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.Prerequisites <em>Prerequisites</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Prerequisites</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Prerequisites
+ * @generated
+ */
+ EClass getPrerequisites();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Prerequisites#getMaven <em>Maven</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Maven</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Prerequisites#getMaven()
+ * @see #getPrerequisites()
+ * @generated
+ */
+ EAttribute getPrerequisites_Maven();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile <em>Profile</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Profile</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Profile
+ * @generated
+ */
+ EClass getProfile();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getId <em>Id</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Profile#getId()
+ * @see #getProfile()
+ * @generated
+ */
+ EAttribute getProfile_Id();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Profile#getActivation <em>Activation</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Activation</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Profile#getActivation()
+ * @see #getProfile()
+ * @generated
+ */
+ EReference getProfile_Activation();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Profile#getBuild <em>Build</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Build</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Profile#getBuild()
+ * @see #getProfile()
+ * @generated
+ */
+ EReference getProfile_Build();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Profile#getRepositories <em>Repositories</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Repositories</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Profile#getRepositories()
+ * @see #getProfile()
+ * @generated
+ */
+ EReference getProfile_Repositories();
+
+ /**
+ * Returns the meta object for the containment reference list '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getPluginRepositories
+ * <em>Plugin Repositories</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the containment reference list '
+ * <em>Plugin Repositories</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Profile#getPluginRepositories()
+ * @see #getProfile()
+ * @generated
+ */
+ EReference getProfile_PluginRepositories();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Profile#getDependencies <em>Dependencies</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Dependencies</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Profile#getDependencies()
+ * @see #getProfile()
+ * @generated
+ */
+ EReference getProfile_Dependencies();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Profile#getReports <em>Reports</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Reports</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Profile#getReports()
+ * @see #getProfile()
+ * @generated
+ */
+ EReference getProfile_Reports();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Profile#getDependencyManagement <em>Dependency Management</em>}'.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @return the meta object for the containment reference '<em>Dependency Management</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Profile#getDependencyManagement()
+ * @see #getProfile()
+ * @generated
+ */
+ EReference getProfile_DependencyManagement();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Profile#getDistributionManagement <em>Distribution Management</em>}'.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @return the meta object for the containment reference '<em>Distribution Management</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Profile#getDistributionManagement()
+ * @see #getProfile()
+ * @generated
+ */
+ EReference getProfile_DistributionManagement();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Profile#getProperties <em>Properties</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Properties</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Profile#getProperties()
+ * @see #getProfile()
+ * @generated
+ */
+ EReference getProfile_Properties();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.m2e.model.edit.pom.Profile#getModules <em>Modules</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Modules</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Profile#getModules()
+ * @see #getProfile()
+ * @generated
+ */
+ EAttribute getProfile_Modules();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.m2e.model.edit.pom.Profile#getReporting <em>Reporting</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Reporting</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Profile#getReporting()
+ * @see #getProfile()
+ * @generated
+ */
+ EReference getProfile_Reporting();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.Relocation <em>Relocation</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Relocation</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Relocation
+ * @generated
+ */
+ EClass getRelocation();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Relocation#getGroupId <em>Group Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Group Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Relocation#getGroupId()
+ * @see #getRelocation()
+ * @generated
+ */
+ EAttribute getRelocation_GroupId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Relocation#getArtifactId <em>Artifact Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Artifact Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Relocation#getArtifactId()
+ * @see #getRelocation()
+ * @generated
+ */
+ EAttribute getRelocation_ArtifactId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Relocation#getVersion <em>Version</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Version</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Relocation#getVersion()
+ * @see #getRelocation()
+ * @generated
+ */
+ EAttribute getRelocation_Version();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Relocation#getMessage <em>Message</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Message</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Relocation#getMessage()
+ * @see #getRelocation()
+ * @generated
+ */
+ EAttribute getRelocation_Message();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.Reporting <em>Reporting</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Reporting</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Reporting
+ * @generated
+ */
+ EClass getReporting();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Reporting#getExcludeDefaults
+ * <em>Exclude Defaults</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the attribute '<em>Exclude Defaults</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Reporting#getExcludeDefaults()
+ * @see #getReporting()
+ * @generated
+ */
+ EAttribute getReporting_ExcludeDefaults();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Reporting#getOutputDirectory
+ * <em>Output Directory</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for the attribute '<em>Output Directory</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Reporting#getOutputDirectory()
+ * @see #getReporting()
+ * @generated
+ */
+ EAttribute getReporting_OutputDirectory();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.Reporting#getPlugins <em>Plugins</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Plugins</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Reporting#getPlugins()
+ * @see #getReporting()
+ * @generated
+ */
+ EReference getReporting_Plugins();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.ReportPlugin <em>Report Plugin</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Report Plugin</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ReportPlugin
+ * @generated
+ */
+ EClass getReportPlugin();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getGroupId <em>Group Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Group Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ReportPlugin#getGroupId()
+ * @see #getReportPlugin()
+ * @generated
+ */
+ EAttribute getReportPlugin_GroupId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getArtifactId <em>Artifact Id</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Artifact Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ReportPlugin#getArtifactId()
+ * @see #getReportPlugin()
+ * @generated
+ */
+ EAttribute getReportPlugin_ArtifactId();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getVersion <em>Version</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Version</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ReportPlugin#getVersion()
+ * @see #getReportPlugin()
+ * @generated
+ */
+ EAttribute getReportPlugin_Version();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getInherited <em>Inherited</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Inherited</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ReportPlugin#getInherited()
+ * @see #getReportPlugin()
+ * @generated
+ */
+ EAttribute getReportPlugin_Inherited();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getReportSets <em>Report Sets</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Report Sets</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ReportPlugin#getReportSets()
+ * @see #getReportPlugin()
+ * @generated
+ */
+ EReference getReportPlugin_ReportSets();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getConfiguration <em>Configuration</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Configuration</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ReportPlugin#getConfiguration()
+ * @see #getReportPlugin()
+ * @generated
+ */
+ EReference getReportPlugin_Configuration();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportSet <em>Report Set</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Report Set</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ReportSet
+ * @generated
+ */
+ EClass getReportSet();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportSet#getId <em>Id</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ReportSet#getId()
+ * @see #getReportSet()
+ * @generated
+ */
+ EAttribute getReportSet_Id();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.ReportSet#getInherited <em>Inherited</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Inherited</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ReportSet#getInherited()
+ * @see #getReportSet()
+ * @generated
+ */
+ EAttribute getReportSet_Inherited();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.m2e.model.edit.pom.ReportSet#getReports <em>Reports</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Reports</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ReportSet#getReports()
+ * @see #getReportSet()
+ * @generated
+ */
+ EAttribute getReportSet_Reports();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.m2e.model.edit.pom.ReportSet#getConfiguration <em>Configuration</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Configuration</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.ReportSet#getConfiguration()
+ * @see #getReportSet()
+ * @generated
+ */
+ EReference getReportSet_Configuration();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.Repository <em>Repository</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Repository</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Repository
+ * @generated
+ */
+ EClass getRepository();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Repository#getReleases <em>Releases</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Releases</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Repository#getReleases()
+ * @see #getRepository()
+ * @generated
+ */
+ EReference getRepository_Releases();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.m2e.model.edit.pom.Repository#getSnapshots <em>Snapshots</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Snapshots</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Repository#getSnapshots()
+ * @see #getRepository()
+ * @generated
+ */
+ EReference getRepository_Snapshots();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository#getId <em>Id</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Repository#getId()
+ * @see #getRepository()
+ * @generated
+ */
+ EAttribute getRepository_Id();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Repository#getName <em>Name</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Repository#getName()
+ * @see #getRepository()
+ * @generated
+ */
+ EAttribute getRepository_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Repository#getUrl <em>Url</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Repository#getUrl()
+ * @see #getRepository()
+ * @generated
+ */
+ EAttribute getRepository_Url();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Repository#getLayout <em>Layout</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Layout</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Repository#getLayout()
+ * @see #getRepository()
+ * @generated
+ */
+ EAttribute getRepository_Layout();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy
+ * <em>Repository Policy</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for class '<em>Repository Policy</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.RepositoryPolicy
+ * @generated
+ */
+ EClass getRepositoryPolicy();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getEnabled <em>Enabled</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Enabled</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getEnabled()
+ * @see #getRepositoryPolicy()
+ * @generated
+ */
+ EAttribute getRepositoryPolicy_Enabled();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getUpdatePolicy <em>Update Policy</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Update Policy</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getUpdatePolicy()
+ * @see #getRepositoryPolicy()
+ * @generated
+ */
+ EAttribute getRepositoryPolicy_UpdatePolicy();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getChecksumPolicy <em>Checksum Policy</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Checksum Policy</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getChecksumPolicy()
+ * @see #getRepositoryPolicy()
+ * @generated
+ */
+ EAttribute getRepositoryPolicy_ChecksumPolicy();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.Resource <em>Resource</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Resource</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Resource
+ * @generated
+ */
+ EClass getResource();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Resource#getTargetPath <em>Target Path</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Target Path</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Resource#getTargetPath()
+ * @see #getResource()
+ * @generated
+ */
+ EAttribute getResource_TargetPath();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Resource#getFiltering <em>Filtering</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Filtering</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Resource#getFiltering()
+ * @see #getResource()
+ * @generated
+ */
+ EAttribute getResource_Filtering();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Resource#getDirectory <em>Directory</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Directory</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Resource#getDirectory()
+ * @see #getResource()
+ * @generated
+ */
+ EAttribute getResource_Directory();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.m2e.model.edit.pom.Resource#getIncludes <em>Includes</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Includes</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Resource#getIncludes()
+ * @see #getResource()
+ * @generated
+ */
+ EAttribute getResource_Includes();
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.m2e.model.edit.pom.Resource#getExcludes <em>Excludes</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Excludes</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Resource#getExcludes()
+ * @see #getResource()
+ * @generated
+ */
+ EAttribute getResource_Excludes();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.Scm <em>Scm</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Scm</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Scm
+ * @generated
+ */
+ EClass getScm();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Scm#getConnection <em>Connection</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Connection</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Scm#getConnection()
+ * @see #getScm()
+ * @generated
+ */
+ EAttribute getScm_Connection();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.Scm#getDeveloperConnection <em>Developer Connection</em>}'.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @return the meta object for the attribute '<em>Developer Connection</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Scm#getDeveloperConnection()
+ * @see #getScm()
+ * @generated
+ */
+ EAttribute getScm_DeveloperConnection();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Scm#getTag <em>Tag</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Tag</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Scm#getTag()
+ * @see #getScm()
+ * @generated
+ */
+ EAttribute getScm_Tag();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Scm#getUrl <em>Url</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Scm#getUrl()
+ * @see #getScm()
+ * @generated
+ */
+ EAttribute getScm_Url();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.Site <em>Site</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Site</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Site
+ * @generated
+ */
+ EClass getSite();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Site#getId <em>Id</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Id</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Site#getId()
+ * @see #getSite()
+ * @generated
+ */
+ EAttribute getSite_Id();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Site#getName <em>Name</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Site#getName()
+ * @see #getSite()
+ * @generated
+ */
+ EAttribute getSite_Name();
+
+ /**
+ * Returns the meta object for the attribute '
+ * {@link org.eclipse.m2e.model.edit.pom.Site#getUrl <em>Url</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Url</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Site#getUrl()
+ * @see #getSite()
+ * @generated
+ */
+ EAttribute getSite_Url();
+
+ /**
+ * Returns the meta object for class '
+ * {@link org.eclipse.m2e.model.edit.pom.PropertyElement
+ * <em>Property Element</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return the meta object for class '<em>Property Element</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.PropertyElement
+ * @generated
+ */
+ EClass getPropertyElement();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.PropertyElement#getName <em>Name</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.PropertyElement#getName()
+ * @see #getPropertyElement()
+ * @generated
+ */
+ EAttribute getPropertyElement_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.m2e.model.edit.pom.PropertyElement#getValue <em>Value</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Value</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.PropertyElement#getValue()
+ * @see #getPropertyElement()
+ * @generated
+ */
+ EAttribute getPropertyElement_Value();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.m2e.model.edit.pom.Configuration <em>Configuration</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @return the meta object for class '<em>Configuration</em>'.
+ * @see org.eclipse.m2e.model.edit.pom.Configuration
+ * @generated
+ */
+ EClass getConfiguration();
+
+ /**
+ * Returns the factory that creates the instances of the model. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ PomFactory getPomFactory();
+
+ /**
+ * <!-- begin-user-doc --> Defines literals for the meta objects that
+ * represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.ActivationImpl <em>Activation</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ActivationImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getActivation()
+ * @generated
+ */
+ EClass ACTIVATION = eINSTANCE.getActivation();
+
+ /**
+ * The meta object literal for the '<em><b>Active By Default</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ACTIVATION__ACTIVE_BY_DEFAULT = eINSTANCE.getActivation_ActiveByDefault();
+
+ /**
+ * The meta object literal for the '<em><b>Jdk</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ACTIVATION__JDK = eINSTANCE.getActivation_Jdk();
+
+ /**
+ * The meta object literal for the '<em><b>Os</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference ACTIVATION__OS = eINSTANCE.getActivation_Os();
+
+ /**
+ * The meta object literal for the '<em><b>Property</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference ACTIVATION__PROPERTY = eINSTANCE.getActivation_Property();
+
+ /**
+ * The meta object literal for the '<em><b>File</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference ACTIVATION__FILE = eINSTANCE.getActivation_File();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.ActivationFileImpl <em>Activation File</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ActivationFileImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getActivationFile()
+ * @generated
+ */
+ EClass ACTIVATION_FILE = eINSTANCE.getActivationFile();
+
+ /**
+ * The meta object literal for the '<em><b>Missing</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ACTIVATION_FILE__MISSING = eINSTANCE.getActivationFile_Missing();
+
+ /**
+ * The meta object literal for the '<em><b>Exists</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ACTIVATION_FILE__EXISTS = eINSTANCE.getActivationFile_Exists();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.ActivationOSImpl <em>Activation OS</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ActivationOSImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getActivationOS()
+ * @generated
+ */
+ EClass ACTIVATION_OS = eINSTANCE.getActivationOS();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ACTIVATION_OS__NAME = eINSTANCE.getActivationOS_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Family</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ACTIVATION_OS__FAMILY = eINSTANCE.getActivationOS_Family();
+
+ /**
+ * The meta object literal for the '<em><b>Arch</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ACTIVATION_OS__ARCH = eINSTANCE.getActivationOS_Arch();
+
+ /**
+ * The meta object literal for the '<em><b>Version</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ACTIVATION_OS__VERSION = eINSTANCE.getActivationOS_Version();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.ActivationPropertyImpl <em>Activation Property</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ActivationPropertyImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getActivationProperty()
+ * @generated
+ */
+ EClass ACTIVATION_PROPERTY = eINSTANCE.getActivationProperty();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ACTIVATION_PROPERTY__NAME = eINSTANCE.getActivationProperty_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Value</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ACTIVATION_PROPERTY__VALUE = eINSTANCE.getActivationProperty_Value();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.BuildImpl <em>Build</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.BuildImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getBuild()
+ * @generated
+ */
+ EClass BUILD = eINSTANCE.getBuild();
+
+ /**
+ * The meta object literal for the '<em><b>Source Directory</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute BUILD__SOURCE_DIRECTORY = eINSTANCE.getBuild_SourceDirectory();
+
+ /**
+ * The meta object literal for the '
+ * <em><b>Script Source Directory</b></em>' attribute feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute BUILD__SCRIPT_SOURCE_DIRECTORY = eINSTANCE.getBuild_ScriptSourceDirectory();
+
+ /**
+ * The meta object literal for the '
+ * <em><b>Test Source Directory</b></em>' attribute feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute BUILD__TEST_SOURCE_DIRECTORY = eINSTANCE.getBuild_TestSourceDirectory();
+
+ /**
+ * The meta object literal for the '<em><b>Output Directory</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute BUILD__OUTPUT_DIRECTORY = eINSTANCE.getBuild_OutputDirectory();
+
+ /**
+ * The meta object literal for the '
+ * <em><b>Test Output Directory</b></em>' attribute feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute BUILD__TEST_OUTPUT_DIRECTORY = eINSTANCE.getBuild_TestOutputDirectory();
+
+ /**
+ * The meta object literal for the '<em><b>Extensions</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference BUILD__EXTENSIONS = eINSTANCE.getBuild_Extensions();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.BuildBaseImpl <em>Build Base</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.BuildBaseImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getBuildBase()
+ * @generated
+ */
+ EClass BUILD_BASE = eINSTANCE.getBuildBase();
+
+ /**
+ * The meta object literal for the '<em><b>Default Goal</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute BUILD_BASE__DEFAULT_GOAL = eINSTANCE.getBuildBase_DefaultGoal();
+
+ /**
+ * The meta object literal for the '<em><b>Resources</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference BUILD_BASE__RESOURCES = eINSTANCE.getBuildBase_Resources();
+
+ /**
+ * The meta object literal for the '<em><b>Test Resources</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference BUILD_BASE__TEST_RESOURCES = eINSTANCE.getBuildBase_TestResources();
+
+ /**
+ * The meta object literal for the '<em><b>Directory</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute BUILD_BASE__DIRECTORY = eINSTANCE.getBuildBase_Directory();
+
+ /**
+ * The meta object literal for the '<em><b>Final Name</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute BUILD_BASE__FINAL_NAME = eINSTANCE.getBuildBase_FinalName();
+
+ /**
+ * The meta object literal for the '<em><b>Plugin Management</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference BUILD_BASE__PLUGIN_MANAGEMENT = eINSTANCE.getBuildBase_PluginManagement();
+
+ /**
+ * The meta object literal for the '<em><b>Plugins</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference BUILD_BASE__PLUGINS = eINSTANCE.getBuildBase_Plugins();
+
+ /**
+ * The meta object literal for the '<em><b>Filters</b></em>' attribute list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute BUILD_BASE__FILTERS = eINSTANCE.getBuildBase_Filters();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.CiManagementImpl <em>Ci Management</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.CiManagementImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getCiManagement()
+ * @generated
+ */
+ EClass CI_MANAGEMENT = eINSTANCE.getCiManagement();
+
+ /**
+ * The meta object literal for the '<em><b>System</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CI_MANAGEMENT__SYSTEM = eINSTANCE.getCiManagement_System();
+
+ /**
+ * The meta object literal for the '<em><b>Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CI_MANAGEMENT__URL = eINSTANCE.getCiManagement_Url();
+
+ /**
+ * The meta object literal for the '<em><b>Notifiers</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference CI_MANAGEMENT__NOTIFIERS = eINSTANCE.getCiManagement_Notifiers();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.ContributorImpl <em>Contributor</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ContributorImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getContributor()
+ * @generated
+ */
+ EClass CONTRIBUTOR = eINSTANCE.getContributor();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CONTRIBUTOR__NAME = eINSTANCE.getContributor_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Email</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CONTRIBUTOR__EMAIL = eINSTANCE.getContributor_Email();
+
+ /**
+ * The meta object literal for the '<em><b>Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CONTRIBUTOR__URL = eINSTANCE.getContributor_Url();
+
+ /**
+ * The meta object literal for the '<em><b>Organization</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CONTRIBUTOR__ORGANIZATION = eINSTANCE.getContributor_Organization();
+
+ /**
+ * The meta object literal for the '<em><b>Organization Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CONTRIBUTOR__ORGANIZATION_URL = eINSTANCE.getContributor_OrganizationUrl();
+
+ /**
+ * The meta object literal for the '<em><b>Timezone</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CONTRIBUTOR__TIMEZONE = eINSTANCE.getContributor_Timezone();
+
+ /**
+ * The meta object literal for the '<em><b>Properties</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference CONTRIBUTOR__PROPERTIES = eINSTANCE.getContributor_Properties();
+
+ /**
+ * The meta object literal for the '<em><b>Roles</b></em>' attribute list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute CONTRIBUTOR__ROLES = eINSTANCE.getContributor_Roles();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.DependencyImpl <em>Dependency</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.DependencyImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getDependency()
+ * @generated
+ */
+ EClass DEPENDENCY = eINSTANCE.getDependency();
+
+ /**
+ * The meta object literal for the '<em><b>Group Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEPENDENCY__GROUP_ID = eINSTANCE.getDependency_GroupId();
+
+ /**
+ * The meta object literal for the '<em><b>Artifact Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEPENDENCY__ARTIFACT_ID = eINSTANCE.getDependency_ArtifactId();
+
+ /**
+ * The meta object literal for the '<em><b>Version</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEPENDENCY__VERSION = eINSTANCE.getDependency_Version();
+
+ /**
+ * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEPENDENCY__TYPE = eINSTANCE.getDependency_Type();
+
+ /**
+ * The meta object literal for the '<em><b>Classifier</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEPENDENCY__CLASSIFIER = eINSTANCE.getDependency_Classifier();
+
+ /**
+ * The meta object literal for the '<em><b>Scope</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEPENDENCY__SCOPE = eINSTANCE.getDependency_Scope();
+
+ /**
+ * The meta object literal for the '<em><b>System Path</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEPENDENCY__SYSTEM_PATH = eINSTANCE.getDependency_SystemPath();
+
+ /**
+ * The meta object literal for the '<em><b>Exclusions</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference DEPENDENCY__EXCLUSIONS = eINSTANCE.getDependency_Exclusions();
+
+ /**
+ * The meta object literal for the '<em><b>Optional</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEPENDENCY__OPTIONAL = eINSTANCE.getDependency_Optional();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.DependencyManagementImpl <em>Dependency Management</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.DependencyManagementImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getDependencyManagement()
+ * @generated
+ */
+ EClass DEPENDENCY_MANAGEMENT = eINSTANCE.getDependencyManagement();
+
+ /**
+ * The meta object literal for the '<em><b>Dependencies</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference DEPENDENCY_MANAGEMENT__DEPENDENCIES = eINSTANCE.getDependencyManagement_Dependencies();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.DeploymentRepositoryImpl <em>Deployment Repository</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.DeploymentRepositoryImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getDeploymentRepository()
+ * @generated
+ */
+ EClass DEPLOYMENT_REPOSITORY = eINSTANCE.getDeploymentRepository();
+
+ /**
+ * The meta object literal for the '<em><b>Unique Version</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEPLOYMENT_REPOSITORY__UNIQUE_VERSION = eINSTANCE.getDeploymentRepository_UniqueVersion();
+
+ /**
+ * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEPLOYMENT_REPOSITORY__ID = eINSTANCE.getDeploymentRepository_Id();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEPLOYMENT_REPOSITORY__NAME = eINSTANCE.getDeploymentRepository_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEPLOYMENT_REPOSITORY__URL = eINSTANCE.getDeploymentRepository_Url();
+
+ /**
+ * The meta object literal for the '<em><b>Layout</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEPLOYMENT_REPOSITORY__LAYOUT = eINSTANCE.getDeploymentRepository_Layout();
+
+ /**
+ * The meta object literal for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DeveloperImpl
+ * <em>Developer</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.DeveloperImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getDeveloper()
+ * @generated
+ */
+ EClass DEVELOPER = eINSTANCE.getDeveloper();
+
+ /**
+ * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEVELOPER__ID = eINSTANCE.getDeveloper_Id();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEVELOPER__NAME = eINSTANCE.getDeveloper_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Email</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEVELOPER__EMAIL = eINSTANCE.getDeveloper_Email();
+
+ /**
+ * The meta object literal for the '<em><b>Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEVELOPER__URL = eINSTANCE.getDeveloper_Url();
+
+ /**
+ * The meta object literal for the '<em><b>Organization</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEVELOPER__ORGANIZATION = eINSTANCE.getDeveloper_Organization();
+
+ /**
+ * The meta object literal for the '<em><b>Organization Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEVELOPER__ORGANIZATION_URL = eINSTANCE.getDeveloper_OrganizationUrl();
+
+ /**
+ * The meta object literal for the '<em><b>Timezone</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEVELOPER__TIMEZONE = eINSTANCE.getDeveloper_Timezone();
+
+ /**
+ * The meta object literal for the '<em><b>Properties</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference DEVELOPER__PROPERTIES = eINSTANCE.getDeveloper_Properties();
+
+ /**
+ * The meta object literal for the '<em><b>Roles</b></em>' attribute list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DEVELOPER__ROLES = eINSTANCE.getDeveloper_Roles();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.DistributionManagementImpl <em>Distribution Management</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.DistributionManagementImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getDistributionManagement()
+ * @generated
+ */
+ EClass DISTRIBUTION_MANAGEMENT = eINSTANCE.getDistributionManagement();
+
+ /**
+ * The meta object literal for the '<em><b>Repository</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference DISTRIBUTION_MANAGEMENT__REPOSITORY = eINSTANCE.getDistributionManagement_Repository();
+
+ /**
+ * The meta object literal for the '<em><b>Snapshot Repository</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY = eINSTANCE.getDistributionManagement_SnapshotRepository();
+
+ /**
+ * The meta object literal for the '<em><b>Site</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference DISTRIBUTION_MANAGEMENT__SITE = eINSTANCE.getDistributionManagement_Site();
+
+ /**
+ * The meta object literal for the '<em><b>Download Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DISTRIBUTION_MANAGEMENT__DOWNLOAD_URL = eINSTANCE.getDistributionManagement_DownloadUrl();
+
+ /**
+ * The meta object literal for the '<em><b>Relocation</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference DISTRIBUTION_MANAGEMENT__RELOCATION = eINSTANCE.getDistributionManagement_Relocation();
+
+ /**
+ * The meta object literal for the '<em><b>Status</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DISTRIBUTION_MANAGEMENT__STATUS = eINSTANCE.getDistributionManagement_Status();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.DocumentRootImpl <em>Document Root</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.DocumentRootImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getDocumentRoot()
+ * @generated
+ */
+ EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot();
+
+ /**
+ * The meta object literal for the '<em><b>Mixed</b></em>' attribute list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed();
+
+ /**
+ * The meta object literal for the '<em><b>XMLNS Prefix Map</b></em>' map feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap();
+
+ /**
+ * The meta object literal for the '<em><b>XSI Schema Location</b></em>' map feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation();
+
+ /**
+ * The meta object literal for the '<em><b>Project</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference DOCUMENT_ROOT__PROJECT = eINSTANCE.getDocumentRoot_Project();
+
+ /**
+ * The meta object literal for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ExclusionImpl
+ * <em>Exclusion</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.ExclusionImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getExclusion()
+ * @generated
+ */
+ EClass EXCLUSION = eINSTANCE.getExclusion();
+
+ /**
+ * The meta object literal for the '<em><b>Artifact Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute EXCLUSION__ARTIFACT_ID = eINSTANCE.getExclusion_ArtifactId();
+
+ /**
+ * The meta object literal for the '<em><b>Group Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute EXCLUSION__GROUP_ID = eINSTANCE.getExclusion_GroupId();
+
+ /**
+ * The meta object literal for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ExtensionImpl
+ * <em>Extension</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.ExtensionImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getExtension()
+ * @generated
+ */
+ EClass EXTENSION = eINSTANCE.getExtension();
+
+ /**
+ * The meta object literal for the '<em><b>Group Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute EXTENSION__GROUP_ID = eINSTANCE.getExtension_GroupId();
+
+ /**
+ * The meta object literal for the '<em><b>Artifact Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute EXTENSION__ARTIFACT_ID = eINSTANCE.getExtension_ArtifactId();
+
+ /**
+ * The meta object literal for the '<em><b>Version</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute EXTENSION__VERSION = eINSTANCE.getExtension_Version();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.IssueManagementImpl <em>Issue Management</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.IssueManagementImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getIssueManagement()
+ * @generated
+ */
+ EClass ISSUE_MANAGEMENT = eINSTANCE.getIssueManagement();
+
+ /**
+ * The meta object literal for the '<em><b>System</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ISSUE_MANAGEMENT__SYSTEM = eINSTANCE.getIssueManagement_System();
+
+ /**
+ * The meta object literal for the '<em><b>Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ISSUE_MANAGEMENT__URL = eINSTANCE.getIssueManagement_Url();
+
+ /**
+ * The meta object literal for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.LicenseImpl
+ * <em>License</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.LicenseImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getLicense()
+ * @generated
+ */
+ EClass LICENSE = eINSTANCE.getLicense();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute LICENSE__NAME = eINSTANCE.getLicense_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute LICENSE__URL = eINSTANCE.getLicense_Url();
+
+ /**
+ * The meta object literal for the '<em><b>Distribution</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute LICENSE__DISTRIBUTION = eINSTANCE.getLicense_Distribution();
+
+ /**
+ * The meta object literal for the '<em><b>Comments</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute LICENSE__COMMENTS = eINSTANCE.getLicense_Comments();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.MailingListImpl <em>Mailing List</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.MailingListImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getMailingList()
+ * @generated
+ */
+ EClass MAILING_LIST = eINSTANCE.getMailingList();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MAILING_LIST__NAME = eINSTANCE.getMailingList_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Subscribe</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MAILING_LIST__SUBSCRIBE = eINSTANCE.getMailingList_Subscribe();
+
+ /**
+ * The meta object literal for the '<em><b>Unsubscribe</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MAILING_LIST__UNSUBSCRIBE = eINSTANCE.getMailingList_Unsubscribe();
+
+ /**
+ * The meta object literal for the '<em><b>Post</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MAILING_LIST__POST = eINSTANCE.getMailingList_Post();
+
+ /**
+ * The meta object literal for the '<em><b>Archive</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MAILING_LIST__ARCHIVE = eINSTANCE.getMailingList_Archive();
+
+ /**
+ * The meta object literal for the '<em><b>Other Archives</b></em>' attribute list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MAILING_LIST__OTHER_ARCHIVES = eINSTANCE.getMailingList_OtherArchives();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl <em>Model</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ModelImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getModel()
+ * @generated
+ */
+ EClass MODEL = eINSTANCE.getModel();
+
+ /**
+ * The meta object literal for the '<em><b>Parent</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__PARENT = eINSTANCE.getModel_Parent();
+
+ /**
+ * The meta object literal for the '<em><b>Model Version</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__MODEL_VERSION = eINSTANCE.getModel_ModelVersion();
+
+ /**
+ * The meta object literal for the '<em><b>Group Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__GROUP_ID = eINSTANCE.getModel_GroupId();
+
+ /**
+ * The meta object literal for the '<em><b>Artifact Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__ARTIFACT_ID = eINSTANCE.getModel_ArtifactId();
+
+ /**
+ * The meta object literal for the '<em><b>Packaging</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__PACKAGING = eINSTANCE.getModel_Packaging();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__NAME = eINSTANCE.getModel_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Version</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__VERSION = eINSTANCE.getModel_Version();
+
+ /**
+ * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__DESCRIPTION = eINSTANCE.getModel_Description();
+
+ /**
+ * The meta object literal for the '<em><b>Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__URL = eINSTANCE.getModel_Url();
+
+ /**
+ * The meta object literal for the '<em><b>Prerequisites</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__PREREQUISITES = eINSTANCE.getModel_Prerequisites();
+
+ /**
+ * The meta object literal for the '<em><b>Issue Management</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__ISSUE_MANAGEMENT = eINSTANCE.getModel_IssueManagement();
+
+ /**
+ * The meta object literal for the '<em><b>Ci Management</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__CI_MANAGEMENT = eINSTANCE.getModel_CiManagement();
+
+ /**
+ * The meta object literal for the '<em><b>Inception Year</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__INCEPTION_YEAR = eINSTANCE.getModel_InceptionYear();
+
+ /**
+ * The meta object literal for the '<em><b>Mailing Lists</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__MAILING_LISTS = eINSTANCE.getModel_MailingLists();
+
+ /**
+ * The meta object literal for the '<em><b>Developers</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__DEVELOPERS = eINSTANCE.getModel_Developers();
+
+ /**
+ * The meta object literal for the '<em><b>Contributors</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__CONTRIBUTORS = eINSTANCE.getModel_Contributors();
+
+ /**
+ * The meta object literal for the '<em><b>Licenses</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__LICENSES = eINSTANCE.getModel_Licenses();
+
+ /**
+ * The meta object literal for the '<em><b>Scm</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__SCM = eINSTANCE.getModel_Scm();
+
+ /**
+ * The meta object literal for the '<em><b>Organization</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__ORGANIZATION = eINSTANCE.getModel_Organization();
+
+ /**
+ * The meta object literal for the '<em><b>Build</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__BUILD = eINSTANCE.getModel_Build();
+
+ /**
+ * The meta object literal for the '<em><b>Profiles</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__PROFILES = eINSTANCE.getModel_Profiles();
+
+ /**
+ * The meta object literal for the '<em><b>Repositories</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__REPOSITORIES = eINSTANCE.getModel_Repositories();
+
+ /**
+ * The meta object literal for the '<em><b>Plugin Repositories</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__PLUGIN_REPOSITORIES = eINSTANCE.getModel_PluginRepositories();
+
+ /**
+ * The meta object literal for the '<em><b>Dependencies</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__DEPENDENCIES = eINSTANCE.getModel_Dependencies();
+
+ /**
+ * The meta object literal for the '<em><b>Reporting</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__REPORTING = eINSTANCE.getModel_Reporting();
+
+ /**
+ * The meta object literal for the '<em><b>Dependency Management</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__DEPENDENCY_MANAGEMENT = eINSTANCE.getModel_DependencyManagement();
+
+ /**
+ * The meta object literal for the '<em><b>Distribution Management</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__DISTRIBUTION_MANAGEMENT = eINSTANCE.getModel_DistributionManagement();
+
+ /**
+ * The meta object literal for the '<em><b>Properties</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference MODEL__PROPERTIES = eINSTANCE.getModel_Properties();
+
+ /**
+ * The meta object literal for the '<em><b>Modules</b></em>' attribute list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute MODEL__MODULES = eINSTANCE.getModel_Modules();
+
+ /**
+ * The meta object literal for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.NotifierImpl
+ * <em>Notifier</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.NotifierImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getNotifier()
+ * @generated
+ */
+ EClass NOTIFIER = eINSTANCE.getNotifier();
+
+ /**
+ * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute NOTIFIER__TYPE = eINSTANCE.getNotifier_Type();
+
+ /**
+ * The meta object literal for the '<em><b>Send On Error</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute NOTIFIER__SEND_ON_ERROR = eINSTANCE.getNotifier_SendOnError();
+
+ /**
+ * The meta object literal for the '<em><b>Send On Failure</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute NOTIFIER__SEND_ON_FAILURE = eINSTANCE.getNotifier_SendOnFailure();
+
+ /**
+ * The meta object literal for the '<em><b>Send On Success</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute NOTIFIER__SEND_ON_SUCCESS = eINSTANCE.getNotifier_SendOnSuccess();
+
+ /**
+ * The meta object literal for the '<em><b>Send On Warning</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute NOTIFIER__SEND_ON_WARNING = eINSTANCE.getNotifier_SendOnWarning();
+
+ /**
+ * The meta object literal for the '<em><b>Address</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute NOTIFIER__ADDRESS = eINSTANCE.getNotifier_Address();
+
+ /**
+ * The meta object literal for the '<em><b>Configuration</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference NOTIFIER__CONFIGURATION = eINSTANCE.getNotifier_Configuration();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.OrganizationImpl <em>Organization</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.OrganizationImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getOrganization()
+ * @generated
+ */
+ EClass ORGANIZATION = eINSTANCE.getOrganization();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ORGANIZATION__NAME = eINSTANCE.getOrganization_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ORGANIZATION__URL = eINSTANCE.getOrganization_Url();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.ParentImpl <em>Parent</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ParentImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getParent()
+ * @generated
+ */
+ EClass PARENT = eINSTANCE.getParent();
+
+ /**
+ * The meta object literal for the '<em><b>Artifact Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PARENT__ARTIFACT_ID = eINSTANCE.getParent_ArtifactId();
+
+ /**
+ * The meta object literal for the '<em><b>Group Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PARENT__GROUP_ID = eINSTANCE.getParent_GroupId();
+
+ /**
+ * The meta object literal for the '<em><b>Version</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PARENT__VERSION = eINSTANCE.getParent_Version();
+
+ /**
+ * The meta object literal for the '<em><b>Relative Path</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PARENT__RELATIVE_PATH = eINSTANCE.getParent_RelativePath();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.PluginImpl <em>Plugin</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.PluginImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getPlugin()
+ * @generated
+ */
+ EClass PLUGIN = eINSTANCE.getPlugin();
+
+ /**
+ * The meta object literal for the '<em><b>Group Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PLUGIN__GROUP_ID = eINSTANCE.getPlugin_GroupId();
+
+ /**
+ * The meta object literal for the '<em><b>Artifact Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PLUGIN__ARTIFACT_ID = eINSTANCE.getPlugin_ArtifactId();
+
+ /**
+ * The meta object literal for the '<em><b>Version</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PLUGIN__VERSION = eINSTANCE.getPlugin_Version();
+
+ /**
+ * The meta object literal for the '<em><b>Extensions</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PLUGIN__EXTENSIONS = eINSTANCE.getPlugin_Extensions();
+
+ /**
+ * The meta object literal for the '<em><b>Executions</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference PLUGIN__EXECUTIONS = eINSTANCE.getPlugin_Executions();
+
+ /**
+ * The meta object literal for the '<em><b>Dependencies</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference PLUGIN__DEPENDENCIES = eINSTANCE.getPlugin_Dependencies();
+
+ /**
+ * The meta object literal for the '<em><b>Inherited</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PLUGIN__INHERITED = eINSTANCE.getPlugin_Inherited();
+
+ /**
+ * The meta object literal for the '<em><b>Configuration</b></em>' reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PLUGIN__CONFIGURATION = eINSTANCE.getPlugin_Configuration();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.PluginExecutionImpl <em>Plugin Execution</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.PluginExecutionImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getPluginExecution()
+ * @generated
+ */
+ EClass PLUGIN_EXECUTION = eINSTANCE.getPluginExecution();
+
+ /**
+ * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PLUGIN_EXECUTION__ID = eINSTANCE.getPluginExecution_Id();
+
+ /**
+ * The meta object literal for the '<em><b>Phase</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PLUGIN_EXECUTION__PHASE = eINSTANCE.getPluginExecution_Phase();
+
+ /**
+ * The meta object literal for the '<em><b>Inherited</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PLUGIN_EXECUTION__INHERITED = eINSTANCE.getPluginExecution_Inherited();
+
+ /**
+ * The meta object literal for the '<em><b>Goals</b></em>' attribute list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PLUGIN_EXECUTION__GOALS = eINSTANCE.getPluginExecution_Goals();
+
+ /**
+ * The meta object literal for the '<em><b>Configuration</b></em>' reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PLUGIN_EXECUTION__CONFIGURATION = eINSTANCE.getPluginExecution_Configuration();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.PluginManagementImpl <em>Plugin Management</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.PluginManagementImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getPluginManagement()
+ * @generated
+ */
+ EClass PLUGIN_MANAGEMENT = eINSTANCE.getPluginManagement();
+
+ /**
+ * The meta object literal for the '<em><b>Plugins</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PLUGIN_MANAGEMENT__PLUGINS = eINSTANCE.getPluginManagement_Plugins();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.PrerequisitesImpl <em>Prerequisites</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.PrerequisitesImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getPrerequisites()
+ * @generated
+ */
+ EClass PREREQUISITES = eINSTANCE.getPrerequisites();
+
+ /**
+ * The meta object literal for the '<em><b>Maven</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PREREQUISITES__MAVEN = eINSTANCE.getPrerequisites_Maven();
+
+ /**
+ * The meta object literal for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl
+ * <em>Profile</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.ProfileImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getProfile()
+ * @generated
+ */
+ EClass PROFILE = eINSTANCE.getProfile();
+
+ /**
+ * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PROFILE__ID = eINSTANCE.getProfile_Id();
+
+ /**
+ * The meta object literal for the '<em><b>Activation</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference PROFILE__ACTIVATION = eINSTANCE.getProfile_Activation();
+
+ /**
+ * The meta object literal for the '<em><b>Build</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PROFILE__BUILD = eINSTANCE.getProfile_Build();
+
+ /**
+ * The meta object literal for the '<em><b>Repositories</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference PROFILE__REPOSITORIES = eINSTANCE.getProfile_Repositories();
+
+ /**
+ * The meta object literal for the '<em><b>Plugin Repositories</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference PROFILE__PLUGIN_REPOSITORIES = eINSTANCE.getProfile_PluginRepositories();
+
+ /**
+ * The meta object literal for the '<em><b>Dependencies</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference PROFILE__DEPENDENCIES = eINSTANCE.getProfile_Dependencies();
+
+ /**
+ * The meta object literal for the '<em><b>Reports</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PROFILE__REPORTS = eINSTANCE.getProfile_Reports();
+
+ /**
+ * The meta object literal for the '<em><b>Dependency Management</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PROFILE__DEPENDENCY_MANAGEMENT = eINSTANCE.getProfile_DependencyManagement();
+
+ /**
+ * The meta object literal for the '<em><b>Distribution Management</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PROFILE__DISTRIBUTION_MANAGEMENT = eINSTANCE.getProfile_DistributionManagement();
+
+ /**
+ * The meta object literal for the '<em><b>Properties</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference PROFILE__PROPERTIES = eINSTANCE.getProfile_Properties();
+
+ /**
+ * The meta object literal for the '<em><b>Modules</b></em>' attribute list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PROFILE__MODULES = eINSTANCE.getProfile_Modules();
+
+ /**
+ * The meta object literal for the '<em><b>Reporting</b></em>' reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PROFILE__REPORTING = eINSTANCE.getProfile_Reporting();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.RelocationImpl <em>Relocation</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.RelocationImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getRelocation()
+ * @generated
+ */
+ EClass RELOCATION = eINSTANCE.getRelocation();
+
+ /**
+ * The meta object literal for the '<em><b>Group Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute RELOCATION__GROUP_ID = eINSTANCE.getRelocation_GroupId();
+
+ /**
+ * The meta object literal for the '<em><b>Artifact Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute RELOCATION__ARTIFACT_ID = eINSTANCE.getRelocation_ArtifactId();
+
+ /**
+ * The meta object literal for the '<em><b>Version</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute RELOCATION__VERSION = eINSTANCE.getRelocation_Version();
+
+ /**
+ * The meta object literal for the '<em><b>Message</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute RELOCATION__MESSAGE = eINSTANCE.getRelocation_Message();
+
+ /**
+ * The meta object literal for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ReportingImpl
+ * <em>Reporting</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.ReportingImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getReporting()
+ * @generated
+ */
+ EClass REPORTING = eINSTANCE.getReporting();
+
+ /**
+ * The meta object literal for the '<em><b>Exclude Defaults</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPORTING__EXCLUDE_DEFAULTS = eINSTANCE.getReporting_ExcludeDefaults();
+
+ /**
+ * The meta object literal for the '<em><b>Output Directory</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPORTING__OUTPUT_DIRECTORY = eINSTANCE.getReporting_OutputDirectory();
+
+ /**
+ * The meta object literal for the '<em><b>Plugins</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference REPORTING__PLUGINS = eINSTANCE.getReporting_Plugins();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.ReportPluginImpl <em>Report Plugin</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ReportPluginImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getReportPlugin()
+ * @generated
+ */
+ EClass REPORT_PLUGIN = eINSTANCE.getReportPlugin();
+
+ /**
+ * The meta object literal for the '<em><b>Group Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPORT_PLUGIN__GROUP_ID = eINSTANCE.getReportPlugin_GroupId();
+
+ /**
+ * The meta object literal for the '<em><b>Artifact Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPORT_PLUGIN__ARTIFACT_ID = eINSTANCE.getReportPlugin_ArtifactId();
+
+ /**
+ * The meta object literal for the '<em><b>Version</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPORT_PLUGIN__VERSION = eINSTANCE.getReportPlugin_Version();
+
+ /**
+ * The meta object literal for the '<em><b>Inherited</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPORT_PLUGIN__INHERITED = eINSTANCE.getReportPlugin_Inherited();
+
+ /**
+ * The meta object literal for the '<em><b>Report Sets</b></em>' containment reference list feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference REPORT_PLUGIN__REPORT_SETS = eINSTANCE.getReportPlugin_ReportSets();
+
+ /**
+ * The meta object literal for the '<em><b>Configuration</b></em>' reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference REPORT_PLUGIN__CONFIGURATION = eINSTANCE.getReportPlugin_Configuration();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.ReportSetImpl <em>Report Set</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ReportSetImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getReportSet()
+ * @generated
+ */
+ EClass REPORT_SET = eINSTANCE.getReportSet();
+
+ /**
+ * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPORT_SET__ID = eINSTANCE.getReportSet_Id();
+
+ /**
+ * The meta object literal for the '<em><b>Inherited</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPORT_SET__INHERITED = eINSTANCE.getReportSet_Inherited();
+
+ /**
+ * The meta object literal for the '<em><b>Reports</b></em>' attribute list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPORT_SET__REPORTS = eINSTANCE.getReportSet_Reports();
+
+ /**
+ * The meta object literal for the '<em><b>Configuration</b></em>' reference feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EReference REPORT_SET__CONFIGURATION = eINSTANCE.getReportSet_Configuration();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.RepositoryImpl <em>Repository</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.RepositoryImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getRepository()
+ * @generated
+ */
+ EClass REPOSITORY = eINSTANCE.getRepository();
+
+ /**
+ * The meta object literal for the '<em><b>Releases</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference REPOSITORY__RELEASES = eINSTANCE.getRepository_Releases();
+
+ /**
+ * The meta object literal for the '<em><b>Snapshots</b></em>' containment reference feature.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ EReference REPOSITORY__SNAPSHOTS = eINSTANCE.getRepository_Snapshots();
+
+ /**
+ * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPOSITORY__ID = eINSTANCE.getRepository_Id();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPOSITORY__NAME = eINSTANCE.getRepository_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPOSITORY__URL = eINSTANCE.getRepository_Url();
+
+ /**
+ * The meta object literal for the '<em><b>Layout</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPOSITORY__LAYOUT = eINSTANCE.getRepository_Layout();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.RepositoryPolicyImpl <em>Repository Policy</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.RepositoryPolicyImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getRepositoryPolicy()
+ * @generated
+ */
+ EClass REPOSITORY_POLICY = eINSTANCE.getRepositoryPolicy();
+
+ /**
+ * The meta object literal for the '<em><b>Enabled</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPOSITORY_POLICY__ENABLED = eINSTANCE.getRepositoryPolicy_Enabled();
+
+ /**
+ * The meta object literal for the '<em><b>Update Policy</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPOSITORY_POLICY__UPDATE_POLICY = eINSTANCE.getRepositoryPolicy_UpdatePolicy();
+
+ /**
+ * The meta object literal for the '<em><b>Checksum Policy</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute REPOSITORY_POLICY__CHECKSUM_POLICY = eINSTANCE.getRepositoryPolicy_ChecksumPolicy();
+
+ /**
+ * The meta object literal for the '
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ResourceImpl
+ * <em>Resource</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.impl.ResourceImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getResource()
+ * @generated
+ */
+ EClass RESOURCE = eINSTANCE.getResource();
+
+ /**
+ * The meta object literal for the '<em><b>Target Path</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute RESOURCE__TARGET_PATH = eINSTANCE.getResource_TargetPath();
+
+ /**
+ * The meta object literal for the '<em><b>Filtering</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute RESOURCE__FILTERING = eINSTANCE.getResource_Filtering();
+
+ /**
+ * The meta object literal for the '<em><b>Directory</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute RESOURCE__DIRECTORY = eINSTANCE.getResource_Directory();
+
+ /**
+ * The meta object literal for the '<em><b>Includes</b></em>' attribute list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute RESOURCE__INCLUDES = eINSTANCE.getResource_Includes();
+
+ /**
+ * The meta object literal for the '<em><b>Excludes</b></em>' attribute list feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute RESOURCE__EXCLUDES = eINSTANCE.getResource_Excludes();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.ScmImpl <em>Scm</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ScmImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getScm()
+ * @generated
+ */
+ EClass SCM = eINSTANCE.getScm();
+
+ /**
+ * The meta object literal for the '<em><b>Connection</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute SCM__CONNECTION = eINSTANCE.getScm_Connection();
+
+ /**
+ * The meta object literal for the '<em><b>Developer Connection</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute SCM__DEVELOPER_CONNECTION = eINSTANCE.getScm_DeveloperConnection();
+
+ /**
+ * The meta object literal for the '<em><b>Tag</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute SCM__TAG = eINSTANCE.getScm_Tag();
+
+ /**
+ * The meta object literal for the '<em><b>Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute SCM__URL = eINSTANCE.getScm_Url();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.SiteImpl <em>Site</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.SiteImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getSite()
+ * @generated
+ */
+ EClass SITE = eINSTANCE.getSite();
+
+ /**
+ * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute SITE__ID = eINSTANCE.getSite_Id();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute SITE__NAME = eINSTANCE.getSite_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Url</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute SITE__URL = eINSTANCE.getSite_Url();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.PropertyElementImpl <em>Property Element</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.PropertyElementImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getPropertyElement()
+ * @generated
+ */
+ EClass PROPERTY_ELEMENT = eINSTANCE.getPropertyElement();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PROPERTY_ELEMENT__NAME = eINSTANCE.getPropertyElement_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Value</b></em>' attribute feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PROPERTY_ELEMENT__VALUE = eINSTANCE.getPropertyElement_Value();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.m2e.model.edit.pom.impl.ConfigurationImpl <em>Configuration</em>}' class.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.impl.ConfigurationImpl
+ * @see org.eclipse.m2e.model.edit.pom.impl.PomPackageImpl#getConfiguration()
+ * @generated
+ */
+ EClass CONFIGURATION = eINSTANCE.getConfiguration();
+
+ }
+
+} // PomPackage
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Prerequisites.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Prerequisites.java
new file mode 100644
index 00000000..7441b97e
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Prerequisites.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Prerequisites</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0 Describes the prerequisites a project can
+ * have. <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Prerequisites#getMaven <em>Maven
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPrerequisites()
+ * @model extendedMetaData="name='Prerequisites' kind='elementOnly'"
+ * @generated
+ */
+public interface Prerequisites extends EObject {
+ /**
+ * Returns the value of the '<em><b>Maven</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The minimum version of Maven required to build the project, or to use
+ * this plugin. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Maven</em>' attribute.
+ * @see #isSetMaven()
+ * @see #unsetMaven()
+ * @see #setMaven(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPrerequisites_Maven()
+ * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * extendedMetaData
+ * ="kind='element' name='maven' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getMaven();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Prerequisites#getMaven
+ * <em>Maven</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Maven</em>' attribute.
+ * @see #isSetMaven()
+ * @see #unsetMaven()
+ * @see #getMaven()
+ * @generated
+ */
+ void setMaven(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Prerequisites#getMaven
+ * <em>Maven</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetMaven()
+ * @see #getMaven()
+ * @see #setMaven(String)
+ * @generated
+ */
+ void unsetMaven();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Prerequisites#getMaven
+ * <em>Maven</em>}' attribute is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Maven</em>' attribute is set.
+ * @see #unsetMaven()
+ * @see #getMaven()
+ * @see #setMaven(String)
+ * @generated
+ */
+ boolean isSetMaven();
+
+} // Prerequisites
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Profile.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Profile.java
new file mode 100644
index 00000000..ab79291f
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Profile.java
@@ -0,0 +1,620 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Profile</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0
+ *
+ * Modifications to the build process which is activated based on environmental
+ * parameters or command line arguments.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Profile#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Profile#getActivation <em>Activation
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Profile#getBuild <em>Build</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Profile#getRepositories <em>
+ * Repositories</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Profile#getPluginRepositories <em>
+ * Plugin Repositories</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Profile#getDependencies <em>
+ * Dependencies</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Profile#getReports <em>Reports</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Profile#getDependencyManagement <em>
+ * Dependency Management</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Profile#getDistributionManagement
+ * <em>Distribution Management</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Profile#getProperties <em>Properties
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Profile#getModules <em>Modules</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Profile#getReporting <em>Reporting
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getProfile()
+ * @model extendedMetaData="name='Profile' kind='elementOnly'"
+ * @generated
+ */
+public interface Profile extends EObject {
+ /**
+ * Returns the value of the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The identifier of this build profile. This used both for command line
+ * activation, and identifies identical profiles to merge with during
+ * inheritance. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Id</em>' attribute.
+ * @see #setId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getProfile_Id()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='id' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getId();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.m2e.model.edit.pom.Profile#getId
+ * <em>Id</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Id</em>' attribute.
+ * @see #getId()
+ * @generated
+ */
+ void setId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Activation</b></em>' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0 The conditional logic which will automatically
+ * trigger the inclusion of this profile. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Activation</em>' containment reference.
+ * @see #isSetActivation()
+ * @see #unsetActivation()
+ * @see #setActivation(Activation)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getProfile_Activation()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='activation' namespace='##targetNamespace'"
+ * @generated
+ */
+ Activation getActivation();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getActivation
+ * <em>Activation</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Activation</em>' containment
+ * reference.
+ * @see #isSetActivation()
+ * @see #unsetActivation()
+ * @see #getActivation()
+ * @generated
+ */
+ void setActivation(Activation value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getActivation
+ * <em>Activation</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetActivation()
+ * @see #getActivation()
+ * @see #setActivation(Activation)
+ * @generated
+ */
+ void unsetActivation();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getActivation
+ * <em>Activation</em>}' containment reference is set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Activation</em>' containment
+ * reference is set.
+ * @see #unsetActivation()
+ * @see #getActivation()
+ * @see #setActivation(Activation)
+ * @generated
+ */
+ boolean isSetActivation();
+
+ /**
+ * Returns the value of the '<em><b>Build</b></em>' containment reference.
+ * <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc -->
+ * 4.0.0 Information required to build the project. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Build</em>' containment reference.
+ * @see #isSetBuild()
+ * @see #unsetBuild()
+ * @see #setBuild(BuildBase)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getProfile_Build()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='build' namespace='##targetNamespace'"
+ * @generated
+ */
+ BuildBase getBuild();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getBuild <em>Build</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Build</em>' containment reference.
+ * @see #isSetBuild()
+ * @see #unsetBuild()
+ * @see #getBuild()
+ * @generated
+ */
+ void setBuild(BuildBase value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getBuild <em>Build</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetBuild()
+ * @see #getBuild()
+ * @see #setBuild(BuildBase)
+ * @generated
+ */
+ void unsetBuild();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getBuild <em>Build</em>}'
+ * containment reference is set. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @return whether the value of the '<em>Build</em>' containment reference
+ * is set.
+ * @see #unsetBuild()
+ * @see #getBuild()
+ * @see #setBuild(BuildBase)
+ * @generated
+ */
+ boolean isSetBuild();
+
+ /**
+ * Returns the value of the '<em><b>Repositories</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Repository}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0 The lists of the
+ * remote repositories for discovering dependencies and extensions. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Repositories</em>' containment reference
+ * list.
+ * @see #isSetRepositories()
+ * @see #unsetRepositories()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getProfile_Repositories()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='repositories' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Repository> getRepositories();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getRepositories
+ * <em>Repositories</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetRepositories()
+ * @see #getRepositories()
+ * @generated
+ */
+ void unsetRepositories();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getRepositories
+ * <em>Repositories</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Repositories</em>' containment
+ * reference list is set.
+ * @see #unsetRepositories()
+ * @see #getRepositories()
+ * @generated
+ */
+ boolean isSetRepositories();
+
+ /**
+ * Returns the value of the '<em><b>Plugin Repositories</b></em>'
+ * containment reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Repository}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The lists of the remote repositories for discovering plugins for builds
+ * and reports. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Plugin Repositories</em>' containment
+ * reference list.
+ * @see #isSetPluginRepositories()
+ * @see #unsetPluginRepositories()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getProfile_PluginRepositories()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='pluginRepositories' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Repository> getPluginRepositories();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getPluginRepositories
+ * <em>Plugin Repositories</em>}' containment reference list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetPluginRepositories()
+ * @see #getPluginRepositories()
+ * @generated
+ */
+ void unsetPluginRepositories();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getPluginRepositories
+ * <em>Plugin Repositories</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Plugin Repositories</em>'
+ * containment reference list is set.
+ * @see #unsetPluginRepositories()
+ * @see #getPluginRepositories()
+ * @generated
+ */
+ boolean isSetPluginRepositories();
+
+ /**
+ * Returns the value of the '<em><b>Dependencies</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * This element describes all of the dependencies associated with a project.
+ * These dependencies are used to construct a classpath for your project
+ * during the build process. They are automatically downloaded from the
+ * repositories defined in this project. See &lt;a href="http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html"
+ * &gt;the dependency mechanism&lt;/a&gt; for more information.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Dependencies</em>' containment reference
+ * list.
+ * @see #isSetDependencies()
+ * @see #unsetDependencies()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getProfile_Dependencies()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='dependencies' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<Dependency> getDependencies();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getDependencies
+ * <em>Dependencies</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetDependencies()
+ * @see #getDependencies()
+ * @generated
+ */
+ void unsetDependencies();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getDependencies
+ * <em>Dependencies</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Dependencies</em>' containment
+ * reference list is set.
+ * @see #unsetDependencies()
+ * @see #getDependencies()
+ * @generated
+ */
+ boolean isSetDependencies();
+
+ /**
+ * Returns the value of the '<em><b>Reports</b></em>' containment reference
+ * list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin}. <!-- begin-user-doc
+ * --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * &lt;b&gt;Deprecated&lt;/b&gt;. Now ignored by Maven.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Reports</em>' containment reference list.
+ * @see #isSetReports()
+ * @see #unsetReports()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getProfile_Reports()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='reports' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<ReportPlugin> getReports();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getReports <em>Reports</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetReports()
+ * @see #getReports()
+ * @generated
+ */
+ void unsetReports();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getReports <em>Reports</em>}'
+ * containment reference list is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Reports</em>' containment reference
+ * list is set.
+ * @see #unsetReports()
+ * @see #getReports()
+ * @generated
+ */
+ boolean isSetReports();
+
+ /**
+ * Returns the value of the '<em><b>Dependency Management</b></em>'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0
+ *
+ * Default dependency information for projects that inherit from this one.
+ * The dependencies in this section are not immediately resolved. Instead,
+ * when a POM derived from this one declares a dependency described by a
+ * matching groupId and artifactId, the version and other values from this
+ * section are used for that dependency if they were not already specified.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Dependency Management</em>' containment
+ * reference.
+ * @see #isSetDependencyManagement()
+ * @see #unsetDependencyManagement()
+ * @see #setDependencyManagement(DependencyManagement)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getProfile_DependencyManagement()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='dependencyManagement' namespace='##targetNamespace'"
+ * @generated
+ */
+ DependencyManagement getDependencyManagement();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getDependencyManagement
+ * <em>Dependency Management</em>}' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Dependency Management</em>'
+ * containment reference.
+ * @see #isSetDependencyManagement()
+ * @see #unsetDependencyManagement()
+ * @see #getDependencyManagement()
+ * @generated
+ */
+ void setDependencyManagement(DependencyManagement value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getDependencyManagement
+ * <em>Dependency Management</em>}' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetDependencyManagement()
+ * @see #getDependencyManagement()
+ * @see #setDependencyManagement(DependencyManagement)
+ * @generated
+ */
+ void unsetDependencyManagement();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getDependencyManagement
+ * <em>Dependency Management</em>}' containment reference is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Dependency Management</em>'
+ * containment reference is set.
+ * @see #unsetDependencyManagement()
+ * @see #getDependencyManagement()
+ * @see #setDependencyManagement(DependencyManagement)
+ * @generated
+ */
+ boolean isSetDependencyManagement();
+
+ /**
+ * Returns the value of the '<em><b>Distribution Management</b></em>'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0 Distribution information for a project that
+ * enables deployment of the site and artifacts to remote web servers and
+ * repositories respectively. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Distribution Management</em>' containment
+ * reference.
+ * @see #isSetDistributionManagement()
+ * @see #unsetDistributionManagement()
+ * @see #setDistributionManagement(DistributionManagement)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getProfile_DistributionManagement()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='distributionManagement' namespace='##targetNamespace'"
+ * @generated
+ */
+ DistributionManagement getDistributionManagement();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getDistributionManagement
+ * <em>Distribution Management</em>}' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Distribution Management</em>'
+ * containment reference.
+ * @see #isSetDistributionManagement()
+ * @see #unsetDistributionManagement()
+ * @see #getDistributionManagement()
+ * @generated
+ */
+ void setDistributionManagement(DistributionManagement value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getDistributionManagement
+ * <em>Distribution Management</em>}' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetDistributionManagement()
+ * @see #getDistributionManagement()
+ * @see #setDistributionManagement(DistributionManagement)
+ * @generated
+ */
+ void unsetDistributionManagement();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getDistributionManagement
+ * <em>Distribution Management</em>}' containment reference is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Distribution Management</em>'
+ * containment reference is set.
+ * @see #unsetDistributionManagement()
+ * @see #getDistributionManagement()
+ * @see #setDistributionManagement(DistributionManagement)
+ * @generated
+ */
+ boolean isSetDistributionManagement();
+
+ /**
+ * Returns the value of the '<em><b>Properties</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.PropertyElement}. <!-- begin-user-doc
+ * --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Properties that can be used throughout the POM as a substitution, and are
+ * used as filters in resources if enabled. The format is
+ * &lt;code&gt;&amp;lt;name&amp;gt;value&amp;lt;/name&amp;gt;&lt;/code&gt;.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Properties</em>' containment reference
+ * list.
+ * @see #isSetProperties()
+ * @see #unsetProperties()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getProfile_Properties()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='properties' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<PropertyElement> getProperties();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getProperties
+ * <em>Properties</em>}' containment reference list. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetProperties()
+ * @see #getProperties()
+ * @generated
+ */
+ void unsetProperties();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getProperties
+ * <em>Properties</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Properties</em>' containment
+ * reference list is set.
+ * @see #unsetProperties()
+ * @see #getProperties()
+ * @generated
+ */
+ boolean isSetProperties();
+
+ /**
+ * Returns the value of the '<em><b>Modules</b></em>' attribute list. The
+ * list contents are of type {@link java.lang.String}. <!-- begin-user-doc
+ * -->
+ * <p>
+ * If the meaning of the '<em>Modules</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Modules</em>' attribute list.
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getProfile_Modules()
+ * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * @generated
+ */
+ EList<String> getModules();
+
+ /**
+ * Returns the value of the '<em><b>Reporting</b></em>' reference. <!--
+ * begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Reporting</em>' reference isn't clear, there
+ * really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Reporting</em>' reference.
+ * @see #setReporting(Reporting)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getProfile_Reporting()
+ * @model
+ * @generated
+ */
+ Reporting getReporting();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile#getReporting
+ * <em>Reporting</em>}' reference. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Reporting</em>' reference.
+ * @see #getReporting()
+ * @generated
+ */
+ void setReporting(Reporting value);
+
+} // Profile
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PropertyElement.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PropertyElement.java
new file mode 100644
index 00000000..fa900d7c
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/PropertyElement.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Property Element</b></em>'. <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.PropertyElement#getName <em>Name
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.PropertyElement#getValue <em>Value
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPropertyElement()
+ * @model
+ * @generated
+ */
+public interface PropertyElement extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear, there really
+ * should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPropertyElement_Name()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.PropertyElement#getName
+ * <em>Name</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Value</b></em>' attribute. <!--
+ * begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Value</em>' attribute isn't clear, there
+ * really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Value</em>' attribute.
+ * @see #setValue(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getPropertyElement_Value()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String"
+ * @generated
+ */
+ String getValue();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.PropertyElement#getValue
+ * <em>Value</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Value</em>' attribute.
+ * @see #getValue()
+ * @generated
+ */
+ void setValue(String value);
+
+} // PropertyElement
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Relocation.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Relocation.java
new file mode 100644
index 00000000..decefc5a
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Relocation.java
@@ -0,0 +1,152 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Relocation</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0 Describes where an artifact has moved to. If
+ * any of the values are omitted, it is assumed to be the same as it was before.
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Relocation#getGroupId <em>Group Id
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Relocation#getArtifactId <em>Artifact
+ * Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Relocation#getVersion <em>Version
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Relocation#getMessage <em>Message
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRelocation()
+ * @model extendedMetaData="name='Relocation' kind='elementOnly'"
+ * @generated
+ */
+public interface Relocation extends EObject {
+ /**
+ * Returns the value of the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The group ID the artifact has moved to. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Group Id</em>' attribute.
+ * @see #setGroupId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRelocation_GroupId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='groupId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getGroupId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Relocation#getGroupId
+ * <em>Group Id</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Group Id</em>' attribute.
+ * @see #getGroupId()
+ * @generated
+ */
+ void setGroupId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The new artifact ID of the artifact. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Artifact Id</em>' attribute.
+ * @see #setArtifactId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRelocation_ArtifactId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='artifactId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getArtifactId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Relocation#getArtifactId
+ * <em>Artifact Id</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Artifact Id</em>' attribute.
+ * @see #getArtifactId()
+ * @generated
+ */
+ void setArtifactId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The new version of the artifact. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Version</em>' attribute.
+ * @see #setVersion(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRelocation_Version()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='version' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getVersion();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Relocation#getVersion
+ * <em>Version</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Version</em>' attribute.
+ * @see #getVersion()
+ * @generated
+ */
+ void setVersion(String value);
+
+ /**
+ * Returns the value of the '<em><b>Message</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * An additional message to show the user about the move, such as the
+ * reason. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Message</em>' attribute.
+ * @see #setMessage(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRelocation_Message()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='message' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getMessage();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Relocation#getMessage
+ * <em>Message</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Message</em>' attribute.
+ * @see #getMessage()
+ * @generated
+ */
+ void setMessage(String value);
+
+} // Relocation
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ReportPlugin.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ReportPlugin.java
new file mode 100644
index 00000000..928d22a2
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ReportPlugin.java
@@ -0,0 +1,266 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Report Plugin</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0 <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getGroupId <em>Group Id
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getArtifactId <em>
+ * Artifact Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getVersion <em>Version
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getInherited <em>
+ * Inherited</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getReportSets <em>Report
+ * Sets</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getConfiguration <em>
+ * Configuration</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReportPlugin()
+ * @model extendedMetaData="name='ReportPlugin' kind='elementOnly'"
+ * @generated
+ */
+public interface ReportPlugin extends EObject {
+ /**
+ * Returns the value of the '<em><b>Group Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The group ID of the reporting plugin in the repository. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Group Id</em>' attribute.
+ * @see #isSetGroupId()
+ * @see #unsetGroupId()
+ * @see #setGroupId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReportPlugin_GroupId()
+ * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * extendedMetaData
+ * ="kind='element' name='groupId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getGroupId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getGroupId
+ * <em>Group Id</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Group Id</em>' attribute.
+ * @see #isSetGroupId()
+ * @see #unsetGroupId()
+ * @see #getGroupId()
+ * @generated
+ */
+ void setGroupId(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getGroupId
+ * <em>Group Id</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #isSetGroupId()
+ * @see #getGroupId()
+ * @see #setGroupId(String)
+ * @generated
+ */
+ void unsetGroupId();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getGroupId
+ * <em>Group Id</em>}' attribute is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Group Id</em>' attribute is set.
+ * @see #unsetGroupId()
+ * @see #getGroupId()
+ * @see #setGroupId(String)
+ * @generated
+ */
+ boolean isSetGroupId();
+
+ /**
+ * Returns the value of the '<em><b>Artifact Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The artifact ID of the reporting plugin in the repository. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Artifact Id</em>' attribute.
+ * @see #setArtifactId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReportPlugin_ArtifactId()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='artifactId' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getArtifactId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getArtifactId
+ * <em>Artifact Id</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Artifact Id</em>' attribute.
+ * @see #getArtifactId()
+ * @generated
+ */
+ void setArtifactId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Version</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * The version of the reporting plugin to be used. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Version</em>' attribute.
+ * @see #setVersion(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReportPlugin_Version()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='version' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getVersion();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getVersion
+ * <em>Version</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Version</em>' attribute.
+ * @see #getVersion()
+ * @generated
+ */
+ void setVersion(String value);
+
+ /**
+ * Returns the value of the '<em><b>Inherited</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ * Whether the configuration in this plugin should be made available to
+ * projects that inherit from this one. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Inherited</em>' attribute.
+ * @see #setInherited(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReportPlugin_Inherited()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='inherited' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getInherited();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getInherited
+ * <em>Inherited</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Inherited</em>' attribute.
+ * @see #getInherited()
+ * @generated
+ */
+ void setInherited(String value);
+
+ /**
+ * Returns the value of the '<em><b>Report Sets</b></em>' containment
+ * reference list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.ReportSet}. <!-- begin-user-doc -->
+ * <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0 Multiple
+ * specifications of a set of reports, each having (possibly) different
+ * configuration. This is the reporting parallel to an
+ * &lt;code&gt;execution&lt;/code&gt; in the build. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Report Sets</em>' containment reference
+ * list.
+ * @see #isSetReportSets()
+ * @see #unsetReportSets()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReportPlugin_ReportSets()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='reportSets' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<ReportSet> getReportSets();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getReportSets
+ * <em>Report Sets</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #isSetReportSets()
+ * @see #getReportSets()
+ * @generated
+ */
+ void unsetReportSets();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getReportSets
+ * <em>Report Sets</em>}' containment reference list is set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Report Sets</em>' containment
+ * reference list is set.
+ * @see #unsetReportSets()
+ * @see #getReportSets()
+ * @generated
+ */
+ boolean isSetReportSets();
+
+ /**
+ * Returns the value of the '<em><b>Configuration</b></em>' reference. <!--
+ * begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Configuration</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Configuration</em>' reference.
+ * @see #setConfiguration(Configuration)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReportPlugin_Configuration()
+ * @model
+ * @generated
+ */
+ Configuration getConfiguration();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin#getConfiguration
+ * <em>Configuration</em>}' reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Configuration</em>' reference.
+ * @see #getConfiguration()
+ * @generated
+ */
+ void setConfiguration(Configuration value);
+
+} // ReportPlugin
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ReportSet.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ReportSet.java
new file mode 100644
index 00000000..b339c9be
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/ReportSet.java
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Report Set</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0 Represents a set of reports and configuration
+ * to be used to generate them. <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ReportSet#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ReportSet#getInherited <em>Inherited
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ReportSet#getReports <em>Reports
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.ReportSet#getConfiguration <em>
+ * Configuration</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReportSet()
+ * @model extendedMetaData="name='ReportSet' kind='elementOnly'"
+ * @generated
+ */
+public interface ReportSet extends EObject {
+ /**
+ * Returns the value of the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 0.0.0+
+ * The unique id for this report set, to be used during POM inheritance.
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Id</em>' attribute.
+ * @see #isSetId()
+ * @see #unsetId()
+ * @see #setId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReportSet_Id()
+ * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * extendedMetaData
+ * ="kind='element' name='id' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportSet#getId <em>Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Id</em>' attribute.
+ * @see #isSetId()
+ * @see #unsetId()
+ * @see #getId()
+ * @generated
+ */
+ void setId(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportSet#getId <em>Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetId()
+ * @see #getId()
+ * @see #setId(String)
+ * @generated
+ */
+ void unsetId();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportSet#getId <em>Id</em>}'
+ * attribute is set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Id</em>' attribute is set.
+ * @see #unsetId()
+ * @see #getId()
+ * @see #setId(String)
+ * @generated
+ */
+ boolean isSetId();
+
+ /**
+ * Returns the value of the '<em><b>Inherited</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Whether any configuration should be propagated to child POMs. <!--
+ * end-model-doc -->
+ *
+ * @return the value of the '<em>Inherited</em>' attribute.
+ * @see #setInherited(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReportSet_Inherited()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='inherited' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getInherited();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportSet#getInherited
+ * <em>Inherited</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Inherited</em>' attribute.
+ * @see #getInherited()
+ * @generated
+ */
+ void setInherited(String value);
+
+ /**
+ * Returns the value of the '<em><b>Reports</b></em>' attribute list. The
+ * list contents are of type {@link java.lang.String}. <!-- begin-user-doc
+ * -->
+ * <p>
+ * If the meaning of the '<em>Reports</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Reports</em>' attribute list.
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReportSet_Reports()
+ * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * @generated
+ */
+ EList<String> getReports();
+
+ /**
+ * Returns the value of the '<em><b>Configuration</b></em>' reference. <!--
+ * begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Configuration</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Configuration</em>' reference.
+ * @see #setConfiguration(Configuration)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReportSet_Configuration()
+ * @model
+ * @generated
+ */
+ Configuration getConfiguration();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportSet#getConfiguration
+ * <em>Configuration</em>}' reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Configuration</em>' reference.
+ * @see #getConfiguration()
+ * @generated
+ */
+ void setConfiguration(Configuration value);
+
+} // ReportSet
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Reporting.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Reporting.java
new file mode 100644
index 00000000..7cbb6d0b
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Reporting.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Reporting</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0 Section for management of reports and their
+ * configuration. <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Reporting#getExcludeDefaults <em>
+ * Exclude Defaults</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Reporting#getOutputDirectory <em>
+ * Output Directory</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Reporting#getPlugins <em>Plugins
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReporting()
+ * @model extendedMetaData="name='Reporting' kind='elementOnly'"
+ * @generated
+ */
+public interface Reporting extends EObject {
+ /**
+ * Returns the value of the '<em><b>Exclude Defaults</b></em>' attribute.
+ * The default value is <code>"false"</code>. <!-- begin-user-doc --> <!--
+ * end-user-doc --> <!-- begin-model-doc --> 4.0.0 If true, then the default
+ * reports are not included in the site generation. This includes the
+ * reports in the "Project Info" menu. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Exclude Defaults</em>' attribute.
+ * @see #isSetExcludeDefaults()
+ * @see #unsetExcludeDefaults()
+ * @see #setExcludeDefaults(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReporting_ExcludeDefaults()
+ * @model default="false" unsettable="true"
+ * dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='excludeDefaults' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getExcludeDefaults();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Reporting#getExcludeDefaults
+ * <em>Exclude Defaults</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Exclude Defaults</em>' attribute.
+ * @see #isSetExcludeDefaults()
+ * @see #unsetExcludeDefaults()
+ * @see #getExcludeDefaults()
+ * @generated
+ */
+ void setExcludeDefaults(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Reporting#getExcludeDefaults
+ * <em>Exclude Defaults</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetExcludeDefaults()
+ * @see #getExcludeDefaults()
+ * @see #setExcludeDefaults(String)
+ * @generated
+ */
+ void unsetExcludeDefaults();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Reporting#getExcludeDefaults
+ * <em>Exclude Defaults</em>}' attribute is set. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Exclude Defaults</em>' attribute is
+ * set.
+ * @see #unsetExcludeDefaults()
+ * @see #getExcludeDefaults()
+ * @see #setExcludeDefaults(String)
+ * @generated
+ */
+ boolean isSetExcludeDefaults();
+
+ /**
+ * Returns the value of the '<em><b>Output Directory</b></em>' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc -->
+ * 4.0.0
+ *
+ * Where to store all of the generated reports. The default is
+ * &lt;code&gt;${project.build.directory}/site&lt;/code&gt; .
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Output Directory</em>' attribute.
+ * @see #setOutputDirectory(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReporting_OutputDirectory()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='outputDirectory' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getOutputDirectory();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Reporting#getOutputDirectory
+ * <em>Output Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Output Directory</em>' attribute.
+ * @see #getOutputDirectory()
+ * @generated
+ */
+ void setOutputDirectory(String value);
+
+ /**
+ * Returns the value of the '<em><b>Plugins</b></em>' containment reference
+ * list. The list contents are of type
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin}. <!-- begin-user-doc
+ * --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0 The reporting
+ * plugins to use and their configuration. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Plugins</em>' containment reference list.
+ * @see #isSetPlugins()
+ * @see #unsetPlugins()
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getReporting_Plugins()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='plugins' namespace='##targetNamespace'"
+ * @generated
+ */
+ EList<ReportPlugin> getPlugins();
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Reporting#getPlugins
+ * <em>Plugins</em>}' containment reference list. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isSetPlugins()
+ * @see #getPlugins()
+ * @generated
+ */
+ void unsetPlugins();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Reporting#getPlugins
+ * <em>Plugins</em>}' containment reference list is set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Plugins</em>' containment reference
+ * list is set.
+ * @see #unsetPlugins()
+ * @see #getPlugins()
+ * @generated
+ */
+ boolean isSetPlugins();
+
+} // Reporting
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Repository.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Repository.java
new file mode 100644
index 00000000..32e74f13
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Repository.java
@@ -0,0 +1,320 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Repository</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0
+ *
+ * A repository contains the information needed for establishing connections
+ * with remote repoistory.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Repository#getReleases <em>Releases
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Repository#getSnapshots <em>Snapshots
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Repository#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Repository#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Repository#getUrl <em>Url</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Repository#getLayout <em>Layout</em>}
+ * </li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRepository()
+ * @model extendedMetaData="name='Repository' kind='elementOnly'"
+ * @generated
+ */
+public interface Repository extends EObject {
+ /**
+ * Returns the value of the '<em><b>Releases</b></em>' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0 How to handle downloading of releases from this
+ * repository. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Releases</em>' containment reference.
+ * @see #isSetReleases()
+ * @see #unsetReleases()
+ * @see #setReleases(RepositoryPolicy)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRepository_Releases()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='releases' namespace='##targetNamespace'"
+ * @generated
+ */
+ RepositoryPolicy getReleases();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository#getReleases
+ * <em>Releases</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Releases</em>' containment
+ * reference.
+ * @see #isSetReleases()
+ * @see #unsetReleases()
+ * @see #getReleases()
+ * @generated
+ */
+ void setReleases(RepositoryPolicy value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository#getReleases
+ * <em>Releases</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetReleases()
+ * @see #getReleases()
+ * @see #setReleases(RepositoryPolicy)
+ * @generated
+ */
+ void unsetReleases();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository#getReleases
+ * <em>Releases</em>}' containment reference is set. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Releases</em>' containment
+ * reference is set.
+ * @see #unsetReleases()
+ * @see #getReleases()
+ * @see #setReleases(RepositoryPolicy)
+ * @generated
+ */
+ boolean isSetReleases();
+
+ /**
+ * Returns the value of the '<em><b>Snapshots</b></em>' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0 How to handle downloading of snapshots from
+ * this repository. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Snapshots</em>' containment reference.
+ * @see #isSetSnapshots()
+ * @see #unsetSnapshots()
+ * @see #setSnapshots(RepositoryPolicy)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRepository_Snapshots()
+ * @model containment="true" unsettable="true" extendedMetaData=
+ * "kind='element' name='snapshots' namespace='##targetNamespace'"
+ * @generated
+ */
+ RepositoryPolicy getSnapshots();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository#getSnapshots
+ * <em>Snapshots</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Snapshots</em>' containment
+ * reference.
+ * @see #isSetSnapshots()
+ * @see #unsetSnapshots()
+ * @see #getSnapshots()
+ * @generated
+ */
+ void setSnapshots(RepositoryPolicy value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository#getSnapshots
+ * <em>Snapshots</em>}' containment reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #isSetSnapshots()
+ * @see #getSnapshots()
+ * @see #setSnapshots(RepositoryPolicy)
+ * @generated
+ */
+ void unsetSnapshots();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository#getSnapshots
+ * <em>Snapshots</em>}' containment reference is set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Snapshots</em>' containment
+ * reference is set.
+ * @see #unsetSnapshots()
+ * @see #getSnapshots()
+ * @see #setSnapshots(RepositoryPolicy)
+ * @generated
+ */
+ boolean isSetSnapshots();
+
+ /**
+ * Returns the value of the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * A unique identifier for a repository. This is used to match the
+ * repository to configuration in the &lt;code&gt;settings.xml&lt;/code&gt;
+ * file, for example.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Id</em>' attribute.
+ * @see #setId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRepository_Id()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='id' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getId();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository#getId <em>Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Id</em>' attribute.
+ * @see #getId()
+ * @generated
+ */
+ void setId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Human readable name of the repository.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRepository_Name()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='name' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository#getName <em>Name</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The url of the repository, in the form
+ * &lt;code&gt;protocol://hostname/path&lt;/code&gt;.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Url</em>' attribute.
+ * @see #setUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRepository_Url()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='url' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUrl();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository#getUrl <em>Url</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Url</em>' attribute.
+ * @see #getUrl()
+ * @generated
+ */
+ void setUrl(String value);
+
+ /**
+ * Returns the value of the '<em><b>Layout</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The type of layout this repository uses for locating and storing
+ * artifacts - can be &lt;code&gt;legacy&lt;/code&gt; or
+ * &lt;code&gt;default&lt;/code&gt;.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Layout</em>' attribute.
+ * @see #isSetLayout()
+ * @see #unsetLayout()
+ * @see #setLayout(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRepository_Layout()
+ * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * extendedMetaData
+ * ="kind='element' name='layout' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getLayout();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository#getLayout <em>Layout</em>}
+ * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Layout</em>' attribute.
+ * @see #isSetLayout()
+ * @see #unsetLayout()
+ * @see #getLayout()
+ * @generated
+ */
+ void setLayout(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository#getLayout <em>Layout</em>}
+ * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetLayout()
+ * @see #getLayout()
+ * @see #setLayout(String)
+ * @generated
+ */
+ void unsetLayout();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository#getLayout <em>Layout</em>}
+ * ' attribute is set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Layout</em>' attribute is set.
+ * @see #unsetLayout()
+ * @see #getLayout()
+ * @see #setLayout(String)
+ * @generated
+ */
+ boolean isSetLayout();
+
+} // Repository
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/RepositoryPolicy.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/RepositoryPolicy.java
new file mode 100644
index 00000000..69bd03e1
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/RepositoryPolicy.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Repository Policy</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0 Download policy <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getEnabled <em>
+ * Enabled</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getUpdatePolicy <em>
+ * Update Policy</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getChecksumPolicy
+ * <em>Checksum Policy</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRepositoryPolicy()
+ * @model extendedMetaData="name='RepositoryPolicy' kind='elementOnly'"
+ * @generated
+ */
+public interface RepositoryPolicy extends EObject {
+ /**
+ * Returns the value of the '<em><b>Enabled</b></em>' attribute. The default
+ * value is <code>"true"</code>. <!-- begin-user-doc --> <!-- end-user-doc
+ * --> <!-- begin-model-doc --> 4.0.0 Whether to use this repository for
+ * downloading this type of artifact. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Enabled</em>' attribute.
+ * @see #isSetEnabled()
+ * @see #unsetEnabled()
+ * @see #setEnabled(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRepositoryPolicy_Enabled()
+ * @model default="true" unsettable="true"
+ * dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='enabled' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getEnabled();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getEnabled
+ * <em>Enabled</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Enabled</em>' attribute.
+ * @see #isSetEnabled()
+ * @see #unsetEnabled()
+ * @see #getEnabled()
+ * @generated
+ */
+ void setEnabled(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getEnabled
+ * <em>Enabled</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #isSetEnabled()
+ * @see #getEnabled()
+ * @see #setEnabled(String)
+ * @generated
+ */
+ void unsetEnabled();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getEnabled
+ * <em>Enabled</em>}' attribute is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Enabled</em>' attribute is set.
+ * @see #unsetEnabled()
+ * @see #getEnabled()
+ * @see #setEnabled(String)
+ * @generated
+ */
+ boolean isSetEnabled();
+
+ /**
+ * Returns the value of the '<em><b>Update Policy</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The frequency for downloading updates - can be
+ * &lt;code&gt;always,&lt;/code&gt; &lt;code&gt;daily&lt;/code&gt;
+ * (default), &lt;code&gt;interval:XXX&lt;/code&gt; (in minutes) or
+ * &lt;code&gt;never&lt;/code&gt; (only if it doesn't exist locally).
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Update Policy</em>' attribute.
+ * @see #setUpdatePolicy(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRepositoryPolicy_UpdatePolicy()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='updatePolicy' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUpdatePolicy();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getUpdatePolicy
+ * <em>Update Policy</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Update Policy</em>' attribute.
+ * @see #getUpdatePolicy()
+ * @generated
+ */
+ void setUpdatePolicy(String value);
+
+ /**
+ * Returns the value of the '<em><b>Checksum Policy</b></em>' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc -->
+ * 4.0.0
+ *
+ * What to do when verification of an artifact checksum fails. Valid values
+ * are &lt;code&gt;ignore&lt;/code&gt; , &lt;code&gt;fail&lt;/code&gt; or
+ * &lt;code&gt;warn&lt;/code&gt; (the default).
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Checksum Policy</em>' attribute.
+ * @see #setChecksumPolicy(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getRepositoryPolicy_ChecksumPolicy()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='checksumPolicy' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getChecksumPolicy();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy#getChecksumPolicy
+ * <em>Checksum Policy</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Checksum Policy</em>' attribute.
+ * @see #getChecksumPolicy()
+ * @generated
+ */
+ void setChecksumPolicy(String value);
+
+} // RepositoryPolicy
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Resource.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Resource.java
new file mode 100644
index 00000000..d52ea7dc
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Resource.java
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Resource</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 3.0.0+
+ *
+ * This element describes all of the classpath resources associated with a
+ * project or unit tests.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Resource#getTargetPath <em>Target
+ * Path</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Resource#getFiltering <em>Filtering
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Resource#getDirectory <em>Directory
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Resource#getIncludes <em>Includes
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Resource#getExcludes <em>Excludes
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getResource()
+ * @model extendedMetaData="name='Resource' kind='elementOnly'"
+ * @generated
+ */
+public interface Resource extends EObject {
+ /**
+ * Returns the value of the '<em><b>Target Path</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * Describe the resource target path. For example, if you want that resource
+ * to appear in a specific package
+ * (&lt;code&gt;org.apache.maven.messages&lt;/code&gt;), you must specify
+ * this element with this value:
+ * &lt;code&gt;org/apache/maven/messages&lt;/code&gt;. This is not required
+ * if you simply put the resources in that directory structure at the
+ * source, however.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Target Path</em>' attribute.
+ * @see #setTargetPath(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getResource_TargetPath()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='targetPath' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getTargetPath();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Resource#getTargetPath
+ * <em>Target Path</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Target Path</em>' attribute.
+ * @see #getTargetPath()
+ * @generated
+ */
+ void setTargetPath(String value);
+
+ /**
+ * Returns the value of the '<em><b>Filtering</b></em>' attribute. The
+ * default value is <code>"false"</code>. <!-- begin-user-doc --> <!--
+ * end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * Whether resources are filtered to replace tokens with parameterised
+ * values or not. The values are taken from the
+ * &lt;code&gt;properties&lt;/code&gt; element and from the properties in
+ * the files listed in the &lt;code&gt;filters&lt;/code&gt; element.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Filtering</em>' attribute.
+ * @see #isSetFiltering()
+ * @see #unsetFiltering()
+ * @see #setFiltering(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getResource_Filtering()
+ * @model default="false" unsettable="true"
+ * dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='filtering' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getFiltering();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Resource#getFiltering
+ * <em>Filtering</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Filtering</em>' attribute.
+ * @see #isSetFiltering()
+ * @see #unsetFiltering()
+ * @see #getFiltering()
+ * @generated
+ */
+ void setFiltering(String value);
+
+ /**
+ * Unsets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Resource#getFiltering
+ * <em>Filtering</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #isSetFiltering()
+ * @see #getFiltering()
+ * @see #setFiltering(String)
+ * @generated
+ */
+ void unsetFiltering();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Resource#getFiltering
+ * <em>Filtering</em>}' attribute is set. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return whether the value of the '<em>Filtering</em>' attribute is set.
+ * @see #unsetFiltering()
+ * @see #getFiltering()
+ * @see #setFiltering(String)
+ * @generated
+ */
+ boolean isSetFiltering();
+
+ /**
+ * Returns the value of the '<em><b>Directory</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 3.0.0+
+ *
+ * Describe the directory where the resources are stored. The path is
+ * relative to the POM.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Directory</em>' attribute.
+ * @see #setDirectory(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getResource_Directory()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='directory' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getDirectory();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Resource#getDirectory
+ * <em>Directory</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @param value
+ * the new value of the '<em>Directory</em>' attribute.
+ * @see #getDirectory()
+ * @generated
+ */
+ void setDirectory(String value);
+
+ /**
+ * Returns the value of the '<em><b>Includes</b></em>' attribute list. The
+ * list contents are of type {@link java.lang.String}. <!-- begin-user-doc
+ * -->
+ * <p>
+ * If the meaning of the '<em>Includes</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Includes</em>' attribute list.
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getResource_Includes()
+ * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * @generated
+ */
+ EList<String> getIncludes();
+
+ /**
+ * Returns the value of the '<em><b>Excludes</b></em>' attribute list. The
+ * list contents are of type {@link java.lang.String}. <!-- begin-user-doc
+ * -->
+ * <p>
+ * If the meaning of the '<em>Excludes</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Excludes</em>' attribute list.
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getResource_Excludes()
+ * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * @generated
+ */
+ EList<String> getExcludes();
+
+} // Resource
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Scm.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Scm.java
new file mode 100644
index 00000000..eaac755a
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Scm.java
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Scm</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0 <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Scm#getConnection <em>Connection
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Scm#getDeveloperConnection <em>
+ * Developer Connection</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Scm#getTag <em>Tag</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Scm#getUrl <em>Url</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getScm()
+ * @model extendedMetaData="name='Scm' kind='elementOnly'"
+ * @generated
+ */
+public interface Scm extends EObject {
+ /**
+ * Returns the value of the '<em><b>Connection</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The source control management system URL that describes the repository
+ * and how to connect to the repository. For more information, see the &lt;a
+ * href="http://maven.apache.org/scm/scm-url-format.html"&gt;URL
+ * format&lt;/a&gt; and &lt;a
+ * href="http://maven.apache.org/scm/scms-overview.html"&gt;list of
+ * supported SCMs&lt;/a&gt;. This connection is read-only.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Connection</em>' attribute.
+ * @see #setConnection(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getScm_Connection()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='connection' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getConnection();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Scm#getConnection
+ * <em>Connection</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Connection</em>' attribute.
+ * @see #getConnection()
+ * @generated
+ */
+ void setConnection(String value);
+
+ /**
+ * Returns the value of the '<em><b>Developer Connection</b></em>'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc --> <!--
+ * begin-model-doc --> 4.0.0
+ *
+ * Just like &lt;code&gt;connection&lt;/code&gt;, but for developers, i.e.
+ * this scm connection will not be read only.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Developer Connection</em>' attribute.
+ * @see #setDeveloperConnection(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getScm_DeveloperConnection()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='developerConnection' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getDeveloperConnection();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Scm#getDeveloperConnection
+ * <em>Developer Connection</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Developer Connection</em>'
+ * attribute.
+ * @see #getDeveloperConnection()
+ * @generated
+ */
+ void setDeveloperConnection(String value);
+
+ /**
+ * Returns the value of the '<em><b>Tag</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The tag of current code. By default, it's set to HEAD during development.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Tag</em>' attribute.
+ * @see #isSetTag()
+ * @see #unsetTag()
+ * @see #setTag(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getScm_Tag()
+ * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.String"
+ * extendedMetaData
+ * ="kind='element' name='tag' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getTag();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.m2e.model.edit.pom.Scm#getTag
+ * <em>Tag</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Tag</em>' attribute.
+ * @see #isSetTag()
+ * @see #unsetTag()
+ * @see #getTag()
+ * @generated
+ */
+ void setTag(String value);
+
+ /**
+ * Unsets the value of the '{@link org.eclipse.m2e.model.edit.pom.Scm#getTag
+ * <em>Tag</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #isSetTag()
+ * @see #getTag()
+ * @see #setTag(String)
+ * @generated
+ */
+ void unsetTag();
+
+ /**
+ * Returns whether the value of the '
+ * {@link org.eclipse.m2e.model.edit.pom.Scm#getTag <em>Tag</em>}' attribute
+ * is set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return whether the value of the '<em>Tag</em>' attribute is set.
+ * @see #unsetTag()
+ * @see #getTag()
+ * @see #setTag(String)
+ * @generated
+ */
+ boolean isSetTag();
+
+ /**
+ * Returns the value of the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The URL to the project's browsable SCM repository, such as ViewVC or
+ * Fisheye. <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Url</em>' attribute.
+ * @see #setUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getScm_Url()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='url' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUrl();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.m2e.model.edit.pom.Scm#getUrl
+ * <em>Url</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Url</em>' attribute.
+ * @see #getUrl()
+ * @generated
+ */
+ void setUrl(String value);
+
+} // Scm
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Site.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Site.java
new file mode 100644
index 00000000..8520dff4
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/Site.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '
+ * <em><b>Site</b></em>'. <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc --> 4.0.0
+ *
+ * Contains the information needed for deploying websites.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Site#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Site#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.Site#getUrl <em>Url</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getSite()
+ * @model extendedMetaData="name='Site' kind='elementOnly'"
+ * @generated
+ */
+public interface Site extends EObject {
+ /**
+ * Returns the value of the '<em><b>Id</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * A unique identifier for a deployment locataion. This is used to match the
+ * site to configuration in the &lt;code&gt;settings.xml&lt;/code&gt; file,
+ * for example.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Id</em>' attribute.
+ * @see #setId(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getSite_Id()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='id' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getId();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.m2e.model.edit.pom.Site#getId
+ * <em>Id</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Id</em>' attribute.
+ * @see #getId()
+ * @generated
+ */
+ void setId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * Human readable name of the deployment location.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getSite_Name()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='name' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.m2e.model.edit.pom.Site#getName
+ * <em>Name</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Url</b></em>' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc --> <!-- begin-model-doc --> 4.0.0
+ *
+ * The url of the location where website is deployed, in the form
+ * &lt;code&gt;protocol://hostname/path&lt;/code&gt;.
+ *
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Url</em>' attribute.
+ * @see #setUrl(String)
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#getSite_Url()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.String" extendedMetaData=
+ * "kind='element' name='url' namespace='##targetNamespace'"
+ * @generated
+ */
+ String getUrl();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.m2e.model.edit.pom.Site#getUrl
+ * <em>Url</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Url</em>' attribute.
+ * @see #getUrl()
+ * @generated
+ */
+ void setUrl(String value);
+
+} // Site
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationFileImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationFileImpl.java
new file mode 100644
index 00000000..9af20d7f
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationFileImpl.java
@@ -0,0 +1,232 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.ActivationFile;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Activation File</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ActivationFileImpl#getMissing
+ * <em>Missing</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ActivationFileImpl#getExists
+ * <em>Exists</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ActivationFileImpl extends EObjectImpl implements ActivationFile {
+ /**
+ * The default value of the '{@link #getMissing() <em>Missing</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getMissing()
+ * @generated
+ * @ordered
+ */
+ protected static final String MISSING_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getMissing() <em>Missing</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getMissing()
+ * @generated
+ * @ordered
+ */
+ protected String missing = MISSING_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getExists() <em>Exists</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getExists()
+ * @generated
+ * @ordered
+ */
+ protected static final String EXISTS_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getExists() <em>Exists</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getExists()
+ * @generated
+ * @ordered
+ */
+ protected String exists = EXISTS_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ActivationFileImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.ACTIVATION_FILE;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getMissing() {
+ return missing;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setMissing(String newMissing) {
+ String oldMissing = missing;
+ missing = newMissing;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ACTIVATION_FILE__MISSING, oldMissing, missing));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getExists() {
+ return exists;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setExists(String newExists) {
+ String oldExists = exists;
+ exists = newExists;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ACTIVATION_FILE__EXISTS, oldExists, exists));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION_FILE__MISSING:
+ return getMissing();
+ case PomPackage.ACTIVATION_FILE__EXISTS:
+ return getExists();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION_FILE__MISSING:
+ setMissing((String) newValue);
+ return;
+ case PomPackage.ACTIVATION_FILE__EXISTS:
+ setExists((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION_FILE__MISSING:
+ setMissing(MISSING_EDEFAULT);
+ return;
+ case PomPackage.ACTIVATION_FILE__EXISTS:
+ setExists(EXISTS_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION_FILE__MISSING:
+ return MISSING_EDEFAULT == null ? missing != null
+ : !MISSING_EDEFAULT.equals(missing);
+ case PomPackage.ACTIVATION_FILE__EXISTS:
+ return EXISTS_EDEFAULT == null ? exists != null : !EXISTS_EDEFAULT
+ .equals(exists);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (missing: "); //$NON-NLS-1$
+ result.append(missing);
+ result.append(", exists: "); //$NON-NLS-1$
+ result.append(exists);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ActivationFileImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationImpl.java
new file mode 100644
index 00000000..f4f2cc03
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationImpl.java
@@ -0,0 +1,738 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.Activation;
+import org.eclipse.m2e.model.edit.pom.ActivationFile;
+import org.eclipse.m2e.model.edit.pom.ActivationOS;
+import org.eclipse.m2e.model.edit.pom.ActivationProperty;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Activation</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ActivationImpl#getActiveByDefault
+ * <em>Active By Default</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ActivationImpl#getJdk <em>Jdk
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ActivationImpl#getOs <em>Os
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ActivationImpl#getProperty <em>
+ * Property</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ActivationImpl#getFile <em>File
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ActivationImpl extends EObjectImpl implements Activation {
+ /**
+ * The default value of the '{@link #getActiveByDefault()
+ * <em>Active By Default</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getActiveByDefault()
+ * @generated
+ * @ordered
+ */
+ protected static final String ACTIVE_BY_DEFAULT_EDEFAULT = "false"; //$NON-NLS-1$
+
+ /**
+ * The cached value of the '{@link #getActiveByDefault()
+ * <em>Active By Default</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getActiveByDefault()
+ * @generated
+ * @ordered
+ */
+ protected String activeByDefault = ACTIVE_BY_DEFAULT_EDEFAULT;
+
+ /**
+ * This is true if the Active By Default attribute has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean activeByDefaultESet;
+
+ /**
+ * The default value of the '{@link #getJdk() <em>Jdk</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getJdk()
+ * @generated
+ * @ordered
+ */
+ protected static final String JDK_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getJdk() <em>Jdk</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getJdk()
+ * @generated
+ * @ordered
+ */
+ protected String jdk = JDK_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getOs() <em>Os</em>}' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getOs()
+ * @generated
+ * @ordered
+ */
+ protected ActivationOS os;
+
+ /**
+ * This is true if the Os containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean osESet;
+
+ /**
+ * The cached value of the '{@link #getProperty() <em>Property</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getProperty()
+ * @generated
+ * @ordered
+ */
+ protected ActivationProperty property;
+
+ /**
+ * This is true if the Property containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean propertyESet;
+
+ /**
+ * The cached value of the '{@link #getFile() <em>File</em>}' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getFile()
+ * @generated
+ * @ordered
+ */
+ protected ActivationFile file;
+
+ /**
+ * This is true if the File containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean fileESet;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ActivationImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.ACTIVATION;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getActiveByDefault() {
+ return activeByDefault;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setActiveByDefault(String newActiveByDefault) {
+ String oldActiveByDefault = activeByDefault;
+ activeByDefault = newActiveByDefault;
+ boolean oldActiveByDefaultESet = activeByDefaultESet;
+ activeByDefaultESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ACTIVATION__ACTIVE_BY_DEFAULT,
+ oldActiveByDefault, activeByDefault,
+ !oldActiveByDefaultESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetActiveByDefault() {
+ String oldActiveByDefault = activeByDefault;
+ boolean oldActiveByDefaultESet = activeByDefaultESet;
+ activeByDefault = ACTIVE_BY_DEFAULT_EDEFAULT;
+ activeByDefaultESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.ACTIVATION__ACTIVE_BY_DEFAULT,
+ oldActiveByDefault, ACTIVE_BY_DEFAULT_EDEFAULT,
+ oldActiveByDefaultESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetActiveByDefault() {
+ return activeByDefaultESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getJdk() {
+ return jdk;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setJdk(String newJdk) {
+ String oldJdk = jdk;
+ jdk = newJdk;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ACTIVATION__JDK, oldJdk, jdk));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ActivationOS getOs() {
+ return os;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetOs(ActivationOS newOs,
+ NotificationChain msgs) {
+ ActivationOS oldOs = os;
+ os = newOs;
+ boolean oldOsESet = osESet;
+ osESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.ACTIVATION__OS, oldOs, newOs,
+ !oldOsESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setOs(ActivationOS newOs) {
+ if (newOs != os) {
+ NotificationChain msgs = null;
+ if (os != null)
+ msgs = ((InternalEObject) os).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.ACTIVATION__OS,
+ null, msgs);
+ if (newOs != null)
+ msgs = ((InternalEObject) newOs).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.ACTIVATION__OS,
+ null, msgs);
+ msgs = basicSetOs(newOs, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldOsESet = osESet;
+ osESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ACTIVATION__OS, newOs, newOs, !oldOsESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetOs(NotificationChain msgs) {
+ ActivationOS oldOs = os;
+ os = null;
+ boolean oldOsESet = osESet;
+ osESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.ACTIVATION__OS, oldOs, null,
+ oldOsESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetOs() {
+ if (os != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) os).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.ACTIVATION__OS, null,
+ msgs);
+ msgs = basicUnsetOs(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldOsESet = osESet;
+ osESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.ACTIVATION__OS, null, null, oldOsESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetOs() {
+ return osESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ActivationProperty getProperty() {
+ return property;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetProperty(ActivationProperty newProperty,
+ NotificationChain msgs) {
+ ActivationProperty oldProperty = property;
+ property = newProperty;
+ boolean oldPropertyESet = propertyESet;
+ propertyESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.ACTIVATION__PROPERTY,
+ oldProperty, newProperty, !oldPropertyESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setProperty(ActivationProperty newProperty) {
+ if (newProperty != property) {
+ NotificationChain msgs = null;
+ if (property != null)
+ msgs = ((InternalEObject) property).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.ACTIVATION__PROPERTY, null, msgs);
+ if (newProperty != null)
+ msgs = ((InternalEObject) newProperty).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.ACTIVATION__PROPERTY, null, msgs);
+ msgs = basicSetProperty(newProperty, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldPropertyESet = propertyESet;
+ propertyESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ACTIVATION__PROPERTY, newProperty,
+ newProperty, !oldPropertyESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetProperty(NotificationChain msgs) {
+ ActivationProperty oldProperty = property;
+ property = null;
+ boolean oldPropertyESet = propertyESet;
+ propertyESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.ACTIVATION__PROPERTY,
+ oldProperty, null, oldPropertyESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetProperty() {
+ if (property != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) property).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.ACTIVATION__PROPERTY,
+ null, msgs);
+ msgs = basicUnsetProperty(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldPropertyESet = propertyESet;
+ propertyESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.ACTIVATION__PROPERTY, null, null,
+ oldPropertyESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetProperty() {
+ return propertyESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ActivationFile getFile() {
+ return file;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetFile(ActivationFile newFile,
+ NotificationChain msgs) {
+ ActivationFile oldFile = file;
+ file = newFile;
+ boolean oldFileESet = fileESet;
+ fileESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.ACTIVATION__FILE, oldFile,
+ newFile, !oldFileESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setFile(ActivationFile newFile) {
+ if (newFile != file) {
+ NotificationChain msgs = null;
+ if (file != null)
+ msgs = ((InternalEObject) file).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.ACTIVATION__FILE,
+ null, msgs);
+ if (newFile != null)
+ msgs = ((InternalEObject) newFile).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.ACTIVATION__FILE,
+ null, msgs);
+ msgs = basicSetFile(newFile, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldFileESet = fileESet;
+ fileESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ACTIVATION__FILE, newFile, newFile,
+ !oldFileESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetFile(NotificationChain msgs) {
+ ActivationFile oldFile = file;
+ file = null;
+ boolean oldFileESet = fileESet;
+ fileESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.ACTIVATION__FILE, oldFile,
+ null, oldFileESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetFile() {
+ if (file != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) file).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.ACTIVATION__FILE, null,
+ msgs);
+ msgs = basicUnsetFile(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldFileESet = fileESet;
+ fileESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.ACTIVATION__FILE, null, null, oldFileESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetFile() {
+ return fileESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION__OS:
+ return basicUnsetOs(msgs);
+ case PomPackage.ACTIVATION__PROPERTY:
+ return basicUnsetProperty(msgs);
+ case PomPackage.ACTIVATION__FILE:
+ return basicUnsetFile(msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION__ACTIVE_BY_DEFAULT:
+ return getActiveByDefault();
+ case PomPackage.ACTIVATION__JDK:
+ return getJdk();
+ case PomPackage.ACTIVATION__OS:
+ return getOs();
+ case PomPackage.ACTIVATION__PROPERTY:
+ return getProperty();
+ case PomPackage.ACTIVATION__FILE:
+ return getFile();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION__ACTIVE_BY_DEFAULT:
+ setActiveByDefault((String) newValue);
+ return;
+ case PomPackage.ACTIVATION__JDK:
+ setJdk((String) newValue);
+ return;
+ case PomPackage.ACTIVATION__OS:
+ setOs((ActivationOS) newValue);
+ return;
+ case PomPackage.ACTIVATION__PROPERTY:
+ setProperty((ActivationProperty) newValue);
+ return;
+ case PomPackage.ACTIVATION__FILE:
+ setFile((ActivationFile) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION__ACTIVE_BY_DEFAULT:
+ unsetActiveByDefault();
+ return;
+ case PomPackage.ACTIVATION__JDK:
+ setJdk(JDK_EDEFAULT);
+ return;
+ case PomPackage.ACTIVATION__OS:
+ unsetOs();
+ return;
+ case PomPackage.ACTIVATION__PROPERTY:
+ unsetProperty();
+ return;
+ case PomPackage.ACTIVATION__FILE:
+ unsetFile();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION__ACTIVE_BY_DEFAULT:
+ return isSetActiveByDefault();
+ case PomPackage.ACTIVATION__JDK:
+ return JDK_EDEFAULT == null ? jdk != null : !JDK_EDEFAULT
+ .equals(jdk);
+ case PomPackage.ACTIVATION__OS:
+ return isSetOs();
+ case PomPackage.ACTIVATION__PROPERTY:
+ return isSetProperty();
+ case PomPackage.ACTIVATION__FILE:
+ return isSetFile();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (activeByDefault: "); //$NON-NLS-1$
+ if (activeByDefaultESet)
+ result.append(activeByDefault);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", jdk: "); //$NON-NLS-1$
+ result.append(jdk);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ActivationImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationOSImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationOSImpl.java
new file mode 100644
index 00000000..778b6ae4
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationOSImpl.java
@@ -0,0 +1,346 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.ActivationOS;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Activation OS</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ActivationOSImpl#getName <em>
+ * Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ActivationOSImpl#getFamily <em>
+ * Family</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ActivationOSImpl#getArch <em>
+ * Arch</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ActivationOSImpl#getVersion <em>
+ * Version</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ActivationOSImpl extends EObjectImpl implements ActivationOS {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getFamily() <em>Family</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getFamily()
+ * @generated
+ * @ordered
+ */
+ protected static final String FAMILY_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getFamily() <em>Family</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getFamily()
+ * @generated
+ * @ordered
+ */
+ protected String family = FAMILY_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getArch() <em>Arch</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArch()
+ * @generated
+ * @ordered
+ */
+ protected static final String ARCH_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getArch() <em>Arch</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArch()
+ * @generated
+ * @ordered
+ */
+ protected String arch = ARCH_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected static final String VERSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected String version = VERSION_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ActivationOSImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.ACTIVATION_OS;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ACTIVATION_OS__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getFamily() {
+ return family;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setFamily(String newFamily) {
+ String oldFamily = family;
+ family = newFamily;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ACTIVATION_OS__FAMILY, oldFamily, family));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getArch() {
+ return arch;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setArch(String newArch) {
+ String oldArch = arch;
+ arch = newArch;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ACTIVATION_OS__ARCH, oldArch, arch));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setVersion(String newVersion) {
+ String oldVersion = version;
+ version = newVersion;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ACTIVATION_OS__VERSION, oldVersion, version));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION_OS__NAME:
+ return getName();
+ case PomPackage.ACTIVATION_OS__FAMILY:
+ return getFamily();
+ case PomPackage.ACTIVATION_OS__ARCH:
+ return getArch();
+ case PomPackage.ACTIVATION_OS__VERSION:
+ return getVersion();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION_OS__NAME:
+ setName((String) newValue);
+ return;
+ case PomPackage.ACTIVATION_OS__FAMILY:
+ setFamily((String) newValue);
+ return;
+ case PomPackage.ACTIVATION_OS__ARCH:
+ setArch((String) newValue);
+ return;
+ case PomPackage.ACTIVATION_OS__VERSION:
+ setVersion((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION_OS__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PomPackage.ACTIVATION_OS__FAMILY:
+ setFamily(FAMILY_EDEFAULT);
+ return;
+ case PomPackage.ACTIVATION_OS__ARCH:
+ setArch(ARCH_EDEFAULT);
+ return;
+ case PomPackage.ACTIVATION_OS__VERSION:
+ setVersion(VERSION_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION_OS__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT
+ .equals(name);
+ case PomPackage.ACTIVATION_OS__FAMILY:
+ return FAMILY_EDEFAULT == null ? family != null : !FAMILY_EDEFAULT
+ .equals(family);
+ case PomPackage.ACTIVATION_OS__ARCH:
+ return ARCH_EDEFAULT == null ? arch != null : !ARCH_EDEFAULT
+ .equals(arch);
+ case PomPackage.ACTIVATION_OS__VERSION:
+ return VERSION_EDEFAULT == null ? version != null
+ : !VERSION_EDEFAULT.equals(version);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(", family: "); //$NON-NLS-1$
+ result.append(family);
+ result.append(", arch: "); //$NON-NLS-1$
+ result.append(arch);
+ result.append(", version: "); //$NON-NLS-1$
+ result.append(version);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ActivationOSImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationPropertyImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationPropertyImpl.java
new file mode 100644
index 00000000..f24a0fc7
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ActivationPropertyImpl.java
@@ -0,0 +1,233 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.ActivationProperty;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Activation Property</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ActivationPropertyImpl#getName
+ * <em>Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ActivationPropertyImpl#getValue
+ * <em>Value</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ActivationPropertyImpl extends EObjectImpl implements
+ ActivationProperty {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final String VALUE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected String value = VALUE_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ActivationPropertyImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.ACTIVATION_PROPERTY;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ACTIVATION_PROPERTY__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setValue(String newValue) {
+ String oldValue = value;
+ value = newValue;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ACTIVATION_PROPERTY__VALUE, oldValue, value));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION_PROPERTY__NAME:
+ return getName();
+ case PomPackage.ACTIVATION_PROPERTY__VALUE:
+ return getValue();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION_PROPERTY__NAME:
+ setName((String) newValue);
+ return;
+ case PomPackage.ACTIVATION_PROPERTY__VALUE:
+ setValue((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION_PROPERTY__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PomPackage.ACTIVATION_PROPERTY__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.ACTIVATION_PROPERTY__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT
+ .equals(name);
+ case PomPackage.ACTIVATION_PROPERTY__VALUE:
+ return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT
+ .equals(value);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(", value: "); //$NON-NLS-1$
+ result.append(value);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ActivationPropertyImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/BuildBaseImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/BuildBaseImpl.java
new file mode 100644
index 00000000..4eb5a60b
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/BuildBaseImpl.java
@@ -0,0 +1,691 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EDataTypeEList;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.BuildBase;
+import org.eclipse.m2e.model.edit.pom.Plugin;
+import org.eclipse.m2e.model.edit.pom.PluginManagement;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Resource;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Build Base</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.BuildBaseImpl#getDefaultGoal
+ * <em>Default Goal</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.BuildBaseImpl#getResources <em>
+ * Resources</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.BuildBaseImpl#getTestResources
+ * <em>Test Resources</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.BuildBaseImpl#getDirectory <em>
+ * Directory</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.BuildBaseImpl#getFinalName <em>
+ * Final Name</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.BuildBaseImpl#getPluginManagement
+ * <em>Plugin Management</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.BuildBaseImpl#getPlugins <em>
+ * Plugins</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.BuildBaseImpl#getFilters <em>
+ * Filters</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class BuildBaseImpl extends EObjectImpl implements BuildBase {
+ /**
+ * The default value of the '{@link #getDefaultGoal() <em>Default Goal</em>}
+ * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDefaultGoal()
+ * @generated
+ * @ordered
+ */
+ protected static final String DEFAULT_GOAL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getDefaultGoal() <em>Default Goal</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDefaultGoal()
+ * @generated
+ * @ordered
+ */
+ protected String defaultGoal = DEFAULT_GOAL_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getResources() <em>Resources</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getResources()
+ * @generated
+ * @ordered
+ */
+ protected EList<Resource> resources;
+
+ /**
+ * The cached value of the '{@link #getTestResources()
+ * <em>Test Resources</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #getTestResources()
+ * @generated
+ * @ordered
+ */
+ protected EList<Resource> testResources;
+
+ /**
+ * The default value of the '{@link #getDirectory() <em>Directory</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDirectory()
+ * @generated
+ * @ordered
+ */
+ protected static final String DIRECTORY_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getDirectory() <em>Directory</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDirectory()
+ * @generated
+ * @ordered
+ */
+ protected String directory = DIRECTORY_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getFinalName() <em>Final Name</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getFinalName()
+ * @generated
+ * @ordered
+ */
+ protected static final String FINAL_NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getFinalName() <em>Final Name</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getFinalName()
+ * @generated
+ * @ordered
+ */
+ protected String finalName = FINAL_NAME_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getPluginManagement()
+ * <em>Plugin Management</em>}' containment reference. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #getPluginManagement()
+ * @generated
+ * @ordered
+ */
+ protected PluginManagement pluginManagement;
+
+ /**
+ * This is true if the Plugin Management containment reference has been set.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean pluginManagementESet;
+
+ /**
+ * The cached value of the '{@link #getPlugins() <em>Plugins</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getPlugins()
+ * @generated
+ * @ordered
+ */
+ protected EList<Plugin> plugins;
+
+ /**
+ * The cached value of the '{@link #getFilters() <em>Filters</em>}'
+ * attribute list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getFilters()
+ * @generated
+ * @ordered
+ */
+ protected EList<String> filters;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected BuildBaseImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.BUILD_BASE;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getDefaultGoal() {
+ return defaultGoal;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setDefaultGoal(String newDefaultGoal) {
+ String oldDefaultGoal = defaultGoal;
+ defaultGoal = newDefaultGoal;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.BUILD_BASE__DEFAULT_GOAL, oldDefaultGoal,
+ defaultGoal));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Resource> getResources() {
+ if (resources == null) {
+ resources = new EObjectContainmentEList.Unsettable<Resource>(
+ Resource.class, this, PomPackage.BUILD_BASE__RESOURCES);
+ }
+ return resources;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetResources() {
+ if (resources != null)
+ ((InternalEList.Unsettable<?>) resources).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetResources() {
+ return resources != null
+ && ((InternalEList.Unsettable<?>) resources).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Resource> getTestResources() {
+ if (testResources == null) {
+ testResources = new EObjectContainmentEList.Unsettable<Resource>(
+ Resource.class, this, PomPackage.BUILD_BASE__TEST_RESOURCES);
+ }
+ return testResources;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetTestResources() {
+ if (testResources != null)
+ ((InternalEList.Unsettable<?>) testResources).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetTestResources() {
+ return testResources != null
+ && ((InternalEList.Unsettable<?>) testResources).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getDirectory() {
+ return directory;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setDirectory(String newDirectory) {
+ String oldDirectory = directory;
+ directory = newDirectory;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.BUILD_BASE__DIRECTORY, oldDirectory, directory));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getFinalName() {
+ return finalName;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setFinalName(String newFinalName) {
+ String oldFinalName = finalName;
+ finalName = newFinalName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.BUILD_BASE__FINAL_NAME, oldFinalName, finalName));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PluginManagement getPluginManagement() {
+ return pluginManagement;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetPluginManagement(
+ PluginManagement newPluginManagement, NotificationChain msgs) {
+ PluginManagement oldPluginManagement = pluginManagement;
+ pluginManagement = newPluginManagement;
+ boolean oldPluginManagementESet = pluginManagementESet;
+ pluginManagementESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.BUILD_BASE__PLUGIN_MANAGEMENT,
+ oldPluginManagement, newPluginManagement,
+ !oldPluginManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setPluginManagement(PluginManagement newPluginManagement) {
+ if (newPluginManagement != pluginManagement) {
+ NotificationChain msgs = null;
+ if (pluginManagement != null)
+ msgs = ((InternalEObject) pluginManagement).eInverseRemove(
+ this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.BUILD_BASE__PLUGIN_MANAGEMENT,
+ null, msgs);
+ if (newPluginManagement != null)
+ msgs = ((InternalEObject) newPluginManagement).eInverseAdd(
+ this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.BUILD_BASE__PLUGIN_MANAGEMENT,
+ null, msgs);
+ msgs = basicSetPluginManagement(newPluginManagement, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldPluginManagementESet = pluginManagementESet;
+ pluginManagementESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.BUILD_BASE__PLUGIN_MANAGEMENT,
+ newPluginManagement, newPluginManagement,
+ !oldPluginManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetPluginManagement(NotificationChain msgs) {
+ PluginManagement oldPluginManagement = pluginManagement;
+ pluginManagement = null;
+ boolean oldPluginManagementESet = pluginManagementESet;
+ pluginManagementESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET,
+ PomPackage.BUILD_BASE__PLUGIN_MANAGEMENT,
+ oldPluginManagement, null, oldPluginManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetPluginManagement() {
+ if (pluginManagement != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) pluginManagement).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.BUILD_BASE__PLUGIN_MANAGEMENT, null,
+ msgs);
+ msgs = basicUnsetPluginManagement(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldPluginManagementESet = pluginManagementESet;
+ pluginManagementESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.BUILD_BASE__PLUGIN_MANAGEMENT, null, null,
+ oldPluginManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetPluginManagement() {
+ return pluginManagementESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Plugin> getPlugins() {
+ if (plugins == null) {
+ plugins = new EObjectContainmentEList.Unsettable<Plugin>(
+ Plugin.class, this, PomPackage.BUILD_BASE__PLUGINS);
+ }
+ return plugins;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetPlugins() {
+ if (plugins != null)
+ ((InternalEList.Unsettable<?>) plugins).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetPlugins() {
+ return plugins != null
+ && ((InternalEList.Unsettable<?>) plugins).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<String> getFilters() {
+ if (filters == null) {
+ filters = new EDataTypeEList<String>(String.class, this,
+ PomPackage.BUILD_BASE__FILTERS);
+ }
+ return filters;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.BUILD_BASE__RESOURCES:
+ return ((InternalEList<?>) getResources()).basicRemove(otherEnd,
+ msgs);
+ case PomPackage.BUILD_BASE__TEST_RESOURCES:
+ return ((InternalEList<?>) getTestResources()).basicRemove(
+ otherEnd, msgs);
+ case PomPackage.BUILD_BASE__PLUGIN_MANAGEMENT:
+ return basicUnsetPluginManagement(msgs);
+ case PomPackage.BUILD_BASE__PLUGINS:
+ return ((InternalEList<?>) getPlugins())
+ .basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.BUILD_BASE__DEFAULT_GOAL:
+ return getDefaultGoal();
+ case PomPackage.BUILD_BASE__RESOURCES:
+ return getResources();
+ case PomPackage.BUILD_BASE__TEST_RESOURCES:
+ return getTestResources();
+ case PomPackage.BUILD_BASE__DIRECTORY:
+ return getDirectory();
+ case PomPackage.BUILD_BASE__FINAL_NAME:
+ return getFinalName();
+ case PomPackage.BUILD_BASE__PLUGIN_MANAGEMENT:
+ return getPluginManagement();
+ case PomPackage.BUILD_BASE__PLUGINS:
+ return getPlugins();
+ case PomPackage.BUILD_BASE__FILTERS:
+ return getFilters();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.BUILD_BASE__DEFAULT_GOAL:
+ setDefaultGoal((String) newValue);
+ return;
+ case PomPackage.BUILD_BASE__RESOURCES:
+ getResources().clear();
+ getResources().addAll((Collection<? extends Resource>) newValue);
+ return;
+ case PomPackage.BUILD_BASE__TEST_RESOURCES:
+ getTestResources().clear();
+ getTestResources()
+ .addAll((Collection<? extends Resource>) newValue);
+ return;
+ case PomPackage.BUILD_BASE__DIRECTORY:
+ setDirectory((String) newValue);
+ return;
+ case PomPackage.BUILD_BASE__FINAL_NAME:
+ setFinalName((String) newValue);
+ return;
+ case PomPackage.BUILD_BASE__PLUGIN_MANAGEMENT:
+ setPluginManagement((PluginManagement) newValue);
+ return;
+ case PomPackage.BUILD_BASE__PLUGINS:
+ getPlugins().clear();
+ getPlugins().addAll((Collection<? extends Plugin>) newValue);
+ return;
+ case PomPackage.BUILD_BASE__FILTERS:
+ getFilters().clear();
+ getFilters().addAll((Collection<? extends String>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.BUILD_BASE__DEFAULT_GOAL:
+ setDefaultGoal(DEFAULT_GOAL_EDEFAULT);
+ return;
+ case PomPackage.BUILD_BASE__RESOURCES:
+ unsetResources();
+ return;
+ case PomPackage.BUILD_BASE__TEST_RESOURCES:
+ unsetTestResources();
+ return;
+ case PomPackage.BUILD_BASE__DIRECTORY:
+ setDirectory(DIRECTORY_EDEFAULT);
+ return;
+ case PomPackage.BUILD_BASE__FINAL_NAME:
+ setFinalName(FINAL_NAME_EDEFAULT);
+ return;
+ case PomPackage.BUILD_BASE__PLUGIN_MANAGEMENT:
+ unsetPluginManagement();
+ return;
+ case PomPackage.BUILD_BASE__PLUGINS:
+ unsetPlugins();
+ return;
+ case PomPackage.BUILD_BASE__FILTERS:
+ getFilters().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.BUILD_BASE__DEFAULT_GOAL:
+ return DEFAULT_GOAL_EDEFAULT == null ? defaultGoal != null
+ : !DEFAULT_GOAL_EDEFAULT.equals(defaultGoal);
+ case PomPackage.BUILD_BASE__RESOURCES:
+ return isSetResources();
+ case PomPackage.BUILD_BASE__TEST_RESOURCES:
+ return isSetTestResources();
+ case PomPackage.BUILD_BASE__DIRECTORY:
+ return DIRECTORY_EDEFAULT == null ? directory != null
+ : !DIRECTORY_EDEFAULT.equals(directory);
+ case PomPackage.BUILD_BASE__FINAL_NAME:
+ return FINAL_NAME_EDEFAULT == null ? finalName != null
+ : !FINAL_NAME_EDEFAULT.equals(finalName);
+ case PomPackage.BUILD_BASE__PLUGIN_MANAGEMENT:
+ return isSetPluginManagement();
+ case PomPackage.BUILD_BASE__PLUGINS:
+ return isSetPlugins();
+ case PomPackage.BUILD_BASE__FILTERS:
+ return filters != null && !filters.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (defaultGoal: "); //$NON-NLS-1$
+ result.append(defaultGoal);
+ result.append(", directory: "); //$NON-NLS-1$
+ result.append(directory);
+ result.append(", finalName: "); //$NON-NLS-1$
+ result.append(finalName);
+ result.append(", filters: "); //$NON-NLS-1$
+ result.append(filters);
+ result.append(')');
+ return result.toString();
+ }
+
+} // BuildBaseImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/BuildImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/BuildImpl.java
new file mode 100644
index 00000000..b1961f08
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/BuildImpl.java
@@ -0,0 +1,506 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.Build;
+import org.eclipse.m2e.model.edit.pom.Extension;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Build</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.BuildImpl#getSourceDirectory
+ * <em>Source Directory</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.BuildImpl#getScriptSourceDirectory
+ * <em>Script Source Directory</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.BuildImpl#getTestSourceDirectory
+ * <em>Test Source Directory</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.BuildImpl#getOutputDirectory
+ * <em>Output Directory</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.BuildImpl#getTestOutputDirectory
+ * <em>Test Output Directory</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.BuildImpl#getExtensions <em>
+ * Extensions</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class BuildImpl extends BuildBaseImpl implements Build {
+ /**
+ * The default value of the '{@link #getSourceDirectory()
+ * <em>Source Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getSourceDirectory()
+ * @generated
+ * @ordered
+ */
+ protected static final String SOURCE_DIRECTORY_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getSourceDirectory()
+ * <em>Source Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getSourceDirectory()
+ * @generated
+ * @ordered
+ */
+ protected String sourceDirectory = SOURCE_DIRECTORY_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getScriptSourceDirectory()
+ * <em>Script Source Directory</em>}' attribute. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getScriptSourceDirectory()
+ * @generated
+ * @ordered
+ */
+ protected static final String SCRIPT_SOURCE_DIRECTORY_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getScriptSourceDirectory()
+ * <em>Script Source Directory</em>}' attribute. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getScriptSourceDirectory()
+ * @generated
+ * @ordered
+ */
+ protected String scriptSourceDirectory = SCRIPT_SOURCE_DIRECTORY_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getTestSourceDirectory()
+ * <em>Test Source Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getTestSourceDirectory()
+ * @generated
+ * @ordered
+ */
+ protected static final String TEST_SOURCE_DIRECTORY_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getTestSourceDirectory()
+ * <em>Test Source Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getTestSourceDirectory()
+ * @generated
+ * @ordered
+ */
+ protected String testSourceDirectory = TEST_SOURCE_DIRECTORY_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getOutputDirectory()
+ * <em>Output Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getOutputDirectory()
+ * @generated
+ * @ordered
+ */
+ protected static final String OUTPUT_DIRECTORY_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getOutputDirectory()
+ * <em>Output Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getOutputDirectory()
+ * @generated
+ * @ordered
+ */
+ protected String outputDirectory = OUTPUT_DIRECTORY_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getTestOutputDirectory()
+ * <em>Test Output Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getTestOutputDirectory()
+ * @generated
+ * @ordered
+ */
+ protected static final String TEST_OUTPUT_DIRECTORY_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getTestOutputDirectory()
+ * <em>Test Output Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getTestOutputDirectory()
+ * @generated
+ * @ordered
+ */
+ protected String testOutputDirectory = TEST_OUTPUT_DIRECTORY_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getExtensions() <em>Extensions</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getExtensions()
+ * @generated
+ * @ordered
+ */
+ protected EList<Extension> extensions;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected BuildImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.BUILD;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getSourceDirectory() {
+ return sourceDirectory;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSourceDirectory(String newSourceDirectory) {
+ String oldSourceDirectory = sourceDirectory;
+ sourceDirectory = newSourceDirectory;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.BUILD__SOURCE_DIRECTORY, oldSourceDirectory,
+ sourceDirectory));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getScriptSourceDirectory() {
+ return scriptSourceDirectory;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setScriptSourceDirectory(String newScriptSourceDirectory) {
+ String oldScriptSourceDirectory = scriptSourceDirectory;
+ scriptSourceDirectory = newScriptSourceDirectory;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.BUILD__SCRIPT_SOURCE_DIRECTORY,
+ oldScriptSourceDirectory, scriptSourceDirectory));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getTestSourceDirectory() {
+ return testSourceDirectory;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setTestSourceDirectory(String newTestSourceDirectory) {
+ String oldTestSourceDirectory = testSourceDirectory;
+ testSourceDirectory = newTestSourceDirectory;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.BUILD__TEST_SOURCE_DIRECTORY,
+ oldTestSourceDirectory, testSourceDirectory));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getOutputDirectory() {
+ return outputDirectory;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setOutputDirectory(String newOutputDirectory) {
+ String oldOutputDirectory = outputDirectory;
+ outputDirectory = newOutputDirectory;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.BUILD__OUTPUT_DIRECTORY, oldOutputDirectory,
+ outputDirectory));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getTestOutputDirectory() {
+ return testOutputDirectory;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setTestOutputDirectory(String newTestOutputDirectory) {
+ String oldTestOutputDirectory = testOutputDirectory;
+ testOutputDirectory = newTestOutputDirectory;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.BUILD__TEST_OUTPUT_DIRECTORY,
+ oldTestOutputDirectory, testOutputDirectory));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Extension> getExtensions() {
+ if (extensions == null) {
+ extensions = new EObjectContainmentEList.Unsettable<Extension>(
+ Extension.class, this, PomPackage.BUILD__EXTENSIONS);
+ }
+ return extensions;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetExtensions() {
+ if (extensions != null)
+ ((InternalEList.Unsettable<?>) extensions).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetExtensions() {
+ return extensions != null
+ && ((InternalEList.Unsettable<?>) extensions).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.BUILD__EXTENSIONS:
+ return ((InternalEList<?>) getExtensions()).basicRemove(otherEnd,
+ msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.BUILD__SOURCE_DIRECTORY:
+ return getSourceDirectory();
+ case PomPackage.BUILD__SCRIPT_SOURCE_DIRECTORY:
+ return getScriptSourceDirectory();
+ case PomPackage.BUILD__TEST_SOURCE_DIRECTORY:
+ return getTestSourceDirectory();
+ case PomPackage.BUILD__OUTPUT_DIRECTORY:
+ return getOutputDirectory();
+ case PomPackage.BUILD__TEST_OUTPUT_DIRECTORY:
+ return getTestOutputDirectory();
+ case PomPackage.BUILD__EXTENSIONS:
+ return getExtensions();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.BUILD__SOURCE_DIRECTORY:
+ setSourceDirectory((String) newValue);
+ return;
+ case PomPackage.BUILD__SCRIPT_SOURCE_DIRECTORY:
+ setScriptSourceDirectory((String) newValue);
+ return;
+ case PomPackage.BUILD__TEST_SOURCE_DIRECTORY:
+ setTestSourceDirectory((String) newValue);
+ return;
+ case PomPackage.BUILD__OUTPUT_DIRECTORY:
+ setOutputDirectory((String) newValue);
+ return;
+ case PomPackage.BUILD__TEST_OUTPUT_DIRECTORY:
+ setTestOutputDirectory((String) newValue);
+ return;
+ case PomPackage.BUILD__EXTENSIONS:
+ getExtensions().clear();
+ getExtensions().addAll((Collection<? extends Extension>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.BUILD__SOURCE_DIRECTORY:
+ setSourceDirectory(SOURCE_DIRECTORY_EDEFAULT);
+ return;
+ case PomPackage.BUILD__SCRIPT_SOURCE_DIRECTORY:
+ setScriptSourceDirectory(SCRIPT_SOURCE_DIRECTORY_EDEFAULT);
+ return;
+ case PomPackage.BUILD__TEST_SOURCE_DIRECTORY:
+ setTestSourceDirectory(TEST_SOURCE_DIRECTORY_EDEFAULT);
+ return;
+ case PomPackage.BUILD__OUTPUT_DIRECTORY:
+ setOutputDirectory(OUTPUT_DIRECTORY_EDEFAULT);
+ return;
+ case PomPackage.BUILD__TEST_OUTPUT_DIRECTORY:
+ setTestOutputDirectory(TEST_OUTPUT_DIRECTORY_EDEFAULT);
+ return;
+ case PomPackage.BUILD__EXTENSIONS:
+ unsetExtensions();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.BUILD__SOURCE_DIRECTORY:
+ return SOURCE_DIRECTORY_EDEFAULT == null ? sourceDirectory != null
+ : !SOURCE_DIRECTORY_EDEFAULT.equals(sourceDirectory);
+ case PomPackage.BUILD__SCRIPT_SOURCE_DIRECTORY:
+ return SCRIPT_SOURCE_DIRECTORY_EDEFAULT == null ? scriptSourceDirectory != null
+ : !SCRIPT_SOURCE_DIRECTORY_EDEFAULT
+ .equals(scriptSourceDirectory);
+ case PomPackage.BUILD__TEST_SOURCE_DIRECTORY:
+ return TEST_SOURCE_DIRECTORY_EDEFAULT == null ? testSourceDirectory != null
+ : !TEST_SOURCE_DIRECTORY_EDEFAULT
+ .equals(testSourceDirectory);
+ case PomPackage.BUILD__OUTPUT_DIRECTORY:
+ return OUTPUT_DIRECTORY_EDEFAULT == null ? outputDirectory != null
+ : !OUTPUT_DIRECTORY_EDEFAULT.equals(outputDirectory);
+ case PomPackage.BUILD__TEST_OUTPUT_DIRECTORY:
+ return TEST_OUTPUT_DIRECTORY_EDEFAULT == null ? testOutputDirectory != null
+ : !TEST_OUTPUT_DIRECTORY_EDEFAULT
+ .equals(testOutputDirectory);
+ case PomPackage.BUILD__EXTENSIONS:
+ return isSetExtensions();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (sourceDirectory: "); //$NON-NLS-1$
+ result.append(sourceDirectory);
+ result.append(", scriptSourceDirectory: "); //$NON-NLS-1$
+ result.append(scriptSourceDirectory);
+ result.append(", testSourceDirectory: "); //$NON-NLS-1$
+ result.append(testSourceDirectory);
+ result.append(", outputDirectory: "); //$NON-NLS-1$
+ result.append(outputDirectory);
+ result.append(", testOutputDirectory: "); //$NON-NLS-1$
+ result.append(testOutputDirectory);
+ result.append(')');
+ return result.toString();
+ }
+
+} // BuildImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/CiManagementImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/CiManagementImpl.java
new file mode 100644
index 00000000..2508a02a
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/CiManagementImpl.java
@@ -0,0 +1,315 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.CiManagement;
+import org.eclipse.m2e.model.edit.pom.Notifier;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Ci Management</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.CiManagementImpl#getSystem <em>
+ * System</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.CiManagementImpl#getUrl <em>Url
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.CiManagementImpl#getNotifiers
+ * <em>Notifiers</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class CiManagementImpl extends EObjectImpl implements CiManagement {
+ /**
+ * The default value of the '{@link #getSystem() <em>System</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getSystem()
+ * @generated
+ * @ordered
+ */
+ protected static final String SYSTEM_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getSystem() <em>System</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getSystem()
+ * @generated
+ * @ordered
+ */
+ protected String system = SYSTEM_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected String url = URL_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getNotifiers() <em>Notifiers</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getNotifiers()
+ * @generated
+ * @ordered
+ */
+ protected EList<Notifier> notifiers;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected CiManagementImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.CI_MANAGEMENT;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getSystem() {
+ return system;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSystem(String newSystem) {
+ String oldSystem = system;
+ system = newSystem;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.CI_MANAGEMENT__SYSTEM, oldSystem, system));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUrl(String newUrl) {
+ String oldUrl = url;
+ url = newUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.CI_MANAGEMENT__URL, oldUrl, url));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Notifier> getNotifiers() {
+ if (notifiers == null) {
+ notifiers = new EObjectContainmentEList.Unsettable<Notifier>(
+ Notifier.class, this, PomPackage.CI_MANAGEMENT__NOTIFIERS);
+ }
+ return notifiers;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetNotifiers() {
+ if (notifiers != null)
+ ((InternalEList.Unsettable<?>) notifiers).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetNotifiers() {
+ return notifiers != null
+ && ((InternalEList.Unsettable<?>) notifiers).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.CI_MANAGEMENT__NOTIFIERS:
+ return ((InternalEList<?>) getNotifiers()).basicRemove(otherEnd,
+ msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.CI_MANAGEMENT__SYSTEM:
+ return getSystem();
+ case PomPackage.CI_MANAGEMENT__URL:
+ return getUrl();
+ case PomPackage.CI_MANAGEMENT__NOTIFIERS:
+ return getNotifiers();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.CI_MANAGEMENT__SYSTEM:
+ setSystem((String) newValue);
+ return;
+ case PomPackage.CI_MANAGEMENT__URL:
+ setUrl((String) newValue);
+ return;
+ case PomPackage.CI_MANAGEMENT__NOTIFIERS:
+ getNotifiers().clear();
+ getNotifiers().addAll((Collection<? extends Notifier>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.CI_MANAGEMENT__SYSTEM:
+ setSystem(SYSTEM_EDEFAULT);
+ return;
+ case PomPackage.CI_MANAGEMENT__URL:
+ setUrl(URL_EDEFAULT);
+ return;
+ case PomPackage.CI_MANAGEMENT__NOTIFIERS:
+ unsetNotifiers();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.CI_MANAGEMENT__SYSTEM:
+ return SYSTEM_EDEFAULT == null ? system != null : !SYSTEM_EDEFAULT
+ .equals(system);
+ case PomPackage.CI_MANAGEMENT__URL:
+ return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT
+ .equals(url);
+ case PomPackage.CI_MANAGEMENT__NOTIFIERS:
+ return isSetNotifiers();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (system: "); //$NON-NLS-1$
+ result.append(system);
+ result.append(", url: "); //$NON-NLS-1$
+ result.append(url);
+ result.append(')');
+ return result.toString();
+ }
+
+} // CiManagementImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ConfigurationImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ConfigurationImpl.java
new file mode 100644
index 00000000..065da650
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ConfigurationImpl.java
@@ -0,0 +1,242 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.Configuration;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Configuration</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ConfigurationImpl#getConfigurationNode <em>Configuration Node</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated NOT
+ */
+public class ConfigurationImpl extends EObjectImpl implements Configuration {
+ private Node configurationNode;
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ protected ConfigurationImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.CONFIGURATION;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node getConfigurationNode() {
+ return configurationNode;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setConfigurationNode(Node newConfigurationNode) {
+ this.configurationNode = newConfigurationNode;
+ }
+
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (configurationNode: "); //$NON-NLS-1$
+ result.append(configurationNode);
+ result.append(')');
+ return result.toString();
+ }
+
+ public String getStringValue(String xpath) throws RuntimeException {
+
+ NodeList children = configurationNode.getChildNodes();
+ for (int i=0; i<children.getLength(); i++) {
+ Node current = children.item(i);
+ if (current.getNodeName().equals(xpath)) {
+ return children.item(i).getChildNodes().item(0).getNodeValue();
+ }
+ }
+ return null;
+ }
+
+ public void setStringValue(String xpath, String value) throws RuntimeException {
+ NodeList children = configurationNode.getChildNodes();
+ boolean set = false;
+ for (int i=0; i<children.getLength(); i++) {
+ Node current = children.item(i);
+ if (current.getNodeName().equals(xpath)) {
+ while(current.getFirstChild() != null) {
+ current.removeChild(current.getFirstChild());
+ }
+ current.appendChild(current.getOwnerDocument().createTextNode(value));
+ set = true;
+ break;
+ }
+ }
+ if(!set) {
+ Element e = configurationNode.getOwnerDocument().createElement(xpath);
+ e.appendChild(configurationNode.getOwnerDocument().createTextNode(value));
+ configurationNode.appendChild(e);
+ }
+ }
+
+ public List<String> getListValue(String xpath) throws RuntimeException {
+ NodeList children = configurationNode.getChildNodes();
+ for (int i=0; i<children.getLength(); i++) {
+ Node current = children.item(i);
+ if (current.getNodeName().equals(xpath)) {
+ NodeList items = current.getChildNodes();
+ List<String> res = new ArrayList<String>();
+ for (int j=0; j<items.getLength(); j++) {
+ if (items.item(j).getNodeType() == Node.ELEMENT_NODE) {
+ res.add(items.item(j).getChildNodes().item(0).getNodeValue());
+ }
+ }
+ return res;
+ }
+ }
+ return null;
+ }
+
+ public List<Node> getListNodes(String xpath) {
+ return getListNodes(configurationNode, xpath);
+ }
+
+ public List<Node> getListNodes(Node node, String xpath) {
+ NodeList children = node.getChildNodes();
+ for (int i=0; i<children.getLength(); i++) {
+ Node current = children.item(i);
+ if (current.getNodeName().equals(xpath)) {
+ List<Node> res = new ArrayList<Node>();
+ NodeList items = current.getChildNodes();
+ for (int j=0; j<items.getLength(); j++) {
+ if (items.item(j).getNodeType() == Node.ELEMENT_NODE) {
+ res.add(items.item(j).getChildNodes().item(0));
+ }
+ }
+ return res;
+ }
+ }
+ return null;
+ }
+
+ public Node getNode(String xpath) {
+ return getNode(configurationNode, xpath);
+ }
+
+ public Node getNode(Node node, String xpath) {
+ NodeList children = node.getChildNodes();
+ for (int i=0; i<children.getLength(); i++) {
+ Node current = children.item(i);
+ if (current.getNodeName().equals(xpath)) {
+ return current;
+ }
+ }
+ return null;
+ }
+
+ public void setNodeValues(String xpath, String names[], String[] values) {
+ setNodeValues(configurationNode, xpath, names, values);
+ }
+
+ public void setNodeValues(String xpath, String name, String[] values) {
+ String[] names = new String[values.length];
+ for (int i=0; i<names.length; i++) {
+ names[i] = name;
+ }
+ setNodeValues(xpath, names, values);
+ }
+
+ public Node createNode(String xpath) {
+ Node element = configurationNode.getOwnerDocument().createElement(xpath);
+ configurationNode.appendChild(element);
+ return element;
+ }
+
+ public void removeNode(String xpath) {
+ configurationNode.removeChild(getNode(xpath));
+ }
+
+ public void setNodeValues(Node node, String xpath, String[] names, String[] values) {
+ Node parent = getNode(node, xpath);
+
+ if (parent == null) {
+ //create node
+ parent = node.getOwnerDocument().createElement(xpath);
+ node.appendChild(parent);
+ }
+
+ List<Node> nodes = getListNodes(node, xpath);
+
+ //append missing nodes if required
+ int diff = values.length - nodes.size();
+ for (int i=0; i<diff; i++) {
+ Node element = parent.getOwnerDocument().createElement(names[i]);
+ parent.appendChild(element);
+ Text text = parent.getOwnerDocument().createTextNode(""); //$NON-NLS-1$
+ element.appendChild(text);
+ nodes.add(text);
+ }
+
+ //remove extra nodes if required
+ for (int i=0; i<-diff; i++) {
+ Node element = nodes.remove(nodes.size() - 1 - i);
+ parent.removeChild(element.getParentNode());
+ }
+
+ //set values
+ for (int i=0; i<nodes.size(); i++) {
+ nodes.get(i).setNodeValue(values[i]);
+ }
+ }
+
+ public void doNotify(int eventType, Object changedFeature, Object oldValue, Object newValue) {
+ // A catch-all notificator.
+ // The configuration section can differ with every plugin, so we cannot really have a
+ // static EMF model. So we'll just notify the subscribers and let them act accordingly.
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, eventType, PomPackage.CONFIGURATION, oldValue, newValue));
+ }
+} // ConfigurationImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ContributorImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ContributorImpl.java
new file mode 100644
index 00000000..9c0f585e
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ContributorImpl.java
@@ -0,0 +1,609 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EDataTypeEList;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.Contributor;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Contributor</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ContributorImpl#getName <em>Name
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ContributorImpl#getEmail <em>
+ * Email</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ContributorImpl#getUrl <em>Url
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ContributorImpl#getOrganization
+ * <em>Organization</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ContributorImpl#getOrganizationUrl
+ * <em>Organization Url</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ContributorImpl#getTimezone <em>
+ * Timezone</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ContributorImpl#getProperties
+ * <em>Properties</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ContributorImpl#getRoles <em>
+ * Roles</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ContributorImpl extends EObjectImpl implements Contributor {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getEmail() <em>Email</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getEmail()
+ * @generated
+ * @ordered
+ */
+ protected static final String EMAIL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getEmail() <em>Email</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getEmail()
+ * @generated
+ * @ordered
+ */
+ protected String email = EMAIL_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected String url = URL_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getOrganization()
+ * <em>Organization</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getOrganization()
+ * @generated
+ * @ordered
+ */
+ protected static final String ORGANIZATION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getOrganization() <em>Organization</em>}
+ * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getOrganization()
+ * @generated
+ * @ordered
+ */
+ protected String organization = ORGANIZATION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getOrganizationUrl()
+ * <em>Organization Url</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getOrganizationUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String ORGANIZATION_URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getOrganizationUrl()
+ * <em>Organization Url</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getOrganizationUrl()
+ * @generated
+ * @ordered
+ */
+ protected String organizationUrl = ORGANIZATION_URL_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getTimezone() <em>Timezone</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getTimezone()
+ * @generated
+ * @ordered
+ */
+ protected static final String TIMEZONE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getTimezone() <em>Timezone</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getTimezone()
+ * @generated
+ * @ordered
+ */
+ protected String timezone = TIMEZONE_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getProperties() <em>Properties</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getProperties()
+ * @generated
+ * @ordered
+ */
+ protected EList<PropertyElement> properties;
+
+ /**
+ * The cached value of the '{@link #getRoles() <em>Roles</em>}' attribute
+ * list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getRoles()
+ * @generated
+ * @ordered
+ */
+ protected EList<String> roles;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ContributorImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.CONTRIBUTOR;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.CONTRIBUTOR__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getEmail() {
+ return email;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setEmail(String newEmail) {
+ String oldEmail = email;
+ email = newEmail;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.CONTRIBUTOR__EMAIL, oldEmail, email));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUrl(String newUrl) {
+ String oldUrl = url;
+ url = newUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.CONTRIBUTOR__URL, oldUrl, url));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getOrganization() {
+ return organization;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setOrganization(String newOrganization) {
+ String oldOrganization = organization;
+ organization = newOrganization;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.CONTRIBUTOR__ORGANIZATION, oldOrganization,
+ organization));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getOrganizationUrl() {
+ return organizationUrl;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setOrganizationUrl(String newOrganizationUrl) {
+ String oldOrganizationUrl = organizationUrl;
+ organizationUrl = newOrganizationUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.CONTRIBUTOR__ORGANIZATION_URL,
+ oldOrganizationUrl, organizationUrl));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getTimezone() {
+ return timezone;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setTimezone(String newTimezone) {
+ String oldTimezone = timezone;
+ timezone = newTimezone;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.CONTRIBUTOR__TIMEZONE, oldTimezone, timezone));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<PropertyElement> getProperties() {
+ if (properties == null) {
+ properties = new EObjectContainmentEList.Unsettable<PropertyElement>(
+ PropertyElement.class, this,
+ PomPackage.CONTRIBUTOR__PROPERTIES);
+ }
+ return properties;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetProperties() {
+ if (properties != null)
+ ((InternalEList.Unsettable<?>) properties).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetProperties() {
+ return properties != null
+ && ((InternalEList.Unsettable<?>) properties).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<String> getRoles() {
+ if (roles == null) {
+ roles = new EDataTypeEList.Unsettable<String>(String.class, this,
+ PomPackage.CONTRIBUTOR__ROLES);
+ }
+ return roles;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetRoles() {
+ if (roles != null)
+ ((InternalEList.Unsettable<?>) roles).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetRoles() {
+ return roles != null && ((InternalEList.Unsettable<?>) roles).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.CONTRIBUTOR__PROPERTIES:
+ return ((InternalEList<?>) getProperties()).basicRemove(otherEnd,
+ msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.CONTRIBUTOR__NAME:
+ return getName();
+ case PomPackage.CONTRIBUTOR__EMAIL:
+ return getEmail();
+ case PomPackage.CONTRIBUTOR__URL:
+ return getUrl();
+ case PomPackage.CONTRIBUTOR__ORGANIZATION:
+ return getOrganization();
+ case PomPackage.CONTRIBUTOR__ORGANIZATION_URL:
+ return getOrganizationUrl();
+ case PomPackage.CONTRIBUTOR__TIMEZONE:
+ return getTimezone();
+ case PomPackage.CONTRIBUTOR__PROPERTIES:
+ return getProperties();
+ case PomPackage.CONTRIBUTOR__ROLES:
+ return getRoles();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.CONTRIBUTOR__NAME:
+ setName((String) newValue);
+ return;
+ case PomPackage.CONTRIBUTOR__EMAIL:
+ setEmail((String) newValue);
+ return;
+ case PomPackage.CONTRIBUTOR__URL:
+ setUrl((String) newValue);
+ return;
+ case PomPackage.CONTRIBUTOR__ORGANIZATION:
+ setOrganization((String) newValue);
+ return;
+ case PomPackage.CONTRIBUTOR__ORGANIZATION_URL:
+ setOrganizationUrl((String) newValue);
+ return;
+ case PomPackage.CONTRIBUTOR__TIMEZONE:
+ setTimezone((String) newValue);
+ return;
+ case PomPackage.CONTRIBUTOR__PROPERTIES:
+ getProperties().clear();
+ getProperties().addAll(
+ (Collection<? extends PropertyElement>) newValue);
+ return;
+ case PomPackage.CONTRIBUTOR__ROLES:
+ getRoles().clear();
+ getRoles().addAll((Collection<? extends String>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.CONTRIBUTOR__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PomPackage.CONTRIBUTOR__EMAIL:
+ setEmail(EMAIL_EDEFAULT);
+ return;
+ case PomPackage.CONTRIBUTOR__URL:
+ setUrl(URL_EDEFAULT);
+ return;
+ case PomPackage.CONTRIBUTOR__ORGANIZATION:
+ setOrganization(ORGANIZATION_EDEFAULT);
+ return;
+ case PomPackage.CONTRIBUTOR__ORGANIZATION_URL:
+ setOrganizationUrl(ORGANIZATION_URL_EDEFAULT);
+ return;
+ case PomPackage.CONTRIBUTOR__TIMEZONE:
+ setTimezone(TIMEZONE_EDEFAULT);
+ return;
+ case PomPackage.CONTRIBUTOR__PROPERTIES:
+ unsetProperties();
+ return;
+ case PomPackage.CONTRIBUTOR__ROLES:
+ unsetRoles();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.CONTRIBUTOR__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT
+ .equals(name);
+ case PomPackage.CONTRIBUTOR__EMAIL:
+ return EMAIL_EDEFAULT == null ? email != null : !EMAIL_EDEFAULT
+ .equals(email);
+ case PomPackage.CONTRIBUTOR__URL:
+ return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT
+ .equals(url);
+ case PomPackage.CONTRIBUTOR__ORGANIZATION:
+ return ORGANIZATION_EDEFAULT == null ? organization != null
+ : !ORGANIZATION_EDEFAULT.equals(organization);
+ case PomPackage.CONTRIBUTOR__ORGANIZATION_URL:
+ return ORGANIZATION_URL_EDEFAULT == null ? organizationUrl != null
+ : !ORGANIZATION_URL_EDEFAULT.equals(organizationUrl);
+ case PomPackage.CONTRIBUTOR__TIMEZONE:
+ return TIMEZONE_EDEFAULT == null ? timezone != null
+ : !TIMEZONE_EDEFAULT.equals(timezone);
+ case PomPackage.CONTRIBUTOR__PROPERTIES:
+ return isSetProperties();
+ case PomPackage.CONTRIBUTOR__ROLES:
+ return isSetRoles();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(", email: "); //$NON-NLS-1$
+ result.append(email);
+ result.append(", url: "); //$NON-NLS-1$
+ result.append(url);
+ result.append(", organization: "); //$NON-NLS-1$
+ result.append(organization);
+ result.append(", organizationUrl: "); //$NON-NLS-1$
+ result.append(organizationUrl);
+ result.append(", timezone: "); //$NON-NLS-1$
+ result.append(timezone);
+ result.append(", roles: "); //$NON-NLS-1$
+ result.append(roles);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ContributorImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DependencyImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DependencyImpl.java
new file mode 100644
index 00000000..ff52abe9
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DependencyImpl.java
@@ -0,0 +1,737 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.Exclusion;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Dependency</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DependencyImpl#getGroupId <em>
+ * Group Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DependencyImpl#getArtifactId
+ * <em>Artifact Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DependencyImpl#getVersion <em>
+ * Version</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DependencyImpl#getType <em>Type
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DependencyImpl#getClassifier
+ * <em>Classifier</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DependencyImpl#getScope <em>
+ * Scope</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DependencyImpl#getSystemPath
+ * <em>System Path</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DependencyImpl#getExclusions
+ * <em>Exclusions</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DependencyImpl#getOptional <em>
+ * Optional</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class DependencyImpl extends EObjectImpl implements Dependency {
+ /**
+ * The default value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected static final String GROUP_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected String groupId = GROUP_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ARTIFACT_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected String artifactId = ARTIFACT_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected static final String VERSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected String version = VERSION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getType() <em>Type</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected static final String TYPE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected String type = TYPE_EDEFAULT;
+
+ /**
+ * This is true if the Type attribute has been set. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean typeESet;
+
+ /**
+ * The default value of the '{@link #getClassifier() <em>Classifier</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getClassifier()
+ * @generated
+ * @ordered
+ */
+ protected static final String CLASSIFIER_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getClassifier() <em>Classifier</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getClassifier()
+ * @generated
+ * @ordered
+ */
+ protected String classifier = CLASSIFIER_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getScope() <em>Scope</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getScope()
+ * @generated
+ * @ordered
+ */
+ protected static final String SCOPE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getScope() <em>Scope</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getScope()
+ * @generated
+ * @ordered
+ */
+ protected String scope = SCOPE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getSystemPath() <em>System Path</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getSystemPath()
+ * @generated
+ * @ordered
+ */
+ protected static final String SYSTEM_PATH_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getSystemPath() <em>System Path</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getSystemPath()
+ * @generated
+ * @ordered
+ */
+ protected String systemPath = SYSTEM_PATH_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getExclusions() <em>Exclusions</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getExclusions()
+ * @generated
+ * @ordered
+ */
+ protected EList<Exclusion> exclusions;
+
+ /**
+ * The default value of the '{@link #getOptional() <em>Optional</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getOptional()
+ * @generated
+ * @ordered
+ */
+ protected static final String OPTIONAL_EDEFAULT = "false"; //$NON-NLS-1$
+
+ /**
+ * The cached value of the '{@link #getOptional() <em>Optional</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getOptional()
+ * @generated
+ * @ordered
+ */
+ protected String optional = OPTIONAL_EDEFAULT;
+
+ /**
+ * This is true if the Optional attribute has been set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean optionalESet;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected DependencyImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.DEPENDENCY;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getGroupId() {
+ return groupId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setGroupId(String newGroupId) {
+ String oldGroupId = groupId;
+ groupId = newGroupId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEPENDENCY__GROUP_ID, oldGroupId, groupId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setArtifactId(String newArtifactId) {
+ String oldArtifactId = artifactId;
+ artifactId = newArtifactId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEPENDENCY__ARTIFACT_ID, oldArtifactId,
+ artifactId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setVersion(String newVersion) {
+ String oldVersion = version;
+ version = newVersion;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEPENDENCY__VERSION, oldVersion, version));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setType(String newType) {
+ String oldType = type;
+ type = newType;
+ boolean oldTypeESet = typeESet;
+ typeESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEPENDENCY__TYPE, oldType, type, !oldTypeESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetType() {
+ String oldType = type;
+ boolean oldTypeESet = typeESet;
+ type = TYPE_EDEFAULT;
+ typeESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.DEPENDENCY__TYPE, oldType, TYPE_EDEFAULT,
+ oldTypeESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetType() {
+ return typeESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getClassifier() {
+ return classifier;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setClassifier(String newClassifier) {
+ String oldClassifier = classifier;
+ classifier = newClassifier;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEPENDENCY__CLASSIFIER, oldClassifier,
+ classifier));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getScope() {
+ return scope;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setScope(String newScope) {
+ String oldScope = scope;
+ scope = newScope;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEPENDENCY__SCOPE, oldScope, scope));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getSystemPath() {
+ return systemPath;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSystemPath(String newSystemPath) {
+ String oldSystemPath = systemPath;
+ systemPath = newSystemPath;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEPENDENCY__SYSTEM_PATH, oldSystemPath,
+ systemPath));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Exclusion> getExclusions() {
+ if (exclusions == null) {
+ exclusions = new EObjectContainmentEList.Unsettable<Exclusion>(
+ Exclusion.class, this, PomPackage.DEPENDENCY__EXCLUSIONS);
+ }
+ return exclusions;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetExclusions() {
+ if (exclusions != null)
+ ((InternalEList.Unsettable<?>) exclusions).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetExclusions() {
+ return exclusions != null
+ && ((InternalEList.Unsettable<?>) exclusions).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getOptional() {
+ return optional;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setOptional(String newOptional) {
+ String oldOptional = optional;
+ optional = newOptional;
+ boolean oldOptionalESet = optionalESet;
+ optionalESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEPENDENCY__OPTIONAL, oldOptional, optional,
+ !oldOptionalESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetOptional() {
+ String oldOptional = optional;
+ boolean oldOptionalESet = optionalESet;
+ optional = OPTIONAL_EDEFAULT;
+ optionalESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.DEPENDENCY__OPTIONAL, oldOptional,
+ OPTIONAL_EDEFAULT, oldOptionalESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetOptional() {
+ return optionalESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.DEPENDENCY__EXCLUSIONS:
+ return ((InternalEList<?>) getExclusions()).basicRemove(otherEnd,
+ msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.DEPENDENCY__GROUP_ID:
+ return getGroupId();
+ case PomPackage.DEPENDENCY__ARTIFACT_ID:
+ return getArtifactId();
+ case PomPackage.DEPENDENCY__VERSION:
+ return getVersion();
+ case PomPackage.DEPENDENCY__TYPE:
+ return getType();
+ case PomPackage.DEPENDENCY__CLASSIFIER:
+ return getClassifier();
+ case PomPackage.DEPENDENCY__SCOPE:
+ return getScope();
+ case PomPackage.DEPENDENCY__SYSTEM_PATH:
+ return getSystemPath();
+ case PomPackage.DEPENDENCY__EXCLUSIONS:
+ return getExclusions();
+ case PomPackage.DEPENDENCY__OPTIONAL:
+ return getOptional();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.DEPENDENCY__GROUP_ID:
+ setGroupId((String) newValue);
+ return;
+ case PomPackage.DEPENDENCY__ARTIFACT_ID:
+ setArtifactId((String) newValue);
+ return;
+ case PomPackage.DEPENDENCY__VERSION:
+ setVersion((String) newValue);
+ return;
+ case PomPackage.DEPENDENCY__TYPE:
+ setType((String) newValue);
+ return;
+ case PomPackage.DEPENDENCY__CLASSIFIER:
+ setClassifier((String) newValue);
+ return;
+ case PomPackage.DEPENDENCY__SCOPE:
+ setScope((String) newValue);
+ return;
+ case PomPackage.DEPENDENCY__SYSTEM_PATH:
+ setSystemPath((String) newValue);
+ return;
+ case PomPackage.DEPENDENCY__EXCLUSIONS:
+ getExclusions().clear();
+ getExclusions().addAll((Collection<? extends Exclusion>) newValue);
+ return;
+ case PomPackage.DEPENDENCY__OPTIONAL:
+ setOptional((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.DEPENDENCY__GROUP_ID:
+ setGroupId(GROUP_ID_EDEFAULT);
+ return;
+ case PomPackage.DEPENDENCY__ARTIFACT_ID:
+ setArtifactId(ARTIFACT_ID_EDEFAULT);
+ return;
+ case PomPackage.DEPENDENCY__VERSION:
+ setVersion(VERSION_EDEFAULT);
+ return;
+ case PomPackage.DEPENDENCY__TYPE:
+ unsetType();
+ return;
+ case PomPackage.DEPENDENCY__CLASSIFIER:
+ setClassifier(CLASSIFIER_EDEFAULT);
+ return;
+ case PomPackage.DEPENDENCY__SCOPE:
+ setScope(SCOPE_EDEFAULT);
+ return;
+ case PomPackage.DEPENDENCY__SYSTEM_PATH:
+ setSystemPath(SYSTEM_PATH_EDEFAULT);
+ return;
+ case PomPackage.DEPENDENCY__EXCLUSIONS:
+ unsetExclusions();
+ return;
+ case PomPackage.DEPENDENCY__OPTIONAL:
+ unsetOptional();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.DEPENDENCY__GROUP_ID:
+ return GROUP_ID_EDEFAULT == null ? groupId != null
+ : !GROUP_ID_EDEFAULT.equals(groupId);
+ case PomPackage.DEPENDENCY__ARTIFACT_ID:
+ return ARTIFACT_ID_EDEFAULT == null ? artifactId != null
+ : !ARTIFACT_ID_EDEFAULT.equals(artifactId);
+ case PomPackage.DEPENDENCY__VERSION:
+ return VERSION_EDEFAULT == null ? version != null
+ : !VERSION_EDEFAULT.equals(version);
+ case PomPackage.DEPENDENCY__TYPE:
+ return isSetType();
+ case PomPackage.DEPENDENCY__CLASSIFIER:
+ return CLASSIFIER_EDEFAULT == null ? classifier != null
+ : !CLASSIFIER_EDEFAULT.equals(classifier);
+ case PomPackage.DEPENDENCY__SCOPE:
+ return SCOPE_EDEFAULT == null ? scope != null : !SCOPE_EDEFAULT
+ .equals(scope);
+ case PomPackage.DEPENDENCY__SYSTEM_PATH:
+ return SYSTEM_PATH_EDEFAULT == null ? systemPath != null
+ : !SYSTEM_PATH_EDEFAULT.equals(systemPath);
+ case PomPackage.DEPENDENCY__EXCLUSIONS:
+ return isSetExclusions();
+ case PomPackage.DEPENDENCY__OPTIONAL:
+ return isSetOptional();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (groupId: "); //$NON-NLS-1$
+ result.append(groupId);
+ result.append(", artifactId: "); //$NON-NLS-1$
+ result.append(artifactId);
+ result.append(", version: "); //$NON-NLS-1$
+ result.append(version);
+ result.append(", type: "); //$NON-NLS-1$
+ if (typeESet)
+ result.append(type);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", classifier: "); //$NON-NLS-1$
+ result.append(classifier);
+ result.append(", scope: "); //$NON-NLS-1$
+ result.append(scope);
+ result.append(", systemPath: "); //$NON-NLS-1$
+ result.append(systemPath);
+ result.append(", optional: "); //$NON-NLS-1$
+ if (optionalESet)
+ result.append(optional);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(')');
+ return result.toString();
+ }
+
+} // DependencyImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DependencyManagementImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DependencyManagementImpl.java
new file mode 100644
index 00000000..45a89a1a
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DependencyManagementImpl.java
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.DependencyManagement;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Dependency Management</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DependencyManagementImpl#getDependencies
+ * <em>Dependencies</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class DependencyManagementImpl extends EObjectImpl implements
+ DependencyManagement {
+ /**
+ * The cached value of the '{@link #getDependencies() <em>Dependencies</em>}
+ * ' containment reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #getDependencies()
+ * @generated
+ * @ordered
+ */
+ protected EList<Dependency> dependencies;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected DependencyManagementImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.DEPENDENCY_MANAGEMENT;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Dependency> getDependencies() {
+ if (dependencies == null) {
+ dependencies = new EObjectContainmentEList.Unsettable<Dependency>(
+ Dependency.class, this,
+ PomPackage.DEPENDENCY_MANAGEMENT__DEPENDENCIES);
+ }
+ return dependencies;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetDependencies() {
+ if (dependencies != null)
+ ((InternalEList.Unsettable<?>) dependencies).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetDependencies() {
+ return dependencies != null
+ && ((InternalEList.Unsettable<?>) dependencies).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.DEPENDENCY_MANAGEMENT__DEPENDENCIES:
+ return ((InternalEList<?>) getDependencies()).basicRemove(otherEnd,
+ msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.DEPENDENCY_MANAGEMENT__DEPENDENCIES:
+ return getDependencies();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.DEPENDENCY_MANAGEMENT__DEPENDENCIES:
+ getDependencies().clear();
+ getDependencies().addAll(
+ (Collection<? extends Dependency>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.DEPENDENCY_MANAGEMENT__DEPENDENCIES:
+ unsetDependencies();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.DEPENDENCY_MANAGEMENT__DEPENDENCIES:
+ return isSetDependencies();
+ }
+ return super.eIsSet(featureID);
+ }
+
+} // DependencyManagementImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DeploymentRepositoryImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DeploymentRepositoryImpl.java
new file mode 100644
index 00000000..9110e681
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DeploymentRepositoryImpl.java
@@ -0,0 +1,487 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.DeploymentRepository;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Deployment Repository</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DeploymentRepositoryImpl#getUniqueVersion
+ * <em>Unique Version</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DeploymentRepositoryImpl#getId
+ * <em>Id</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DeploymentRepositoryImpl#getName
+ * <em>Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DeploymentRepositoryImpl#getUrl
+ * <em>Url</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DeploymentRepositoryImpl#getLayout
+ * <em>Layout</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class DeploymentRepositoryImpl extends EObjectImpl implements
+ DeploymentRepository {
+ /**
+ * The default value of the '{@link #getUniqueVersion()
+ * <em>Unique Version</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getUniqueVersion()
+ * @generated
+ * @ordered
+ */
+ protected static final String UNIQUE_VERSION_EDEFAULT = "true"; //$NON-NLS-1$
+
+ /**
+ * The cached value of the '{@link #getUniqueVersion()
+ * <em>Unique Version</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getUniqueVersion()
+ * @generated
+ * @ordered
+ */
+ protected String uniqueVersion = UNIQUE_VERSION_EDEFAULT;
+
+ /**
+ * This is true if the Unique Version attribute has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean uniqueVersionESet;
+
+ /**
+ * The default value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected String id = ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected String url = URL_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getLayout() <em>Layout</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getLayout()
+ * @generated
+ * @ordered
+ */
+ protected static final String LAYOUT_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getLayout() <em>Layout</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getLayout()
+ * @generated
+ * @ordered
+ */
+ protected String layout = LAYOUT_EDEFAULT;
+
+ /**
+ * This is true if the Layout attribute has been set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean layoutESet;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected DeploymentRepositoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.DEPLOYMENT_REPOSITORY;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUniqueVersion() {
+ return uniqueVersion;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUniqueVersion(String newUniqueVersion) {
+ String oldUniqueVersion = uniqueVersion;
+ uniqueVersion = newUniqueVersion;
+ boolean oldUniqueVersionESet = uniqueVersionESet;
+ uniqueVersionESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEPLOYMENT_REPOSITORY__UNIQUE_VERSION,
+ oldUniqueVersion, uniqueVersion, !oldUniqueVersionESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetUniqueVersion() {
+ String oldUniqueVersion = uniqueVersion;
+ boolean oldUniqueVersionESet = uniqueVersionESet;
+ uniqueVersion = UNIQUE_VERSION_EDEFAULT;
+ uniqueVersionESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.DEPLOYMENT_REPOSITORY__UNIQUE_VERSION,
+ oldUniqueVersion, UNIQUE_VERSION_EDEFAULT,
+ oldUniqueVersionESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetUniqueVersion() {
+ return uniqueVersionESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setId(String newId) {
+ String oldId = id;
+ id = newId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEPLOYMENT_REPOSITORY__ID, oldId, id));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEPLOYMENT_REPOSITORY__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUrl(String newUrl) {
+ String oldUrl = url;
+ url = newUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEPLOYMENT_REPOSITORY__URL, oldUrl, url));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getLayout() {
+ return layout;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setLayout(String newLayout) {
+ String oldLayout = layout;
+ layout = newLayout;
+ boolean oldLayoutESet = layoutESet;
+ layoutESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEPLOYMENT_REPOSITORY__LAYOUT, oldLayout,
+ layout, !oldLayoutESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetLayout() {
+ String oldLayout = layout;
+ boolean oldLayoutESet = layoutESet;
+ layout = LAYOUT_EDEFAULT;
+ layoutESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.DEPLOYMENT_REPOSITORY__LAYOUT, oldLayout,
+ LAYOUT_EDEFAULT, oldLayoutESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetLayout() {
+ return layoutESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.DEPLOYMENT_REPOSITORY__UNIQUE_VERSION:
+ return getUniqueVersion();
+ case PomPackage.DEPLOYMENT_REPOSITORY__ID:
+ return getId();
+ case PomPackage.DEPLOYMENT_REPOSITORY__NAME:
+ return getName();
+ case PomPackage.DEPLOYMENT_REPOSITORY__URL:
+ return getUrl();
+ case PomPackage.DEPLOYMENT_REPOSITORY__LAYOUT:
+ return getLayout();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.DEPLOYMENT_REPOSITORY__UNIQUE_VERSION:
+ setUniqueVersion((String) newValue);
+ return;
+ case PomPackage.DEPLOYMENT_REPOSITORY__ID:
+ setId((String) newValue);
+ return;
+ case PomPackage.DEPLOYMENT_REPOSITORY__NAME:
+ setName((String) newValue);
+ return;
+ case PomPackage.DEPLOYMENT_REPOSITORY__URL:
+ setUrl((String) newValue);
+ return;
+ case PomPackage.DEPLOYMENT_REPOSITORY__LAYOUT:
+ setLayout((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.DEPLOYMENT_REPOSITORY__UNIQUE_VERSION:
+ unsetUniqueVersion();
+ return;
+ case PomPackage.DEPLOYMENT_REPOSITORY__ID:
+ setId(ID_EDEFAULT);
+ return;
+ case PomPackage.DEPLOYMENT_REPOSITORY__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PomPackage.DEPLOYMENT_REPOSITORY__URL:
+ setUrl(URL_EDEFAULT);
+ return;
+ case PomPackage.DEPLOYMENT_REPOSITORY__LAYOUT:
+ unsetLayout();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.DEPLOYMENT_REPOSITORY__UNIQUE_VERSION:
+ return isSetUniqueVersion();
+ case PomPackage.DEPLOYMENT_REPOSITORY__ID:
+ return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
+ case PomPackage.DEPLOYMENT_REPOSITORY__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT
+ .equals(name);
+ case PomPackage.DEPLOYMENT_REPOSITORY__URL:
+ return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT
+ .equals(url);
+ case PomPackage.DEPLOYMENT_REPOSITORY__LAYOUT:
+ return isSetLayout();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (uniqueVersion: "); //$NON-NLS-1$
+ if (uniqueVersionESet)
+ result.append(uniqueVersion);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", id: "); //$NON-NLS-1$
+ result.append(id);
+ result.append(", name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(", url: "); //$NON-NLS-1$
+ result.append(url);
+ result.append(", layout: "); //$NON-NLS-1$
+ if (layoutESet)
+ result.append(layout);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(')');
+ return result.toString();
+ }
+
+} // DeploymentRepositoryImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DeveloperImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DeveloperImpl.java
new file mode 100644
index 00000000..de8844fa
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DeveloperImpl.java
@@ -0,0 +1,665 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EDataTypeEList;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.Developer;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Developer</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DeveloperImpl#getId <em>Id</em>}
+ * </li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DeveloperImpl#getName <em>Name
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DeveloperImpl#getEmail <em>Email
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DeveloperImpl#getUrl <em>Url
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DeveloperImpl#getOrganization
+ * <em>Organization</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DeveloperImpl#getOrganizationUrl
+ * <em>Organization Url</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DeveloperImpl#getTimezone <em>
+ * Timezone</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DeveloperImpl#getProperties <em>
+ * Properties</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DeveloperImpl#getRoles <em>Roles
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class DeveloperImpl extends EObjectImpl implements Developer {
+ /**
+ * The default value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected String id = ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getEmail() <em>Email</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getEmail()
+ * @generated
+ * @ordered
+ */
+ protected static final String EMAIL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getEmail() <em>Email</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getEmail()
+ * @generated
+ * @ordered
+ */
+ protected String email = EMAIL_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected String url = URL_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getOrganization()
+ * <em>Organization</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getOrganization()
+ * @generated
+ * @ordered
+ */
+ protected static final String ORGANIZATION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getOrganization() <em>Organization</em>}
+ * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getOrganization()
+ * @generated
+ * @ordered
+ */
+ protected String organization = ORGANIZATION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getOrganizationUrl()
+ * <em>Organization Url</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getOrganizationUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String ORGANIZATION_URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getOrganizationUrl()
+ * <em>Organization Url</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getOrganizationUrl()
+ * @generated
+ * @ordered
+ */
+ protected String organizationUrl = ORGANIZATION_URL_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getTimezone() <em>Timezone</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getTimezone()
+ * @generated
+ * @ordered
+ */
+ protected static final String TIMEZONE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getTimezone() <em>Timezone</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getTimezone()
+ * @generated
+ * @ordered
+ */
+ protected String timezone = TIMEZONE_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getProperties() <em>Properties</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getProperties()
+ * @generated
+ * @ordered
+ */
+ protected EList<PropertyElement> properties;
+
+ /**
+ * The cached value of the '{@link #getRoles() <em>Roles</em>}' attribute
+ * list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getRoles()
+ * @generated
+ * @ordered
+ */
+ protected EList<String> roles;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected DeveloperImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.DEVELOPER;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setId(String newId) {
+ String oldId = id;
+ id = newId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEVELOPER__ID, oldId, id));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEVELOPER__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getEmail() {
+ return email;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setEmail(String newEmail) {
+ String oldEmail = email;
+ email = newEmail;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEVELOPER__EMAIL, oldEmail, email));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUrl(String newUrl) {
+ String oldUrl = url;
+ url = newUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEVELOPER__URL, oldUrl, url));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getOrganization() {
+ return organization;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setOrganization(String newOrganization) {
+ String oldOrganization = organization;
+ organization = newOrganization;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEVELOPER__ORGANIZATION, oldOrganization,
+ organization));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getOrganizationUrl() {
+ return organizationUrl;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setOrganizationUrl(String newOrganizationUrl) {
+ String oldOrganizationUrl = organizationUrl;
+ organizationUrl = newOrganizationUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEVELOPER__ORGANIZATION_URL, oldOrganizationUrl,
+ organizationUrl));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getTimezone() {
+ return timezone;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setTimezone(String newTimezone) {
+ String oldTimezone = timezone;
+ timezone = newTimezone;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DEVELOPER__TIMEZONE, oldTimezone, timezone));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<PropertyElement> getProperties() {
+ if (properties == null) {
+ properties = new EObjectContainmentEList.Unsettable<PropertyElement>(
+ PropertyElement.class, this,
+ PomPackage.DEVELOPER__PROPERTIES);
+ }
+ return properties;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetProperties() {
+ if (properties != null)
+ ((InternalEList.Unsettable<?>) properties).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetProperties() {
+ return properties != null
+ && ((InternalEList.Unsettable<?>) properties).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<String> getRoles() {
+ if (roles == null) {
+ roles = new EDataTypeEList.Unsettable<String>(String.class, this,
+ PomPackage.DEVELOPER__ROLES);
+ }
+ return roles;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetRoles() {
+ if (roles != null)
+ ((InternalEList.Unsettable<?>) roles).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetRoles() {
+ return roles != null && ((InternalEList.Unsettable<?>) roles).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.DEVELOPER__PROPERTIES:
+ return ((InternalEList<?>) getProperties()).basicRemove(otherEnd,
+ msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.DEVELOPER__ID:
+ return getId();
+ case PomPackage.DEVELOPER__NAME:
+ return getName();
+ case PomPackage.DEVELOPER__EMAIL:
+ return getEmail();
+ case PomPackage.DEVELOPER__URL:
+ return getUrl();
+ case PomPackage.DEVELOPER__ORGANIZATION:
+ return getOrganization();
+ case PomPackage.DEVELOPER__ORGANIZATION_URL:
+ return getOrganizationUrl();
+ case PomPackage.DEVELOPER__TIMEZONE:
+ return getTimezone();
+ case PomPackage.DEVELOPER__PROPERTIES:
+ return getProperties();
+ case PomPackage.DEVELOPER__ROLES:
+ return getRoles();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.DEVELOPER__ID:
+ setId((String) newValue);
+ return;
+ case PomPackage.DEVELOPER__NAME:
+ setName((String) newValue);
+ return;
+ case PomPackage.DEVELOPER__EMAIL:
+ setEmail((String) newValue);
+ return;
+ case PomPackage.DEVELOPER__URL:
+ setUrl((String) newValue);
+ return;
+ case PomPackage.DEVELOPER__ORGANIZATION:
+ setOrganization((String) newValue);
+ return;
+ case PomPackage.DEVELOPER__ORGANIZATION_URL:
+ setOrganizationUrl((String) newValue);
+ return;
+ case PomPackage.DEVELOPER__TIMEZONE:
+ setTimezone((String) newValue);
+ return;
+ case PomPackage.DEVELOPER__PROPERTIES:
+ getProperties().clear();
+ getProperties().addAll(
+ (Collection<? extends PropertyElement>) newValue);
+ return;
+ case PomPackage.DEVELOPER__ROLES:
+ getRoles().clear();
+ getRoles().addAll((Collection<? extends String>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.DEVELOPER__ID:
+ setId(ID_EDEFAULT);
+ return;
+ case PomPackage.DEVELOPER__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PomPackage.DEVELOPER__EMAIL:
+ setEmail(EMAIL_EDEFAULT);
+ return;
+ case PomPackage.DEVELOPER__URL:
+ setUrl(URL_EDEFAULT);
+ return;
+ case PomPackage.DEVELOPER__ORGANIZATION:
+ setOrganization(ORGANIZATION_EDEFAULT);
+ return;
+ case PomPackage.DEVELOPER__ORGANIZATION_URL:
+ setOrganizationUrl(ORGANIZATION_URL_EDEFAULT);
+ return;
+ case PomPackage.DEVELOPER__TIMEZONE:
+ setTimezone(TIMEZONE_EDEFAULT);
+ return;
+ case PomPackage.DEVELOPER__PROPERTIES:
+ unsetProperties();
+ return;
+ case PomPackage.DEVELOPER__ROLES:
+ unsetRoles();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.DEVELOPER__ID:
+ return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
+ case PomPackage.DEVELOPER__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT
+ .equals(name);
+ case PomPackage.DEVELOPER__EMAIL:
+ return EMAIL_EDEFAULT == null ? email != null : !EMAIL_EDEFAULT
+ .equals(email);
+ case PomPackage.DEVELOPER__URL:
+ return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT
+ .equals(url);
+ case PomPackage.DEVELOPER__ORGANIZATION:
+ return ORGANIZATION_EDEFAULT == null ? organization != null
+ : !ORGANIZATION_EDEFAULT.equals(organization);
+ case PomPackage.DEVELOPER__ORGANIZATION_URL:
+ return ORGANIZATION_URL_EDEFAULT == null ? organizationUrl != null
+ : !ORGANIZATION_URL_EDEFAULT.equals(organizationUrl);
+ case PomPackage.DEVELOPER__TIMEZONE:
+ return TIMEZONE_EDEFAULT == null ? timezone != null
+ : !TIMEZONE_EDEFAULT.equals(timezone);
+ case PomPackage.DEVELOPER__PROPERTIES:
+ return isSetProperties();
+ case PomPackage.DEVELOPER__ROLES:
+ return isSetRoles();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (id: "); //$NON-NLS-1$
+ result.append(id);
+ result.append(", name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(", email: "); //$NON-NLS-1$
+ result.append(email);
+ result.append(", url: "); //$NON-NLS-1$
+ result.append(url);
+ result.append(", organization: "); //$NON-NLS-1$
+ result.append(organization);
+ result.append(", organizationUrl: "); //$NON-NLS-1$
+ result.append(organizationUrl);
+ result.append(", timezone: "); //$NON-NLS-1$
+ result.append(timezone);
+ result.append(", roles: "); //$NON-NLS-1$
+ result.append(roles);
+ result.append(')');
+ return result.toString();
+ }
+
+} // DeveloperImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DistributionManagementImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DistributionManagementImpl.java
new file mode 100644
index 00000000..f7e63600
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DistributionManagementImpl.java
@@ -0,0 +1,894 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.DeploymentRepository;
+import org.eclipse.m2e.model.edit.pom.DistributionManagement;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Relocation;
+import org.eclipse.m2e.model.edit.pom.Site;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Distribution Management</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DistributionManagementImpl#getRepository
+ * <em>Repository</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DistributionManagementImpl#getSnapshotRepository
+ * <em>Snapshot Repository</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DistributionManagementImpl#getSite
+ * <em>Site</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DistributionManagementImpl#getDownloadUrl
+ * <em>Download Url</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DistributionManagementImpl#getRelocation
+ * <em>Relocation</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DistributionManagementImpl#getStatus
+ * <em>Status</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class DistributionManagementImpl extends EObjectImpl implements
+ DistributionManagement {
+ /**
+ * The cached value of the '{@link #getRepository() <em>Repository</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getRepository()
+ * @generated
+ * @ordered
+ */
+ protected DeploymentRepository repository;
+
+ /**
+ * This is true if the Repository containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean repositoryESet;
+
+ /**
+ * The cached value of the '{@link #getSnapshotRepository()
+ * <em>Snapshot Repository</em>}' containment reference. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #getSnapshotRepository()
+ * @generated
+ * @ordered
+ */
+ protected DeploymentRepository snapshotRepository;
+
+ /**
+ * This is true if the Snapshot Repository containment reference has been
+ * set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean snapshotRepositoryESet;
+
+ /**
+ * The cached value of the '{@link #getSite() <em>Site</em>}' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getSite()
+ * @generated
+ * @ordered
+ */
+ protected Site site;
+
+ /**
+ * This is true if the Site containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean siteESet;
+
+ /**
+ * The default value of the '{@link #getDownloadUrl() <em>Download Url</em>}
+ * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDownloadUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String DOWNLOAD_URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getDownloadUrl() <em>Download Url</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDownloadUrl()
+ * @generated
+ * @ordered
+ */
+ protected String downloadUrl = DOWNLOAD_URL_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getRelocation() <em>Relocation</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getRelocation()
+ * @generated
+ * @ordered
+ */
+ protected Relocation relocation;
+
+ /**
+ * This is true if the Relocation containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean relocationESet;
+
+ /**
+ * The default value of the '{@link #getStatus() <em>Status</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getStatus()
+ * @generated
+ * @ordered
+ */
+ protected static final String STATUS_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getStatus() <em>Status</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getStatus()
+ * @generated
+ * @ordered
+ */
+ protected String status = STATUS_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected DistributionManagementImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.DISTRIBUTION_MANAGEMENT;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DeploymentRepository getRepository() {
+ return repository;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetRepository(
+ DeploymentRepository newRepository, NotificationChain msgs) {
+ DeploymentRepository oldRepository = repository;
+ repository = newRepository;
+ boolean oldRepositoryESet = repositoryESet;
+ repositoryESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__REPOSITORY,
+ oldRepository, newRepository, !oldRepositoryESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setRepository(DeploymentRepository newRepository) {
+ if (newRepository != repository) {
+ NotificationChain msgs = null;
+ if (repository != null)
+ msgs = ((InternalEObject) repository)
+ .eInverseRemove(
+ this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.DISTRIBUTION_MANAGEMENT__REPOSITORY,
+ null, msgs);
+ if (newRepository != null)
+ msgs = ((InternalEObject) newRepository)
+ .eInverseAdd(
+ this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.DISTRIBUTION_MANAGEMENT__REPOSITORY,
+ null, msgs);
+ msgs = basicSetRepository(newRepository, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldRepositoryESet = repositoryESet;
+ repositoryESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__REPOSITORY,
+ newRepository, newRepository, !oldRepositoryESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetRepository(NotificationChain msgs) {
+ DeploymentRepository oldRepository = repository;
+ repository = null;
+ boolean oldRepositoryESet = repositoryESet;
+ repositoryESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__REPOSITORY,
+ oldRepository, null, oldRepositoryESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetRepository() {
+ if (repository != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) repository).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.DISTRIBUTION_MANAGEMENT__REPOSITORY,
+ null, msgs);
+ msgs = basicUnsetRepository(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldRepositoryESet = repositoryESet;
+ repositoryESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__REPOSITORY, null,
+ null, oldRepositoryESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetRepository() {
+ return repositoryESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DeploymentRepository getSnapshotRepository() {
+ return snapshotRepository;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetSnapshotRepository(
+ DeploymentRepository newSnapshotRepository, NotificationChain msgs) {
+ DeploymentRepository oldSnapshotRepository = snapshotRepository;
+ snapshotRepository = newSnapshotRepository;
+ boolean oldSnapshotRepositoryESet = snapshotRepositoryESet;
+ snapshotRepositoryESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY,
+ oldSnapshotRepository, newSnapshotRepository,
+ !oldSnapshotRepositoryESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSnapshotRepository(DeploymentRepository newSnapshotRepository) {
+ if (newSnapshotRepository != snapshotRepository) {
+ NotificationChain msgs = null;
+ if (snapshotRepository != null)
+ msgs = ((InternalEObject) snapshotRepository)
+ .eInverseRemove(
+ this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY,
+ null, msgs);
+ if (newSnapshotRepository != null)
+ msgs = ((InternalEObject) newSnapshotRepository)
+ .eInverseAdd(
+ this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY,
+ null, msgs);
+ msgs = basicSetSnapshotRepository(newSnapshotRepository, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldSnapshotRepositoryESet = snapshotRepositoryESet;
+ snapshotRepositoryESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(
+ this,
+ Notification.SET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY,
+ newSnapshotRepository, newSnapshotRepository,
+ !oldSnapshotRepositoryESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetSnapshotRepository(NotificationChain msgs) {
+ DeploymentRepository oldSnapshotRepository = snapshotRepository;
+ snapshotRepository = null;
+ boolean oldSnapshotRepositoryESet = snapshotRepositoryESet;
+ snapshotRepositoryESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY,
+ oldSnapshotRepository, null, oldSnapshotRepositoryESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetSnapshotRepository() {
+ if (snapshotRepository != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) snapshotRepository)
+ .eInverseRemove(
+ this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY,
+ null, msgs);
+ msgs = basicUnsetSnapshotRepository(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldSnapshotRepositoryESet = snapshotRepositoryESet;
+ snapshotRepositoryESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(
+ this,
+ Notification.UNSET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY,
+ null, null, oldSnapshotRepositoryESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetSnapshotRepository() {
+ return snapshotRepositoryESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Site getSite() {
+ return site;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetSite(Site newSite, NotificationChain msgs) {
+ Site oldSite = site;
+ site = newSite;
+ boolean oldSiteESet = siteESet;
+ siteESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.DISTRIBUTION_MANAGEMENT__SITE,
+ oldSite, newSite, !oldSiteESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSite(Site newSite) {
+ if (newSite != site) {
+ NotificationChain msgs = null;
+ if (site != null)
+ msgs = ((InternalEObject) site).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.DISTRIBUTION_MANAGEMENT__SITE,
+ null, msgs);
+ if (newSite != null)
+ msgs = ((InternalEObject) newSite).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.DISTRIBUTION_MANAGEMENT__SITE,
+ null, msgs);
+ msgs = basicSetSite(newSite, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldSiteESet = siteESet;
+ siteESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__SITE, newSite,
+ newSite, !oldSiteESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetSite(NotificationChain msgs) {
+ Site oldSite = site;
+ site = null;
+ boolean oldSiteESet = siteESet;
+ siteESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__SITE, oldSite, null,
+ oldSiteESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetSite() {
+ if (site != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) site).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.DISTRIBUTION_MANAGEMENT__SITE, null,
+ msgs);
+ msgs = basicUnsetSite(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldSiteESet = siteESet;
+ siteESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__SITE, null, null,
+ oldSiteESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetSite() {
+ return siteESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getDownloadUrl() {
+ return downloadUrl;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setDownloadUrl(String newDownloadUrl) {
+ String oldDownloadUrl = downloadUrl;
+ downloadUrl = newDownloadUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__DOWNLOAD_URL,
+ oldDownloadUrl, downloadUrl));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Relocation getRelocation() {
+ return relocation;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetRelocation(Relocation newRelocation,
+ NotificationChain msgs) {
+ Relocation oldRelocation = relocation;
+ relocation = newRelocation;
+ boolean oldRelocationESet = relocationESet;
+ relocationESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__RELOCATION,
+ oldRelocation, newRelocation, !oldRelocationESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setRelocation(Relocation newRelocation) {
+ if (newRelocation != relocation) {
+ NotificationChain msgs = null;
+ if (relocation != null)
+ msgs = ((InternalEObject) relocation)
+ .eInverseRemove(
+ this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.DISTRIBUTION_MANAGEMENT__RELOCATION,
+ null, msgs);
+ if (newRelocation != null)
+ msgs = ((InternalEObject) newRelocation)
+ .eInverseAdd(
+ this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.DISTRIBUTION_MANAGEMENT__RELOCATION,
+ null, msgs);
+ msgs = basicSetRelocation(newRelocation, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldRelocationESet = relocationESet;
+ relocationESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__RELOCATION,
+ newRelocation, newRelocation, !oldRelocationESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetRelocation(NotificationChain msgs) {
+ Relocation oldRelocation = relocation;
+ relocation = null;
+ boolean oldRelocationESet = relocationESet;
+ relocationESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__RELOCATION,
+ oldRelocation, null, oldRelocationESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetRelocation() {
+ if (relocation != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) relocation).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.DISTRIBUTION_MANAGEMENT__RELOCATION,
+ null, msgs);
+ msgs = basicUnsetRelocation(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldRelocationESet = relocationESet;
+ relocationESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__RELOCATION, null,
+ null, oldRelocationESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetRelocation() {
+ return relocationESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getStatus() {
+ return status;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setStatus(String newStatus) {
+ String oldStatus = status;
+ status = newStatus;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.DISTRIBUTION_MANAGEMENT__STATUS, oldStatus,
+ status));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.DISTRIBUTION_MANAGEMENT__REPOSITORY:
+ return basicUnsetRepository(msgs);
+ case PomPackage.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY:
+ return basicUnsetSnapshotRepository(msgs);
+ case PomPackage.DISTRIBUTION_MANAGEMENT__SITE:
+ return basicUnsetSite(msgs);
+ case PomPackage.DISTRIBUTION_MANAGEMENT__RELOCATION:
+ return basicUnsetRelocation(msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.DISTRIBUTION_MANAGEMENT__REPOSITORY:
+ return getRepository();
+ case PomPackage.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY:
+ return getSnapshotRepository();
+ case PomPackage.DISTRIBUTION_MANAGEMENT__SITE:
+ return getSite();
+ case PomPackage.DISTRIBUTION_MANAGEMENT__DOWNLOAD_URL:
+ return getDownloadUrl();
+ case PomPackage.DISTRIBUTION_MANAGEMENT__RELOCATION:
+ return getRelocation();
+ case PomPackage.DISTRIBUTION_MANAGEMENT__STATUS:
+ return getStatus();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.DISTRIBUTION_MANAGEMENT__REPOSITORY:
+ setRepository((DeploymentRepository) newValue);
+ return;
+ case PomPackage.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY:
+ setSnapshotRepository((DeploymentRepository) newValue);
+ return;
+ case PomPackage.DISTRIBUTION_MANAGEMENT__SITE:
+ setSite((Site) newValue);
+ return;
+ case PomPackage.DISTRIBUTION_MANAGEMENT__DOWNLOAD_URL:
+ setDownloadUrl((String) newValue);
+ return;
+ case PomPackage.DISTRIBUTION_MANAGEMENT__RELOCATION:
+ setRelocation((Relocation) newValue);
+ return;
+ case PomPackage.DISTRIBUTION_MANAGEMENT__STATUS:
+ setStatus((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.DISTRIBUTION_MANAGEMENT__REPOSITORY:
+ unsetRepository();
+ return;
+ case PomPackage.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY:
+ unsetSnapshotRepository();
+ return;
+ case PomPackage.DISTRIBUTION_MANAGEMENT__SITE:
+ unsetSite();
+ return;
+ case PomPackage.DISTRIBUTION_MANAGEMENT__DOWNLOAD_URL:
+ setDownloadUrl(DOWNLOAD_URL_EDEFAULT);
+ return;
+ case PomPackage.DISTRIBUTION_MANAGEMENT__RELOCATION:
+ unsetRelocation();
+ return;
+ case PomPackage.DISTRIBUTION_MANAGEMENT__STATUS:
+ setStatus(STATUS_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.DISTRIBUTION_MANAGEMENT__REPOSITORY:
+ return isSetRepository();
+ case PomPackage.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY:
+ return isSetSnapshotRepository();
+ case PomPackage.DISTRIBUTION_MANAGEMENT__SITE:
+ return isSetSite();
+ case PomPackage.DISTRIBUTION_MANAGEMENT__DOWNLOAD_URL:
+ return DOWNLOAD_URL_EDEFAULT == null ? downloadUrl != null
+ : !DOWNLOAD_URL_EDEFAULT.equals(downloadUrl);
+ case PomPackage.DISTRIBUTION_MANAGEMENT__RELOCATION:
+ return isSetRelocation();
+ case PomPackage.DISTRIBUTION_MANAGEMENT__STATUS:
+ return STATUS_EDEFAULT == null ? status != null : !STATUS_EDEFAULT
+ .equals(status);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (downloadUrl: "); //$NON-NLS-1$
+ result.append(downloadUrl);
+ result.append(", status: "); //$NON-NLS-1$
+ result.append(status);
+ result.append(')');
+ return result.toString();
+ }
+
+} // DistributionManagementImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DocumentRootImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DocumentRootImpl.java
new file mode 100644
index 00000000..0b6d6d44
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/DocumentRootImpl.java
@@ -0,0 +1,317 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EMap;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl;
+
+import org.eclipse.emf.ecore.util.BasicFeatureMap;
+import org.eclipse.emf.ecore.util.EcoreEMap;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.DocumentRoot;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Document Root</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DocumentRootImpl#getMixed <em>
+ * Mixed</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DocumentRootImpl#getXMLNSPrefixMap
+ * <em>XMLNS Prefix Map</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.DocumentRootImpl#getXSISchemaLocation
+ * <em>XSI Schema Location</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.DocumentRootImpl#getProject <em>
+ * Project</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class DocumentRootImpl extends EObjectImpl implements DocumentRoot {
+ /**
+ * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute
+ * list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getMixed()
+ * @generated
+ * @ordered
+ */
+ protected FeatureMap mixed;
+
+ /**
+ * The cached value of the '{@link #getXMLNSPrefixMap()
+ * <em>XMLNS Prefix Map</em>}' map. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getXMLNSPrefixMap()
+ * @generated
+ * @ordered
+ */
+ protected EMap<String, String> xMLNSPrefixMap;
+
+ /**
+ * The cached value of the '{@link #getXSISchemaLocation()
+ * <em>XSI Schema Location</em>}' map. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getXSISchemaLocation()
+ * @generated
+ * @ordered
+ */
+ protected EMap<String, String> xSISchemaLocation;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected DocumentRootImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.DOCUMENT_ROOT;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public FeatureMap getMixed() {
+ if (mixed == null) {
+ mixed = new BasicFeatureMap(this, PomPackage.DOCUMENT_ROOT__MIXED);
+ }
+ return mixed;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EMap<String, String> getXMLNSPrefixMap() {
+ if (xMLNSPrefixMap == null) {
+ xMLNSPrefixMap = new EcoreEMap<String, String>(
+ EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY,
+ EStringToStringMapEntryImpl.class, this,
+ PomPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP);
+ }
+ return xMLNSPrefixMap;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EMap<String, String> getXSISchemaLocation() {
+ if (xSISchemaLocation == null) {
+ xSISchemaLocation = new EcoreEMap<String, String>(
+ EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY,
+ EStringToStringMapEntryImpl.class, this,
+ PomPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION);
+ }
+ return xSISchemaLocation;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Model getProject() {
+ return (Model) getMixed().get(
+ PomPackage.Literals.DOCUMENT_ROOT__PROJECT, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetProject(Model newProject,
+ NotificationChain msgs) {
+ return ((FeatureMap.Internal) getMixed()).basicAdd(
+ PomPackage.Literals.DOCUMENT_ROOT__PROJECT, newProject, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setProject(Model newProject) {
+ ((FeatureMap.Internal) getMixed()).set(
+ PomPackage.Literals.DOCUMENT_ROOT__PROJECT, newProject);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.DOCUMENT_ROOT__MIXED:
+ return ((InternalEList<?>) getMixed()).basicRemove(otherEnd, msgs);
+ case PomPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
+ return ((InternalEList<?>) getXMLNSPrefixMap()).basicRemove(
+ otherEnd, msgs);
+ case PomPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
+ return ((InternalEList<?>) getXSISchemaLocation()).basicRemove(
+ otherEnd, msgs);
+ case PomPackage.DOCUMENT_ROOT__PROJECT:
+ return basicSetProject(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.DOCUMENT_ROOT__MIXED:
+ if (coreType)
+ return getMixed();
+ return ((FeatureMap.Internal) getMixed()).getWrapper();
+ case PomPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
+ if (coreType)
+ return getXMLNSPrefixMap();
+ else
+ return getXMLNSPrefixMap().map();
+ case PomPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
+ if (coreType)
+ return getXSISchemaLocation();
+ else
+ return getXSISchemaLocation().map();
+ case PomPackage.DOCUMENT_ROOT__PROJECT:
+ return getProject();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.DOCUMENT_ROOT__MIXED:
+ ((FeatureMap.Internal) getMixed()).set(newValue);
+ return;
+ case PomPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
+ ((EStructuralFeature.Setting) getXMLNSPrefixMap()).set(newValue);
+ return;
+ case PomPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
+ ((EStructuralFeature.Setting) getXSISchemaLocation()).set(newValue);
+ return;
+ case PomPackage.DOCUMENT_ROOT__PROJECT:
+ setProject((Model) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.DOCUMENT_ROOT__MIXED:
+ getMixed().clear();
+ return;
+ case PomPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
+ getXMLNSPrefixMap().clear();
+ return;
+ case PomPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
+ getXSISchemaLocation().clear();
+ return;
+ case PomPackage.DOCUMENT_ROOT__PROJECT:
+ setProject((Model) null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.DOCUMENT_ROOT__MIXED:
+ return mixed != null && !mixed.isEmpty();
+ case PomPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
+ return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty();
+ case PomPackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
+ return xSISchemaLocation != null && !xSISchemaLocation.isEmpty();
+ case PomPackage.DOCUMENT_ROOT__PROJECT:
+ return getProject() != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (mixed: "); //$NON-NLS-1$
+ result.append(mixed);
+ result.append(')');
+ return result.toString();
+ }
+
+} // DocumentRootImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ExclusionImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ExclusionImpl.java
new file mode 100644
index 00000000..3c9dd2e7
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ExclusionImpl.java
@@ -0,0 +1,233 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.Exclusion;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Exclusion</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ExclusionImpl#getArtifactId <em>
+ * Artifact Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ExclusionImpl#getGroupId <em>
+ * Group Id</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ExclusionImpl extends EObjectImpl implements Exclusion {
+ /**
+ * The default value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ARTIFACT_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected String artifactId = ARTIFACT_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected static final String GROUP_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected String groupId = GROUP_ID_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ExclusionImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.EXCLUSION;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setArtifactId(String newArtifactId) {
+ String oldArtifactId = artifactId;
+ artifactId = newArtifactId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.EXCLUSION__ARTIFACT_ID, oldArtifactId,
+ artifactId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getGroupId() {
+ return groupId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setGroupId(String newGroupId) {
+ String oldGroupId = groupId;
+ groupId = newGroupId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.EXCLUSION__GROUP_ID, oldGroupId, groupId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.EXCLUSION__ARTIFACT_ID:
+ return getArtifactId();
+ case PomPackage.EXCLUSION__GROUP_ID:
+ return getGroupId();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.EXCLUSION__ARTIFACT_ID:
+ setArtifactId((String) newValue);
+ return;
+ case PomPackage.EXCLUSION__GROUP_ID:
+ setGroupId((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.EXCLUSION__ARTIFACT_ID:
+ setArtifactId(ARTIFACT_ID_EDEFAULT);
+ return;
+ case PomPackage.EXCLUSION__GROUP_ID:
+ setGroupId(GROUP_ID_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.EXCLUSION__ARTIFACT_ID:
+ return ARTIFACT_ID_EDEFAULT == null ? artifactId != null
+ : !ARTIFACT_ID_EDEFAULT.equals(artifactId);
+ case PomPackage.EXCLUSION__GROUP_ID:
+ return GROUP_ID_EDEFAULT == null ? groupId != null
+ : !GROUP_ID_EDEFAULT.equals(groupId);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (artifactId: "); //$NON-NLS-1$
+ result.append(artifactId);
+ result.append(", groupId: "); //$NON-NLS-1$
+ result.append(groupId);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ExclusionImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ExtensionImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ExtensionImpl.java
new file mode 100644
index 00000000..bd10cf36
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ExtensionImpl.java
@@ -0,0 +1,290 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.Extension;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Extension</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ExtensionImpl#getGroupId <em>
+ * Group Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ExtensionImpl#getArtifactId <em>
+ * Artifact Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ExtensionImpl#getVersion <em>
+ * Version</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ExtensionImpl extends EObjectImpl implements Extension {
+ /**
+ * The default value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected static final String GROUP_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected String groupId = GROUP_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ARTIFACT_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected String artifactId = ARTIFACT_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected static final String VERSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected String version = VERSION_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ExtensionImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.EXTENSION;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getGroupId() {
+ return groupId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setGroupId(String newGroupId) {
+ String oldGroupId = groupId;
+ groupId = newGroupId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.EXTENSION__GROUP_ID, oldGroupId, groupId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setArtifactId(String newArtifactId) {
+ String oldArtifactId = artifactId;
+ artifactId = newArtifactId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.EXTENSION__ARTIFACT_ID, oldArtifactId,
+ artifactId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setVersion(String newVersion) {
+ String oldVersion = version;
+ version = newVersion;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.EXTENSION__VERSION, oldVersion, version));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.EXTENSION__GROUP_ID:
+ return getGroupId();
+ case PomPackage.EXTENSION__ARTIFACT_ID:
+ return getArtifactId();
+ case PomPackage.EXTENSION__VERSION:
+ return getVersion();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.EXTENSION__GROUP_ID:
+ setGroupId((String) newValue);
+ return;
+ case PomPackage.EXTENSION__ARTIFACT_ID:
+ setArtifactId((String) newValue);
+ return;
+ case PomPackage.EXTENSION__VERSION:
+ setVersion((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.EXTENSION__GROUP_ID:
+ setGroupId(GROUP_ID_EDEFAULT);
+ return;
+ case PomPackage.EXTENSION__ARTIFACT_ID:
+ setArtifactId(ARTIFACT_ID_EDEFAULT);
+ return;
+ case PomPackage.EXTENSION__VERSION:
+ setVersion(VERSION_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.EXTENSION__GROUP_ID:
+ return GROUP_ID_EDEFAULT == null ? groupId != null
+ : !GROUP_ID_EDEFAULT.equals(groupId);
+ case PomPackage.EXTENSION__ARTIFACT_ID:
+ return ARTIFACT_ID_EDEFAULT == null ? artifactId != null
+ : !ARTIFACT_ID_EDEFAULT.equals(artifactId);
+ case PomPackage.EXTENSION__VERSION:
+ return VERSION_EDEFAULT == null ? version != null
+ : !VERSION_EDEFAULT.equals(version);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (groupId: "); //$NON-NLS-1$
+ result.append(groupId);
+ result.append(", artifactId: "); //$NON-NLS-1$
+ result.append(artifactId);
+ result.append(", version: "); //$NON-NLS-1$
+ result.append(version);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ExtensionImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/IssueManagementImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/IssueManagementImpl.java
new file mode 100644
index 00000000..bcda5290
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/IssueManagementImpl.java
@@ -0,0 +1,232 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.IssueManagement;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Issue Management</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.IssueManagementImpl#getSystem
+ * <em>System</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.IssueManagementImpl#getUrl <em>
+ * Url</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class IssueManagementImpl extends EObjectImpl implements IssueManagement {
+ /**
+ * The default value of the '{@link #getSystem() <em>System</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getSystem()
+ * @generated
+ * @ordered
+ */
+ protected static final String SYSTEM_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getSystem() <em>System</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getSystem()
+ * @generated
+ * @ordered
+ */
+ protected String system = SYSTEM_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected String url = URL_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IssueManagementImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.ISSUE_MANAGEMENT;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getSystem() {
+ return system;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSystem(String newSystem) {
+ String oldSystem = system;
+ system = newSystem;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ISSUE_MANAGEMENT__SYSTEM, oldSystem, system));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUrl(String newUrl) {
+ String oldUrl = url;
+ url = newUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ISSUE_MANAGEMENT__URL, oldUrl, url));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.ISSUE_MANAGEMENT__SYSTEM:
+ return getSystem();
+ case PomPackage.ISSUE_MANAGEMENT__URL:
+ return getUrl();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.ISSUE_MANAGEMENT__SYSTEM:
+ setSystem((String) newValue);
+ return;
+ case PomPackage.ISSUE_MANAGEMENT__URL:
+ setUrl((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.ISSUE_MANAGEMENT__SYSTEM:
+ setSystem(SYSTEM_EDEFAULT);
+ return;
+ case PomPackage.ISSUE_MANAGEMENT__URL:
+ setUrl(URL_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.ISSUE_MANAGEMENT__SYSTEM:
+ return SYSTEM_EDEFAULT == null ? system != null : !SYSTEM_EDEFAULT
+ .equals(system);
+ case PomPackage.ISSUE_MANAGEMENT__URL:
+ return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT
+ .equals(url);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (system: "); //$NON-NLS-1$
+ result.append(system);
+ result.append(", url: "); //$NON-NLS-1$
+ result.append(url);
+ result.append(')');
+ return result.toString();
+ }
+
+} // IssueManagementImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/LicenseImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/LicenseImpl.java
new file mode 100644
index 00000000..2e2fdfec
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/LicenseImpl.java
@@ -0,0 +1,348 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.License;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>License</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.LicenseImpl#getName <em>Name
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.LicenseImpl#getUrl <em>Url</em>}
+ * </li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.LicenseImpl#getDistribution <em>
+ * Distribution</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.LicenseImpl#getComments <em>
+ * Comments</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class LicenseImpl extends EObjectImpl implements License {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected String url = URL_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getDistribution()
+ * <em>Distribution</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getDistribution()
+ * @generated
+ * @ordered
+ */
+ protected static final String DISTRIBUTION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getDistribution() <em>Distribution</em>}
+ * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDistribution()
+ * @generated
+ * @ordered
+ */
+ protected String distribution = DISTRIBUTION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getComments() <em>Comments</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getComments()
+ * @generated
+ * @ordered
+ */
+ protected static final String COMMENTS_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getComments() <em>Comments</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getComments()
+ * @generated
+ * @ordered
+ */
+ protected String comments = COMMENTS_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected LicenseImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.LICENSE;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.LICENSE__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUrl(String newUrl) {
+ String oldUrl = url;
+ url = newUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.LICENSE__URL, oldUrl, url));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getDistribution() {
+ return distribution;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setDistribution(String newDistribution) {
+ String oldDistribution = distribution;
+ distribution = newDistribution;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.LICENSE__DISTRIBUTION, oldDistribution,
+ distribution));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getComments() {
+ return comments;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setComments(String newComments) {
+ String oldComments = comments;
+ comments = newComments;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.LICENSE__COMMENTS, oldComments, comments));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.LICENSE__NAME:
+ return getName();
+ case PomPackage.LICENSE__URL:
+ return getUrl();
+ case PomPackage.LICENSE__DISTRIBUTION:
+ return getDistribution();
+ case PomPackage.LICENSE__COMMENTS:
+ return getComments();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.LICENSE__NAME:
+ setName((String) newValue);
+ return;
+ case PomPackage.LICENSE__URL:
+ setUrl((String) newValue);
+ return;
+ case PomPackage.LICENSE__DISTRIBUTION:
+ setDistribution((String) newValue);
+ return;
+ case PomPackage.LICENSE__COMMENTS:
+ setComments((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.LICENSE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PomPackage.LICENSE__URL:
+ setUrl(URL_EDEFAULT);
+ return;
+ case PomPackage.LICENSE__DISTRIBUTION:
+ setDistribution(DISTRIBUTION_EDEFAULT);
+ return;
+ case PomPackage.LICENSE__COMMENTS:
+ setComments(COMMENTS_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.LICENSE__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT
+ .equals(name);
+ case PomPackage.LICENSE__URL:
+ return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT
+ .equals(url);
+ case PomPackage.LICENSE__DISTRIBUTION:
+ return DISTRIBUTION_EDEFAULT == null ? distribution != null
+ : !DISTRIBUTION_EDEFAULT.equals(distribution);
+ case PomPackage.LICENSE__COMMENTS:
+ return COMMENTS_EDEFAULT == null ? comments != null
+ : !COMMENTS_EDEFAULT.equals(comments);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(", url: "); //$NON-NLS-1$
+ result.append(url);
+ result.append(", distribution: "); //$NON-NLS-1$
+ result.append(distribution);
+ result.append(", comments: "); //$NON-NLS-1$
+ result.append(comments);
+ result.append(')');
+ return result.toString();
+ }
+
+} // LicenseImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/MailingListImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/MailingListImpl.java
new file mode 100644
index 00000000..cb7ee9f3
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/MailingListImpl.java
@@ -0,0 +1,472 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EDataTypeEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.MailingList;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Mailing List</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.MailingListImpl#getName <em>Name
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.MailingListImpl#getSubscribe
+ * <em>Subscribe</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.MailingListImpl#getUnsubscribe
+ * <em>Unsubscribe</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.MailingListImpl#getPost <em>Post
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.MailingListImpl#getArchive <em>
+ * Archive</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.MailingListImpl#getOtherArchives
+ * <em>Other Archives</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class MailingListImpl extends EObjectImpl implements MailingList {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getSubscribe() <em>Subscribe</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getSubscribe()
+ * @generated
+ * @ordered
+ */
+ protected static final String SUBSCRIBE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getSubscribe() <em>Subscribe</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getSubscribe()
+ * @generated
+ * @ordered
+ */
+ protected String subscribe = SUBSCRIBE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUnsubscribe() <em>Unsubscribe</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUnsubscribe()
+ * @generated
+ * @ordered
+ */
+ protected static final String UNSUBSCRIBE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUnsubscribe() <em>Unsubscribe</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUnsubscribe()
+ * @generated
+ * @ordered
+ */
+ protected String unsubscribe = UNSUBSCRIBE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getPost() <em>Post</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getPost()
+ * @generated
+ * @ordered
+ */
+ protected static final String POST_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getPost() <em>Post</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getPost()
+ * @generated
+ * @ordered
+ */
+ protected String post = POST_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getArchive() <em>Archive</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArchive()
+ * @generated
+ * @ordered
+ */
+ protected static final String ARCHIVE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getArchive() <em>Archive</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArchive()
+ * @generated
+ * @ordered
+ */
+ protected String archive = ARCHIVE_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getOtherArchives()
+ * <em>Other Archives</em>}' attribute list. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getOtherArchives()
+ * @generated
+ * @ordered
+ */
+ protected EList<String> otherArchives;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected MailingListImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.MAILING_LIST;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MAILING_LIST__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getSubscribe() {
+ return subscribe;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSubscribe(String newSubscribe) {
+ String oldSubscribe = subscribe;
+ subscribe = newSubscribe;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MAILING_LIST__SUBSCRIBE, oldSubscribe, subscribe));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUnsubscribe() {
+ return unsubscribe;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUnsubscribe(String newUnsubscribe) {
+ String oldUnsubscribe = unsubscribe;
+ unsubscribe = newUnsubscribe;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MAILING_LIST__UNSUBSCRIBE, oldUnsubscribe,
+ unsubscribe));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getPost() {
+ return post;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setPost(String newPost) {
+ String oldPost = post;
+ post = newPost;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MAILING_LIST__POST, oldPost, post));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getArchive() {
+ return archive;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setArchive(String newArchive) {
+ String oldArchive = archive;
+ archive = newArchive;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MAILING_LIST__ARCHIVE, oldArchive, archive));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<String> getOtherArchives() {
+ if (otherArchives == null) {
+ otherArchives = new EDataTypeEList.Unsettable<String>(String.class,
+ this, PomPackage.MAILING_LIST__OTHER_ARCHIVES);
+ }
+ return otherArchives;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetOtherArchives() {
+ if (otherArchives != null)
+ ((InternalEList.Unsettable<?>) otherArchives).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetOtherArchives() {
+ return otherArchives != null
+ && ((InternalEList.Unsettable<?>) otherArchives).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.MAILING_LIST__NAME:
+ return getName();
+ case PomPackage.MAILING_LIST__SUBSCRIBE:
+ return getSubscribe();
+ case PomPackage.MAILING_LIST__UNSUBSCRIBE:
+ return getUnsubscribe();
+ case PomPackage.MAILING_LIST__POST:
+ return getPost();
+ case PomPackage.MAILING_LIST__ARCHIVE:
+ return getArchive();
+ case PomPackage.MAILING_LIST__OTHER_ARCHIVES:
+ return getOtherArchives();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.MAILING_LIST__NAME:
+ setName((String) newValue);
+ return;
+ case PomPackage.MAILING_LIST__SUBSCRIBE:
+ setSubscribe((String) newValue);
+ return;
+ case PomPackage.MAILING_LIST__UNSUBSCRIBE:
+ setUnsubscribe((String) newValue);
+ return;
+ case PomPackage.MAILING_LIST__POST:
+ setPost((String) newValue);
+ return;
+ case PomPackage.MAILING_LIST__ARCHIVE:
+ setArchive((String) newValue);
+ return;
+ case PomPackage.MAILING_LIST__OTHER_ARCHIVES:
+ getOtherArchives().clear();
+ getOtherArchives().addAll((Collection<? extends String>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.MAILING_LIST__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PomPackage.MAILING_LIST__SUBSCRIBE:
+ setSubscribe(SUBSCRIBE_EDEFAULT);
+ return;
+ case PomPackage.MAILING_LIST__UNSUBSCRIBE:
+ setUnsubscribe(UNSUBSCRIBE_EDEFAULT);
+ return;
+ case PomPackage.MAILING_LIST__POST:
+ setPost(POST_EDEFAULT);
+ return;
+ case PomPackage.MAILING_LIST__ARCHIVE:
+ setArchive(ARCHIVE_EDEFAULT);
+ return;
+ case PomPackage.MAILING_LIST__OTHER_ARCHIVES:
+ unsetOtherArchives();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.MAILING_LIST__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT
+ .equals(name);
+ case PomPackage.MAILING_LIST__SUBSCRIBE:
+ return SUBSCRIBE_EDEFAULT == null ? subscribe != null
+ : !SUBSCRIBE_EDEFAULT.equals(subscribe);
+ case PomPackage.MAILING_LIST__UNSUBSCRIBE:
+ return UNSUBSCRIBE_EDEFAULT == null ? unsubscribe != null
+ : !UNSUBSCRIBE_EDEFAULT.equals(unsubscribe);
+ case PomPackage.MAILING_LIST__POST:
+ return POST_EDEFAULT == null ? post != null : !POST_EDEFAULT
+ .equals(post);
+ case PomPackage.MAILING_LIST__ARCHIVE:
+ return ARCHIVE_EDEFAULT == null ? archive != null
+ : !ARCHIVE_EDEFAULT.equals(archive);
+ case PomPackage.MAILING_LIST__OTHER_ARCHIVES:
+ return isSetOtherArchives();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(", subscribe: "); //$NON-NLS-1$
+ result.append(subscribe);
+ result.append(", unsubscribe: "); //$NON-NLS-1$
+ result.append(unsubscribe);
+ result.append(", post: "); //$NON-NLS-1$
+ result.append(post);
+ result.append(", archive: "); //$NON-NLS-1$
+ result.append(archive);
+ result.append(", otherArchives: "); //$NON-NLS-1$
+ result.append(otherArchives);
+ result.append(')');
+ return result.toString();
+ }
+
+} // MailingListImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ModelImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ModelImpl.java
new file mode 100644
index 00000000..18e5bd55
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ModelImpl.java
@@ -0,0 +1,2791 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EDataTypeEList;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.Build;
+import org.eclipse.m2e.model.edit.pom.CiManagement;
+import org.eclipse.m2e.model.edit.pom.Contributor;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.DependencyManagement;
+import org.eclipse.m2e.model.edit.pom.Developer;
+import org.eclipse.m2e.model.edit.pom.DistributionManagement;
+import org.eclipse.m2e.model.edit.pom.IssueManagement;
+import org.eclipse.m2e.model.edit.pom.License;
+import org.eclipse.m2e.model.edit.pom.MailingList;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.Organization;
+import org.eclipse.m2e.model.edit.pom.Parent;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Prerequisites;
+import org.eclipse.m2e.model.edit.pom.Profile;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+import org.eclipse.m2e.model.edit.pom.Reporting;
+import org.eclipse.m2e.model.edit.pom.Repository;
+import org.eclipse.m2e.model.edit.pom.Scm;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Model</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getParent <em>Parent
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getModelVersion <em>
+ * Model Version</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getGroupId <em>Group
+ * Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getArtifactId <em>
+ * Artifact Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getPackaging <em>
+ * Packaging</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getName <em>Name</em>}
+ * </li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getVersion <em>Version
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getDescription <em>
+ * Description</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getUrl <em>Url</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getPrerequisites <em>
+ * Prerequisites</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getIssueManagement
+ * <em>Issue Management</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getCiManagement <em>Ci
+ * Management</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getInceptionYear <em>
+ * Inception Year</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getMailingLists <em>
+ * Mailing Lists</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getDevelopers <em>
+ * Developers</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getContributors <em>
+ * Contributors</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getLicenses <em>
+ * Licenses</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getScm <em>Scm</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getOrganization <em>
+ * Organization</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getBuild <em>Build
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getProfiles <em>
+ * Profiles</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getRepositories <em>
+ * Repositories</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getPluginRepositories
+ * <em>Plugin Repositories</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getDependencies <em>
+ * Dependencies</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getReporting <em>
+ * Reporting</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getDependencyManagement
+ * <em>Dependency Management</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getDistributionManagement
+ * <em>Distribution Management</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getProperties <em>
+ * Properties</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ModelImpl#getModules <em>Modules
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ModelImpl extends EObjectImpl implements Model {
+ /**
+ * The cached value of the '{@link #getParent() <em>Parent</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getParent()
+ * @generated
+ * @ordered
+ */
+ protected Parent parent;
+
+ /**
+ * This is true if the Parent containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean parentESet;
+
+ /**
+ * The default value of the '{@link #getModelVersion()
+ * <em>Model Version</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getModelVersion()
+ * @generated
+ * @ordered
+ */
+ protected static final String MODEL_VERSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getModelVersion()
+ * <em>Model Version</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getModelVersion()
+ * @generated
+ * @ordered
+ */
+ protected String modelVersion = MODEL_VERSION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected static final String GROUP_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected String groupId = GROUP_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ARTIFACT_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected String artifactId = ARTIFACT_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getPackaging() <em>Packaging</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getPackaging()
+ * @generated
+ * @ordered
+ */
+ protected static final String PACKAGING_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getPackaging() <em>Packaging</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getPackaging()
+ * @generated
+ * @ordered
+ */
+ protected String packaging = PACKAGING_EDEFAULT;
+
+ /**
+ * This is true if the Packaging attribute has been set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean packagingESet;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected static final String VERSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected String version = VERSION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getDescription() <em>Description</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDescription()
+ * @generated
+ * @ordered
+ */
+ protected static final String DESCRIPTION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getDescription() <em>Description</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDescription()
+ * @generated
+ * @ordered
+ */
+ protected String description = DESCRIPTION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected String url = URL_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getPrerequisites()
+ * <em>Prerequisites</em>}' containment reference. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getPrerequisites()
+ * @generated
+ * @ordered
+ */
+ protected Prerequisites prerequisites;
+
+ /**
+ * This is true if the Prerequisites containment reference has been set.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean prerequisitesESet;
+
+ /**
+ * The cached value of the '{@link #getIssueManagement()
+ * <em>Issue Management</em>}' containment reference. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #getIssueManagement()
+ * @generated
+ * @ordered
+ */
+ protected IssueManagement issueManagement;
+
+ /**
+ * This is true if the Issue Management containment reference has been set.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean issueManagementESet;
+
+ /**
+ * The cached value of the '{@link #getCiManagement()
+ * <em>Ci Management</em>}' containment reference. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getCiManagement()
+ * @generated
+ * @ordered
+ */
+ protected CiManagement ciManagement;
+
+ /**
+ * This is true if the Ci Management containment reference has been set.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean ciManagementESet;
+
+ /**
+ * The default value of the '{@link #getInceptionYear()
+ * <em>Inception Year</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getInceptionYear()
+ * @generated
+ * @ordered
+ */
+ protected static final String INCEPTION_YEAR_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getInceptionYear()
+ * <em>Inception Year</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getInceptionYear()
+ * @generated
+ * @ordered
+ */
+ protected String inceptionYear = INCEPTION_YEAR_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getMailingLists()
+ * <em>Mailing Lists</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #getMailingLists()
+ * @generated
+ * @ordered
+ */
+ protected EList<MailingList> mailingLists;
+
+ /**
+ * The cached value of the '{@link #getDevelopers() <em>Developers</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDevelopers()
+ * @generated
+ * @ordered
+ */
+ protected EList<Developer> developers;
+
+ /**
+ * The cached value of the '{@link #getContributors() <em>Contributors</em>}
+ * ' containment reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #getContributors()
+ * @generated
+ * @ordered
+ */
+ protected EList<Contributor> contributors;
+
+ /**
+ * The cached value of the '{@link #getLicenses() <em>Licenses</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getLicenses()
+ * @generated
+ * @ordered
+ */
+ protected EList<License> licenses;
+
+ /**
+ * The cached value of the '{@link #getScm() <em>Scm</em>}' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getScm()
+ * @generated
+ * @ordered
+ */
+ protected Scm scm;
+
+ /**
+ * This is true if the Scm containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean scmESet;
+
+ /**
+ * The cached value of the '{@link #getOrganization() <em>Organization</em>}
+ * ' containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getOrganization()
+ * @generated
+ * @ordered
+ */
+ protected Organization organization;
+
+ /**
+ * This is true if the Organization containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean organizationESet;
+
+ /**
+ * The cached value of the '{@link #getBuild() <em>Build</em>}' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getBuild()
+ * @generated
+ * @ordered
+ */
+ protected Build build;
+
+ /**
+ * This is true if the Build containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean buildESet;
+
+ /**
+ * The cached value of the '{@link #getProfiles() <em>Profiles</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getProfiles()
+ * @generated
+ * @ordered
+ */
+ protected EList<Profile> profiles;
+
+ /**
+ * The cached value of the '{@link #getRepositories() <em>Repositories</em>}
+ * ' containment reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #getRepositories()
+ * @generated
+ * @ordered
+ */
+ protected EList<Repository> repositories;
+
+ /**
+ * The cached value of the '{@link #getPluginRepositories()
+ * <em>Plugin Repositories</em>}' containment reference list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getPluginRepositories()
+ * @generated
+ * @ordered
+ */
+ protected EList<Repository> pluginRepositories;
+
+ /**
+ * The cached value of the '{@link #getDependencies() <em>Dependencies</em>}
+ * ' containment reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #getDependencies()
+ * @generated
+ * @ordered
+ */
+ protected EList<Dependency> dependencies;
+
+ /**
+ * The cached value of the '{@link #getReporting() <em>Reporting</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getReporting()
+ * @generated
+ * @ordered
+ */
+ protected Reporting reporting;
+
+ /**
+ * This is true if the Reporting containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean reportingESet;
+
+ /**
+ * The cached value of the '{@link #getDependencyManagement()
+ * <em>Dependency Management</em>}' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDependencyManagement()
+ * @generated
+ * @ordered
+ */
+ protected DependencyManagement dependencyManagement;
+
+ /**
+ * This is true if the Dependency Management containment reference has been
+ * set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean dependencyManagementESet;
+
+ /**
+ * The cached value of the '{@link #getDistributionManagement()
+ * <em>Distribution Management</em>}' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDistributionManagement()
+ * @generated
+ * @ordered
+ */
+ protected DistributionManagement distributionManagement;
+
+ /**
+ * This is true if the Distribution Management containment reference has
+ * been set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean distributionManagementESet;
+
+ /**
+ * The cached value of the '{@link #getProperties() <em>Properties</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getProperties()
+ * @generated
+ * @ordered
+ */
+ protected EList<PropertyElement> properties;
+
+ /**
+ * The cached value of the '{@link #getModules() <em>Modules</em>}'
+ * attribute list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getModules()
+ * @generated
+ * @ordered
+ */
+ protected EList<String> modules;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ModelImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.MODEL;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Parent getParent() {
+ return parent;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetParent(Parent newParent,
+ NotificationChain msgs) {
+ Parent oldParent = parent;
+ parent = newParent;
+ boolean oldParentESet = parentESet;
+ parentESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.MODEL__PARENT, oldParent,
+ newParent, !oldParentESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setParent(Parent newParent) {
+ if (newParent != parent) {
+ NotificationChain msgs = null;
+ if (parent != null)
+ msgs = ((InternalEObject) parent).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__PARENT,
+ null, msgs);
+ if (newParent != null)
+ msgs = ((InternalEObject) newParent).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__PARENT,
+ null, msgs);
+ msgs = basicSetParent(newParent, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldParentESet = parentESet;
+ parentESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__PARENT, newParent, newParent,
+ !oldParentESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetParent(NotificationChain msgs) {
+ Parent oldParent = parent;
+ parent = null;
+ boolean oldParentESet = parentESet;
+ parentESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.MODEL__PARENT, oldParent,
+ null, oldParentESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetParent() {
+ if (parent != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) parent).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__PARENT, null,
+ msgs);
+ msgs = basicUnsetParent(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldParentESet = parentESet;
+ parentESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.MODEL__PARENT, null, null, oldParentESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetParent() {
+ return parentESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getModelVersion() {
+ return modelVersion;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setModelVersion(String newModelVersion) {
+ String oldModelVersion = modelVersion;
+ modelVersion = newModelVersion;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__MODEL_VERSION, oldModelVersion,
+ modelVersion));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getGroupId() {
+ return groupId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setGroupId(String newGroupId) {
+ String oldGroupId = groupId;
+ groupId = newGroupId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__GROUP_ID, oldGroupId, groupId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setArtifactId(String newArtifactId) {
+ String oldArtifactId = artifactId;
+ artifactId = newArtifactId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__ARTIFACT_ID, oldArtifactId, artifactId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getPackaging() {
+ return packaging;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setPackaging(String newPackaging) {
+ String oldPackaging = packaging;
+ packaging = newPackaging;
+ boolean oldPackagingESet = packagingESet;
+ packagingESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__PACKAGING, oldPackaging, packaging,
+ !oldPackagingESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetPackaging() {
+ String oldPackaging = packaging;
+ boolean oldPackagingESet = packagingESet;
+ packaging = PACKAGING_EDEFAULT;
+ packagingESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.MODEL__PACKAGING, oldPackaging,
+ PACKAGING_EDEFAULT, oldPackagingESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetPackaging() {
+ return packagingESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setVersion(String newVersion) {
+ String oldVersion = version;
+ version = newVersion;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__VERSION, oldVersion, version));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setDescription(String newDescription) {
+ String oldDescription = description;
+ description = newDescription;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__DESCRIPTION, oldDescription, description));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUrl(String newUrl) {
+ String oldUrl = url;
+ url = newUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__URL, oldUrl, url));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Prerequisites getPrerequisites() {
+ return prerequisites;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetPrerequisites(
+ Prerequisites newPrerequisites, NotificationChain msgs) {
+ Prerequisites oldPrerequisites = prerequisites;
+ prerequisites = newPrerequisites;
+ boolean oldPrerequisitesESet = prerequisitesESet;
+ prerequisitesESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.MODEL__PREREQUISITES,
+ oldPrerequisites, newPrerequisites, !oldPrerequisitesESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setPrerequisites(Prerequisites newPrerequisites) {
+ if (newPrerequisites != prerequisites) {
+ NotificationChain msgs = null;
+ if (prerequisites != null)
+ msgs = ((InternalEObject) prerequisites).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__PREREQUISITES, null, msgs);
+ if (newPrerequisites != null)
+ msgs = ((InternalEObject) newPrerequisites).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__PREREQUISITES, null, msgs);
+ msgs = basicSetPrerequisites(newPrerequisites, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldPrerequisitesESet = prerequisitesESet;
+ prerequisitesESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__PREREQUISITES, newPrerequisites,
+ newPrerequisites, !oldPrerequisitesESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetPrerequisites(NotificationChain msgs) {
+ Prerequisites oldPrerequisites = prerequisites;
+ prerequisites = null;
+ boolean oldPrerequisitesESet = prerequisitesESet;
+ prerequisitesESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.MODEL__PREREQUISITES,
+ oldPrerequisites, null, oldPrerequisitesESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetPrerequisites() {
+ if (prerequisites != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) prerequisites).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__PREREQUISITES,
+ null, msgs);
+ msgs = basicUnsetPrerequisites(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldPrerequisitesESet = prerequisitesESet;
+ prerequisitesESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.MODEL__PREREQUISITES, null, null,
+ oldPrerequisitesESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetPrerequisites() {
+ return prerequisitesESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IssueManagement getIssueManagement() {
+ return issueManagement;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetIssueManagement(
+ IssueManagement newIssueManagement, NotificationChain msgs) {
+ IssueManagement oldIssueManagement = issueManagement;
+ issueManagement = newIssueManagement;
+ boolean oldIssueManagementESet = issueManagementESet;
+ issueManagementESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.MODEL__ISSUE_MANAGEMENT,
+ oldIssueManagement, newIssueManagement,
+ !oldIssueManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setIssueManagement(IssueManagement newIssueManagement) {
+ if (newIssueManagement != issueManagement) {
+ NotificationChain msgs = null;
+ if (issueManagement != null)
+ msgs = ((InternalEObject) issueManagement).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__ISSUE_MANAGEMENT, null,
+ msgs);
+ if (newIssueManagement != null)
+ msgs = ((InternalEObject) newIssueManagement).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__ISSUE_MANAGEMENT, null,
+ msgs);
+ msgs = basicSetIssueManagement(newIssueManagement, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldIssueManagementESet = issueManagementESet;
+ issueManagementESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__ISSUE_MANAGEMENT, newIssueManagement,
+ newIssueManagement, !oldIssueManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetIssueManagement(NotificationChain msgs) {
+ IssueManagement oldIssueManagement = issueManagement;
+ issueManagement = null;
+ boolean oldIssueManagementESet = issueManagementESet;
+ issueManagementESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.MODEL__ISSUE_MANAGEMENT,
+ oldIssueManagement, null, oldIssueManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetIssueManagement() {
+ if (issueManagement != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) issueManagement)
+ .eInverseRemove(this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__ISSUE_MANAGEMENT, null, msgs);
+ msgs = basicUnsetIssueManagement(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldIssueManagementESet = issueManagementESet;
+ issueManagementESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.MODEL__ISSUE_MANAGEMENT, null, null,
+ oldIssueManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetIssueManagement() {
+ return issueManagementESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public CiManagement getCiManagement() {
+ return ciManagement;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetCiManagement(CiManagement newCiManagement,
+ NotificationChain msgs) {
+ CiManagement oldCiManagement = ciManagement;
+ ciManagement = newCiManagement;
+ boolean oldCiManagementESet = ciManagementESet;
+ ciManagementESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.MODEL__CI_MANAGEMENT,
+ oldCiManagement, newCiManagement, !oldCiManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setCiManagement(CiManagement newCiManagement) {
+ if (newCiManagement != ciManagement) {
+ NotificationChain msgs = null;
+ if (ciManagement != null)
+ msgs = ((InternalEObject) ciManagement).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__CI_MANAGEMENT, null, msgs);
+ if (newCiManagement != null)
+ msgs = ((InternalEObject) newCiManagement).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__CI_MANAGEMENT, null, msgs);
+ msgs = basicSetCiManagement(newCiManagement, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldCiManagementESet = ciManagementESet;
+ ciManagementESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__CI_MANAGEMENT, newCiManagement,
+ newCiManagement, !oldCiManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetCiManagement(NotificationChain msgs) {
+ CiManagement oldCiManagement = ciManagement;
+ ciManagement = null;
+ boolean oldCiManagementESet = ciManagementESet;
+ ciManagementESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.MODEL__CI_MANAGEMENT,
+ oldCiManagement, null, oldCiManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetCiManagement() {
+ if (ciManagement != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) ciManagement).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__CI_MANAGEMENT,
+ null, msgs);
+ msgs = basicUnsetCiManagement(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldCiManagementESet = ciManagementESet;
+ ciManagementESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.MODEL__CI_MANAGEMENT, null, null,
+ oldCiManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetCiManagement() {
+ return ciManagementESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getInceptionYear() {
+ return inceptionYear;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setInceptionYear(String newInceptionYear) {
+ String oldInceptionYear = inceptionYear;
+ inceptionYear = newInceptionYear;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__INCEPTION_YEAR, oldInceptionYear,
+ inceptionYear));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<MailingList> getMailingLists() {
+ if (mailingLists == null) {
+ mailingLists = new EObjectContainmentEList.Unsettable<MailingList>(
+ MailingList.class, this, PomPackage.MODEL__MAILING_LISTS);
+ }
+ return mailingLists;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetMailingLists() {
+ if (mailingLists != null)
+ ((InternalEList.Unsettable<?>) mailingLists).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetMailingLists() {
+ return mailingLists != null
+ && ((InternalEList.Unsettable<?>) mailingLists).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Developer> getDevelopers() {
+ if (developers == null) {
+ developers = new EObjectContainmentEList.Unsettable<Developer>(
+ Developer.class, this, PomPackage.MODEL__DEVELOPERS);
+ }
+ return developers;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetDevelopers() {
+ if (developers != null)
+ ((InternalEList.Unsettable<?>) developers).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetDevelopers() {
+ return developers != null
+ && ((InternalEList.Unsettable<?>) developers).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Contributor> getContributors() {
+ if (contributors == null) {
+ contributors = new EObjectContainmentEList.Unsettable<Contributor>(
+ Contributor.class, this, PomPackage.MODEL__CONTRIBUTORS);
+ }
+ return contributors;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetContributors() {
+ if (contributors != null)
+ ((InternalEList.Unsettable<?>) contributors).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetContributors() {
+ return contributors != null
+ && ((InternalEList.Unsettable<?>) contributors).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<License> getLicenses() {
+ if (licenses == null) {
+ licenses = new EObjectContainmentEList<License>(License.class,
+ this, PomPackage.MODEL__LICENSES);
+ }
+ return licenses;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Scm getScm() {
+ return scm;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetScm(Scm newScm, NotificationChain msgs) {
+ Scm oldScm = scm;
+ scm = newScm;
+ boolean oldScmESet = scmESet;
+ scmESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.MODEL__SCM, oldScm, newScm,
+ !oldScmESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setScm(Scm newScm) {
+ if (newScm != scm) {
+ NotificationChain msgs = null;
+ if (scm != null)
+ msgs = ((InternalEObject) scm).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__SCM, null,
+ msgs);
+ if (newScm != null)
+ msgs = ((InternalEObject) newScm).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__SCM, null,
+ msgs);
+ msgs = basicSetScm(newScm, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldScmESet = scmESet;
+ scmESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__SCM, newScm, newScm, !oldScmESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetScm(NotificationChain msgs) {
+ Scm oldScm = scm;
+ scm = null;
+ boolean oldScmESet = scmESet;
+ scmESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.MODEL__SCM, oldScm, null,
+ oldScmESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetScm() {
+ if (scm != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) scm).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__SCM, null, msgs);
+ msgs = basicUnsetScm(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldScmESet = scmESet;
+ scmESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.MODEL__SCM, null, null, oldScmESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetScm() {
+ return scmESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Organization getOrganization() {
+ return organization;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetOrganization(Organization newOrganization,
+ NotificationChain msgs) {
+ Organization oldOrganization = organization;
+ organization = newOrganization;
+ boolean oldOrganizationESet = organizationESet;
+ organizationESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.MODEL__ORGANIZATION,
+ oldOrganization, newOrganization, !oldOrganizationESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setOrganization(Organization newOrganization) {
+ if (newOrganization != organization) {
+ NotificationChain msgs = null;
+ if (organization != null)
+ msgs = ((InternalEObject) organization)
+ .eInverseRemove(this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__ORGANIZATION, null, msgs);
+ if (newOrganization != null)
+ msgs = ((InternalEObject) newOrganization)
+ .eInverseAdd(this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__ORGANIZATION, null, msgs);
+ msgs = basicSetOrganization(newOrganization, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldOrganizationESet = organizationESet;
+ organizationESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__ORGANIZATION, newOrganization,
+ newOrganization, !oldOrganizationESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetOrganization(NotificationChain msgs) {
+ Organization oldOrganization = organization;
+ organization = null;
+ boolean oldOrganizationESet = organizationESet;
+ organizationESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.MODEL__ORGANIZATION,
+ oldOrganization, null, oldOrganizationESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetOrganization() {
+ if (organization != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) organization).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__ORGANIZATION,
+ null, msgs);
+ msgs = basicUnsetOrganization(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldOrganizationESet = organizationESet;
+ organizationESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.MODEL__ORGANIZATION, null, null,
+ oldOrganizationESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetOrganization() {
+ return organizationESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Build getBuild() {
+ return build;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetBuild(Build newBuild,
+ NotificationChain msgs) {
+ Build oldBuild = build;
+ build = newBuild;
+ boolean oldBuildESet = buildESet;
+ buildESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.MODEL__BUILD, oldBuild,
+ newBuild, !oldBuildESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setBuild(Build newBuild) {
+ if (newBuild != build) {
+ NotificationChain msgs = null;
+ if (build != null)
+ msgs = ((InternalEObject) build).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__BUILD, null,
+ msgs);
+ if (newBuild != null)
+ msgs = ((InternalEObject) newBuild).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__BUILD, null,
+ msgs);
+ msgs = basicSetBuild(newBuild, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldBuildESet = buildESet;
+ buildESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__BUILD, newBuild, newBuild,
+ !oldBuildESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetBuild(NotificationChain msgs) {
+ Build oldBuild = build;
+ build = null;
+ boolean oldBuildESet = buildESet;
+ buildESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.MODEL__BUILD, oldBuild,
+ null, oldBuildESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetBuild() {
+ if (build != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) build).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__BUILD, null,
+ msgs);
+ msgs = basicUnsetBuild(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldBuildESet = buildESet;
+ buildESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.MODEL__BUILD, null, null, oldBuildESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetBuild() {
+ return buildESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Profile> getProfiles() {
+ if (profiles == null) {
+ profiles = new EObjectContainmentEList.Unsettable<Profile>(
+ Profile.class, this, PomPackage.MODEL__PROFILES);
+ }
+ return profiles;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetProfiles() {
+ if (profiles != null)
+ ((InternalEList.Unsettable<?>) profiles).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetProfiles() {
+ return profiles != null
+ && ((InternalEList.Unsettable<?>) profiles).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Repository> getRepositories() {
+ if (repositories == null) {
+ repositories = new EObjectContainmentEList.Unsettable<Repository>(
+ Repository.class, this, PomPackage.MODEL__REPOSITORIES);
+ }
+ return repositories;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetRepositories() {
+ if (repositories != null)
+ ((InternalEList.Unsettable<?>) repositories).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetRepositories() {
+ return repositories != null
+ && ((InternalEList.Unsettable<?>) repositories).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Repository> getPluginRepositories() {
+ if (pluginRepositories == null) {
+ pluginRepositories = new EObjectContainmentEList.Unsettable<Repository>(
+ Repository.class, this,
+ PomPackage.MODEL__PLUGIN_REPOSITORIES);
+ }
+ return pluginRepositories;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetPluginRepositories() {
+ if (pluginRepositories != null)
+ ((InternalEList.Unsettable<?>) pluginRepositories).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetPluginRepositories() {
+ return pluginRepositories != null
+ && ((InternalEList.Unsettable<?>) pluginRepositories).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Dependency> getDependencies() {
+ if (dependencies == null) {
+ dependencies = new EObjectContainmentEList.Unsettable<Dependency>(
+ Dependency.class, this, PomPackage.MODEL__DEPENDENCIES);
+ }
+ return dependencies;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetDependencies() {
+ if (dependencies != null)
+ ((InternalEList.Unsettable<?>) dependencies).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetDependencies() {
+ return dependencies != null
+ && ((InternalEList.Unsettable<?>) dependencies).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Reporting getReporting() {
+ return reporting;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetReporting(Reporting newReporting,
+ NotificationChain msgs) {
+ Reporting oldReporting = reporting;
+ reporting = newReporting;
+ boolean oldReportingESet = reportingESet;
+ reportingESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.MODEL__REPORTING,
+ oldReporting, newReporting, !oldReportingESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setReporting(Reporting newReporting) {
+ if (newReporting != reporting) {
+ NotificationChain msgs = null;
+ if (reporting != null)
+ msgs = ((InternalEObject) reporting).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__REPORTING,
+ null, msgs);
+ if (newReporting != null)
+ msgs = ((InternalEObject) newReporting).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__REPORTING,
+ null, msgs);
+ msgs = basicSetReporting(newReporting, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldReportingESet = reportingESet;
+ reportingESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__REPORTING, newReporting,
+ newReporting, !oldReportingESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetReporting(NotificationChain msgs) {
+ Reporting oldReporting = reporting;
+ reporting = null;
+ boolean oldReportingESet = reportingESet;
+ reportingESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.MODEL__REPORTING,
+ oldReporting, null, oldReportingESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetReporting() {
+ if (reporting != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) reporting).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.MODEL__REPORTING, null,
+ msgs);
+ msgs = basicUnsetReporting(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldReportingESet = reportingESet;
+ reportingESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.MODEL__REPORTING, null, null,
+ oldReportingESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetReporting() {
+ return reportingESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DependencyManagement getDependencyManagement() {
+ return dependencyManagement;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetDependencyManagement(
+ DependencyManagement newDependencyManagement, NotificationChain msgs) {
+ DependencyManagement oldDependencyManagement = dependencyManagement;
+ dependencyManagement = newDependencyManagement;
+ boolean oldDependencyManagementESet = dependencyManagementESet;
+ dependencyManagementESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.MODEL__DEPENDENCY_MANAGEMENT,
+ oldDependencyManagement, newDependencyManagement,
+ !oldDependencyManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setDependencyManagement(
+ DependencyManagement newDependencyManagement) {
+ if (newDependencyManagement != dependencyManagement) {
+ NotificationChain msgs = null;
+ if (dependencyManagement != null)
+ msgs = ((InternalEObject) dependencyManagement).eInverseRemove(
+ this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__DEPENDENCY_MANAGEMENT,
+ null, msgs);
+ if (newDependencyManagement != null)
+ msgs = ((InternalEObject) newDependencyManagement).eInverseAdd(
+ this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__DEPENDENCY_MANAGEMENT,
+ null, msgs);
+ msgs = basicSetDependencyManagement(newDependencyManagement, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldDependencyManagementESet = dependencyManagementESet;
+ dependencyManagementESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__DEPENDENCY_MANAGEMENT,
+ newDependencyManagement, newDependencyManagement,
+ !oldDependencyManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetDependencyManagement(
+ NotificationChain msgs) {
+ DependencyManagement oldDependencyManagement = dependencyManagement;
+ dependencyManagement = null;
+ boolean oldDependencyManagementESet = dependencyManagementESet;
+ dependencyManagementESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET,
+ PomPackage.MODEL__DEPENDENCY_MANAGEMENT,
+ oldDependencyManagement, null, oldDependencyManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetDependencyManagement() {
+ if (dependencyManagement != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) dependencyManagement).eInverseRemove(
+ this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__DEPENDENCY_MANAGEMENT, null,
+ msgs);
+ msgs = basicUnsetDependencyManagement(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldDependencyManagementESet = dependencyManagementESet;
+ dependencyManagementESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.MODEL__DEPENDENCY_MANAGEMENT, null, null,
+ oldDependencyManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetDependencyManagement() {
+ return dependencyManagementESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DistributionManagement getDistributionManagement() {
+ return distributionManagement;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetDistributionManagement(
+ DistributionManagement newDistributionManagement,
+ NotificationChain msgs) {
+ DistributionManagement oldDistributionManagement = distributionManagement;
+ distributionManagement = newDistributionManagement;
+ boolean oldDistributionManagementESet = distributionManagementESet;
+ distributionManagementESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET,
+ PomPackage.MODEL__DISTRIBUTION_MANAGEMENT,
+ oldDistributionManagement, newDistributionManagement,
+ !oldDistributionManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setDistributionManagement(
+ DistributionManagement newDistributionManagement) {
+ if (newDistributionManagement != distributionManagement) {
+ NotificationChain msgs = null;
+ if (distributionManagement != null)
+ msgs = ((InternalEObject) distributionManagement)
+ .eInverseRemove(this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__DISTRIBUTION_MANAGEMENT,
+ null, msgs);
+ if (newDistributionManagement != null)
+ msgs = ((InternalEObject) newDistributionManagement)
+ .eInverseAdd(this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__DISTRIBUTION_MANAGEMENT,
+ null, msgs);
+ msgs = basicSetDistributionManagement(newDistributionManagement,
+ msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldDistributionManagementESet = distributionManagementESet;
+ distributionManagementESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.MODEL__DISTRIBUTION_MANAGEMENT,
+ newDistributionManagement, newDistributionManagement,
+ !oldDistributionManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetDistributionManagement(
+ NotificationChain msgs) {
+ DistributionManagement oldDistributionManagement = distributionManagement;
+ distributionManagement = null;
+ boolean oldDistributionManagementESet = distributionManagementESet;
+ distributionManagementESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET,
+ PomPackage.MODEL__DISTRIBUTION_MANAGEMENT,
+ oldDistributionManagement, null,
+ oldDistributionManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetDistributionManagement() {
+ if (distributionManagement != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) distributionManagement).eInverseRemove(
+ this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.MODEL__DISTRIBUTION_MANAGEMENT, null,
+ msgs);
+ msgs = basicUnsetDistributionManagement(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldDistributionManagementESet = distributionManagementESet;
+ distributionManagementESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.MODEL__DISTRIBUTION_MANAGEMENT, null, null,
+ oldDistributionManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetDistributionManagement() {
+ return distributionManagementESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<PropertyElement> getProperties() {
+ if (properties == null) {
+ properties = new EObjectContainmentEList.Unsettable<PropertyElement>(
+ PropertyElement.class, this, PomPackage.MODEL__PROPERTIES);
+ }
+ return properties;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetProperties() {
+ if (properties != null)
+ ((InternalEList.Unsettable<?>) properties).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetProperties() {
+ return properties != null
+ && ((InternalEList.Unsettable<?>) properties).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<String> getModules() {
+ if (modules == null) {
+ modules = new EDataTypeEList<String>(String.class, this,
+ PomPackage.MODEL__MODULES);
+ }
+ return modules;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.MODEL__PARENT:
+ return basicUnsetParent(msgs);
+ case PomPackage.MODEL__PREREQUISITES:
+ return basicUnsetPrerequisites(msgs);
+ case PomPackage.MODEL__ISSUE_MANAGEMENT:
+ return basicUnsetIssueManagement(msgs);
+ case PomPackage.MODEL__CI_MANAGEMENT:
+ return basicUnsetCiManagement(msgs);
+ case PomPackage.MODEL__MAILING_LISTS:
+ return ((InternalEList<?>) getMailingLists()).basicRemove(otherEnd,
+ msgs);
+ case PomPackage.MODEL__DEVELOPERS:
+ return ((InternalEList<?>) getDevelopers()).basicRemove(otherEnd,
+ msgs);
+ case PomPackage.MODEL__CONTRIBUTORS:
+ return ((InternalEList<?>) getContributors()).basicRemove(otherEnd,
+ msgs);
+ case PomPackage.MODEL__LICENSES:
+ return ((InternalEList<?>) getLicenses()).basicRemove(otherEnd,
+ msgs);
+ case PomPackage.MODEL__SCM:
+ return basicUnsetScm(msgs);
+ case PomPackage.MODEL__ORGANIZATION:
+ return basicUnsetOrganization(msgs);
+ case PomPackage.MODEL__BUILD:
+ return basicUnsetBuild(msgs);
+ case PomPackage.MODEL__PROFILES:
+ return ((InternalEList<?>) getProfiles()).basicRemove(otherEnd,
+ msgs);
+ case PomPackage.MODEL__REPOSITORIES:
+ return ((InternalEList<?>) getRepositories()).basicRemove(otherEnd,
+ msgs);
+ case PomPackage.MODEL__PLUGIN_REPOSITORIES:
+ return ((InternalEList<?>) getPluginRepositories()).basicRemove(
+ otherEnd, msgs);
+ case PomPackage.MODEL__DEPENDENCIES:
+ return ((InternalEList<?>) getDependencies()).basicRemove(otherEnd,
+ msgs);
+ case PomPackage.MODEL__REPORTING:
+ return basicUnsetReporting(msgs);
+ case PomPackage.MODEL__DEPENDENCY_MANAGEMENT:
+ return basicUnsetDependencyManagement(msgs);
+ case PomPackage.MODEL__DISTRIBUTION_MANAGEMENT:
+ return basicUnsetDistributionManagement(msgs);
+ case PomPackage.MODEL__PROPERTIES:
+ return ((InternalEList<?>) getProperties()).basicRemove(otherEnd,
+ msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.MODEL__PARENT:
+ return getParent();
+ case PomPackage.MODEL__MODEL_VERSION:
+ return getModelVersion();
+ case PomPackage.MODEL__GROUP_ID:
+ return getGroupId();
+ case PomPackage.MODEL__ARTIFACT_ID:
+ return getArtifactId();
+ case PomPackage.MODEL__PACKAGING:
+ return getPackaging();
+ case PomPackage.MODEL__NAME:
+ return getName();
+ case PomPackage.MODEL__VERSION:
+ return getVersion();
+ case PomPackage.MODEL__DESCRIPTION:
+ return getDescription();
+ case PomPackage.MODEL__URL:
+ return getUrl();
+ case PomPackage.MODEL__PREREQUISITES:
+ return getPrerequisites();
+ case PomPackage.MODEL__ISSUE_MANAGEMENT:
+ return getIssueManagement();
+ case PomPackage.MODEL__CI_MANAGEMENT:
+ return getCiManagement();
+ case PomPackage.MODEL__INCEPTION_YEAR:
+ return getInceptionYear();
+ case PomPackage.MODEL__MAILING_LISTS:
+ return getMailingLists();
+ case PomPackage.MODEL__DEVELOPERS:
+ return getDevelopers();
+ case PomPackage.MODEL__CONTRIBUTORS:
+ return getContributors();
+ case PomPackage.MODEL__LICENSES:
+ return getLicenses();
+ case PomPackage.MODEL__SCM:
+ return getScm();
+ case PomPackage.MODEL__ORGANIZATION:
+ return getOrganization();
+ case PomPackage.MODEL__BUILD:
+ return getBuild();
+ case PomPackage.MODEL__PROFILES:
+ return getProfiles();
+ case PomPackage.MODEL__REPOSITORIES:
+ return getRepositories();
+ case PomPackage.MODEL__PLUGIN_REPOSITORIES:
+ return getPluginRepositories();
+ case PomPackage.MODEL__DEPENDENCIES:
+ return getDependencies();
+ case PomPackage.MODEL__REPORTING:
+ return getReporting();
+ case PomPackage.MODEL__DEPENDENCY_MANAGEMENT:
+ return getDependencyManagement();
+ case PomPackage.MODEL__DISTRIBUTION_MANAGEMENT:
+ return getDistributionManagement();
+ case PomPackage.MODEL__PROPERTIES:
+ return getProperties();
+ case PomPackage.MODEL__MODULES:
+ return getModules();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.MODEL__PARENT:
+ setParent((Parent) newValue);
+ return;
+ case PomPackage.MODEL__MODEL_VERSION:
+ setModelVersion((String) newValue);
+ return;
+ case PomPackage.MODEL__GROUP_ID:
+ setGroupId((String) newValue);
+ return;
+ case PomPackage.MODEL__ARTIFACT_ID:
+ setArtifactId((String) newValue);
+ return;
+ case PomPackage.MODEL__PACKAGING:
+ setPackaging((String) newValue);
+ return;
+ case PomPackage.MODEL__NAME:
+ setName((String) newValue);
+ return;
+ case PomPackage.MODEL__VERSION:
+ setVersion((String) newValue);
+ return;
+ case PomPackage.MODEL__DESCRIPTION:
+ setDescription((String) newValue);
+ return;
+ case PomPackage.MODEL__URL:
+ setUrl((String) newValue);
+ return;
+ case PomPackage.MODEL__PREREQUISITES:
+ setPrerequisites((Prerequisites) newValue);
+ return;
+ case PomPackage.MODEL__ISSUE_MANAGEMENT:
+ setIssueManagement((IssueManagement) newValue);
+ return;
+ case PomPackage.MODEL__CI_MANAGEMENT:
+ setCiManagement((CiManagement) newValue);
+ return;
+ case PomPackage.MODEL__INCEPTION_YEAR:
+ setInceptionYear((String) newValue);
+ return;
+ case PomPackage.MODEL__MAILING_LISTS:
+ getMailingLists().clear();
+ getMailingLists().addAll(
+ (Collection<? extends MailingList>) newValue);
+ return;
+ case PomPackage.MODEL__DEVELOPERS:
+ getDevelopers().clear();
+ getDevelopers().addAll((Collection<? extends Developer>) newValue);
+ return;
+ case PomPackage.MODEL__CONTRIBUTORS:
+ getContributors().clear();
+ getContributors().addAll(
+ (Collection<? extends Contributor>) newValue);
+ return;
+ case PomPackage.MODEL__LICENSES:
+ getLicenses().clear();
+ getLicenses().addAll((Collection<? extends License>) newValue);
+ return;
+ case PomPackage.MODEL__SCM:
+ setScm((Scm) newValue);
+ return;
+ case PomPackage.MODEL__ORGANIZATION:
+ setOrganization((Organization) newValue);
+ return;
+ case PomPackage.MODEL__BUILD:
+ setBuild((Build) newValue);
+ return;
+ case PomPackage.MODEL__PROFILES:
+ getProfiles().clear();
+ getProfiles().addAll((Collection<? extends Profile>) newValue);
+ return;
+ case PomPackage.MODEL__REPOSITORIES:
+ getRepositories().clear();
+ getRepositories().addAll(
+ (Collection<? extends Repository>) newValue);
+ return;
+ case PomPackage.MODEL__PLUGIN_REPOSITORIES:
+ getPluginRepositories().clear();
+ getPluginRepositories().addAll(
+ (Collection<? extends Repository>) newValue);
+ return;
+ case PomPackage.MODEL__DEPENDENCIES:
+ getDependencies().clear();
+ getDependencies().addAll(
+ (Collection<? extends Dependency>) newValue);
+ return;
+ case PomPackage.MODEL__REPORTING:
+ setReporting((Reporting) newValue);
+ return;
+ case PomPackage.MODEL__DEPENDENCY_MANAGEMENT:
+ setDependencyManagement((DependencyManagement) newValue);
+ return;
+ case PomPackage.MODEL__DISTRIBUTION_MANAGEMENT:
+ setDistributionManagement((DistributionManagement) newValue);
+ return;
+ case PomPackage.MODEL__PROPERTIES:
+ getProperties().clear();
+ getProperties().addAll(
+ (Collection<? extends PropertyElement>) newValue);
+ return;
+ case PomPackage.MODEL__MODULES:
+ getModules().clear();
+ getModules().addAll((Collection<? extends String>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.MODEL__PARENT:
+ unsetParent();
+ return;
+ case PomPackage.MODEL__MODEL_VERSION:
+ setModelVersion(MODEL_VERSION_EDEFAULT);
+ return;
+ case PomPackage.MODEL__GROUP_ID:
+ setGroupId(GROUP_ID_EDEFAULT);
+ return;
+ case PomPackage.MODEL__ARTIFACT_ID:
+ setArtifactId(ARTIFACT_ID_EDEFAULT);
+ return;
+ case PomPackage.MODEL__PACKAGING:
+ unsetPackaging();
+ return;
+ case PomPackage.MODEL__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PomPackage.MODEL__VERSION:
+ setVersion(VERSION_EDEFAULT);
+ return;
+ case PomPackage.MODEL__DESCRIPTION:
+ setDescription(DESCRIPTION_EDEFAULT);
+ return;
+ case PomPackage.MODEL__URL:
+ setUrl(URL_EDEFAULT);
+ return;
+ case PomPackage.MODEL__PREREQUISITES:
+ unsetPrerequisites();
+ return;
+ case PomPackage.MODEL__ISSUE_MANAGEMENT:
+ unsetIssueManagement();
+ return;
+ case PomPackage.MODEL__CI_MANAGEMENT:
+ unsetCiManagement();
+ return;
+ case PomPackage.MODEL__INCEPTION_YEAR:
+ setInceptionYear(INCEPTION_YEAR_EDEFAULT);
+ return;
+ case PomPackage.MODEL__MAILING_LISTS:
+ unsetMailingLists();
+ return;
+ case PomPackage.MODEL__DEVELOPERS:
+ unsetDevelopers();
+ return;
+ case PomPackage.MODEL__CONTRIBUTORS:
+ unsetContributors();
+ return;
+ case PomPackage.MODEL__LICENSES:
+ getLicenses().clear();
+ return;
+ case PomPackage.MODEL__SCM:
+ unsetScm();
+ return;
+ case PomPackage.MODEL__ORGANIZATION:
+ unsetOrganization();
+ return;
+ case PomPackage.MODEL__BUILD:
+ unsetBuild();
+ return;
+ case PomPackage.MODEL__PROFILES:
+ unsetProfiles();
+ return;
+ case PomPackage.MODEL__REPOSITORIES:
+ unsetRepositories();
+ return;
+ case PomPackage.MODEL__PLUGIN_REPOSITORIES:
+ unsetPluginRepositories();
+ return;
+ case PomPackage.MODEL__DEPENDENCIES:
+ unsetDependencies();
+ return;
+ case PomPackage.MODEL__REPORTING:
+ unsetReporting();
+ return;
+ case PomPackage.MODEL__DEPENDENCY_MANAGEMENT:
+ unsetDependencyManagement();
+ return;
+ case PomPackage.MODEL__DISTRIBUTION_MANAGEMENT:
+ unsetDistributionManagement();
+ return;
+ case PomPackage.MODEL__PROPERTIES:
+ unsetProperties();
+ return;
+ case PomPackage.MODEL__MODULES:
+ getModules().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.MODEL__PARENT:
+ return isSetParent();
+ case PomPackage.MODEL__MODEL_VERSION:
+ return MODEL_VERSION_EDEFAULT == null ? modelVersion != null
+ : !MODEL_VERSION_EDEFAULT.equals(modelVersion);
+ case PomPackage.MODEL__GROUP_ID:
+ return GROUP_ID_EDEFAULT == null ? groupId != null
+ : !GROUP_ID_EDEFAULT.equals(groupId);
+ case PomPackage.MODEL__ARTIFACT_ID:
+ return ARTIFACT_ID_EDEFAULT == null ? artifactId != null
+ : !ARTIFACT_ID_EDEFAULT.equals(artifactId);
+ case PomPackage.MODEL__PACKAGING:
+ return isSetPackaging();
+ case PomPackage.MODEL__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT
+ .equals(name);
+ case PomPackage.MODEL__VERSION:
+ return VERSION_EDEFAULT == null ? version != null
+ : !VERSION_EDEFAULT.equals(version);
+ case PomPackage.MODEL__DESCRIPTION:
+ return DESCRIPTION_EDEFAULT == null ? description != null
+ : !DESCRIPTION_EDEFAULT.equals(description);
+ case PomPackage.MODEL__URL:
+ return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT
+ .equals(url);
+ case PomPackage.MODEL__PREREQUISITES:
+ return isSetPrerequisites();
+ case PomPackage.MODEL__ISSUE_MANAGEMENT:
+ return isSetIssueManagement();
+ case PomPackage.MODEL__CI_MANAGEMENT:
+ return isSetCiManagement();
+ case PomPackage.MODEL__INCEPTION_YEAR:
+ return INCEPTION_YEAR_EDEFAULT == null ? inceptionYear != null
+ : !INCEPTION_YEAR_EDEFAULT.equals(inceptionYear);
+ case PomPackage.MODEL__MAILING_LISTS:
+ return isSetMailingLists();
+ case PomPackage.MODEL__DEVELOPERS:
+ return isSetDevelopers();
+ case PomPackage.MODEL__CONTRIBUTORS:
+ return isSetContributors();
+ case PomPackage.MODEL__LICENSES:
+ return licenses != null && !licenses.isEmpty();
+ case PomPackage.MODEL__SCM:
+ return isSetScm();
+ case PomPackage.MODEL__ORGANIZATION:
+ return isSetOrganization();
+ case PomPackage.MODEL__BUILD:
+ return isSetBuild();
+ case PomPackage.MODEL__PROFILES:
+ return isSetProfiles();
+ case PomPackage.MODEL__REPOSITORIES:
+ return isSetRepositories();
+ case PomPackage.MODEL__PLUGIN_REPOSITORIES:
+ return isSetPluginRepositories();
+ case PomPackage.MODEL__DEPENDENCIES:
+ return isSetDependencies();
+ case PomPackage.MODEL__REPORTING:
+ return isSetReporting();
+ case PomPackage.MODEL__DEPENDENCY_MANAGEMENT:
+ return isSetDependencyManagement();
+ case PomPackage.MODEL__DISTRIBUTION_MANAGEMENT:
+ return isSetDistributionManagement();
+ case PomPackage.MODEL__PROPERTIES:
+ return isSetProperties();
+ case PomPackage.MODEL__MODULES:
+ return modules != null && !modules.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (modelVersion: "); //$NON-NLS-1$
+ result.append(modelVersion);
+ result.append(", groupId: "); //$NON-NLS-1$
+ result.append(groupId);
+ result.append(", artifactId: "); //$NON-NLS-1$
+ result.append(artifactId);
+ result.append(", packaging: "); //$NON-NLS-1$
+ if (packagingESet)
+ result.append(packaging);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(", version: "); //$NON-NLS-1$
+ result.append(version);
+ result.append(", description: "); //$NON-NLS-1$
+ result.append(description);
+ result.append(", url: "); //$NON-NLS-1$
+ result.append(url);
+ result.append(", inceptionYear: "); //$NON-NLS-1$
+ result.append(inceptionYear);
+ result.append(", modules: "); //$NON-NLS-1$
+ result.append(modules);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ModelImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/NotifierImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/NotifierImpl.java
new file mode 100644
index 00000000..d4333ace
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/NotifierImpl.java
@@ -0,0 +1,747 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.Notifier;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Notifier</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.NotifierImpl#getType <em>Type
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.NotifierImpl#getSendOnError <em>
+ * Send On Error</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.NotifierImpl#getSendOnFailure
+ * <em>Send On Failure</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.NotifierImpl#getSendOnSuccess
+ * <em>Send On Success</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.NotifierImpl#getSendOnWarning
+ * <em>Send On Warning</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.NotifierImpl#getAddress <em>
+ * Address</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.NotifierImpl#getConfiguration
+ * <em>Configuration</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class NotifierImpl extends EObjectImpl implements Notifier {
+ /**
+ * The default value of the '{@link #getType() <em>Type</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected static final String TYPE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected String type = TYPE_EDEFAULT;
+
+ /**
+ * This is true if the Type attribute has been set. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean typeESet;
+
+ /**
+ * The default value of the '{@link #getSendOnError()
+ * <em>Send On Error</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getSendOnError()
+ * @generated
+ * @ordered
+ */
+ protected static final String SEND_ON_ERROR_EDEFAULT = "true"; //$NON-NLS-1$
+
+ /**
+ * The cached value of the '{@link #getSendOnError() <em>Send On Error</em>}
+ * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getSendOnError()
+ * @generated
+ * @ordered
+ */
+ protected String sendOnError = SEND_ON_ERROR_EDEFAULT;
+
+ /**
+ * This is true if the Send On Error attribute has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean sendOnErrorESet;
+
+ /**
+ * The default value of the '{@link #getSendOnFailure()
+ * <em>Send On Failure</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getSendOnFailure()
+ * @generated
+ * @ordered
+ */
+ protected static final String SEND_ON_FAILURE_EDEFAULT = "true"; //$NON-NLS-1$
+
+ /**
+ * The cached value of the '{@link #getSendOnFailure()
+ * <em>Send On Failure</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getSendOnFailure()
+ * @generated
+ * @ordered
+ */
+ protected String sendOnFailure = SEND_ON_FAILURE_EDEFAULT;
+
+ /**
+ * This is true if the Send On Failure attribute has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean sendOnFailureESet;
+
+ /**
+ * The default value of the '{@link #getSendOnSuccess()
+ * <em>Send On Success</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getSendOnSuccess()
+ * @generated
+ * @ordered
+ */
+ protected static final String SEND_ON_SUCCESS_EDEFAULT = "true"; //$NON-NLS-1$
+
+ /**
+ * The cached value of the '{@link #getSendOnSuccess()
+ * <em>Send On Success</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getSendOnSuccess()
+ * @generated
+ * @ordered
+ */
+ protected String sendOnSuccess = SEND_ON_SUCCESS_EDEFAULT;
+
+ /**
+ * This is true if the Send On Success attribute has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean sendOnSuccessESet;
+
+ /**
+ * The default value of the '{@link #getSendOnWarning()
+ * <em>Send On Warning</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getSendOnWarning()
+ * @generated
+ * @ordered
+ */
+ protected static final String SEND_ON_WARNING_EDEFAULT = "true"; //$NON-NLS-1$
+
+ /**
+ * The cached value of the '{@link #getSendOnWarning()
+ * <em>Send On Warning</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getSendOnWarning()
+ * @generated
+ * @ordered
+ */
+ protected String sendOnWarning = SEND_ON_WARNING_EDEFAULT;
+
+ /**
+ * This is true if the Send On Warning attribute has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean sendOnWarningESet;
+
+ /**
+ * The default value of the '{@link #getAddress() <em>Address</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getAddress()
+ * @generated
+ * @ordered
+ */
+ protected static final String ADDRESS_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getAddress() <em>Address</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getAddress()
+ * @generated
+ * @ordered
+ */
+ protected String address = ADDRESS_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getConfiguration()
+ * <em>Configuration</em>}' containment reference list. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @see #getConfiguration()
+ * @generated
+ * @ordered
+ */
+ protected EList<PropertyElement> configuration;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected NotifierImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.NOTIFIER;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setType(String newType) {
+ String oldType = type;
+ type = newType;
+ boolean oldTypeESet = typeESet;
+ typeESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.NOTIFIER__TYPE, oldType, type, !oldTypeESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetType() {
+ String oldType = type;
+ boolean oldTypeESet = typeESet;
+ type = TYPE_EDEFAULT;
+ typeESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.NOTIFIER__TYPE, oldType, TYPE_EDEFAULT,
+ oldTypeESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetType() {
+ return typeESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getSendOnError() {
+ return sendOnError;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSendOnError(String newSendOnError) {
+ String oldSendOnError = sendOnError;
+ sendOnError = newSendOnError;
+ boolean oldSendOnErrorESet = sendOnErrorESet;
+ sendOnErrorESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.NOTIFIER__SEND_ON_ERROR, oldSendOnError,
+ sendOnError, !oldSendOnErrorESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetSendOnError() {
+ String oldSendOnError = sendOnError;
+ boolean oldSendOnErrorESet = sendOnErrorESet;
+ sendOnError = SEND_ON_ERROR_EDEFAULT;
+ sendOnErrorESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.NOTIFIER__SEND_ON_ERROR, oldSendOnError,
+ SEND_ON_ERROR_EDEFAULT, oldSendOnErrorESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetSendOnError() {
+ return sendOnErrorESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getSendOnFailure() {
+ return sendOnFailure;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSendOnFailure(String newSendOnFailure) {
+ String oldSendOnFailure = sendOnFailure;
+ sendOnFailure = newSendOnFailure;
+ boolean oldSendOnFailureESet = sendOnFailureESet;
+ sendOnFailureESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.NOTIFIER__SEND_ON_FAILURE, oldSendOnFailure,
+ sendOnFailure, !oldSendOnFailureESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetSendOnFailure() {
+ String oldSendOnFailure = sendOnFailure;
+ boolean oldSendOnFailureESet = sendOnFailureESet;
+ sendOnFailure = SEND_ON_FAILURE_EDEFAULT;
+ sendOnFailureESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.NOTIFIER__SEND_ON_FAILURE, oldSendOnFailure,
+ SEND_ON_FAILURE_EDEFAULT, oldSendOnFailureESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetSendOnFailure() {
+ return sendOnFailureESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getSendOnSuccess() {
+ return sendOnSuccess;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSendOnSuccess(String newSendOnSuccess) {
+ String oldSendOnSuccess = sendOnSuccess;
+ sendOnSuccess = newSendOnSuccess;
+ boolean oldSendOnSuccessESet = sendOnSuccessESet;
+ sendOnSuccessESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.NOTIFIER__SEND_ON_SUCCESS, oldSendOnSuccess,
+ sendOnSuccess, !oldSendOnSuccessESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetSendOnSuccess() {
+ String oldSendOnSuccess = sendOnSuccess;
+ boolean oldSendOnSuccessESet = sendOnSuccessESet;
+ sendOnSuccess = SEND_ON_SUCCESS_EDEFAULT;
+ sendOnSuccessESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.NOTIFIER__SEND_ON_SUCCESS, oldSendOnSuccess,
+ SEND_ON_SUCCESS_EDEFAULT, oldSendOnSuccessESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetSendOnSuccess() {
+ return sendOnSuccessESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getSendOnWarning() {
+ return sendOnWarning;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSendOnWarning(String newSendOnWarning) {
+ String oldSendOnWarning = sendOnWarning;
+ sendOnWarning = newSendOnWarning;
+ boolean oldSendOnWarningESet = sendOnWarningESet;
+ sendOnWarningESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.NOTIFIER__SEND_ON_WARNING, oldSendOnWarning,
+ sendOnWarning, !oldSendOnWarningESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetSendOnWarning() {
+ String oldSendOnWarning = sendOnWarning;
+ boolean oldSendOnWarningESet = sendOnWarningESet;
+ sendOnWarning = SEND_ON_WARNING_EDEFAULT;
+ sendOnWarningESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.NOTIFIER__SEND_ON_WARNING, oldSendOnWarning,
+ SEND_ON_WARNING_EDEFAULT, oldSendOnWarningESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetSendOnWarning() {
+ return sendOnWarningESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getAddress() {
+ return address;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setAddress(String newAddress) {
+ String oldAddress = address;
+ address = newAddress;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.NOTIFIER__ADDRESS, oldAddress, address));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<PropertyElement> getConfiguration() {
+ if (configuration == null) {
+ configuration = new EObjectContainmentEList.Unsettable<PropertyElement>(
+ PropertyElement.class, this,
+ PomPackage.NOTIFIER__CONFIGURATION);
+ }
+ return configuration;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetConfiguration() {
+ if (configuration != null)
+ ((InternalEList.Unsettable<?>) configuration).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetConfiguration() {
+ return configuration != null
+ && ((InternalEList.Unsettable<?>) configuration).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.NOTIFIER__CONFIGURATION:
+ return ((InternalEList<?>) getConfiguration()).basicRemove(
+ otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.NOTIFIER__TYPE:
+ return getType();
+ case PomPackage.NOTIFIER__SEND_ON_ERROR:
+ return getSendOnError();
+ case PomPackage.NOTIFIER__SEND_ON_FAILURE:
+ return getSendOnFailure();
+ case PomPackage.NOTIFIER__SEND_ON_SUCCESS:
+ return getSendOnSuccess();
+ case PomPackage.NOTIFIER__SEND_ON_WARNING:
+ return getSendOnWarning();
+ case PomPackage.NOTIFIER__ADDRESS:
+ return getAddress();
+ case PomPackage.NOTIFIER__CONFIGURATION:
+ return getConfiguration();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.NOTIFIER__TYPE:
+ setType((String) newValue);
+ return;
+ case PomPackage.NOTIFIER__SEND_ON_ERROR:
+ setSendOnError((String) newValue);
+ return;
+ case PomPackage.NOTIFIER__SEND_ON_FAILURE:
+ setSendOnFailure((String) newValue);
+ return;
+ case PomPackage.NOTIFIER__SEND_ON_SUCCESS:
+ setSendOnSuccess((String) newValue);
+ return;
+ case PomPackage.NOTIFIER__SEND_ON_WARNING:
+ setSendOnWarning((String) newValue);
+ return;
+ case PomPackage.NOTIFIER__ADDRESS:
+ setAddress((String) newValue);
+ return;
+ case PomPackage.NOTIFIER__CONFIGURATION:
+ getConfiguration().clear();
+ getConfiguration().addAll(
+ (Collection<? extends PropertyElement>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.NOTIFIER__TYPE:
+ unsetType();
+ return;
+ case PomPackage.NOTIFIER__SEND_ON_ERROR:
+ unsetSendOnError();
+ return;
+ case PomPackage.NOTIFIER__SEND_ON_FAILURE:
+ unsetSendOnFailure();
+ return;
+ case PomPackage.NOTIFIER__SEND_ON_SUCCESS:
+ unsetSendOnSuccess();
+ return;
+ case PomPackage.NOTIFIER__SEND_ON_WARNING:
+ unsetSendOnWarning();
+ return;
+ case PomPackage.NOTIFIER__ADDRESS:
+ setAddress(ADDRESS_EDEFAULT);
+ return;
+ case PomPackage.NOTIFIER__CONFIGURATION:
+ unsetConfiguration();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.NOTIFIER__TYPE:
+ return isSetType();
+ case PomPackage.NOTIFIER__SEND_ON_ERROR:
+ return isSetSendOnError();
+ case PomPackage.NOTIFIER__SEND_ON_FAILURE:
+ return isSetSendOnFailure();
+ case PomPackage.NOTIFIER__SEND_ON_SUCCESS:
+ return isSetSendOnSuccess();
+ case PomPackage.NOTIFIER__SEND_ON_WARNING:
+ return isSetSendOnWarning();
+ case PomPackage.NOTIFIER__ADDRESS:
+ return ADDRESS_EDEFAULT == null ? address != null
+ : !ADDRESS_EDEFAULT.equals(address);
+ case PomPackage.NOTIFIER__CONFIGURATION:
+ return isSetConfiguration();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (type: "); //$NON-NLS-1$
+ if (typeESet)
+ result.append(type);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", sendOnError: "); //$NON-NLS-1$
+ if (sendOnErrorESet)
+ result.append(sendOnError);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", sendOnFailure: "); //$NON-NLS-1$
+ if (sendOnFailureESet)
+ result.append(sendOnFailure);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", sendOnSuccess: "); //$NON-NLS-1$
+ if (sendOnSuccessESet)
+ result.append(sendOnSuccess);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", sendOnWarning: "); //$NON-NLS-1$
+ if (sendOnWarningESet)
+ result.append(sendOnWarning);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", address: "); //$NON-NLS-1$
+ result.append(address);
+ result.append(')');
+ return result.toString();
+ }
+
+} // NotifierImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/OrganizationImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/OrganizationImpl.java
new file mode 100644
index 00000000..869cb7cc
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/OrganizationImpl.java
@@ -0,0 +1,232 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.Organization;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Organization</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.OrganizationImpl#getName <em>
+ * Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.OrganizationImpl#getUrl <em>Url
+ * </em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class OrganizationImpl extends EObjectImpl implements Organization {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected String url = URL_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected OrganizationImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.ORGANIZATION;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ORGANIZATION__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUrl(String newUrl) {
+ String oldUrl = url;
+ url = newUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.ORGANIZATION__URL, oldUrl, url));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.ORGANIZATION__NAME:
+ return getName();
+ case PomPackage.ORGANIZATION__URL:
+ return getUrl();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.ORGANIZATION__NAME:
+ setName((String) newValue);
+ return;
+ case PomPackage.ORGANIZATION__URL:
+ setUrl((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.ORGANIZATION__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PomPackage.ORGANIZATION__URL:
+ setUrl(URL_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.ORGANIZATION__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT
+ .equals(name);
+ case PomPackage.ORGANIZATION__URL:
+ return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT
+ .equals(url);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(", url: "); //$NON-NLS-1$
+ result.append(url);
+ result.append(')');
+ return result.toString();
+ }
+
+} // OrganizationImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ParentImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ParentImpl.java
new file mode 100644
index 00000000..c98b1228
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ParentImpl.java
@@ -0,0 +1,349 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.Parent;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Parent</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ParentImpl#getArtifactId <em>
+ * Artifact Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ParentImpl#getGroupId <em>Group
+ * Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ParentImpl#getVersion <em>
+ * Version</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ParentImpl#getRelativePath <em>
+ * Relative Path</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ParentImpl extends EObjectImpl implements Parent {
+ /**
+ * The default value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ARTIFACT_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected String artifactId = ARTIFACT_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected static final String GROUP_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected String groupId = GROUP_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected static final String VERSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected String version = VERSION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getRelativePath()
+ * <em>Relative Path</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getRelativePath()
+ * @generated
+ * @ordered
+ */
+ protected static final String RELATIVE_PATH_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getRelativePath()
+ * <em>Relative Path</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getRelativePath()
+ * @generated
+ * @ordered
+ */
+ protected String relativePath = RELATIVE_PATH_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ParentImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.PARENT;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setArtifactId(String newArtifactId) {
+ String oldArtifactId = artifactId;
+ artifactId = newArtifactId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PARENT__ARTIFACT_ID, oldArtifactId, artifactId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getGroupId() {
+ return groupId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setGroupId(String newGroupId) {
+ String oldGroupId = groupId;
+ groupId = newGroupId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PARENT__GROUP_ID, oldGroupId, groupId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setVersion(String newVersion) {
+ String oldVersion = version;
+ version = newVersion;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PARENT__VERSION, oldVersion, version));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getRelativePath() {
+ return relativePath;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setRelativePath(String newRelativePath) {
+ String oldRelativePath = relativePath;
+ relativePath = newRelativePath;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PARENT__RELATIVE_PATH, oldRelativePath,
+ relativePath));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.PARENT__ARTIFACT_ID:
+ return getArtifactId();
+ case PomPackage.PARENT__GROUP_ID:
+ return getGroupId();
+ case PomPackage.PARENT__VERSION:
+ return getVersion();
+ case PomPackage.PARENT__RELATIVE_PATH:
+ return getRelativePath();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.PARENT__ARTIFACT_ID:
+ setArtifactId((String) newValue);
+ return;
+ case PomPackage.PARENT__GROUP_ID:
+ setGroupId((String) newValue);
+ return;
+ case PomPackage.PARENT__VERSION:
+ setVersion((String) newValue);
+ return;
+ case PomPackage.PARENT__RELATIVE_PATH:
+ setRelativePath((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.PARENT__ARTIFACT_ID:
+ setArtifactId(ARTIFACT_ID_EDEFAULT);
+ return;
+ case PomPackage.PARENT__GROUP_ID:
+ setGroupId(GROUP_ID_EDEFAULT);
+ return;
+ case PomPackage.PARENT__VERSION:
+ setVersion(VERSION_EDEFAULT);
+ return;
+ case PomPackage.PARENT__RELATIVE_PATH:
+ setRelativePath(RELATIVE_PATH_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.PARENT__ARTIFACT_ID:
+ return ARTIFACT_ID_EDEFAULT == null ? artifactId != null
+ : !ARTIFACT_ID_EDEFAULT.equals(artifactId);
+ case PomPackage.PARENT__GROUP_ID:
+ return GROUP_ID_EDEFAULT == null ? groupId != null
+ : !GROUP_ID_EDEFAULT.equals(groupId);
+ case PomPackage.PARENT__VERSION:
+ return VERSION_EDEFAULT == null ? version != null
+ : !VERSION_EDEFAULT.equals(version);
+ case PomPackage.PARENT__RELATIVE_PATH:
+ return RELATIVE_PATH_EDEFAULT == null ? relativePath != null
+ : !RELATIVE_PATH_EDEFAULT.equals(relativePath);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (artifactId: "); //$NON-NLS-1$
+ result.append(artifactId);
+ result.append(", groupId: "); //$NON-NLS-1$
+ result.append(groupId);
+ result.append(", version: "); //$NON-NLS-1$
+ result.append(version);
+ result.append(", relativePath: "); //$NON-NLS-1$
+ result.append(relativePath);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ParentImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginExecutionImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginExecutionImpl.java
new file mode 100644
index 00000000..0574148b
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginExecutionImpl.java
@@ -0,0 +1,444 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EDataTypeEList;
+import org.eclipse.m2e.model.edit.pom.Configuration;
+import org.eclipse.m2e.model.edit.pom.PluginExecution;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Plugin Execution</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PluginExecutionImpl#getId <em>Id
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PluginExecutionImpl#getPhase
+ * <em>Phase</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.PluginExecutionImpl#getInherited
+ * <em>Inherited</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PluginExecutionImpl#getGoals
+ * <em>Goals</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.PluginExecutionImpl#getConfiguration
+ * <em>Configuration</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class PluginExecutionImpl extends EObjectImpl implements PluginExecution {
+ /**
+ * The default value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected String id = ID_EDEFAULT;
+
+ /**
+ * This is true if the Id attribute has been set. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean idESet;
+
+ /**
+ * The default value of the '{@link #getPhase() <em>Phase</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getPhase()
+ * @generated
+ * @ordered
+ */
+ protected static final String PHASE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getPhase() <em>Phase</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getPhase()
+ * @generated
+ * @ordered
+ */
+ protected String phase = PHASE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getInherited() <em>Inherited</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getInherited()
+ * @generated
+ * @ordered
+ */
+ protected static final String INHERITED_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getInherited() <em>Inherited</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getInherited()
+ * @generated
+ * @ordered
+ */
+ protected String inherited = INHERITED_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getGoals() <em>Goals</em>}' attribute
+ * list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGoals()
+ * @generated
+ * @ordered
+ */
+ protected EList<String> goals;
+
+ /**
+ * The cached value of the '{@link #getConfiguration()
+ * <em>Configuration</em>}' reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getConfiguration()
+ * @generated
+ * @ordered
+ */
+ protected Configuration configuration;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PluginExecutionImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.PLUGIN_EXECUTION;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setId(String newId) {
+ String oldId = id;
+ id = newId;
+ boolean oldIdESet = idESet;
+ idESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PLUGIN_EXECUTION__ID, oldId, id, !oldIdESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetId() {
+ String oldId = id;
+ boolean oldIdESet = idESet;
+ id = ID_EDEFAULT;
+ idESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.PLUGIN_EXECUTION__ID, oldId, ID_EDEFAULT,
+ oldIdESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetId() {
+ return idESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getPhase() {
+ return phase;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setPhase(String newPhase) {
+ String oldPhase = phase;
+ phase = newPhase;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PLUGIN_EXECUTION__PHASE, oldPhase, phase));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getInherited() {
+ return inherited;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setInherited(String newInherited) {
+ String oldInherited = inherited;
+ inherited = newInherited;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PLUGIN_EXECUTION__INHERITED, oldInherited,
+ inherited));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<String> getGoals() {
+ if (goals == null) {
+ goals = new EDataTypeEList<String>(String.class, this,
+ PomPackage.PLUGIN_EXECUTION__GOALS);
+ }
+ return goals;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Configuration getConfiguration() {
+ if (configuration != null && configuration.eIsProxy()) {
+ InternalEObject oldConfiguration = (InternalEObject) configuration;
+ configuration = (Configuration) eResolveProxy(oldConfiguration);
+ if (configuration != oldConfiguration) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE,
+ PomPackage.PLUGIN_EXECUTION__CONFIGURATION,
+ oldConfiguration, configuration));
+ }
+ }
+ return configuration;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Configuration basicGetConfiguration() {
+ return configuration;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setConfiguration(Configuration newConfiguration) {
+ Configuration oldConfiguration = configuration;
+ configuration = newConfiguration;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PLUGIN_EXECUTION__CONFIGURATION,
+ oldConfiguration, configuration));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.PLUGIN_EXECUTION__ID:
+ return getId();
+ case PomPackage.PLUGIN_EXECUTION__PHASE:
+ return getPhase();
+ case PomPackage.PLUGIN_EXECUTION__INHERITED:
+ return getInherited();
+ case PomPackage.PLUGIN_EXECUTION__GOALS:
+ return getGoals();
+ case PomPackage.PLUGIN_EXECUTION__CONFIGURATION:
+ if (resolve)
+ return getConfiguration();
+ return basicGetConfiguration();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.PLUGIN_EXECUTION__ID:
+ setId((String) newValue);
+ return;
+ case PomPackage.PLUGIN_EXECUTION__PHASE:
+ setPhase((String) newValue);
+ return;
+ case PomPackage.PLUGIN_EXECUTION__INHERITED:
+ setInherited((String) newValue);
+ return;
+ case PomPackage.PLUGIN_EXECUTION__GOALS:
+ getGoals().clear();
+ getGoals().addAll((Collection<? extends String>) newValue);
+ return;
+ case PomPackage.PLUGIN_EXECUTION__CONFIGURATION:
+ setConfiguration((Configuration) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.PLUGIN_EXECUTION__ID:
+ unsetId();
+ return;
+ case PomPackage.PLUGIN_EXECUTION__PHASE:
+ setPhase(PHASE_EDEFAULT);
+ return;
+ case PomPackage.PLUGIN_EXECUTION__INHERITED:
+ setInherited(INHERITED_EDEFAULT);
+ return;
+ case PomPackage.PLUGIN_EXECUTION__GOALS:
+ getGoals().clear();
+ return;
+ case PomPackage.PLUGIN_EXECUTION__CONFIGURATION:
+ setConfiguration((Configuration) null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.PLUGIN_EXECUTION__ID:
+ return isSetId();
+ case PomPackage.PLUGIN_EXECUTION__PHASE:
+ return PHASE_EDEFAULT == null ? phase != null : !PHASE_EDEFAULT
+ .equals(phase);
+ case PomPackage.PLUGIN_EXECUTION__INHERITED:
+ return INHERITED_EDEFAULT == null ? inherited != null
+ : !INHERITED_EDEFAULT.equals(inherited);
+ case PomPackage.PLUGIN_EXECUTION__GOALS:
+ return goals != null && !goals.isEmpty();
+ case PomPackage.PLUGIN_EXECUTION__CONFIGURATION:
+ return configuration != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (id: "); //$NON-NLS-1$
+ if (idESet)
+ result.append(id);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", phase: "); //$NON-NLS-1$
+ result.append(phase);
+ result.append(", inherited: "); //$NON-NLS-1$
+ result.append(inherited);
+ result.append(", goals: "); //$NON-NLS-1$
+ result.append(goals);
+ result.append(')');
+ return result.toString();
+ }
+
+} // PluginExecutionImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginImpl.java
new file mode 100644
index 00000000..5f1143a8
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginImpl.java
@@ -0,0 +1,695 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.Configuration;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.Plugin;
+import org.eclipse.m2e.model.edit.pom.PluginExecution;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Plugin</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PluginImpl#getGroupId <em>Group
+ * Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PluginImpl#getArtifactId <em>
+ * Artifact Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PluginImpl#getVersion <em>
+ * Version</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PluginImpl#getExtensions <em>
+ * Extensions</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PluginImpl#getExecutions <em>
+ * Executions</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PluginImpl#getDependencies <em>
+ * Dependencies</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PluginImpl#getInherited <em>
+ * Inherited</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PluginImpl#getConfiguration <em>
+ * Configuration</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class PluginImpl extends EObjectImpl implements Plugin {
+ /**
+ * The default value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected static final String GROUP_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected String groupId = GROUP_ID_EDEFAULT;
+
+ /**
+ * This is true if the Group Id attribute has been set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean groupIdESet;
+
+ /**
+ * The default value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ARTIFACT_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected String artifactId = ARTIFACT_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected static final String VERSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected String version = VERSION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getExtensions() <em>Extensions</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getExtensions()
+ * @generated
+ * @ordered
+ */
+ protected static final String EXTENSIONS_EDEFAULT = "false"; //$NON-NLS-1$
+
+ /**
+ * The cached value of the '{@link #getExtensions() <em>Extensions</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getExtensions()
+ * @generated
+ * @ordered
+ */
+ protected String extensions = EXTENSIONS_EDEFAULT;
+
+ /**
+ * This is true if the Extensions attribute has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean extensionsESet;
+
+ /**
+ * The cached value of the '{@link #getExecutions() <em>Executions</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getExecutions()
+ * @generated
+ * @ordered
+ */
+ protected EList<PluginExecution> executions;
+
+ /**
+ * The cached value of the '{@link #getDependencies() <em>Dependencies</em>}
+ * ' containment reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #getDependencies()
+ * @generated
+ * @ordered
+ */
+ protected EList<Dependency> dependencies;
+
+ /**
+ * The default value of the '{@link #getInherited() <em>Inherited</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getInherited()
+ * @generated
+ * @ordered
+ */
+ protected static final String INHERITED_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getInherited() <em>Inherited</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getInherited()
+ * @generated
+ * @ordered
+ */
+ protected String inherited = INHERITED_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getConfiguration()
+ * <em>Configuration</em>}' reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getConfiguration()
+ * @generated
+ * @ordered
+ */
+ protected Configuration configuration;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PluginImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.PLUGIN;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getGroupId() {
+ return groupId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setGroupId(String newGroupId) {
+ String oldGroupId = groupId;
+ groupId = newGroupId;
+ boolean oldGroupIdESet = groupIdESet;
+ groupIdESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PLUGIN__GROUP_ID, oldGroupId, groupId,
+ !oldGroupIdESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetGroupId() {
+ String oldGroupId = groupId;
+ boolean oldGroupIdESet = groupIdESet;
+ groupId = GROUP_ID_EDEFAULT;
+ groupIdESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.PLUGIN__GROUP_ID, oldGroupId, GROUP_ID_EDEFAULT,
+ oldGroupIdESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetGroupId() {
+ return groupIdESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setArtifactId(String newArtifactId) {
+ String oldArtifactId = artifactId;
+ artifactId = newArtifactId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PLUGIN__ARTIFACT_ID, oldArtifactId, artifactId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setVersion(String newVersion) {
+ String oldVersion = version;
+ version = newVersion;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PLUGIN__VERSION, oldVersion, version));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getExtensions() {
+ return extensions;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setExtensions(String newExtensions) {
+ String oldExtensions = extensions;
+ extensions = newExtensions;
+ boolean oldExtensionsESet = extensionsESet;
+ extensionsESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PLUGIN__EXTENSIONS, oldExtensions, extensions,
+ !oldExtensionsESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetExtensions() {
+ String oldExtensions = extensions;
+ boolean oldExtensionsESet = extensionsESet;
+ extensions = EXTENSIONS_EDEFAULT;
+ extensionsESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.PLUGIN__EXTENSIONS, oldExtensions,
+ EXTENSIONS_EDEFAULT, oldExtensionsESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetExtensions() {
+ return extensionsESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<PluginExecution> getExecutions() {
+ if (executions == null) {
+ executions = new EObjectContainmentEList.Unsettable<PluginExecution>(
+ PluginExecution.class, this, PomPackage.PLUGIN__EXECUTIONS);
+ }
+ return executions;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetExecutions() {
+ if (executions != null)
+ ((InternalEList.Unsettable<?>) executions).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetExecutions() {
+ return executions != null
+ && ((InternalEList.Unsettable<?>) executions).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Dependency> getDependencies() {
+ if (dependencies == null) {
+ dependencies = new EObjectContainmentEList.Unsettable<Dependency>(
+ Dependency.class, this, PomPackage.PLUGIN__DEPENDENCIES);
+ }
+ return dependencies;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetDependencies() {
+ if (dependencies != null)
+ ((InternalEList.Unsettable<?>) dependencies).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetDependencies() {
+ return dependencies != null
+ && ((InternalEList.Unsettable<?>) dependencies).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getInherited() {
+ return inherited;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setInherited(String newInherited) {
+ String oldInherited = inherited;
+ inherited = newInherited;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PLUGIN__INHERITED, oldInherited, inherited));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Configuration getConfiguration() {
+ if (configuration != null && configuration.eIsProxy()) {
+ InternalEObject oldConfiguration = (InternalEObject) configuration;
+ configuration = (Configuration) eResolveProxy(oldConfiguration);
+ if (configuration != oldConfiguration) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE,
+ PomPackage.PLUGIN__CONFIGURATION, oldConfiguration,
+ configuration));
+ }
+ }
+ return configuration;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Configuration basicGetConfiguration() {
+ return configuration;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setConfiguration(Configuration newConfiguration) {
+ Configuration oldConfiguration = configuration;
+ configuration = newConfiguration;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PLUGIN__CONFIGURATION, oldConfiguration,
+ configuration));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.PLUGIN__EXECUTIONS:
+ return ((InternalEList<?>) getExecutions()).basicRemove(otherEnd,
+ msgs);
+ case PomPackage.PLUGIN__DEPENDENCIES:
+ return ((InternalEList<?>) getDependencies()).basicRemove(otherEnd,
+ msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.PLUGIN__GROUP_ID:
+ return getGroupId();
+ case PomPackage.PLUGIN__ARTIFACT_ID:
+ return getArtifactId();
+ case PomPackage.PLUGIN__VERSION:
+ return getVersion();
+ case PomPackage.PLUGIN__EXTENSIONS:
+ return getExtensions();
+ case PomPackage.PLUGIN__EXECUTIONS:
+ return getExecutions();
+ case PomPackage.PLUGIN__DEPENDENCIES:
+ return getDependencies();
+ case PomPackage.PLUGIN__INHERITED:
+ return getInherited();
+ case PomPackage.PLUGIN__CONFIGURATION:
+ if (resolve)
+ return getConfiguration();
+ return basicGetConfiguration();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.PLUGIN__GROUP_ID:
+ setGroupId((String) newValue);
+ return;
+ case PomPackage.PLUGIN__ARTIFACT_ID:
+ setArtifactId((String) newValue);
+ return;
+ case PomPackage.PLUGIN__VERSION:
+ setVersion((String) newValue);
+ return;
+ case PomPackage.PLUGIN__EXTENSIONS:
+ setExtensions((String) newValue);
+ return;
+ case PomPackage.PLUGIN__EXECUTIONS:
+ getExecutions().clear();
+ getExecutions().addAll(
+ (Collection<? extends PluginExecution>) newValue);
+ return;
+ case PomPackage.PLUGIN__DEPENDENCIES:
+ getDependencies().clear();
+ getDependencies().addAll(
+ (Collection<? extends Dependency>) newValue);
+ return;
+ case PomPackage.PLUGIN__INHERITED:
+ setInherited((String) newValue);
+ return;
+ case PomPackage.PLUGIN__CONFIGURATION:
+ setConfiguration((Configuration) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.PLUGIN__GROUP_ID:
+ unsetGroupId();
+ return;
+ case PomPackage.PLUGIN__ARTIFACT_ID:
+ setArtifactId(ARTIFACT_ID_EDEFAULT);
+ return;
+ case PomPackage.PLUGIN__VERSION:
+ setVersion(VERSION_EDEFAULT);
+ return;
+ case PomPackage.PLUGIN__EXTENSIONS:
+ unsetExtensions();
+ return;
+ case PomPackage.PLUGIN__EXECUTIONS:
+ unsetExecutions();
+ return;
+ case PomPackage.PLUGIN__DEPENDENCIES:
+ unsetDependencies();
+ return;
+ case PomPackage.PLUGIN__INHERITED:
+ setInherited(INHERITED_EDEFAULT);
+ return;
+ case PomPackage.PLUGIN__CONFIGURATION:
+ setConfiguration((Configuration) null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.PLUGIN__GROUP_ID:
+ return isSetGroupId();
+ case PomPackage.PLUGIN__ARTIFACT_ID:
+ return ARTIFACT_ID_EDEFAULT == null ? artifactId != null
+ : !ARTIFACT_ID_EDEFAULT.equals(artifactId);
+ case PomPackage.PLUGIN__VERSION:
+ return VERSION_EDEFAULT == null ? version != null
+ : !VERSION_EDEFAULT.equals(version);
+ case PomPackage.PLUGIN__EXTENSIONS:
+ return isSetExtensions();
+ case PomPackage.PLUGIN__EXECUTIONS:
+ return isSetExecutions();
+ case PomPackage.PLUGIN__DEPENDENCIES:
+ return isSetDependencies();
+ case PomPackage.PLUGIN__INHERITED:
+ return INHERITED_EDEFAULT == null ? inherited != null
+ : !INHERITED_EDEFAULT.equals(inherited);
+ case PomPackage.PLUGIN__CONFIGURATION:
+ return configuration != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (groupId: "); //$NON-NLS-1$
+ if (groupIdESet)
+ result.append(groupId);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", artifactId: "); //$NON-NLS-1$
+ result.append(artifactId);
+ result.append(", version: "); //$NON-NLS-1$
+ result.append(version);
+ result.append(", extensions: "); //$NON-NLS-1$
+ if (extensionsESet)
+ result.append(extensions);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", inherited: "); //$NON-NLS-1$
+ result.append(inherited);
+ result.append(')');
+ return result.toString();
+ }
+
+} // PluginImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginManagementImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginManagementImpl.java
new file mode 100644
index 00000000..5c8add48
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PluginManagementImpl.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.Plugin;
+import org.eclipse.m2e.model.edit.pom.PluginManagement;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Plugin Management</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PluginManagementImpl#getPlugins
+ * <em>Plugins</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class PluginManagementImpl extends EObjectImpl implements
+ PluginManagement {
+ /**
+ * The cached value of the '{@link #getPlugins() <em>Plugins</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getPlugins()
+ * @generated
+ * @ordered
+ */
+ protected EList<Plugin> plugins;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PluginManagementImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.PLUGIN_MANAGEMENT;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Plugin> getPlugins() {
+ if (plugins == null) {
+ plugins = new EObjectContainmentEList<Plugin>(Plugin.class, this,
+ PomPackage.PLUGIN_MANAGEMENT__PLUGINS);
+ }
+ return plugins;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.PLUGIN_MANAGEMENT__PLUGINS:
+ return ((InternalEList<?>) getPlugins())
+ .basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.PLUGIN_MANAGEMENT__PLUGINS:
+ return getPlugins();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.PLUGIN_MANAGEMENT__PLUGINS:
+ getPlugins().clear();
+ getPlugins().addAll((Collection<? extends Plugin>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.PLUGIN_MANAGEMENT__PLUGINS:
+ getPlugins().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.PLUGIN_MANAGEMENT__PLUGINS:
+ return plugins != null && !plugins.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+} // PluginManagementImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PomFactoryImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PomFactoryImpl.java
new file mode 100644
index 00000000..b23aefb2
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PomFactoryImpl.java
@@ -0,0 +1,562 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.eclipse.m2e.model.edit.pom.*;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+public class PomFactoryImpl extends EFactoryImpl implements PomFactory {
+ /**
+ * Creates the default factory implementation. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public static PomFactory init() {
+ try {
+ PomFactory thePomFactory = (PomFactory) EPackage.Registry.INSTANCE
+ .getEFactory("http://maven.apache.org/POM/4.0.0"); //$NON-NLS-1$
+ if (thePomFactory != null) {
+ return thePomFactory;
+ }
+ } catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new PomFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public PomFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case PomPackage.ACTIVATION:
+ return createActivation();
+ case PomPackage.ACTIVATION_FILE:
+ return createActivationFile();
+ case PomPackage.ACTIVATION_OS:
+ return createActivationOS();
+ case PomPackage.ACTIVATION_PROPERTY:
+ return createActivationProperty();
+ case PomPackage.BUILD:
+ return createBuild();
+ case PomPackage.BUILD_BASE:
+ return createBuildBase();
+ case PomPackage.CI_MANAGEMENT:
+ return createCiManagement();
+ case PomPackage.CONTRIBUTOR:
+ return createContributor();
+ case PomPackage.DEPENDENCY:
+ return createDependency();
+ case PomPackage.DEPENDENCY_MANAGEMENT:
+ return createDependencyManagement();
+ case PomPackage.DEPLOYMENT_REPOSITORY:
+ return createDeploymentRepository();
+ case PomPackage.DEVELOPER:
+ return createDeveloper();
+ case PomPackage.DISTRIBUTION_MANAGEMENT:
+ return createDistributionManagement();
+ case PomPackage.DOCUMENT_ROOT:
+ return createDocumentRoot();
+ case PomPackage.EXCLUSION:
+ return createExclusion();
+ case PomPackage.EXTENSION:
+ return createExtension();
+ case PomPackage.ISSUE_MANAGEMENT:
+ return createIssueManagement();
+ case PomPackage.LICENSE:
+ return createLicense();
+ case PomPackage.MAILING_LIST:
+ return createMailingList();
+ case PomPackage.MODEL:
+ return createModel();
+ case PomPackage.NOTIFIER:
+ return createNotifier();
+ case PomPackage.ORGANIZATION:
+ return createOrganization();
+ case PomPackage.PARENT:
+ return createParent();
+ case PomPackage.PLUGIN:
+ return createPlugin();
+ case PomPackage.PLUGIN_EXECUTION:
+ return createPluginExecution();
+ case PomPackage.PLUGIN_MANAGEMENT:
+ return createPluginManagement();
+ case PomPackage.PREREQUISITES:
+ return createPrerequisites();
+ case PomPackage.PROFILE:
+ return createProfile();
+ case PomPackage.RELOCATION:
+ return createRelocation();
+ case PomPackage.REPORTING:
+ return createReporting();
+ case PomPackage.REPORT_PLUGIN:
+ return createReportPlugin();
+ case PomPackage.REPORT_SET:
+ return createReportSet();
+ case PomPackage.REPOSITORY:
+ return createRepository();
+ case PomPackage.REPOSITORY_POLICY:
+ return createRepositoryPolicy();
+ case PomPackage.RESOURCE:
+ return createResource();
+ case PomPackage.SCM:
+ return createScm();
+ case PomPackage.SITE:
+ return createSite();
+ case PomPackage.PROPERTY_ELEMENT:
+ return createPropertyElement();
+ case PomPackage.CONFIGURATION:
+ return createConfiguration();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() //$NON-NLS-1$
+ + "' is not a valid classifier"); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Activation createActivation() {
+ ActivationImpl activation = new ActivationImpl();
+ return activation;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ActivationFile createActivationFile() {
+ ActivationFileImpl activationFile = new ActivationFileImpl();
+ return activationFile;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ActivationOS createActivationOS() {
+ ActivationOSImpl activationOS = new ActivationOSImpl();
+ return activationOS;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ActivationProperty createActivationProperty() {
+ ActivationPropertyImpl activationProperty = new ActivationPropertyImpl();
+ return activationProperty;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Build createBuild() {
+ BuildImpl build = new BuildImpl();
+ return build;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public BuildBase createBuildBase() {
+ BuildBaseImpl buildBase = new BuildBaseImpl();
+ return buildBase;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public CiManagement createCiManagement() {
+ CiManagementImpl ciManagement = new CiManagementImpl();
+ return ciManagement;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Contributor createContributor() {
+ ContributorImpl contributor = new ContributorImpl();
+ return contributor;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Dependency createDependency() {
+ DependencyImpl dependency = new DependencyImpl();
+ return dependency;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DependencyManagement createDependencyManagement() {
+ DependencyManagementImpl dependencyManagement = new DependencyManagementImpl();
+ return dependencyManagement;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DeploymentRepository createDeploymentRepository() {
+ DeploymentRepositoryImpl deploymentRepository = new DeploymentRepositoryImpl();
+ return deploymentRepository;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Developer createDeveloper() {
+ DeveloperImpl developer = new DeveloperImpl();
+ return developer;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DistributionManagement createDistributionManagement() {
+ DistributionManagementImpl distributionManagement = new DistributionManagementImpl();
+ return distributionManagement;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DocumentRoot createDocumentRoot() {
+ DocumentRootImpl documentRoot = new DocumentRootImpl();
+ return documentRoot;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Exclusion createExclusion() {
+ ExclusionImpl exclusion = new ExclusionImpl();
+ return exclusion;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Extension createExtension() {
+ ExtensionImpl extension = new ExtensionImpl();
+ return extension;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IssueManagement createIssueManagement() {
+ IssueManagementImpl issueManagement = new IssueManagementImpl();
+ return issueManagement;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public License createLicense() {
+ LicenseImpl license = new LicenseImpl();
+ return license;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public MailingList createMailingList() {
+ MailingListImpl mailingList = new MailingListImpl();
+ return mailingList;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Model createModel() {
+ ModelImpl model = new ModelImpl();
+ return model;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Notifier createNotifier() {
+ NotifierImpl notifier = new NotifierImpl();
+ return notifier;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Organization createOrganization() {
+ OrganizationImpl organization = new OrganizationImpl();
+ return organization;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Parent createParent() {
+ ParentImpl parent = new ParentImpl();
+ return parent;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Plugin createPlugin() {
+ PluginImpl plugin = new PluginImpl();
+ return plugin;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PluginExecution createPluginExecution() {
+ PluginExecutionImpl pluginExecution = new PluginExecutionImpl();
+ return pluginExecution;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PluginManagement createPluginManagement() {
+ PluginManagementImpl pluginManagement = new PluginManagementImpl();
+ return pluginManagement;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Prerequisites createPrerequisites() {
+ PrerequisitesImpl prerequisites = new PrerequisitesImpl();
+ return prerequisites;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Profile createProfile() {
+ ProfileImpl profile = new ProfileImpl();
+ return profile;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Relocation createRelocation() {
+ RelocationImpl relocation = new RelocationImpl();
+ return relocation;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Reporting createReporting() {
+ ReportingImpl reporting = new ReportingImpl();
+ return reporting;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ReportPlugin createReportPlugin() {
+ ReportPluginImpl reportPlugin = new ReportPluginImpl();
+ return reportPlugin;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ReportSet createReportSet() {
+ ReportSetImpl reportSet = new ReportSetImpl();
+ return reportSet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Repository createRepository() {
+ RepositoryImpl repository = new RepositoryImpl();
+ return repository;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public RepositoryPolicy createRepositoryPolicy() {
+ RepositoryPolicyImpl repositoryPolicy = new RepositoryPolicyImpl();
+ return repositoryPolicy;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Resource createResource() {
+ ResourceImpl resource = new ResourceImpl();
+ return resource;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Scm createScm() {
+ ScmImpl scm = new ScmImpl();
+ return scm;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Site createSite() {
+ SiteImpl site = new SiteImpl();
+ return site;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PropertyElement createPropertyElement() {
+ PropertyElementImpl propertyElement = new PropertyElementImpl();
+ return propertyElement;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Configuration createConfiguration() {
+ ConfigurationImpl configuration = new ConfigurationImpl();
+ return configuration;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PomPackage getPomPackage() {
+ return (PomPackage) getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static PomPackage getPackage() {
+ return PomPackage.eINSTANCE;
+ }
+
+} // PomFactoryImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PomPackageImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PomPackageImpl.java
new file mode 100644
index 00000000..fc64bc92
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PomPackageImpl.java
@@ -0,0 +1,4597 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+import org.eclipse.m2e.model.edit.pom.Activation;
+import org.eclipse.m2e.model.edit.pom.ActivationFile;
+import org.eclipse.m2e.model.edit.pom.ActivationOS;
+import org.eclipse.m2e.model.edit.pom.ActivationProperty;
+import org.eclipse.m2e.model.edit.pom.Build;
+import org.eclipse.m2e.model.edit.pom.BuildBase;
+import org.eclipse.m2e.model.edit.pom.CiManagement;
+import org.eclipse.m2e.model.edit.pom.Configuration;
+import org.eclipse.m2e.model.edit.pom.Contributor;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.DependencyManagement;
+import org.eclipse.m2e.model.edit.pom.DeploymentRepository;
+import org.eclipse.m2e.model.edit.pom.Developer;
+import org.eclipse.m2e.model.edit.pom.DistributionManagement;
+import org.eclipse.m2e.model.edit.pom.DocumentRoot;
+import org.eclipse.m2e.model.edit.pom.Exclusion;
+import org.eclipse.m2e.model.edit.pom.Extension;
+import org.eclipse.m2e.model.edit.pom.IssueManagement;
+import org.eclipse.m2e.model.edit.pom.License;
+import org.eclipse.m2e.model.edit.pom.MailingList;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.Notifier;
+import org.eclipse.m2e.model.edit.pom.Organization;
+import org.eclipse.m2e.model.edit.pom.Parent;
+import org.eclipse.m2e.model.edit.pom.Plugin;
+import org.eclipse.m2e.model.edit.pom.PluginExecution;
+import org.eclipse.m2e.model.edit.pom.PluginManagement;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Prerequisites;
+import org.eclipse.m2e.model.edit.pom.Profile;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+import org.eclipse.m2e.model.edit.pom.Relocation;
+import org.eclipse.m2e.model.edit.pom.ReportPlugin;
+import org.eclipse.m2e.model.edit.pom.ReportSet;
+import org.eclipse.m2e.model.edit.pom.Reporting;
+import org.eclipse.m2e.model.edit.pom.Repository;
+import org.eclipse.m2e.model.edit.pom.RepositoryPolicy;
+import org.eclipse.m2e.model.edit.pom.Resource;
+import org.eclipse.m2e.model.edit.pom.Scm;
+import org.eclipse.m2e.model.edit.pom.Site;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!--
+ * end-user-doc -->
+ * @generated
+ */
+public class PomPackageImpl extends EPackageImpl implements PomPackage {
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass activationEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass activationFileEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass activationOSEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass activationPropertyEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass buildEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass buildBaseEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass ciManagementEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass contributorEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass dependencyEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass dependencyManagementEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass deploymentRepositoryEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass developerEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass distributionManagementEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass documentRootEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass exclusionEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass extensionEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass issueManagementEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass licenseEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass mailingListEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass modelEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass notifierEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass organizationEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass parentEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass pluginEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass pluginExecutionEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass pluginManagementEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass prerequisitesEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass profileEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass relocationEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass reportingEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass reportPluginEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass reportSetEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass repositoryEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass repositoryPolicyEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass resourceEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass scmEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass siteEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass propertyElementEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass configurationEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the
+ * package package URI value.
+ * <p>
+ * Note: the correct way to create the package is via the static factory
+ * method {@link #init init()}, which also performs initialization of the
+ * package, or returns the registered package, if one already exists. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private PomPackageImpl() {
+ super(eNS_URI, PomFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this
+ * model, and for any others upon which it depends. Simple
+ * dependencies are satisfied by calling this method on all
+ * dependent packages before doing anything else. This method drives
+ * initialization for interdependent packages directly, in parallel
+ * with this package, itself.
+ * <p>Of this package and its interdependencies, all packages which
+ * have not yet been registered by their URI values are first created
+ * and registered. The packages are then initialized in two steps:
+ * meta-model objects for all of the packages are created before any
+ * are initialized, since one package's meta-model objects may refer to
+ * those of another.
+ * <p>Invocation of this method will not affect any packages that have
+ * already been initialized.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static PomPackage init() {
+ if (isInited) return (PomPackage)EPackage.Registry.INSTANCE.getEPackage(PomPackage.eNS_URI);
+
+ // Obtain or create and register package
+ PomPackageImpl thePomPackage = (PomPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof PomPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new PomPackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ XMLTypePackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ thePomPackage.createPackageContents();
+
+ // Initialize created meta-data
+ thePomPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ thePomPackage.freeze();
+
+ return thePomPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getActivation() {
+ return activationEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getActivation_ActiveByDefault() {
+ return (EAttribute)activationEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getActivation_Jdk() {
+ return (EAttribute)activationEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getActivation_Os() {
+ return (EReference)activationEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getActivation_Property() {
+ return (EReference)activationEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getActivation_File() {
+ return (EReference)activationEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getActivationFile() {
+ return activationFileEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getActivationFile_Missing() {
+ return (EAttribute)activationFileEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getActivationFile_Exists() {
+ return (EAttribute)activationFileEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getActivationOS() {
+ return activationOSEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getActivationOS_Name() {
+ return (EAttribute)activationOSEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getActivationOS_Family() {
+ return (EAttribute)activationOSEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getActivationOS_Arch() {
+ return (EAttribute)activationOSEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getActivationOS_Version() {
+ return (EAttribute)activationOSEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getActivationProperty() {
+ return activationPropertyEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getActivationProperty_Name() {
+ return (EAttribute)activationPropertyEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getActivationProperty_Value() {
+ return (EAttribute)activationPropertyEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getBuild() {
+ return buildEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getBuild_SourceDirectory() {
+ return (EAttribute)buildEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getBuild_ScriptSourceDirectory() {
+ return (EAttribute)buildEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getBuild_TestSourceDirectory() {
+ return (EAttribute)buildEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getBuild_OutputDirectory() {
+ return (EAttribute)buildEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getBuild_TestOutputDirectory() {
+ return (EAttribute)buildEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getBuild_Extensions() {
+ return (EReference)buildEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getBuildBase() {
+ return buildBaseEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getBuildBase_DefaultGoal() {
+ return (EAttribute)buildBaseEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getBuildBase_Resources() {
+ return (EReference)buildBaseEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getBuildBase_TestResources() {
+ return (EReference)buildBaseEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getBuildBase_Directory() {
+ return (EAttribute)buildBaseEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getBuildBase_FinalName() {
+ return (EAttribute)buildBaseEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getBuildBase_PluginManagement() {
+ return (EReference)buildBaseEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getBuildBase_Plugins() {
+ return (EReference)buildBaseEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getBuildBase_Filters() {
+ return (EAttribute)buildBaseEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getCiManagement() {
+ return ciManagementEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getCiManagement_System() {
+ return (EAttribute)ciManagementEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getCiManagement_Url() {
+ return (EAttribute)ciManagementEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getCiManagement_Notifiers() {
+ return (EReference)ciManagementEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getContributor() {
+ return contributorEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getContributor_Name() {
+ return (EAttribute)contributorEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getContributor_Email() {
+ return (EAttribute)contributorEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getContributor_Url() {
+ return (EAttribute)contributorEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getContributor_Organization() {
+ return (EAttribute)contributorEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getContributor_OrganizationUrl() {
+ return (EAttribute)contributorEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getContributor_Timezone() {
+ return (EAttribute)contributorEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getContributor_Properties() {
+ return (EReference)contributorEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getContributor_Roles() {
+ return (EAttribute)contributorEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getDependency() {
+ return dependencyEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDependency_GroupId() {
+ return (EAttribute)dependencyEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDependency_ArtifactId() {
+ return (EAttribute)dependencyEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDependency_Version() {
+ return (EAttribute)dependencyEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDependency_Type() {
+ return (EAttribute)dependencyEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDependency_Classifier() {
+ return (EAttribute)dependencyEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDependency_Scope() {
+ return (EAttribute)dependencyEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDependency_SystemPath() {
+ return (EAttribute)dependencyEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDependency_Exclusions() {
+ return (EReference)dependencyEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDependency_Optional() {
+ return (EAttribute)dependencyEClass.getEStructuralFeatures().get(8);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getDependencyManagement() {
+ return dependencyManagementEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDependencyManagement_Dependencies() {
+ return (EReference)dependencyManagementEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getDeploymentRepository() {
+ return deploymentRepositoryEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDeploymentRepository_UniqueVersion() {
+ return (EAttribute)deploymentRepositoryEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDeploymentRepository_Id() {
+ return (EAttribute)deploymentRepositoryEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDeploymentRepository_Name() {
+ return (EAttribute)deploymentRepositoryEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDeploymentRepository_Url() {
+ return (EAttribute)deploymentRepositoryEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDeploymentRepository_Layout() {
+ return (EAttribute)deploymentRepositoryEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getDeveloper() {
+ return developerEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDeveloper_Id() {
+ return (EAttribute)developerEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDeveloper_Name() {
+ return (EAttribute)developerEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDeveloper_Email() {
+ return (EAttribute)developerEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDeveloper_Url() {
+ return (EAttribute)developerEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDeveloper_Organization() {
+ return (EAttribute)developerEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDeveloper_OrganizationUrl() {
+ return (EAttribute)developerEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDeveloper_Timezone() {
+ return (EAttribute)developerEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDeveloper_Properties() {
+ return (EReference)developerEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDeveloper_Roles() {
+ return (EAttribute)developerEClass.getEStructuralFeatures().get(8);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getDistributionManagement() {
+ return distributionManagementEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDistributionManagement_Repository() {
+ return (EReference)distributionManagementEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDistributionManagement_SnapshotRepository() {
+ return (EReference)distributionManagementEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDistributionManagement_Site() {
+ return (EReference)distributionManagementEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDistributionManagement_DownloadUrl() {
+ return (EAttribute)distributionManagementEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDistributionManagement_Relocation() {
+ return (EReference)distributionManagementEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDistributionManagement_Status() {
+ return (EAttribute)distributionManagementEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getDocumentRoot() {
+ return documentRootEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDocumentRoot_Mixed() {
+ return (EAttribute)documentRootEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDocumentRoot_XMLNSPrefixMap() {
+ return (EReference)documentRootEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDocumentRoot_XSISchemaLocation() {
+ return (EReference)documentRootEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDocumentRoot_Project() {
+ return (EReference)documentRootEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getExclusion() {
+ return exclusionEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getExclusion_ArtifactId() {
+ return (EAttribute)exclusionEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getExclusion_GroupId() {
+ return (EAttribute)exclusionEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getExtension() {
+ return extensionEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getExtension_GroupId() {
+ return (EAttribute)extensionEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getExtension_ArtifactId() {
+ return (EAttribute)extensionEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getExtension_Version() {
+ return (EAttribute)extensionEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getIssueManagement() {
+ return issueManagementEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getIssueManagement_System() {
+ return (EAttribute)issueManagementEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getIssueManagement_Url() {
+ return (EAttribute)issueManagementEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getLicense() {
+ return licenseEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getLicense_Name() {
+ return (EAttribute)licenseEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getLicense_Url() {
+ return (EAttribute)licenseEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getLicense_Distribution() {
+ return (EAttribute)licenseEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getLicense_Comments() {
+ return (EAttribute)licenseEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getMailingList() {
+ return mailingListEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMailingList_Name() {
+ return (EAttribute)mailingListEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMailingList_Subscribe() {
+ return (EAttribute)mailingListEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMailingList_Unsubscribe() {
+ return (EAttribute)mailingListEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMailingList_Post() {
+ return (EAttribute)mailingListEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMailingList_Archive() {
+ return (EAttribute)mailingListEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getMailingList_OtherArchives() {
+ return (EAttribute)mailingListEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getModel() {
+ return modelEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_Parent() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_ModelVersion() {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_GroupId() {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_ArtifactId() {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_Packaging() {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_Name() {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_Version() {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_Description() {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_Url() {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(8);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_Prerequisites() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(9);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_IssueManagement() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(10);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_CiManagement() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(11);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_InceptionYear() {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(12);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_MailingLists() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(13);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_Developers() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(14);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_Contributors() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(15);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_Licenses() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(16);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_Scm() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(17);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_Organization() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(18);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_Build() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(19);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_Profiles() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(20);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_Repositories() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(21);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_PluginRepositories() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(22);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_Dependencies() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(23);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_Reporting() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(24);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_DependencyManagement() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(25);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_DistributionManagement() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(26);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getModel_Properties() {
+ return (EReference)modelEClass.getEStructuralFeatures().get(27);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getModel_Modules() {
+ return (EAttribute)modelEClass.getEStructuralFeatures().get(28);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getNotifier() {
+ return notifierEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getNotifier_Type() {
+ return (EAttribute)notifierEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getNotifier_SendOnError() {
+ return (EAttribute)notifierEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getNotifier_SendOnFailure() {
+ return (EAttribute)notifierEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getNotifier_SendOnSuccess() {
+ return (EAttribute)notifierEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getNotifier_SendOnWarning() {
+ return (EAttribute)notifierEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getNotifier_Address() {
+ return (EAttribute)notifierEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getNotifier_Configuration() {
+ return (EReference)notifierEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getOrganization() {
+ return organizationEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getOrganization_Name() {
+ return (EAttribute)organizationEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getOrganization_Url() {
+ return (EAttribute)organizationEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getParent() {
+ return parentEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getParent_ArtifactId() {
+ return (EAttribute)parentEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getParent_GroupId() {
+ return (EAttribute)parentEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getParent_Version() {
+ return (EAttribute)parentEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getParent_RelativePath() {
+ return (EAttribute)parentEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPlugin() {
+ return pluginEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPlugin_GroupId() {
+ return (EAttribute)pluginEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPlugin_ArtifactId() {
+ return (EAttribute)pluginEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPlugin_Version() {
+ return (EAttribute)pluginEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPlugin_Extensions() {
+ return (EAttribute)pluginEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPlugin_Executions() {
+ return (EReference)pluginEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPlugin_Dependencies() {
+ return (EReference)pluginEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPlugin_Inherited() {
+ return (EAttribute)pluginEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPlugin_Configuration() {
+ return (EReference)pluginEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPluginExecution() {
+ return pluginExecutionEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPluginExecution_Id() {
+ return (EAttribute)pluginExecutionEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPluginExecution_Phase() {
+ return (EAttribute)pluginExecutionEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPluginExecution_Inherited() {
+ return (EAttribute)pluginExecutionEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPluginExecution_Goals() {
+ return (EAttribute)pluginExecutionEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPluginExecution_Configuration() {
+ return (EReference)pluginExecutionEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPluginManagement() {
+ return pluginManagementEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPluginManagement_Plugins() {
+ return (EReference)pluginManagementEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPrerequisites() {
+ return prerequisitesEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPrerequisites_Maven() {
+ return (EAttribute)prerequisitesEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getProfile() {
+ return profileEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getProfile_Id() {
+ return (EAttribute)profileEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getProfile_Activation() {
+ return (EReference)profileEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getProfile_Build() {
+ return (EReference)profileEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getProfile_Repositories() {
+ return (EReference)profileEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getProfile_PluginRepositories() {
+ return (EReference)profileEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getProfile_Dependencies() {
+ return (EReference)profileEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getProfile_Reports() {
+ return (EReference)profileEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getProfile_DependencyManagement() {
+ return (EReference)profileEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getProfile_DistributionManagement() {
+ return (EReference)profileEClass.getEStructuralFeatures().get(8);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getProfile_Properties() {
+ return (EReference)profileEClass.getEStructuralFeatures().get(9);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getProfile_Modules() {
+ return (EAttribute)profileEClass.getEStructuralFeatures().get(10);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getProfile_Reporting() {
+ return (EReference)profileEClass.getEStructuralFeatures().get(11);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getRelocation() {
+ return relocationEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getRelocation_GroupId() {
+ return (EAttribute)relocationEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getRelocation_ArtifactId() {
+ return (EAttribute)relocationEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getRelocation_Version() {
+ return (EAttribute)relocationEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getRelocation_Message() {
+ return (EAttribute)relocationEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getReporting() {
+ return reportingEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getReporting_ExcludeDefaults() {
+ return (EAttribute)reportingEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getReporting_OutputDirectory() {
+ return (EAttribute)reportingEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getReporting_Plugins() {
+ return (EReference)reportingEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getReportPlugin() {
+ return reportPluginEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getReportPlugin_GroupId() {
+ return (EAttribute)reportPluginEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getReportPlugin_ArtifactId() {
+ return (EAttribute)reportPluginEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getReportPlugin_Version() {
+ return (EAttribute)reportPluginEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getReportPlugin_Inherited() {
+ return (EAttribute)reportPluginEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getReportPlugin_ReportSets() {
+ return (EReference)reportPluginEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getReportPlugin_Configuration() {
+ return (EReference)reportPluginEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getReportSet() {
+ return reportSetEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getReportSet_Id() {
+ return (EAttribute)reportSetEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getReportSet_Inherited() {
+ return (EAttribute)reportSetEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getReportSet_Reports() {
+ return (EAttribute)reportSetEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getReportSet_Configuration() {
+ return (EReference)reportSetEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getRepository() {
+ return repositoryEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getRepository_Releases() {
+ return (EReference)repositoryEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getRepository_Snapshots() {
+ return (EReference)repositoryEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getRepository_Id() {
+ return (EAttribute)repositoryEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getRepository_Name() {
+ return (EAttribute)repositoryEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getRepository_Url() {
+ return (EAttribute)repositoryEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getRepository_Layout() {
+ return (EAttribute)repositoryEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getRepositoryPolicy() {
+ return repositoryPolicyEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getRepositoryPolicy_Enabled() {
+ return (EAttribute)repositoryPolicyEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getRepositoryPolicy_UpdatePolicy() {
+ return (EAttribute)repositoryPolicyEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getRepositoryPolicy_ChecksumPolicy() {
+ return (EAttribute)repositoryPolicyEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getResource() {
+ return resourceEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getResource_TargetPath() {
+ return (EAttribute)resourceEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getResource_Filtering() {
+ return (EAttribute)resourceEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getResource_Directory() {
+ return (EAttribute)resourceEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getResource_Includes() {
+ return (EAttribute)resourceEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getResource_Excludes() {
+ return (EAttribute)resourceEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getScm() {
+ return scmEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getScm_Connection() {
+ return (EAttribute)scmEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getScm_DeveloperConnection() {
+ return (EAttribute)scmEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getScm_Tag() {
+ return (EAttribute)scmEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getScm_Url() {
+ return (EAttribute)scmEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getSite() {
+ return siteEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getSite_Id() {
+ return (EAttribute)siteEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getSite_Name() {
+ return (EAttribute)siteEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getSite_Url() {
+ return (EAttribute)siteEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPropertyElement() {
+ return propertyElementEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPropertyElement_Name() {
+ return (EAttribute)propertyElementEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPropertyElement_Value() {
+ return (EAttribute)propertyElementEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getConfiguration() {
+ return configurationEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public PomFactory getPomFactory() {
+ return (PomFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ activationEClass = createEClass(ACTIVATION);
+ createEAttribute(activationEClass, ACTIVATION__ACTIVE_BY_DEFAULT);
+ createEAttribute(activationEClass, ACTIVATION__JDK);
+ createEReference(activationEClass, ACTIVATION__OS);
+ createEReference(activationEClass, ACTIVATION__PROPERTY);
+ createEReference(activationEClass, ACTIVATION__FILE);
+
+ activationFileEClass = createEClass(ACTIVATION_FILE);
+ createEAttribute(activationFileEClass, ACTIVATION_FILE__MISSING);
+ createEAttribute(activationFileEClass, ACTIVATION_FILE__EXISTS);
+
+ activationOSEClass = createEClass(ACTIVATION_OS);
+ createEAttribute(activationOSEClass, ACTIVATION_OS__NAME);
+ createEAttribute(activationOSEClass, ACTIVATION_OS__FAMILY);
+ createEAttribute(activationOSEClass, ACTIVATION_OS__ARCH);
+ createEAttribute(activationOSEClass, ACTIVATION_OS__VERSION);
+
+ activationPropertyEClass = createEClass(ACTIVATION_PROPERTY);
+ createEAttribute(activationPropertyEClass, ACTIVATION_PROPERTY__NAME);
+ createEAttribute(activationPropertyEClass, ACTIVATION_PROPERTY__VALUE);
+
+ buildEClass = createEClass(BUILD);
+ createEAttribute(buildEClass, BUILD__SOURCE_DIRECTORY);
+ createEAttribute(buildEClass, BUILD__SCRIPT_SOURCE_DIRECTORY);
+ createEAttribute(buildEClass, BUILD__TEST_SOURCE_DIRECTORY);
+ createEAttribute(buildEClass, BUILD__OUTPUT_DIRECTORY);
+ createEAttribute(buildEClass, BUILD__TEST_OUTPUT_DIRECTORY);
+ createEReference(buildEClass, BUILD__EXTENSIONS);
+
+ buildBaseEClass = createEClass(BUILD_BASE);
+ createEAttribute(buildBaseEClass, BUILD_BASE__DEFAULT_GOAL);
+ createEReference(buildBaseEClass, BUILD_BASE__RESOURCES);
+ createEReference(buildBaseEClass, BUILD_BASE__TEST_RESOURCES);
+ createEAttribute(buildBaseEClass, BUILD_BASE__DIRECTORY);
+ createEAttribute(buildBaseEClass, BUILD_BASE__FINAL_NAME);
+ createEReference(buildBaseEClass, BUILD_BASE__PLUGIN_MANAGEMENT);
+ createEReference(buildBaseEClass, BUILD_BASE__PLUGINS);
+ createEAttribute(buildBaseEClass, BUILD_BASE__FILTERS);
+
+ ciManagementEClass = createEClass(CI_MANAGEMENT);
+ createEAttribute(ciManagementEClass, CI_MANAGEMENT__SYSTEM);
+ createEAttribute(ciManagementEClass, CI_MANAGEMENT__URL);
+ createEReference(ciManagementEClass, CI_MANAGEMENT__NOTIFIERS);
+
+ contributorEClass = createEClass(CONTRIBUTOR);
+ createEAttribute(contributorEClass, CONTRIBUTOR__NAME);
+ createEAttribute(contributorEClass, CONTRIBUTOR__EMAIL);
+ createEAttribute(contributorEClass, CONTRIBUTOR__URL);
+ createEAttribute(contributorEClass, CONTRIBUTOR__ORGANIZATION);
+ createEAttribute(contributorEClass, CONTRIBUTOR__ORGANIZATION_URL);
+ createEAttribute(contributorEClass, CONTRIBUTOR__TIMEZONE);
+ createEReference(contributorEClass, CONTRIBUTOR__PROPERTIES);
+ createEAttribute(contributorEClass, CONTRIBUTOR__ROLES);
+
+ dependencyEClass = createEClass(DEPENDENCY);
+ createEAttribute(dependencyEClass, DEPENDENCY__GROUP_ID);
+ createEAttribute(dependencyEClass, DEPENDENCY__ARTIFACT_ID);
+ createEAttribute(dependencyEClass, DEPENDENCY__VERSION);
+ createEAttribute(dependencyEClass, DEPENDENCY__TYPE);
+ createEAttribute(dependencyEClass, DEPENDENCY__CLASSIFIER);
+ createEAttribute(dependencyEClass, DEPENDENCY__SCOPE);
+ createEAttribute(dependencyEClass, DEPENDENCY__SYSTEM_PATH);
+ createEReference(dependencyEClass, DEPENDENCY__EXCLUSIONS);
+ createEAttribute(dependencyEClass, DEPENDENCY__OPTIONAL);
+
+ dependencyManagementEClass = createEClass(DEPENDENCY_MANAGEMENT);
+ createEReference(dependencyManagementEClass, DEPENDENCY_MANAGEMENT__DEPENDENCIES);
+
+ deploymentRepositoryEClass = createEClass(DEPLOYMENT_REPOSITORY);
+ createEAttribute(deploymentRepositoryEClass, DEPLOYMENT_REPOSITORY__UNIQUE_VERSION);
+ createEAttribute(deploymentRepositoryEClass, DEPLOYMENT_REPOSITORY__ID);
+ createEAttribute(deploymentRepositoryEClass, DEPLOYMENT_REPOSITORY__NAME);
+ createEAttribute(deploymentRepositoryEClass, DEPLOYMENT_REPOSITORY__URL);
+ createEAttribute(deploymentRepositoryEClass, DEPLOYMENT_REPOSITORY__LAYOUT);
+
+ developerEClass = createEClass(DEVELOPER);
+ createEAttribute(developerEClass, DEVELOPER__ID);
+ createEAttribute(developerEClass, DEVELOPER__NAME);
+ createEAttribute(developerEClass, DEVELOPER__EMAIL);
+ createEAttribute(developerEClass, DEVELOPER__URL);
+ createEAttribute(developerEClass, DEVELOPER__ORGANIZATION);
+ createEAttribute(developerEClass, DEVELOPER__ORGANIZATION_URL);
+ createEAttribute(developerEClass, DEVELOPER__TIMEZONE);
+ createEReference(developerEClass, DEVELOPER__PROPERTIES);
+ createEAttribute(developerEClass, DEVELOPER__ROLES);
+
+ distributionManagementEClass = createEClass(DISTRIBUTION_MANAGEMENT);
+ createEReference(distributionManagementEClass, DISTRIBUTION_MANAGEMENT__REPOSITORY);
+ createEReference(distributionManagementEClass, DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY);
+ createEReference(distributionManagementEClass, DISTRIBUTION_MANAGEMENT__SITE);
+ createEAttribute(distributionManagementEClass, DISTRIBUTION_MANAGEMENT__DOWNLOAD_URL);
+ createEReference(distributionManagementEClass, DISTRIBUTION_MANAGEMENT__RELOCATION);
+ createEAttribute(distributionManagementEClass, DISTRIBUTION_MANAGEMENT__STATUS);
+
+ documentRootEClass = createEClass(DOCUMENT_ROOT);
+ createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__PROJECT);
+
+ exclusionEClass = createEClass(EXCLUSION);
+ createEAttribute(exclusionEClass, EXCLUSION__ARTIFACT_ID);
+ createEAttribute(exclusionEClass, EXCLUSION__GROUP_ID);
+
+ extensionEClass = createEClass(EXTENSION);
+ createEAttribute(extensionEClass, EXTENSION__GROUP_ID);
+ createEAttribute(extensionEClass, EXTENSION__ARTIFACT_ID);
+ createEAttribute(extensionEClass, EXTENSION__VERSION);
+
+ issueManagementEClass = createEClass(ISSUE_MANAGEMENT);
+ createEAttribute(issueManagementEClass, ISSUE_MANAGEMENT__SYSTEM);
+ createEAttribute(issueManagementEClass, ISSUE_MANAGEMENT__URL);
+
+ licenseEClass = createEClass(LICENSE);
+ createEAttribute(licenseEClass, LICENSE__NAME);
+ createEAttribute(licenseEClass, LICENSE__URL);
+ createEAttribute(licenseEClass, LICENSE__DISTRIBUTION);
+ createEAttribute(licenseEClass, LICENSE__COMMENTS);
+
+ mailingListEClass = createEClass(MAILING_LIST);
+ createEAttribute(mailingListEClass, MAILING_LIST__NAME);
+ createEAttribute(mailingListEClass, MAILING_LIST__SUBSCRIBE);
+ createEAttribute(mailingListEClass, MAILING_LIST__UNSUBSCRIBE);
+ createEAttribute(mailingListEClass, MAILING_LIST__POST);
+ createEAttribute(mailingListEClass, MAILING_LIST__ARCHIVE);
+ createEAttribute(mailingListEClass, MAILING_LIST__OTHER_ARCHIVES);
+
+ modelEClass = createEClass(MODEL);
+ createEReference(modelEClass, MODEL__PARENT);
+ createEAttribute(modelEClass, MODEL__MODEL_VERSION);
+ createEAttribute(modelEClass, MODEL__GROUP_ID);
+ createEAttribute(modelEClass, MODEL__ARTIFACT_ID);
+ createEAttribute(modelEClass, MODEL__PACKAGING);
+ createEAttribute(modelEClass, MODEL__NAME);
+ createEAttribute(modelEClass, MODEL__VERSION);
+ createEAttribute(modelEClass, MODEL__DESCRIPTION);
+ createEAttribute(modelEClass, MODEL__URL);
+ createEReference(modelEClass, MODEL__PREREQUISITES);
+ createEReference(modelEClass, MODEL__ISSUE_MANAGEMENT);
+ createEReference(modelEClass, MODEL__CI_MANAGEMENT);
+ createEAttribute(modelEClass, MODEL__INCEPTION_YEAR);
+ createEReference(modelEClass, MODEL__MAILING_LISTS);
+ createEReference(modelEClass, MODEL__DEVELOPERS);
+ createEReference(modelEClass, MODEL__CONTRIBUTORS);
+ createEReference(modelEClass, MODEL__LICENSES);
+ createEReference(modelEClass, MODEL__SCM);
+ createEReference(modelEClass, MODEL__ORGANIZATION);
+ createEReference(modelEClass, MODEL__BUILD);
+ createEReference(modelEClass, MODEL__PROFILES);
+ createEReference(modelEClass, MODEL__REPOSITORIES);
+ createEReference(modelEClass, MODEL__PLUGIN_REPOSITORIES);
+ createEReference(modelEClass, MODEL__DEPENDENCIES);
+ createEReference(modelEClass, MODEL__REPORTING);
+ createEReference(modelEClass, MODEL__DEPENDENCY_MANAGEMENT);
+ createEReference(modelEClass, MODEL__DISTRIBUTION_MANAGEMENT);
+ createEReference(modelEClass, MODEL__PROPERTIES);
+ createEAttribute(modelEClass, MODEL__MODULES);
+
+ notifierEClass = createEClass(NOTIFIER);
+ createEAttribute(notifierEClass, NOTIFIER__TYPE);
+ createEAttribute(notifierEClass, NOTIFIER__SEND_ON_ERROR);
+ createEAttribute(notifierEClass, NOTIFIER__SEND_ON_FAILURE);
+ createEAttribute(notifierEClass, NOTIFIER__SEND_ON_SUCCESS);
+ createEAttribute(notifierEClass, NOTIFIER__SEND_ON_WARNING);
+ createEAttribute(notifierEClass, NOTIFIER__ADDRESS);
+ createEReference(notifierEClass, NOTIFIER__CONFIGURATION);
+
+ organizationEClass = createEClass(ORGANIZATION);
+ createEAttribute(organizationEClass, ORGANIZATION__NAME);
+ createEAttribute(organizationEClass, ORGANIZATION__URL);
+
+ parentEClass = createEClass(PARENT);
+ createEAttribute(parentEClass, PARENT__ARTIFACT_ID);
+ createEAttribute(parentEClass, PARENT__GROUP_ID);
+ createEAttribute(parentEClass, PARENT__VERSION);
+ createEAttribute(parentEClass, PARENT__RELATIVE_PATH);
+
+ pluginEClass = createEClass(PLUGIN);
+ createEAttribute(pluginEClass, PLUGIN__GROUP_ID);
+ createEAttribute(pluginEClass, PLUGIN__ARTIFACT_ID);
+ createEAttribute(pluginEClass, PLUGIN__VERSION);
+ createEAttribute(pluginEClass, PLUGIN__EXTENSIONS);
+ createEReference(pluginEClass, PLUGIN__EXECUTIONS);
+ createEReference(pluginEClass, PLUGIN__DEPENDENCIES);
+ createEAttribute(pluginEClass, PLUGIN__INHERITED);
+ createEReference(pluginEClass, PLUGIN__CONFIGURATION);
+
+ pluginExecutionEClass = createEClass(PLUGIN_EXECUTION);
+ createEAttribute(pluginExecutionEClass, PLUGIN_EXECUTION__ID);
+ createEAttribute(pluginExecutionEClass, PLUGIN_EXECUTION__PHASE);
+ createEAttribute(pluginExecutionEClass, PLUGIN_EXECUTION__INHERITED);
+ createEAttribute(pluginExecutionEClass, PLUGIN_EXECUTION__GOALS);
+ createEReference(pluginExecutionEClass, PLUGIN_EXECUTION__CONFIGURATION);
+
+ pluginManagementEClass = createEClass(PLUGIN_MANAGEMENT);
+ createEReference(pluginManagementEClass, PLUGIN_MANAGEMENT__PLUGINS);
+
+ prerequisitesEClass = createEClass(PREREQUISITES);
+ createEAttribute(prerequisitesEClass, PREREQUISITES__MAVEN);
+
+ profileEClass = createEClass(PROFILE);
+ createEAttribute(profileEClass, PROFILE__ID);
+ createEReference(profileEClass, PROFILE__ACTIVATION);
+ createEReference(profileEClass, PROFILE__BUILD);
+ createEReference(profileEClass, PROFILE__REPOSITORIES);
+ createEReference(profileEClass, PROFILE__PLUGIN_REPOSITORIES);
+ createEReference(profileEClass, PROFILE__DEPENDENCIES);
+ createEReference(profileEClass, PROFILE__REPORTS);
+ createEReference(profileEClass, PROFILE__DEPENDENCY_MANAGEMENT);
+ createEReference(profileEClass, PROFILE__DISTRIBUTION_MANAGEMENT);
+ createEReference(profileEClass, PROFILE__PROPERTIES);
+ createEAttribute(profileEClass, PROFILE__MODULES);
+ createEReference(profileEClass, PROFILE__REPORTING);
+
+ relocationEClass = createEClass(RELOCATION);
+ createEAttribute(relocationEClass, RELOCATION__GROUP_ID);
+ createEAttribute(relocationEClass, RELOCATION__ARTIFACT_ID);
+ createEAttribute(relocationEClass, RELOCATION__VERSION);
+ createEAttribute(relocationEClass, RELOCATION__MESSAGE);
+
+ reportingEClass = createEClass(REPORTING);
+ createEAttribute(reportingEClass, REPORTING__EXCLUDE_DEFAULTS);
+ createEAttribute(reportingEClass, REPORTING__OUTPUT_DIRECTORY);
+ createEReference(reportingEClass, REPORTING__PLUGINS);
+
+ reportPluginEClass = createEClass(REPORT_PLUGIN);
+ createEAttribute(reportPluginEClass, REPORT_PLUGIN__GROUP_ID);
+ createEAttribute(reportPluginEClass, REPORT_PLUGIN__ARTIFACT_ID);
+ createEAttribute(reportPluginEClass, REPORT_PLUGIN__VERSION);
+ createEAttribute(reportPluginEClass, REPORT_PLUGIN__INHERITED);
+ createEReference(reportPluginEClass, REPORT_PLUGIN__REPORT_SETS);
+ createEReference(reportPluginEClass, REPORT_PLUGIN__CONFIGURATION);
+
+ reportSetEClass = createEClass(REPORT_SET);
+ createEAttribute(reportSetEClass, REPORT_SET__ID);
+ createEAttribute(reportSetEClass, REPORT_SET__INHERITED);
+ createEAttribute(reportSetEClass, REPORT_SET__REPORTS);
+ createEReference(reportSetEClass, REPORT_SET__CONFIGURATION);
+
+ repositoryEClass = createEClass(REPOSITORY);
+ createEReference(repositoryEClass, REPOSITORY__RELEASES);
+ createEReference(repositoryEClass, REPOSITORY__SNAPSHOTS);
+ createEAttribute(repositoryEClass, REPOSITORY__ID);
+ createEAttribute(repositoryEClass, REPOSITORY__NAME);
+ createEAttribute(repositoryEClass, REPOSITORY__URL);
+ createEAttribute(repositoryEClass, REPOSITORY__LAYOUT);
+
+ repositoryPolicyEClass = createEClass(REPOSITORY_POLICY);
+ createEAttribute(repositoryPolicyEClass, REPOSITORY_POLICY__ENABLED);
+ createEAttribute(repositoryPolicyEClass, REPOSITORY_POLICY__UPDATE_POLICY);
+ createEAttribute(repositoryPolicyEClass, REPOSITORY_POLICY__CHECKSUM_POLICY);
+
+ resourceEClass = createEClass(RESOURCE);
+ createEAttribute(resourceEClass, RESOURCE__TARGET_PATH);
+ createEAttribute(resourceEClass, RESOURCE__FILTERING);
+ createEAttribute(resourceEClass, RESOURCE__DIRECTORY);
+ createEAttribute(resourceEClass, RESOURCE__INCLUDES);
+ createEAttribute(resourceEClass, RESOURCE__EXCLUDES);
+
+ scmEClass = createEClass(SCM);
+ createEAttribute(scmEClass, SCM__CONNECTION);
+ createEAttribute(scmEClass, SCM__DEVELOPER_CONNECTION);
+ createEAttribute(scmEClass, SCM__TAG);
+ createEAttribute(scmEClass, SCM__URL);
+
+ siteEClass = createEClass(SITE);
+ createEAttribute(siteEClass, SITE__ID);
+ createEAttribute(siteEClass, SITE__NAME);
+ createEAttribute(siteEClass, SITE__URL);
+
+ propertyElementEClass = createEClass(PROPERTY_ELEMENT);
+ createEAttribute(propertyElementEClass, PROPERTY_ELEMENT__NAME);
+ createEAttribute(propertyElementEClass, PROPERTY_ELEMENT__VALUE);
+
+ configurationEClass = createEClass(CONFIGURATION);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ buildEClass.getESuperTypes().add(this.getBuildBase());
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(activationEClass, Activation.class, "Activation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getActivation_ActiveByDefault(), theXMLTypePackage.getString(), "activeByDefault", "false", 0, 1, Activation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getActivation_Jdk(), theXMLTypePackage.getString(), "jdk", null, 0, 1, Activation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getActivation_Os(), this.getActivationOS(), null, "os", null, 0, 1, Activation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getActivation_Property(), this.getActivationProperty(), null, "property", null, 0, 1, Activation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getActivation_File(), this.getActivationFile(), null, "file", null, 0, 1, Activation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(activationFileEClass, ActivationFile.class, "ActivationFile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getActivationFile_Missing(), theXMLTypePackage.getString(), "missing", null, 0, 1, ActivationFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getActivationFile_Exists(), theXMLTypePackage.getString(), "exists", null, 0, 1, ActivationFile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(activationOSEClass, ActivationOS.class, "ActivationOS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getActivationOS_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, ActivationOS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getActivationOS_Family(), theXMLTypePackage.getString(), "family", null, 0, 1, ActivationOS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getActivationOS_Arch(), theXMLTypePackage.getString(), "arch", null, 0, 1, ActivationOS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getActivationOS_Version(), theXMLTypePackage.getString(), "version", null, 0, 1, ActivationOS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(activationPropertyEClass, ActivationProperty.class, "ActivationProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getActivationProperty_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, ActivationProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getActivationProperty_Value(), theXMLTypePackage.getString(), "value", null, 0, 1, ActivationProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(buildEClass, Build.class, "Build", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getBuild_SourceDirectory(), theXMLTypePackage.getString(), "sourceDirectory", null, 0, 1, Build.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getBuild_ScriptSourceDirectory(), theXMLTypePackage.getString(), "scriptSourceDirectory", null, 0, 1, Build.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getBuild_TestSourceDirectory(), theXMLTypePackage.getString(), "testSourceDirectory", null, 0, 1, Build.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getBuild_OutputDirectory(), theXMLTypePackage.getString(), "outputDirectory", null, 0, 1, Build.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getBuild_TestOutputDirectory(), theXMLTypePackage.getString(), "testOutputDirectory", null, 0, 1, Build.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getBuild_Extensions(), this.getExtension(), null, "extensions", null, 0, -1, Build.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(buildBaseEClass, BuildBase.class, "BuildBase", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getBuildBase_DefaultGoal(), theXMLTypePackage.getString(), "defaultGoal", null, 0, 1, BuildBase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getBuildBase_Resources(), this.getResource(), null, "resources", null, 0, -1, BuildBase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getBuildBase_TestResources(), this.getResource(), null, "testResources", null, 0, -1, BuildBase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getBuildBase_Directory(), theXMLTypePackage.getString(), "directory", null, 0, 1, BuildBase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getBuildBase_FinalName(), theXMLTypePackage.getString(), "finalName", null, 0, 1, BuildBase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getBuildBase_PluginManagement(), this.getPluginManagement(), null, "pluginManagement", null, 0, 1, BuildBase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getBuildBase_Plugins(), this.getPlugin(), null, "plugins", null, 0, -1, BuildBase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getBuildBase_Filters(), theXMLTypePackage.getString(), "filters", null, 0, -1, BuildBase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(ciManagementEClass, CiManagement.class, "CiManagement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getCiManagement_System(), theXMLTypePackage.getString(), "system", null, 0, 1, CiManagement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getCiManagement_Url(), theXMLTypePackage.getString(), "url", null, 0, 1, CiManagement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getCiManagement_Notifiers(), this.getNotifier(), null, "notifiers", null, 0, -1, CiManagement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(contributorEClass, Contributor.class, "Contributor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getContributor_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Contributor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getContributor_Email(), theXMLTypePackage.getString(), "email", null, 0, 1, Contributor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getContributor_Url(), theXMLTypePackage.getString(), "url", null, 0, 1, Contributor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getContributor_Organization(), theXMLTypePackage.getString(), "organization", null, 0, 1, Contributor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getContributor_OrganizationUrl(), theXMLTypePackage.getString(), "organizationUrl", null, 0, 1, Contributor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getContributor_Timezone(), theXMLTypePackage.getString(), "timezone", null, 0, 1, Contributor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getContributor_Properties(), this.getPropertyElement(), null, "properties", null, 0, -1, Contributor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getContributor_Roles(), theXMLTypePackage.getString(), "roles", null, 0, -1, Contributor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(dependencyEClass, Dependency.class, "Dependency", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getDependency_GroupId(), theXMLTypePackage.getString(), "groupId", null, 0, 1, Dependency.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDependency_ArtifactId(), theXMLTypePackage.getString(), "artifactId", null, 0, 1, Dependency.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDependency_Version(), theXMLTypePackage.getString(), "version", null, 0, 1, Dependency.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDependency_Type(), theXMLTypePackage.getString(), "type", null, 0, 1, Dependency.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDependency_Classifier(), theXMLTypePackage.getString(), "classifier", null, 0, 1, Dependency.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDependency_Scope(), theXMLTypePackage.getString(), "scope", null, 0, 1, Dependency.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDependency_SystemPath(), theXMLTypePackage.getString(), "systemPath", null, 0, 1, Dependency.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getDependency_Exclusions(), this.getExclusion(), null, "exclusions", null, 0, -1, Dependency.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDependency_Optional(), theXMLTypePackage.getString(), "optional", "false", 0, 1, Dependency.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(dependencyManagementEClass, DependencyManagement.class, "DependencyManagement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getDependencyManagement_Dependencies(), this.getDependency(), null, "dependencies", null, 0, -1, DependencyManagement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(deploymentRepositoryEClass, DeploymentRepository.class, "DeploymentRepository", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getDeploymentRepository_UniqueVersion(), theXMLTypePackage.getString(), "uniqueVersion", "true", 0, 1, DeploymentRepository.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDeploymentRepository_Id(), theXMLTypePackage.getString(), "id", null, 0, 1, DeploymentRepository.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDeploymentRepository_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, DeploymentRepository.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDeploymentRepository_Url(), theXMLTypePackage.getString(), "url", null, 0, 1, DeploymentRepository.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDeploymentRepository_Layout(), theXMLTypePackage.getString(), "layout", null, 0, 1, DeploymentRepository.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(developerEClass, Developer.class, "Developer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getDeveloper_Id(), theXMLTypePackage.getString(), "id", null, 0, 1, Developer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDeveloper_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Developer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDeveloper_Email(), theXMLTypePackage.getString(), "email", null, 0, 1, Developer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDeveloper_Url(), theXMLTypePackage.getString(), "url", null, 0, 1, Developer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDeveloper_Organization(), theXMLTypePackage.getString(), "organization", null, 0, 1, Developer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDeveloper_OrganizationUrl(), theXMLTypePackage.getString(), "organizationUrl", null, 0, 1, Developer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDeveloper_Timezone(), theXMLTypePackage.getString(), "timezone", null, 0, 1, Developer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getDeveloper_Properties(), this.getPropertyElement(), null, "properties", null, 0, -1, Developer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDeveloper_Roles(), theXMLTypePackage.getString(), "roles", null, 0, -1, Developer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(distributionManagementEClass, DistributionManagement.class, "DistributionManagement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getDistributionManagement_Repository(), this.getDeploymentRepository(), null, "repository", null, 0, 1, DistributionManagement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getDistributionManagement_SnapshotRepository(), this.getDeploymentRepository(), null, "snapshotRepository", null, 0, 1, DistributionManagement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getDistributionManagement_Site(), this.getSite(), null, "site", null, 0, 1, DistributionManagement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDistributionManagement_DownloadUrl(), theXMLTypePackage.getString(), "downloadUrl", null, 0, 1, DistributionManagement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getDistributionManagement_Relocation(), this.getRelocation(), null, "relocation", null, 0, 1, DistributionManagement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDistributionManagement_Status(), theXMLTypePackage.getString(), "status", null, 0, 1, DistributionManagement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(documentRootEClass, DocumentRoot.class, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getDocumentRoot_Project(), this.getModel(), null, "project", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+
+ initEClass(exclusionEClass, Exclusion.class, "Exclusion", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getExclusion_ArtifactId(), theXMLTypePackage.getString(), "artifactId", null, 0, 1, Exclusion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getExclusion_GroupId(), theXMLTypePackage.getString(), "groupId", null, 0, 1, Exclusion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(extensionEClass, Extension.class, "Extension", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getExtension_GroupId(), theXMLTypePackage.getString(), "groupId", null, 0, 1, Extension.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getExtension_ArtifactId(), theXMLTypePackage.getString(), "artifactId", null, 0, 1, Extension.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getExtension_Version(), theXMLTypePackage.getString(), "version", null, 0, 1, Extension.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(issueManagementEClass, IssueManagement.class, "IssueManagement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getIssueManagement_System(), theXMLTypePackage.getString(), "system", null, 0, 1, IssueManagement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getIssueManagement_Url(), theXMLTypePackage.getString(), "url", null, 0, 1, IssueManagement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(licenseEClass, License.class, "License", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getLicense_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, License.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getLicense_Url(), theXMLTypePackage.getString(), "url", null, 0, 1, License.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getLicense_Distribution(), theXMLTypePackage.getString(), "distribution", null, 0, 1, License.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getLicense_Comments(), theXMLTypePackage.getString(), "comments", null, 0, 1, License.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(mailingListEClass, MailingList.class, "MailingList", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getMailingList_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, MailingList.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getMailingList_Subscribe(), theXMLTypePackage.getString(), "subscribe", null, 0, 1, MailingList.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getMailingList_Unsubscribe(), theXMLTypePackage.getString(), "unsubscribe", null, 0, 1, MailingList.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getMailingList_Post(), theXMLTypePackage.getString(), "post", null, 0, 1, MailingList.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getMailingList_Archive(), theXMLTypePackage.getString(), "archive", null, 0, 1, MailingList.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getMailingList_OtherArchives(), ecorePackage.getEString(), "otherArchives", null, 0, -1, MailingList.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getModel_Parent(), this.getParent(), null, "parent", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getModel_ModelVersion(), theXMLTypePackage.getString(), "modelVersion", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getModel_GroupId(), theXMLTypePackage.getString(), "groupId", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getModel_ArtifactId(), theXMLTypePackage.getString(), "artifactId", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getModel_Packaging(), theXMLTypePackage.getString(), "packaging", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getModel_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getModel_Version(), theXMLTypePackage.getString(), "version", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getModel_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getModel_Url(), theXMLTypePackage.getString(), "url", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_Prerequisites(), this.getPrerequisites(), null, "prerequisites", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_IssueManagement(), this.getIssueManagement(), null, "issueManagement", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_CiManagement(), this.getCiManagement(), null, "ciManagement", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getModel_InceptionYear(), theXMLTypePackage.getString(), "inceptionYear", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_MailingLists(), this.getMailingList(), null, "mailingLists", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_Developers(), this.getDeveloper(), null, "developers", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_Contributors(), this.getContributor(), null, "contributors", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_Licenses(), this.getLicense(), null, "licenses", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_Scm(), this.getScm(), null, "scm", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_Organization(), this.getOrganization(), null, "organization", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_Build(), this.getBuild(), null, "build", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_Profiles(), this.getProfile(), null, "profiles", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_Repositories(), this.getRepository(), null, "repositories", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_PluginRepositories(), this.getRepository(), null, "pluginRepositories", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_Dependencies(), this.getDependency(), null, "dependencies", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_Reporting(), this.getReporting(), null, "reporting", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_DependencyManagement(), this.getDependencyManagement(), null, "dependencyManagement", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_DistributionManagement(), this.getDistributionManagement(), null, "distributionManagement", null, 0, 1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getModel_Properties(), this.getPropertyElement(), null, "properties", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getModel_Modules(), theXMLTypePackage.getString(), "modules", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(notifierEClass, Notifier.class, "Notifier", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getNotifier_Type(), theXMLTypePackage.getString(), "type", null, 0, 1, Notifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getNotifier_SendOnError(), theXMLTypePackage.getString(), "sendOnError", "true", 0, 1, Notifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getNotifier_SendOnFailure(), theXMLTypePackage.getString(), "sendOnFailure", "true", 0, 1, Notifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getNotifier_SendOnSuccess(), theXMLTypePackage.getString(), "sendOnSuccess", "true", 0, 1, Notifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getNotifier_SendOnWarning(), theXMLTypePackage.getString(), "sendOnWarning", "true", 0, 1, Notifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getNotifier_Address(), theXMLTypePackage.getString(), "address", null, 0, 1, Notifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getNotifier_Configuration(), this.getPropertyElement(), null, "configuration", null, 0, -1, Notifier.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(organizationEClass, Organization.class, "Organization", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getOrganization_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Organization.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getOrganization_Url(), theXMLTypePackage.getString(), "url", null, 0, 1, Organization.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(parentEClass, Parent.class, "Parent", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getParent_ArtifactId(), theXMLTypePackage.getString(), "artifactId", null, 0, 1, Parent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getParent_GroupId(), theXMLTypePackage.getString(), "groupId", null, 0, 1, Parent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getParent_Version(), theXMLTypePackage.getString(), "version", null, 0, 1, Parent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getParent_RelativePath(), theXMLTypePackage.getString(), "relativePath", null, 0, 1, Parent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(pluginEClass, Plugin.class, "Plugin", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getPlugin_GroupId(), theXMLTypePackage.getString(), "groupId", null, 0, 1, Plugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPlugin_ArtifactId(), theXMLTypePackage.getString(), "artifactId", null, 0, 1, Plugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPlugin_Version(), theXMLTypePackage.getString(), "version", null, 0, 1, Plugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPlugin_Extensions(), theXMLTypePackage.getString(), "extensions", "false", 0, 1, Plugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getPlugin_Executions(), this.getPluginExecution(), null, "executions", null, 0, -1, Plugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getPlugin_Dependencies(), this.getDependency(), null, "dependencies", null, 0, -1, Plugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPlugin_Inherited(), theXMLTypePackage.getString(), "inherited", null, 0, 1, Plugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getPlugin_Configuration(), this.getConfiguration(), null, "configuration", null, 0, 1, Plugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(pluginExecutionEClass, PluginExecution.class, "PluginExecution", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getPluginExecution_Id(), theXMLTypePackage.getString(), "id", null, 0, 1, PluginExecution.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPluginExecution_Phase(), theXMLTypePackage.getString(), "phase", null, 0, 1, PluginExecution.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPluginExecution_Inherited(), theXMLTypePackage.getString(), "inherited", null, 0, 1, PluginExecution.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPluginExecution_Goals(), theXMLTypePackage.getString(), "goals", null, 0, -1, PluginExecution.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getPluginExecution_Configuration(), this.getConfiguration(), null, "configuration", null, 0, 1, PluginExecution.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(pluginManagementEClass, PluginManagement.class, "PluginManagement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getPluginManagement_Plugins(), this.getPlugin(), null, "plugins", null, 0, -1, PluginManagement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(prerequisitesEClass, Prerequisites.class, "Prerequisites", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getPrerequisites_Maven(), theXMLTypePackage.getString(), "maven", null, 0, 1, Prerequisites.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(profileEClass, Profile.class, "Profile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getProfile_Id(), theXMLTypePackage.getString(), "id", null, 0, 1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getProfile_Activation(), this.getActivation(), null, "activation", null, 0, 1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getProfile_Build(), this.getBuildBase(), null, "build", null, 0, 1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getProfile_Repositories(), this.getRepository(), null, "repositories", null, 0, -1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getProfile_PluginRepositories(), this.getRepository(), null, "pluginRepositories", null, 0, -1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getProfile_Dependencies(), this.getDependency(), null, "dependencies", null, 0, -1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getProfile_Reports(), this.getReportPlugin(), null, "reports", null, 0, -1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getProfile_DependencyManagement(), this.getDependencyManagement(), null, "dependencyManagement", null, 0, 1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getProfile_DistributionManagement(), this.getDistributionManagement(), null, "distributionManagement", null, 0, 1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getProfile_Properties(), this.getPropertyElement(), null, "properties", null, 0, -1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getProfile_Modules(), theXMLTypePackage.getString(), "modules", null, 0, -1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getProfile_Reporting(), this.getReporting(), null, "reporting", null, 0, 1, Profile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(relocationEClass, Relocation.class, "Relocation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getRelocation_GroupId(), theXMLTypePackage.getString(), "groupId", null, 0, 1, Relocation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getRelocation_ArtifactId(), theXMLTypePackage.getString(), "artifactId", null, 0, 1, Relocation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getRelocation_Version(), theXMLTypePackage.getString(), "version", null, 0, 1, Relocation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getRelocation_Message(), theXMLTypePackage.getString(), "message", null, 0, 1, Relocation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(reportingEClass, Reporting.class, "Reporting", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getReporting_ExcludeDefaults(), theXMLTypePackage.getString(), "excludeDefaults", "false", 0, 1, Reporting.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getReporting_OutputDirectory(), theXMLTypePackage.getString(), "outputDirectory", null, 0, 1, Reporting.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getReporting_Plugins(), this.getReportPlugin(), null, "plugins", null, 0, -1, Reporting.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(reportPluginEClass, ReportPlugin.class, "ReportPlugin", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getReportPlugin_GroupId(), theXMLTypePackage.getString(), "groupId", null, 0, 1, ReportPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getReportPlugin_ArtifactId(), theXMLTypePackage.getString(), "artifactId", null, 0, 1, ReportPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getReportPlugin_Version(), theXMLTypePackage.getString(), "version", null, 0, 1, ReportPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getReportPlugin_Inherited(), theXMLTypePackage.getString(), "inherited", null, 0, 1, ReportPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getReportPlugin_ReportSets(), this.getReportSet(), null, "reportSets", null, 0, -1, ReportPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getReportPlugin_Configuration(), this.getConfiguration(), null, "configuration", null, 0, 1, ReportPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(reportSetEClass, ReportSet.class, "ReportSet", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getReportSet_Id(), theXMLTypePackage.getString(), "id", null, 0, 1, ReportSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getReportSet_Inherited(), theXMLTypePackage.getString(), "inherited", null, 0, 1, ReportSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getReportSet_Reports(), theXMLTypePackage.getString(), "reports", null, 0, -1, ReportSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getReportSet_Configuration(), this.getConfiguration(), null, "configuration", null, 0, 1, ReportSet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(repositoryEClass, Repository.class, "Repository", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getRepository_Releases(), this.getRepositoryPolicy(), null, "releases", null, 0, 1, Repository.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getRepository_Snapshots(), this.getRepositoryPolicy(), null, "snapshots", null, 0, 1, Repository.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getRepository_Id(), theXMLTypePackage.getString(), "id", null, 0, 1, Repository.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getRepository_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Repository.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getRepository_Url(), theXMLTypePackage.getString(), "url", null, 0, 1, Repository.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getRepository_Layout(), theXMLTypePackage.getString(), "layout", null, 0, 1, Repository.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(repositoryPolicyEClass, RepositoryPolicy.class, "RepositoryPolicy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getRepositoryPolicy_Enabled(), theXMLTypePackage.getString(), "enabled", "true", 0, 1, RepositoryPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getRepositoryPolicy_UpdatePolicy(), theXMLTypePackage.getString(), "updatePolicy", null, 0, 1, RepositoryPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getRepositoryPolicy_ChecksumPolicy(), theXMLTypePackage.getString(), "checksumPolicy", null, 0, 1, RepositoryPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(resourceEClass, Resource.class, "Resource", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getResource_TargetPath(), theXMLTypePackage.getString(), "targetPath", null, 0, 1, Resource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getResource_Filtering(), theXMLTypePackage.getString(), "filtering", "false", 0, 1, Resource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getResource_Directory(), theXMLTypePackage.getString(), "directory", null, 0, 1, Resource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getResource_Includes(), theXMLTypePackage.getString(), "includes", null, 0, -1, Resource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getResource_Excludes(), theXMLTypePackage.getString(), "excludes", null, 0, -1, Resource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(scmEClass, Scm.class, "Scm", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getScm_Connection(), theXMLTypePackage.getString(), "connection", null, 0, 1, Scm.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getScm_DeveloperConnection(), theXMLTypePackage.getString(), "developerConnection", null, 0, 1, Scm.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getScm_Tag(), theXMLTypePackage.getString(), "tag", null, 0, 1, Scm.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getScm_Url(), theXMLTypePackage.getString(), "url", null, 0, 1, Scm.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(siteEClass, Site.class, "Site", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getSite_Id(), theXMLTypePackage.getString(), "id", null, 0, 1, Site.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getSite_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, Site.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getSite_Url(), theXMLTypePackage.getString(), "url", null, 0, 1, Site.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(propertyElementEClass, PropertyElement.class, "PropertyElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getPropertyElement_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, PropertyElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPropertyElement_Value(), theXMLTypePackage.getString(), "value", null, 0, 1, PropertyElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(configurationEClass, Configuration.class, "Configuration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
+ // Create resource
+ createResource(eNS_URI);
+
+ // Create annotations
+ // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
+ createExtendedMetaDataAnnotations();
+ }
+
+ /**
+ * Initializes the annotations for
+ * <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void createExtendedMetaDataAnnotations() {
+ String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
+ addAnnotation
+ (activationEClass,
+ source,
+ new String[] {
+ "name", "Activation",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getActivation_ActiveByDefault(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "activeByDefault",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getActivation_Jdk(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "jdk",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getActivation_Os(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "os",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getActivation_Property(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "property",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getActivation_File(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "file",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (activationFileEClass,
+ source,
+ new String[] {
+ "name", "ActivationFile",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getActivationFile_Missing(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "missing",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getActivationFile_Exists(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "exists",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (activationOSEClass,
+ source,
+ new String[] {
+ "name", "ActivationOS",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getActivationOS_Name(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "name",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getActivationOS_Family(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "family",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getActivationOS_Arch(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "arch",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getActivationOS_Version(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "version",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (activationPropertyEClass,
+ source,
+ new String[] {
+ "name", "ActivationProperty",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getActivationProperty_Name(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "name",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getActivationProperty_Value(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "value",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (buildEClass,
+ source,
+ new String[] {
+ "name", "Build",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getBuild_SourceDirectory(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "sourceDirectory",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getBuild_ScriptSourceDirectory(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "scriptSourceDirectory",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getBuild_TestSourceDirectory(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "testSourceDirectory",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getBuild_OutputDirectory(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "outputDirectory",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getBuild_TestOutputDirectory(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "testOutputDirectory",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getBuild_Extensions(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "extensions",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (buildBaseEClass,
+ source,
+ new String[] {
+ "name", "BuildBase",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getBuildBase_DefaultGoal(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "defaultGoal",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getBuildBase_Resources(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "resources",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getBuildBase_TestResources(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "testResources",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getBuildBase_Directory(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "directory",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getBuildBase_FinalName(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "finalName",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getBuildBase_PluginManagement(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "pluginManagement",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getBuildBase_Plugins(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "plugins",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (ciManagementEClass,
+ source,
+ new String[] {
+ "name", "CiManagement",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getCiManagement_System(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "system",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getCiManagement_Url(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "url",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getCiManagement_Notifiers(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "notifiers",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (contributorEClass,
+ source,
+ new String[] {
+ "name", "Contributor",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getContributor_Name(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "name",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getContributor_Email(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "email",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getContributor_Url(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "url",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getContributor_Organization(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "organization",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getContributor_OrganizationUrl(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "organizationUrl",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getContributor_Timezone(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "timezone",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getContributor_Properties(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "properties",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (dependencyEClass,
+ source,
+ new String[] {
+ "name", "Dependency",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getDependency_GroupId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "groupId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDependency_ArtifactId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "artifactId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDependency_Version(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "version",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDependency_Type(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "type",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDependency_Classifier(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "classifier",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDependency_Scope(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "scope",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDependency_SystemPath(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "systemPath",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDependency_Exclusions(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "exclusions",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDependency_Optional(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "optional",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (dependencyManagementEClass,
+ source,
+ new String[] {
+ "name", "DependencyManagement",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getDependencyManagement_Dependencies(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "dependencies",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (deploymentRepositoryEClass,
+ source,
+ new String[] {
+ "name", "DeploymentRepository",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getDeploymentRepository_UniqueVersion(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "uniqueVersion",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDeploymentRepository_Id(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "id",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDeploymentRepository_Name(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "name",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDeploymentRepository_Url(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "url",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDeploymentRepository_Layout(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "layout",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (developerEClass,
+ source,
+ new String[] {
+ "name", "Developer",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getDeveloper_Id(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "id",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDeveloper_Name(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "name",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDeveloper_Email(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "email",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDeveloper_Url(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "url",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDeveloper_Organization(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "organization",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDeveloper_OrganizationUrl(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "organizationUrl",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDeveloper_Timezone(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "timezone",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDeveloper_Properties(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "properties",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (distributionManagementEClass,
+ source,
+ new String[] {
+ "name", "DistributionManagement",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getDistributionManagement_Repository(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "repository",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDistributionManagement_SnapshotRepository(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "snapshotRepository",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDistributionManagement_Site(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "site",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDistributionManagement_DownloadUrl(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "downloadUrl",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDistributionManagement_Relocation(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "relocation",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getDistributionManagement_Status(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "status",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (documentRootEClass,
+ source,
+ new String[] {
+ "name", "",
+ "kind", "mixed"
+ });
+ addAnnotation
+ (getDocumentRoot_Mixed(),
+ source,
+ new String[] {
+ "kind", "elementWildcard",
+ "name", ":mixed"
+ });
+ addAnnotation
+ (getDocumentRoot_XMLNSPrefixMap(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "xmlns:prefix"
+ });
+ addAnnotation
+ (getDocumentRoot_XSISchemaLocation(),
+ source,
+ new String[] {
+ "kind", "attribute",
+ "name", "xsi:schemaLocation"
+ });
+ addAnnotation
+ (getDocumentRoot_Project(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "project",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (exclusionEClass,
+ source,
+ new String[] {
+ "name", "Exclusion",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getExclusion_ArtifactId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "artifactId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getExclusion_GroupId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "groupId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (extensionEClass,
+ source,
+ new String[] {
+ "name", "Extension",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getExtension_GroupId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "groupId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getExtension_ArtifactId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "artifactId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getExtension_Version(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "version",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (issueManagementEClass,
+ source,
+ new String[] {
+ "name", "IssueManagement",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getIssueManagement_System(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "system",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getIssueManagement_Url(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "url",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (licenseEClass,
+ source,
+ new String[] {
+ "name", "License",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getLicense_Name(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "name",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getLicense_Url(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "url",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getLicense_Distribution(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "distribution",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getLicense_Comments(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "comments",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (mailingListEClass,
+ source,
+ new String[] {
+ "name", "MailingList",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getMailingList_Name(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "name",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getMailingList_Subscribe(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "subscribe",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getMailingList_Unsubscribe(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "unsubscribe",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getMailingList_Post(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "post",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getMailingList_Archive(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "archive",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (modelEClass,
+ source,
+ new String[] {
+ "name", "Model",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getModel_Parent(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "parent",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_ModelVersion(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "modelVersion",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_GroupId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "groupId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_ArtifactId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "artifactId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Packaging(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "packaging",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Name(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "name",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Version(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "version",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Description(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "description",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Url(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "url",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Prerequisites(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "prerequisites",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_IssueManagement(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "issueManagement",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_CiManagement(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "ciManagement",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_InceptionYear(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "inceptionYear",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_MailingLists(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "mailingLists",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Developers(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "developers",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Contributors(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "contributors",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Licenses(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "licenses",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Scm(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "scm",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Organization(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "organization",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Build(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "build",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Profiles(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "profiles",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Repositories(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "repositories",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_PluginRepositories(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "pluginRepositories",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Dependencies(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "dependencies",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Reporting(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "reporting",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_DependencyManagement(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "dependencyManagement",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_DistributionManagement(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "distributionManagement",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getModel_Properties(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "properties",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (notifierEClass,
+ source,
+ new String[] {
+ "name", "Notifier",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getNotifier_Type(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "type",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getNotifier_SendOnError(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "sendOnError",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getNotifier_SendOnFailure(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "sendOnFailure",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getNotifier_SendOnSuccess(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "sendOnSuccess",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getNotifier_SendOnWarning(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "sendOnWarning",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getNotifier_Address(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "address",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (organizationEClass,
+ source,
+ new String[] {
+ "name", "Organization",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getOrganization_Name(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "name",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getOrganization_Url(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "url",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (parentEClass,
+ source,
+ new String[] {
+ "name", "Parent",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getParent_ArtifactId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "artifactId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getParent_GroupId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "groupId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getParent_Version(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "version",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getParent_RelativePath(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "relativePath",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (pluginEClass,
+ source,
+ new String[] {
+ "name", "Plugin",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getPlugin_GroupId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "groupId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getPlugin_ArtifactId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "artifactId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getPlugin_Version(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "version",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getPlugin_Extensions(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "extensions",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getPlugin_Executions(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "executions",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getPlugin_Dependencies(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "dependencies",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getPlugin_Inherited(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "inherited",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (pluginExecutionEClass,
+ source,
+ new String[] {
+ "name", "PluginExecution",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getPluginExecution_Id(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "id",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getPluginExecution_Phase(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "phase",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getPluginExecution_Inherited(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "inherited",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (pluginManagementEClass,
+ source,
+ new String[] {
+ "name", "PluginManagement",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getPluginManagement_Plugins(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "plugins",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (prerequisitesEClass,
+ source,
+ new String[] {
+ "name", "Prerequisites",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getPrerequisites_Maven(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "maven",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (profileEClass,
+ source,
+ new String[] {
+ "name", "Profile",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getProfile_Id(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "id",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getProfile_Activation(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "activation",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getProfile_Build(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "build",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getProfile_Repositories(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "repositories",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getProfile_PluginRepositories(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "pluginRepositories",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getProfile_Dependencies(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "dependencies",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getProfile_Reports(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "reports",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getProfile_DependencyManagement(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "dependencyManagement",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getProfile_DistributionManagement(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "distributionManagement",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getProfile_Properties(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "properties",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (relocationEClass,
+ source,
+ new String[] {
+ "name", "Relocation",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getRelocation_GroupId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "groupId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getRelocation_ArtifactId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "artifactId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getRelocation_Version(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "version",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getRelocation_Message(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "message",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (reportingEClass,
+ source,
+ new String[] {
+ "name", "Reporting",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getReporting_ExcludeDefaults(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "excludeDefaults",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getReporting_OutputDirectory(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "outputDirectory",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getReporting_Plugins(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "plugins",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (reportPluginEClass,
+ source,
+ new String[] {
+ "name", "ReportPlugin",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getReportPlugin_GroupId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "groupId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getReportPlugin_ArtifactId(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "artifactId",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getReportPlugin_Version(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "version",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getReportPlugin_Inherited(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "inherited",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getReportPlugin_ReportSets(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "reportSets",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (reportSetEClass,
+ source,
+ new String[] {
+ "name", "ReportSet",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getReportSet_Id(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "id",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getReportSet_Inherited(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "inherited",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (repositoryEClass,
+ source,
+ new String[] {
+ "name", "Repository",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getRepository_Releases(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "releases",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getRepository_Snapshots(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "snapshots",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getRepository_Id(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "id",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getRepository_Name(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "name",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getRepository_Url(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "url",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getRepository_Layout(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "layout",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (repositoryPolicyEClass,
+ source,
+ new String[] {
+ "name", "RepositoryPolicy",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getRepositoryPolicy_Enabled(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "enabled",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getRepositoryPolicy_UpdatePolicy(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "updatePolicy",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getRepositoryPolicy_ChecksumPolicy(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "checksumPolicy",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (resourceEClass,
+ source,
+ new String[] {
+ "name", "Resource",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getResource_TargetPath(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "targetPath",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getResource_Filtering(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "filtering",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getResource_Directory(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "directory",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (scmEClass,
+ source,
+ new String[] {
+ "name", "Scm",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getScm_Connection(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "connection",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getScm_DeveloperConnection(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "developerConnection",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getScm_Tag(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "tag",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getScm_Url(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "url",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (siteEClass,
+ source,
+ new String[] {
+ "name", "Site",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getSite_Id(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "id",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getSite_Name(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "name",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (getSite_Url(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "url",
+ "namespace", "##targetNamespace"
+ });
+ }
+
+} // PomPackageImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PrerequisitesImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PrerequisitesImpl.java
new file mode 100644
index 00000000..729fbd98
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PrerequisitesImpl.java
@@ -0,0 +1,214 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Prerequisites;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Prerequisites</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PrerequisitesImpl#getMaven <em>
+ * Maven</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class PrerequisitesImpl extends EObjectImpl implements Prerequisites {
+ /**
+ * The default value of the '{@link #getMaven() <em>Maven</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getMaven()
+ * @generated
+ * @ordered
+ */
+ protected static final String MAVEN_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getMaven() <em>Maven</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getMaven()
+ * @generated
+ * @ordered
+ */
+ protected String maven = MAVEN_EDEFAULT;
+
+ /**
+ * This is true if the Maven attribute has been set. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean mavenESet;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PrerequisitesImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.PREREQUISITES;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getMaven() {
+ return maven;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setMaven(String newMaven) {
+ String oldMaven = maven;
+ maven = newMaven;
+ boolean oldMavenESet = mavenESet;
+ mavenESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PREREQUISITES__MAVEN, oldMaven, maven,
+ !oldMavenESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetMaven() {
+ String oldMaven = maven;
+ boolean oldMavenESet = mavenESet;
+ maven = MAVEN_EDEFAULT;
+ mavenESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.PREREQUISITES__MAVEN, oldMaven, MAVEN_EDEFAULT,
+ oldMavenESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetMaven() {
+ return mavenESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.PREREQUISITES__MAVEN:
+ return getMaven();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.PREREQUISITES__MAVEN:
+ setMaven((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.PREREQUISITES__MAVEN:
+ unsetMaven();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.PREREQUISITES__MAVEN:
+ return isSetMaven();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (maven: "); //$NON-NLS-1$
+ if (mavenESet)
+ result.append(maven);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(')');
+ return result.toString();
+ }
+
+} // PrerequisitesImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ProfileImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ProfileImpl.java
new file mode 100644
index 00000000..3e3555ad
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ProfileImpl.java
@@ -0,0 +1,1233 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EDataTypeEList;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.Activation;
+import org.eclipse.m2e.model.edit.pom.BuildBase;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.DependencyManagement;
+import org.eclipse.m2e.model.edit.pom.DistributionManagement;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Profile;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+import org.eclipse.m2e.model.edit.pom.ReportPlugin;
+import org.eclipse.m2e.model.edit.pom.Reporting;
+import org.eclipse.m2e.model.edit.pom.Repository;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Profile</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl#getActivation <em>
+ * Activation</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl#getBuild <em>Build
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl#getRepositories <em>
+ * Repositories</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl#getPluginRepositories
+ * <em>Plugin Repositories</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl#getDependencies <em>
+ * Dependencies</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl#getReports <em>
+ * Reports</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl#getDependencyManagement
+ * <em>Dependency Management</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl#getDistributionManagement
+ * <em>Distribution Management</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl#getProperties <em>
+ * Properties</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl#getModules <em>
+ * Modules</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ProfileImpl#getReporting <em>
+ * Reporting</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ProfileImpl extends EObjectImpl implements Profile {
+ /**
+ * The default value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected String id = ID_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getActivation() <em>Activation</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getActivation()
+ * @generated
+ * @ordered
+ */
+ protected Activation activation;
+
+ /**
+ * This is true if the Activation containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean activationESet;
+
+ /**
+ * The cached value of the '{@link #getBuild() <em>Build</em>}' containment
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getBuild()
+ * @generated
+ * @ordered
+ */
+ protected BuildBase build;
+
+ /**
+ * This is true if the Build containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean buildESet;
+
+ /**
+ * The cached value of the '{@link #getRepositories() <em>Repositories</em>}
+ * ' containment reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #getRepositories()
+ * @generated
+ * @ordered
+ */
+ protected EList<Repository> repositories;
+
+ /**
+ * The cached value of the '{@link #getPluginRepositories()
+ * <em>Plugin Repositories</em>}' containment reference list. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getPluginRepositories()
+ * @generated
+ * @ordered
+ */
+ protected EList<Repository> pluginRepositories;
+
+ /**
+ * The cached value of the '{@link #getDependencies() <em>Dependencies</em>}
+ * ' containment reference list. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @see #getDependencies()
+ * @generated
+ * @ordered
+ */
+ protected EList<Dependency> dependencies;
+
+ /**
+ * The cached value of the '{@link #getReports() <em>Reports</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getReports()
+ * @generated
+ * @ordered
+ */
+ protected EList<ReportPlugin> reports;
+
+ /**
+ * The cached value of the '{@link #getDependencyManagement()
+ * <em>Dependency Management</em>}' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDependencyManagement()
+ * @generated
+ * @ordered
+ */
+ protected DependencyManagement dependencyManagement;
+
+ /**
+ * This is true if the Dependency Management containment reference has been
+ * set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean dependencyManagementESet;
+
+ /**
+ * The cached value of the '{@link #getDistributionManagement()
+ * <em>Distribution Management</em>}' containment reference. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDistributionManagement()
+ * @generated
+ * @ordered
+ */
+ protected DistributionManagement distributionManagement;
+
+ /**
+ * This is true if the Distribution Management containment reference has
+ * been set. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean distributionManagementESet;
+
+ /**
+ * The cached value of the '{@link #getProperties() <em>Properties</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getProperties()
+ * @generated
+ * @ordered
+ */
+ protected EList<PropertyElement> properties;
+
+ /**
+ * The cached value of the '{@link #getModules() <em>Modules</em>}'
+ * attribute list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getModules()
+ * @generated
+ * @ordered
+ */
+ protected EList<String> modules;
+
+ /**
+ * The cached value of the '{@link #getReporting() <em>Reporting</em>}'
+ * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getReporting()
+ * @generated
+ * @ordered
+ */
+ protected Reporting reporting;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ProfileImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.PROFILE;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setId(String newId) {
+ String oldId = id;
+ id = newId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PROFILE__ID, oldId, id));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Activation getActivation() {
+ return activation;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetActivation(Activation newActivation,
+ NotificationChain msgs) {
+ Activation oldActivation = activation;
+ activation = newActivation;
+ boolean oldActivationESet = activationESet;
+ activationESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.PROFILE__ACTIVATION,
+ oldActivation, newActivation, !oldActivationESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setActivation(Activation newActivation) {
+ if (newActivation != activation) {
+ NotificationChain msgs = null;
+ if (activation != null)
+ msgs = ((InternalEObject) activation)
+ .eInverseRemove(this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.PROFILE__ACTIVATION, null, msgs);
+ if (newActivation != null)
+ msgs = ((InternalEObject) newActivation)
+ .eInverseAdd(this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.PROFILE__ACTIVATION, null, msgs);
+ msgs = basicSetActivation(newActivation, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldActivationESet = activationESet;
+ activationESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PROFILE__ACTIVATION, newActivation,
+ newActivation, !oldActivationESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetActivation(NotificationChain msgs) {
+ Activation oldActivation = activation;
+ activation = null;
+ boolean oldActivationESet = activationESet;
+ activationESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.PROFILE__ACTIVATION,
+ oldActivation, null, oldActivationESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetActivation() {
+ if (activation != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) activation).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.PROFILE__ACTIVATION,
+ null, msgs);
+ msgs = basicUnsetActivation(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldActivationESet = activationESet;
+ activationESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.PROFILE__ACTIVATION, null, null,
+ oldActivationESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetActivation() {
+ return activationESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public BuildBase getBuild() {
+ return build;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetBuild(BuildBase newBuild,
+ NotificationChain msgs) {
+ BuildBase oldBuild = build;
+ build = newBuild;
+ boolean oldBuildESet = buildESet;
+ buildESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.PROFILE__BUILD, oldBuild,
+ newBuild, !oldBuildESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setBuild(BuildBase newBuild) {
+ if (newBuild != build) {
+ NotificationChain msgs = null;
+ if (build != null)
+ msgs = ((InternalEObject) build).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.PROFILE__BUILD,
+ null, msgs);
+ if (newBuild != null)
+ msgs = ((InternalEObject) newBuild).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.PROFILE__BUILD,
+ null, msgs);
+ msgs = basicSetBuild(newBuild, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldBuildESet = buildESet;
+ buildESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PROFILE__BUILD, newBuild, newBuild,
+ !oldBuildESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetBuild(NotificationChain msgs) {
+ BuildBase oldBuild = build;
+ build = null;
+ boolean oldBuildESet = buildESet;
+ buildESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.PROFILE__BUILD, oldBuild,
+ null, oldBuildESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetBuild() {
+ if (build != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) build).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.PROFILE__BUILD, null,
+ msgs);
+ msgs = basicUnsetBuild(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldBuildESet = buildESet;
+ buildESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.PROFILE__BUILD, null, null, oldBuildESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetBuild() {
+ return buildESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Repository> getRepositories() {
+ if (repositories == null) {
+ repositories = new EObjectContainmentEList.Unsettable<Repository>(
+ Repository.class, this, PomPackage.PROFILE__REPOSITORIES);
+ }
+ return repositories;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetRepositories() {
+ if (repositories != null)
+ ((InternalEList.Unsettable<?>) repositories).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetRepositories() {
+ return repositories != null
+ && ((InternalEList.Unsettable<?>) repositories).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Repository> getPluginRepositories() {
+ if (pluginRepositories == null) {
+ pluginRepositories = new EObjectContainmentEList.Unsettable<Repository>(
+ Repository.class, this,
+ PomPackage.PROFILE__PLUGIN_REPOSITORIES);
+ }
+ return pluginRepositories;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetPluginRepositories() {
+ if (pluginRepositories != null)
+ ((InternalEList.Unsettable<?>) pluginRepositories).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetPluginRepositories() {
+ return pluginRepositories != null
+ && ((InternalEList.Unsettable<?>) pluginRepositories).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Dependency> getDependencies() {
+ if (dependencies == null) {
+ dependencies = new EObjectContainmentEList.Unsettable<Dependency>(
+ Dependency.class, this, PomPackage.PROFILE__DEPENDENCIES);
+ }
+ return dependencies;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetDependencies() {
+ if (dependencies != null)
+ ((InternalEList.Unsettable<?>) dependencies).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetDependencies() {
+ return dependencies != null
+ && ((InternalEList.Unsettable<?>) dependencies).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<ReportPlugin> getReports() {
+ if (reports == null) {
+ reports = new EObjectContainmentEList.Unsettable<ReportPlugin>(
+ ReportPlugin.class, this, PomPackage.PROFILE__REPORTS);
+ }
+ return reports;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetReports() {
+ if (reports != null)
+ ((InternalEList.Unsettable<?>) reports).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetReports() {
+ return reports != null
+ && ((InternalEList.Unsettable<?>) reports).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DependencyManagement getDependencyManagement() {
+ return dependencyManagement;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetDependencyManagement(
+ DependencyManagement newDependencyManagement, NotificationChain msgs) {
+ DependencyManagement oldDependencyManagement = dependencyManagement;
+ dependencyManagement = newDependencyManagement;
+ boolean oldDependencyManagementESet = dependencyManagementESet;
+ dependencyManagementESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET,
+ PomPackage.PROFILE__DEPENDENCY_MANAGEMENT,
+ oldDependencyManagement, newDependencyManagement,
+ !oldDependencyManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setDependencyManagement(
+ DependencyManagement newDependencyManagement) {
+ if (newDependencyManagement != dependencyManagement) {
+ NotificationChain msgs = null;
+ if (dependencyManagement != null)
+ msgs = ((InternalEObject) dependencyManagement).eInverseRemove(
+ this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.PROFILE__DEPENDENCY_MANAGEMENT,
+ null, msgs);
+ if (newDependencyManagement != null)
+ msgs = ((InternalEObject) newDependencyManagement).eInverseAdd(
+ this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.PROFILE__DEPENDENCY_MANAGEMENT,
+ null, msgs);
+ msgs = basicSetDependencyManagement(newDependencyManagement, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldDependencyManagementESet = dependencyManagementESet;
+ dependencyManagementESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PROFILE__DEPENDENCY_MANAGEMENT,
+ newDependencyManagement, newDependencyManagement,
+ !oldDependencyManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetDependencyManagement(
+ NotificationChain msgs) {
+ DependencyManagement oldDependencyManagement = dependencyManagement;
+ dependencyManagement = null;
+ boolean oldDependencyManagementESet = dependencyManagementESet;
+ dependencyManagementESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET,
+ PomPackage.PROFILE__DEPENDENCY_MANAGEMENT,
+ oldDependencyManagement, null, oldDependencyManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetDependencyManagement() {
+ if (dependencyManagement != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) dependencyManagement).eInverseRemove(
+ this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.PROFILE__DEPENDENCY_MANAGEMENT, null,
+ msgs);
+ msgs = basicUnsetDependencyManagement(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldDependencyManagementESet = dependencyManagementESet;
+ dependencyManagementESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.PROFILE__DEPENDENCY_MANAGEMENT, null, null,
+ oldDependencyManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetDependencyManagement() {
+ return dependencyManagementESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DistributionManagement getDistributionManagement() {
+ return distributionManagement;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetDistributionManagement(
+ DistributionManagement newDistributionManagement,
+ NotificationChain msgs) {
+ DistributionManagement oldDistributionManagement = distributionManagement;
+ distributionManagement = newDistributionManagement;
+ boolean oldDistributionManagementESet = distributionManagementESet;
+ distributionManagementESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET,
+ PomPackage.PROFILE__DISTRIBUTION_MANAGEMENT,
+ oldDistributionManagement, newDistributionManagement,
+ !oldDistributionManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setDistributionManagement(
+ DistributionManagement newDistributionManagement) {
+ if (newDistributionManagement != distributionManagement) {
+ NotificationChain msgs = null;
+ if (distributionManagement != null)
+ msgs = ((InternalEObject) distributionManagement)
+ .eInverseRemove(this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.PROFILE__DISTRIBUTION_MANAGEMENT,
+ null, msgs);
+ if (newDistributionManagement != null)
+ msgs = ((InternalEObject) newDistributionManagement)
+ .eInverseAdd(this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.PROFILE__DISTRIBUTION_MANAGEMENT,
+ null, msgs);
+ msgs = basicSetDistributionManagement(newDistributionManagement,
+ msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldDistributionManagementESet = distributionManagementESet;
+ distributionManagementESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PROFILE__DISTRIBUTION_MANAGEMENT,
+ newDistributionManagement, newDistributionManagement,
+ !oldDistributionManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetDistributionManagement(
+ NotificationChain msgs) {
+ DistributionManagement oldDistributionManagement = distributionManagement;
+ distributionManagement = null;
+ boolean oldDistributionManagementESet = distributionManagementESet;
+ distributionManagementESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET,
+ PomPackage.PROFILE__DISTRIBUTION_MANAGEMENT,
+ oldDistributionManagement, null,
+ oldDistributionManagementESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetDistributionManagement() {
+ if (distributionManagement != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) distributionManagement).eInverseRemove(
+ this, EOPPOSITE_FEATURE_BASE
+ - PomPackage.PROFILE__DISTRIBUTION_MANAGEMENT,
+ null, msgs);
+ msgs = basicUnsetDistributionManagement(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldDistributionManagementESet = distributionManagementESet;
+ distributionManagementESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.PROFILE__DISTRIBUTION_MANAGEMENT, null,
+ null, oldDistributionManagementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetDistributionManagement() {
+ return distributionManagementESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<PropertyElement> getProperties() {
+ if (properties == null) {
+ properties = new EObjectContainmentEList.Unsettable<PropertyElement>(
+ PropertyElement.class, this, PomPackage.PROFILE__PROPERTIES);
+ }
+ return properties;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetProperties() {
+ if (properties != null)
+ ((InternalEList.Unsettable<?>) properties).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetProperties() {
+ return properties != null
+ && ((InternalEList.Unsettable<?>) properties).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<String> getModules() {
+ if (modules == null) {
+ modules = new EDataTypeEList<String>(String.class, this,
+ PomPackage.PROFILE__MODULES);
+ }
+ return modules;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Reporting getReporting() {
+ if (reporting != null && reporting.eIsProxy()) {
+ InternalEObject oldReporting = (InternalEObject) reporting;
+ reporting = (Reporting) eResolveProxy(oldReporting);
+ if (reporting != oldReporting) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE,
+ PomPackage.PROFILE__REPORTING, oldReporting,
+ reporting));
+ }
+ }
+ return reporting;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Reporting basicGetReporting() {
+ return reporting;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setReporting(Reporting newReporting) {
+ Reporting oldReporting = reporting;
+ reporting = newReporting;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PROFILE__REPORTING, oldReporting, reporting));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.PROFILE__ACTIVATION:
+ return basicUnsetActivation(msgs);
+ case PomPackage.PROFILE__BUILD:
+ return basicUnsetBuild(msgs);
+ case PomPackage.PROFILE__REPOSITORIES:
+ return ((InternalEList<?>) getRepositories()).basicRemove(otherEnd,
+ msgs);
+ case PomPackage.PROFILE__PLUGIN_REPOSITORIES:
+ return ((InternalEList<?>) getPluginRepositories()).basicRemove(
+ otherEnd, msgs);
+ case PomPackage.PROFILE__DEPENDENCIES:
+ return ((InternalEList<?>) getDependencies()).basicRemove(otherEnd,
+ msgs);
+ case PomPackage.PROFILE__REPORTS:
+ return ((InternalEList<?>) getReports())
+ .basicRemove(otherEnd, msgs);
+ case PomPackage.PROFILE__DEPENDENCY_MANAGEMENT:
+ return basicUnsetDependencyManagement(msgs);
+ case PomPackage.PROFILE__DISTRIBUTION_MANAGEMENT:
+ return basicUnsetDistributionManagement(msgs);
+ case PomPackage.PROFILE__PROPERTIES:
+ return ((InternalEList<?>) getProperties()).basicRemove(otherEnd,
+ msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.PROFILE__ID:
+ return getId();
+ case PomPackage.PROFILE__ACTIVATION:
+ return getActivation();
+ case PomPackage.PROFILE__BUILD:
+ return getBuild();
+ case PomPackage.PROFILE__REPOSITORIES:
+ return getRepositories();
+ case PomPackage.PROFILE__PLUGIN_REPOSITORIES:
+ return getPluginRepositories();
+ case PomPackage.PROFILE__DEPENDENCIES:
+ return getDependencies();
+ case PomPackage.PROFILE__REPORTS:
+ return getReports();
+ case PomPackage.PROFILE__DEPENDENCY_MANAGEMENT:
+ return getDependencyManagement();
+ case PomPackage.PROFILE__DISTRIBUTION_MANAGEMENT:
+ return getDistributionManagement();
+ case PomPackage.PROFILE__PROPERTIES:
+ return getProperties();
+ case PomPackage.PROFILE__MODULES:
+ return getModules();
+ case PomPackage.PROFILE__REPORTING:
+ if (resolve)
+ return getReporting();
+ return basicGetReporting();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.PROFILE__ID:
+ setId((String) newValue);
+ return;
+ case PomPackage.PROFILE__ACTIVATION:
+ setActivation((Activation) newValue);
+ return;
+ case PomPackage.PROFILE__BUILD:
+ setBuild((BuildBase) newValue);
+ return;
+ case PomPackage.PROFILE__REPOSITORIES:
+ getRepositories().clear();
+ getRepositories().addAll(
+ (Collection<? extends Repository>) newValue);
+ return;
+ case PomPackage.PROFILE__PLUGIN_REPOSITORIES:
+ getPluginRepositories().clear();
+ getPluginRepositories().addAll(
+ (Collection<? extends Repository>) newValue);
+ return;
+ case PomPackage.PROFILE__DEPENDENCIES:
+ getDependencies().clear();
+ getDependencies().addAll(
+ (Collection<? extends Dependency>) newValue);
+ return;
+ case PomPackage.PROFILE__REPORTS:
+ getReports().clear();
+ getReports().addAll((Collection<? extends ReportPlugin>) newValue);
+ return;
+ case PomPackage.PROFILE__DEPENDENCY_MANAGEMENT:
+ setDependencyManagement((DependencyManagement) newValue);
+ return;
+ case PomPackage.PROFILE__DISTRIBUTION_MANAGEMENT:
+ setDistributionManagement((DistributionManagement) newValue);
+ return;
+ case PomPackage.PROFILE__PROPERTIES:
+ getProperties().clear();
+ getProperties().addAll(
+ (Collection<? extends PropertyElement>) newValue);
+ return;
+ case PomPackage.PROFILE__MODULES:
+ getModules().clear();
+ getModules().addAll((Collection<? extends String>) newValue);
+ return;
+ case PomPackage.PROFILE__REPORTING:
+ setReporting((Reporting) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.PROFILE__ID:
+ setId(ID_EDEFAULT);
+ return;
+ case PomPackage.PROFILE__ACTIVATION:
+ unsetActivation();
+ return;
+ case PomPackage.PROFILE__BUILD:
+ unsetBuild();
+ return;
+ case PomPackage.PROFILE__REPOSITORIES:
+ unsetRepositories();
+ return;
+ case PomPackage.PROFILE__PLUGIN_REPOSITORIES:
+ unsetPluginRepositories();
+ return;
+ case PomPackage.PROFILE__DEPENDENCIES:
+ unsetDependencies();
+ return;
+ case PomPackage.PROFILE__REPORTS:
+ unsetReports();
+ return;
+ case PomPackage.PROFILE__DEPENDENCY_MANAGEMENT:
+ unsetDependencyManagement();
+ return;
+ case PomPackage.PROFILE__DISTRIBUTION_MANAGEMENT:
+ unsetDistributionManagement();
+ return;
+ case PomPackage.PROFILE__PROPERTIES:
+ unsetProperties();
+ return;
+ case PomPackage.PROFILE__MODULES:
+ getModules().clear();
+ return;
+ case PomPackage.PROFILE__REPORTING:
+ setReporting((Reporting) null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.PROFILE__ID:
+ return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
+ case PomPackage.PROFILE__ACTIVATION:
+ return isSetActivation();
+ case PomPackage.PROFILE__BUILD:
+ return isSetBuild();
+ case PomPackage.PROFILE__REPOSITORIES:
+ return isSetRepositories();
+ case PomPackage.PROFILE__PLUGIN_REPOSITORIES:
+ return isSetPluginRepositories();
+ case PomPackage.PROFILE__DEPENDENCIES:
+ return isSetDependencies();
+ case PomPackage.PROFILE__REPORTS:
+ return isSetReports();
+ case PomPackage.PROFILE__DEPENDENCY_MANAGEMENT:
+ return isSetDependencyManagement();
+ case PomPackage.PROFILE__DISTRIBUTION_MANAGEMENT:
+ return isSetDistributionManagement();
+ case PomPackage.PROFILE__PROPERTIES:
+ return isSetProperties();
+ case PomPackage.PROFILE__MODULES:
+ return modules != null && !modules.isEmpty();
+ case PomPackage.PROFILE__REPORTING:
+ return reporting != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (id: "); //$NON-NLS-1$
+ result.append(id);
+ result.append(", modules: "); //$NON-NLS-1$
+ result.append(modules);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ProfileImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PropertyElementImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PropertyElementImpl.java
new file mode 100644
index 00000000..01fb7416
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/PropertyElementImpl.java
@@ -0,0 +1,232 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Property Element</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PropertyElementImpl#getName <em>
+ * Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.PropertyElementImpl#getValue
+ * <em>Value</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class PropertyElementImpl extends EObjectImpl implements PropertyElement {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final String VALUE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected String value = VALUE_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PropertyElementImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.PROPERTY_ELEMENT;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PROPERTY_ELEMENT__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setValue(String newValue) {
+ String oldValue = value;
+ value = newValue;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.PROPERTY_ELEMENT__VALUE, oldValue, value));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.PROPERTY_ELEMENT__NAME:
+ return getName();
+ case PomPackage.PROPERTY_ELEMENT__VALUE:
+ return getValue();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.PROPERTY_ELEMENT__NAME:
+ setName((String) newValue);
+ return;
+ case PomPackage.PROPERTY_ELEMENT__VALUE:
+ setValue((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.PROPERTY_ELEMENT__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PomPackage.PROPERTY_ELEMENT__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.PROPERTY_ELEMENT__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT
+ .equals(name);
+ case PomPackage.PROPERTY_ELEMENT__VALUE:
+ return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT
+ .equals(value);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(", value: "); //$NON-NLS-1$
+ result.append(value);
+ result.append(')');
+ return result.toString();
+ }
+
+} // PropertyElementImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RelocationImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RelocationImpl.java
new file mode 100644
index 00000000..56f8d90b
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RelocationImpl.java
@@ -0,0 +1,347 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Relocation;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Relocation</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.RelocationImpl#getGroupId <em>
+ * Group Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.RelocationImpl#getArtifactId
+ * <em>Artifact Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.RelocationImpl#getVersion <em>
+ * Version</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.RelocationImpl#getMessage <em>
+ * Message</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class RelocationImpl extends EObjectImpl implements Relocation {
+ /**
+ * The default value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected static final String GROUP_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected String groupId = GROUP_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ARTIFACT_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected String artifactId = ARTIFACT_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected static final String VERSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected String version = VERSION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getMessage() <em>Message</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getMessage()
+ * @generated
+ * @ordered
+ */
+ protected static final String MESSAGE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getMessage() <em>Message</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getMessage()
+ * @generated
+ * @ordered
+ */
+ protected String message = MESSAGE_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected RelocationImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.RELOCATION;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getGroupId() {
+ return groupId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setGroupId(String newGroupId) {
+ String oldGroupId = groupId;
+ groupId = newGroupId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.RELOCATION__GROUP_ID, oldGroupId, groupId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setArtifactId(String newArtifactId) {
+ String oldArtifactId = artifactId;
+ artifactId = newArtifactId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.RELOCATION__ARTIFACT_ID, oldArtifactId,
+ artifactId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setVersion(String newVersion) {
+ String oldVersion = version;
+ version = newVersion;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.RELOCATION__VERSION, oldVersion, version));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setMessage(String newMessage) {
+ String oldMessage = message;
+ message = newMessage;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.RELOCATION__MESSAGE, oldMessage, message));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.RELOCATION__GROUP_ID:
+ return getGroupId();
+ case PomPackage.RELOCATION__ARTIFACT_ID:
+ return getArtifactId();
+ case PomPackage.RELOCATION__VERSION:
+ return getVersion();
+ case PomPackage.RELOCATION__MESSAGE:
+ return getMessage();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.RELOCATION__GROUP_ID:
+ setGroupId((String) newValue);
+ return;
+ case PomPackage.RELOCATION__ARTIFACT_ID:
+ setArtifactId((String) newValue);
+ return;
+ case PomPackage.RELOCATION__VERSION:
+ setVersion((String) newValue);
+ return;
+ case PomPackage.RELOCATION__MESSAGE:
+ setMessage((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.RELOCATION__GROUP_ID:
+ setGroupId(GROUP_ID_EDEFAULT);
+ return;
+ case PomPackage.RELOCATION__ARTIFACT_ID:
+ setArtifactId(ARTIFACT_ID_EDEFAULT);
+ return;
+ case PomPackage.RELOCATION__VERSION:
+ setVersion(VERSION_EDEFAULT);
+ return;
+ case PomPackage.RELOCATION__MESSAGE:
+ setMessage(MESSAGE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.RELOCATION__GROUP_ID:
+ return GROUP_ID_EDEFAULT == null ? groupId != null
+ : !GROUP_ID_EDEFAULT.equals(groupId);
+ case PomPackage.RELOCATION__ARTIFACT_ID:
+ return ARTIFACT_ID_EDEFAULT == null ? artifactId != null
+ : !ARTIFACT_ID_EDEFAULT.equals(artifactId);
+ case PomPackage.RELOCATION__VERSION:
+ return VERSION_EDEFAULT == null ? version != null
+ : !VERSION_EDEFAULT.equals(version);
+ case PomPackage.RELOCATION__MESSAGE:
+ return MESSAGE_EDEFAULT == null ? message != null
+ : !MESSAGE_EDEFAULT.equals(message);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (groupId: "); //$NON-NLS-1$
+ result.append(groupId);
+ result.append(", artifactId: "); //$NON-NLS-1$
+ result.append(artifactId);
+ result.append(", version: "); //$NON-NLS-1$
+ result.append(version);
+ result.append(", message: "); //$NON-NLS-1$
+ result.append(message);
+ result.append(')');
+ return result.toString();
+ }
+
+} // RelocationImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportPluginImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportPluginImpl.java
new file mode 100644
index 00000000..af6fd86f
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportPluginImpl.java
@@ -0,0 +1,540 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.Configuration;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.ReportPlugin;
+import org.eclipse.m2e.model.edit.pom.ReportSet;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Report Plugin</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ReportPluginImpl#getGroupId <em>
+ * Group Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ReportPluginImpl#getArtifactId
+ * <em>Artifact Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ReportPluginImpl#getVersion <em>
+ * Version</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ReportPluginImpl#getInherited
+ * <em>Inherited</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ReportPluginImpl#getReportSets
+ * <em>Report Sets</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ReportPluginImpl#getConfiguration
+ * <em>Configuration</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ReportPluginImpl extends EObjectImpl implements ReportPlugin {
+ /**
+ * The default value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected static final String GROUP_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getGroupId() <em>Group Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getGroupId()
+ * @generated
+ * @ordered
+ */
+ protected String groupId = GROUP_ID_EDEFAULT;
+
+ /**
+ * This is true if the Group Id attribute has been set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean groupIdESet;
+
+ /**
+ * The default value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ARTIFACT_ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getArtifactId()
+ * @generated
+ * @ordered
+ */
+ protected String artifactId = ARTIFACT_ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected static final String VERSION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getVersion() <em>Version</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getVersion()
+ * @generated
+ * @ordered
+ */
+ protected String version = VERSION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getInherited() <em>Inherited</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getInherited()
+ * @generated
+ * @ordered
+ */
+ protected static final String INHERITED_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getInherited() <em>Inherited</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getInherited()
+ * @generated
+ * @ordered
+ */
+ protected String inherited = INHERITED_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getReportSets() <em>Report Sets</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getReportSets()
+ * @generated
+ * @ordered
+ */
+ protected EList<ReportSet> reportSets;
+
+ /**
+ * The cached value of the '{@link #getConfiguration()
+ * <em>Configuration</em>}' reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getConfiguration()
+ * @generated
+ * @ordered
+ */
+ protected Configuration configuration;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ReportPluginImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.REPORT_PLUGIN;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getGroupId() {
+ return groupId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setGroupId(String newGroupId) {
+ String oldGroupId = groupId;
+ groupId = newGroupId;
+ boolean oldGroupIdESet = groupIdESet;
+ groupIdESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPORT_PLUGIN__GROUP_ID, oldGroupId, groupId,
+ !oldGroupIdESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetGroupId() {
+ String oldGroupId = groupId;
+ boolean oldGroupIdESet = groupIdESet;
+ groupId = GROUP_ID_EDEFAULT;
+ groupIdESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.REPORT_PLUGIN__GROUP_ID, oldGroupId,
+ GROUP_ID_EDEFAULT, oldGroupIdESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetGroupId() {
+ return groupIdESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setArtifactId(String newArtifactId) {
+ String oldArtifactId = artifactId;
+ artifactId = newArtifactId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPORT_PLUGIN__ARTIFACT_ID, oldArtifactId,
+ artifactId));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setVersion(String newVersion) {
+ String oldVersion = version;
+ version = newVersion;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPORT_PLUGIN__VERSION, oldVersion, version));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getInherited() {
+ return inherited;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setInherited(String newInherited) {
+ String oldInherited = inherited;
+ inherited = newInherited;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPORT_PLUGIN__INHERITED, oldInherited,
+ inherited));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<ReportSet> getReportSets() {
+ if (reportSets == null) {
+ reportSets = new EObjectContainmentEList.Unsettable<ReportSet>(
+ ReportSet.class, this,
+ PomPackage.REPORT_PLUGIN__REPORT_SETS);
+ }
+ return reportSets;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetReportSets() {
+ if (reportSets != null)
+ ((InternalEList.Unsettable<?>) reportSets).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetReportSets() {
+ return reportSets != null
+ && ((InternalEList.Unsettable<?>) reportSets).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Configuration getConfiguration() {
+ if (configuration != null && configuration.eIsProxy()) {
+ InternalEObject oldConfiguration = (InternalEObject) configuration;
+ configuration = (Configuration) eResolveProxy(oldConfiguration);
+ if (configuration != oldConfiguration) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE,
+ PomPackage.REPORT_PLUGIN__CONFIGURATION,
+ oldConfiguration, configuration));
+ }
+ }
+ return configuration;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Configuration basicGetConfiguration() {
+ return configuration;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setConfiguration(Configuration newConfiguration) {
+ Configuration oldConfiguration = configuration;
+ configuration = newConfiguration;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPORT_PLUGIN__CONFIGURATION, oldConfiguration,
+ configuration));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.REPORT_PLUGIN__REPORT_SETS:
+ return ((InternalEList<?>) getReportSets()).basicRemove(otherEnd,
+ msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.REPORT_PLUGIN__GROUP_ID:
+ return getGroupId();
+ case PomPackage.REPORT_PLUGIN__ARTIFACT_ID:
+ return getArtifactId();
+ case PomPackage.REPORT_PLUGIN__VERSION:
+ return getVersion();
+ case PomPackage.REPORT_PLUGIN__INHERITED:
+ return getInherited();
+ case PomPackage.REPORT_PLUGIN__REPORT_SETS:
+ return getReportSets();
+ case PomPackage.REPORT_PLUGIN__CONFIGURATION:
+ if (resolve)
+ return getConfiguration();
+ return basicGetConfiguration();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.REPORT_PLUGIN__GROUP_ID:
+ setGroupId((String) newValue);
+ return;
+ case PomPackage.REPORT_PLUGIN__ARTIFACT_ID:
+ setArtifactId((String) newValue);
+ return;
+ case PomPackage.REPORT_PLUGIN__VERSION:
+ setVersion((String) newValue);
+ return;
+ case PomPackage.REPORT_PLUGIN__INHERITED:
+ setInherited((String) newValue);
+ return;
+ case PomPackage.REPORT_PLUGIN__REPORT_SETS:
+ getReportSets().clear();
+ getReportSets().addAll((Collection<? extends ReportSet>) newValue);
+ return;
+ case PomPackage.REPORT_PLUGIN__CONFIGURATION:
+ setConfiguration((Configuration) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.REPORT_PLUGIN__GROUP_ID:
+ unsetGroupId();
+ return;
+ case PomPackage.REPORT_PLUGIN__ARTIFACT_ID:
+ setArtifactId(ARTIFACT_ID_EDEFAULT);
+ return;
+ case PomPackage.REPORT_PLUGIN__VERSION:
+ setVersion(VERSION_EDEFAULT);
+ return;
+ case PomPackage.REPORT_PLUGIN__INHERITED:
+ setInherited(INHERITED_EDEFAULT);
+ return;
+ case PomPackage.REPORT_PLUGIN__REPORT_SETS:
+ unsetReportSets();
+ return;
+ case PomPackage.REPORT_PLUGIN__CONFIGURATION:
+ setConfiguration((Configuration) null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.REPORT_PLUGIN__GROUP_ID:
+ return isSetGroupId();
+ case PomPackage.REPORT_PLUGIN__ARTIFACT_ID:
+ return ARTIFACT_ID_EDEFAULT == null ? artifactId != null
+ : !ARTIFACT_ID_EDEFAULT.equals(artifactId);
+ case PomPackage.REPORT_PLUGIN__VERSION:
+ return VERSION_EDEFAULT == null ? version != null
+ : !VERSION_EDEFAULT.equals(version);
+ case PomPackage.REPORT_PLUGIN__INHERITED:
+ return INHERITED_EDEFAULT == null ? inherited != null
+ : !INHERITED_EDEFAULT.equals(inherited);
+ case PomPackage.REPORT_PLUGIN__REPORT_SETS:
+ return isSetReportSets();
+ case PomPackage.REPORT_PLUGIN__CONFIGURATION:
+ return configuration != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (groupId: "); //$NON-NLS-1$
+ if (groupIdESet)
+ result.append(groupId);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", artifactId: "); //$NON-NLS-1$
+ result.append(artifactId);
+ result.append(", version: "); //$NON-NLS-1$
+ result.append(version);
+ result.append(", inherited: "); //$NON-NLS-1$
+ result.append(inherited);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ReportPluginImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportSetImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportSetImpl.java
new file mode 100644
index 00000000..5b45af61
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportSetImpl.java
@@ -0,0 +1,383 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EDataTypeEList;
+import org.eclipse.m2e.model.edit.pom.Configuration;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.ReportSet;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Report Set</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ReportSetImpl#getId <em>Id</em>}
+ * </li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ReportSetImpl#getInherited <em>
+ * Inherited</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ReportSetImpl#getReports <em>
+ * Reports</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ReportSetImpl#getConfiguration
+ * <em>Configuration</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ReportSetImpl extends EObjectImpl implements ReportSet {
+ /**
+ * The default value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected String id = ID_EDEFAULT;
+
+ /**
+ * This is true if the Id attribute has been set. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean idESet;
+
+ /**
+ * The default value of the '{@link #getInherited() <em>Inherited</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getInherited()
+ * @generated
+ * @ordered
+ */
+ protected static final String INHERITED_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getInherited() <em>Inherited</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getInherited()
+ * @generated
+ * @ordered
+ */
+ protected String inherited = INHERITED_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getReports() <em>Reports</em>}'
+ * attribute list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getReports()
+ * @generated
+ * @ordered
+ */
+ protected EList<String> reports;
+
+ /**
+ * The cached value of the '{@link #getConfiguration()
+ * <em>Configuration</em>}' reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getConfiguration()
+ * @generated
+ * @ordered
+ */
+ protected Configuration configuration;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ReportSetImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.REPORT_SET;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setId(String newId) {
+ String oldId = id;
+ id = newId;
+ boolean oldIdESet = idESet;
+ idESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPORT_SET__ID, oldId, id, !oldIdESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetId() {
+ String oldId = id;
+ boolean oldIdESet = idESet;
+ id = ID_EDEFAULT;
+ idESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.REPORT_SET__ID, oldId, ID_EDEFAULT, oldIdESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetId() {
+ return idESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getInherited() {
+ return inherited;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setInherited(String newInherited) {
+ String oldInherited = inherited;
+ inherited = newInherited;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPORT_SET__INHERITED, oldInherited, inherited));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<String> getReports() {
+ if (reports == null) {
+ reports = new EDataTypeEList<String>(String.class, this,
+ PomPackage.REPORT_SET__REPORTS);
+ }
+ return reports;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Configuration getConfiguration() {
+ if (configuration != null && configuration.eIsProxy()) {
+ InternalEObject oldConfiguration = (InternalEObject) configuration;
+ configuration = (Configuration) eResolveProxy(oldConfiguration);
+ if (configuration != oldConfiguration) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE,
+ PomPackage.REPORT_SET__CONFIGURATION,
+ oldConfiguration, configuration));
+ }
+ }
+ return configuration;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Configuration basicGetConfiguration() {
+ return configuration;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setConfiguration(Configuration newConfiguration) {
+ Configuration oldConfiguration = configuration;
+ configuration = newConfiguration;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPORT_SET__CONFIGURATION, oldConfiguration,
+ configuration));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.REPORT_SET__ID:
+ return getId();
+ case PomPackage.REPORT_SET__INHERITED:
+ return getInherited();
+ case PomPackage.REPORT_SET__REPORTS:
+ return getReports();
+ case PomPackage.REPORT_SET__CONFIGURATION:
+ if (resolve)
+ return getConfiguration();
+ return basicGetConfiguration();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.REPORT_SET__ID:
+ setId((String) newValue);
+ return;
+ case PomPackage.REPORT_SET__INHERITED:
+ setInherited((String) newValue);
+ return;
+ case PomPackage.REPORT_SET__REPORTS:
+ getReports().clear();
+ getReports().addAll((Collection<? extends String>) newValue);
+ return;
+ case PomPackage.REPORT_SET__CONFIGURATION:
+ setConfiguration((Configuration) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.REPORT_SET__ID:
+ unsetId();
+ return;
+ case PomPackage.REPORT_SET__INHERITED:
+ setInherited(INHERITED_EDEFAULT);
+ return;
+ case PomPackage.REPORT_SET__REPORTS:
+ getReports().clear();
+ return;
+ case PomPackage.REPORT_SET__CONFIGURATION:
+ setConfiguration((Configuration) null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.REPORT_SET__ID:
+ return isSetId();
+ case PomPackage.REPORT_SET__INHERITED:
+ return INHERITED_EDEFAULT == null ? inherited != null
+ : !INHERITED_EDEFAULT.equals(inherited);
+ case PomPackage.REPORT_SET__REPORTS:
+ return reports != null && !reports.isEmpty();
+ case PomPackage.REPORT_SET__CONFIGURATION:
+ return configuration != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (id: "); //$NON-NLS-1$
+ if (idESet)
+ result.append(id);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", inherited: "); //$NON-NLS-1$
+ result.append(inherited);
+ result.append(", reports: "); //$NON-NLS-1$
+ result.append(reports);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ReportSetImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportingImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportingImpl.java
new file mode 100644
index 00000000..5e120122
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ReportingImpl.java
@@ -0,0 +1,361 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.ReportPlugin;
+import org.eclipse.m2e.model.edit.pom.Reporting;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Reporting</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ReportingImpl#getExcludeDefaults
+ * <em>Exclude Defaults</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.ReportingImpl#getOutputDirectory
+ * <em>Output Directory</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ReportingImpl#getPlugins <em>
+ * Plugins</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ReportingImpl extends EObjectImpl implements Reporting {
+ /**
+ * The default value of the '{@link #getExcludeDefaults()
+ * <em>Exclude Defaults</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getExcludeDefaults()
+ * @generated
+ * @ordered
+ */
+ protected static final String EXCLUDE_DEFAULTS_EDEFAULT = "false"; //$NON-NLS-1$
+
+ /**
+ * The cached value of the '{@link #getExcludeDefaults()
+ * <em>Exclude Defaults</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getExcludeDefaults()
+ * @generated
+ * @ordered
+ */
+ protected String excludeDefaults = EXCLUDE_DEFAULTS_EDEFAULT;
+
+ /**
+ * This is true if the Exclude Defaults attribute has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean excludeDefaultsESet;
+
+ /**
+ * The default value of the '{@link #getOutputDirectory()
+ * <em>Output Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getOutputDirectory()
+ * @generated
+ * @ordered
+ */
+ protected static final String OUTPUT_DIRECTORY_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getOutputDirectory()
+ * <em>Output Directory</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getOutputDirectory()
+ * @generated
+ * @ordered
+ */
+ protected String outputDirectory = OUTPUT_DIRECTORY_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getPlugins() <em>Plugins</em>}'
+ * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getPlugins()
+ * @generated
+ * @ordered
+ */
+ protected EList<ReportPlugin> plugins;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ReportingImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.REPORTING;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getExcludeDefaults() {
+ return excludeDefaults;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setExcludeDefaults(String newExcludeDefaults) {
+ String oldExcludeDefaults = excludeDefaults;
+ excludeDefaults = newExcludeDefaults;
+ boolean oldExcludeDefaultsESet = excludeDefaultsESet;
+ excludeDefaultsESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPORTING__EXCLUDE_DEFAULTS, oldExcludeDefaults,
+ excludeDefaults, !oldExcludeDefaultsESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetExcludeDefaults() {
+ String oldExcludeDefaults = excludeDefaults;
+ boolean oldExcludeDefaultsESet = excludeDefaultsESet;
+ excludeDefaults = EXCLUDE_DEFAULTS_EDEFAULT;
+ excludeDefaultsESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.REPORTING__EXCLUDE_DEFAULTS, oldExcludeDefaults,
+ EXCLUDE_DEFAULTS_EDEFAULT, oldExcludeDefaultsESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetExcludeDefaults() {
+ return excludeDefaultsESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getOutputDirectory() {
+ return outputDirectory;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setOutputDirectory(String newOutputDirectory) {
+ String oldOutputDirectory = outputDirectory;
+ outputDirectory = newOutputDirectory;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPORTING__OUTPUT_DIRECTORY, oldOutputDirectory,
+ outputDirectory));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<ReportPlugin> getPlugins() {
+ if (plugins == null) {
+ plugins = new EObjectContainmentEList.Unsettable<ReportPlugin>(
+ ReportPlugin.class, this, PomPackage.REPORTING__PLUGINS);
+ }
+ return plugins;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetPlugins() {
+ if (plugins != null)
+ ((InternalEList.Unsettable<?>) plugins).unset();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetPlugins() {
+ return plugins != null
+ && ((InternalEList.Unsettable<?>) plugins).isSet();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.REPORTING__PLUGINS:
+ return ((InternalEList<?>) getPlugins())
+ .basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.REPORTING__EXCLUDE_DEFAULTS:
+ return getExcludeDefaults();
+ case PomPackage.REPORTING__OUTPUT_DIRECTORY:
+ return getOutputDirectory();
+ case PomPackage.REPORTING__PLUGINS:
+ return getPlugins();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.REPORTING__EXCLUDE_DEFAULTS:
+ setExcludeDefaults((String) newValue);
+ return;
+ case PomPackage.REPORTING__OUTPUT_DIRECTORY:
+ setOutputDirectory((String) newValue);
+ return;
+ case PomPackage.REPORTING__PLUGINS:
+ getPlugins().clear();
+ getPlugins().addAll((Collection<? extends ReportPlugin>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.REPORTING__EXCLUDE_DEFAULTS:
+ unsetExcludeDefaults();
+ return;
+ case PomPackage.REPORTING__OUTPUT_DIRECTORY:
+ setOutputDirectory(OUTPUT_DIRECTORY_EDEFAULT);
+ return;
+ case PomPackage.REPORTING__PLUGINS:
+ unsetPlugins();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.REPORTING__EXCLUDE_DEFAULTS:
+ return isSetExcludeDefaults();
+ case PomPackage.REPORTING__OUTPUT_DIRECTORY:
+ return OUTPUT_DIRECTORY_EDEFAULT == null ? outputDirectory != null
+ : !OUTPUT_DIRECTORY_EDEFAULT.equals(outputDirectory);
+ case PomPackage.REPORTING__PLUGINS:
+ return isSetPlugins();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (excludeDefaults: "); //$NON-NLS-1$
+ if (excludeDefaultsESet)
+ result.append(excludeDefaults);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", outputDirectory: "); //$NON-NLS-1$
+ result.append(outputDirectory);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ReportingImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RepositoryImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RepositoryImpl.java
new file mode 100644
index 00000000..afc9362f
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RepositoryImpl.java
@@ -0,0 +1,698 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Repository;
+import org.eclipse.m2e.model.edit.pom.RepositoryPolicy;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Repository</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.RepositoryImpl#getReleases <em>
+ * Releases</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.RepositoryImpl#getSnapshots <em>
+ * Snapshots</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.RepositoryImpl#getId <em>Id
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.RepositoryImpl#getName <em>Name
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.RepositoryImpl#getUrl <em>Url
+ * </em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.RepositoryImpl#getLayout <em>
+ * Layout</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class RepositoryImpl extends EObjectImpl implements Repository {
+ /**
+ * The cached value of the '{@link #getReleases() <em>Releases</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getReleases()
+ * @generated
+ * @ordered
+ */
+ protected RepositoryPolicy releases;
+
+ /**
+ * This is true if the Releases containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean releasesESet;
+
+ /**
+ * The cached value of the '{@link #getSnapshots() <em>Snapshots</em>}'
+ * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getSnapshots()
+ * @generated
+ * @ordered
+ */
+ protected RepositoryPolicy snapshots;
+
+ /**
+ * This is true if the Snapshots containment reference has been set. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean snapshotsESet;
+
+ /**
+ * The default value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected String id = ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected String url = URL_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getLayout() <em>Layout</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getLayout()
+ * @generated
+ * @ordered
+ */
+ protected static final String LAYOUT_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getLayout() <em>Layout</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getLayout()
+ * @generated
+ * @ordered
+ */
+ protected String layout = LAYOUT_EDEFAULT;
+
+ /**
+ * This is true if the Layout attribute has been set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean layoutESet;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected RepositoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.REPOSITORY;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public RepositoryPolicy getReleases() {
+ return releases;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetReleases(RepositoryPolicy newReleases,
+ NotificationChain msgs) {
+ RepositoryPolicy oldReleases = releases;
+ releases = newReleases;
+ boolean oldReleasesESet = releasesESet;
+ releasesESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.REPOSITORY__RELEASES,
+ oldReleases, newReleases, !oldReleasesESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setReleases(RepositoryPolicy newReleases) {
+ if (newReleases != releases) {
+ NotificationChain msgs = null;
+ if (releases != null)
+ msgs = ((InternalEObject) releases).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.REPOSITORY__RELEASES, null, msgs);
+ if (newReleases != null)
+ msgs = ((InternalEObject) newReleases).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.REPOSITORY__RELEASES, null, msgs);
+ msgs = basicSetReleases(newReleases, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldReleasesESet = releasesESet;
+ releasesESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPOSITORY__RELEASES, newReleases,
+ newReleases, !oldReleasesESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetReleases(NotificationChain msgs) {
+ RepositoryPolicy oldReleases = releases;
+ releases = null;
+ boolean oldReleasesESet = releasesESet;
+ releasesESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.REPOSITORY__RELEASES,
+ oldReleases, null, oldReleasesESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetReleases() {
+ if (releases != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) releases).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.REPOSITORY__RELEASES,
+ null, msgs);
+ msgs = basicUnsetReleases(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldReleasesESet = releasesESet;
+ releasesESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.REPOSITORY__RELEASES, null, null,
+ oldReleasesESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetReleases() {
+ return releasesESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public RepositoryPolicy getSnapshots() {
+ return snapshots;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetSnapshots(RepositoryPolicy newSnapshots,
+ NotificationChain msgs) {
+ RepositoryPolicy oldSnapshots = snapshots;
+ snapshots = newSnapshots;
+ boolean oldSnapshotsESet = snapshotsESet;
+ snapshotsESet = true;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.SET, PomPackage.REPOSITORY__SNAPSHOTS,
+ oldSnapshots, newSnapshots, !oldSnapshotsESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSnapshots(RepositoryPolicy newSnapshots) {
+ if (newSnapshots != snapshots) {
+ NotificationChain msgs = null;
+ if (snapshots != null)
+ msgs = ((InternalEObject) snapshots).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.REPOSITORY__SNAPSHOTS, null, msgs);
+ if (newSnapshots != null)
+ msgs = ((InternalEObject) newSnapshots).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE
+ - PomPackage.REPOSITORY__SNAPSHOTS, null, msgs);
+ msgs = basicSetSnapshots(newSnapshots, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldSnapshotsESet = snapshotsESet;
+ snapshotsESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPOSITORY__SNAPSHOTS, newSnapshots,
+ newSnapshots, !oldSnapshotsESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicUnsetSnapshots(NotificationChain msgs) {
+ RepositoryPolicy oldSnapshots = snapshots;
+ snapshots = null;
+ boolean oldSnapshotsESet = snapshotsESet;
+ snapshotsESet = false;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this,
+ Notification.UNSET, PomPackage.REPOSITORY__SNAPSHOTS,
+ oldSnapshots, null, oldSnapshotsESet);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetSnapshots() {
+ if (snapshots != null) {
+ NotificationChain msgs = null;
+ msgs = ((InternalEObject) snapshots).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - PomPackage.REPOSITORY__SNAPSHOTS,
+ null, msgs);
+ msgs = basicUnsetSnapshots(msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else {
+ boolean oldSnapshotsESet = snapshotsESet;
+ snapshotsESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.REPOSITORY__SNAPSHOTS, null, null,
+ oldSnapshotsESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetSnapshots() {
+ return snapshotsESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setId(String newId) {
+ String oldId = id;
+ id = newId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPOSITORY__ID, oldId, id));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPOSITORY__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUrl(String newUrl) {
+ String oldUrl = url;
+ url = newUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPOSITORY__URL, oldUrl, url));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getLayout() {
+ return layout;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setLayout(String newLayout) {
+ String oldLayout = layout;
+ layout = newLayout;
+ boolean oldLayoutESet = layoutESet;
+ layoutESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPOSITORY__LAYOUT, oldLayout, layout,
+ !oldLayoutESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetLayout() {
+ String oldLayout = layout;
+ boolean oldLayoutESet = layoutESet;
+ layout = LAYOUT_EDEFAULT;
+ layoutESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.REPOSITORY__LAYOUT, oldLayout, LAYOUT_EDEFAULT,
+ oldLayoutESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetLayout() {
+ return layoutESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd,
+ int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PomPackage.REPOSITORY__RELEASES:
+ return basicUnsetReleases(msgs);
+ case PomPackage.REPOSITORY__SNAPSHOTS:
+ return basicUnsetSnapshots(msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.REPOSITORY__RELEASES:
+ return getReleases();
+ case PomPackage.REPOSITORY__SNAPSHOTS:
+ return getSnapshots();
+ case PomPackage.REPOSITORY__ID:
+ return getId();
+ case PomPackage.REPOSITORY__NAME:
+ return getName();
+ case PomPackage.REPOSITORY__URL:
+ return getUrl();
+ case PomPackage.REPOSITORY__LAYOUT:
+ return getLayout();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.REPOSITORY__RELEASES:
+ setReleases((RepositoryPolicy) newValue);
+ return;
+ case PomPackage.REPOSITORY__SNAPSHOTS:
+ setSnapshots((RepositoryPolicy) newValue);
+ return;
+ case PomPackage.REPOSITORY__ID:
+ setId((String) newValue);
+ return;
+ case PomPackage.REPOSITORY__NAME:
+ setName((String) newValue);
+ return;
+ case PomPackage.REPOSITORY__URL:
+ setUrl((String) newValue);
+ return;
+ case PomPackage.REPOSITORY__LAYOUT:
+ setLayout((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.REPOSITORY__RELEASES:
+ unsetReleases();
+ return;
+ case PomPackage.REPOSITORY__SNAPSHOTS:
+ unsetSnapshots();
+ return;
+ case PomPackage.REPOSITORY__ID:
+ setId(ID_EDEFAULT);
+ return;
+ case PomPackage.REPOSITORY__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PomPackage.REPOSITORY__URL:
+ setUrl(URL_EDEFAULT);
+ return;
+ case PomPackage.REPOSITORY__LAYOUT:
+ unsetLayout();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.REPOSITORY__RELEASES:
+ return isSetReleases();
+ case PomPackage.REPOSITORY__SNAPSHOTS:
+ return isSetSnapshots();
+ case PomPackage.REPOSITORY__ID:
+ return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
+ case PomPackage.REPOSITORY__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT
+ .equals(name);
+ case PomPackage.REPOSITORY__URL:
+ return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT
+ .equals(url);
+ case PomPackage.REPOSITORY__LAYOUT:
+ return isSetLayout();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (id: "); //$NON-NLS-1$
+ result.append(id);
+ result.append(", name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(", url: "); //$NON-NLS-1$
+ result.append(url);
+ result.append(", layout: "); //$NON-NLS-1$
+ if (layoutESet)
+ result.append(layout);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(')');
+ return result.toString();
+ }
+
+} // RepositoryImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RepositoryPolicyImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RepositoryPolicyImpl.java
new file mode 100644
index 00000000..1bf621fe
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/RepositoryPolicyImpl.java
@@ -0,0 +1,337 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.RepositoryPolicy;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Repository Policy</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.RepositoryPolicyImpl#getEnabled
+ * <em>Enabled</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.RepositoryPolicyImpl#getUpdatePolicy
+ * <em>Update Policy</em>}</li>
+ * <li>
+ * {@link org.eclipse.m2e.model.edit.pom.impl.RepositoryPolicyImpl#getChecksumPolicy
+ * <em>Checksum Policy</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class RepositoryPolicyImpl extends EObjectImpl implements
+ RepositoryPolicy {
+ /**
+ * The default value of the '{@link #getEnabled() <em>Enabled</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getEnabled()
+ * @generated
+ * @ordered
+ */
+ protected static final String ENABLED_EDEFAULT = "true"; //$NON-NLS-1$
+
+ /**
+ * The cached value of the '{@link #getEnabled() <em>Enabled</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getEnabled()
+ * @generated
+ * @ordered
+ */
+ protected String enabled = ENABLED_EDEFAULT;
+
+ /**
+ * This is true if the Enabled attribute has been set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean enabledESet;
+
+ /**
+ * The default value of the '{@link #getUpdatePolicy()
+ * <em>Update Policy</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getUpdatePolicy()
+ * @generated
+ * @ordered
+ */
+ protected static final String UPDATE_POLICY_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUpdatePolicy()
+ * <em>Update Policy</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getUpdatePolicy()
+ * @generated
+ * @ordered
+ */
+ protected String updatePolicy = UPDATE_POLICY_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getChecksumPolicy()
+ * <em>Checksum Policy</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getChecksumPolicy()
+ * @generated
+ * @ordered
+ */
+ protected static final String CHECKSUM_POLICY_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getChecksumPolicy()
+ * <em>Checksum Policy</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getChecksumPolicy()
+ * @generated
+ * @ordered
+ */
+ protected String checksumPolicy = CHECKSUM_POLICY_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected RepositoryPolicyImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.REPOSITORY_POLICY;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getEnabled() {
+ return enabled;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setEnabled(String newEnabled) {
+ String oldEnabled = enabled;
+ enabled = newEnabled;
+ boolean oldEnabledESet = enabledESet;
+ enabledESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPOSITORY_POLICY__ENABLED, oldEnabled, enabled,
+ !oldEnabledESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetEnabled() {
+ String oldEnabled = enabled;
+ boolean oldEnabledESet = enabledESet;
+ enabled = ENABLED_EDEFAULT;
+ enabledESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.REPOSITORY_POLICY__ENABLED, oldEnabled,
+ ENABLED_EDEFAULT, oldEnabledESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetEnabled() {
+ return enabledESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUpdatePolicy() {
+ return updatePolicy;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUpdatePolicy(String newUpdatePolicy) {
+ String oldUpdatePolicy = updatePolicy;
+ updatePolicy = newUpdatePolicy;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPOSITORY_POLICY__UPDATE_POLICY,
+ oldUpdatePolicy, updatePolicy));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getChecksumPolicy() {
+ return checksumPolicy;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setChecksumPolicy(String newChecksumPolicy) {
+ String oldChecksumPolicy = checksumPolicy;
+ checksumPolicy = newChecksumPolicy;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.REPOSITORY_POLICY__CHECKSUM_POLICY,
+ oldChecksumPolicy, checksumPolicy));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.REPOSITORY_POLICY__ENABLED:
+ return getEnabled();
+ case PomPackage.REPOSITORY_POLICY__UPDATE_POLICY:
+ return getUpdatePolicy();
+ case PomPackage.REPOSITORY_POLICY__CHECKSUM_POLICY:
+ return getChecksumPolicy();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.REPOSITORY_POLICY__ENABLED:
+ setEnabled((String) newValue);
+ return;
+ case PomPackage.REPOSITORY_POLICY__UPDATE_POLICY:
+ setUpdatePolicy((String) newValue);
+ return;
+ case PomPackage.REPOSITORY_POLICY__CHECKSUM_POLICY:
+ setChecksumPolicy((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.REPOSITORY_POLICY__ENABLED:
+ unsetEnabled();
+ return;
+ case PomPackage.REPOSITORY_POLICY__UPDATE_POLICY:
+ setUpdatePolicy(UPDATE_POLICY_EDEFAULT);
+ return;
+ case PomPackage.REPOSITORY_POLICY__CHECKSUM_POLICY:
+ setChecksumPolicy(CHECKSUM_POLICY_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.REPOSITORY_POLICY__ENABLED:
+ return isSetEnabled();
+ case PomPackage.REPOSITORY_POLICY__UPDATE_POLICY:
+ return UPDATE_POLICY_EDEFAULT == null ? updatePolicy != null
+ : !UPDATE_POLICY_EDEFAULT.equals(updatePolicy);
+ case PomPackage.REPOSITORY_POLICY__CHECKSUM_POLICY:
+ return CHECKSUM_POLICY_EDEFAULT == null ? checksumPolicy != null
+ : !CHECKSUM_POLICY_EDEFAULT.equals(checksumPolicy);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (enabled: "); //$NON-NLS-1$
+ if (enabledESet)
+ result.append(enabled);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", updatePolicy: "); //$NON-NLS-1$
+ result.append(updatePolicy);
+ result.append(", checksumPolicy: "); //$NON-NLS-1$
+ result.append(checksumPolicy);
+ result.append(')');
+ return result.toString();
+ }
+
+} // RepositoryPolicyImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ResourceImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ResourceImpl.java
new file mode 100644
index 00000000..aa9bbea7
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ResourceImpl.java
@@ -0,0 +1,411 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EDataTypeEList;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Resource;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Resource</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ResourceImpl#getTargetPath <em>
+ * Target Path</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ResourceImpl#getFiltering <em>
+ * Filtering</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ResourceImpl#getDirectory <em>
+ * Directory</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ResourceImpl#getIncludes <em>
+ * Includes</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ResourceImpl#getExcludes <em>
+ * Excludes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ResourceImpl extends EObjectImpl implements Resource {
+ /**
+ * The default value of the '{@link #getTargetPath() <em>Target Path</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getTargetPath()
+ * @generated
+ * @ordered
+ */
+ protected static final String TARGET_PATH_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getTargetPath() <em>Target Path</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getTargetPath()
+ * @generated
+ * @ordered
+ */
+ protected String targetPath = TARGET_PATH_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getFiltering() <em>Filtering</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getFiltering()
+ * @generated
+ * @ordered
+ */
+ protected static final String FILTERING_EDEFAULT = "false"; //$NON-NLS-1$
+
+ /**
+ * The cached value of the '{@link #getFiltering() <em>Filtering</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getFiltering()
+ * @generated
+ * @ordered
+ */
+ protected String filtering = FILTERING_EDEFAULT;
+
+ /**
+ * This is true if the Filtering attribute has been set. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean filteringESet;
+
+ /**
+ * The default value of the '{@link #getDirectory() <em>Directory</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDirectory()
+ * @generated
+ * @ordered
+ */
+ protected static final String DIRECTORY_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getDirectory() <em>Directory</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getDirectory()
+ * @generated
+ * @ordered
+ */
+ protected String directory = DIRECTORY_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getIncludes() <em>Includes</em>}'
+ * attribute list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getIncludes()
+ * @generated
+ * @ordered
+ */
+ protected EList<String> includes;
+
+ /**
+ * The cached value of the '{@link #getExcludes() <em>Excludes</em>}'
+ * attribute list. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getExcludes()
+ * @generated
+ * @ordered
+ */
+ protected EList<String> excludes;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ResourceImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.RESOURCE;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getTargetPath() {
+ return targetPath;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setTargetPath(String newTargetPath) {
+ String oldTargetPath = targetPath;
+ targetPath = newTargetPath;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.RESOURCE__TARGET_PATH, oldTargetPath, targetPath));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getFiltering() {
+ return filtering;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setFiltering(String newFiltering) {
+ String oldFiltering = filtering;
+ filtering = newFiltering;
+ boolean oldFilteringESet = filteringESet;
+ filteringESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.RESOURCE__FILTERING, oldFiltering, filtering,
+ !oldFilteringESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetFiltering() {
+ String oldFiltering = filtering;
+ boolean oldFilteringESet = filteringESet;
+ filtering = FILTERING_EDEFAULT;
+ filteringESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.RESOURCE__FILTERING, oldFiltering,
+ FILTERING_EDEFAULT, oldFilteringESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetFiltering() {
+ return filteringESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getDirectory() {
+ return directory;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setDirectory(String newDirectory) {
+ String oldDirectory = directory;
+ directory = newDirectory;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.RESOURCE__DIRECTORY, oldDirectory, directory));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<String> getIncludes() {
+ if (includes == null) {
+ includes = new EDataTypeEList<String>(String.class, this,
+ PomPackage.RESOURCE__INCLUDES);
+ }
+ return includes;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<String> getExcludes() {
+ if (excludes == null) {
+ excludes = new EDataTypeEList<String>(String.class, this,
+ PomPackage.RESOURCE__EXCLUDES);
+ }
+ return excludes;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.RESOURCE__TARGET_PATH:
+ return getTargetPath();
+ case PomPackage.RESOURCE__FILTERING:
+ return getFiltering();
+ case PomPackage.RESOURCE__DIRECTORY:
+ return getDirectory();
+ case PomPackage.RESOURCE__INCLUDES:
+ return getIncludes();
+ case PomPackage.RESOURCE__EXCLUDES:
+ return getExcludes();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.RESOURCE__TARGET_PATH:
+ setTargetPath((String) newValue);
+ return;
+ case PomPackage.RESOURCE__FILTERING:
+ setFiltering((String) newValue);
+ return;
+ case PomPackage.RESOURCE__DIRECTORY:
+ setDirectory((String) newValue);
+ return;
+ case PomPackage.RESOURCE__INCLUDES:
+ getIncludes().clear();
+ getIncludes().addAll((Collection<? extends String>) newValue);
+ return;
+ case PomPackage.RESOURCE__EXCLUDES:
+ getExcludes().clear();
+ getExcludes().addAll((Collection<? extends String>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.RESOURCE__TARGET_PATH:
+ setTargetPath(TARGET_PATH_EDEFAULT);
+ return;
+ case PomPackage.RESOURCE__FILTERING:
+ unsetFiltering();
+ return;
+ case PomPackage.RESOURCE__DIRECTORY:
+ setDirectory(DIRECTORY_EDEFAULT);
+ return;
+ case PomPackage.RESOURCE__INCLUDES:
+ getIncludes().clear();
+ return;
+ case PomPackage.RESOURCE__EXCLUDES:
+ getExcludes().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.RESOURCE__TARGET_PATH:
+ return TARGET_PATH_EDEFAULT == null ? targetPath != null
+ : !TARGET_PATH_EDEFAULT.equals(targetPath);
+ case PomPackage.RESOURCE__FILTERING:
+ return isSetFiltering();
+ case PomPackage.RESOURCE__DIRECTORY:
+ return DIRECTORY_EDEFAULT == null ? directory != null
+ : !DIRECTORY_EDEFAULT.equals(directory);
+ case PomPackage.RESOURCE__INCLUDES:
+ return includes != null && !includes.isEmpty();
+ case PomPackage.RESOURCE__EXCLUDES:
+ return excludes != null && !excludes.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (targetPath: "); //$NON-NLS-1$
+ result.append(targetPath);
+ result.append(", filtering: "); //$NON-NLS-1$
+ if (filteringESet)
+ result.append(filtering);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", directory: "); //$NON-NLS-1$
+ result.append(directory);
+ result.append(", includes: "); //$NON-NLS-1$
+ result.append(includes);
+ result.append(", excludes: "); //$NON-NLS-1$
+ result.append(excludes);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ResourceImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ScmImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ScmImpl.java
new file mode 100644
index 00000000..c6ada8f7
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/ScmImpl.java
@@ -0,0 +1,385 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Scm;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Scm</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ScmImpl#getConnection <em>
+ * Connection</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ScmImpl#getDeveloperConnection
+ * <em>Developer Connection</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ScmImpl#getTag <em>Tag</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.ScmImpl#getUrl <em>Url</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ScmImpl extends EObjectImpl implements Scm {
+ /**
+ * The default value of the '{@link #getConnection() <em>Connection</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getConnection()
+ * @generated
+ * @ordered
+ */
+ protected static final String CONNECTION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getConnection() <em>Connection</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getConnection()
+ * @generated
+ * @ordered
+ */
+ protected String connection = CONNECTION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getDeveloperConnection()
+ * <em>Developer Connection</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getDeveloperConnection()
+ * @generated
+ * @ordered
+ */
+ protected static final String DEVELOPER_CONNECTION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getDeveloperConnection()
+ * <em>Developer Connection</em>}' attribute. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @see #getDeveloperConnection()
+ * @generated
+ * @ordered
+ */
+ protected String developerConnection = DEVELOPER_CONNECTION_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getTag() <em>Tag</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getTag()
+ * @generated
+ * @ordered
+ */
+ protected static final String TAG_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getTag() <em>Tag</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getTag()
+ * @generated
+ * @ordered
+ */
+ protected String tag = TAG_EDEFAULT;
+
+ /**
+ * This is true if the Tag attribute has been set. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ protected boolean tagESet;
+
+ /**
+ * The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected String url = URL_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ScmImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.SCM;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getConnection() {
+ return connection;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setConnection(String newConnection) {
+ String oldConnection = connection;
+ connection = newConnection;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.SCM__CONNECTION, oldConnection, connection));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getDeveloperConnection() {
+ return developerConnection;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setDeveloperConnection(String newDeveloperConnection) {
+ String oldDeveloperConnection = developerConnection;
+ developerConnection = newDeveloperConnection;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.SCM__DEVELOPER_CONNECTION,
+ oldDeveloperConnection, developerConnection));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getTag() {
+ return tag;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setTag(String newTag) {
+ String oldTag = tag;
+ tag = newTag;
+ boolean oldTagESet = tagESet;
+ tagESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.SCM__TAG, oldTag, tag, !oldTagESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void unsetTag() {
+ String oldTag = tag;
+ boolean oldTagESet = tagESet;
+ tag = TAG_EDEFAULT;
+ tagESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET,
+ PomPackage.SCM__TAG, oldTag, TAG_EDEFAULT, oldTagESet));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isSetTag() {
+ return tagESet;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUrl(String newUrl) {
+ String oldUrl = url;
+ url = newUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.SCM__URL, oldUrl, url));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.SCM__CONNECTION:
+ return getConnection();
+ case PomPackage.SCM__DEVELOPER_CONNECTION:
+ return getDeveloperConnection();
+ case PomPackage.SCM__TAG:
+ return getTag();
+ case PomPackage.SCM__URL:
+ return getUrl();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.SCM__CONNECTION:
+ setConnection((String) newValue);
+ return;
+ case PomPackage.SCM__DEVELOPER_CONNECTION:
+ setDeveloperConnection((String) newValue);
+ return;
+ case PomPackage.SCM__TAG:
+ setTag((String) newValue);
+ return;
+ case PomPackage.SCM__URL:
+ setUrl((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.SCM__CONNECTION:
+ setConnection(CONNECTION_EDEFAULT);
+ return;
+ case PomPackage.SCM__DEVELOPER_CONNECTION:
+ setDeveloperConnection(DEVELOPER_CONNECTION_EDEFAULT);
+ return;
+ case PomPackage.SCM__TAG:
+ unsetTag();
+ return;
+ case PomPackage.SCM__URL:
+ setUrl(URL_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.SCM__CONNECTION:
+ return CONNECTION_EDEFAULT == null ? connection != null
+ : !CONNECTION_EDEFAULT.equals(connection);
+ case PomPackage.SCM__DEVELOPER_CONNECTION:
+ return DEVELOPER_CONNECTION_EDEFAULT == null ? developerConnection != null
+ : !DEVELOPER_CONNECTION_EDEFAULT
+ .equals(developerConnection);
+ case PomPackage.SCM__TAG:
+ return isSetTag();
+ case PomPackage.SCM__URL:
+ return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT
+ .equals(url);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (connection: "); //$NON-NLS-1$
+ result.append(connection);
+ result.append(", developerConnection: "); //$NON-NLS-1$
+ result.append(developerConnection);
+ result.append(", tag: "); //$NON-NLS-1$
+ if (tagESet)
+ result.append(tag);
+ else
+ result.append("<unset>"); //$NON-NLS-1$
+ result.append(", url: "); //$NON-NLS-1$
+ result.append(url);
+ result.append(')');
+ return result.toString();
+ }
+
+} // ScmImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/SiteImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/SiteImpl.java
new file mode 100644
index 00000000..5e3faf98
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/impl/SiteImpl.java
@@ -0,0 +1,285 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Site;
+
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>Site</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.SiteImpl#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.SiteImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.m2e.model.edit.pom.impl.SiteImpl#getUrl <em>Url</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class SiteImpl extends EObjectImpl implements Site {
+ /**
+ * The default value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected static final String ID_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getId() <em>Id</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
+ protected String id = ID_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected static final String URL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getUrl()
+ * @generated
+ * @ordered
+ */
+ protected String url = URL_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected SiteImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PomPackage.Literals.SITE;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setId(String newId) {
+ String oldId = id;
+ id = newId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.SITE__ID, oldId, id));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.SITE__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setUrl(String newUrl) {
+ String oldUrl = url;
+ url = newUrl;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET,
+ PomPackage.SITE__URL, oldUrl, url));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PomPackage.SITE__ID:
+ return getId();
+ case PomPackage.SITE__NAME:
+ return getName();
+ case PomPackage.SITE__URL:
+ return getUrl();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PomPackage.SITE__ID:
+ setId((String) newValue);
+ return;
+ case PomPackage.SITE__NAME:
+ setName((String) newValue);
+ return;
+ case PomPackage.SITE__URL:
+ setUrl((String) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PomPackage.SITE__ID:
+ setId(ID_EDEFAULT);
+ return;
+ case PomPackage.SITE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PomPackage.SITE__URL:
+ setUrl(URL_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PomPackage.SITE__ID:
+ return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
+ case PomPackage.SITE__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT
+ .equals(name);
+ case PomPackage.SITE__URL:
+ return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT
+ .equals(url);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy())
+ return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (id: "); //$NON-NLS-1$
+ result.append(id);
+ result.append(", name: "); //$NON-NLS-1$
+ result.append(name);
+ result.append(", url: "); //$NON-NLS-1$
+ result.append(url);
+ result.append(')');
+ return result.toString();
+ }
+
+} // SiteImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationFileItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationFileItemProvider.java
new file mode 100644
index 00000000..3d4eda1e
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationFileItemProvider.java
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.ActivationFile;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationFile} object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ActivationFileItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ActivationFileItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addMissingPropertyDescriptor(object);
+ addExistsPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Missing feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addMissingPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ActivationFile_missing_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ActivationFile_missing_feature",
+ "_UI_ActivationFile_type"),
+ PomPackage.Literals.ACTIVATION_FILE__MISSING, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Exists feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addExistsPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ActivationFile_exists_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ActivationFile_exists_feature",
+ "_UI_ActivationFile_type"),
+ PomPackage.Literals.ACTIVATION_FILE__EXISTS, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns ActivationFile.gif. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/ActivationFile"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((ActivationFile) object).getMissing();
+ return label == null || label.length() == 0 ? getString("_UI_ActivationFile_type")
+ : getString("_UI_ActivationFile_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(ActivationFile.class)) {
+ case PomPackage.ACTIVATION_FILE__MISSING:
+ case PomPackage.ACTIVATION_FILE__EXISTS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationItemProvider.java
new file mode 100644
index 00000000..cecd8bb9
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationItemProvider.java
@@ -0,0 +1,236 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.Activation;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Activation} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ActivationItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ActivationItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addActiveByDefaultPropertyDescriptor(object);
+ addJdkPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Active By Default feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addActiveByDefaultPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Activation_activeByDefault_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Activation_activeByDefault_feature",
+ "_UI_Activation_type"),
+ PomPackage.Literals.ACTIVATION__ACTIVE_BY_DEFAULT, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Jdk feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addJdkPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Activation_jdk_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Activation_jdk_feature", "_UI_Activation_type"),
+ PomPackage.Literals.ACTIVATION__JDK, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.ACTIVATION__OS);
+ childrenFeatures.add(PomPackage.Literals.ACTIVATION__PROPERTY);
+ childrenFeatures.add(PomPackage.Literals.ACTIVATION__FILE);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Activation.gif. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Activation"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Activation) object).getActiveByDefault();
+ return label == null || label.length() == 0 ? getString("_UI_Activation_type")
+ : getString("_UI_Activation_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Activation.class)) {
+ case PomPackage.ACTIVATION__ACTIVE_BY_DEFAULT:
+ case PomPackage.ACTIVATION__JDK:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.ACTIVATION__OS:
+ case PomPackage.ACTIVATION__PROPERTY:
+ case PomPackage.ACTIVATION__FILE:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.ACTIVATION__OS, PomFactory.eINSTANCE
+ .createActivationOS()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.ACTIVATION__PROPERTY, PomFactory.eINSTANCE
+ .createActivationProperty()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.ACTIVATION__FILE, PomFactory.eINSTANCE
+ .createActivationFile()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationOSItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationOSItemProvider.java
new file mode 100644
index 00000000..14248305
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationOSItemProvider.java
@@ -0,0 +1,220 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.ActivationOS;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationOS} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ActivationOSItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ActivationOSItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ addFamilyPropertyDescriptor(object);
+ addArchPropertyDescriptor(object);
+ addVersionPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ActivationOS_name_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ActivationOS_name_feature",
+ "_UI_ActivationOS_type"),
+ PomPackage.Literals.ACTIVATION_OS__NAME, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Family feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addFamilyPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ActivationOS_family_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ActivationOS_family_feature",
+ "_UI_ActivationOS_type"),
+ PomPackage.Literals.ACTIVATION_OS__FAMILY, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Arch feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addArchPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ActivationOS_arch_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ActivationOS_arch_feature",
+ "_UI_ActivationOS_type"),
+ PomPackage.Literals.ACTIVATION_OS__ARCH, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Version feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addVersionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ActivationOS_version_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ActivationOS_version_feature",
+ "_UI_ActivationOS_type"),
+ PomPackage.Literals.ACTIVATION_OS__VERSION, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns ActivationOS.gif. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/ActivationOS"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((ActivationOS) object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_ActivationOS_type")
+ : getString("_UI_ActivationOS_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(ActivationOS.class)) {
+ case PomPackage.ACTIVATION_OS__NAME:
+ case PomPackage.ACTIVATION_OS__FAMILY:
+ case PomPackage.ACTIVATION_OS__ARCH:
+ case PomPackage.ACTIVATION_OS__VERSION:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationPropertyItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationPropertyItemProvider.java
new file mode 100644
index 00000000..d7b00628
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ActivationPropertyItemProvider.java
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.ActivationProperty;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationProperty} object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ActivationPropertyItemProvider extends ItemProviderAdapter
+ implements IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ActivationPropertyItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ addValuePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ActivationProperty_name_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ActivationProperty_name_feature",
+ "_UI_ActivationProperty_type"),
+ PomPackage.Literals.ACTIVATION_PROPERTY__NAME, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Value feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addValuePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ActivationProperty_value_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ActivationProperty_value_feature",
+ "_UI_ActivationProperty_type"),
+ PomPackage.Literals.ACTIVATION_PROPERTY__VALUE, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns ActivationProperty.gif. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/ActivationProperty"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((ActivationProperty) object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_ActivationProperty_type")
+ : getString("_UI_ActivationProperty_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(ActivationProperty.class)) {
+ case PomPackage.ACTIVATION_PROPERTY__NAME:
+ case PomPackage.ACTIVATION_PROPERTY__VALUE:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/BuildBaseItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/BuildBaseItemProvider.java
new file mode 100644
index 00000000..2abaafe3
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/BuildBaseItemProvider.java
@@ -0,0 +1,297 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.BuildBase;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class BuildBaseItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public BuildBaseItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addDefaultGoalPropertyDescriptor(object);
+ addDirectoryPropertyDescriptor(object);
+ addFinalNamePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Default Goal feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addDefaultGoalPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_BuildBase_defaultGoal_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_BuildBase_defaultGoal_feature",
+ "_UI_BuildBase_type"),
+ PomPackage.Literals.BUILD_BASE__DEFAULT_GOAL, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Directory feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addDirectoryPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_BuildBase_directory_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_BuildBase_directory_feature",
+ "_UI_BuildBase_type"),
+ PomPackage.Literals.BUILD_BASE__DIRECTORY, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Final Name feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addFinalNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_BuildBase_finalName_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_BuildBase_finalName_feature",
+ "_UI_BuildBase_type"),
+ PomPackage.Literals.BUILD_BASE__FINAL_NAME, true,
+ false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.BUILD_BASE__RESOURCES);
+ childrenFeatures
+ .add(PomPackage.Literals.BUILD_BASE__TEST_RESOURCES);
+ childrenFeatures
+ .add(PomPackage.Literals.BUILD_BASE__PLUGIN_MANAGEMENT);
+ childrenFeatures.add(PomPackage.Literals.BUILD_BASE__PLUGINS);
+ childrenFeatures.add(PomPackage.Literals.BUILD_BASE__FILTERS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns BuildBase.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/BuildBase"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((BuildBase) object).getFinalName();
+ return label == null || label.length() == 0 ? getString("_UI_BuildBase_type")
+ : getString("_UI_BuildBase_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(BuildBase.class)) {
+ case PomPackage.BUILD_BASE__DEFAULT_GOAL:
+ case PomPackage.BUILD_BASE__DIRECTORY:
+ case PomPackage.BUILD_BASE__FINAL_NAME:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.BUILD_BASE__RESOURCES:
+ case PomPackage.BUILD_BASE__TEST_RESOURCES:
+ case PomPackage.BUILD_BASE__PLUGIN_MANAGEMENT:
+ case PomPackage.BUILD_BASE__PLUGINS:
+ case PomPackage.BUILD_BASE__FILTERS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.BUILD_BASE__RESOURCES, PomFactory.eINSTANCE
+ .createResource()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.BUILD_BASE__TEST_RESOURCES,
+ PomFactory.eINSTANCE.createResource()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.BUILD_BASE__PLUGIN_MANAGEMENT,
+ PomFactory.eINSTANCE.createPluginManagement()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.BUILD_BASE__PLUGINS, PomFactory.eINSTANCE
+ .createPlugin()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.BUILD_BASE__FILTERS, ""));
+ }
+
+ /**
+ * This returns the label text for
+ * {@link org.eclipse.emf.edit.command.CreateChildCommand}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getCreateChildText(Object owner, Object feature,
+ Object child, Collection<?> selection) {
+ Object childFeature = feature;
+ Object childObject = child;
+
+ boolean qualify = childFeature == PomPackage.Literals.BUILD_BASE__RESOURCES
+ || childFeature == PomPackage.Literals.BUILD_BASE__TEST_RESOURCES;
+
+ if (qualify) {
+ return getString("_UI_CreateChild_text2", new Object[] {
+ getTypeText(childObject), getFeatureText(childFeature),
+ getTypeText(owner) });
+ }
+ return super.getCreateChildText(owner, feature, child, selection);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/BuildItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/BuildItemProvider.java
new file mode 100644
index 00000000..0917d886
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/BuildItemProvider.java
@@ -0,0 +1,293 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.Build;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Build} object. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class BuildItemProvider extends BuildBaseItemProvider implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public BuildItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addSourceDirectoryPropertyDescriptor(object);
+ addScriptSourceDirectoryPropertyDescriptor(object);
+ addTestSourceDirectoryPropertyDescriptor(object);
+ addOutputDirectoryPropertyDescriptor(object);
+ addTestOutputDirectoryPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Source Directory feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addSourceDirectoryPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Build_sourceDirectory_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Build_sourceDirectory_feature", "_UI_Build_type"),
+ PomPackage.Literals.BUILD__SOURCE_DIRECTORY, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Script Source Directory feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addScriptSourceDirectoryPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Build_scriptSourceDirectory_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_Build_scriptSourceDirectory_feature",
+ "_UI_Build_type"),
+ PomPackage.Literals.BUILD__SCRIPT_SOURCE_DIRECTORY, true,
+ false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Test Source Directory feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addTestSourceDirectoryPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Build_testSourceDirectory_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Build_testSourceDirectory_feature",
+ "_UI_Build_type"),
+ PomPackage.Literals.BUILD__TEST_SOURCE_DIRECTORY, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Output Directory feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addOutputDirectoryPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Build_outputDirectory_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Build_outputDirectory_feature", "_UI_Build_type"),
+ PomPackage.Literals.BUILD__OUTPUT_DIRECTORY, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Test Output Directory feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addTestOutputDirectoryPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Build_testOutputDirectory_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Build_testOutputDirectory_feature",
+ "_UI_Build_type"),
+ PomPackage.Literals.BUILD__TEST_OUTPUT_DIRECTORY, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.BUILD__EXTENSIONS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Build.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Build"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Build) object).getFinalName();
+ return label == null || label.length() == 0 ? getString("_UI_Build_type")
+ : getString("_UI_Build_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Build.class)) {
+ case PomPackage.BUILD__SOURCE_DIRECTORY:
+ case PomPackage.BUILD__SCRIPT_SOURCE_DIRECTORY:
+ case PomPackage.BUILD__TEST_SOURCE_DIRECTORY:
+ case PomPackage.BUILD__OUTPUT_DIRECTORY:
+ case PomPackage.BUILD__TEST_OUTPUT_DIRECTORY:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.BUILD__EXTENSIONS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.BUILD__EXTENSIONS, PomFactory.eINSTANCE
+ .createExtension()));
+ }
+
+ /**
+ * This returns the label text for
+ * {@link org.eclipse.emf.edit.command.CreateChildCommand}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getCreateChildText(Object owner, Object feature,
+ Object child, Collection<?> selection) {
+ Object childFeature = feature;
+ Object childObject = child;
+
+ boolean qualify = childFeature == PomPackage.Literals.BUILD_BASE__RESOURCES
+ || childFeature == PomPackage.Literals.BUILD_BASE__TEST_RESOURCES;
+
+ if (qualify) {
+ return getString("_UI_CreateChild_text2", new Object[] {
+ getTypeText(childObject), getFeatureText(childFeature),
+ getTypeText(owner) });
+ }
+ return super.getCreateChildText(owner, feature, child, selection);
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/CiManagementItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/CiManagementItemProvider.java
new file mode 100644
index 00000000..39176994
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/CiManagementItemProvider.java
@@ -0,0 +1,227 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.CiManagement;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.CiManagement} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class CiManagementItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public CiManagementItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addSystemPropertyDescriptor(object);
+ addUrlPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the System feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addSystemPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_CiManagement_system_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_CiManagement_system_feature",
+ "_UI_CiManagement_type"),
+ PomPackage.Literals.CI_MANAGEMENT__SYSTEM, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Url feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_CiManagement_url_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_CiManagement_url_feature",
+ "_UI_CiManagement_type"),
+ PomPackage.Literals.CI_MANAGEMENT__URL, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.CI_MANAGEMENT__NOTIFIERS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns CiManagement.gif. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/CiManagement"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((CiManagement) object).getSystem();
+ return label == null || label.length() == 0 ? getString("_UI_CiManagement_type")
+ : getString("_UI_CiManagement_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(CiManagement.class)) {
+ case PomPackage.CI_MANAGEMENT__SYSTEM:
+ case PomPackage.CI_MANAGEMENT__URL:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.CI_MANAGEMENT__NOTIFIERS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.CI_MANAGEMENT__NOTIFIERS,
+ PomFactory.eINSTANCE.createNotifier()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ConfigurationItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ConfigurationItemProvider.java
new file mode 100644
index 00000000..cccca85c
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ConfigurationItemProvider.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Configuration} object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ConfigurationItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ConfigurationItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This returns Configuration.gif. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/Configuration"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_Configuration_type");
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ContributorItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ContributorItemProvider.java
new file mode 100644
index 00000000..bbec6410
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ContributorItemProvider.java
@@ -0,0 +1,313 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.Contributor;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ContributorItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ContributorItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ addEmailPropertyDescriptor(object);
+ addUrlPropertyDescriptor(object);
+ addOrganizationPropertyDescriptor(object);
+ addOrganizationUrlPropertyDescriptor(object);
+ addTimezonePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Contributor_name_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Contributor_name_feature",
+ "_UI_Contributor_type"),
+ PomPackage.Literals.CONTRIBUTOR__NAME, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Email feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addEmailPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Contributor_email_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Contributor_email_feature",
+ "_UI_Contributor_type"),
+ PomPackage.Literals.CONTRIBUTOR__EMAIL, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Url feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Contributor_url_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Contributor_url_feature", "_UI_Contributor_type"),
+ PomPackage.Literals.CONTRIBUTOR__URL, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Organization feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addOrganizationPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Contributor_organization_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Contributor_organization_feature",
+ "_UI_Contributor_type"),
+ PomPackage.Literals.CONTRIBUTOR__ORGANIZATION, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Organization Url feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addOrganizationUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Contributor_organizationUrl_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_Contributor_organizationUrl_feature",
+ "_UI_Contributor_type"),
+ PomPackage.Literals.CONTRIBUTOR__ORGANIZATION_URL, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Timezone feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addTimezonePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Contributor_timezone_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Contributor_timezone_feature",
+ "_UI_Contributor_type"),
+ PomPackage.Literals.CONTRIBUTOR__TIMEZONE, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.CONTRIBUTOR__PROPERTIES);
+ childrenFeatures.add(PomPackage.Literals.CONTRIBUTOR__ROLES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Contributor.gif. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Contributor"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Contributor) object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_Contributor_type")
+ : getString("_UI_Contributor_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Contributor.class)) {
+ case PomPackage.CONTRIBUTOR__NAME:
+ case PomPackage.CONTRIBUTOR__EMAIL:
+ case PomPackage.CONTRIBUTOR__URL:
+ case PomPackage.CONTRIBUTOR__ORGANIZATION:
+ case PomPackage.CONTRIBUTOR__ORGANIZATION_URL:
+ case PomPackage.CONTRIBUTOR__TIMEZONE:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.CONTRIBUTOR__PROPERTIES:
+ case PomPackage.CONTRIBUTOR__ROLES:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.CONTRIBUTOR__PROPERTIES,
+ PomFactory.eINSTANCE.createPropertyElement()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.CONTRIBUTOR__ROLES, ""));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DependencyItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DependencyItemProvider.java
new file mode 100644
index 00000000..89401c66
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DependencyItemProvider.java
@@ -0,0 +1,347 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class DependencyItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DependencyItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addGroupIdPropertyDescriptor(object);
+ addArtifactIdPropertyDescriptor(object);
+ addVersionPropertyDescriptor(object);
+ addTypePropertyDescriptor(object);
+ addClassifierPropertyDescriptor(object);
+ addScopePropertyDescriptor(object);
+ addSystemPathPropertyDescriptor(object);
+ addOptionalPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Group Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addGroupIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Dependency_groupId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Dependency_groupId_feature",
+ "_UI_Dependency_type"),
+ PomPackage.Literals.DEPENDENCY__GROUP_ID, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Artifact Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addArtifactIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Dependency_artifactId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Dependency_artifactId_feature",
+ "_UI_Dependency_type"),
+ PomPackage.Literals.DEPENDENCY__ARTIFACT_ID, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Version feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addVersionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Dependency_version_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Dependency_version_feature",
+ "_UI_Dependency_type"),
+ PomPackage.Literals.DEPENDENCY__VERSION, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Type feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addTypePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Dependency_type_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Dependency_type_feature", "_UI_Dependency_type"),
+ PomPackage.Literals.DEPENDENCY__TYPE, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Classifier feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addClassifierPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Dependency_classifier_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Dependency_classifier_feature",
+ "_UI_Dependency_type"),
+ PomPackage.Literals.DEPENDENCY__CLASSIFIER, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Scope feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addScopePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Dependency_scope_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Dependency_scope_feature", "_UI_Dependency_type"),
+ PomPackage.Literals.DEPENDENCY__SCOPE, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the System Path feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addSystemPathPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Dependency_systemPath_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Dependency_systemPath_feature",
+ "_UI_Dependency_type"),
+ PomPackage.Literals.DEPENDENCY__SYSTEM_PATH, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Optional feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addOptionalPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Dependency_optional_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Dependency_optional_feature",
+ "_UI_Dependency_type"),
+ PomPackage.Literals.DEPENDENCY__OPTIONAL, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.DEPENDENCY__EXCLUSIONS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Dependency.gif. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Dependency"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Dependency) object).getGroupId();
+ return label == null || label.length() == 0 ? getString("_UI_Dependency_type")
+ : getString("_UI_Dependency_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Dependency.class)) {
+ case PomPackage.DEPENDENCY__GROUP_ID:
+ case PomPackage.DEPENDENCY__ARTIFACT_ID:
+ case PomPackage.DEPENDENCY__VERSION:
+ case PomPackage.DEPENDENCY__TYPE:
+ case PomPackage.DEPENDENCY__CLASSIFIER:
+ case PomPackage.DEPENDENCY__SCOPE:
+ case PomPackage.DEPENDENCY__SYSTEM_PATH:
+ case PomPackage.DEPENDENCY__OPTIONAL:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.DEPENDENCY__EXCLUSIONS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.DEPENDENCY__EXCLUSIONS,
+ PomFactory.eINSTANCE.createExclusion()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DependencyManagementItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DependencyManagementItemProvider.java
new file mode 100644
index 00000000..1a8024ad
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DependencyManagementItemProvider.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.DependencyManagement;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.DependencyManagement} object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class DependencyManagementItemProvider extends ItemProviderAdapter
+ implements IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DependencyManagementItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures
+ .add(PomPackage.Literals.DEPENDENCY_MANAGEMENT__DEPENDENCIES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns DependencyManagement.gif. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/DependencyManagement"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_DependencyManagement_type");
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(DependencyManagement.class)) {
+ case PomPackage.DEPENDENCY_MANAGEMENT__DEPENDENCIES:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.DEPENDENCY_MANAGEMENT__DEPENDENCIES,
+ PomFactory.eINSTANCE.createDependency()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DeploymentRepositoryItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DeploymentRepositoryItemProvider.java
new file mode 100644
index 00000000..a0c85aef
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DeploymentRepositoryItemProvider.java
@@ -0,0 +1,241 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.DeploymentRepository;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository} object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class DeploymentRepositoryItemProvider extends ItemProviderAdapter
+ implements IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DeploymentRepositoryItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addUniqueVersionPropertyDescriptor(object);
+ addIdPropertyDescriptor(object);
+ addNamePropertyDescriptor(object);
+ addUrlPropertyDescriptor(object);
+ addLayoutPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Unique Version feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUniqueVersionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_DeploymentRepository_uniqueVersion_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_DeploymentRepository_uniqueVersion_feature",
+ "_UI_DeploymentRepository_type"),
+ PomPackage.Literals.DEPLOYMENT_REPOSITORY__UNIQUE_VERSION,
+ true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Id feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_DeploymentRepository_id_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_DeploymentRepository_id_feature",
+ "_UI_DeploymentRepository_type"),
+ PomPackage.Literals.DEPLOYMENT_REPOSITORY__ID, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_DeploymentRepository_name_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_DeploymentRepository_name_feature",
+ "_UI_DeploymentRepository_type"),
+ PomPackage.Literals.DEPLOYMENT_REPOSITORY__NAME, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Url feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_DeploymentRepository_url_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_DeploymentRepository_url_feature",
+ "_UI_DeploymentRepository_type"),
+ PomPackage.Literals.DEPLOYMENT_REPOSITORY__URL, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Layout feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addLayoutPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_DeploymentRepository_layout_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_DeploymentRepository_layout_feature",
+ "_UI_DeploymentRepository_type"),
+ PomPackage.Literals.DEPLOYMENT_REPOSITORY__LAYOUT, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns DeploymentRepository.gif. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/DeploymentRepository"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((DeploymentRepository) object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_DeploymentRepository_type")
+ : getString("_UI_DeploymentRepository_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(DeploymentRepository.class)) {
+ case PomPackage.DEPLOYMENT_REPOSITORY__UNIQUE_VERSION:
+ case PomPackage.DEPLOYMENT_REPOSITORY__ID:
+ case PomPackage.DEPLOYMENT_REPOSITORY__NAME:
+ case PomPackage.DEPLOYMENT_REPOSITORY__URL:
+ case PomPackage.DEPLOYMENT_REPOSITORY__LAYOUT:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DeveloperItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DeveloperItemProvider.java
new file mode 100644
index 00000000..d3d5f037
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DeveloperItemProvider.java
@@ -0,0 +1,327 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.Developer;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Developer} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class DeveloperItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DeveloperItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addIdPropertyDescriptor(object);
+ addNamePropertyDescriptor(object);
+ addEmailPropertyDescriptor(object);
+ addUrlPropertyDescriptor(object);
+ addOrganizationPropertyDescriptor(object);
+ addOrganizationUrlPropertyDescriptor(object);
+ addTimezonePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Id feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Developer_id_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Developer_id_feature", "_UI_Developer_type"),
+ PomPackage.Literals.DEVELOPER__ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Developer_name_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Developer_name_feature", "_UI_Developer_type"),
+ PomPackage.Literals.DEVELOPER__NAME, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Email feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addEmailPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Developer_email_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Developer_email_feature", "_UI_Developer_type"),
+ PomPackage.Literals.DEVELOPER__EMAIL, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Url feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Developer_url_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Developer_url_feature", "_UI_Developer_type"),
+ PomPackage.Literals.DEVELOPER__URL, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Organization feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addOrganizationPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Developer_organization_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Developer_organization_feature",
+ "_UI_Developer_type"),
+ PomPackage.Literals.DEVELOPER__ORGANIZATION, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Organization Url feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addOrganizationUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Developer_organizationUrl_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Developer_organizationUrl_feature",
+ "_UI_Developer_type"),
+ PomPackage.Literals.DEVELOPER__ORGANIZATION_URL, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Timezone feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addTimezonePropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Developer_timezone_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Developer_timezone_feature",
+ "_UI_Developer_type"),
+ PomPackage.Literals.DEVELOPER__TIMEZONE, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.DEVELOPER__PROPERTIES);
+ childrenFeatures.add(PomPackage.Literals.DEVELOPER__ROLES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Developer.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Developer"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Developer) object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_Developer_type")
+ : getString("_UI_Developer_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Developer.class)) {
+ case PomPackage.DEVELOPER__ID:
+ case PomPackage.DEVELOPER__NAME:
+ case PomPackage.DEVELOPER__EMAIL:
+ case PomPackage.DEVELOPER__URL:
+ case PomPackage.DEVELOPER__ORGANIZATION:
+ case PomPackage.DEVELOPER__ORGANIZATION_URL:
+ case PomPackage.DEVELOPER__TIMEZONE:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.DEVELOPER__PROPERTIES:
+ case PomPackage.DEVELOPER__ROLES:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.DEVELOPER__PROPERTIES, PomFactory.eINSTANCE
+ .createPropertyElement()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.DEVELOPER__ROLES, ""));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DistributionManagementItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DistributionManagementItemProvider.java
new file mode 100644
index 00000000..68db070f
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DistributionManagementItemProvider.java
@@ -0,0 +1,274 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.DistributionManagement;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement} object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class DistributionManagementItemProvider extends ItemProviderAdapter
+ implements IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DistributionManagementItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addDownloadUrlPropertyDescriptor(object);
+ addStatusPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Download Url feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addDownloadUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_DistributionManagement_downloadUrl_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_DistributionManagement_downloadUrl_feature",
+ "_UI_DistributionManagement_type"),
+ PomPackage.Literals.DISTRIBUTION_MANAGEMENT__DOWNLOAD_URL,
+ true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Status feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addStatusPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_DistributionManagement_status_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_DistributionManagement_status_feature",
+ "_UI_DistributionManagement_type"),
+ PomPackage.Literals.DISTRIBUTION_MANAGEMENT__STATUS, true,
+ false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures
+ .add(PomPackage.Literals.DISTRIBUTION_MANAGEMENT__REPOSITORY);
+ childrenFeatures
+ .add(PomPackage.Literals.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY);
+ childrenFeatures
+ .add(PomPackage.Literals.DISTRIBUTION_MANAGEMENT__SITE);
+ childrenFeatures
+ .add(PomPackage.Literals.DISTRIBUTION_MANAGEMENT__RELOCATION);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns DistributionManagement.gif. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/DistributionManagement"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((DistributionManagement) object).getDownloadUrl();
+ return label == null || label.length() == 0 ? getString("_UI_DistributionManagement_type")
+ : getString("_UI_DistributionManagement_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(DistributionManagement.class)) {
+ case PomPackage.DISTRIBUTION_MANAGEMENT__DOWNLOAD_URL:
+ case PomPackage.DISTRIBUTION_MANAGEMENT__STATUS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.DISTRIBUTION_MANAGEMENT__REPOSITORY:
+ case PomPackage.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY:
+ case PomPackage.DISTRIBUTION_MANAGEMENT__SITE:
+ case PomPackage.DISTRIBUTION_MANAGEMENT__RELOCATION:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.DISTRIBUTION_MANAGEMENT__REPOSITORY,
+ PomFactory.eINSTANCE.createDeploymentRepository()));
+
+ newChildDescriptors
+ .add(createChildParameter(
+ PomPackage.Literals.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY,
+ PomFactory.eINSTANCE.createDeploymentRepository()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.DISTRIBUTION_MANAGEMENT__SITE,
+ PomFactory.eINSTANCE.createSite()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.DISTRIBUTION_MANAGEMENT__RELOCATION,
+ PomFactory.eINSTANCE.createRelocation()));
+ }
+
+ /**
+ * This returns the label text for
+ * {@link org.eclipse.emf.edit.command.CreateChildCommand}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getCreateChildText(Object owner, Object feature,
+ Object child, Collection<?> selection) {
+ Object childFeature = feature;
+ Object childObject = child;
+
+ boolean qualify = childFeature == PomPackage.Literals.DISTRIBUTION_MANAGEMENT__REPOSITORY
+ || childFeature == PomPackage.Literals.DISTRIBUTION_MANAGEMENT__SNAPSHOT_REPOSITORY;
+
+ if (qualify) {
+ return getString("_UI_CreateChild_text2", new Object[] {
+ getTypeText(childObject), getFeatureText(childFeature),
+ getTypeText(owner) });
+ }
+ return super.getCreateChildText(owner, feature, child, selection);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DocumentRootItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DocumentRootItemProvider.java
new file mode 100644
index 00000000..74b5278e
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/DocumentRootItemProvider.java
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.DocumentRoot;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.DocumentRoot} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class DocumentRootItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public DocumentRootItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.DOCUMENT_ROOT__PROJECT);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns DocumentRoot.gif. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/DocumentRoot"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_DocumentRoot_type");
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(DocumentRoot.class)) {
+ case PomPackage.DOCUMENT_ROOT__PROJECT:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.DOCUMENT_ROOT__PROJECT,
+ PomFactory.eINSTANCE.createModel()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ExclusionItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ExclusionItemProvider.java
new file mode 100644
index 00000000..5d4b48f1
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ExclusionItemProvider.java
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.Exclusion;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Exclusion} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ExclusionItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ExclusionItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addArtifactIdPropertyDescriptor(object);
+ addGroupIdPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Artifact Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addArtifactIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Exclusion_artifactId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Exclusion_artifactId_feature",
+ "_UI_Exclusion_type"),
+ PomPackage.Literals.EXCLUSION__ARTIFACT_ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Group Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addGroupIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Exclusion_groupId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Exclusion_groupId_feature", "_UI_Exclusion_type"),
+ PomPackage.Literals.EXCLUSION__GROUP_ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns Exclusion.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Exclusion"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Exclusion) object).getArtifactId();
+ return label == null || label.length() == 0 ? getString("_UI_Exclusion_type")
+ : getString("_UI_Exclusion_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Exclusion.class)) {
+ case PomPackage.EXCLUSION__ARTIFACT_ID:
+ case PomPackage.EXCLUSION__GROUP_ID:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ExtensionItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ExtensionItemProvider.java
new file mode 100644
index 00000000..e68dc41f
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ExtensionItemProvider.java
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.Extension;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Extension} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ExtensionItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ExtensionItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addGroupIdPropertyDescriptor(object);
+ addArtifactIdPropertyDescriptor(object);
+ addVersionPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Group Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addGroupIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Extension_groupId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Extension_groupId_feature", "_UI_Extension_type"),
+ PomPackage.Literals.EXTENSION__GROUP_ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Artifact Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addArtifactIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Extension_artifactId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Extension_artifactId_feature",
+ "_UI_Extension_type"),
+ PomPackage.Literals.EXTENSION__ARTIFACT_ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Version feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addVersionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Extension_version_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Extension_version_feature", "_UI_Extension_type"),
+ PomPackage.Literals.EXTENSION__VERSION, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns Extension.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Extension"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Extension) object).getGroupId();
+ return label == null || label.length() == 0 ? getString("_UI_Extension_type")
+ : getString("_UI_Extension_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Extension.class)) {
+ case PomPackage.EXTENSION__GROUP_ID:
+ case PomPackage.EXTENSION__ARTIFACT_ID:
+ case PomPackage.EXTENSION__VERSION:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/IssueManagementItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/IssueManagementItemProvider.java
new file mode 100644
index 00000000..a18ccb30
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/IssueManagementItemProvider.java
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.IssueManagement;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.IssueManagement} object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class IssueManagementItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IssueManagementItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addSystemPropertyDescriptor(object);
+ addUrlPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the System feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addSystemPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_IssueManagement_system_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_IssueManagement_system_feature",
+ "_UI_IssueManagement_type"),
+ PomPackage.Literals.ISSUE_MANAGEMENT__SYSTEM, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Url feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_IssueManagement_url_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_IssueManagement_url_feature",
+ "_UI_IssueManagement_type"),
+ PomPackage.Literals.ISSUE_MANAGEMENT__URL, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns IssueManagement.gif. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/IssueManagement"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((IssueManagement) object).getSystem();
+ return label == null || label.length() == 0 ? getString("_UI_IssueManagement_type")
+ : getString("_UI_IssueManagement_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(IssueManagement.class)) {
+ case PomPackage.ISSUE_MANAGEMENT__SYSTEM:
+ case PomPackage.ISSUE_MANAGEMENT__URL:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/LicenseItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/LicenseItemProvider.java
new file mode 100644
index 00000000..17e82b21
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/LicenseItemProvider.java
@@ -0,0 +1,218 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.License;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.License} object. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class LicenseItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public LicenseItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ addUrlPropertyDescriptor(object);
+ addDistributionPropertyDescriptor(object);
+ addCommentsPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_License_name_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_License_name_feature", "_UI_License_type"),
+ PomPackage.Literals.LICENSE__NAME, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Url feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_License_url_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_License_url_feature", "_UI_License_type"),
+ PomPackage.Literals.LICENSE__URL, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Distribution feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addDistributionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_License_distribution_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_License_distribution_feature",
+ "_UI_License_type"),
+ PomPackage.Literals.LICENSE__DISTRIBUTION, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Comments feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addCommentsPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_License_comments_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_License_comments_feature", "_UI_License_type"),
+ PomPackage.Literals.LICENSE__COMMENTS, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns License.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/License"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((License) object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_License_type")
+ : getString("_UI_License_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(License.class)) {
+ case PomPackage.LICENSE__NAME:
+ case PomPackage.LICENSE__URL:
+ case PomPackage.LICENSE__DISTRIBUTION:
+ case PomPackage.LICENSE__COMMENTS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/MailingListItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/MailingListItemProvider.java
new file mode 100644
index 00000000..74680083
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/MailingListItemProvider.java
@@ -0,0 +1,288 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.MailingList;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.MailingList} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class MailingListItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public MailingListItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ addSubscribePropertyDescriptor(object);
+ addUnsubscribePropertyDescriptor(object);
+ addPostPropertyDescriptor(object);
+ addArchivePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_MailingList_name_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_MailingList_name_feature",
+ "_UI_MailingList_type"),
+ PomPackage.Literals.MAILING_LIST__NAME, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Subscribe feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addSubscribePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_MailingList_subscribe_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_MailingList_subscribe_feature",
+ "_UI_MailingList_type"),
+ PomPackage.Literals.MAILING_LIST__SUBSCRIBE, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Unsubscribe feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUnsubscribePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_MailingList_unsubscribe_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_MailingList_unsubscribe_feature",
+ "_UI_MailingList_type"),
+ PomPackage.Literals.MAILING_LIST__UNSUBSCRIBE, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Post feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addPostPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_MailingList_post_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_MailingList_post_feature",
+ "_UI_MailingList_type"),
+ PomPackage.Literals.MAILING_LIST__POST, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Archive feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addArchivePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_MailingList_archive_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_MailingList_archive_feature",
+ "_UI_MailingList_type"),
+ PomPackage.Literals.MAILING_LIST__ARCHIVE, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures
+ .add(PomPackage.Literals.MAILING_LIST__OTHER_ARCHIVES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns MailingList.gif. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/MailingList"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((MailingList) object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_MailingList_type")
+ : getString("_UI_MailingList_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(MailingList.class)) {
+ case PomPackage.MAILING_LIST__NAME:
+ case PomPackage.MAILING_LIST__SUBSCRIBE:
+ case PomPackage.MAILING_LIST__UNSUBSCRIBE:
+ case PomPackage.MAILING_LIST__POST:
+ case PomPackage.MAILING_LIST__ARCHIVE:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.MAILING_LIST__OTHER_ARCHIVES:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MAILING_LIST__OTHER_ARCHIVES, ""));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ModelItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ModelItemProvider.java
new file mode 100644
index 00000000..81c2d12d
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ModelItemProvider.java
@@ -0,0 +1,495 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Model} object. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ModelItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ModelItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addModelVersionPropertyDescriptor(object);
+ addGroupIdPropertyDescriptor(object);
+ addArtifactIdPropertyDescriptor(object);
+ addPackagingPropertyDescriptor(object);
+ addNamePropertyDescriptor(object);
+ addVersionPropertyDescriptor(object);
+ addDescriptionPropertyDescriptor(object);
+ addUrlPropertyDescriptor(object);
+ addInceptionYearPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Model Version feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addModelVersionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Model_modelVersion_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Model_modelVersion_feature", "_UI_Model_type"),
+ PomPackage.Literals.MODEL__MODEL_VERSION, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Group Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addGroupIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Model_groupId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Model_groupId_feature", "_UI_Model_type"),
+ PomPackage.Literals.MODEL__GROUP_ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Artifact Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addArtifactIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Model_artifactId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Model_artifactId_feature", "_UI_Model_type"),
+ PomPackage.Literals.MODEL__ARTIFACT_ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Packaging feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addPackagingPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Model_packaging_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Model_packaging_feature", "_UI_Model_type"),
+ PomPackage.Literals.MODEL__PACKAGING, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Model_name_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Model_name_feature", "_UI_Model_type"),
+ PomPackage.Literals.MODEL__NAME, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Version feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addVersionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Model_version_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Model_version_feature", "_UI_Model_type"),
+ PomPackage.Literals.MODEL__VERSION, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Description feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addDescriptionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Model_description_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Model_description_feature", "_UI_Model_type"),
+ PomPackage.Literals.MODEL__DESCRIPTION, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Url feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Model_url_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Model_url_feature", "_UI_Model_type"),
+ PomPackage.Literals.MODEL__URL, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Inception Year feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addInceptionYearPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Model_inceptionYear_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Model_inceptionYear_feature", "_UI_Model_type"),
+ PomPackage.Literals.MODEL__INCEPTION_YEAR, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.MODEL__PARENT);
+ childrenFeatures.add(PomPackage.Literals.MODEL__PREREQUISITES);
+ childrenFeatures.add(PomPackage.Literals.MODEL__ISSUE_MANAGEMENT);
+ childrenFeatures.add(PomPackage.Literals.MODEL__CI_MANAGEMENT);
+ childrenFeatures.add(PomPackage.Literals.MODEL__MAILING_LISTS);
+ childrenFeatures.add(PomPackage.Literals.MODEL__DEVELOPERS);
+ childrenFeatures.add(PomPackage.Literals.MODEL__CONTRIBUTORS);
+ childrenFeatures.add(PomPackage.Literals.MODEL__LICENSES);
+ childrenFeatures.add(PomPackage.Literals.MODEL__SCM);
+ childrenFeatures.add(PomPackage.Literals.MODEL__ORGANIZATION);
+ childrenFeatures.add(PomPackage.Literals.MODEL__BUILD);
+ childrenFeatures.add(PomPackage.Literals.MODEL__PROFILES);
+ childrenFeatures.add(PomPackage.Literals.MODEL__REPOSITORIES);
+ childrenFeatures
+ .add(PomPackage.Literals.MODEL__PLUGIN_REPOSITORIES);
+ childrenFeatures.add(PomPackage.Literals.MODEL__DEPENDENCIES);
+ childrenFeatures.add(PomPackage.Literals.MODEL__REPORTING);
+ childrenFeatures
+ .add(PomPackage.Literals.MODEL__DEPENDENCY_MANAGEMENT);
+ childrenFeatures
+ .add(PomPackage.Literals.MODEL__DISTRIBUTION_MANAGEMENT);
+ childrenFeatures.add(PomPackage.Literals.MODEL__PROPERTIES);
+ childrenFeatures.add(PomPackage.Literals.MODEL__MODULES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Model.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Model"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Model) object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_Model_type")
+ : getString("_UI_Model_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Model.class)) {
+ case PomPackage.MODEL__MODEL_VERSION:
+ case PomPackage.MODEL__GROUP_ID:
+ case PomPackage.MODEL__ARTIFACT_ID:
+ case PomPackage.MODEL__PACKAGING:
+ case PomPackage.MODEL__NAME:
+ case PomPackage.MODEL__VERSION:
+ case PomPackage.MODEL__DESCRIPTION:
+ case PomPackage.MODEL__URL:
+ case PomPackage.MODEL__INCEPTION_YEAR:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.MODEL__PARENT:
+ case PomPackage.MODEL__PREREQUISITES:
+ case PomPackage.MODEL__ISSUE_MANAGEMENT:
+ case PomPackage.MODEL__CI_MANAGEMENT:
+ case PomPackage.MODEL__MAILING_LISTS:
+ case PomPackage.MODEL__DEVELOPERS:
+ case PomPackage.MODEL__CONTRIBUTORS:
+ case PomPackage.MODEL__LICENSES:
+ case PomPackage.MODEL__SCM:
+ case PomPackage.MODEL__ORGANIZATION:
+ case PomPackage.MODEL__BUILD:
+ case PomPackage.MODEL__PROFILES:
+ case PomPackage.MODEL__REPOSITORIES:
+ case PomPackage.MODEL__PLUGIN_REPOSITORIES:
+ case PomPackage.MODEL__DEPENDENCIES:
+ case PomPackage.MODEL__REPORTING:
+ case PomPackage.MODEL__DEPENDENCY_MANAGEMENT:
+ case PomPackage.MODEL__DISTRIBUTION_MANAGEMENT:
+ case PomPackage.MODEL__PROPERTIES:
+ case PomPackage.MODEL__MODULES:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__PARENT, PomFactory.eINSTANCE
+ .createParent()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__PREREQUISITES, PomFactory.eINSTANCE
+ .createPrerequisites()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__ISSUE_MANAGEMENT,
+ PomFactory.eINSTANCE.createIssueManagement()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__CI_MANAGEMENT, PomFactory.eINSTANCE
+ .createCiManagement()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__MAILING_LISTS, PomFactory.eINSTANCE
+ .createMailingList()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__DEVELOPERS, PomFactory.eINSTANCE
+ .createDeveloper()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__CONTRIBUTORS, PomFactory.eINSTANCE
+ .createContributor()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__LICENSES, PomFactory.eINSTANCE
+ .createLicense()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__SCM, PomFactory.eINSTANCE
+ .createScm()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__ORGANIZATION, PomFactory.eINSTANCE
+ .createOrganization()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__BUILD, PomFactory.eINSTANCE
+ .createBuild()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__PROFILES, PomFactory.eINSTANCE
+ .createProfile()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__REPOSITORIES, PomFactory.eINSTANCE
+ .createRepository()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__PLUGIN_REPOSITORIES,
+ PomFactory.eINSTANCE.createRepository()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__DEPENDENCIES, PomFactory.eINSTANCE
+ .createDependency()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__REPORTING, PomFactory.eINSTANCE
+ .createReporting()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__DEPENDENCY_MANAGEMENT,
+ PomFactory.eINSTANCE.createDependencyManagement()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__DISTRIBUTION_MANAGEMENT,
+ PomFactory.eINSTANCE.createDistributionManagement()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__PROPERTIES, PomFactory.eINSTANCE
+ .createPropertyElement()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.MODEL__MODULES, ""));
+ }
+
+ /**
+ * This returns the label text for
+ * {@link org.eclipse.emf.edit.command.CreateChildCommand}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getCreateChildText(Object owner, Object feature,
+ Object child, Collection<?> selection) {
+ Object childFeature = feature;
+ Object childObject = child;
+
+ boolean qualify = childFeature == PomPackage.Literals.MODEL__REPOSITORIES
+ || childFeature == PomPackage.Literals.MODEL__PLUGIN_REPOSITORIES;
+
+ if (qualify) {
+ return getString("_UI_CreateChild_text2", new Object[] {
+ getTypeText(childObject), getFeatureText(childFeature),
+ getTypeText(owner) });
+ }
+ return super.getCreateChildText(owner, feature, child, selection);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/NotifierItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/NotifierItemProvider.java
new file mode 100644
index 00000000..8c958942
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/NotifierItemProvider.java
@@ -0,0 +1,304 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.Notifier;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier} object. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class NotifierItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotifierItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addTypePropertyDescriptor(object);
+ addSendOnErrorPropertyDescriptor(object);
+ addSendOnFailurePropertyDescriptor(object);
+ addSendOnSuccessPropertyDescriptor(object);
+ addSendOnWarningPropertyDescriptor(object);
+ addAddressPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Type feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addTypePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Notifier_type_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Notifier_type_feature", "_UI_Notifier_type"),
+ PomPackage.Literals.NOTIFIER__TYPE, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Send On Error feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addSendOnErrorPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Notifier_sendOnError_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_Notifier_sendOnError_feature",
+ "_UI_Notifier_type"),
+ PomPackage.Literals.NOTIFIER__SEND_ON_ERROR, true,
+ false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Send On Failure feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addSendOnFailurePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Notifier_sendOnFailure_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Notifier_sendOnFailure_feature",
+ "_UI_Notifier_type"),
+ PomPackage.Literals.NOTIFIER__SEND_ON_FAILURE, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Send On Success feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addSendOnSuccessPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Notifier_sendOnSuccess_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Notifier_sendOnSuccess_feature",
+ "_UI_Notifier_type"),
+ PomPackage.Literals.NOTIFIER__SEND_ON_SUCCESS, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Send On Warning feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addSendOnWarningPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Notifier_sendOnWarning_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Notifier_sendOnWarning_feature",
+ "_UI_Notifier_type"),
+ PomPackage.Literals.NOTIFIER__SEND_ON_WARNING, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Address feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addAddressPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Notifier_address_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Notifier_address_feature", "_UI_Notifier_type"),
+ PomPackage.Literals.NOTIFIER__ADDRESS, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.NOTIFIER__CONFIGURATION);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Notifier.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Notifier"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Notifier) object).getType();
+ return label == null || label.length() == 0 ? getString("_UI_Notifier_type")
+ : getString("_UI_Notifier_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Notifier.class)) {
+ case PomPackage.NOTIFIER__TYPE:
+ case PomPackage.NOTIFIER__SEND_ON_ERROR:
+ case PomPackage.NOTIFIER__SEND_ON_FAILURE:
+ case PomPackage.NOTIFIER__SEND_ON_SUCCESS:
+ case PomPackage.NOTIFIER__SEND_ON_WARNING:
+ case PomPackage.NOTIFIER__ADDRESS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.NOTIFIER__CONFIGURATION:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.NOTIFIER__CONFIGURATION,
+ PomFactory.eINSTANCE.createPropertyElement()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/OrganizationItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/OrganizationItemProvider.java
new file mode 100644
index 00000000..d30dccae
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/OrganizationItemProvider.java
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.Organization;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Organization} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class OrganizationItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public OrganizationItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ addUrlPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Organization_name_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Organization_name_feature",
+ "_UI_Organization_type"),
+ PomPackage.Literals.ORGANIZATION__NAME, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Url feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Organization_url_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Organization_url_feature",
+ "_UI_Organization_type"),
+ PomPackage.Literals.ORGANIZATION__URL, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This returns Organization.gif. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Organization"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Organization) object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_Organization_type")
+ : getString("_UI_Organization_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Organization.class)) {
+ case PomPackage.ORGANIZATION__NAME:
+ case PomPackage.ORGANIZATION__URL:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ParentItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ParentItemProvider.java
new file mode 100644
index 00000000..fb46c3a1
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ParentItemProvider.java
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.Parent;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Parent} object. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ParentItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ParentItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addArtifactIdPropertyDescriptor(object);
+ addGroupIdPropertyDescriptor(object);
+ addVersionPropertyDescriptor(object);
+ addRelativePathPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Artifact Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addArtifactIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Parent_artifactId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Parent_artifactId_feature", "_UI_Parent_type"),
+ PomPackage.Literals.PARENT__ARTIFACT_ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Group Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addGroupIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Parent_groupId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Parent_groupId_feature", "_UI_Parent_type"),
+ PomPackage.Literals.PARENT__GROUP_ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Version feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addVersionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Parent_version_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Parent_version_feature", "_UI_Parent_type"),
+ PomPackage.Literals.PARENT__VERSION, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Relative Path feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addRelativePathPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Parent_relativePath_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Parent_relativePath_feature", "_UI_Parent_type"),
+ PomPackage.Literals.PARENT__RELATIVE_PATH, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns Parent.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Parent"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Parent) object).getArtifactId();
+ return label == null || label.length() == 0 ? getString("_UI_Parent_type")
+ : getString("_UI_Parent_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Parent.class)) {
+ case PomPackage.PARENT__ARTIFACT_ID:
+ case PomPackage.PARENT__GROUP_ID:
+ case PomPackage.PARENT__VERSION:
+ case PomPackage.PARENT__RELATIVE_PATH:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginExecutionItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginExecutionItemProvider.java
new file mode 100644
index 00000000..3a1d1340
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginExecutionItemProvider.java
@@ -0,0 +1,262 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PluginExecution;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.PluginExecution} object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class PluginExecutionItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PluginExecutionItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addIdPropertyDescriptor(object);
+ addPhasePropertyDescriptor(object);
+ addInheritedPropertyDescriptor(object);
+ addConfigurationPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Id feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_PluginExecution_id_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_PluginExecution_id_feature",
+ "_UI_PluginExecution_type"),
+ PomPackage.Literals.PLUGIN_EXECUTION__ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Phase feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addPhasePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_PluginExecution_phase_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_PluginExecution_phase_feature",
+ "_UI_PluginExecution_type"),
+ PomPackage.Literals.PLUGIN_EXECUTION__PHASE, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Inherited feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addInheritedPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_PluginExecution_inherited_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_PluginExecution_inherited_feature",
+ "_UI_PluginExecution_type"),
+ PomPackage.Literals.PLUGIN_EXECUTION__INHERITED, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Configuration feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addConfigurationPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_PluginExecution_configuration_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_PluginExecution_configuration_feature",
+ "_UI_PluginExecution_type"),
+ PomPackage.Literals.PLUGIN_EXECUTION__CONFIGURATION, true,
+ false, true, null, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.PLUGIN_EXECUTION__GOALS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns PluginExecution.gif. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/PluginExecution"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((PluginExecution) object).getId();
+ return label == null || label.length() == 0 ? getString("_UI_PluginExecution_type")
+ : getString("_UI_PluginExecution_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(PluginExecution.class)) {
+ case PomPackage.PLUGIN_EXECUTION__ID:
+ case PomPackage.PLUGIN_EXECUTION__PHASE:
+ case PomPackage.PLUGIN_EXECUTION__INHERITED:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.PLUGIN_EXECUTION__GOALS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PLUGIN_EXECUTION__GOALS, ""));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginItemProvider.java
new file mode 100644
index 00000000..ba7965eb
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginItemProvider.java
@@ -0,0 +1,303 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.Plugin;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin} object. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class PluginItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PluginItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addGroupIdPropertyDescriptor(object);
+ addArtifactIdPropertyDescriptor(object);
+ addVersionPropertyDescriptor(object);
+ addExtensionsPropertyDescriptor(object);
+ addInheritedPropertyDescriptor(object);
+ addConfigurationPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Group Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addGroupIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Plugin_groupId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Plugin_groupId_feature", "_UI_Plugin_type"),
+ PomPackage.Literals.PLUGIN__GROUP_ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Artifact Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addArtifactIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Plugin_artifactId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Plugin_artifactId_feature", "_UI_Plugin_type"),
+ PomPackage.Literals.PLUGIN__ARTIFACT_ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Version feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addVersionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Plugin_version_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Plugin_version_feature", "_UI_Plugin_type"),
+ PomPackage.Literals.PLUGIN__VERSION, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Extensions feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addExtensionsPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Plugin_extensions_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Plugin_extensions_feature", "_UI_Plugin_type"),
+ PomPackage.Literals.PLUGIN__EXTENSIONS, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Inherited feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addInheritedPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Plugin_inherited_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Plugin_inherited_feature", "_UI_Plugin_type"),
+ PomPackage.Literals.PLUGIN__INHERITED, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Configuration feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addConfigurationPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Plugin_configuration_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Plugin_configuration_feature", "_UI_Plugin_type"),
+ PomPackage.Literals.PLUGIN__CONFIGURATION, true, false, true,
+ null, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.PLUGIN__EXECUTIONS);
+ childrenFeatures.add(PomPackage.Literals.PLUGIN__DEPENDENCIES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Plugin.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Plugin"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Plugin) object).getGroupId();
+ return label == null || label.length() == 0 ? getString("_UI_Plugin_type")
+ : getString("_UI_Plugin_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Plugin.class)) {
+ case PomPackage.PLUGIN__GROUP_ID:
+ case PomPackage.PLUGIN__ARTIFACT_ID:
+ case PomPackage.PLUGIN__VERSION:
+ case PomPackage.PLUGIN__EXTENSIONS:
+ case PomPackage.PLUGIN__INHERITED:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.PLUGIN__EXECUTIONS:
+ case PomPackage.PLUGIN__DEPENDENCIES:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PLUGIN__EXECUTIONS, PomFactory.eINSTANCE
+ .createPluginExecution()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PLUGIN__DEPENDENCIES, PomFactory.eINSTANCE
+ .createDependency()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginManagementItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginManagementItemProvider.java
new file mode 100644
index 00000000..b2e3eba5
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PluginManagementItemProvider.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PluginManagement;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.PluginManagement} object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class PluginManagementItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PluginManagementItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures
+ .add(PomPackage.Literals.PLUGIN_MANAGEMENT__PLUGINS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns PluginManagement.gif. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/PluginManagement"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_PluginManagement_type");
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(PluginManagement.class)) {
+ case PomPackage.PLUGIN_MANAGEMENT__PLUGINS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PLUGIN_MANAGEMENT__PLUGINS,
+ PomFactory.eINSTANCE.createPlugin()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PomEditPlugin.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PomEditPlugin.java
new file mode 100644
index 00000000..a395f972
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PomEditPlugin.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import org.eclipse.emf.common.EMFPlugin;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+/**
+ * This is the central singleton for the Pom edit plugin. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public final class PomEditPlugin extends EMFPlugin {
+ /**
+ * Keep track of the singleton. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ public static final PomEditPlugin INSTANCE = new PomEditPlugin();
+
+ /**
+ * Keep track of the singleton. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PomEditPlugin() {
+ super(new ResourceLocator[] {});
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static class Implementation extends EclipsePlugin {
+ /**
+ * Creates an instance. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PomItemProviderAdapterFactory.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PomItemProviderAdapterFactory.java
new file mode 100644
index 00000000..150ee816
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PomItemProviderAdapterFactory.java
@@ -0,0 +1,1243 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.m2e.model.edit.pom.util.PomAdapterFactory;
+
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support
+ * Viewers. The adapters generated by this factory convert EMF adapter
+ * notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The
+ * adapters also support Eclipse property sheets. Note that most of the adapters
+ * are shared among multiple instances. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+public class PomItemProviderAdapterFactory extends PomAdapterFactory implements
+ ComposeableAdapterFactory, IChangeNotifier, IDisposable {
+ /**
+ * This keeps track of the root adapter factory that delegates to this
+ * adapter factory. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ComposedAdapterFactory parentAdapterFactory;
+
+ /**
+ * This is used to implement
+ * {@link org.eclipse.emf.edit.provider.IChangeNotifier}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+ /**
+ * This keeps track of all the supported types checked by
+ * {@link #isFactoryForType isFactoryForType}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<Object> supportedTypes = new ArrayList<Object>();
+
+ /**
+ * This constructs an instance. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ public PomItemProviderAdapterFactory() {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Activation} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ActivationItemProvider activationItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Activation}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createActivationAdapter() {
+ if (activationItemProvider == null) {
+ activationItemProvider = new ActivationItemProvider(this);
+ }
+
+ return activationItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationFile} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ActivationFileItemProvider activationFileItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationFile}. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createActivationFileAdapter() {
+ if (activationFileItemProvider == null) {
+ activationFileItemProvider = new ActivationFileItemProvider(this);
+ }
+
+ return activationFileItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationOS} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ActivationOSItemProvider activationOSItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationOS}. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createActivationOSAdapter() {
+ if (activationOSItemProvider == null) {
+ activationOSItemProvider = new ActivationOSItemProvider(this);
+ }
+
+ return activationOSItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationProperty} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ActivationPropertyItemProvider activationPropertyItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationProperty}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createActivationPropertyAdapter() {
+ if (activationPropertyItemProvider == null) {
+ activationPropertyItemProvider = new ActivationPropertyItemProvider(
+ this);
+ }
+
+ return activationPropertyItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Build} instances. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected BuildItemProvider buildItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.m2e.model.edit.pom.Build}.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createBuildAdapter() {
+ if (buildItemProvider == null) {
+ buildItemProvider = new BuildItemProvider(this);
+ }
+
+ return buildItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected BuildBaseItemProvider buildBaseItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createBuildBaseAdapter() {
+ if (buildBaseItemProvider == null) {
+ buildBaseItemProvider = new BuildBaseItemProvider(this);
+ }
+
+ return buildBaseItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.CiManagement} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected CiManagementItemProvider ciManagementItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.CiManagement}. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createCiManagementAdapter() {
+ if (ciManagementItemProvider == null) {
+ ciManagementItemProvider = new CiManagementItemProvider(this);
+ }
+
+ return ciManagementItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ContributorItemProvider contributorItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createContributorAdapter() {
+ if (contributorItemProvider == null) {
+ contributorItemProvider = new ContributorItemProvider(this);
+ }
+
+ return contributorItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected DependencyItemProvider dependencyItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createDependencyAdapter() {
+ if (dependencyItemProvider == null) {
+ dependencyItemProvider = new DependencyItemProvider(this);
+ }
+
+ return dependencyItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.DependencyManagement} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected DependencyManagementItemProvider dependencyManagementItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.DependencyManagement}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createDependencyManagementAdapter() {
+ if (dependencyManagementItemProvider == null) {
+ dependencyManagementItemProvider = new DependencyManagementItemProvider(
+ this);
+ }
+
+ return dependencyManagementItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected DeploymentRepositoryItemProvider deploymentRepositoryItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createDeploymentRepositoryAdapter() {
+ if (deploymentRepositoryItemProvider == null) {
+ deploymentRepositoryItemProvider = new DeploymentRepositoryItemProvider(
+ this);
+ }
+
+ return deploymentRepositoryItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Developer} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected DeveloperItemProvider developerItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Developer}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createDeveloperAdapter() {
+ if (developerItemProvider == null) {
+ developerItemProvider = new DeveloperItemProvider(this);
+ }
+
+ return developerItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement} instances.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected DistributionManagementItemProvider distributionManagementItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createDistributionManagementAdapter() {
+ if (distributionManagementItemProvider == null) {
+ distributionManagementItemProvider = new DistributionManagementItemProvider(
+ this);
+ }
+
+ return distributionManagementItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.DocumentRoot} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected DocumentRootItemProvider documentRootItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.DocumentRoot}. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createDocumentRootAdapter() {
+ if (documentRootItemProvider == null) {
+ documentRootItemProvider = new DocumentRootItemProvider(this);
+ }
+
+ return documentRootItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Exclusion} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ExclusionItemProvider exclusionItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Exclusion}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createExclusionAdapter() {
+ if (exclusionItemProvider == null) {
+ exclusionItemProvider = new ExclusionItemProvider(this);
+ }
+
+ return exclusionItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Extension} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ExtensionItemProvider extensionItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Extension}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createExtensionAdapter() {
+ if (extensionItemProvider == null) {
+ extensionItemProvider = new ExtensionItemProvider(this);
+ }
+
+ return extensionItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.IssueManagement} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IssueManagementItemProvider issueManagementItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.IssueManagement}. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createIssueManagementAdapter() {
+ if (issueManagementItemProvider == null) {
+ issueManagementItemProvider = new IssueManagementItemProvider(this);
+ }
+
+ return issueManagementItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.License} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected LicenseItemProvider licenseItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.License}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createLicenseAdapter() {
+ if (licenseItemProvider == null) {
+ licenseItemProvider = new LicenseItemProvider(this);
+ }
+
+ return licenseItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.MailingList} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected MailingListItemProvider mailingListItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.MailingList}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createMailingListAdapter() {
+ if (mailingListItemProvider == null) {
+ mailingListItemProvider = new MailingListItemProvider(this);
+ }
+
+ return mailingListItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Model} instances. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ModelItemProvider modelItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.m2e.model.edit.pom.Model}.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createModelAdapter() {
+ if (modelItemProvider == null) {
+ modelItemProvider = new ModelItemProvider(this);
+ }
+
+ return modelItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected NotifierItemProvider notifierItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createNotifierAdapter() {
+ if (notifierItemProvider == null) {
+ notifierItemProvider = new NotifierItemProvider(this);
+ }
+
+ return notifierItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Organization} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected OrganizationItemProvider organizationItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Organization}. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createOrganizationAdapter() {
+ if (organizationItemProvider == null) {
+ organizationItemProvider = new OrganizationItemProvider(this);
+ }
+
+ return organizationItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Parent} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ParentItemProvider parentItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.m2e.model.edit.pom.Parent}
+ * . <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createParentAdapter() {
+ if (parentItemProvider == null) {
+ parentItemProvider = new ParentItemProvider(this);
+ }
+
+ return parentItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PluginItemProvider pluginItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.m2e.model.edit.pom.Plugin}
+ * . <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createPluginAdapter() {
+ if (pluginItemProvider == null) {
+ pluginItemProvider = new PluginItemProvider(this);
+ }
+
+ return pluginItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.PluginExecution} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PluginExecutionItemProvider pluginExecutionItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.PluginExecution}. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createPluginExecutionAdapter() {
+ if (pluginExecutionItemProvider == null) {
+ pluginExecutionItemProvider = new PluginExecutionItemProvider(this);
+ }
+
+ return pluginExecutionItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.PluginManagement} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PluginManagementItemProvider pluginManagementItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.PluginManagement}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createPluginManagementAdapter() {
+ if (pluginManagementItemProvider == null) {
+ pluginManagementItemProvider = new PluginManagementItemProvider(
+ this);
+ }
+
+ return pluginManagementItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Prerequisites} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PrerequisitesItemProvider prerequisitesItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Prerequisites}. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createPrerequisitesAdapter() {
+ if (prerequisitesItemProvider == null) {
+ prerequisitesItemProvider = new PrerequisitesItemProvider(this);
+ }
+
+ return prerequisitesItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Profile} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ProfileItemProvider profileItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Profile}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createProfileAdapter() {
+ if (profileItemProvider == null) {
+ profileItemProvider = new ProfileItemProvider(this);
+ }
+
+ return profileItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Relocation} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected RelocationItemProvider relocationItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Relocation}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createRelocationAdapter() {
+ if (relocationItemProvider == null) {
+ relocationItemProvider = new RelocationItemProvider(this);
+ }
+
+ return relocationItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Reporting} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ReportingItemProvider reportingItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Reporting}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createReportingAdapter() {
+ if (reportingItemProvider == null) {
+ reportingItemProvider = new ReportingItemProvider(this);
+ }
+
+ return reportingItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ReportPluginItemProvider reportPluginItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin}. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createReportPluginAdapter() {
+ if (reportPluginItemProvider == null) {
+ reportPluginItemProvider = new ReportPluginItemProvider(this);
+ }
+
+ return reportPluginItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.ReportSet} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ReportSetItemProvider reportSetItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.ReportSet}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createReportSetAdapter() {
+ if (reportSetItemProvider == null) {
+ reportSetItemProvider = new ReportSetItemProvider(this);
+ }
+
+ return reportSetItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Repository} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected RepositoryItemProvider repositoryItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Repository}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createRepositoryAdapter() {
+ if (repositoryItemProvider == null) {
+ repositoryItemProvider = new RepositoryItemProvider(this);
+ }
+
+ return repositoryItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected RepositoryPolicyItemProvider repositoryPolicyItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createRepositoryPolicyAdapter() {
+ if (repositoryPolicyItemProvider == null) {
+ repositoryPolicyItemProvider = new RepositoryPolicyItemProvider(
+ this);
+ }
+
+ return repositoryPolicyItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Resource} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ResourceItemProvider resourceItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Resource}. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createResourceAdapter() {
+ if (resourceItemProvider == null) {
+ resourceItemProvider = new ResourceItemProvider(this);
+ }
+
+ return resourceItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Scm} instances. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ScmItemProvider scmItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.m2e.model.edit.pom.Scm}.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createScmAdapter() {
+ if (scmItemProvider == null) {
+ scmItemProvider = new ScmItemProvider(this);
+ }
+
+ return scmItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Site} instances. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected SiteItemProvider siteItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.m2e.model.edit.pom.Site}.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createSiteAdapter() {
+ if (siteItemProvider == null) {
+ siteItemProvider = new SiteItemProvider(this);
+ }
+
+ return siteItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.PropertyElement} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PropertyElementItemProvider propertyElementItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.PropertyElement}. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createPropertyElementAdapter() {
+ if (propertyElementItemProvider == null) {
+ propertyElementItemProvider = new PropertyElementItemProvider(this);
+ }
+
+ return propertyElementItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all
+ * {@link org.eclipse.m2e.model.edit.pom.Configuration} instances. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ConfigurationItemProvider configurationItemProvider;
+
+ /**
+ * This creates an adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Configuration}. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter createConfigurationAdapter() {
+ if (configurationItemProvider == null) {
+ configurationItemProvider = new ConfigurationItemProvider(this);
+ }
+
+ return configurationItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ComposeableAdapterFactory getRootAdapterFactory() {
+ return parentAdapterFactory == null ? this : parentAdapterFactory
+ .getRootAdapterFactory();
+ }
+
+ /**
+ * This sets the composed adapter factory that contains this factory. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setParentAdapterFactory(
+ ComposedAdapterFactory parentAdapterFactory) {
+ this.parentAdapterFactory = parentAdapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object type) {
+ return supportedTypes.contains(type) || super.isFactoryForType(type);
+ }
+
+ /**
+ * This implementation substitutes the factory itself as the key for the
+ * adapter. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Adapter adapt(Notifier notifier, Object type) {
+ return super.adapt(notifier, this);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object adapt(Object object, Object type) {
+ if (isFactoryForType(type)) {
+ Object adapter = super.adapt(object, type);
+ if (!(type instanceof Class)
+ || (((Class<?>) type).isInstance(adapter))) {
+ return adapter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * This adds a listener. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void addListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.addListener(notifyChangedListener);
+ }
+
+ /**
+ * This removes a listener. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void removeListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.removeListener(notifyChangedListener);
+ }
+
+ /**
+ * This delegates to {@link #changeNotifier} and to
+ * {@link #parentAdapterFactory}. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ public void fireNotifyChanged(Notification notification) {
+ changeNotifier.fireNotifyChanged(notification);
+
+ if (parentAdapterFactory != null) {
+ parentAdapterFactory.fireNotifyChanged(notification);
+ }
+ }
+
+ /**
+ * This disposes all of the item providers created by this factory. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void dispose() {
+ if (activationItemProvider != null)
+ activationItemProvider.dispose();
+ if (activationFileItemProvider != null)
+ activationFileItemProvider.dispose();
+ if (activationOSItemProvider != null)
+ activationOSItemProvider.dispose();
+ if (activationPropertyItemProvider != null)
+ activationPropertyItemProvider.dispose();
+ if (buildItemProvider != null)
+ buildItemProvider.dispose();
+ if (buildBaseItemProvider != null)
+ buildBaseItemProvider.dispose();
+ if (ciManagementItemProvider != null)
+ ciManagementItemProvider.dispose();
+ if (contributorItemProvider != null)
+ contributorItemProvider.dispose();
+ if (dependencyItemProvider != null)
+ dependencyItemProvider.dispose();
+ if (dependencyManagementItemProvider != null)
+ dependencyManagementItemProvider.dispose();
+ if (deploymentRepositoryItemProvider != null)
+ deploymentRepositoryItemProvider.dispose();
+ if (developerItemProvider != null)
+ developerItemProvider.dispose();
+ if (distributionManagementItemProvider != null)
+ distributionManagementItemProvider.dispose();
+ if (documentRootItemProvider != null)
+ documentRootItemProvider.dispose();
+ if (exclusionItemProvider != null)
+ exclusionItemProvider.dispose();
+ if (extensionItemProvider != null)
+ extensionItemProvider.dispose();
+ if (issueManagementItemProvider != null)
+ issueManagementItemProvider.dispose();
+ if (licenseItemProvider != null)
+ licenseItemProvider.dispose();
+ if (mailingListItemProvider != null)
+ mailingListItemProvider.dispose();
+ if (modelItemProvider != null)
+ modelItemProvider.dispose();
+ if (notifierItemProvider != null)
+ notifierItemProvider.dispose();
+ if (organizationItemProvider != null)
+ organizationItemProvider.dispose();
+ if (parentItemProvider != null)
+ parentItemProvider.dispose();
+ if (pluginItemProvider != null)
+ pluginItemProvider.dispose();
+ if (pluginExecutionItemProvider != null)
+ pluginExecutionItemProvider.dispose();
+ if (pluginManagementItemProvider != null)
+ pluginManagementItemProvider.dispose();
+ if (prerequisitesItemProvider != null)
+ prerequisitesItemProvider.dispose();
+ if (profileItemProvider != null)
+ profileItemProvider.dispose();
+ if (relocationItemProvider != null)
+ relocationItemProvider.dispose();
+ if (reportingItemProvider != null)
+ reportingItemProvider.dispose();
+ if (reportPluginItemProvider != null)
+ reportPluginItemProvider.dispose();
+ if (reportSetItemProvider != null)
+ reportSetItemProvider.dispose();
+ if (repositoryItemProvider != null)
+ repositoryItemProvider.dispose();
+ if (repositoryPolicyItemProvider != null)
+ repositoryPolicyItemProvider.dispose();
+ if (resourceItemProvider != null)
+ resourceItemProvider.dispose();
+ if (scmItemProvider != null)
+ scmItemProvider.dispose();
+ if (siteItemProvider != null)
+ siteItemProvider.dispose();
+ if (propertyElementItemProvider != null)
+ propertyElementItemProvider.dispose();
+ if (configurationItemProvider != null)
+ configurationItemProvider.dispose();
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PrerequisitesItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PrerequisitesItemProvider.java
new file mode 100644
index 00000000..216d9334
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PrerequisitesItemProvider.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Prerequisites;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Prerequisites} object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class PrerequisitesItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PrerequisitesItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addMavenPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Maven feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addMavenPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Prerequisites_maven_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Prerequisites_maven_feature",
+ "_UI_Prerequisites_type"),
+ PomPackage.Literals.PREREQUISITES__MAVEN, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns Prerequisites.gif. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Prerequisites"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Prerequisites) object).getMaven();
+ return label == null || label.length() == 0 ? getString("_UI_Prerequisites_type")
+ : getString("_UI_Prerequisites_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Prerequisites.class)) {
+ case PomPackage.PREREQUISITES__MAVEN:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ProfileItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ProfileItemProvider.java
new file mode 100644
index 00000000..3a449d30
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ProfileItemProvider.java
@@ -0,0 +1,305 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Profile;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Profile} object. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ProfileItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ProfileItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addIdPropertyDescriptor(object);
+ addReportingPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Id feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Profile_id_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Profile_id_feature", "_UI_Profile_type"),
+ PomPackage.Literals.PROFILE__ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Reporting feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addReportingPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Profile_reporting_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Profile_reporting_feature", "_UI_Profile_type"),
+ PomPackage.Literals.PROFILE__REPORTING, true, false, true,
+ null, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.PROFILE__ACTIVATION);
+ childrenFeatures.add(PomPackage.Literals.PROFILE__BUILD);
+ childrenFeatures.add(PomPackage.Literals.PROFILE__REPOSITORIES);
+ childrenFeatures
+ .add(PomPackage.Literals.PROFILE__PLUGIN_REPOSITORIES);
+ childrenFeatures.add(PomPackage.Literals.PROFILE__DEPENDENCIES);
+ childrenFeatures.add(PomPackage.Literals.PROFILE__REPORTS);
+ childrenFeatures
+ .add(PomPackage.Literals.PROFILE__DEPENDENCY_MANAGEMENT);
+ childrenFeatures
+ .add(PomPackage.Literals.PROFILE__DISTRIBUTION_MANAGEMENT);
+ childrenFeatures.add(PomPackage.Literals.PROFILE__PROPERTIES);
+ childrenFeatures.add(PomPackage.Literals.PROFILE__MODULES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Profile.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Profile"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Profile) object).getId();
+ return label == null || label.length() == 0 ? getString("_UI_Profile_type")
+ : getString("_UI_Profile_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Profile.class)) {
+ case PomPackage.PROFILE__ID:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.PROFILE__ACTIVATION:
+ case PomPackage.PROFILE__BUILD:
+ case PomPackage.PROFILE__REPOSITORIES:
+ case PomPackage.PROFILE__PLUGIN_REPOSITORIES:
+ case PomPackage.PROFILE__DEPENDENCIES:
+ case PomPackage.PROFILE__REPORTS:
+ case PomPackage.PROFILE__DEPENDENCY_MANAGEMENT:
+ case PomPackage.PROFILE__DISTRIBUTION_MANAGEMENT:
+ case PomPackage.PROFILE__PROPERTIES:
+ case PomPackage.PROFILE__MODULES:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PROFILE__ACTIVATION, PomFactory.eINSTANCE
+ .createActivation()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PROFILE__BUILD, PomFactory.eINSTANCE
+ .createBuildBase()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PROFILE__BUILD, PomFactory.eINSTANCE
+ .createBuild()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PROFILE__REPOSITORIES, PomFactory.eINSTANCE
+ .createRepository()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PROFILE__PLUGIN_REPOSITORIES,
+ PomFactory.eINSTANCE.createRepository()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PROFILE__DEPENDENCIES, PomFactory.eINSTANCE
+ .createDependency()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PROFILE__REPORTS, PomFactory.eINSTANCE
+ .createReportPlugin()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PROFILE__DEPENDENCY_MANAGEMENT,
+ PomFactory.eINSTANCE.createDependencyManagement()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PROFILE__DISTRIBUTION_MANAGEMENT,
+ PomFactory.eINSTANCE.createDistributionManagement()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PROFILE__PROPERTIES, PomFactory.eINSTANCE
+ .createPropertyElement()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.PROFILE__MODULES, ""));
+ }
+
+ /**
+ * This returns the label text for
+ * {@link org.eclipse.emf.edit.command.CreateChildCommand}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getCreateChildText(Object owner, Object feature,
+ Object child, Collection<?> selection) {
+ Object childFeature = feature;
+ Object childObject = child;
+
+ boolean qualify = childFeature == PomPackage.Literals.PROFILE__REPOSITORIES
+ || childFeature == PomPackage.Literals.PROFILE__PLUGIN_REPOSITORIES;
+
+ if (qualify) {
+ return getString("_UI_CreateChild_text2", new Object[] {
+ getTypeText(childObject), getFeatureText(childFeature),
+ getTypeText(owner) });
+ }
+ return super.getCreateChildText(owner, feature, child, selection);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PropertyElementItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PropertyElementItemProvider.java
new file mode 100644
index 00000000..0015d7cc
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/PropertyElementItemProvider.java
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.PropertyElement} object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class PropertyElementItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PropertyElementItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ addValuePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_PropertyElement_name_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_PropertyElement_name_feature",
+ "_UI_PropertyElement_type"),
+ PomPackage.Literals.PROPERTY_ELEMENT__NAME, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Value feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addValuePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_PropertyElement_value_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_PropertyElement_value_feature",
+ "_UI_PropertyElement_type"),
+ PomPackage.Literals.PROPERTY_ELEMENT__VALUE, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns PropertyElement.gif. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/PropertyElement"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((PropertyElement) object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_PropertyElement_type")
+ : getString("_UI_PropertyElement_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(PropertyElement.class)) {
+ case PomPackage.PROPERTY_ELEMENT__NAME:
+ case PomPackage.PROPERTY_ELEMENT__VALUE:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RelocationItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RelocationItemProvider.java
new file mode 100644
index 00000000..8f35e7ef
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RelocationItemProvider.java
@@ -0,0 +1,226 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Relocation;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Relocation} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class RelocationItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public RelocationItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addGroupIdPropertyDescriptor(object);
+ addArtifactIdPropertyDescriptor(object);
+ addVersionPropertyDescriptor(object);
+ addMessagePropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Group Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addGroupIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Relocation_groupId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Relocation_groupId_feature",
+ "_UI_Relocation_type"),
+ PomPackage.Literals.RELOCATION__GROUP_ID, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Artifact Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addArtifactIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Relocation_artifactId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Relocation_artifactId_feature",
+ "_UI_Relocation_type"),
+ PomPackage.Literals.RELOCATION__ARTIFACT_ID, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Version feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addVersionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Relocation_version_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Relocation_version_feature",
+ "_UI_Relocation_type"),
+ PomPackage.Literals.RELOCATION__VERSION, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Message feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addMessagePropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Relocation_message_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Relocation_message_feature",
+ "_UI_Relocation_type"),
+ PomPackage.Literals.RELOCATION__MESSAGE, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This returns Relocation.gif. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Relocation"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Relocation) object).getGroupId();
+ return label == null || label.length() == 0 ? getString("_UI_Relocation_type")
+ : getString("_UI_Relocation_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Relocation.class)) {
+ case PomPackage.RELOCATION__GROUP_ID:
+ case PomPackage.RELOCATION__ARTIFACT_ID:
+ case PomPackage.RELOCATION__VERSION:
+ case PomPackage.RELOCATION__MESSAGE:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportPluginItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportPluginItemProvider.java
new file mode 100644
index 00000000..22196167
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportPluginItemProvider.java
@@ -0,0 +1,285 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.ReportPlugin;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ReportPluginItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ReportPluginItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addGroupIdPropertyDescriptor(object);
+ addArtifactIdPropertyDescriptor(object);
+ addVersionPropertyDescriptor(object);
+ addInheritedPropertyDescriptor(object);
+ addConfigurationPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Group Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addGroupIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ReportPlugin_groupId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ReportPlugin_groupId_feature",
+ "_UI_ReportPlugin_type"),
+ PomPackage.Literals.REPORT_PLUGIN__GROUP_ID, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Artifact Id feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addArtifactIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ReportPlugin_artifactId_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ReportPlugin_artifactId_feature",
+ "_UI_ReportPlugin_type"),
+ PomPackage.Literals.REPORT_PLUGIN__ARTIFACT_ID, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Version feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addVersionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ReportPlugin_version_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ReportPlugin_version_feature",
+ "_UI_ReportPlugin_type"),
+ PomPackage.Literals.REPORT_PLUGIN__VERSION, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Inherited feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addInheritedPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ReportPlugin_inherited_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ReportPlugin_inherited_feature",
+ "_UI_ReportPlugin_type"),
+ PomPackage.Literals.REPORT_PLUGIN__INHERITED, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Configuration feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addConfigurationPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ReportPlugin_configuration_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ReportPlugin_configuration_feature",
+ "_UI_ReportPlugin_type"),
+ PomPackage.Literals.REPORT_PLUGIN__CONFIGURATION, true, false,
+ true, null, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures
+ .add(PomPackage.Literals.REPORT_PLUGIN__REPORT_SETS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns ReportPlugin.gif. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/ReportPlugin"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((ReportPlugin) object).getGroupId();
+ return label == null || label.length() == 0 ? getString("_UI_ReportPlugin_type")
+ : getString("_UI_ReportPlugin_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(ReportPlugin.class)) {
+ case PomPackage.REPORT_PLUGIN__GROUP_ID:
+ case PomPackage.REPORT_PLUGIN__ARTIFACT_ID:
+ case PomPackage.REPORT_PLUGIN__VERSION:
+ case PomPackage.REPORT_PLUGIN__INHERITED:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.REPORT_PLUGIN__REPORT_SETS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.REPORT_PLUGIN__REPORT_SETS,
+ PomFactory.eINSTANCE.createReportSet()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportSetItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportSetItemProvider.java
new file mode 100644
index 00000000..dbd17522
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportSetItemProvider.java
@@ -0,0 +1,242 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.ReportSet;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.ReportSet} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ReportSetItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ReportSetItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addIdPropertyDescriptor(object);
+ addInheritedPropertyDescriptor(object);
+ addConfigurationPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Id feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ReportSet_id_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ReportSet_id_feature", "_UI_ReportSet_type"),
+ PomPackage.Literals.REPORT_SET__ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Inherited feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addInheritedPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ReportSet_inherited_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_ReportSet_inherited_feature",
+ "_UI_ReportSet_type"),
+ PomPackage.Literals.REPORT_SET__INHERITED, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Configuration feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addConfigurationPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ReportSet_configuration_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_ReportSet_configuration_feature",
+ "_UI_ReportSet_type"),
+ PomPackage.Literals.REPORT_SET__CONFIGURATION, true, false,
+ true, null, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.REPORT_SET__REPORTS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns ReportSet.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/ReportSet"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((ReportSet) object).getId();
+ return label == null || label.length() == 0 ? getString("_UI_ReportSet_type")
+ : getString("_UI_ReportSet_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(ReportSet.class)) {
+ case PomPackage.REPORT_SET__ID:
+ case PomPackage.REPORT_SET__INHERITED:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.REPORT_SET__REPORTS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.REPORT_SET__REPORTS, ""));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportingItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportingItemProvider.java
new file mode 100644
index 00000000..bf398207
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ReportingItemProvider.java
@@ -0,0 +1,224 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Reporting;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Reporting} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ReportingItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ReportingItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addExcludeDefaultsPropertyDescriptor(object);
+ addOutputDirectoryPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Exclude Defaults feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addExcludeDefaultsPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Reporting_excludeDefaults_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Reporting_excludeDefaults_feature",
+ "_UI_Reporting_type"),
+ PomPackage.Literals.REPORTING__EXCLUDE_DEFAULTS, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Output Directory feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addOutputDirectoryPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Reporting_outputDirectory_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Reporting_outputDirectory_feature",
+ "_UI_Reporting_type"),
+ PomPackage.Literals.REPORTING__OUTPUT_DIRECTORY, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.REPORTING__PLUGINS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Reporting.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Reporting"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Reporting) object).getExcludeDefaults();
+ return label == null || label.length() == 0 ? getString("_UI_Reporting_type")
+ : getString("_UI_Reporting_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Reporting.class)) {
+ case PomPackage.REPORTING__EXCLUDE_DEFAULTS:
+ case PomPackage.REPORTING__OUTPUT_DIRECTORY:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.REPORTING__PLUGINS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.REPORTING__PLUGINS, PomFactory.eINSTANCE
+ .createReportPlugin()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RepositoryItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RepositoryItemProvider.java
new file mode 100644
index 00000000..19c6618b
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RepositoryItemProvider.java
@@ -0,0 +1,294 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Repository;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Repository} object. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class RepositoryItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public RepositoryItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addIdPropertyDescriptor(object);
+ addNamePropertyDescriptor(object);
+ addUrlPropertyDescriptor(object);
+ addLayoutPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Id feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Repository_id_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Repository_id_feature", "_UI_Repository_type"),
+ PomPackage.Literals.REPOSITORY__ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Repository_name_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Repository_name_feature", "_UI_Repository_type"),
+ PomPackage.Literals.REPOSITORY__NAME, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Url feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Repository_url_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Repository_url_feature", "_UI_Repository_type"),
+ PomPackage.Literals.REPOSITORY__URL, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Layout feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addLayoutPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Repository_layout_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Repository_layout_feature",
+ "_UI_Repository_type"),
+ PomPackage.Literals.REPOSITORY__LAYOUT, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.REPOSITORY__RELEASES);
+ childrenFeatures.add(PomPackage.Literals.REPOSITORY__SNAPSHOTS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Repository.gif. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Repository"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Repository) object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_Repository_type")
+ : getString("_UI_Repository_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Repository.class)) {
+ case PomPackage.REPOSITORY__ID:
+ case PomPackage.REPOSITORY__NAME:
+ case PomPackage.REPOSITORY__URL:
+ case PomPackage.REPOSITORY__LAYOUT:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.REPOSITORY__RELEASES:
+ case PomPackage.REPOSITORY__SNAPSHOTS:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.REPOSITORY__RELEASES, PomFactory.eINSTANCE
+ .createRepositoryPolicy()));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.REPOSITORY__SNAPSHOTS, PomFactory.eINSTANCE
+ .createRepositoryPolicy()));
+ }
+
+ /**
+ * This returns the label text for
+ * {@link org.eclipse.emf.edit.command.CreateChildCommand}. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getCreateChildText(Object owner, Object feature,
+ Object child, Collection<?> selection) {
+ Object childFeature = feature;
+ Object childObject = child;
+
+ boolean qualify = childFeature == PomPackage.Literals.REPOSITORY__RELEASES
+ || childFeature == PomPackage.Literals.REPOSITORY__SNAPSHOTS;
+
+ if (qualify) {
+ return getString("_UI_CreateChild_text2", new Object[] {
+ getTypeText(childObject), getFeatureText(childFeature),
+ getTypeText(owner) });
+ }
+ return super.getCreateChildText(owner, feature, child, selection);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RepositoryPolicyItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RepositoryPolicyItemProvider.java
new file mode 100644
index 00000000..08977f15
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/RepositoryPolicyItemProvider.java
@@ -0,0 +1,202 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.RepositoryPolicy;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy} object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class RepositoryPolicyItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public RepositoryPolicyItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addEnabledPropertyDescriptor(object);
+ addUpdatePolicyPropertyDescriptor(object);
+ addChecksumPolicyPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Enabled feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addEnabledPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_RepositoryPolicy_enabled_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_RepositoryPolicy_enabled_feature",
+ "_UI_RepositoryPolicy_type"),
+ PomPackage.Literals.REPOSITORY_POLICY__ENABLED, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Update Policy feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUpdatePolicyPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_RepositoryPolicy_updatePolicy_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_RepositoryPolicy_updatePolicy_feature",
+ "_UI_RepositoryPolicy_type"),
+ PomPackage.Literals.REPOSITORY_POLICY__UPDATE_POLICY, true,
+ false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Checksum Policy feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addChecksumPolicyPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_RepositoryPolicy_checksumPolicy_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_RepositoryPolicy_checksumPolicy_feature",
+ "_UI_RepositoryPolicy_type"),
+ PomPackage.Literals.REPOSITORY_POLICY__CHECKSUM_POLICY, true,
+ false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null,
+ null));
+ }
+
+ /**
+ * This returns RepositoryPolicy.gif. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/RepositoryPolicy"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((RepositoryPolicy) object).getEnabled();
+ return label == null || label.length() == 0 ? getString("_UI_RepositoryPolicy_type")
+ : getString("_UI_RepositoryPolicy_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(RepositoryPolicy.class)) {
+ case PomPackage.REPOSITORY_POLICY__ENABLED:
+ case PomPackage.REPOSITORY_POLICY__UPDATE_POLICY:
+ case PomPackage.REPOSITORY_POLICY__CHECKSUM_POLICY:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ResourceItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ResourceItemProvider.java
new file mode 100644
index 00000000..51c6a44c
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ResourceItemProvider.java
@@ -0,0 +1,247 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Resource;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Resource} object. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class ResourceItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ResourceItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addTargetPathPropertyDescriptor(object);
+ addFilteringPropertyDescriptor(object);
+ addDirectoryPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Target Path feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addTargetPathPropertyDescriptor(Object object) {
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Resource_targetPath_feature"),
+ getString("_UI_PropertyDescriptor_description",
+ "_UI_Resource_targetPath_feature",
+ "_UI_Resource_type"),
+ PomPackage.Literals.RESOURCE__TARGET_PATH, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Filtering feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addFilteringPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Resource_filtering_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Resource_filtering_feature", "_UI_Resource_type"),
+ PomPackage.Literals.RESOURCE__FILTERING, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Directory feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addDirectoryPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Resource_directory_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Resource_directory_feature", "_UI_Resource_type"),
+ PomPackage.Literals.RESOURCE__DIRECTORY, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to
+ * deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand},
+ * {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in
+ * {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(
+ Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(PomPackage.Literals.RESOURCE__INCLUDES);
+ childrenFeatures.add(PomPackage.Literals.RESOURCE__EXCLUDES);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper
+ // feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns Resource.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Resource"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Resource) object).getTargetPath();
+ return label == null || label.length() == 0 ? getString("_UI_Resource_type")
+ : getString("_UI_Resource_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Resource.class)) {
+ case PomPackage.RESOURCE__TARGET_PATH:
+ case PomPackage.RESOURCE__FILTERING:
+ case PomPackage.RESOURCE__DIRECTORY:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ case PomPackage.RESOURCE__INCLUDES:
+ case PomPackage.RESOURCE__EXCLUDES:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.RESOURCE__INCLUDES, ""));
+
+ newChildDescriptors.add(createChildParameter(
+ PomPackage.Literals.RESOURCE__EXCLUDES, ""));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ScmItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ScmItemProvider.java
new file mode 100644
index 00000000..82db76ba
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/ScmItemProvider.java
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Scm;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Scm} object. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+public class ScmItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ScmItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addConnectionPropertyDescriptor(object);
+ addDeveloperConnectionPropertyDescriptor(object);
+ addTagPropertyDescriptor(object);
+ addUrlPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Connection feature. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addConnectionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Scm_connection_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Scm_connection_feature", "_UI_Scm_type"),
+ PomPackage.Literals.SCM__CONNECTION, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Developer Connection feature.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addDeveloperConnectionPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Scm_developerConnection_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Scm_developerConnection_feature", "_UI_Scm_type"),
+ PomPackage.Literals.SCM__DEVELOPER_CONNECTION, true, false,
+ false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Tag feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addTagPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Scm_tag_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Scm_tag_feature", "_UI_Scm_type"),
+ PomPackage.Literals.SCM__TAG, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Url feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Scm_url_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Scm_url_feature", "_UI_Scm_type"),
+ PomPackage.Literals.SCM__URL, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns Scm.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Scm"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Scm) object).getConnection();
+ return label == null || label.length() == 0 ? getString("_UI_Scm_type")
+ : getString("_UI_Scm_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Scm.class)) {
+ case PomPackage.SCM__CONNECTION:
+ case PomPackage.SCM__DEVELOPER_CONNECTION:
+ case PomPackage.SCM__TAG:
+ case PomPackage.SCM__URL:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/SiteItemProvider.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/SiteItemProvider.java
new file mode 100644
index 00000000..f03c7db7
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/provider/SiteItemProvider.java
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.provider;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.Site;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.m2e.model.edit.pom.Site} object. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class SiteItemProvider extends ItemProviderAdapter implements
+ IEditingDomainItemProvider, IStructuredItemContentProvider,
+ ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public SiteItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addIdPropertyDescriptor(object);
+ addNamePropertyDescriptor(object);
+ addUrlPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Id feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addIdPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Site_id_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Site_id_feature", "_UI_Site_type"),
+ PomPackage.Literals.SITE__ID, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Site_name_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Site_name_feature", "_UI_Site_type"),
+ PomPackage.Literals.SITE__NAME, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Url feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addUrlPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(
+ ((ComposeableAdapterFactory) adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_Site_url_feature"), getString(
+ "_UI_PropertyDescriptor_description",
+ "_UI_Site_url_feature", "_UI_Site_type"),
+ PomPackage.Literals.SITE__URL, true, false, false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This returns Site.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage(
+ "full/obj16/Site"));
+ }
+
+ /**
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((Site) object).getName();
+ return label == null || label.length() == 0 ? getString("_UI_Site_type")
+ : getString("_UI_Site_type") + " " + label;
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(Site.class)) {
+ case PomPackage.SITE__ID:
+ case PomPackage.SITE__NAME:
+ case PomPackage.SITE__URL:
+ fireNotifyChanged(new ViewerNotification(notification, notification
+ .getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
+ * describing the children that can be created under this object. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(
+ Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PomEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ConfigurationAdapter.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ConfigurationAdapter.java
new file mode 100644
index 00000000..918e1e87
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ConfigurationAdapter.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.translators;
+
+import org.eclipse.m2e.model.edit.pom.Configuration;
+import org.eclipse.m2e.model.edit.pom.impl.ConfigurationImpl;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.w3c.dom.Element;
+
+/**
+ * Synchronizes configuration elements between XML and model
+ *
+ * @author Mike Poindexter
+ */
+class ConfigurationAdapter extends TranslatorAdapter implements INodeAdapter {
+
+ private Configuration modelObject;
+
+ public ConfigurationAdapter(SSESyncResource resource, Element node,
+ Configuration object) {
+ super(resource);
+ this.node = node;
+ this.modelObject = object;
+ load();
+ }
+
+ public boolean isAdapterForType(Object type) {
+ return ConfigurationAdapter.class.equals(type);
+ }
+
+ public void notifyChanged(INodeNotifier notifier, int eventType,
+ Object changedFeature, Object oldValue, Object newValue, int pos) {
+ // A catch-all notificator.
+ // The configuration section can differ with every plugin, so we cannot really have a
+ // static EMF model. So we'll just notify the subscribers and let them act accordingly.
+ ((ConfigurationImpl)modelObject).doNotify(eventType, changedFeature, oldValue, newValue);
+ }
+
+ @Override
+ public void load() {
+ ((ConfigurationImpl)modelObject).setConfigurationNode(node);
+ }
+
+ @Override
+ public void save() {
+ }
+
+ @Override
+ public void update(Object oldValue, Object newValue, int index) {
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ListAdapter.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ListAdapter.java
new file mode 100644
index 00000000..cfa7afb1
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ListAdapter.java
@@ -0,0 +1,230 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.translators;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+/**
+ * Translates a multi valued feature into a <foos> <foo>bar</foo> </foos>
+ *
+ * structure.
+ *
+ * @author Mike Poindexter
+ *
+ */
+public class ListAdapter extends TranslatorAdapter {
+ protected List list;
+
+ private EClass elementType;
+
+ public ListAdapter(SSESyncResource resc, Element containerNode,
+ List<?> list, EClass elementType) {
+ super(resc);
+ this.node = containerNode;
+ this.elementType = elementType;
+ this.list = list;
+ this.resource = resc;
+ }
+
+ public void notifyChanged(INodeNotifier notifier, int eventType,
+ Object changedFeature, Object oldValue, Object newValue, int pos) {
+ if (resource.isProcessEvents()) {
+ try {
+ resource.setProcessEvents(false);
+ if (INodeNotifier.ADD == eventType
+ && newValue instanceof Element) {
+ if (notifier == node) {
+ IDOMElement addedElement = (IDOMElement) newValue;
+ int idx = absoluteIndexOf(node, addedElement);
+ if (idx == -1)
+ idx = 0;
+ list.add(idx, getObject(addedElement, true));
+ }
+ } else if (INodeNotifier.REMOVE == eventType
+ && oldValue instanceof Element) {
+ IDOMElement el = (IDOMElement)oldValue;
+ if (notifier == node) {
+ // Remove the corresponding object from the model.
+ Object o = getObject((Element) oldValue, false);
+ if (o instanceof String && o.toString().length() == 0) {
+ // the removed oldValue has unfortunately no text value in it, so no way to identify the
+ // remove entry.
+ // -> just remove all and add the ones that stayed around.
+ // only after checking that the object to be removed is a string, just to be sure..
+ NodeList lst = node.getChildNodes();
+ list.clear();
+ for (int i = 0; i < lst.getLength(); i++) {
+ Node nd = lst.item(i);
+ if (nd instanceof Element) {
+ list.add(getElementText((Element)nd));
+ }
+ }
+ } else if (o != null) {
+ list.remove(o);
+ }
+ // TODO: What to do here? We don't know which model
+ // child
+ // to remove. I don't think this can happen. -MDP
+ }
+ } else if (changedFeature instanceof Text
+ && elementType == null) {
+ if (notifier != node && notifier instanceof Element) {
+ Element e = (Element) notifier;
+ String name = e.getLocalName();
+ int idx = absoluteIndexOf(node, e);
+ if (idx < 0)
+ idx = 0;
+ list.remove(idx);
+ list.add(idx, getObject(e, true));
+ }
+ }
+ } finally {
+ resource.setProcessEvents(true);
+ }
+
+ }
+
+ }
+
+ public void add(Object newValue, int position) {
+ Object value = getElementValue(newValue);
+ if (value instanceof EObject) {
+ EObject eo = (EObject) value;
+ if (EcoreUtil.getAdapter(eo.eAdapters(), ModelObjectAdapter.class) == null) {
+ String tagName = getElementName(newValue);
+ Element newElement = node.getOwnerDocument().createElement(
+ tagName);
+ Node before = getNthChildWithName(node, "*", position); //$NON-NLS-1$
+ if (before != null) {
+ node.insertBefore(newElement, before);
+ } else {
+ node.appendChild(newElement);
+ }
+
+ ModelObjectAdapter newAdapter = new ModelObjectAdapter(
+ resource, eo, newElement);
+ eo.eAdapters().add(newAdapter);
+ formatNode(newElement);
+ ((IDOMNode) newElement).addAdapter(newAdapter);
+ newAdapter.save();
+
+ }
+ } else {
+ String tagName = getElementName(newValue);
+ Element newElement = node.getOwnerDocument().createElement(tagName);
+ org.w3c.dom.Text text = node.getOwnerDocument().createTextNode(
+ value.toString());
+ newElement.appendChild(text);
+ Node before = getNthChildWithName(node, "*", position); //$NON-NLS-1$
+ if (before != null) {
+ node.insertBefore(newElement, before);
+ } else {
+ node.appendChild(newElement);
+ }
+ formatNode(newElement);
+ ((IDOMNode) newElement).addAdapter(this);
+ }
+ }
+
+ public void remove(Object oldValue, int position) {
+ if (position == -1) {
+ position = 0;
+ }
+ Element n = getNthChildWithName(node, "*", position); //$NON-NLS-1$
+
+ if (n != null)
+ removeChildElement(n);
+ }
+
+ @Override
+ public void update(Object oldValue, Object newValue, int index) {
+ remove(oldValue, index);
+ add(newValue, index);
+ }
+
+ protected String getElementName(Object o) {
+ String name = node.getLocalName();
+ if (name.endsWith("ies")) //$NON-NLS-1$
+ name = name.replaceAll("ies$", "y"); //$NON-NLS-1$ //$NON-NLS-2$
+ else
+ name = name.replaceAll("s$", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ return name;
+ }
+
+ protected Object getElementValue(Object o) {
+ return o;
+ }
+
+ protected Object getObject(Element childElement, boolean createIfNeeded) {
+ if (elementType == null) {
+ ListAdapter existing = (ListAdapter) ((IDOMNode) childElement)
+ .getExistingAdapter(ListAdapter.class);
+ if (existing == null) {
+ ((IDOMNode) childElement).addAdapter(this);
+ }
+ return getElementText(childElement);
+ } else {
+ ModelObjectAdapter existing = (ModelObjectAdapter) ((IDOMNode) childElement)
+ .getExistingAdapter(ModelObjectAdapter.class);
+ if (existing == null) {
+ if (createIfNeeded) {
+ EObject eo = PomFactory.eINSTANCE.create(elementType);
+ existing = new ModelObjectAdapter(resource, eo,
+ childElement);
+ eo.eAdapters().add(existing);
+ ((IDOMNode) childElement).addAdapter(existing);
+ existing.load();
+ return eo;
+ } else {
+ return null;
+ }
+ } else {
+ return existing.getTarget();
+ }
+ }
+ }
+
+ public boolean isAdapterForType(Object type) {
+ return ListAdapter.class.equals(type);
+ }
+
+ @Override
+ public void load() {
+ NodeList children = node.getChildNodes();
+ int nChildren = children.getLength();
+ for (int i = 0; i < nChildren; i++) {
+ Node child = children.item(i);
+ if (child instanceof Element) {
+ list.add(getObject((Element) child, true));
+ }
+ }
+ }
+
+ @Override
+ public void save() {
+ for (Object o : list) {
+ add(o, -1);
+ }
+ }
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ModelObjectAdapter.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ModelObjectAdapter.java
new file mode 100644
index 00000000..eab5cb15
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ModelObjectAdapter.java
@@ -0,0 +1,326 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.translators;
+
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.m2e.model.edit.pom.Configuration;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Listens for notifications from the dom model and the E model, and syncs the
+ * models.
+ *
+ * @author Mike Poindexter
+ */
+public class ModelObjectAdapter extends TranslatorAdapter implements Adapter,
+ INodeAdapter {
+ private SSESyncResource resource;
+
+ private EObject eobject;
+
+ private Notifier target;
+
+ private Map<EStructuralFeature, TranslatorAdapter> childAdapters = new LinkedHashMap<EStructuralFeature, TranslatorAdapter>();
+
+ public ModelObjectAdapter(SSESyncResource resource, EObject eobject,
+ Element node) {
+ super(resource);
+ this.eobject = eobject;
+ this.node = node;
+ this.resource = resource;
+ }
+
+ public boolean isAdapterForType(Object type) {
+ return ModelObjectAdapter.class.equals(type);
+ }
+
+ public void notifyChanged(INodeNotifier notifier, int eventType,
+ Object changedFeature, Object oldValue, Object newValue, int pos) {
+ if (resource.isProcessEvents()) {
+ resource.setProcessEvents(false);
+ try {
+ if (INodeNotifier.ADD == eventType
+ && newValue instanceof Element) {
+ if (notifier == node) {
+ IDOMElement addedElement = (IDOMElement) newValue;
+ EStructuralFeature feature = eobject.eClass()
+ .getEStructuralFeature(
+ addedElement.getLocalName());
+ if (feature != null) {
+ createOrGetChildAdapter(feature).load();
+ }
+ }
+ } else if (INodeNotifier.REMOVE == eventType
+ && oldValue instanceof Element) {
+ if (notifier == node) {
+ IDOMElement removedElement = (IDOMElement) oldValue;
+ EStructuralFeature feature = eobject.eClass()
+ .getEStructuralFeature(
+ removedElement.getLocalName());
+ if (feature != null) {
+ eobject.eUnset(feature);
+ childAdapters.remove(feature);
+ }
+ }
+ }
+ } finally {
+ resource.setProcessEvents(true);
+ }
+ }
+ }
+
+ public void notifyChanged(Notification notification) {
+ if (resource.isProcessEvents()) {
+ resource.setProcessEvents(false);
+ try {
+ EStructuralFeature feature = (EStructuralFeature) notification
+ .getFeature();
+ switch (notification.getEventType()) {
+
+ case Notification.SET:
+ if (null == notification.getNewValue()
+ || "".equals(notification.getNewValue())) { //$NON-NLS-1$
+ removeDomChild(feature);
+ } else {
+ TranslatorAdapter setAdapter = createOrGetChildAdapter(feature);
+ setAdapter.update(notification.getOldValue(),
+ notification.getNewValue(), notification
+ .getPosition());
+ }
+
+ break;
+
+ case Notification.ADD:
+ ListAdapter addListAdapter = (ListAdapter) createOrGetChildAdapter(feature);
+ addListAdapter.add(notification.getNewValue(), notification
+ .getPosition());
+ break;
+
+ case Notification.ADD_MANY:
+ ListAdapter addManyListAdapter = (ListAdapter) createOrGetChildAdapter(feature);
+ Collection<?> addMany = (Collection<?>) notification
+ .getNewValue();
+ int addPosition = notification.getPosition();
+ int addIdx = addPosition;
+ for (Object object : addMany) {
+ addManyListAdapter
+ .add(
+ object,
+ addPosition == Notification.NO_INDEX ? Notification.NO_INDEX
+ : addIdx);
+ addIdx++;
+ }
+ break;
+
+ case Notification.REMOVE:
+ ListAdapter removeListAdapter = (ListAdapter) createOrGetChildAdapter(feature);
+ removeListAdapter.remove(notification.getOldValue(),
+ notification.getPosition());
+ break;
+
+ case Notification.UNSET:
+ removeDomChild(feature);
+ break;
+
+ case Notification.REMOVE_MANY:
+ ListAdapter removeManyListAdapter = (ListAdapter) createOrGetChildAdapter(feature);
+ Collection<?> removeMany = (Collection<?>) notification
+ .getOldValue();
+ int removePosition = notification.getPosition();
+ int removeIdx = removePosition;
+ for (Object object : removeMany) {
+ removeManyListAdapter
+ .remove(
+ object,
+ removePosition == Notification.NO_INDEX ? Notification.NO_INDEX
+ : removeIdx);
+ removeIdx++;
+ }
+ break;
+
+ }
+ } finally {
+ resource.setProcessEvents(true);
+ }
+ }
+
+ }
+
+ @Override
+ public void update(Object oldValue, Object newValObject, int index) {
+ save();
+ }
+
+ private TranslatorAdapter createOrGetChildAdapter(EStructuralFeature feature) {
+ TranslatorAdapter ret = childAdapters.get(feature);
+ if (null == ret) {
+ Element element = getFirstChildWithName(node, feature.getName());
+ boolean isNew = false;
+ if (element == null) {
+ element = node.getOwnerDocument().createElement(feature.getName());
+ insertElement(element);
+ isNew = true;
+ }
+
+ if (feature.isMany()) {
+ EClass elementType = null;
+ if (feature instanceof EReference) {
+ elementType = ((EReference) feature).getEReferenceType();
+ }
+
+ if (elementType != null && elementType.getClassifierID() == PomPackage.Literals.PROPERTY_ELEMENT.getClassifierID()) {
+ ret = new PropertiesAdapter(resource, element, (List<PropertyElement>) eobject.eGet(feature));
+ } else {
+ ret = new ListAdapter(resource, element, (List<?>) eobject.eGet(feature), elementType);
+ }
+ } else if (feature instanceof EReference) {
+ EReference ref = (EReference) feature;
+ EObject eo = (EObject) eobject.eGet(feature);
+ if (null == eo) {
+ eo = PomFactory.eINSTANCE.create(ref.getEReferenceType());
+ eobject.eSet(ref, eo);
+ }
+
+ EClass elementType = ref.getEReferenceType();
+ if (elementType != null && elementType.getClassifierID() == PomPackage.Literals.CONFIGURATION.getClassifierID()) {
+ ret = new ConfigurationAdapter(resource, element, (Configuration)eobject.eGet(feature));
+ } else {
+ ret = new ModelObjectAdapter(this.resource, eo, element);
+ ((ModelObjectAdapter) ret).eobject.eAdapters().add((ModelObjectAdapter) ret);
+ }
+ } else {
+ ret = new ValueUpdateAdapter(resource, element, eobject, feature);
+ }
+ if (isNew) {
+ formatNode(element);
+ }
+ ((IDOMElement) element).addAdapter(ret);
+ childAdapters.put(feature, ret);
+ }
+ return ret;
+ }
+
+ /**
+ * Removes the dom child matching the feature.
+ *
+ * @param feature
+ */
+ private void removeDomChild(EStructuralFeature feature) {
+ TranslatorAdapter ta = childAdapters.get(feature);
+ if (ta != null && ta.getNode() != null) {
+ removeChildElement(ta.getNode());
+ }
+ childAdapters.remove(feature);
+ }
+
+ /**
+ * Inserts an element under the current node, attempting to preserve proper
+ * node ordering.
+ *
+ * @param element
+ * @param position
+ */
+ private void insertElement(Element element) {
+ Node beforeNode = null;
+ boolean searching = false;
+ for (EStructuralFeature feature : eobject.eClass()
+ .getEStructuralFeatures()) {
+ if (element.getLocalName().equals(feature.getName())) {
+ searching = true;
+ }
+ if (searching) {
+ beforeNode = getFirstChildWithName(node, feature.getName());
+ if (beforeNode != null) {
+ break;
+ }
+ }
+ }
+
+ if (beforeNode == null) {
+ beforeNode = node.getLastChild();
+ while (!(beforeNode == null
+ || beforeNode.getPreviousSibling() instanceof Element || beforeNode
+ .getPreviousSibling() == null)) {
+ beforeNode = beforeNode.getPreviousSibling();
+ }
+ }
+
+ if (beforeNode == null) {
+ node.appendChild(element);
+ } else {
+ node.insertBefore(element, beforeNode);
+ }
+ }
+
+ /**
+ * Populates all child model objects from the child nodes in the dom tree.
+ */
+ public void load() {
+ NodeList children = node.getChildNodes();
+ int nChildren = children.getLength();
+ for (int i = 0; i < nChildren; i++) {
+ Node child = children.item(i);
+ if (child instanceof Element) {
+ Element element = (Element) child;
+ EStructuralFeature feature = eobject.eClass()
+ .getEStructuralFeature(element.getLocalName());
+ if (feature != null) {
+ createOrGetChildAdapter(feature).load();
+ }
+ }
+
+ }
+ }
+
+ /**
+ * Populates all child dom objects from the model children.
+ */
+ public void save() {
+ for (EStructuralFeature feature : eobject.eClass()
+ .getEStructuralFeatures()) {
+ if (eobject.eIsSet(feature)) {
+ Object o = eobject.eGet(feature);
+ if (!"".equals(o) && o != null) { //$NON-NLS-1$
+ createOrGetChildAdapter(feature).save();
+ }
+ }
+ }
+ }
+
+ public Notifier getTarget() {
+ return target;
+ }
+
+ public void setTarget(Notifier target) {
+ this.target = target;
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/PropertiesAdapter.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/PropertiesAdapter.java
new file mode 100644
index 00000000..85fbbfc3
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/PropertiesAdapter.java
@@ -0,0 +1,235 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.translators;
+
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+/**
+ * Translates a property list using the name and value instead of reflection.
+ *
+ * @author Mike Poindexter
+ *
+ */
+public class PropertiesAdapter extends ListAdapter {
+ protected List<PropertyElement> properties;
+
+ public PropertiesAdapter(SSESyncResource resc, Element containerNode,
+ List<PropertyElement> properties) {
+ super(resc, containerNode, properties, null);
+ this.node = containerNode;
+ this.properties = properties;
+ }
+
+ @Override
+ public void notifyChanged(INodeNotifier notifier, int eventType,
+ Object changedFeature, Object oldValue, Object newValue, int pos) {
+ if (resource.isProcessEvents()) {
+ try {
+ resource.setProcessEvents(false);
+ if (INodeNotifier.ADD == eventType
+ && newValue instanceof Element) {
+ if (notifier == node) {
+ IDOMElement addedElement = (IDOMElement) newValue;
+ int idx = absoluteIndexOf(node, addedElement);
+ if (idx == -1)
+ idx = 0;
+ properties.add(idx, createObject(addedElement));
+ }
+ } else if (INodeNotifier.REMOVE == eventType
+ && oldValue instanceof Element) {
+ if (notifier == node) {
+ for (PropertyElement prop : properties) {
+ PropertyChildAdapter adapter = (PropertyChildAdapter) EcoreUtil
+ .getExistingAdapter(prop,
+ PropertyChildAdapter.class);
+ if (adapter.getElement().equals(oldValue)) {
+ properties.remove(prop);
+ break;
+ }
+ }
+ }
+ } else if (changedFeature instanceof Text) {
+ if (notifier != node && notifier instanceof Element) {
+ Element e = (Element) notifier;
+ String name = e.getLocalName();
+ for (PropertyElement prop : properties) {
+ if (name.equals(prop.getName())) {
+ prop.setValue(getElementText(e));
+ }
+ }
+ }
+ }
+ } finally {
+ resource.setProcessEvents(true);
+ }
+
+ }
+
+ }
+
+ public void add(Object newValue, int position) {
+ final PropertyElement prop = (PropertyElement) newValue;
+ Element newElement = node.getOwnerDocument().createElement(
+ prop.getName());
+ Text value = node.getOwnerDocument().createTextNode(prop.getValue());
+ newElement.appendChild(value);
+
+ if (position < 0)
+ position = 0;
+ Node n = getNthChildWithName(node, "*", position); //$NON-NLS-1$
+ if (n != null) {
+ node.insertBefore(newElement, n);
+ } else {
+ node.appendChild(newElement);
+ }
+ formatNode(newElement);
+ if (null == EcoreUtil.getExistingAdapter(prop,
+ PropertyChildAdapter.class)) {
+ prop.eAdapters().add(new PropertyChildAdapter(prop, newElement));
+ }
+ ((IDOMNode) newElement).addAdapter(this);
+ }
+
+ public void remove(Object oldValue, int position) {
+ if (position == -1)
+ position = 0;
+
+ Element n = getNthChildWithName(node, "*", position); //$NON-NLS-1$
+ if (n != null)
+ removeChildElement(n);
+ }
+
+ public PropertyElement createObject(Element child) {
+ PropertyElement propertyElement = PomFactory.eINSTANCE
+ .createPropertyElement();
+ propertyElement.setName(child.getLocalName());
+ propertyElement.setValue(getElementText(child));
+ if (null == ((IDOMNode) child)
+ .getExistingAdapter(PropertiesAdapter.class)) {
+ ((IDOMNode) child).addAdapter(this);
+ }
+ propertyElement.eAdapters().add(
+ new PropertyChildAdapter(propertyElement, child));
+ return propertyElement;
+ }
+
+ @Override
+ public boolean isAdapterForType(Object type) {
+ return PropertiesAdapter.class.equals(type);
+ }
+
+ @Override
+ public void load() {
+ NodeList children = node.getChildNodes();
+ int nChildren = children.getLength();
+ for (int i = 0; i < nChildren; i++) {
+ Node child = children.item(i);
+ if (child instanceof Element) {
+ properties.add(createObject((Element) child));
+ }
+
+ }
+
+ }
+
+ @Override
+ public void save() {
+ for (PropertyElement o : properties) {
+ add(o, -1);
+ }
+ }
+
+ private class PropertyChildAdapter implements Adapter {
+ private Notifier target;
+ private PropertyElement property;
+ private Element element;
+
+ /**
+ * @param propertyElement
+ * @param container
+ */
+ public PropertyChildAdapter(PropertyElement propertyElement,
+ Element element) {
+ super();
+ this.property = propertyElement;
+ this.element = element;
+ }
+
+ public boolean isAdapterForType(Object type) {
+ return PropertyChildAdapter.class.equals(type);
+ }
+
+ public void notifyChanged(Notification notification) {
+ if (resource.isProcessEvents()) {
+ try {
+ resource.setProcessEvents(false);
+ Element newElement = node.getOwnerDocument().createElement(
+ property.getName());
+ Text value = node.getOwnerDocument().createTextNode(
+ property.getValue());
+ newElement.appendChild(value);
+ node.replaceChild(newElement, element);
+ formatNode(newElement);
+ this.element = newElement;
+ ((IDOMNode) newElement).addAdapter(PropertiesAdapter.this);
+ } finally {
+ resource.setProcessEvents(true);
+ }
+ }
+ }
+
+ /**
+ * @return the target
+ */
+ public Notifier getTarget() {
+ return target;
+ }
+
+ /**
+ * @param target
+ * the target to set
+ */
+ public void setTarget(Notifier target) {
+ this.target = target;
+ }
+
+ /**
+ * @return the property
+ */
+ public PropertyElement getProperty() {
+ return property;
+ }
+
+ /**
+ * @return the element
+ */
+ public Element getElement() {
+ return element;
+ }
+
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/SSESyncResource.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/SSESyncResource.java
new file mode 100644
index 00000000..999bcadc
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/SSESyncResource.java
@@ -0,0 +1,284 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.translators;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.PomFactory;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class SSESyncResource extends ResourceImpl {
+ private static final Set<String> NO_EVENT_MODELS = new HashSet<String>();
+
+ private IDOMModel domModel;
+
+ private Model pomModel;
+
+ private Document doc;
+
+ public SSESyncResource() {
+ super();
+ }
+
+ public SSESyncResource(URI uri) {
+ super(uri);
+ }
+
+ @Override
+ public void load(Map<?, ?> options) throws IOException {
+ if (isLoaded()) {
+ return;
+ }
+ loadDOMModel();
+ setProcessEvents(false);
+ try {
+ pomModel = PomFactory.eINSTANCE.createModel();
+ doc = domModel.getDocument();
+ DocumentAdapter da = new DocumentAdapter();
+ if (doc.getDocumentElement() != null) {
+ createAdapterForRootNode(
+ domModel.getDocument().getDocumentElement()).load();
+ } else {
+ pomModel.eAdapters().add(da);
+ }
+ ((IDOMNode) doc).addAdapter(da);
+ this.getContents().add(pomModel);
+ this.setLoaded(true);
+ } finally {
+ setProcessEvents(true);
+ }
+
+ }
+
+ @Override
+ protected void doSave(OutputStream outputStream, Map<?, ?> options)
+ throws IOException {
+ try {
+ domModel.save(outputStream);
+ } catch (CoreException e) {
+ IOException ioe = new IOException(e.getMessage());
+ ioe.initCause(e);
+ throw ioe;
+ }
+ }
+
+ @Override
+ protected void doUnload() {
+ domModel.releaseFromEdit();
+ }
+
+ private void loadDOMModel() throws IOException {
+ IFile ifile = null;
+ if (uri.isPlatformResource()) {
+ String localPath = uri.toPlatformString(true);
+ ifile = (IFile) ResourcesPlugin.getWorkspace().getRoot().findMember(localPath);
+ } else if (uri.isFile()) {
+ String filePath = uri.toFileString();
+ File f = new File(filePath);
+ IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(f.getAbsoluteFile().toURI());
+ if (files.length > 0) {
+ ifile = files[0];
+ }
+ }
+
+ try {
+ IModelManager modelManager = StructuredModelManager.getModelManager();
+ if (ifile != null && ifile.exists()) {
+ domModel = (IDOMModel) modelManager.getExistingModelForEdit(ifile);
+ }
+ if (null == domModel) {
+ if (ifile != null && ifile.exists()) {
+ domModel = (IDOMModel) modelManager.getModelForEdit(ifile);
+ } else if (uri.isFile()) {
+ File f = new File(uri.toFileString());
+ FileInputStream is = new FileInputStream(f);
+ try {
+ domModel = (IDOMModel) modelManager.getModelForEdit(f.getAbsolutePath(), is, null);
+ } finally {
+ is.close();
+ }
+ }
+ // Had to comment this out, ExtensibleURIConverterImpl isn't available in Eclipse 3.3
+// else {
+// ExtensibleURIConverterImpl converter = new ExtensibleURIConverterImpl();
+// InputStream is = converter.createInputStream(uri);
+// domModel = (IDOMModel) modelManager.getModelForEdit(uri.toString(), is, null);
+// is.close();
+// }
+ }
+ } catch (CoreException e) {
+ // IOException can't wrap another exception before Java 6
+ if (e.getCause() != null && e.getCause() instanceof IOException) {
+ throw (IOException) e.getCause();
+ } else {
+ throw new IOException(e.getMessage());
+ }
+ }
+ }
+
+ private ModelObjectAdapter createAdapterForRootNode(Element root) {
+ ModelObjectAdapter adapter = new ModelObjectAdapter(this, pomModel,
+ root);
+ ((IDOMElement) root).addAdapter(adapter);
+ pomModel.eAdapters().add(adapter);
+ return adapter;
+ }
+
+ boolean isProcessEvents() {
+ return !NO_EVENT_MODELS.contains(domModel.getId());
+ }
+
+ void setProcessEvents(boolean processEvents) {
+ if(processEvents) {
+ NO_EVENT_MODELS.remove(domModel.getId());
+ } else {
+ NO_EVENT_MODELS.add(domModel.getId());
+ }
+ }
+
+ private class DocumentAdapter implements INodeAdapter, Adapter {
+ private Notifier target;
+
+ public boolean isAdapterForType(Object type) {
+ return getClass().equals(type);
+ }
+
+ public void notifyChanged(Notification notification) {
+ if (isProcessEvents()) {
+ setProcessEvents(false);
+ try {
+ int type = notification.getEventType();
+ if (Notification.ADD == type
+ || Notification.ADD_MANY == type
+ || Notification.SET == type) {
+ if (null == doc.getDocumentElement()) {
+ Element newRoot = doc.createElementNS(
+ "http://maven.apache.org/POM/4.0.0", //$NON-NLS-1$
+ "project"); //$NON-NLS-1$
+ newRoot
+ .setAttributeNS(
+ "http://www.w3.org/2001/XMLSchema-instance", //$NON-NLS-1$
+ "xsi:schemaLocation", //$NON-NLS-1$
+ "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"); //$NON-NLS-1$
+
+ // I think this is just wrong...but can't find a
+ // better way.
+ newRoot.setAttribute("xmlns", //$NON-NLS-1$
+ "http://maven.apache.org/POM/4.0.0"); //$NON-NLS-1$
+ newRoot
+ .setAttribute("xmlns:xsi", //$NON-NLS-1$
+ "http://www.w3.org/2001/XMLSchema-instance"); //$NON-NLS-1$
+ doc.appendChild(newRoot);
+ pomModel.setModelVersion("4.0.0"); //$NON-NLS-1$
+ createAdapterForRootNode(newRoot).save();
+ } else {
+ Element root = doc.getDocumentElement();
+ createAdapterForRootNode(root).load();
+ }
+ DocumentAdapter existingDocAdapter = (DocumentAdapter) EcoreUtil
+ .getExistingAdapter(pomModel,
+ DocumentAdapter.class);
+ if (null != existingDocAdapter) {
+ pomModel.eAdapters().remove(existingDocAdapter);
+ }
+ }
+ } finally {
+ setProcessEvents(true);
+ }
+ }
+
+ }
+
+ public void notifyChanged(INodeNotifier notifier, int eventType,
+ Object changedFeature, Object oldValue, Object newValue, int pos) {
+ if (isProcessEvents()) {
+ setProcessEvents(false);
+ try {
+ if (INodeNotifier.ADD == eventType) {
+ if (newValue instanceof Element) {
+ Element e = (Element) newValue;
+ if (doc.getDocumentElement().equals(e)) {
+ DocumentAdapter existingDocAdapter = (DocumentAdapter) EcoreUtil
+ .getExistingAdapter(pomModel,
+ DocumentAdapter.class);
+ if (null != existingDocAdapter) {
+ pomModel.eAdapters().remove(
+ existingDocAdapter);
+ }
+ createAdapterForRootNode(e).load();
+ }
+ }
+ } else if (INodeNotifier.REMOVE == eventType) {
+ if (changedFeature instanceof Element) {
+ ModelObjectAdapter existing = (ModelObjectAdapter) EcoreUtil
+ .getExistingAdapter(pomModel,
+ ModelObjectAdapter.class);
+ if (existing != null) {
+ pomModel.eAdapters().remove(existing);
+ }
+
+ if (null == doc.getDocumentElement()) {
+ for (EStructuralFeature feature : pomModel
+ .eClass().getEStructuralFeatures()) {
+ pomModel.eUnset(feature);
+ }
+ }
+
+ DocumentAdapter existingDocAdapter = (DocumentAdapter) EcoreUtil
+ .getExistingAdapter(pomModel,
+ DocumentAdapter.class);
+ if (null == existingDocAdapter) {
+ pomModel.eAdapters().add(this);
+ }
+
+ }
+ }
+ } finally {
+ setProcessEvents(true);
+ }
+ }
+ }
+
+ public Notifier getTarget() {
+ return target;
+ }
+
+ public void setTarget(Notifier newTarget) {
+ this.target = newTarget;
+ }
+ }
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/TranslatorAdapter.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/TranslatorAdapter.java
new file mode 100644
index 00000000..c7250fdb
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/TranslatorAdapter.java
@@ -0,0 +1,371 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.translators;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+import com.ibm.icu.lang.UCharacter;
+
+
+/**
+ * A base class for all adapters that can translate a EMF to DOM and vice-versa.
+ *
+ * Each translator adaptor is expected to have a single root element that
+ * controls its existence. It is responsible for the subtree of that node by
+ * updating it directly or delegating to child adapters to do the work.
+ *
+ *
+ * @author Mike Poindexter
+ */
+public abstract class TranslatorAdapter implements INodeAdapter {
+ protected SSESyncResource resource;
+
+ protected Element node;
+
+ public TranslatorAdapter(SSESyncResource resource) {
+ this.resource = resource;
+ }
+
+ /**
+ * Returns the textual value of an element.
+ *
+ * @param e
+ * @return
+ */
+ protected static String getElementText(Element e) {
+ StringBuilder ret = new StringBuilder();
+ NodeList children = e.getChildNodes();
+ int nChildren = children.getLength();
+ for (int i = 0; i < nChildren; i++) {
+ Node child = children.item(i);
+ if (child instanceof Text) {
+ ret.append(((Text) child).getData());
+ }
+ }
+ return ret.toString().trim();
+ }
+
+ /**
+ * Load the model value from this adapter's xml value
+ */
+ public abstract void load();
+
+ /**
+ * Save the xml value of this adapter from the model.
+ */
+ public abstract void save();
+
+ /**
+ * @param oldValue
+ */
+ public abstract void update(Object oldValue, Object newValue, int index);
+
+ /**
+ * Returns the index of the given element in the list of elements of the
+ * same name.
+ *
+ * @param e
+ * @return
+ */
+ protected int namedIndexOf(Element parentNode, Element element) {
+ int ret = 0;
+ NodeList children = parentNode.getChildNodes();
+ int nChildren = children.getLength();
+ for (int i = 0; i < nChildren; i++) {
+ Node child = children.item(i);
+ if (child instanceof Element) {
+ Element e = (Element) child;
+ if (e.getLocalName().equals(element.getLocalName())) {
+ if (e == element) {
+ return ret;
+ } else {
+ ret++;
+ }
+ }
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Returns the index of the given element in the list of child elements.
+ *
+ * @param e
+ * @return
+ */
+ protected int absoluteIndexOf(Element parentNode, Element element) {
+ int ret = 0;
+ NodeList children = parentNode.getChildNodes();
+ int nChildren = children.getLength();
+ for (int i = 0; i < nChildren; i++) {
+ Node child = children.item(i);
+ if (child instanceof Element) {
+ Element e = (Element) child;
+ if (e.getLocalName().equals(element.getLocalName())) {
+ if (e == element) {
+ return ret;
+ } else {
+ ret++;
+ }
+ }
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Returns the first child with the given name, or null if none exists.
+ *
+ * @param name
+ * @return
+ */
+ protected Element getFirstChildWithName(Element parent, String name) {
+ return getNthChildWithName(parent, name, 0);
+ }
+
+ /**
+ * Returns the nth child element with a given name, or null if no such
+ * element exists.
+ *
+ * @param name
+ * @param n
+ * @return
+ */
+ protected Element getNthChildWithName(Element parent, String name, int n) {
+ int matchCount = 0;
+ NodeList children = parent.getChildNodes();
+ int nChildren = children.getLength();
+ for (int i = 0; i < nChildren; i++) {
+ Node child = children.item(i);
+ if (child instanceof Element) {
+ Element e = (Element) child;
+ if (e.getTagName().equals(name) || "*".equals(name)) { //$NON-NLS-1$
+ if (matchCount == n) {
+ return e;
+ } else {
+ matchCount++;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public Element getNode() {
+ return node;
+ }
+
+ public void setNode(Element node) {
+ this.node = node;
+ }
+
+ protected void formatNode(Element element) {
+ createWSBefore(element);
+ createWSAfter(element);
+ }
+
+ /**
+ * Ensure at least one NL between this node and the previous, and proper
+ * start tag indentation.
+ *
+ * @param element
+ * @return
+ */
+ protected void createWSBefore(Element element) {
+ try {
+ IStructuredDocument doc = ((IDOMNode) element)
+ .getStructuredDocument();
+ int nodeStartOff = ((IDOMNode) element).getStartOffset();
+ StringBuilder betweenText = new StringBuilder();
+ int i = nodeStartOff - 1;
+ while (i > -1) {
+ char next = doc.getChar(i);
+ if (next == '>') {
+ break;
+ }
+ betweenText.insert(0, next);
+ i--;
+ }
+ int origLen = betweenText.length();
+ int nlIndex = betweenText.lastIndexOf("\n"); //$NON-NLS-1$
+ if (nlIndex == -1) {
+ String nl = getNewlineString();
+ betweenText.insert(0, nl);
+ nlIndex = nl.length() - 1;
+ }
+
+ String indent = getIndentForNode(element);
+ if (!indent.equals(betweenText.substring(nlIndex + 1))) {
+ betweenText.replace(nlIndex + 1, betweenText.length(), indent);
+ }
+ if (origLen > 0) {
+ doc.replaceText(this, i + 1, origLen, betweenText.toString());
+ } else {
+ Text t = element.getOwnerDocument().createTextNode(
+ betweenText.toString());
+ element.getParentNode().insertBefore(t, element);
+ }
+ } catch (BadLocationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * Ensure at least one NL between this node and the next, and proper indent
+ * to the next tag tag indentation.
+ *
+ * @param element
+ * @return
+ */
+ protected void createWSAfter(Element element) {
+ try {
+ IStructuredDocument doc = ((IDOMNode) element)
+ .getStructuredDocument();
+ int nodeEndOff = ((IDOMNode) element).getEndOffset();
+ StringBuilder betweenText = new StringBuilder();
+ int i = nodeEndOff;
+ while (i < doc.getLength()) {
+ char next = doc.getChar(i);
+ if (next == '<') {
+ break;
+ }
+ betweenText.append(next);
+ i++;
+ }
+ int origLen = betweenText.length();
+ int nlIndex = betweenText.lastIndexOf("\n"); //$NON-NLS-1$
+ if (nlIndex == -1) {
+ String nl = getNewlineString();
+ betweenText.insert(0, nl);
+ nlIndex = nl.length() - 1;
+ }
+
+ Node refNode = element.getNextSibling();
+ while (refNode != null && !(refNode instanceof Element)) {
+ refNode = refNode.getNextSibling();
+ }
+ String indent = ""; //$NON-NLS-1$
+ if (refNode == null) {
+ indent = getIndentBeforeStartTag(element.getParentNode());
+ } else {
+ indent = getIndentForNode((Element) refNode);
+ }
+ if (!indent.equals(betweenText.substring(nlIndex + 1))) {
+ betweenText.replace(nlIndex + 1, betweenText.length(), indent);
+ }
+ if (origLen > 0) {
+ doc.replaceText(this, nodeEndOff, origLen, betweenText
+ .toString());
+ } else {
+ Text t = element.getOwnerDocument().createTextNode(
+ betweenText.toString());
+
+ if (null == refNode) {
+ element.getParentNode().appendChild(t);
+ } else {
+ element.getParentNode().insertBefore(t, refNode);
+ }
+ }
+ } catch (BadLocationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+ protected void removeChildElement(Element e) {
+ IStructuredDocument doc = ((IDOMNode) e).getStructuredDocument();
+ int nodeStartOff = ((IDOMNode) e).getStartOffset();
+ int nodeEndOff = ((IDOMNode) e).getEndOffset();
+ int i = nodeStartOff - 1;
+
+ while (i > 0) {
+ char c = ' ';
+ try {
+ c = doc.getChar(i);
+ } catch (BadLocationException ble) {
+ // We check for bad locations so this should not happen
+ }
+ if(UCharacter.isWhitespace(c)) {
+ i--;
+ }
+
+ if (c == '\n') {
+ if (i > 0) {
+ try {
+ c = doc.getChar(i);
+ } catch (BadLocationException ble) {
+ // We check for bad locations so this should not happen
+ }
+ if (c == '\r')
+ i--;
+ }
+ break;
+ }
+
+ }
+ doc.replaceText(this, i + 1, nodeEndOff - i - 1, null);
+ }
+
+ private String getIndentForNode(Element node) {
+ String ret = null;
+ Node prev = node.getPreviousSibling();
+ while (prev != null) {
+ if (prev instanceof Element) {
+ ret = getIndentBeforeStartTag(prev);
+ break;
+ }
+ prev = prev.getPreviousSibling();
+ }
+
+ if (null == ret) {
+ ret = getIndentBeforeStartTag(node.getParentNode()) + "\t"; //$NON-NLS-1$
+ }
+ return ret;
+ }
+
+ private String getIndentBeforeStartTag(Node node) {
+ StringBuilder builder = new StringBuilder(100);
+ IStructuredDocument doc = ((IDOMNode) node).getStructuredDocument();
+ int nodeStartOff = ((IDOMNode) node).getStartOffset();
+ int i = nodeStartOff - 1;
+ while (i > 0) {
+ char c = ' ';
+ try {
+ c = doc.getChar(i);
+ } catch (BadLocationException e) {
+ // We check for bad locations so this should not happen
+ }
+ if(UCharacter.isWhitespace(c) && !(c == '\r' || c == '\n')) {
+ builder.insert(0, c);
+ i--;
+ } else {
+ break;
+ }
+ }
+ return builder.toString();
+ }
+
+ private String getNewlineString() {
+ return ((IDOMNode) node).getStructuredDocument().getLineDelimiter();
+ }
+
+}
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ValueUpdateAdapter.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ValueUpdateAdapter.java
new file mode 100644
index 00000000..0449a812
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/translators/ValueUpdateAdapter.java
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.translators;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.wst.common.internal.emf.utilities.ExtendedEcoreUtil;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+/**
+ * Handles notifications from the DOM that a simple text value has changed.
+ *
+ * @author Mike Poindexter
+ */
+class ValueUpdateAdapter extends TranslatorAdapter implements INodeAdapter {
+ /**
+ *
+ */
+ private EObject modelObject;
+
+ private EStructuralFeature feature;
+
+ private List<Node> linkedWhitespaceNodes = Collections.emptyList();
+
+ public ValueUpdateAdapter(SSESyncResource resource, Element node,
+ EObject object, EStructuralFeature feature) {
+ super(resource);
+ this.node = node;
+ this.modelObject = object;
+ this.feature = feature;
+ }
+
+ public boolean isAdapterForType(Object type) {
+ return ValueUpdateAdapter.class.equals(type);
+ }
+
+ public void notifyChanged(INodeNotifier notifier, int eventType,
+ Object changedFeature, Object oldValue, Object newValue, int pos) {
+ if (resource.isProcessEvents()) {
+ try {
+ resource.setProcessEvents(false);
+ if (newValue instanceof Text) {
+ changedFeature = newValue;
+ newValue = ((Text) newValue).getData();
+ }
+ if (changedFeature instanceof Text) {
+ if (null == newValue) {
+ ExtendedEcoreUtil.eUnsetOrRemove(modelObject, feature,
+ oldValue);
+ } else {
+ ExtendedEcoreUtil.eSetOrAdd(modelObject, feature,
+ newValue.toString().trim());
+ }
+ }
+ } finally {
+ resource.setProcessEvents(true);
+ }
+
+ }
+
+ }
+
+ @Override
+ public void load() {
+ Object value = getElementText(node);
+ if (feature instanceof EAttribute) {
+ EAttribute ea = (EAttribute) feature;
+ value = EcoreUtil.createFromString(ea.getEAttributeType(), value
+ .toString());
+ }
+
+ modelObject.eSet(feature, value);
+ }
+
+ @Override
+ public void save() {
+ setElementTextValue(node, null, modelObject.eGet(feature));
+ }
+
+ @Override
+ public void update(Object oldValue, Object newValue, int index) {
+ setElementTextValue(node, oldValue, modelObject.eGet(feature));
+ }
+
+ /**
+ * Sets the text value of an existing node, attempting to preserve
+ * whitespace
+ *
+ * @param element
+ * @param oldValue
+ * @param newValue
+ */
+ private void setElementTextValue(Element element, Object oldValue,
+ Object newValue) {
+ newValue = newValue == null ? "" : newValue.toString(); //$NON-NLS-1$
+ boolean replacedChild = false;
+
+ if (oldValue != null) {
+ // First try to find a text node with the old value and set it (to
+ // preserve whitespace)
+ NodeList children = element.getChildNodes();
+ int nChildren = children.getLength();
+ for (int i = 0; i < nChildren; i++) {
+ Node child = children.item(i);
+ if (child instanceof Text) {
+ String value = ((Text) child).getData();
+ int oldIdx = value.indexOf(oldValue.toString());
+ if (oldIdx > -1) {
+ String replacement = value.substring(0, oldIdx)
+ + newValue.toString()
+ + value.substring(oldIdx
+ + oldValue.toString().length());
+ ((Text) child).setData(replacement);
+ replacedChild = true;
+ }
+ }
+ }
+ }
+
+ // If for some reason we couldn't find a text to update, just clear the
+ // element contents and put in our text.
+ if (!replacedChild) {
+ while (element.getFirstChild() != null) {
+ element.removeChild(element.getFirstChild());
+ }
+ Text text = node.getOwnerDocument().createTextNode(
+ newValue.toString());
+ element.appendChild(text);
+ }
+ }
+
+ public List<Node> getLinkedWhitespaceNodes() {
+ return linkedWhitespaceNodes;
+ }
+
+ public void setLinkedWhitespaceNodes(List<Node> linkedWhitespaceNodes) {
+ this.linkedWhitespaceNodes = linkedWhitespaceNodes;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomAdapterFactory.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomAdapterFactory.java
new file mode 100644
index 00000000..8717ecb2
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomAdapterFactory.java
@@ -0,0 +1,904 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: PomAdapterFactory.java 20588 2008-12-04 17:59:55Z jerdfelt $
+ */
+package org.eclipse.m2e.model.edit.pom.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.m2e.model.edit.pom.*;
+
+/**
+ * <!-- begin-user-doc --> The <b>Adapter Factory</b> for the model. It provides
+ * an adapter <code>createXXX</code> method for each class of the model. <!--
+ * end-user-doc -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage
+ * @generated
+ */
+public class PomAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected static PomPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public PomAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = PomPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc --> This implementation returns <code>true</code> if
+ * the object is either the model's package or is an instance object of the
+ * model. <!-- end-user-doc -->
+ *
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject) object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PomSwitch<Adapter> modelSwitch = new PomSwitch<Adapter>() {
+ @Override
+ public Adapter caseActivation(Activation object) {
+ return createActivationAdapter();
+ }
+
+ @Override
+ public Adapter caseActivationFile(ActivationFile object) {
+ return createActivationFileAdapter();
+ }
+
+ @Override
+ public Adapter caseActivationOS(ActivationOS object) {
+ return createActivationOSAdapter();
+ }
+
+ @Override
+ public Adapter caseActivationProperty(ActivationProperty object) {
+ return createActivationPropertyAdapter();
+ }
+
+ @Override
+ public Adapter caseBuild(Build object) {
+ return createBuildAdapter();
+ }
+
+ @Override
+ public Adapter caseBuildBase(BuildBase object) {
+ return createBuildBaseAdapter();
+ }
+
+ @Override
+ public Adapter caseCiManagement(CiManagement object) {
+ return createCiManagementAdapter();
+ }
+
+ @Override
+ public Adapter caseContributor(Contributor object) {
+ return createContributorAdapter();
+ }
+
+ @Override
+ public Adapter caseDependency(Dependency object) {
+ return createDependencyAdapter();
+ }
+
+ @Override
+ public Adapter caseDependencyManagement(DependencyManagement object) {
+ return createDependencyManagementAdapter();
+ }
+
+ @Override
+ public Adapter caseDeploymentRepository(DeploymentRepository object) {
+ return createDeploymentRepositoryAdapter();
+ }
+
+ @Override
+ public Adapter caseDeveloper(Developer object) {
+ return createDeveloperAdapter();
+ }
+
+ @Override
+ public Adapter caseDistributionManagement(DistributionManagement object) {
+ return createDistributionManagementAdapter();
+ }
+
+ @Override
+ public Adapter caseDocumentRoot(DocumentRoot object) {
+ return createDocumentRootAdapter();
+ }
+
+ @Override
+ public Adapter caseExclusion(Exclusion object) {
+ return createExclusionAdapter();
+ }
+
+ @Override
+ public Adapter caseExtension(Extension object) {
+ return createExtensionAdapter();
+ }
+
+ @Override
+ public Adapter caseIssueManagement(IssueManagement object) {
+ return createIssueManagementAdapter();
+ }
+
+ @Override
+ public Adapter caseLicense(License object) {
+ return createLicenseAdapter();
+ }
+
+ @Override
+ public Adapter caseMailingList(MailingList object) {
+ return createMailingListAdapter();
+ }
+
+ @Override
+ public Adapter caseModel(Model object) {
+ return createModelAdapter();
+ }
+
+ @Override
+ public Adapter caseNotifier(org.eclipse.m2e.model.edit.pom.Notifier object) {
+ return createNotifierAdapter();
+ }
+
+ @Override
+ public Adapter caseOrganization(Organization object) {
+ return createOrganizationAdapter();
+ }
+
+ @Override
+ public Adapter caseParent(Parent object) {
+ return createParentAdapter();
+ }
+
+ @Override
+ public Adapter casePlugin(Plugin object) {
+ return createPluginAdapter();
+ }
+
+ @Override
+ public Adapter casePluginExecution(PluginExecution object) {
+ return createPluginExecutionAdapter();
+ }
+
+ @Override
+ public Adapter casePluginManagement(PluginManagement object) {
+ return createPluginManagementAdapter();
+ }
+
+ @Override
+ public Adapter casePrerequisites(Prerequisites object) {
+ return createPrerequisitesAdapter();
+ }
+
+ @Override
+ public Adapter caseProfile(Profile object) {
+ return createProfileAdapter();
+ }
+
+ @Override
+ public Adapter caseRelocation(Relocation object) {
+ return createRelocationAdapter();
+ }
+
+ @Override
+ public Adapter caseReporting(Reporting object) {
+ return createReportingAdapter();
+ }
+
+ @Override
+ public Adapter caseReportPlugin(ReportPlugin object) {
+ return createReportPluginAdapter();
+ }
+
+ @Override
+ public Adapter caseReportSet(ReportSet object) {
+ return createReportSetAdapter();
+ }
+
+ @Override
+ public Adapter caseRepository(Repository object) {
+ return createRepositoryAdapter();
+ }
+
+ @Override
+ public Adapter caseRepositoryPolicy(RepositoryPolicy object) {
+ return createRepositoryPolicyAdapter();
+ }
+
+ @Override
+ public Adapter caseResource(Resource object) {
+ return createResourceAdapter();
+ }
+
+ @Override
+ public Adapter caseScm(Scm object) {
+ return createScmAdapter();
+ }
+
+ @Override
+ public Adapter caseSite(Site object) {
+ return createSiteAdapter();
+ }
+
+ @Override
+ public Adapter casePropertyElement(PropertyElement object) {
+ return createPropertyElementAdapter();
+ }
+
+ @Override
+ public Adapter caseConfiguration(Configuration object) {
+ return createConfigurationAdapter();
+ }
+
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @param target
+ * the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject) target);
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Activation <em>Activation</em>}'.
+ * <!-- begin-user-doc --> This default implementation returns null so that
+ * we can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Activation
+ * @generated
+ */
+ public Adapter createActivationAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationFile
+ * <em>Activation File</em>}'. <!-- begin-user-doc --> This default
+ * implementation returns null so that we can easily ignore cases; it's
+ * useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationFile
+ * @generated
+ */
+ public Adapter createActivationFileAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationOS <em>Activation OS</em>}
+ * '. <!-- begin-user-doc --> This default implementation returns null so
+ * that we can easily ignore cases; it's useful to ignore a case when
+ * inheritance will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationOS
+ * @generated
+ */
+ public Adapter createActivationOSAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.ActivationProperty
+ * <em>Activation Property</em>}'. <!-- begin-user-doc --> This default
+ * implementation returns null so that we can easily ignore cases; it's
+ * useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.ActivationProperty
+ * @generated
+ */
+ public Adapter createActivationPropertyAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Build <em>Build</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Build
+ * @generated
+ */
+ public Adapter createBuildAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.BuildBase <em>Build Base</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.BuildBase
+ * @generated
+ */
+ public Adapter createBuildBaseAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.CiManagement <em>Ci Management</em>}
+ * '. <!-- begin-user-doc --> This default implementation returns null so
+ * that we can easily ignore cases; it's useful to ignore a case when
+ * inheritance will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.CiManagement
+ * @generated
+ */
+ public Adapter createCiManagementAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Contributor <em>Contributor</em>}'.
+ * <!-- begin-user-doc --> This default implementation returns null so that
+ * we can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Contributor
+ * @generated
+ */
+ public Adapter createContributorAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Dependency <em>Dependency</em>}'.
+ * <!-- begin-user-doc --> This default implementation returns null so that
+ * we can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Dependency
+ * @generated
+ */
+ public Adapter createDependencyAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.DependencyManagement
+ * <em>Dependency Management</em>}'. <!-- begin-user-doc --> This default
+ * implementation returns null so that we can easily ignore cases; it's
+ * useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.DependencyManagement
+ * @generated
+ */
+ public Adapter createDependencyManagementAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.DeploymentRepository
+ * <em>Deployment Repository</em>}'. <!-- begin-user-doc --> This default
+ * implementation returns null so that we can easily ignore cases; it's
+ * useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.DeploymentRepository
+ * @generated
+ */
+ public Adapter createDeploymentRepositoryAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Developer <em>Developer</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Developer
+ * @generated
+ */
+ public Adapter createDeveloperAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.DistributionManagement
+ * <em>Distribution Management</em>}'. <!-- begin-user-doc --> This default
+ * implementation returns null so that we can easily ignore cases; it's
+ * useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.DistributionManagement
+ * @generated
+ */
+ public Adapter createDistributionManagementAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.DocumentRoot <em>Document Root</em>}
+ * '. <!-- begin-user-doc --> This default implementation returns null so
+ * that we can easily ignore cases; it's useful to ignore a case when
+ * inheritance will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.DocumentRoot
+ * @generated
+ */
+ public Adapter createDocumentRootAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Exclusion <em>Exclusion</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Exclusion
+ * @generated
+ */
+ public Adapter createExclusionAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Extension <em>Extension</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Extension
+ * @generated
+ */
+ public Adapter createExtensionAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.IssueManagement
+ * <em>Issue Management</em>}'. <!-- begin-user-doc --> This default
+ * implementation returns null so that we can easily ignore cases; it's
+ * useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.IssueManagement
+ * @generated
+ */
+ public Adapter createIssueManagementAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.License <em>License</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.License
+ * @generated
+ */
+ public Adapter createLicenseAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.MailingList <em>Mailing List</em>}'.
+ * <!-- begin-user-doc --> This default implementation returns null so that
+ * we can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.MailingList
+ * @generated
+ */
+ public Adapter createMailingListAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Model <em>Model</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Model
+ * @generated
+ */
+ public Adapter createModelAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Notifier <em>Notifier</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Notifier
+ * @generated
+ */
+ public Adapter createNotifierAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Organization <em>Organization</em>}'.
+ * <!-- begin-user-doc --> This default implementation returns null so that
+ * we can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Organization
+ * @generated
+ */
+ public Adapter createOrganizationAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Parent <em>Parent</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Parent
+ * @generated
+ */
+ public Adapter createParentAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Plugin <em>Plugin</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Plugin
+ * @generated
+ */
+ public Adapter createPluginAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.PluginExecution
+ * <em>Plugin Execution</em>}'. <!-- begin-user-doc --> This default
+ * implementation returns null so that we can easily ignore cases; it's
+ * useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.PluginExecution
+ * @generated
+ */
+ public Adapter createPluginExecutionAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.PluginManagement
+ * <em>Plugin Management</em>}'. <!-- begin-user-doc --> This default
+ * implementation returns null so that we can easily ignore cases; it's
+ * useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.PluginManagement
+ * @generated
+ */
+ public Adapter createPluginManagementAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Prerequisites <em>Prerequisites</em>}
+ * '. <!-- begin-user-doc --> This default implementation returns null so
+ * that we can easily ignore cases; it's useful to ignore a case when
+ * inheritance will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Prerequisites
+ * @generated
+ */
+ public Adapter createPrerequisitesAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Profile <em>Profile</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Profile
+ * @generated
+ */
+ public Adapter createProfileAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Relocation <em>Relocation</em>}'.
+ * <!-- begin-user-doc --> This default implementation returns null so that
+ * we can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Relocation
+ * @generated
+ */
+ public Adapter createRelocationAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Reporting <em>Reporting</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Reporting
+ * @generated
+ */
+ public Adapter createReportingAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportPlugin <em>Report Plugin</em>}
+ * '. <!-- begin-user-doc --> This default implementation returns null so
+ * that we can easily ignore cases; it's useful to ignore a case when
+ * inheritance will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.ReportPlugin
+ * @generated
+ */
+ public Adapter createReportPluginAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.ReportSet <em>Report Set</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.ReportSet
+ * @generated
+ */
+ public Adapter createReportSetAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Repository <em>Repository</em>}'.
+ * <!-- begin-user-doc --> This default implementation returns null so that
+ * we can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Repository
+ * @generated
+ */
+ public Adapter createRepositoryAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.RepositoryPolicy
+ * <em>Repository Policy</em>}'. <!-- begin-user-doc --> This default
+ * implementation returns null so that we can easily ignore cases; it's
+ * useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.RepositoryPolicy
+ * @generated
+ */
+ public Adapter createRepositoryPolicyAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Resource <em>Resource</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Resource
+ * @generated
+ */
+ public Adapter createResourceAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Scm <em>Scm</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Scm
+ * @generated
+ */
+ public Adapter createScmAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Site <em>Site</em>}'. <!--
+ * begin-user-doc --> This default implementation returns null so that we
+ * can easily ignore cases; it's useful to ignore a case when inheritance
+ * will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Site
+ * @generated
+ */
+ public Adapter createSiteAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.PropertyElement
+ * <em>Property Element</em>}'. <!-- begin-user-doc --> This default
+ * implementation returns null so that we can easily ignore cases; it's
+ * useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.PropertyElement
+ * @generated
+ */
+ public Adapter createPropertyElementAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '
+ * {@link org.eclipse.m2e.model.edit.pom.Configuration <em>Configuration</em>}
+ * '. <!-- begin-user-doc --> This default implementation returns null so
+ * that we can easily ignore cases; it's useful to ignore a case when
+ * inheritance will catch all the cases anyway. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @see org.eclipse.m2e.model.edit.pom.Configuration
+ * @generated
+ */
+ public Adapter createConfigurationAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case. <!-- begin-user-doc --> This
+ * default implementation returns null. <!-- end-user-doc -->
+ *
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} // PomAdapterFactory
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomResourceFactoryImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomResourceFactoryImpl.java
new file mode 100644
index 00000000..26c2b49f
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomResourceFactoryImpl.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: PomResourceFactoryImpl.java 20719 2009-02-02 05:52:56Z mpoindexter $
+ */
+package org.eclipse.m2e.model.edit.pom.util;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
+
+/**
+ * <!-- begin-user-doc --> The <b>Resource Factory</b> associated with the
+ * package. <!-- end-user-doc -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.util.PomResourceImpl
+ */
+public class PomResourceFactoryImpl extends ResourceFactoryImpl {
+
+ /**
+ * Creates an instance of the resource factory. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ */
+ public PomResourceFactoryImpl() {
+
+ }
+
+ @Override
+ public Resource createResource(URI uri) {
+ return new PomResourceImpl(uri);
+ }
+
+} // PomResourceFactoryImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomResourceImpl.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomResourceImpl.java
new file mode 100644
index 00000000..63dc5b92
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomResourceImpl.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.model.edit.pom.util;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.translators.SSESyncResource;
+
+/**
+ * <!-- begin-user-doc --> The <b>Resource </b> associated with the package.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.m2e.model.edit.pom.util.PomResourceFactoryImpl
+ * @generated NOT
+ */
+public class PomResourceImpl extends SSESyncResource {
+ /**
+ * Creates an instance of the resource.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @param uri the URI of the new resource.
+ * @generated
+ */
+ public PomResourceImpl(URI uri) {
+ super(uri);
+ }
+
+ public void load(Map<?, ?> options) throws IOException {
+ super.load(options);
+ }
+
+ public Model getModel() {
+ return (Model) getContents().get(0);
+ }
+
+} // PomResourceImpl
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomSwitch.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomSwitch.java
new file mode 100644
index 00000000..5ee48ad5
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomSwitch.java
@@ -0,0 +1,1060 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: PomSwitch.java 20588 2008-12-04 17:59:55Z jerdfelt $
+ */
+package org.eclipse.m2e.model.edit.pom.util;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.m2e.model.edit.pom.*;
+
+/**
+ * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance
+ * hierarchy. It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object and proceeding up the
+ * inheritance hierarchy until a non-null result is returned, which is the
+ * result of the switch. <!-- end-user-doc -->
+ *
+ * @see org.eclipse.m2e.model.edit.pom.PomPackage
+ * @generated
+ */
+public class PomSwitch<T> {
+ /**
+ * The cached model package <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected static PomPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ public PomSwitch() {
+ if (modelPackage == null) {
+ modelPackage = PomPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns
+ * a non null result; it yields that result. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return the first non-null result returned by a <code>caseXXX</code>
+ * call.
+ * @generated
+ */
+ public T doSwitch(EObject theEObject) {
+ return doSwitch(theEObject.eClass(), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns
+ * a non null result; it yields that result. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return the first non-null result returned by a <code>caseXXX</code>
+ * call.
+ * @generated
+ */
+ protected T doSwitch(EClass theEClass, EObject theEObject) {
+ if (theEClass.eContainer() == modelPackage) {
+ return doSwitch(theEClass.getClassifierID(), theEObject);
+ } else {
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(
+ eSuperTypes.get(0), theEObject);
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns
+ * a non null result; it yields that result. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return the first non-null result returned by a <code>caseXXX</code>
+ * call.
+ * @generated
+ */
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case PomPackage.ACTIVATION: {
+ Activation activation = (Activation) theEObject;
+ T result = caseActivation(activation);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.ACTIVATION_FILE: {
+ ActivationFile activationFile = (ActivationFile) theEObject;
+ T result = caseActivationFile(activationFile);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.ACTIVATION_OS: {
+ ActivationOS activationOS = (ActivationOS) theEObject;
+ T result = caseActivationOS(activationOS);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.ACTIVATION_PROPERTY: {
+ ActivationProperty activationProperty = (ActivationProperty) theEObject;
+ T result = caseActivationProperty(activationProperty);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.BUILD: {
+ Build build = (Build) theEObject;
+ T result = caseBuild(build);
+ if (result == null)
+ result = caseBuildBase(build);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.BUILD_BASE: {
+ BuildBase buildBase = (BuildBase) theEObject;
+ T result = caseBuildBase(buildBase);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.CI_MANAGEMENT: {
+ CiManagement ciManagement = (CiManagement) theEObject;
+ T result = caseCiManagement(ciManagement);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.CONTRIBUTOR: {
+ Contributor contributor = (Contributor) theEObject;
+ T result = caseContributor(contributor);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.DEPENDENCY: {
+ Dependency dependency = (Dependency) theEObject;
+ T result = caseDependency(dependency);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.DEPENDENCY_MANAGEMENT: {
+ DependencyManagement dependencyManagement = (DependencyManagement) theEObject;
+ T result = caseDependencyManagement(dependencyManagement);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.DEPLOYMENT_REPOSITORY: {
+ DeploymentRepository deploymentRepository = (DeploymentRepository) theEObject;
+ T result = caseDeploymentRepository(deploymentRepository);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.DEVELOPER: {
+ Developer developer = (Developer) theEObject;
+ T result = caseDeveloper(developer);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.DISTRIBUTION_MANAGEMENT: {
+ DistributionManagement distributionManagement = (DistributionManagement) theEObject;
+ T result = caseDistributionManagement(distributionManagement);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.DOCUMENT_ROOT: {
+ DocumentRoot documentRoot = (DocumentRoot) theEObject;
+ T result = caseDocumentRoot(documentRoot);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.EXCLUSION: {
+ Exclusion exclusion = (Exclusion) theEObject;
+ T result = caseExclusion(exclusion);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.EXTENSION: {
+ Extension extension = (Extension) theEObject;
+ T result = caseExtension(extension);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.ISSUE_MANAGEMENT: {
+ IssueManagement issueManagement = (IssueManagement) theEObject;
+ T result = caseIssueManagement(issueManagement);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.LICENSE: {
+ License license = (License) theEObject;
+ T result = caseLicense(license);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.MAILING_LIST: {
+ MailingList mailingList = (MailingList) theEObject;
+ T result = caseMailingList(mailingList);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.MODEL: {
+ Model model = (Model) theEObject;
+ T result = caseModel(model);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.NOTIFIER: {
+ Notifier notifier = (Notifier) theEObject;
+ T result = caseNotifier(notifier);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.ORGANIZATION: {
+ Organization organization = (Organization) theEObject;
+ T result = caseOrganization(organization);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.PARENT: {
+ Parent parent = (Parent) theEObject;
+ T result = caseParent(parent);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.PLUGIN: {
+ Plugin plugin = (Plugin) theEObject;
+ T result = casePlugin(plugin);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.PLUGIN_EXECUTION: {
+ PluginExecution pluginExecution = (PluginExecution) theEObject;
+ T result = casePluginExecution(pluginExecution);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.PLUGIN_MANAGEMENT: {
+ PluginManagement pluginManagement = (PluginManagement) theEObject;
+ T result = casePluginManagement(pluginManagement);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.PREREQUISITES: {
+ Prerequisites prerequisites = (Prerequisites) theEObject;
+ T result = casePrerequisites(prerequisites);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.PROFILE: {
+ Profile profile = (Profile) theEObject;
+ T result = caseProfile(profile);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.RELOCATION: {
+ Relocation relocation = (Relocation) theEObject;
+ T result = caseRelocation(relocation);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.REPORTING: {
+ Reporting reporting = (Reporting) theEObject;
+ T result = caseReporting(reporting);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.REPORT_PLUGIN: {
+ ReportPlugin reportPlugin = (ReportPlugin) theEObject;
+ T result = caseReportPlugin(reportPlugin);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.REPORT_SET: {
+ ReportSet reportSet = (ReportSet) theEObject;
+ T result = caseReportSet(reportSet);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.REPOSITORY: {
+ Repository repository = (Repository) theEObject;
+ T result = caseRepository(repository);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.REPOSITORY_POLICY: {
+ RepositoryPolicy repositoryPolicy = (RepositoryPolicy) theEObject;
+ T result = caseRepositoryPolicy(repositoryPolicy);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.RESOURCE: {
+ Resource resource = (Resource) theEObject;
+ T result = caseResource(resource);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.SCM: {
+ Scm scm = (Scm) theEObject;
+ T result = caseScm(scm);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.SITE: {
+ Site site = (Site) theEObject;
+ T result = caseSite(site);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.PROPERTY_ELEMENT: {
+ PropertyElement propertyElement = (PropertyElement) theEObject;
+ T result = casePropertyElement(propertyElement);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case PomPackage.CONFIGURATION: {
+ Configuration configuration = (Configuration) theEObject;
+ T result = caseConfiguration(configuration);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ default:
+ return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Activation</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Activation</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseActivation(Activation object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Activation File</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Activation File</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseActivationFile(ActivationFile object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Activation OS</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Activation OS</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseActivationOS(ActivationOS object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Activation Property</em>'. <!-- begin-user-doc --> This
+ * implementation returns null; returning a non-null result will terminate
+ * the switch. <!-- end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Activation Property</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseActivationProperty(ActivationProperty object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Build</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Build</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseBuild(Build object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Build Base</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Build Base</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseBuildBase(BuildBase object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Ci Management</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Ci Management</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseCiManagement(CiManagement object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Contributor</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Contributor</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseContributor(Contributor object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Dependency</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Dependency</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseDependency(Dependency object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Dependency Management</em>'. <!-- begin-user-doc --> This
+ * implementation returns null; returning a non-null result will terminate
+ * the switch. <!-- end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Dependency Management</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseDependencyManagement(DependencyManagement object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Deployment Repository</em>'. <!-- begin-user-doc --> This
+ * implementation returns null; returning a non-null result will terminate
+ * the switch. <!-- end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Deployment Repository</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseDeploymentRepository(DeploymentRepository object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Developer</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Developer</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseDeveloper(Developer object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Distribution Management</em>'. <!-- begin-user-doc --> This
+ * implementation returns null; returning a non-null result will terminate
+ * the switch. <!-- end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Distribution Management</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseDistributionManagement(DistributionManagement object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Document Root</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Document Root</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseDocumentRoot(DocumentRoot object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Exclusion</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Exclusion</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseExclusion(Exclusion object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Extension</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Extension</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseExtension(Extension object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Issue Management</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Issue Management</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseIssueManagement(IssueManagement object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>License</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>License</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLicense(License object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Mailing List</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Mailing List</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseMailingList(MailingList object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Model</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Model</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseModel(Model object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Notifier</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Notifier</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseNotifier(Notifier object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Organization</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Organization</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseOrganization(Organization object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Parent</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Parent</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseParent(Parent object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Plugin</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Plugin</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePlugin(Plugin object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Plugin Execution</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Plugin Execution</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePluginExecution(PluginExecution object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Plugin Management</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Plugin Management</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePluginManagement(PluginManagement object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Prerequisites</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Prerequisites</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePrerequisites(Prerequisites object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Profile</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Profile</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseProfile(Profile object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Relocation</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Relocation</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseRelocation(Relocation object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Reporting</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Reporting</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseReporting(Reporting object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Report Plugin</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Report Plugin</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseReportPlugin(ReportPlugin object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Report Set</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Report Set</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseReportSet(ReportSet object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Repository</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Repository</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseRepository(Repository object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Repository Policy</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Repository Policy</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseRepositoryPolicy(RepositoryPolicy object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Resource</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Resource</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseResource(Resource object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Scm</em>'. <!-- begin-user-doc --> This implementation returns null;
+ * returning a non-null result will terminate the switch. <!-- end-user-doc
+ * -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Scm</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseScm(Scm object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Site</em>'. <!-- begin-user-doc --> This implementation returns null;
+ * returning a non-null result will terminate the switch. <!-- end-user-doc
+ * -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Site</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseSite(Site object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Property Element</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Property Element</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePropertyElement(PropertyElement object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>Configuration</em>'. <!-- begin-user-doc --> This implementation
+ * returns null; returning a non-null result will terminate the switch. <!--
+ * end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>Configuration</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseConfiguration(Configuration object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '
+ * <em>EObject</em>'. <!-- begin-user-doc --> This implementation returns
+ * null; returning a non-null result will terminate the switch, but this is
+ * the last case anyway. <!-- end-user-doc -->
+ *
+ * @param object
+ * the target of the switch.
+ * @return the result of interpreting the object as an instance of '
+ * <em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} // PomSwitch
diff --git a/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomXMLProcessor.java b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomXMLProcessor.java
new file mode 100644
index 00000000..0afa6afb
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/java/org/eclipse/m2e/model/edit/pom/util/PomXMLProcessor.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: PomXMLProcessor.java 20588 2008-12-04 17:59:55Z jerdfelt $
+ */
+package org.eclipse.m2e.model.edit.pom.util;
+
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.resource.Resource;
+
+import org.eclipse.emf.ecore.xmi.util.XMLProcessor;
+import org.eclipse.m2e.model.edit.pom.PomPackage;
+
+/**
+ * This class contains helper methods to serialize and deserialize XML documents
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class PomXMLProcessor extends XMLProcessor {
+
+ /**
+ * Public constructor to instantiate the helper. <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PomXMLProcessor() {
+ super((EPackage.Registry.INSTANCE));
+ PomPackage.eINSTANCE.eClass();
+ }
+
+ /**
+ * Register for "*" and "xml" file extensions the PomResourceFactoryImpl
+ * factory. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected Map<String, Resource.Factory> getRegistrations() {
+ if (registrations == null) {
+ super.getRegistrations();
+ registrations.put(XML_EXTENSION, new PomResourceFactoryImpl());
+ registrations.put(STAR_EXTENSION, new PomResourceFactoryImpl());
+ }
+ return registrations;
+ }
+
+} // PomXMLProcessor
diff --git a/org.eclipse.m2e.model.edit/src/main/templates/Header.javajetinc b/org.eclipse.m2e.model.edit/src/main/templates/Header.javajetinc
new file mode 100644
index 00000000..8a7dffab
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/templates/Header.javajetinc
@@ -0,0 +1,7 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
diff --git a/org.eclipse.m2e.model.edit/src/main/templates/emf-merge.xml b/org.eclipse.m2e.model.edit/src/main/templates/emf-merge.xml
new file mode 100644
index 00000000..25384a15
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/templates/emf-merge.xml
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<merge:options
+ indent=" "
+ braceStyle="matching"
+ redirect="Gen"
+ block="\s*@\s*generated\s*NOT\s*(?:\n\r?|\r\n?)"
+ noImport="\s*//\s*import\s+([\w.*]*)\s*;\s*(?:\n\r?|\r\n?)"
+ xmlns:merge="http://www.eclipse.org/org/eclipse/emf/codegen/jmerge/Options">
+
+<!-- Tabbed Standard
+
+ indent="&#x9;"
+ braceStyle="standard"
+
+-->
+
+ <!-- this accepts both new and old style markup. -->
+
+ <merge:dictionaryPattern
+ name="modelMembers"
+ select="Member/getComment"
+ match="@\s*(model)"/>
+
+ <merge:dictionaryPattern
+ name="generatedUnmodifiableMembers"
+ select="Member/getComment"
+ match="@\s*(gen)erated\s*(This field/method[^(?:\n\r?|\r\n?)]*)*(?:\n\r?|\r\n?)"/>
+
+ <merge:dictionaryPattern
+ name="generatedModifiableMembers"
+ select="Member/getComment"
+ match="@\s*generated\s*(modifiable)\s*(?:\n\r?|\r\n?)"/>
+
+ <!-- This is like the above, but for backward compatibility -->
+ <merge:dictionaryPattern
+ name="generatedLastGenMembers"
+ select="Member/getComment"
+ match="@\s*(lastgen).*(?:\n\r?|\r\n?)"/>
+
+ <merge:dictionaryPattern
+ name="orderedMembers"
+ select="Member/getComment"
+ match="@\s*(ordered)\s*(?:\n\r?|\r\n?)"/>
+
+ <!-- Only push Annotations for the Members marked by gen-->
+ <merge:push targetParentMarkup="^gen$" select="Annotation"/>
+
+ <merge:pull
+ sourceMarkup="^modifiable$"
+ sourceGet="Member/getComment"
+ sourceTransfer="(\s*&lt;!--\s*begin-user-doc.*?end-user-doc\s*-->\s*)(?:\n\r?|\r\n?)"
+ targetMarkup="^modifiable$"
+ targetPut="Member/setComment"/>
+ <merge:pull
+ sourceMarkup="^gen$"
+ sourceGet="Member/getComment"
+ sourceTransfer="(\s*&lt;!--\s*begin-user-doc.*?end-user-doc\s*-->\s*)(?:\n\r?|\r\n?)"
+ targetMarkup="^gen$"
+ targetPut="Member/setComment"/>
+ <merge:pull
+ sourceGet="Member/getFlags"
+ targetMarkup="^gen$"
+ equals="Member/getName"
+ targetPut="Member/setFlags"/>
+
+ <merge:pull
+ sourceMarkup="^gen$"
+ sourceGet="AbstractType/getComment"
+ sourceTransfer="(\s*&lt;!--\s*begin-user-doc.*?end-user-doc\s*-->\s*)(?:\n\r?|\r\n?)"
+ targetMarkup="^modifiable$"
+ targetPut="AbstractType/setComment"/>
+
+ <merge:pull
+ sourceGet="Type/getTypeParameters"
+ targetMarkup="^lastgen$|^gen$|^modifiable$|^model$"
+ targetPut="Type/setTypeParameters"/>
+ <merge:pull
+ sourceGet="Type/getSuperclass"
+ targetMarkup="^lastgen$|^gen$|^modifiable$|^model$"
+ targetPut="Type/setSuperclass"/>
+ <merge:pull
+ sourceGet="Type/getSuperInterfaces"
+ sourceTransfer="(\s*@\s*extends|\s*@\s*implements)(.*?)(?:&lt;!--|(?:\n\r?|\r\n?))"
+ targetMarkup="^lastgen$|^gen$|^modifiable$|^model$"
+ targetPut="Type/addSuperInterface"/>
+
+ <merge:pull
+ sourceGet="Enum/getSuperInterfaces"
+ sourceTransfer="(\s*@\s*extends|\s*@\s*implements)(.*?)(?:&lt;!--|(?:\n\r?|\r\n?))"
+ targetMarkup="^lastgen$|^gen$|^modifiable$|^model$"
+ targetPut="Enum/addSuperInterface"/>
+
+ <merge:pull
+ sourceGet="EnumConstant/getArguments"
+ targetMarkup="^lastgen$|^gen$|^modifiable$|^model$"
+ targetPut="EnumConstant/setArguments"/>
+ <merge:pull
+ sourceGet="EnumConstant/getBody"
+ targetMarkup="^lastgen$|^gen$|^modifiable$|^model$$"
+ targetPut="EnumConstant/setBody"/>
+
+ <merge:pull
+ sourceGet="AnnotationTypeMember/getType"
+ targetMarkup="^gen$"
+ targetPut="AnnotationTypeMember/setType"/>
+ <merge:pull
+ sourceGet="AnnotationTypeMember/getDefaultValue"
+ targetMarkup="^gen$"
+ targetPut="AnnotationTypeMember/setDefaultValue"/>
+
+ <merge:pull
+ sourceGet="Initializer/getBody"
+ targetMarkup="^gen$"
+ targetPut="Initializer/setBody"/>
+
+ <merge:pull
+ sourceGet="Field/getType"
+ targetMarkup="^gen$"
+ targetPut="Field/setType"/>
+ <merge:pull
+ sourceGet="Field/getInitializer"
+ targetMarkup="^gen$"
+ targetPut="Field/setInitializer"/>
+
+ <merge:pull
+ sourceGet="Method/getTypeParameters"
+ targetMarkup="^gen$"
+ targetPut="Method/setTypeParameters"/>
+ <merge:pull
+ sourceGet="Method/getReturnType"
+ targetMarkup="^gen$|^model$"
+ targetPut="Method/setReturnType"/>
+ <merge:pull
+ sourceGet="Method/getParameters"
+ targetMarkup="^gen$"
+ targetPut="Method/setParameters"/>
+ <merge:pull
+ sourceGet="Method/getBody"
+ targetMarkup="^gen$"
+ targetPut="Method/setBody"/>
+ <merge:pull
+ sourceGet="Method/getExceptions"
+ targetMarkup="^gen$"
+ targetPut="Method/addException"/>
+
+ <merge:sweep markup="^gen$" select="Member"/>
+ <merge:sweep markup="^org.eclipse.emf.ecore.EMetaObject$" select="Import"/>
+ <merge:sweep markup="^org.eclipse.emf.ecore.impl.EMetaObjectImpl$" select="Import"/>
+ <merge:sweep markup="^org.eclipse.emf.ecore.util.EObjectCompositeEList$" select="Import"/>
+ <merge:sweep markup="^org.eclipse.emf.ecore.util.EObjectCompositeWithInverseEList$" select="Import"/>
+ <merge:sweep markup="^org.eclipse.emf.common.util.AbstractEnumerator$" select="Import"/>
+
+ <merge:sort markup="^ordered$" select="Field"/>
+ <merge:sort markup="^ordered$" select="EnumConstant"/>
+
+ <merge:pull
+ sourceGet="CompilationUnit/getHeader"
+ targetPut="CompilationUnit/setHeader"/>
+
+<!-- Basic Rules
+
+ <merge:pull
+ sourceGet="CompilationUnit/getHeader"
+ targetPut="CompilationUnit/setHeader"/>
+
+ <merge:pull
+ sourceGet="Package/getName"
+ targetPut="Package/setName"/>
+
+ <merge:pull
+ sourceGet="Member/getFlags"
+ targetPut="Member/setFlags"/>
+ <merge:pull
+ sourceGet="Member/getComment"
+ targetPut="Member/setComment"/>
+
+ <merge:pull
+ sourceGet="Type/getSuperclass"
+ targetPut="Type/setSuperclass"/>
+ <merge:pull
+ sourceGet="Type/getSuperInterfaces"
+ targetPut="Type/addSuperInterface"/>
+
+ <merge:pull
+ sourceGet="Initializer/getBody"
+ targetPut="Initializer/setBody"/>
+
+ <merge:pull
+ sourceGet="Field/getType"
+ targetPut="Field/setType"/>
+ <merge:pull
+ sourceGet="Field/getInitializer"
+ targetPut="Field/setInitializer"/>
+
+ <merge:pull
+ sourceGet="Method/getBody"
+ targetPut="Method/setBody"/>
+ <merge:pull
+ sourceGet="Method/getReturnType"
+ targetPut="Method/setReturnType"/>
+ <merge:pull
+ sourceGet="Method/getExceptions"
+ targetPut="Method/addException"/>
+-->
+
+<!-- Push Enum Constants only for generated Enums -->
+<!--
+ <merge:push targetParentMarkup="^gen$" select="EnumConstant"/>
+-->
+
+<!-- Push Annotation Type Members only for generated Annotation Types -->
+<!--
+ <merge:push targetParentMarkup="^gen$" select="AnnotationTypeMember"/>
+-->
+
+<!-- Sets the content of annotations if the parent is marked with gen -->
+<!--
+ <merge:pull
+ sourceGet="Annotation/getContents"
+ targetParentMarkup="^gen$"
+ targetPut="Annotation/setContents"/>
+-->
+
+<!-- Remove annotations of generated target nodes if the annotation is not in the source -->
+<!--
+ <merge:sweep parentMarkup="^gen$" select="Annotation"/>
+-->
+
+<!--
+ <merge:pull
+ sourceMarkup="^modifiable$"
+ sourceGet="Member/getComment"
+ targetMarkup="^gen$"
+ targetPut="Member/setComment"/>
+-->
+
+</merge:options>
diff --git a/org.eclipse.m2e.model.edit/src/main/templates/model/Class.javajet b/org.eclipse.m2e.model.edit/src/main/templates/model/Class.javajet
new file mode 100644
index 00000000..2f305a3b
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/templates/model/Class.javajet
@@ -0,0 +1,2010 @@
+<%@ jet package="org.eclipse.emf.codegen.ecore.templates.model" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="Class" version="$Id: Class.javajet,v 1.70 2007/06/18 19:35:21 emerks Exp $" %>
+<%
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2002-2007 IBM Corporation 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:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ */
+%>
+<%final GenClass genClass = (GenClass)((Object[])argument)[0]; final GenPackage genPackage = genClass.getGenPackage(); final GenModel genModel=genPackage.getGenModel();%>
+<%final boolean isInterface = Boolean.TRUE.equals(((Object[])argument)[1]); final boolean isImplementation = Boolean.TRUE.equals(((Object[])argument)[2]);%>
+<%final String publicStaticFinalFlag = isImplementation ? "public static final " : "";%>
+<%final String singleWildcard = genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50 ? "<?>" : "";%>
+<%final String negativeOffsetCorrection = genClass.hasOffsetCorrection() ? " - " + genClass.getOffsetCorrectionField(null) : "";%>
+<%final String positiveOffsetCorrection = genClass.hasOffsetCorrection() ? " + " + genClass.getOffsetCorrectionField(null) : "";%>
+<%@ include file="../Header.javajetinc"%>
+<%if (isInterface) {%>
+package <%=genPackage.getInterfacePackageName()%>;
+<%} else {%>
+package <%=genPackage.getClassPackageName()%>;
+<%}%>
+
+<%genModel.markImportLocation(stringBuffer, genPackage);%>
+
+<%if (isInterface) {%>
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b><%=genClass.getFormattedName()%></b></em>'.
+ * <!-- end-user-doc -->
+<%if (genClass.hasDocumentation()) {%>
+ *
+ * <!-- begin-model-doc -->
+ * <%=genClass.getDocumentation(genModel.getIndentation(stringBuffer))%>
+ * <!-- end-model-doc -->
+<%}%>
+ *
+<%if (!genClass.getGenFeatures().isEmpty()) {%>
+ * <p>
+ * The following features are supported:
+ * <ul>
+<%for (GenFeature genFeature : genClass.getGenFeatures()) {%>
+ <%if (!genFeature.isSuppressedGetVisibility()) {%>
+ * <li>{@link <%=genClass.getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}</li>
+ <%}%>
+<%}%>
+ * </ul>
+ * </p>
+<%}%>
+ *
+<%if (!genModel.isSuppressEMFMetaData()) {%>
+ * @see <%=genPackage.getQualifiedPackageInterfaceName()%>#get<%=genClass.getClassifierAccessorName()%>()
+<%}%>
+<%if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genClass.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;%>
+ * @model <%=modelInfo%>
+<%} else {%>
+ * <%=modelInfo%>
+<%}} if (first) {%>
+ * @model
+<%}}%>
+<%if (genClass.needsRootExtendsInterfaceExtendsTag()) {%>
+ * @extends <%=genModel.getImportedName(genModel.getRootExtendsInterface())%>
+<%}%>
+ * @generated
+ */
+<%} else {%>
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b><%=genClass.getFormattedName()%></b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+<%if (!genClass.getImplementedGenFeatures().isEmpty()) {%>
+ * The following features are implemented:
+ * <ul>
+<%for (GenFeature genFeature : genClass.getImplementedGenFeatures()) {%>
+ * <li>{@link <%=genClass.getQualifiedClassName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}</li>
+<%}%>
+ * </ul>
+<%}%>
+ * </p>
+ *
+ * @generated
+ */
+<%}%>
+<%if (isImplementation) {%>
+public<%if (genClass.isAbstract()) {%> abstract<%}%> class <%=genClass.getClassName()%><%=genClass.getTypeParameters().trim()%><%=genClass.getClassExtends()%><%=genClass.getClassImplements()%>
+<%} else {%>
+public interface <%=genClass.getInterfaceName()%><%=genClass.getTypeParameters().trim()%><%=genClass.getInterfaceExtends()%>
+<%}%>
+{
+<%if (genModel.hasCopyrightField()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genModel.getImportedName("java.lang.String")%> copyright = <%=genModel.getCopyrightFieldLiteral()%>;<%=genModel.getNonNLS()%>
+
+<%}%>
+<%if (isImplementation && genModel.getDriverNumber() != null) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final <%=genModel.getImportedName("java.lang.String")%> mofDriverNumber = "<%=genModel.getDriverNumber()%>";<%=genModel.getNonNLS()%>
+
+<%}%>
+<%if (isImplementation && genClass.isJavaIOSerializable()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final long serialVersionUID = 1L;
+
+<%}%>
+<%if (isImplementation && genModel.isVirtualDelegation()) { String eVirtualValuesField = genClass.getEVirtualValuesField();%>
+ <%if (eVirtualValuesField != null) {%>
+ /**
+ * An array of objects representing the values of non-primitive features.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Object[] <%=eVirtualValuesField%>;
+
+ <%}%>
+ <%{ List<String> eVirtualIndexBitFields = genClass.getEVirtualIndexBitFields(new ArrayList<String>());%>
+ <%if (!eVirtualIndexBitFields.isEmpty()) {%>
+ <%for (String eVirtualIndexBitField : eVirtualIndexBitFields) {%>
+ /**
+ * A bit field representing the indices of non-primitive feature values.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected int <%=eVirtualIndexBitField%>;
+
+ <%}%>
+ <%}%>
+ <%}%>
+<%}%>
+<%if (isImplementation && genClass.isModelRoot() && genModel.isBooleanFlagsEnabled() && genModel.getBooleanFlagsReservedBits() == -1) {%>
+ /**
+ * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected int <%=genModel.getBooleanFlagsField()%> = 0;
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation()) {%>
+ <%for (GenFeature genFeature : genClass.getDeclaredFieldGenFeatures()) {%>
+<%@ include file="Class/declaredFieldGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ <%if (genFeature.isListType() || genFeature.isReferenceType()) {%>
+ <%if (genClass.isField(genFeature)) {%>
+ /**
+ * The cached value of the '{@link #<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ * @ordered
+ */
+ protected <%=genFeature.getImportedInternalType(genClass)%> <%=genFeature.getSafeName()%>;
+
+ <%}%>
+ <%if (genModel.isArrayAccessors() && genFeature.isListType() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) { String rawListItemType = genFeature.getRawListItemType(); int index = rawListItemType.indexOf('['); String head = rawListItemType; String tail = ""; if (index != -1) { head = rawListItemType.substring(0, index); tail = rawListItemType.substring(index); } %>
+ /**
+ * The empty value for the '{@link #<%=genFeature.getGetArrayAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' array accessor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetArrayAccessor()%>()
+ * @generated
+ * @ordered
+ */
+ <%if (genFeature.getQualifiedListItemType(genClass).contains("<")) {%>
+ @SuppressWarnings("unchecked")
+ <%}%>
+ protected static final <%=rawListItemType%>[] <%=genFeature.getUpperName()%>_EEMPTY_ARRAY = new <%=head%> [0]<%=tail%>;
+
+ <%}%>
+ <%} else {%>
+ <%if (genFeature.hasEDefault() && (!genFeature.isVolatile() || !genModel.isReflectiveDelegation() && (!genFeature.hasDelegateFeature() || !genFeature.isUnsettable()))) { String staticDefaultValue = genFeature.getStaticDefaultValue();%>
+ /**
+ * The default value of the '{@link #<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ * @ordered
+ */
+ <%if (genModel.useGenerics() && genFeature.isListDataType() && genFeature.isSetDefaultValue()) {%>
+ @SuppressWarnings("unchecked")
+ <%}%>
+ protected static final <%=genFeature.getImportedType(genClass)%> <%=genFeature.getEDefault()%><%if ("".equals(staticDefaultValue)) {%>; // TODO The default value literal "<%=genFeature.getEcoreFeature().getDefaultValueLiteral()%>" is not valid.<%} else {%> = <%=staticDefaultValue%>;<%=genModel.getNonNLS(staticDefaultValue)%><%}%>
+
+ <%}%>
+ <%if (genClass.isField(genFeature)) {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ <%if (genClass.getFlagIndex(genFeature) > 31 && genClass.getFlagIndex(genFeature) % 32 == 0) {%>
+ /**
+ * An additional set of bit flags representing the values of boolean attributes and whether unsettable features have been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected int <%=genClass.getFlagsField(genFeature)%> = 0;
+
+ <%}%>
+ /**
+ * The flag representing the value of the '{@link #<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ * @ordered
+ */
+ protected static final int <%=genFeature.getUpperName()%>_EFLAG = 1 <%="<< " + genClass.getFlagIndex(genFeature) % 32 %>;
+
+ <%} else {%>
+ /**
+ * The cached value of the '{@link #<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ * @ordered
+ */
+ protected <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%><%if (genFeature.hasEDefault()) {%> = <%=genFeature.getEDefault()%><%}%>;
+
+ <%}%>
+ <%}%>
+ <%}%>
+ <%if (genClass.isESetField(genFeature)) {%>
+ <%if (genClass.isESetFlag(genFeature)) {%>
+ <%if (genClass.getESetFlagIndex(genFeature) > 31 && genClass.getESetFlagIndex(genFeature) % 32 == 0) {%>
+ /**
+ * An additional set of bit flags representing the values of boolean attributes and whether unsettable features have been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected int <%=genClass.getESetFlagsField(genFeature)%> = 0;
+
+ <%}%>
+ /**
+ * The flag representing whether the <%=genFeature.getFormattedName()%> <%=genFeature.getFeatureKind()%> has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected static final int <%=genFeature.getUpperName()%>_ESETFLAG = 1 <%="<< " + genClass.getESetFlagIndex(genFeature) % 32 %>;
+
+ <%} else {%>
+ /**
+ * This is true if the <%=genFeature.getFormattedName()%> <%=genFeature.getFeatureKind()%> has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean <%=genFeature.getUncapName()%>ESet;
+
+ <%}%>
+ <%}%>
+ <%}%>
+<%@ include file="Class/declaredFieldGenFeature.insert.javajetinc" fail="silent" %>
+<%@ end %><%//Class/declaredFieldGenFeature.override.javajetinc%>
+<%}%>
+<%if (isImplementation && genClass.hasOffsetCorrection() && !genClass.getImplementedGenFeatures().isEmpty()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final int <%=genClass.getOffsetCorrectionField(null)%> = <%=genClass.getQualifiedClassifierAccessor()%>.getFeatureID(<%=genClass.getImplementedGenFeatures().get(0).getQualifiedFeatureAccessor()%>) - <%=genClass.getQualifiedFeatureID(genClass.getImplementedGenFeatures().get(0))%>;
+
+<%}%>
+<%if (isImplementation && genClass.hasOffsetCorrection() && !genModel.isReflectiveDelegation()) {%>
+ <%for (GenFeature genFeature : genClass.getImplementedGenFeatures()) { GenFeature reverseFeature = genFeature.getReverse();%>
+ <%if (reverseFeature != null && reverseFeature.getGenClass().hasOffsetCorrection()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final int <%=genClass.getOffsetCorrectionField(genFeature)%> = <%=reverseFeature.getGenClass().getQualifiedClassifierAccessor()%>.getFeatureID(<%=reverseFeature.getQualifiedFeatureAccessor()%>) - <%=reverseFeature.getGenClass().getQualifiedFeatureID(reverseFeature)%>;
+
+ <%}%>
+ <%}%>
+<%}%>
+<%if (isImplementation) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.isPublicConstructors()) {%>public<%} else {%>protected<%}%> <%=genClass.getClassName()%>()
+ {
+ super();
+ <%for (GenFeature genFeature : genClass.getFlagGenFeatures("true")) {%>
+ <%=genClass.getFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_EFLAG;
+ <%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ protected <%=genModel.getImportedName("org.eclipse.emf.ecore.EClass")%> eStaticClass()
+ {
+ return <%=genClass.getQualifiedClassifierAccessor()%>;
+ }
+
+<%}%>
+<%@ include file="Class/reflectiveDelegation.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isImplementation && genModel.getFeatureDelegation() == GenDelegationKind.REFLECTIVE_LITERAL && (genClass.getClassExtendsGenClass() == null || genClass.getClassExtendsGenClass().getGenModel().getFeatureDelegation() != GenDelegationKind.REFLECTIVE_LITERAL)) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ protected int eStaticFeatureCount()
+ {
+ return <%=genClass.getClassExtendsGenClass() == null ? 0 : genClass.getClassExtendsGenClass().getAllGenFeatures().size()%>;
+ }
+
+<%}%>
+<%@ end %><%//Class/reflectiveDelegation.override.javajetinc%>
+<%new Runnable() { public void run() {%>
+<%for (GenFeature genFeature : (isImplementation ? genClass.getImplementedGenFeatures() : genClass.getDeclaredGenFeatures())) {%>
+<%@ include file="Class/genFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ <%if (genModel.isArrayAccessors() && genFeature.isListType() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ <%=genFeature.getListItemType(genClass)%>[] <%=genFeature.getGetArrayAccessor()%>();
+
+ <%} else {%>
+ <%if (genModel.useGenerics()) {%>
+ @SuppressWarnings("unchecked")
+ <%}%>
+ public <%=genFeature.getListItemType(genClass)%>[] <%=genFeature.getGetArrayAccessor()%>()
+ {
+ <%if (genFeature.isVolatile()) {%>
+ <%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%><%=genFeature.getListTemplateArguments(genClass)%> list = (<%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%><%=genFeature.getListTemplateArguments(genClass)%>)<%=genFeature.getGetAccessor()%>();
+ if (list.isEmpty()) return <%if (genModel.useGenerics() && !genFeature.getListItemType(genClass).contains("<") && !genFeature.getListItemType(null).equals(genFeature.getListItemType(genClass))) {%>(<%=genFeature.getListItemType(genClass)%>[])<%}%><%=genFeature.getUpperName()%>_EEMPTY_ARRAY;
+ <%} else {%>
+ if (<%=genFeature.getSafeName()%> == null || <%=genFeature.getSafeName()%>.isEmpty()) return <%if (genModel.useGenerics() && !genFeature.getListItemType(genClass).contains("<") && !genFeature.getListItemType(null).equals(genFeature.getListItemType(genClass))) {%>(<%=genFeature.getListItemType(genClass)%>[])<%}%><%=genFeature.getUpperName()%>_EEMPTY_ARRAY;
+ <%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%><%=genFeature.getListTemplateArguments(genClass)%> list = (<%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%><%=genFeature.getListTemplateArguments(genClass)%>)<%=genFeature.getSafeName()%>;
+ <%}%>
+ list.shrink();
+ return (<%=genFeature.getListItemType(genClass)%>[])list.data();
+ }
+
+ <%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ <%=genFeature.getListItemType(genClass)%> get<%=genFeature.getAccessorName()%>(int index);
+
+ <%} else {%>
+ public <%=genFeature.getListItemType(genClass)%> get<%=genFeature.getAccessorName()%>(int index)
+ {
+ return <%if (!genModel.useGenerics()) {%>(<%=genFeature.getListItemType(genClass)%>)<%}%><%=genFeature.getGetAccessor()%>().get(index);
+ }
+
+ <%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ int get<%=genFeature.getAccessorName()%>Length();
+
+ <%} else {%>
+ public int get<%=genFeature.getAccessorName()%>Length()
+ {
+ <%if (genFeature.isVolatile()) {%>
+ return <%=genFeature.getGetAccessor()%>().size();
+ <%} else {%>
+ return <%=genFeature.getSafeName()%> == null ? 0 : <%=genFeature.getSafeName()%>.size();
+ <%}%>
+ }
+
+ <%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ void set<%=genFeature.getAccessorName()%>(<%=genFeature.getListItemType(genClass)%>[] new<%=genFeature.getCapName()%>);
+
+ <%} else {%>
+ public void set<%=genFeature.getAccessorName()%>(<%=genFeature.getListItemType(genClass)%>[] new<%=genFeature.getCapName()%>)
+ {
+ ((<%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%><%=genFeature.getListTemplateArguments(genClass)%>)<%=genFeature.getGetAccessor()%>()).setData(new<%=genFeature.getCapName()%>.length, new<%=genFeature.getCapName()%>);
+ }
+
+ <%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ void set<%=genFeature.getAccessorName()%>(int index, <%=genFeature.getListItemType(genClass)%> element);
+
+ <%} else {%>
+ public void set<%=genFeature.getAccessorName()%>(int index, <%=genFeature.getListItemType(genClass)%> element)
+ {
+ <%=genFeature.getGetAccessor()%>().set(index, element);
+ }
+
+ <%}%>
+ <%}%>
+ <%if (genFeature.isGet() && (isImplementation || !genFeature.isSuppressedGetVisibility())) {%>
+<%@ include file="Class/getGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) {%>
+<%@ include file="Class/getGenFeature.javadoc.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * Returns the value of the '<em><b><%=genFeature.getFormattedName()%></b></em>' <%=genFeature.getFeatureKind()%>.
+ <%if (genFeature.isListType()) {%>
+ <%if (genFeature.isMapType()) { GenFeature keyFeature = genFeature.getMapEntryTypeGenClass().getMapEntryKeyFeature(); GenFeature valueFeature = genFeature.getMapEntryTypeGenClass().getMapEntryValueFeature(); %>
+ * The key is of type <%if (keyFeature.isListType()) {%>list of {@link <%=keyFeature.getQualifiedListItemType(genClass)%>}<%} else {%>{@link <%=keyFeature.getType(genClass)%>}<%}%>,
+ * and the value is of type <%if (valueFeature.isListType()) {%>list of {@link <%=valueFeature.getQualifiedListItemType(genClass)%>}<%} else {%>{@link <%=valueFeature.getType(genClass)%>}<%}%>,
+ <%} else if (!genFeature.isWrappedFeatureMapType() && !(genModel.isSuppressEMFMetaData() && "org.eclipse.emf.ecore.EObject".equals(genFeature.getQualifiedListItemType(genClass)))) {
+String typeName = genFeature.getQualifiedListItemType(genClass); String head = typeName; String tail = ""; int index = typeName.indexOf('<'); if (index == -1) { index = typeName.indexOf('['); }
+if (index != -1) { head = typeName.substring(0, index); tail = typeName.substring(index).replaceAll("<", "&lt;"); }
+%>
+ * The list contents are of type {@link <%=head%>}<%=tail%>.
+ <%}%>
+ <%} else if (genFeature.isSetDefaultValue()) {%>
+ * The default value is <code><%=genFeature.getDefaultValue()%></code>.
+ <%}%>
+ <%if (genFeature.getTypeGenEnum() != null) {%>
+ * The literals are from the enumeration {@link <%=genFeature.getTypeGenEnum().getQualifiedName()%>}.
+ <%}%>
+ <%if (genFeature.isBidirectional() && !genFeature.getReverse().getGenClass().isMapEntry()) { GenFeature reverseGenFeature = genFeature.getReverse(); %>
+ <%if (!reverseGenFeature.isSuppressedGetVisibility()) {%>
+ * It is bidirectional and its opposite is '{@link <%=reverseGenFeature.getGenClass().getQualifiedInterfaceName()%>#<%=reverseGenFeature.getGetAccessor()%> <em><%=reverseGenFeature.getFormattedName()%></em>}'.
+ <%}%>
+ <%}%>
+<%@ include file="Class/getGenFeature.javadoc.insert.javajetinc" fail="silent" %>
+ * <!-- begin-user-doc -->
+ <%if (!genFeature.hasDocumentation()) {%>
+ * <p>
+ * If the meaning of the '<em><%=genFeature.getFormattedName()%></em>' <%=genFeature.getFeatureKind()%> isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ <%}%>
+ * <!-- end-user-doc -->
+ <%if (genFeature.hasDocumentation()) {%>
+ * <!-- begin-model-doc -->
+ * <%=genFeature.getDocumentation(genModel.getIndentation(stringBuffer))%>
+ * <!-- end-model-doc -->
+ <%}%>
+ * @return the value of the '<em><%=genFeature.getFormattedName()%></em>' <%=genFeature.getFeatureKind()%>.
+ <%if (genFeature.getTypeGenEnum() != null) {%>
+ * @see <%=genFeature.getTypeGenEnum().getQualifiedName()%>
+ <%}%>
+ <%if (genFeature.isUnsettable()) {%>
+ <%if (!genFeature.isSuppressedIsSetVisibility()) {%>
+ * @see #isSet<%=genFeature.getAccessorName()%>()
+ <%}%>
+ <%if (genFeature.isChangeable() && !genFeature.isSuppressedUnsetVisibility()) {%>
+ * @see #unset<%=genFeature.getAccessorName()%>()
+ <%}%>
+ <%}%>
+ <%if (genFeature.isChangeable() && !genFeature.isListType() && !genFeature.isSuppressedSetVisibility()) {%>
+ * @see #set<%=genFeature.getAccessorName()%>(<%=genFeature.getRawImportedBoundType()%>)
+ <%}%>
+ <%if (!genModel.isSuppressEMFMetaData()) {%>
+ * @see <%=genPackage.getQualifiedPackageInterfaceName()%>#get<%=genFeature.getFeatureAccessorName()%>()
+ <%}%>
+ <%if (genFeature.isBidirectional() && !genFeature.getReverse().getGenClass().isMapEntry()) { GenFeature reverseGenFeature = genFeature.getReverse(); %>
+ <%if (!reverseGenFeature.isSuppressedGetVisibility()) {%>
+ * @see <%=reverseGenFeature.getGenClass().getQualifiedInterfaceName()%>#<%=reverseGenFeature.getGetAccessor()%>
+ <%}%>
+ <%}%>
+ <%if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genFeature.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;%>
+ * @model <%=modelInfo%>
+ <%} else {%>
+ * <%=modelInfo%>
+ <%}} if (first) {%>
+ * @model
+ <%}}%>
+ * @generated
+ */
+<%@ end %><%//Class/getGenFeature.javadoc.override.javajetinc%>
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) { //Class/getGenFeature.annotations.insert.javajetinc%>
+<%@ include file="Class/getGenFeature.annotations.insert.javajetinc" fail="silent" %>
+<%}%>
+<%}%>
+<%if (!isImplementation) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getGetAccessor()%>();
+
+<%} else {%>
+ <%if (genModel.useGenerics() && ((genFeature.isContainer() || genFeature.isResolveProxies()) && !genFeature.isListType() && !genModel.isReflectiveDelegation() && genFeature.isUncheckedCast() || genFeature.isListType() && (genModel.isReflectiveDelegation() || genModel.isVirtualDelegation()) || genFeature.isListDataType() && genFeature.hasDelegateFeature())) {%>
+ @SuppressWarnings("unchecked")
+ <%}%>
+ public <%=genFeature.getImportedType(genClass)%> <%=genFeature.getGetAccessor()%>()
+ {
+<%@ include file="Class/getGenFeature.pre.insert.javajetinc" fail="silent" %>
+ <%if (genModel.isReflectiveDelegation()) {%>
+ return <%if (genFeature.isPrimitiveType()) {%>(<%}%>(<%=genFeature.getObjectType(genClass)%>)eGet(<%=genFeature.getQualifiedFeatureAccessor()%>, true)<%if (genFeature.isPrimitiveType()) {%>).<%=genFeature.getPrimitiveValueFunction()%>()<%}%>;
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genFeature.isListType()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType(genClass)%>)eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>);
+ <%}%>
+ if (<%=genFeature.getSafeName()%> == null)
+ {
+ <%if (genModel.isVirtualDelegation()) {%>
+ eVirtualSet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, <%=genFeature.getSafeName()%> = new <%=genClass.getListConstructor(genFeature)%>);
+ <%} else {%>
+ <%=genFeature.getSafeName()%> = new <%=genClass.getListConstructor(genFeature)%>;
+ <%}%>
+ }
+ return <%=genFeature.getSafeName()%><%=genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes() ? ".map()" : ""%>;
+ <%} else if (genFeature.isContainer()) {%>
+ if (eContainerFeatureID != <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>) return null;
+ return (<%=genFeature.getImportedType(genClass)%>)eContainer();
+ <%} else {%>
+ <%if (genFeature.isResolveProxies()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType(genClass)%>)eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%><%if (genFeature.hasEDefault()) {%>, <%=genFeature.getEDefault()%><%}%>);
+ <%}%>
+ if (<%=genFeature.getSafeName()%> != null && <%=genFeature.getSafeNameAsEObject()%>.eIsProxy())
+ {
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%> old<%=genFeature.getCapName()%> = (<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>;
+ <%=genFeature.getSafeName()%> = <%=genFeature.getNonEObjectInternalTypeCast(genClass)%>eResolveProxy(old<%=genFeature.getCapName()%>);
+ if (<%=genFeature.getSafeName()%> != old<%=genFeature.getCapName()%>)
+ {
+ <%if (genFeature.isEffectiveContains()) {%>
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%> new<%=genFeature.getCapName()%> = (<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>;
+ <%if (!genFeature.isBidirectional()) {%>
+ <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> msgs = old<%=genFeature.getCapName()%>.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - <%=genClass.getQualifiedFeatureID(genFeature)%><%=negativeOffsetCorrection%>, null, null);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass(); String reverseOffsetCorrection = targetClass.hasOffsetCorrection() ? " + " + genClass.getOffsetCorrectionField(reverseFeature) : "";%>
+ <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> msgs = old<%=genFeature.getCapName()%>.eInverseRemove(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%><%=reverseOffsetCorrection%>, <%=targetClass.getImportedInterfaceName()%>.class, null);
+ <%}%>
+ if (new<%=genFeature.getCapName()%>.eInternalContainer() == null)
+ {
+ <%if (!genFeature.isBidirectional()) {%>
+ msgs = new<%=genFeature.getCapName()%>.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - <%=genClass.getQualifiedFeatureID(genFeature)%><%=negativeOffsetCorrection%>, null, msgs);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass(); String reverseOffsetCorrection = targetClass.hasOffsetCorrection() ? " + " + genClass.getOffsetCorrectionField(reverseFeature) : "";%>
+ msgs = new<%=genFeature.getCapName()%>.eInverseAdd(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%><%=reverseOffsetCorrection%>, <%=targetClass.getImportedInterfaceName()%>.class, msgs);
+ <%}%>
+ }
+ if (msgs != null) msgs.dispatch();
+ <%} else if (genModel.isVirtualDelegation()) {%>
+ eVirtualSet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, <%=genFeature.getSafeName()%>);
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (eNotificationRequired())
+ eNotify(new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%>(this, <%=genModel.getImportedName("org.eclipse.emf.common.notify.Notification")%>.RESOLVE, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, old<%=genFeature.getCapName()%>, <%=genFeature.getSafeName()%>));
+ <%}%>
+ }
+ }
+ <%}%>
+ <%if (!genFeature.isResolveProxies() && genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ return (<%=genFeature.getImportedType(genClass)%>)eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%><%if (genFeature.hasEDefault()) {%>, <%=genFeature.getEDefault()%><%}%>);
+ <%} else if (genClass.isFlag(genFeature)) {%>
+ return (<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0;
+ <%} else {%>
+ return <%=genFeature.getSafeName()%>;
+ <%}%>
+ <%}%>
+ <%} else {//volatile%>
+ <%if (genFeature.isResolveProxies() && !genFeature.isListType()) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = basicGet<%=genFeature.getAccessorName()%>();
+ return <%=genFeature.getSafeName()%> != null && <%=genFeature.getSafeNameAsEObject()%>.eIsProxy() ? <%=genFeature.getNonEObjectInternalTypeCast(genClass)%>eResolveProxy((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>) : <%=genFeature.getSafeName()%>;
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();%>
+ <%if (genFeature.isFeatureMapType()) {%>
+ <%String featureMapEntryTemplateArgument = genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50 ? "<" + genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap") + ".Entry>" : "";%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return new <%=genFeature.getImportedEffectiveFeatureMapWrapperClass()%>((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal.Wrapper)get<%=delegateFeature.getAccessorName()%>()).featureMap().<%=featureMapEntryTemplateArgument%>list(<%=genFeature.getQualifiedFeatureAccessor()%>));
+ <%} else {%>
+ return (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>)get<%=delegateFeature.getAccessorName()%>().<%=featureMapEntryTemplateArgument%>list(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%}%>
+ <%} else if (genFeature.isListType()) {%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal.Wrapper)get<%=delegateFeature.getAccessorName()%>()).featureMap().list(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%} else {%>
+ return get<%=delegateFeature.getAccessorName()%>().list(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%}%>
+ <%} else {%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return <%if (genFeature.isPrimitiveType()) {%>(<%}%><%if (genFeature.getTypeGenDataType() == null || !genFeature.getTypeGenDataType().isObjectType()) {%>(<%=genFeature.getObjectType(genClass)%>)<%}%>((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal.Wrapper)get<%=delegateFeature.getAccessorName()%>()).featureMap().get(<%=genFeature.getQualifiedFeatureAccessor()%>, true)<%if (genFeature.isPrimitiveType()) {%>).<%=genFeature.getPrimitiveValueFunction()%>()<%}%>;
+ <%} else {%>
+ return <%if (genFeature.isPrimitiveType()) {%>(<%}%><%if (genFeature.getTypeGenDataType() == null || !genFeature.getTypeGenDataType().isObjectType()) {%>(<%=genFeature.getObjectType(genClass)%>)<%}%>get<%=delegateFeature.getAccessorName()%>().get(<%=genFeature.getQualifiedFeatureAccessor()%>, true)<%if (genFeature.isPrimitiveType()) {%>).<%=genFeature.getPrimitiveValueFunction()%>()<%}%>;
+ <%}%>
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/getGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to return the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // Ensure that you remove @generated or mark it @generated NOT
+ <%if (genFeature.isListType()) {%>
+ // The list is expected to implement org.eclipse.emf.ecore.util.InternalEList and org.eclipse.emf.ecore.EStructuralFeature.Setting
+ // so it's likely that an appropriate subclass of org.eclipse.emf.ecore.util.<%if (genFeature.isMapType()) {%>EcoreEMap<%} else if (genFeature.isFeatureMapType()) {%>BasicFeatureMap<%} else {%>EcoreEList<%}%> should be used.
+ <%}%>
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/getGenFeature.todo.override.javajetinc%>
+ <%}%>
+ <%}%>
+ }
+
+<%}%>
+<%@ end %><%//Class/getGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicGet()) {%>
+<%@ include file="Class/basicGetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) { //Class/basicGetGenFeature.annotations.insert.javajetinc%>
+<%@ include file="Class/basicGetGenFeature.annotations.insert.javajetinc" fail="silent" %>
+<%}%>
+ public <%=genFeature.getImportedType(genClass)%> basicGet<%=genFeature.getAccessorName()%>()
+ {
+<%@ include file="Class/basicGetGenFeature.pre.insert.javajetinc" fail="silent" %>
+ <%if (genFeature.isContainer()) {%>
+ if (eContainerFeatureID != <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>) return null;
+ return (<%=genFeature.getImportedType(genClass)%>)eInternalContainer();
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ return (<%=genFeature.getImportedType(genClass)%>)eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>);
+ <%} else {%>
+ return <%=genFeature.getSafeName()%>;
+ <%}%>
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return (<%=genFeature.getImportedType(genClass)%>)((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal.Wrapper)get<%=delegateFeature.getAccessorName()%>()).featureMap().get(<%=genFeature.getQualifiedFeatureAccessor()%>, false);
+ <%} else {%>
+ return (<%=genFeature.getImportedType(genClass)%>)get<%=delegateFeature.getAccessorName()%>().get(<%=genFeature.getQualifiedFeatureAccessor()%>, false);
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/basicGetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to return the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // -> do not perform proxy resolution
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/basicGetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%@ end %><%//Class/basicGetGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicSet()) {%>
+<%@ include file="Class/basicSetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) { //Class/basicSetGenFeature.annotations.insert.javajetinc%>
+<%@ include file="Class/basicSetGenFeature.annotations.insert.javajetinc" fail="silent" %>
+<%}%>
+ public <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> basicSet<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedInternalType(genClass)%> new<%=genFeature.getCapName()%>, <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> msgs)
+ {
+ <%if (genFeature.isContainer()) {%>
+<%@ include file="Class/basicSetGenFeature.pre.insert.javajetinc" fail="silent" %>
+ msgs = eBasicSetContainer((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)new<%=genFeature.getCapName()%>, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, msgs);
+<%@ include file="Class/basicSetGenFeature.post.insert.javajetinc" fail="silent" %>
+ return msgs;
+ <%} else if (!genFeature.isVolatile()) {%>
+<%@ include file="Class/basicSetGenFeature.pre.insert.javajetinc" fail="silent" %>
+ <%if (genModel.isVirtualDelegation()) {%>
+ Object old<%=genFeature.getCapName()%> = eVirtualSet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, new<%=genFeature.getCapName()%>);
+ <%} else {%>
+ <%=genFeature.getImportedType(genClass)%> old<%=genFeature.getCapName()%> = <%=genFeature.getSafeName()%>;
+ <%=genFeature.getSafeName()%> = new<%=genFeature.getCapName()%>;
+ <%}%>
+ <%if (genFeature.isUnsettable()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ boolean isSetChange = old<%=genFeature.getCapName()%> == EVIRTUAL_NO_VALUE;
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ boolean old<%=genFeature.getCapName()%>ESet = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%=genClass.getESetFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ boolean old<%=genFeature.getCapName()%>ESet = <%=genFeature.getUncapName()%>ESet;
+ <%=genFeature.getUncapName()%>ESet = true;
+ <%}%>
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (eNotificationRequired())
+ {
+ <%if (genFeature.isUnsettable()) {%>
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%> notification = new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%>(this, <%=genModel.getImportedName("org.eclipse.emf.common.notify.Notification")%>.SET, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, <%if (genModel.isVirtualDelegation()) {%>isSetChange ? null : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, new<%=genFeature.getCapName()%>, <%if (genModel.isVirtualDelegation()) {%>isSetChange<%} else {%>!old<%=genFeature.getCapName()%>ESet<%}%>);
+ <%} else {%>
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%> notification = new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%>(this, <%=genModel.getImportedName("org.eclipse.emf.common.notify.Notification")%>.SET, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, <%if (genModel.isVirtualDelegation()) {%>old<%=genFeature.getCapName()%> == EVIRTUAL_NO_VALUE ? null : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, new<%=genFeature.getCapName()%>);
+ <%}%>
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ <%}%>
+<%@ include file="Class/basicSetGenFeature.post.insert.javajetinc" fail="silent" %>
+ return msgs;
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal.Wrapper)get<%=delegateFeature.getAccessorName()%>()).featureMap()).basicAdd(<%=genFeature.getQualifiedFeatureAccessor()%>, new<%=genFeature.getCapName()%>, msgs);
+ <%} else {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)get<%=delegateFeature.getAccessorName()%>()).basicAdd(<%=genFeature.getQualifiedFeatureAccessor()%>, new<%=genFeature.getCapName()%>, msgs);
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/basicSetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to set the contained '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // -> this method is automatically invoked to keep the containment relationship in synch
+ // -> do not modify other features
+ // -> return msgs, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first)
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/basicSetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%@ end %><%//Class/basicSetGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (genFeature.isSet() && (isImplementation || !genFeature.isSuppressedSetVisibility())) {%>
+<%@ include file="Class/setGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) { %>
+<%@ include file="Class/setGenFeature.javadoc.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * Sets the value of the '{@link <%=genClass.getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+<%@ include file="Class/setGenFeature.javadoc.insert.javajetinc" fail="silent" %>
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em><%=genFeature.getFormattedName()%></em>' <%=genFeature.getFeatureKind()%>.
+ <%if (genFeature.isEnumType()) {%>
+ * @see <%=genFeature.getTypeGenEnum().getQualifiedName()%>
+ <%}%>
+ <%if (genFeature.isUnsettable()) {%>
+ <%if (!genFeature.isSuppressedIsSetVisibility()) {%>
+ * @see #isSet<%=genFeature.getAccessorName()%>()
+ <%}%>
+ <%if (!genFeature.isSuppressedUnsetVisibility()) {%>
+ * @see #unset<%=genFeature.getAccessorName()%>()
+ <%}%>
+ <%}%>
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ */
+<%@ end %><%//Class/setGenFeature.javadoc.override.javajetinc%>
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) { //Class/setGenFeature.annotations.insert.javajetinc%>
+<%@ include file="Class/setGenFeature.annotations.insert.javajetinc" fail="silent" %>
+<%}%>
+<%}%>
+<%if (!isImplementation) { %>
+ void set<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedType(genClass)%> value);
+
+<%} else {%>
+ public void set<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedType(genClass)%> new<%=genFeature.getCapName()%>)
+ {
+<%@ include file="Class/setGenFeature.pre.insert.javajetinc" fail="silent" %>
+ <%if (genModel.isReflectiveDelegation()) {%>
+ eSet(<%=genFeature.getQualifiedFeatureAccessor()%>, <%if (genFeature.isPrimitiveType()) {%>new <%=genFeature.getObjectType(genClass)%>(<%}%>new<%=genFeature.getCapName()%><%if (genFeature.isPrimitiveType()) {%>)<%}%>);
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genFeature.isContainer()) { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass(); String reverseOffsetCorrection = targetClass.hasOffsetCorrection() ? " + " + genClass.getOffsetCorrectionField(reverseFeature) : "";%>
+ if (new<%=genFeature.getCapName()%> != eInternalContainer() || (eContainerFeatureID != <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%> && new<%=genFeature.getCapName()%> != null))
+ {
+ if (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.EcoreUtil")%>.isAncestor(this, <%=genFeature.getEObjectCast()%>new<%=genFeature.getCapName()%>))
+ throw new <%=genModel.getImportedName("java.lang.IllegalArgumentException")%>("Recursive containment not allowed for " + toString());<%=genModel.getNonNLS()%>
+ <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> msgs = null;
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ if (new<%=genFeature.getCapName()%> != null)
+ msgs = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)new<%=genFeature.getCapName()%>).eInverseAdd(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%><%=reverseOffsetCorrection%>, <%=targetClass.getImportedInterfaceName()%>.class, msgs);
+ msgs = basicSet<%=genFeature.getAccessorName()%>(<%=genFeature.getInternalTypeCast()%>new<%=genFeature.getCapName()%>, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ <%if (!genModel.isSuppressNotification()) {%>
+ else if (eNotificationRequired())
+ eNotify(new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%>(this, <%=genModel.getImportedName("org.eclipse.emf.common.notify.Notification")%>.SET, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, new<%=genFeature.getCapName()%>, new<%=genFeature.getCapName()%>));
+ <%}%>
+ <%} else if (genFeature.isBidirectional() || genFeature.isEffectiveContains()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType(genClass)%>)eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>);
+ <%}%>
+ if (new<%=genFeature.getCapName()%> != <%=genFeature.getSafeName()%>)
+ {
+ <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> msgs = null;
+ if (<%=genFeature.getSafeName()%> != null)
+ <%if (!genFeature.isBidirectional()) {%>
+ msgs = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - <%=genClass.getQualifiedFeatureID(genFeature)%><%=negativeOffsetCorrection%>, null, msgs);
+ if (new<%=genFeature.getCapName()%> != null)
+ msgs = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)new<%=genFeature.getCapName()%>).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - <%=genClass.getQualifiedFeatureID(genFeature)%><%=negativeOffsetCorrection%>, null, msgs);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass(); String reverseOffsetCorrection = targetClass.hasOffsetCorrection() ? " + " + genClass.getOffsetCorrectionField(reverseFeature) : "";%>
+ msgs = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>).eInverseRemove(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%><%=reverseOffsetCorrection%>, <%=targetClass.getImportedInterfaceName()%>.class, msgs);
+ if (new<%=genFeature.getCapName()%> != null)
+ msgs = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)new<%=genFeature.getCapName()%>).eInverseAdd(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%><%=reverseOffsetCorrection%>, <%=targetClass.getImportedInterfaceName()%>.class, msgs);
+ <%}%>
+ msgs = basicSet<%=genFeature.getAccessorName()%>(<%=genFeature.getInternalTypeCast()%>new<%=genFeature.getCapName()%>, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ <%if (genFeature.isUnsettable()) {%>
+ else
+ {
+ <%if (genModel.isVirtualDelegation()) {%>
+ boolean old<%=genFeature.getCapName()%>ESet = eVirtualIsSet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>);
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>ESet = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%}%>
+ <%=genClass.getESetFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>ESet = <%=genFeature.getUncapName()%>ESet;
+ <%}%>
+ <%=genFeature.getUncapName()%>ESet = true;
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (eNotificationRequired())
+ eNotify(new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%>(this, <%=genModel.getImportedName("org.eclipse.emf.common.notify.Notification")%>.SET, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, new<%=genFeature.getCapName()%>, new<%=genFeature.getCapName()%>, !old<%=genFeature.getCapName()%>ESet));
+ <%}%>
+ }
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ else if (eNotificationRequired())
+ eNotify(new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%>(this, <%=genModel.getImportedName("org.eclipse.emf.common.notify.Notification")%>.SET, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, new<%=genFeature.getCapName()%>, new<%=genFeature.getCapName()%>));
+ <%}%>
+ <%}%>
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ <%=genFeature.getImportedType(genClass)%> old<%=genFeature.getCapName()%> = (<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0;
+ <%}%>
+ if (new<%=genFeature.getCapName()%>) <%=genClass.getFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_EFLAG; else <%=genClass.getFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_EFLAG;
+ <%} else {%>
+ <%if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ <%=genFeature.getImportedType(genClass)%> old<%=genFeature.getCapName()%> = <%=genFeature.getSafeName()%>;
+ <%}%>
+ <%}%>
+ <%if (genFeature.isEnumType()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = new<%=genFeature.getCapName()%> == null ? <%=genFeature.getEDefault()%> : new<%=genFeature.getCapName()%>;
+ <%} else {%>
+ <%=genFeature.getSafeName()%> = new<%=genFeature.getCapName()%> == null ? <%=genFeature.getEDefault()%> : new<%=genFeature.getCapName()%>;
+ <%}%>
+ <%} else {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = <%=genFeature.getInternalTypeCast()%>new<%=genFeature.getCapName()%>;
+ <%} else {%>
+ <%=genFeature.getSafeName()%> = <%=genFeature.getInternalTypeCast()%>new<%=genFeature.getCapName()%>;
+ <%}%>
+ <%}%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ Object old<%=genFeature.getCapName()%> = eVirtualSet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, <%=genFeature.getSafeName()%>);
+ <%}%>
+ <%}%>
+ <%if (genFeature.isUnsettable()) {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ boolean isSetChange = old<%=genFeature.getCapName()%> == EVIRTUAL_NO_VALUE;
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>ESet = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%}%>
+ <%=genClass.getESetFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>ESet = <%=genFeature.getUncapName()%>ESet;
+ <%}%>
+ <%=genFeature.getUncapName()%>ESet = true;
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (eNotificationRequired())
+ eNotify(new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%>(this, <%=genModel.getImportedName("org.eclipse.emf.common.notify.Notification")%>.SET, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>isSetChange ? <%=genFeature.getEDefault()%> : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, <%if (genClass.isFlag(genFeature)) {%>new<%=genFeature.getCapName()%><%} else {%><%=genFeature.getSafeName()%><%}%>, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>isSetChange<%} else {%>!old<%=genFeature.getCapName()%>ESet<%}%>));
+ <%}%>
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (eNotificationRequired())
+ eNotify(new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%>(this, <%=genModel.getImportedName("org.eclipse.emf.common.notify.Notification")%>.SET, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>old<%=genFeature.getCapName()%> == EVIRTUAL_NO_VALUE ? <%=genFeature.getEDefault()%> : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, <%if (genClass.isFlag(genFeature)) {%>new<%=genFeature.getCapName()%><%} else {%><%=genFeature.getSafeName()%><%}%>));
+ <%}%>
+ <%}%>
+ <%}%>
+<%@ include file="Class/setGenFeature.post.insert.javajetinc" fail="silent" %>
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal.Wrapper)get<%=delegateFeature.getAccessorName()%>()).featureMap()).set(<%=genFeature.getQualifiedFeatureAccessor()%>, <%if (genFeature.isPrimitiveType()) {%>new <%=genFeature.getObjectType(genClass)%>(<%}%>new<%=genFeature.getCapName()%><%if (genFeature.isPrimitiveType()) {%>)<%}%>);
+ <%} else {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)get<%=delegateFeature.getAccessorName()%>()).set(<%=genFeature.getQualifiedFeatureAccessor()%>, <%if (genFeature.isPrimitiveType()) {%>new <%=genFeature.getObjectType(genClass)%>(<%}%>new<%=genFeature.getCapName()%><%if (genFeature.isPrimitiveType()) {%>)<%}%>);
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/setGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to set the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/setGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%}%>
+<%@ end %><%//Class/setGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicUnset()) {%>
+<%@ include file="Class/basicUnsetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) { //Class/basicUnsetGenFeature.annotations.insert.javajetinc%>
+<%@ include file="Class/basicUnsetGenFeature.annotations.insert.javajetinc" fail="silent" %>
+<%}%>
+ public <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> basicUnset<%=genFeature.getAccessorName()%>(<%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> msgs)
+ {
+ <%if (!genFeature.isVolatile()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ Object old<%=genFeature.getCapName()%> = eVirtualUnset(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>);
+ <%} else {%>
+ <%=genFeature.getImportedType(genClass)%> old<%=genFeature.getCapName()%> = <%=genFeature.getSafeName()%>;
+ <%=genFeature.getSafeName()%> = null;
+ <%}%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ boolean isSetChange = old<%=genFeature.getCapName()%> != EVIRTUAL_NO_VALUE;
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ boolean old<%=genFeature.getCapName()%>ESet = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%=genClass.getESetFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ boolean old<%=genFeature.getCapName()%>ESet = <%=genFeature.getUncapName()%>ESet;
+ <%=genFeature.getUncapName()%>ESet = false;
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (eNotificationRequired())
+ {
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%> notification = new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%>(this, <%=genModel.getImportedName("org.eclipse.emf.common.notify.Notification")%>.UNSET, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, <%if (genModel.isVirtualDelegation()) {%>isSetChange ? old<%=genFeature.getCapName()%> : null<%} else {%>old<%=genFeature.getCapName()%><%}%>, null, <%if (genModel.isVirtualDelegation()) {%>isSetChange<%} else {%>old<%=genFeature.getCapName()%>ESet<%}%>);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/basicUnsetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to unset the contained '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // -> this method is automatically invoked to keep the containment relationship in synch
+ // -> do not modify other features
+ // -> return msgs, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first)
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/basicUnsetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%@ end %><%//Class.basicUnsetGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (genFeature.isUnset() && (isImplementation || !genFeature.isSuppressedUnsetVisibility())) {%>
+<%@ include file="Class/unsetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) {%>
+<%@ include file="Class/unsetGenFeature.javadoc.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * Unsets the value of the '{@link <%=genClass.getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+<%@ include file="Class/unsetGenFeature.javadoc.insert.javajetinc" fail="silent" %>
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ <%if (!genFeature.isSuppressedIsSetVisibility()) {%>
+ * @see #isSet<%=genFeature.getAccessorName()%>()
+ <%}%>
+ * @see #<%=genFeature.getGetAccessor()%>()
+ <%if (!genFeature.isListType() && !genFeature.isSuppressedSetVisibility()) {%>
+ * @see #set<%=genFeature.getAccessorName()%>(<%=genFeature.getRawImportedBoundType()%>)
+ <%}%>
+ * @generated
+ */
+<%@ end %><%//Class/unsetGenFeature.javadoc.override.javajetinc%>
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) { //Class/unsetGenFeature.annotations.insert.javajetinc%>
+<%@ include file="Class/unsetGenFeature.annotations.insert.javajetinc" fail="silent" %>
+<%}%>
+<%}%>
+<%if (!isImplementation) {%>
+ void unset<%=genFeature.getAccessorName()%>();
+
+<%} else {%>
+ public void unset<%=genFeature.getAccessorName()%>()
+ {
+ <%if (genModel.isReflectiveDelegation()) {%>
+ eUnset(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genFeature.isListType()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType(genClass)%>)eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>);
+ <%}%>
+ if (<%=genFeature.getSafeName()%> != null) ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%>.Unsettable<%=singleWildcard%>)<%=genFeature.getSafeName()%>).unset();
+ <%} else if (genFeature.isBidirectional() || genFeature.isEffectiveContains()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType(genClass)%>)eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>);
+ <%}%>
+ if (<%=genFeature.getSafeName()%> != null)
+ {
+ <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> msgs = null;
+ <%if (!genFeature.isBidirectional()) {%>
+ msgs = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - <%=genClass.getQualifiedFeatureID(genFeature)%><%=negativeOffsetCorrection%>, null, msgs);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass(); String reverseOffsetCorrection = targetClass.hasOffsetCorrection() ? " + " + genClass.getOffsetCorrectionField(reverseFeature) : "";%>
+ msgs = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>).eInverseRemove(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%><%=reverseOffsetCorrection%>, <%=targetClass.getImportedInterfaceName()%>.class, msgs);
+ <%}%>
+ msgs = basicUnset<%=genFeature.getAccessorName()%>(msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else
+ {
+ <%if (genModel.isVirtualDelegation()) {%>
+ boolean old<%=genFeature.getCapName()%>ESet = eVirtualIsSet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>);
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>ESet = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%}%>
+ <%=genClass.getESetFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>ESet = <%=genFeature.getUncapName()%>ESet;
+ <%}%>
+ <%=genFeature.getUncapName()%>ESet = false;
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (eNotificationRequired())
+ eNotify(new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%>(this, <%=genModel.getImportedName("org.eclipse.emf.common.notify.Notification")%>.UNSET, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, null, null, old<%=genFeature.getCapName()%>ESet));
+ <%}%>
+ }
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ <%=genFeature.getImportedType(genClass)%> old<%=genFeature.getCapName()%> = (<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0;
+ <%}%>
+ <%} else if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ Object old<%=genFeature.getCapName()%> = eVirtualUnset(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>);
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ <%=genFeature.getImportedType(genClass)%> old<%=genFeature.getCapName()%> = <%=genFeature.getSafeName()%>;
+ <%}%>
+ <%}%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ boolean isSetChange = old<%=genFeature.getCapName()%> != EVIRTUAL_NO_VALUE;
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ boolean old<%=genFeature.getCapName()%>ESet = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>ESet = <%=genFeature.getUncapName()%>ESet;
+ <%}%>
+ <%}%>
+ <%if (genFeature.isReferenceType()) {%>
+ <%=genFeature.getSafeName()%> = null;
+ <%if (!genModel.isVirtualDelegation()) {%>
+ <%if (genClass.isESetFlag(genFeature)) {%>
+ <%=genClass.getESetFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%=genFeature.getUncapName()%>ESet = false;
+ <%}%>
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (eNotificationRequired())
+ eNotify(new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%>(this, <%=genModel.getImportedName("org.eclipse.emf.common.notify.Notification")%>.UNSET, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, <%if (genModel.isVirtualDelegation()) {%>isSetChange ? old<%=genFeature.getCapName()%> : null<%} else {%>old<%=genFeature.getCapName()%><%}%>, null, <%if (genModel.isVirtualDelegation()) {%>isSetChange<%} else {%>old<%=genFeature.getCapName()%>ESet<%}%>));
+ <%}%>
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ if (<%=genFeature.getEDefault()%>) <%=genClass.getFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_EFLAG; else <%=genClass.getFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_EFLAG;
+ <%} else if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {%>
+ <%=genFeature.getSafeName()%> = <%=genFeature.getEDefault()%>;
+ <%}%>
+ <%if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {%>
+ <%if (genClass.isESetFlag(genFeature)) {%>
+ <%=genClass.getESetFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%=genFeature.getUncapName()%>ESet = false;
+ <%}%>
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (eNotificationRequired())
+ eNotify(new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%>(this, <%=genModel.getImportedName("org.eclipse.emf.common.notify.Notification")%>.UNSET, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>isSetChange ? old<%=genFeature.getCapName()%> : <%=genFeature.getEDefault()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, <%=genFeature.getEDefault()%>, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>isSetChange<%} else {%>old<%=genFeature.getCapName()%>ESet<%}%>));
+ <%}%>
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal.Wrapper)get<%=delegateFeature.getAccessorName()%>()).featureMap()).clear(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%} else {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)get<%=delegateFeature.getAccessorName()%>()).clear(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/unsetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to unset the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/unsetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%}%>
+<%@ end %><%//Class/unsetGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (genFeature.isIsSet() && (isImplementation || !genFeature.isSuppressedIsSetVisibility())) {%>
+<%@ include file="Class/isSetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) {%>
+<%@ include file="Class/isSetGenFeature.javadoc.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * Returns whether the value of the '{@link <%=genClass.getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%> is set.
+<%@ include file="Class/isSetGenFeature.javadoc.insert.javajetinc" fail="silent" %>
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em><%=genFeature.getFormattedName()%></em>' <%=genFeature.getFeatureKind()%> is set.
+ <%if (genFeature.isChangeable() && !genFeature.isSuppressedUnsetVisibility()) {%>
+ * @see #unset<%=genFeature.getAccessorName()%>()
+ <%}%>
+ * @see #<%=genFeature.getGetAccessor()%>()
+ <%if (!genFeature.isListType() && genFeature.isChangeable() && !genFeature.isSuppressedSetVisibility()) {%>
+ * @see #set<%=genFeature.getAccessorName()%>(<%=genFeature.getRawImportedBoundType()%>)
+ <%}%>
+ * @generated
+ */
+<%@ end %><%//Class/isSetGenFeature.javadoc.override.javajetinc%>
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) { //Class/isSetGenFeature.annotations.insert.javajetinc%>
+<%@ include file="Class/isSetGenFeature.annotations.insert.javajetinc" fail="silent" %>
+<%}%>
+<%}%>
+<%if (!isImplementation) {%>
+ boolean isSet<%=genFeature.getAccessorName()%>();
+
+<%} else {%>
+ public boolean isSet<%=genFeature.getAccessorName()%>()
+ {
+ <%if (genModel.isReflectiveDelegation()) {%>
+ return eIsSet(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genFeature.isListType()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType(genClass)%>)eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>);
+ <%}%>
+ return <%=genFeature.getSafeName()%> != null && ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%>.Unsettable<%=singleWildcard%>)<%=genFeature.getSafeName()%>).isSet();
+ <%} else {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ return eVirtualIsSet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>);
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ return (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%} else {%>
+ return <%=genFeature.getUncapName()%>ESet;
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return !((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal.Wrapper)get<%=delegateFeature.getAccessorName()%>()).featureMap()).isEmpty(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%} else {%>
+ return !((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)get<%=delegateFeature.getAccessorName()%>()).isEmpty(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/isSetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to return whether the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%> is set
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/isSetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%}%>
+<%@ end %><%//Class/isSetGenFeature.override.javajetinc%>
+ <%}%>
+<%@ include file="Class/genFeature.insert.javajetinc" fail="silent" %>
+<%@ end %><%//Class/genFeature.override.javajetinc%>
+<%}//for%>
+<%}}.run();%>
+<%for (GenOperation genOperation : (isImplementation ? genClass.getImplementedGenOperations() : genClass.getDeclaredGenOperations())) {%>
+<%@ include file="Class/genOperation.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) {%>
+<%@ include file="Class/genOperation.javadoc.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+<%@ include file="Class/genOperation.javadoc.insert.javajetinc" fail="silent" %>
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ <%if (genOperation.hasDocumentation() || genOperation.hasParameterDocumentation()) {%>
+ * <!-- begin-model-doc -->
+ <%if (genOperation.hasDocumentation()) {%>
+ * <%=genOperation.getDocumentation(genModel.getIndentation(stringBuffer))%>
+ <%}%>
+ <%for (GenParameter genParameter : genOperation.getGenParameters()) {%>
+ <%if (genParameter.hasDocumentation()) { String documentation = genParameter.getDocumentation("");%>
+ <%if (documentation.contains("\n") || documentation.contains("\r")) {%>
+ * @param <%=genParameter.getName()%>
+ * <%=genParameter.getDocumentation(genModel.getIndentation(stringBuffer))%>
+ <%} else {%>
+ * @param <%=genParameter.getName()%> <%=genParameter.getDocumentation(genModel.getIndentation(stringBuffer))%>
+ <%}%>
+ <%}%>
+ <%}%>
+ * <!-- end-model-doc -->
+ <%}%>
+ <%if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genOperation.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;%>
+ * @model <%=modelInfo%>
+ <%} else {%>
+ * <%=modelInfo%>
+ <%}} if (first) {%>
+ * @model
+ <%}}%>
+ * @generated
+ */
+<%@ end %><%//Class/genOperation.javadoc.override.javajetinc%>
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) { //Class/genOperation.annotations.insert.javajetinc%>
+<%@ include file="Class/genOperation.annotations.insert.javajetinc" fail="silent" %>
+<%}%>
+<%}%>
+<%if (!isImplementation) {%>
+ <%=genOperation.getTypeParameters(genClass)%><%=genOperation.getImportedType(genClass)%> <%=genOperation.getName()%>(<%=genOperation.getParameters(genClass)%>)<%=genOperation.getThrows(genClass)%>;
+
+<%} else {%>
+ public <%=genOperation.getTypeParameters(genClass)%><%=genOperation.getImportedType(genClass)%> <%=genOperation.getName()%>(<%=genOperation.getParameters(genClass)%>)<%=genOperation.getThrows(genClass)%>
+ {
+ <%if (genOperation.hasBody()) {%>
+ <%=genOperation.getBody(genModel.getIndentation(stringBuffer))%>
+ <%} else if (genOperation.isInvariant()) {GenClass opClass = genOperation.getGenClass(); String diagnostics = genOperation.getGenParameters().get(0).getName(); String context = genOperation.getGenParameters().get(1).getName();%>
+ // TODO: implement this method
+ // -> specify the condition that violates the invariant
+ // -> verify the details of the diagnostic, including severity and message
+ // Ensure that you remove @generated or mark it @generated NOT
+ if (false)
+ {
+ if (<%=diagnostics%> != null)
+ {
+ <%=diagnostics%>.add
+ (new <%=genModel.getImportedName("org.eclipse.emf.common.util.BasicDiagnostic")%>
+ (<%=genModel.getImportedName("org.eclipse.emf.common.util.Diagnostic")%>.ERROR,
+ <%=opClass.getGenPackage().getImportedValidatorClassName()%>.DIAGNOSTIC_SOURCE,
+ <%=opClass.getGenPackage().getImportedValidatorClassName()%>.<%=opClass.getOperationID(genOperation)%>,
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.plugin.EcorePlugin")%>.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "<%=genOperation.getName()%>", <%=genModel.getImportedName("org.eclipse.emf.ecore.util.EObjectValidator")%>.getObjectLabel(this, <%=context%>) }),<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
+ new Object [] { this }));
+ }
+ return false;
+ }
+ return true;
+ <%} else {%>
+<%@ include file="Class/implementedGenOperation.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/implementedGenOperation.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%}%>
+<%@ include file="Class/genOperation.insert.javajetinc" fail="silent" %>
+<%@ end %><%//Class/implementedGenOperation.override.javajetinc%>
+<%}//for%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEInverseAddGenFeatures())) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useGenerics()) {%>
+ <%for (GenFeature genFeature : genClass.getEInverseAddGenFeatures()) {%>
+ <%if (genFeature.isUncheckedCast()) {%>
+ @SuppressWarnings("unchecked")
+ <%break; }%>
+ <%}%>
+ <%}%>
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ public <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> eInverseAdd(<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%> otherEnd, int featureID, <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> msgs)
+ {
+ switch (featureID<%=negativeOffsetCorrection%>)
+ {
+<%for (GenFeature genFeature : genClass.getEInverseAddGenFeatures()) {%>
+ case <%=genClass.getQualifiedFeatureID(genFeature)%>:
+ <%if (genFeature.isListType()) { String cast = "(" + genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList") + (!genModel.useGenerics() ? ")" : "<" + genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject") + ">)(" + genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList") + "<?>)");%>
+ <%if (genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes()) {%>
+ return ((<%=cast%>(<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>.InternalMapView<%=genFeature.getImportedMapTemplateArguments(genClass)%>)<%=genFeature.getGetAccessor()%>()).eMap()).basicAdd(otherEnd, msgs);
+ <%} else {%>
+ return (<%=cast%><%=genFeature.getGetAccessor()%>()).basicAdd(otherEnd, msgs);
+ <%}%>
+ <%} else if (genFeature.isContainer()) {%>
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ <%if (genFeature.isBasicSet()) {%>
+ return basicSet<%=genFeature.getAccessorName()%>((<%=genFeature.getImportedType(genClass)%>)otherEnd, msgs);
+ <%} else {%>
+ return eBasicSetContainer(otherEnd, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, msgs);
+ <%}%>
+ <%} else {%>
+ <%if (genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType(genClass)%>)eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>);
+ <%} else if (genFeature.isVolatile()) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = <%if (genFeature.isResolveProxies()) {%>basicGet<%=genFeature.getAccessorName()%><%} else {%><%=genFeature.getGetAccessor()%><%}%>();
+ <%}%>
+ if (<%=genFeature.getSafeName()%> != null)
+ <%if (genFeature.isEffectiveContains()) {%>
+ msgs = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - <%=genClass.getQualifiedFeatureID(genFeature)%><%=negativeOffsetCorrection%>, null, msgs);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass(); String reverseOffsetCorrection = targetClass.hasOffsetCorrection() ? " + " + genClass.getOffsetCorrectionField(reverseFeature) : "";%>
+ msgs = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>).eInverseRemove(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%><%=reverseOffsetCorrection%>, <%=targetClass.getImportedInterfaceName()%>.class, msgs);
+ <%}%>
+ return basicSet<%=genFeature.getAccessorName()%>((<%=genFeature.getImportedType(genClass)%>)otherEnd, msgs);
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+<%} else {%>
+ return eDynamicInverseAdd(otherEnd, featureID, msgs);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEInverseRemoveGenFeatures())) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ public <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> eInverseRemove(<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%> otherEnd, int featureID, <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> msgs)
+ {
+ switch (featureID<%=negativeOffsetCorrection%>)
+ {
+<%for (GenFeature genFeature : genClass.getEInverseRemoveGenFeatures()) {%>
+ case <%=genClass.getQualifiedFeatureID(genFeature)%>:
+ <%if (genFeature.isListType()) {%>
+ <%if (genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes()) {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%><%=singleWildcard%>)((<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>.InternalMapView<%=genFeature.getImportedMapTemplateArguments(genClass)%>)<%=genFeature.getGetAccessor()%>()).eMap()).basicRemove(otherEnd, msgs);
+ <%} else if (genFeature.isWrappedFeatureMapType()) {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%><%=singleWildcard%>)((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal.Wrapper)<%=genFeature.getGetAccessor()%>()).featureMap()).basicRemove(otherEnd, msgs);
+ <%} else {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%><%=singleWildcard%>)<%=genFeature.getGetAccessor()%>()).basicRemove(otherEnd, msgs);
+ <%}%>
+ <%} else if (genFeature.isContainer() && !genFeature.isBasicSet()) {%>
+ return eBasicSetContainer(null, <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, msgs);
+ <%} else if (genFeature.isUnsettable()) {%>
+ return basicUnset<%=genFeature.getAccessorName()%>(msgs);
+ <%} else {%>
+ return basicSet<%=genFeature.getAccessorName()%>(null, msgs);
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+<%} else {%>
+ return eDynamicInverseRemove(otherEnd, featureID, msgs);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEBasicRemoveFromContainerGenFeatures())) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ public <%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> eBasicRemoveFromContainerFeature(<%=genModel.getImportedName("org.eclipse.emf.common.notify.NotificationChain")%> msgs)
+ {
+ switch (eContainerFeatureID<%=negativeOffsetCorrection%>)
+ {
+<%for (GenFeature genFeature : genClass.getEBasicRemoveFromContainerGenFeatures()) {%>
+ <%GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass(); String reverseOffsetCorrection = targetClass.hasOffsetCorrection() ? " + " + genClass.getOffsetCorrectionField(reverseFeature) : "";%>
+ case <%=genClass.getQualifiedFeatureID(genFeature)%>:
+ return eInternalContainer().eInverseRemove(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%><%=reverseOffsetCorrection%>, <%=targetClass.getImportedInterfaceName()%>.class, msgs);
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.eBasicRemoveFromContainerFeature(msgs);
+<%} else {%>
+ return eDynamicBasicRemoveFromContainer(msgs);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEGetGenFeatures())) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID<%=negativeOffsetCorrection%>)
+ {
+<%for (GenFeature genFeature : genClass.getEGetGenFeatures()) {%>
+ case <%=genClass.getQualifiedFeatureID(genFeature)%>:
+ <%if (genFeature.isPrimitiveType()) {%>
+ <%if (genFeature.isBooleanType()) {%>
+ return <%=genFeature.getGetAccessor()%>() ? Boolean.TRUE : Boolean.FALSE;
+ <%} else {%>
+ return new <%=genFeature.getObjectType(genClass)%>(<%=genFeature.getGetAccessor()%>());
+ <%}%>
+ <%} else if (genFeature.isResolveProxies() && !genFeature.isListType()) {%>
+ if (resolve) return <%=genFeature.getGetAccessor()%>();
+ return basicGet<%=genFeature.getAccessorName()%>();
+ <%} else if (genFeature.isMapType()) {%>
+ <%if (genFeature.isEffectiveSuppressEMFTypes()) {%>
+ if (coreType) return ((<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>.InternalMapView<%=genFeature.getImportedMapTemplateArguments(genClass)%>)<%=genFeature.getGetAccessor()%>()).eMap();
+ else return <%=genFeature.getGetAccessor()%>();
+ <%} else {%>
+ if (coreType) return <%=genFeature.getGetAccessor()%>();
+ else return <%=genFeature.getGetAccessor()%>().map();
+ <%}%>
+ <%} else if (genFeature.isWrappedFeatureMapType()) {%>
+ if (coreType) return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal.Wrapper)<%=genFeature.getGetAccessor()%>()).featureMap();
+ return <%=genFeature.getGetAccessor()%>();
+ <%} else if (genFeature.isFeatureMapType()) {%>
+ if (coreType) return <%=genFeature.getGetAccessor()%>();
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)<%=genFeature.getGetAccessor()%>()).getWrapper();
+ <%} else {%>
+ return <%=genFeature.getGetAccessor()%>();
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.eGet(featureID, resolve, coreType);
+<%} else {%>
+ return eDynamicGet(featureID, resolve, coreType);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getESetGenFeatures())) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useGenerics()) {%>
+ <%for (GenFeature genFeature : genClass.getESetGenFeatures()) {%>
+ <%if (genFeature.isUncheckedCast() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) {%>
+ @SuppressWarnings("unchecked")
+ <%break; }%>
+ <%}%>
+ <%}%>
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID<%=negativeOffsetCorrection%>)
+ {
+ <%for (GenFeature genFeature : genClass.getESetGenFeatures()) {%>
+ case <%=genClass.getQualifiedFeatureID(genFeature)%>:
+ <%if (genFeature.isListType()) {%>
+ <%if (genFeature.isWrappedFeatureMapType()) {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal.Wrapper)<%=genFeature.getGetAccessor()%>()).featureMap()).set(newValue);
+ <%} else if (genFeature.isFeatureMapType()) {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)<%=genFeature.getGetAccessor()%>()).set(newValue);
+ <%} else if (genFeature.isMapType()) {%>
+ <%if (genFeature.isEffectiveSuppressEMFTypes()) {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")%>.Setting)((<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>.InternalMapView<%=genFeature.getImportedMapTemplateArguments(genClass)%>)<%=genFeature.getGetAccessor()%>()).eMap()).set(newValue);
+ <%} else {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")%>.Setting)<%=genFeature.getGetAccessor()%>()).set(newValue);
+ <%}%>
+ <%} else {%>
+ <%=genFeature.getGetAccessor()%>().clear();
+ <%=genFeature.getGetAccessor()%>().addAll((<%=genModel.getImportedName("java.util.Collection")%><%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) {%><? extends <%=genFeature.getListItemType(genClass)%>><%}%>)newValue);
+ <%}%>
+ <%} else if (genFeature.isPrimitiveType()) {%>
+ set<%=genFeature.getAccessorName()%>(((<%=genFeature.getObjectType(genClass)%>)newValue).<%=genFeature.getPrimitiveValueFunction()%>());
+ <%} else {%>
+ set<%=genFeature.getAccessorName()%>(<%if (genFeature.getTypeGenDataType() == null || !genFeature.getTypeGenDataType().isObjectType() || !genFeature.getRawType().equals(genFeature.getType(genClass))) {%>(<%=genFeature.getImportedType(genClass)%>)<%}%>newValue);
+ <%}%>
+ return;
+ <%}%>
+ }
+ <%if (genModel.isMinimalReflectiveMethods()) {%>
+ super.eSet(featureID, newValue);
+ <%} else {%>
+ eDynamicSet(featureID, newValue);
+ <%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEUnsetGenFeatures())) {%>
+<%@ include file="Class/eUnset.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ public void eUnset(int featureID)
+ {
+ switch (featureID<%=negativeOffsetCorrection%>)
+ {
+ <%for (GenFeature genFeature : genClass.getEUnsetGenFeatures()) {%>
+ case <%=genClass.getQualifiedFeatureID(genFeature)%>:
+ <%if (genFeature.isListType() && !genFeature.isUnsettable()) {%>
+ <%if (genFeature.isWrappedFeatureMapType()) {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal.Wrapper)<%=genFeature.getGetAccessor()%>()).featureMap().clear();
+ <%} else {%>
+ <%=genFeature.getGetAccessor()%>().clear();
+ <%}%>
+ <%} else if (genFeature.isUnsettable()) {%>
+ unset<%=genFeature.getAccessorName()%>();
+ <%} else if (!genFeature.hasEDefault()) {%>
+ set<%=genFeature.getAccessorName()%>((<%=genFeature.getImportedType(genClass)%>)null);
+ <%} else {%>
+ set<%=genFeature.getAccessorName()%>(<%=genFeature.getEDefault()%>);
+ <%}%>
+ return;
+ <%}%>
+ }
+ <%if (genModel.isMinimalReflectiveMethods()) {%>
+ super.eUnset(featureID);
+ <%} else {%>
+ eDynamicUnset(featureID);
+ <%}%>
+ }
+
+<%@ end %><%//Class/eUnset.override.javajetinc%>
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEIsSetGenFeatures())) {%>
+<%@ include file="Class/eIsSet.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useGenerics()) {%>
+ <%for (GenFeature genFeature : genClass.getEIsSetGenFeatures()) {%>
+ <%if (genFeature.isListType() && !genFeature.isUnsettable() && !genFeature.isWrappedFeatureMapType() && !genClass.isField(genFeature) && genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ @SuppressWarnings("unchecked")
+ <%break; }%>
+ <%}%>
+ <%}%>
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID<%=negativeOffsetCorrection%>)
+ {
+<%for (GenFeature genFeature : genClass.getEIsSetGenFeatures()) {%>
+ case <%=genClass.getQualifiedFeatureID(genFeature)%>:
+ <%if (genFeature.isListType() && !genFeature.isUnsettable()) {%>
+ <%if (genFeature.isWrappedFeatureMapType()) {%>
+ <%if (genFeature.isVolatile()) {%>
+ return !((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal.Wrapper)<%=genFeature.getGetAccessor()%>()).featureMap().isEmpty();
+ <%} else {%>
+ return <%=genFeature.getSafeName()%> != null && !<%=genFeature.getSafeName()%>.featureMap().isEmpty();
+ <%}%>
+ <%} else {%>
+ <%if (genClass.isField(genFeature)) {%>
+ return <%=genFeature.getSafeName()%> != null && !<%=genFeature.getSafeName()%>.isEmpty();
+ <%} else {%>
+ <%if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType(genClass)%>)eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>);
+ return <%=genFeature.getSafeName()%> != null && !<%=genFeature.getSafeName()%>.isEmpty();
+ <%} else {%>
+ return !<%=genFeature.getGetAccessor()%>().isEmpty();
+ <%}%>
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.isUnsettable()) {%>
+ return isSet<%=genFeature.getAccessorName()%>();
+ <%} else if (genFeature.isResolveProxies()) {%>
+ <%if (genClass.isField(genFeature)) {%>
+ return <%=genFeature.getSafeName()%> != null;
+ <%} else {%>
+ <%if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ return eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>) != null;
+ <%} else {%>
+ return basicGet<%=genFeature.getAccessorName()%>() != null;
+ <%}%>
+ <%}%>
+ <%} else if (!genFeature.hasEDefault()) {%>
+ <%if (genClass.isField(genFeature)) {%>
+ return <%=genFeature.getSafeName()%> != null;
+ <%} else {%>
+ <%if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ return eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>) != null;
+ <%} else {%>
+ return <%=genFeature.getGetAccessor()%>() != null;
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.isPrimitiveType() || genFeature.isEnumType()) {%>
+ <%if (genClass.isField(genFeature)) {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ return ((<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0) != <%=genFeature.getEDefault()%>;
+ <%} else {%>
+ return <%=genFeature.getSafeName()%> != <%=genFeature.getEDefault()%>;
+ <%}%>
+ <%} else {%>
+ <%if (genFeature.isEnumType() && genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ return eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, <%=genFeature.getEDefault()%>) != <%=genFeature.getEDefault()%>;
+ <%} else {%>
+ return <%=genFeature.getGetAccessor()%>() != <%=genFeature.getEDefault()%>;
+ <%}%>
+ <%}%>
+ <%} else {//datatype%>
+ <%if (genClass.isField(genFeature)) {%>
+ return <%=genFeature.getEDefault()%> == null ? <%=genFeature.getSafeName()%> != null : !<%=genFeature.getEDefault()%>.equals(<%=genFeature.getSafeName()%>);
+ <%} else {%>
+ <%if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType(genClass)%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType(genClass)%>)eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>, <%=genFeature.getEDefault()%>);
+ return <%=genFeature.getEDefault()%> == null ? <%=genFeature.getSafeName()%> != null : !<%=genFeature.getEDefault()%>.equals(<%=genFeature.getSafeName()%>);
+ <%} else {%>
+ return <%=genFeature.getEDefault()%> == null ? <%=genFeature.getGetAccessor()%>() != null : !<%=genFeature.getEDefault()%>.equals(<%=genFeature.getGetAccessor()%>());
+ <%}%>
+ <%}%>
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.eIsSet(featureID);
+<%} else {%>
+ return eDynamicIsSet(featureID);
+<%}%>
+ }
+
+<%@ end %><%//Class/eIsSet.override.javajetinc%>
+<%}%>
+<%if (isImplementation && (!genClass.getMixinGenFeatures().isEmpty() || genClass.hasOffsetCorrection() && !genClass.getGenFeatures().isEmpty())) {%>
+ <%if (!genClass.getMixinGenFeatures().isEmpty()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class<%=singleWildcard%> baseClass)
+ {
+ <%for (GenClass mixinGenClass : genClass.getMixinGenClasses()) {%>
+ if (baseClass == <%=mixinGenClass.getImportedInterfaceName()%>.class)
+ {
+ switch (derivedFeatureID<%=negativeOffsetCorrection%>)
+ {
+ <%for (GenFeature genFeature : mixinGenClass.getGenFeatures()) {%>
+ case <%=genClass.getQualifiedFeatureID(genFeature)%>: return <%=mixinGenClass.getQualifiedFeatureID(genFeature)%>;
+ <%}%>
+ default: return -1;
+ }
+ }
+ <%}%>
+ return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
+ }
+ <%}%>
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ public int eDerivedStructuralFeatureID(int baseFeatureID, Class<%=singleWildcard%> baseClass)
+ {
+ <%for (GenClass mixinGenClass : genClass.getMixinGenClasses()) {%>
+ if (baseClass == <%=mixinGenClass.getImportedInterfaceName()%>.class)
+ {
+ switch (baseFeatureID)
+ {
+ <%for (GenFeature genFeature : mixinGenClass.getGenFeatures()) {%>
+ case <%=mixinGenClass.getQualifiedFeatureID(genFeature)%>: return <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>;
+ <%}%>
+ default: return -1;
+ }
+ }
+ <%}%>
+ <%if (genClass.hasOffsetCorrection() && !genClass.getGenFeatures().isEmpty()) {%>
+ if (baseClass == <%=genClass.getImportedInterfaceName()%>.class)
+ {
+ switch (baseFeatureID<%=negativeOffsetCorrection%>)
+ {
+ <%for (GenFeature genFeature : genClass.getGenFeatures()) {%>
+ case <%=genClass.getQualifiedFeatureID(genFeature)%>: return <%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>;
+ <%}%>
+ default: return -1;
+ }
+ }
+ <%}%>
+ return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
+ }
+
+<%}%>
+<%if (isImplementation && genModel.isVirtualDelegation()) { String eVirtualValuesField = genClass.getEVirtualValuesField();%>
+ <%if (eVirtualValuesField != null) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ protected Object[] eVirtualValues()
+ {
+ return <%=eVirtualValuesField%>;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ protected void eSetVirtualValues(Object[] newValues)
+ {
+ <%=eVirtualValuesField%> = newValues;
+ }
+
+ <%}%>
+ <%{ List<String> eVirtualIndexBitFields = genClass.getEVirtualIndexBitFields(new ArrayList<String>());%>
+ <%if (!eVirtualIndexBitFields.isEmpty()) { List<String> allEVirtualIndexBitFields = genClass.getAllEVirtualIndexBitFields(new ArrayList<String>());%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ protected int eVirtualIndexBits(int offset)
+ {
+ switch (offset)
+ {
+ <%for (int i = 0; i < allEVirtualIndexBitFields.size(); i++) {%>
+ case <%=i%> :
+ return <%=allEVirtualIndexBitFields.get(i)%>;
+ <%}%>
+ default :
+ throw new IndexOutOfBoundsException();
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ protected void eSetVirtualIndexBits(int offset, int newIndexBits)
+ {
+ switch (offset)
+ {
+ <%for (int i = 0; i < allEVirtualIndexBitFields.size(); i++) {%>
+ case <%=i%> :
+ <%=allEVirtualIndexBitFields.get(i)%> = newIndexBits;
+ break;
+ <%}%>
+ default :
+ throw new IndexOutOfBoundsException();
+ }
+ }
+
+ <%}%>
+ <%}%>
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getToStringGenFeatures().isEmpty()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useClassOverrideAnnotation()) {%>
+ @Override
+ <%}%>
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ <%{ boolean first = true;%>
+ <%for (GenFeature genFeature : genClass.getToStringGenFeatures()) {%>
+ <%if (first) { first = false;%>
+ result.append(" (<%=genFeature.getName()%>: ");<%=genModel.getNonNLS()%>
+ <%} else {%>
+ result.append(", <%=genFeature.getName()%>: ");<%=genModel.getNonNLS()%>
+ <%}%>
+ <%if (genFeature.isUnsettable() && !genFeature.isListType()) {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ if (eVirtualIsSet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>)) result.append(eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%>)); else result.append("<unset>");<%=genModel.getNonNLS()%>
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ if (<%if (genClass.isESetFlag(genFeature)) {%>(<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0<%} else {%><%=genFeature.getUncapName()%>ESet<%}%>) result.append((<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0); else result.append("<unset>");<%=genModel.getNonNLS()%>
+ <%} else {%>
+ if (<%if (genClass.isESetFlag(genFeature)) {%>(<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0<%} else {%><%=genFeature.getUncapName()%>ESet<%}%>) result.append(<%=genFeature.getSafeName()%>); else result.append("<unset>");<%=genModel.getNonNLS()%>
+ <%}%>
+ <%}%>
+ <%} else {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ result.append(eVirtualGet(<%=genClass.getQualifiedFeatureID(genFeature)%><%=positiveOffsetCorrection%><%if (!genFeature.isListType() && !genFeature.isReferenceType()){%>, <%=genFeature.getEDefault()%><%}%>));
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ result.append((<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0);
+ <%} else {%>
+ result.append(<%=genFeature.getSafeName()%>);
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+ result.append(')');
+ return result.toString();
+ }
+
+<%}%>
+<%if (isImplementation && genClass.isMapEntry()) { GenFeature keyFeature = genClass.getMapEntryKeyFeature(); GenFeature valueFeature = genClass.getMapEntryValueFeature();%>
+<%String objectType = genModel.getImportedName("java.lang.Object");%>
+<%String keyType = genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50 ? keyFeature.getObjectType(genClass) : objectType;%>
+<%String valueType = genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50 ? valueFeature.getObjectType(genClass) : objectType;%>
+<%String eMapType = genModel.getImportedName("org.eclipse.emf.common.util.EMap") + (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50 ? "<" + keyType + ", " + valueType + ">" : "");%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected int hash = -1;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int getHash()
+ {
+ if (hash == -1)
+ {
+ <%=objectType%> theKey = getKey();
+ hash = (theKey == null ? 0 : theKey.hashCode());
+ }
+ return hash;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setHash(int hash)
+ {
+ this.hash = hash;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=keyType%> getKey()
+ {
+ <%if (keyFeature.isPrimitiveType()) {%>
+ return new <%=keyFeature.getObjectType(genClass)%>(getTypedKey());
+ <%} else {%>
+ return getTypedKey();
+ <%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setKey(<%=keyType%> key)
+ {
+ <%if (keyFeature.isListType()) {%>
+ getTypedKey().addAll(<%if (!genModel.useGenerics()) {%>(<%=genModel.getImportedName("java.util.Collection")%>)<%}%>key);
+ <%} else if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) {%>
+ setTypedKey(key);
+ <%} else if (keyFeature.isPrimitiveType()) {%>
+ setTypedKey(((<%=keyFeature.getObjectType(genClass)%>)key).<%=keyFeature.getPrimitiveValueFunction()%>());
+ <%} else {%>
+ setTypedKey((<%=keyFeature.getImportedType(genClass)%>)key);
+ <%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=valueType%> getValue()
+ {
+ <%if (valueFeature.isPrimitiveType()) {%>
+ return new <%=valueFeature.getObjectType(genClass)%>(getTypedValue());
+ <%} else {%>
+ return getTypedValue();
+ <%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=valueType%> setValue(<%=valueType%> value)
+ {
+ <%=valueType%> oldValue = getValue();
+ <%if (valueFeature.isListType()) {%>
+ getTypedValue().clear();
+ getTypedValue().addAll(<%if (!genModel.useGenerics()) {%>(<%=genModel.getImportedName("java.util.Collection")%>)<%}%>value);
+ <%} else if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) {%>
+ setTypedValue(value);
+ <%} else if (valueFeature.isPrimitiveType()) {%>
+ setTypedValue(((<%=valueFeature.getObjectType(genClass)%>)value).<%=valueFeature.getPrimitiveValueFunction()%>());
+ <%} else {%>
+ setTypedValue((<%=valueFeature.getImportedType(genClass)%>)value);
+ <%}%>
+ return oldValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (genModel.useGenerics()) {%>
+ @SuppressWarnings("unchecked")
+ <%}%>
+ public <%=eMapType%> getEMap()
+ {
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")%> container = eContainer();
+ return container == null ? null : (<%=eMapType%>)container.eGet(eContainmentFeature());
+ }
+
+<%}%>
+<%@ include file="Class/insert.javajetinc" fail="silent" %>
+} //<%=isInterface ? " " + genClass.getInterfaceName() : genClass.getClassName()%>
+<%// TODO fix the space above%>
+<%genModel.emitSortedImports();%>
diff --git a/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.ecore b/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.ecore
new file mode 100644
index 00000000..9cedd690
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.ecore
@@ -0,0 +1,2262 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="pom"
+ nsURI="http://maven.apache.org/POM/4.0.0" nsPrefix="pom">
+ <eClassifiers xsi:type="ecore:EClass" name="Activation">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The conditions within the build runtime environment which will trigger&#xD;&#xA; the automatic inclusion of the build profile.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Activation"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="activeByDefault" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ defaultValueLiteral="false" unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Flag specifying whether this profile is active by default."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="activeByDefault"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="jdk" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Specifies that this profile will be activated when a matching JDK is detected. For example, &amp;lt;code&amp;gt;1.4&amp;lt;/code&amp;gt;&#xD;&#xA; only activates on JDKs versioned 1.4, while &amp;lt;code&amp;gt;!1.4&amp;lt;/code&amp;gt; matches any JDK that is not version 1.4.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="jdk"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="os" eType="#//ActivationOS"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Specifies that this profile will be activated when matching operating system attributes are detected.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="os"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="property" eType="#//ActivationProperty"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Specifies that this profile will be activated when this system property is specified.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="property"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="file" eType="#//ActivationFile"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Specifies that this profile will be activated based on existence of a file.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="file"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ActivationFile">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; This is the file specification used to activate the profile. The missing value will be the location&#xD;&#xA; of a file that needs to exist, and if it doesn't the profile will be activated. On the other hand exists will test&#xD;&#xA; for the existence of the file and if it is there the profile will be activated.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="ActivationFile"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="missing" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The name of the file that must be missing to activate the profile."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="missing"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="exists" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The name of the file that must exist to activate the profile."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="exists"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ActivationOS">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; This is an activator which will detect an operating system's attributes in order to activate&#xD;&#xA; its profile.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="ActivationOS"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The name of the operating system to be used to activate the profile. This must be an exact match&#xD;&#xA; of the &amp;lt;code&amp;gt;${os.name}&amp;lt;/code&amp;gt; Java property, such as &amp;lt;code&amp;gt;Windows XP&amp;lt;/code&amp;gt;."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="family" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The general family of the OS to be used to activate the profile, such as &amp;lt;code&amp;gt;windows&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;unix&amp;lt;/code&amp;gt;."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="family"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="arch" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The architecture of the operating system to be used to activate the profile."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="arch"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The version of the operating system to be used to activate the profile."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="version"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ActivationProperty">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; This is the property specification used to activate a profile. If the value field is empty,&#xD;&#xA; then the existence of the named property will activate the profile, otherwise it does a case-sensitive&#xD;&#xA; match against the property value as well.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="ActivationProperty"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The name of the property to be used to activate a profile."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The value of the property required to activate a profile."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="value"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Build" eSuperTypes="#//BuildBase">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Build"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="sourceDirectory" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; This element specifies a directory containing the source&#xD;&#xA; of the project. The generated build system will compile&#xD;&#xA; the source in this directory when the project is built.&#xD;&#xA; The path given is relative to the project descriptor.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="sourceDirectory"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="scriptSourceDirectory"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; This element specifies a directory containing the script sources&#xD;&#xA; of the project. This directory is meant to be different from the&#xD;&#xA; sourceDirectory, in that its contents will be copied to the output&#xD;&#xA; directory in most cases (since scripts are interpreted rather than&#xD;&#xA; compiled).&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="scriptSourceDirectory"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="testSourceDirectory" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; This element specifies a directory containing the unit test&#xD;&#xA; source of the project. The generated build system will&#xD;&#xA; compile these directories when the project is being tested.&#xD;&#xA; The path given is relative to the project descriptor.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="testSourceDirectory"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="outputDirectory" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The directory where compiled application classes are placed.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="outputDirectory"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="testOutputDirectory" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The directory where compiled test classes are placed.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="testOutputDirectory"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="extensions" unique="false"
+ upperBound="-1" eType="#//Extension" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;A set of build extensions to use from this project."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="extensions"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="BuildBase">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="BuildBase"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultGoal" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The default goal (or phase in Maven 2) to execute when none is specified for the project.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="defaultGoal"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="resources" unique="false"
+ upperBound="-1" eType="#//Resource" unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; This element describes all of the classpath resources such as properties files associated with a&#xD;&#xA; project. These resources are often included in the final package.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="resources"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="testResources" unique="false"
+ upperBound="-1" eType="#//Resource" unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; This element describes all of the classpath resources such as properties files associated with a&#xD;&#xA; project's unit tests.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="testResources"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="directory" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The directory where all files generated by the build are placed.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="directory"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="finalName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The filename (excluding the extension, and with no path information) that the produced artifact&#xD;&#xA; will be called. The default value is &amp;lt;code&amp;gt;${artifactId}-${version}&amp;lt;/code&amp;gt;.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="finalName"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="pluginManagement" eType="#//PluginManagement"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Default plugin information to be made available for reference by &#xD;&#xA; projects derived from this one. This plugin configuration will not&#xD;&#xA; be resolved or bound to the lifecycle unless referenced. Any local&#xD;&#xA; configuration for a given plugin will override the plugin's entire&#xD;&#xA; definition here.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="pluginManagement"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="plugins" unique="false"
+ upperBound="-1" eType="#//Plugin" unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The list of plugins to use.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="plugins"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="filters" unique="false"
+ upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="CiManagement">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="CiManagement"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="system" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The name of the continuous integration system, e.g. &amp;lt;code&amp;gt;continuum&amp;lt;/code&amp;gt;."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="system"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="url" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; URL for the continuous integration system used by the project if it has a web interface."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="url"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="notifiers" unique="false"
+ upperBound="-1" eType="#//Notifier" unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Configuration for notifying developers/users when a build is &#xD;&#xA; unsuccessful, including user information and notification mode.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="notifiers"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Contributor">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; Description of a person who has contributed to the project, but who does&#xD;&#xA; not have commit privileges. Usually, these contributions come in the&#xD;&#xA; form of patches submitted.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Contributor"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The full name of the contributor."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="email" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The email address of the contributor."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="email"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="url" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The URL for the homepage of the contributor."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="url"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="organization" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The organization to which the contributor belongs."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="organization"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="organizationUrl" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The URL of the organization."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="organizationUrl"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="timezone" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The timezone the contributor is in. This is a number in the range -11 to 12.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="timezone"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="properties" unique="false"
+ upperBound="-1" eType="#//PropertyElement" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; Properties about the contributor, such as an instant messenger handle.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="properties"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="roles" unique="false" upperBound="-1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String" unsettable="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Dependency">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Dependency"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="groupId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The project group that produced the dependency, e.g.&#xD;&#xA; &amp;lt;code&amp;gt;org.apache.maven&amp;lt;/code&amp;gt;.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="groupId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="artifactId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The unique id for an artifact produced by the project group, e.g.&#xD;&#xA; &amp;lt;code&amp;gt;maven-artifact&amp;lt;/code&amp;gt;.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="artifactId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The version of the dependency, e.g. &amp;lt;code&amp;gt;3.2.1&amp;lt;/code&amp;gt;. In Maven 2, this can also be&#xD;&#xA; specified as a range of versions.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="version"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The type of dependency. This defaults to &amp;lt;code&amp;gt;jar&amp;lt;/code&amp;gt;. While it usually represents the extension on&#xD;&#xA; the filename of the dependency, that is not always the case. A type can be mapped to a different&#xD;&#xA; extension and a classifier.&#xD;&#xA; The type often correspongs to the packaging used, though this is also not always the case.&#xD;&#xA; Some examples are &amp;lt;code&amp;gt;jar&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;war&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ejb-client&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;test-jar&amp;lt;/code&amp;gt;.&#xD;&#xA; New types can be defined by plugins that set&#xD;&#xA; &amp;lt;code&amp;gt;extensions&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, so this is not a complete list.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="type"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="classifier" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The classifier of the dependency. This allows distinguishing two artifacts that belong to the same POM but&#xD;&#xA; were built differently, and is appended to the filename after the version. For example,&#xD;&#xA; &amp;lt;code&amp;gt;jdk14&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;jdk15&amp;lt;/code&amp;gt;.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="classifier"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="scope" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The scope of the dependency - &amp;lt;code&amp;gt;compile&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;runtime&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;test&amp;lt;/code&amp;gt;,&#xD;&#xA; &amp;lt;code&amp;gt;system&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;provided&amp;lt;/code&amp;gt;. Used to&#xD;&#xA; calculate the various classpaths used for compilation, testing, and so on. It also assists in determining&#xD;&#xA; which artifacts to include in a distribution of this project. For more information, see&#xD;&#xA; &amp;lt;a href=&quot;http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html&quot;&amp;gt;the&#xD;&#xA; dependency mechanism&amp;lt;/a&amp;gt;.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="scope"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="systemPath" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; FOR SYSTEM SCOPE ONLY. Note that use of this property is &amp;lt;b&amp;gt;discouraged&amp;lt;/b&amp;gt; and may be replaced in later&#xD;&#xA; versions. This specifies the path on the filesystem for this dependency.&#xD;&#xA; Requires an absolute path for the value, not relative.&#xD;&#xA; Use a property that gives the machine specific absolute path,&#xD;&#xA; e.g. &amp;lt;code&amp;gt;${java.home}&amp;lt;/code&amp;gt;.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="systemPath"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="exclusions" unique="false"
+ upperBound="-1" eType="#//Exclusion" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Lists a set of artifacts that should be excluded from this dependency's artifact list when it comes to&#xD;&#xA; calculating transitive dependencies.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="exclusions"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="optional" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ defaultValueLiteral="false" unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Indicates the dependency is optional for use of this library. While the version of the dependency will be&#xD;&#xA; taken into account for dependency calculation if the library is used elsewhere, it will not be passed on&#xD;&#xA; transitively.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="optional"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="DependencyManagement">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Section for management of default dependency information for use in a group of POMs.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="DependencyManagement"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="dependencies" unique="false"
+ upperBound="-1" eType="#//Dependency" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The dependencies specified here are not used until they&#xD;&#xA; are referenced in a POM within the group. This allows the&#xD;&#xA; specification of a &quot;standard&quot; version for a particular&#xD;&#xA; dependency.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="dependencies"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="DeploymentRepository">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Repository contains the information needed for deploying to the remote repoistory.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="DeploymentRepository"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="uniqueVersion" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ defaultValueLiteral="true" unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Whether to assign snapshots a unique version comprised of the timestamp and build number, or to&#xD;&#xA; use the same version each time"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="uniqueVersion"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; A unique identifier for a repository. This is used to match the repository to configuration in&#xD;&#xA; the &amp;lt;code&amp;gt;settings.xml&amp;lt;/code&amp;gt; file, for example.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="id"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Human readable name of the repository.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="url" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The url of the repository, in the form &amp;lt;code&amp;gt;protocol://hostname/path&amp;lt;/code&amp;gt;.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="url"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="layout" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The type of layout this repository uses for locating and storing artifacts - can be &amp;lt;code&amp;gt;legacy&amp;lt;/code&amp;gt; or&#xD;&#xA; &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="layout"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Developer">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; Information about one of the committers on this project.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Developer"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The unique ID of the developer in the SCM."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="id"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The full name of the contributor."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="email" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The email address of the contributor."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="email"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="url" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The URL for the homepage of the contributor."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="url"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="organization" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The organization to which the contributor belongs."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="organization"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="organizationUrl" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The URL of the organization."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="organizationUrl"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="timezone" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The timezone the contributor is in. This is a number in the range -11 to 12.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="timezone"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="properties" unique="false"
+ upperBound="-1" eType="#//PropertyElement" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; Properties about the contributor, such as an instant messenger handle.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="properties"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="roles" unique="false" upperBound="-1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String" unsettable="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="DistributionManagement">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; This elements describes all that pertains to distribution for a project.&#xD;&#xA; It is primarily used for deployment of artifacts and the site&#xD;&#xA; produced by the build.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="DistributionManagement"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="repository" eType="#//DeploymentRepository"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Information needed to deploy the artifacts generated by the project to a remote repository.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="repository"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="snapshotRepository" eType="#//DeploymentRepository"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Where to deploy snapshots of artifacts to. If not given, it defaults to the &amp;lt;code&amp;gt;repository&amp;lt;/code&amp;gt; element.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="snapshotRepository"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="site" eType="#//Site" unsettable="true"
+ containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Information needed for deploying the web site of the project.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="site"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="downloadUrl" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0+&#xD;&#xA;&#xD;&#xA; The URL of the project's download page. If not given users will be referred to the homepage given by&#xD;&#xA; &amp;lt;code&amp;gt;url&amp;lt;/code&amp;gt;. This is given to assist in locating artifacts that are not in the repository due to&#xD;&#xA; licensing restrictions.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="downloadUrl"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="relocation" eType="#//Relocation"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Relocation information of the artifact if it has been moved to a new group ID and/or artifact ID.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="relocation"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="status" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Gives the status of this artifact in the remote repository. This must not be set in your local&#xD;&#xA; project, as it is updated by tools placing it in the reposiory. Valid values are: &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; (default),&#xD;&#xA; &amp;lt;code&amp;gt;converted&amp;lt;/code&amp;gt; (repository manager converted this from an Maven 1 POM), &amp;lt;code&amp;gt;partner&amp;lt;/code&amp;gt;&#xD;&#xA; (directly synced from a partner Maven 2 repository), &amp;lt;code&amp;gt;deployed&amp;lt;/code&amp;gt; (was deployed from a Maven 2&#xD;&#xA; instance), &amp;lt;code&amp;gt;verified&amp;lt;/code&amp;gt; (has been hand verified as correct and final).&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="status"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="DocumentRoot">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value=""/>
+ <details key="kind" value="mixed"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed" unique="false" upperBound="-1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="elementWildcard"/>
+ <details key="name" value=":mixed"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="xMLNSPrefixMap" upperBound="-1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry"
+ transient="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="xmlns:prefix"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="xSISchemaLocation" upperBound="-1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry"
+ transient="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="attribute"/>
+ <details key="name" value="xsi:schemaLocation"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="project" upperBound="-2"
+ eType="#//Model" volatile="true" transient="true" derived="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The &amp;lt;code&amp;gt;&amp;amp;lt;project&amp;amp;gt;&amp;lt;/code&amp;gt; element is the root of the descriptor.&#xD;&#xA; The following table lists all of the possible child elements.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="project"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Exclusion">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Exclusion"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="artifactId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The artifact ID of the project to exclude."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="artifactId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="groupId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The group ID of the project to exclude."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="groupId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Extension">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Describes a build extension to utilise."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Extension"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="groupId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The group ID of the extension's artifact."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="groupId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="artifactId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The artifact ID of the extension."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="artifactId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The version of the extension."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="version"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="IssueManagement">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Information about the issue tracking (or bug tracking) system used to manage this project.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="IssueManagement"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="system" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The name of the issue management system, e.g. Bugzilla"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="system"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="url" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;URL for the issue management system used by the project."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="url"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="License">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; Describes the licenses for this project. This is used to generate&#xD;&#xA; the license page of the project's web site, as well as being taken into consideration in other reporting and&#xD;&#xA; validation. The licenses listed for the project are that of the project itself, and not of dependencies.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="License"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The full legal name of the license."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="url" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The official url for the license text."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="url"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="distribution" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The primary method by which this project may be distributed.&#xD;&#xA; &amp;lt;dl&amp;gt;&#xD;&#xA; &amp;lt;dt&amp;gt;repo&amp;lt;/dt&amp;gt;&#xD;&#xA; &amp;lt;dd&amp;gt;may be downloaded from the Maven repository&amp;lt;/dd&amp;gt;&#xD;&#xA; &amp;lt;dt&amp;gt;manual&amp;lt;/dt&amp;gt;&#xD;&#xA; &amp;lt;dd&amp;gt;user must manually download and install the dependency.&amp;lt;/dd&amp;gt;&#xD;&#xA; &amp;lt;/dl&amp;gt;&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="distribution"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="comments" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; Addendum information pertaining to this license.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="comments"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="MailingList">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; This element describes all of the mailing lists associated with&#xD;&#xA; a project. The auto-generated site references this information.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="MailingList"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The name of the mailing list."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="subscribe" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The email address or link that can be used to subscribe to the mailing list.&#xD;&#xA; If this is an email address, a&#xD;&#xA; &amp;lt;code&amp;gt;mailto:&amp;lt;/code&amp;gt; link will automatically be created when&#xD;&#xA; the documentation is created.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="subscribe"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="unsubscribe" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The email address or link that can be used to unsubscribe to&#xD;&#xA; the mailing list. If this is an email address, a&#xD;&#xA; &amp;lt;code&amp;gt;mailto:&amp;lt;/code&amp;gt; link will automatically be created&#xD;&#xA; when the documentation is created.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="unsubscribe"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="post" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The email address or link that can be used to post to&#xD;&#xA; the mailing list. If this is an email address, a&#xD;&#xA; &amp;lt;code&amp;gt;mailto:&amp;lt;/code&amp;gt; link will automatically be created&#xD;&#xA; when the documentation is created.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="post"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="archive" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The link to a URL where you can browse the mailing list archive.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="archive"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="otherArchives" unique="false"
+ upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ unsettable="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Model">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The &amp;lt;code&amp;gt;&amp;amp;lt;project&amp;amp;gt;&amp;lt;/code&amp;gt; element is the root of the descriptor.&#xD;&#xA; The following table lists all of the possible child elements.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Model"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//Parent"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The location of the parent project, if one exists. Values from the&#xD;&#xA; parent project will be the default for this project if they are&#xD;&#xA; left unspecified. The location is given as a group ID, artifact ID and version.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="parent"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="modelVersion" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Declares to which version of project descriptor this POM conforms."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="modelVersion"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="groupId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; A universally unique identifier for a project. It is normal to&#xD;&#xA; use a fully-qualified package name to distinguish it from other projects with a similar name&#xD;&#xA; (eg. &amp;lt;code&amp;gt;org.apache.maven&amp;lt;/code&amp;gt;).&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="groupId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="artifactId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The identifier for this artifact that is unique within the group given by the group ID.&#xD;&#xA; An artifact is something that is either produced or used by a project. Examples of artifacts produced by&#xD;&#xA; Maven for a project include: JARs, source and binary distributions, and WARs.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="artifactId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="packaging" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The type of artifact this project produces, for example &amp;lt;code&amp;gt;jar&amp;lt;/code&amp;gt;&#xD;&#xA; &amp;lt;code&amp;gt;war&amp;lt;/code&amp;gt;&#xD;&#xA; &amp;lt;code&amp;gt;ear&amp;lt;/code&amp;gt;&#xD;&#xA; &amp;lt;code&amp;gt;pom&amp;lt;/code&amp;gt;.&#xD;&#xA; Plugins can create their own packaging, and&#xD;&#xA; therefore their own packaging types,&#xD;&#xA; so this list does not contain all possible types.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="packaging"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The full name of the project.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The current version of the artifact produced by this project.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="version"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; A detailed description of the project, used by Maven whenever it needs to describe the project,&#xD;&#xA; such as on the web site. While this element can be specified as CDATA to enable&#xD;&#xA; the use of HTML tags within the description, it is discouraged to allow plain text representation.&#xD;&#xA; If you need to modify the index page of the generated web site, you are able to specify your own instead&#xD;&#xA; of adjusting this text.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="description"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="url" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The URL to the project's homepage.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="url"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="prerequisites" eType="#//Prerequisites"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Describes the prerequisites in the build environment for this project.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="prerequisites"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="issueManagement" eType="#//IssueManagement"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The project's issue management system information."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="issueManagement"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ciManagement" eType="#//CiManagement"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The project's continuous integration information."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="ciManagement"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="inceptionYear" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; The year of the project's inception, specified with 4 digits.&#xD;&#xA; This value is used when generating copyright notices as well as being informational.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="inceptionYear"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="mailingLists" unique="false"
+ upperBound="-1" eType="#//MailingList" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; Contains information about a project's mailing lists.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="mailingLists"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="developers" unique="false"
+ upperBound="-1" eType="#//Developer" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; Describes the committers of a project.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="developers"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="contributors" unique="false"
+ upperBound="-1" eType="#//Contributor" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; Describes the contributors to a project that are not yet committers.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="contributors"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="licenses" unique="false"
+ upperBound="-1" eType="#//License" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; This element describes all of the licenses for this project. &#xD;&#xA; Each license is described by a &amp;lt;code&amp;gt;license&amp;lt;/code&amp;gt; element, which &#xD;&#xA; is then described by additional elements.&#xD;&#xA; Projects should only list the license(s) that applies to the project &#xD;&#xA; and not the licenses that apply to dependencies.&#xD;&#xA; If multiple licenses are listed, it is assumed that the user can select any of them, not that they&#xD;&#xA; must accept all.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="licenses"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="scm" eType="#//Scm" unsettable="true"
+ containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Specification for the SCM used by the project, such as CVS, Subversion, etc."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="scm"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="organization" eType="#//Organization"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; This element describes various attributes of the organization to&#xD;&#xA; which the project belongs. These attributes are utilized when&#xD;&#xA; documentation is created (for copyright notices and links).&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="organization"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="build" eType="#//Build"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;Information required to build the project."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="build"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="profiles" unique="false"
+ upperBound="-1" eType="#//Profile" unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; A listing of project-local build profiles which will modify the build process when activated.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="profiles"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="repositories" unique="false"
+ upperBound="-1" eType="#//Repository" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The lists of the remote repositories for discovering dependencies and&#xD;&#xA; extensions."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="repositories"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="pluginRepositories" unique="false"
+ upperBound="-1" eType="#//Repository" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The lists of the remote repositories for discovering plugins for builds and reports."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="pluginRepositories"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="dependencies" unique="false"
+ upperBound="-1" eType="#//Dependency" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; This element describes all of the dependencies associated with a&#xD;&#xA; project.&#xD;&#xA; These dependencies are used to construct a classpath for your &#xD;&#xA; project during the build process. They are automatically downloaded from the&#xD;&#xA; repositories defined in this project.&#xD;&#xA; See &amp;lt;a href=&quot;http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html&quot;&amp;gt;the&#xD;&#xA; dependency mechanism&amp;lt;/a&amp;gt; for more information.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="dependencies"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="reporting" eType="#//Reporting"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; This element includes the specification of report plugins to use to generate the reports on the&#xD;&#xA; Maven-generated site. These reports will be run when a user executes &amp;lt;code&amp;gt;mvn site&amp;lt;/code&amp;gt;. All of the&#xD;&#xA; reports will be included in the navigation bar for browsing.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="reporting"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="dependencyManagement" eType="#//DependencyManagement"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Default dependency information for projects that inherit from&#xD;&#xA; this one. The dependencies in this section are not immediately resolved.&#xD;&#xA; Instead, when a POM derived from this one declares a dependency &#xD;&#xA; described by a matching groupId and artifactId, the version and other values from this&#xD;&#xA; section are used for that dependency if they were not already specified.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="dependencyManagement"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="distributionManagement"
+ eType="#//DistributionManagement" unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Distribution information for a project that enables deployment of the site&#xD;&#xA; and artifacts to remote web servers and repositories respectively."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="distributionManagement"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="properties" unique="false"
+ upperBound="-1" eType="#//PropertyElement" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Properties that can be used throughout the POM as a substitution, and are used as filters in resources&#xD;&#xA; if enabled. The format is &amp;lt;code&amp;gt;&amp;amp;lt;name&amp;amp;gt;value&amp;amp;lt;/name&amp;amp;gt;&amp;lt;/code&amp;gt;.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="properties"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="modules" unique="false"
+ upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Notifier">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Configures one method for notifying users/developers when a build breaks.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Notifier"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The mechanism used to deliver notifications."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="type"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="sendOnError" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ defaultValueLiteral="true" unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Whether to send notifications on error."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="sendOnError"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="sendOnFailure" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ defaultValueLiteral="true" unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Whether to send notifications on failure."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="sendOnFailure"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="sendOnSuccess" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ defaultValueLiteral="true" unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Whether to send notifications on success."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="sendOnSuccess"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="sendOnWarning" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ defaultValueLiteral="true" unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Whether to send notifications on warning."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="sendOnWarning"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="address" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; &amp;lt;b&amp;gt;Deprecated&amp;lt;/b&amp;gt;. Where to send the notification to - eg email address.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="address"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="configuration" unique="false"
+ upperBound="-1" eType="#//PropertyElement" unsettable="true" containment="true"
+ resolveProxies="false"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Organization">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;Specifies the organization that produces this project."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Organization"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The full name of the organization."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="url" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;The URL to the organization's home page."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="url"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Parent">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Parent"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="artifactId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The artifact id of the parent project to inherit from."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="artifactId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="groupId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The group id of the parent project to inherit from."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="groupId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The version of the parent project to inherit."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="version"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="relativePath" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The relative path of the parent &amp;lt;code&amp;gt;pom.xml&amp;lt;/code&amp;gt; file within the check out.&#xD;&#xA; The default value is &amp;lt;code&amp;gt;../pom.xml&amp;lt;/code&amp;gt;.&#xD;&#xA; Maven looks for the parent pom first in the reactor of currently building projects, then in this location on&#xD;&#xA; the filesystem, then the local repository, and lastly in the remote repo.&#xD;&#xA; &amp;lt;code&amp;gt;relativePath&amp;lt;/code&amp;gt; allows you to select a different location,&#xD;&#xA; for example when your structure is flat, or deeper without an intermediate parent pom.&#xD;&#xA; However, the group ID, artifact ID and version are still required,&#xD;&#xA; and must match the file in the location given or it will revert to the repository for the POM.&#xD;&#xA; This feature is only for enhancing the development in a local checkout of that project.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="relativePath"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Plugin">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Plugin"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="groupId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The group ID of the plugin in the repository."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="groupId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="artifactId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The artifact ID of the plugin in the repository."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="artifactId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The version (or valid range of verisons) of the plugin to be used."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="version"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="extensions" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ defaultValueLiteral="false" unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Whether to load Maven extensions (such as packaging and type handlers) from this&#xD;&#xA; plugin. For performance reasons, this should only be enabled when necessary."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="extensions"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="executions" unique="false"
+ upperBound="-1" eType="#//PluginExecution" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Multiple specifications of a set of goals to execute during the build lifecycle, each having&#xD;&#xA; (possibly) different&#xD;&#xA; configuration."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="executions"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="dependencies" unique="false"
+ upperBound="-1" eType="#//Dependency" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Additional dependencies that this project needs to introduce to the plugin's&#xD;&#xA; classloader."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="dependencies"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="inherited" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Whether any configuration should be propagated to child POMs."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="inherited"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="configuration" unique="false"
+ eType="#//Configuration"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="PluginExecution">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="PluginExecution"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The identifier of this execution for labelling the goals during the build, and for matching&#xD;&#xA; exections to merge during inheritance."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="id"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="phase" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The build lifecycle phase to bind the goals in this execution to. If omitted, the goals will&#xD;&#xA; be bound to the default specified in their metadata."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="phase"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="inherited" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Whether any configuration should be propagated to child POMs."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="inherited"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="goals" unique="false" upperBound="-1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="configuration" eType="#//Configuration"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="PluginManagement">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Section for management of default plugin information for use in a group of POMs.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="PluginManagement"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="plugins" unique="false"
+ upperBound="-1" eType="#//Plugin" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The list of plugins to use.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="plugins"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Prerequisites">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Describes the prerequisites a project can have."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Prerequisites"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="maven" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The minimum version of Maven required to build the project, or to use this plugin."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="maven"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Profile">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Modifications to the build process which is activated based on environmental parameters or command line arguments.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Profile"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The identifier of this build profile. This used both for command line activation, and identifies&#xD;&#xA; identical profiles to merge with during inheritance."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="id"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="activation" eType="#//Activation"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The conditional logic which will automatically&#xD;&#xA; trigger the inclusion of this profile."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="activation"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="build" eType="#//BuildBase"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Information required to build the project."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="build"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="repositories" unique="false"
+ upperBound="-1" eType="#//Repository" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The lists of the remote repositories for discovering dependencies and&#xD;&#xA; extensions."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="repositories"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="pluginRepositories" unique="false"
+ upperBound="-1" eType="#//Repository" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The lists of the remote repositories for discovering plugins for builds and reports."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="pluginRepositories"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="dependencies" unique="false"
+ upperBound="-1" eType="#//Dependency" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; This element describes all of the dependencies associated with a&#xD;&#xA; project.&#xD;&#xA; These dependencies are used to construct a classpath for your &#xD;&#xA; project during the build process. They are automatically downloaded from the&#xD;&#xA; repositories defined in this project.&#xD;&#xA; See &amp;lt;a href=&quot;http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html&quot;&amp;gt;the&#xD;&#xA; dependency mechanism&amp;lt;/a&amp;gt; for more information.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="dependencies"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="reports" unique="false"
+ upperBound="-1" eType="#//ReportPlugin" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; &amp;lt;b&amp;gt;Deprecated&amp;lt;/b&amp;gt;. Now ignored by Maven.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="reports"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="dependencyManagement" eType="#//DependencyManagement"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Default dependency information for projects that inherit from&#xD;&#xA; this one. The dependencies in this section are not immediately resolved.&#xD;&#xA; Instead, when a POM derived from this one declares a dependency &#xD;&#xA; described by a matching groupId and artifactId, the version and other values from this&#xD;&#xA; section are used for that dependency if they were not already specified.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="dependencyManagement"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="distributionManagement"
+ eType="#//DistributionManagement" unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Distribution information for a project that enables deployment of the site&#xD;&#xA; and artifacts to remote web servers and repositories respectively."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="distributionManagement"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="properties" unique="false"
+ upperBound="-1" eType="#//PropertyElement" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Properties that can be used throughout the POM as a substitution, and are used as filters in resources&#xD;&#xA; if enabled. The format is &amp;lt;code&amp;gt;&amp;amp;lt;name&amp;amp;gt;value&amp;amp;lt;/name&amp;amp;gt;&amp;lt;/code&amp;gt;.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="properties"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="modules" unique="false"
+ upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="reporting" eType="#//Reporting"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Relocation">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Describes where an artifact has moved to. If any of the values are omitted, it is assumed to be the&#xD;&#xA; same as it was before."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Relocation"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="groupId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The group ID the artifact has moved to."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="groupId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="artifactId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The new artifact ID of the artifact."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="artifactId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The new version of the artifact."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="version"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="message" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;An additional message to show the user about the move, such as the reason."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="message"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Reporting">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Section for management of reports and their configuration."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Reporting"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaults" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ defaultValueLiteral="false" unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;If true, then the default reports are not included in the site generation. This includes the&#xD;&#xA; reports in the &quot;Project Info&quot; menu."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="excludeDefaults"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="outputDirectory" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Where to store all of the generated reports. The default is&#xD;&#xA; &amp;lt;code&amp;gt;${project.build.directory}/site&amp;lt;/code&amp;gt;&#xD;&#xA; .&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="outputDirectory"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="plugins" unique="false"
+ upperBound="-1" eType="#//ReportPlugin" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The reporting plugins to use and their configuration."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="plugins"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ReportPlugin">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="ReportPlugin"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="groupId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The group ID of the reporting plugin in the repository."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="groupId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="artifactId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The artifact ID of the reporting plugin in the repository."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="artifactId"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;The version of the reporting plugin to be used."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="version"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="inherited" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Whether the configuration in this plugin should be made available to projects that&#xD;&#xA; inherit from this one."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="inherited"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="reportSets" unique="false"
+ upperBound="-1" eType="#//ReportSet" unsettable="true" containment="true"
+ resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Multiple specifications of a set of reports, each having (possibly) different&#xD;&#xA; configuration. This is the reporting parallel to an &amp;lt;code&amp;gt;execution&amp;lt;/code&amp;gt; in the build."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="reportSets"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="configuration" eType="#//Configuration"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ReportSet">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Represents a set of reports and configuration to be used to generate them."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="ReportSet"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="0.0.0+&#xD;&#xA;The unique id for this report set, to be used during POM inheritance."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="id"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="inherited" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Whether any configuration should be propagated to child POMs."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="inherited"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="reports" unique="false"
+ upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="configuration" eType="#//Configuration"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Repository">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; A repository contains the information needed for establishing connections with remote repoistory.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Repository"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="releases" eType="#//RepositoryPolicy"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;How to handle downloading of releases from this repository."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="releases"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="snapshots" eType="#//RepositoryPolicy"
+ unsettable="true" containment="true" resolveProxies="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;How to handle downloading of snapshots from this repository."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="snapshots"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; A unique identifier for a repository. This is used to match the repository to configuration in&#xD;&#xA; the &amp;lt;code&amp;gt;settings.xml&amp;lt;/code&amp;gt; file, for example.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="id"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Human readable name of the repository.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="url" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The url of the repository, in the form &amp;lt;code&amp;gt;protocol://hostname/path&amp;lt;/code&amp;gt;.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="url"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="layout" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The type of layout this repository uses for locating and storing artifacts - can be &amp;lt;code&amp;gt;legacy&amp;lt;/code&amp;gt; or&#xD;&#xA; &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="layout"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="RepositoryPolicy">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Download policy"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="RepositoryPolicy"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="enabled" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ defaultValueLiteral="true" unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;Whether to use this repository for downloading this type of artifact."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="enabled"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="updatePolicy" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The frequency for downloading updates - can be&#xD;&#xA; &amp;lt;code&amp;gt;always,&amp;lt;/code&amp;gt;&#xD;&#xA; &amp;lt;code&amp;gt;daily&amp;lt;/code&amp;gt;&#xD;&#xA; (default),&#xD;&#xA; &amp;lt;code&amp;gt;interval:XXX&amp;lt;/code&amp;gt;&#xD;&#xA; (in minutes) or&#xD;&#xA; &amp;lt;code&amp;gt;never&amp;lt;/code&amp;gt;&#xD;&#xA; (only if it doesn't exist locally).&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="updatePolicy"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="checksumPolicy" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; What to do when verification of an artifact checksum fails. Valid values are&#xD;&#xA; &amp;lt;code&amp;gt;ignore&amp;lt;/code&amp;gt;&#xD;&#xA; ,&#xD;&#xA; &amp;lt;code&amp;gt;fail&amp;lt;/code&amp;gt;&#xD;&#xA; or&#xD;&#xA; &amp;lt;code&amp;gt;warn&amp;lt;/code&amp;gt;&#xD;&#xA; (the default).&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="checksumPolicy"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Resource">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; This element describes all of the classpath resources associated with a project or&#xD;&#xA; unit tests.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Resource"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="targetPath" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; Describe the resource target path. For example, if you want that &#xD;&#xA; resource to appear in a specific package&#xD;&#xA; (&amp;lt;code&amp;gt;org.apache.maven.messages&amp;lt;/code&amp;gt;), you must specify this &#xD;&#xA; element with this value: &amp;lt;code&amp;gt;org/apache/maven/messages&amp;lt;/code&amp;gt;.&#xD;&#xA; This is not required if you simply put the resources in that directory structure at the source, however.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="targetPath"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="filtering" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ defaultValueLiteral="false" unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; Whether resources are filtered to replace tokens with parameterised values or not.&#xD;&#xA; The values are taken from the &amp;lt;code&amp;gt;properties&amp;lt;/code&amp;gt; element and from the properties in the files listed&#xD;&#xA; in the &amp;lt;code&amp;gt;filters&amp;lt;/code&amp;gt; element.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="filtering"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="directory" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="3.0.0+&#xD;&#xA;&#xD;&#xA; Describe the directory where the resources are stored.&#xD;&#xA; The path is relative to the POM.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="directory"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="includes" unique="false"
+ upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludes" unique="false"
+ upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Scm">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Scm"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="connection" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The source control management system URL&#xD;&#xA; that describes the repository and how to connect to the&#xD;&#xA; repository. For more information, see the&#xD;&#xA; &amp;lt;a href=&quot;http://maven.apache.org/scm/scm-url-format.html&quot;&amp;gt;URL format&amp;lt;/a&amp;gt;&#xD;&#xA; and &amp;lt;a href=&quot;http://maven.apache.org/scm/scms-overview.html&quot;&amp;gt;list of supported SCMs&amp;lt;/a&amp;gt;.&#xD;&#xA; This connection is read-only.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="connection"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="developerConnection" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Just like &amp;lt;code&amp;gt;connection&amp;lt;/code&amp;gt;, but for developers, i.e. this scm connection&#xD;&#xA; will not be read only.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="developerConnection"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="tag" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
+ unsettable="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The tag of current code. By default, it's set to HEAD during development.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="tag"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="url" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The URL to the project's browsable SCM repository, such as ViewVC or Fisheye."/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="url"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Site">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Contains the information needed for deploying websites.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Site"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; A unique identifier for a deployment locataion. This is used to match the site to configuration in&#xD;&#xA; the &amp;lt;code&amp;gt;settings.xml&amp;lt;/code&amp;gt; file, for example.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="id"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; Human readable name of the deployment location.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="url" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="4.0.0&#xD;&#xA;&#xD;&#xA; The url of the location where website is deployed, in the form &amp;lt;code&amp;gt;protocol://hostname/path&amp;lt;/code&amp;gt;.&#xD;&#xA; "/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="url"/>
+ <details key="namespace" value="##targetNamespace"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="PropertyElement">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Configuration"/>
+</ecore:EPackage>
diff --git a/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.genmodel b/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.genmodel
new file mode 100644
index 00000000..5226efcd
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.genmodel
@@ -0,0 +1,291 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2008 Sonatype, Inc.&#xD;&#xA;All rights reserved. This program and the accompanying materials&#xD;&#xA;are made available under the terms of the Eclipse Public License v1.0&#xD;&#xA;which accompanies this distribution, and is available at&#xD;&#xA;http://www.eclipse.org/legal/epl-v10.html&#xD;&#xA;"
+ modelDirectory="/org.eclipse.m2e.model.edit/src/main/java" editDirectory="/org.eclipse.m2e.model.edit/src/main/java"
+ editorDirectory="/org.eclipse.m2e.model.edit/src/main/java" modelPluginID="org.eclipse.m2e.model.edit"
+ modelName="Pom" testsDirectory="/org.eclipse.model.edit.tests/src/main/java"
+ importerID="org.eclipse.xsd.ecore.importer" complianceLevel="5.0" copyrightFields="false"
+ editPluginID="org.eclipse.m2e.model.edit" language="">
+ <foreignModel>http://maven.apache.org/maven-v4_0_0.xsd</foreignModel>
+ <genPackages prefix="Pom" basePackage="org.eclipse.m2e.model.edit" resource="XML"
+ disposableProviderFactory="true" ecorePackage="pom.ecore#/">
+ <genClasses ecoreClass="pom.ecore#//Activation">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Activation/activeByDefault"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Activation/jdk"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Activation/os"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Activation/property"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Activation/file"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//ActivationFile">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ActivationFile/missing"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ActivationFile/exists"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//ActivationOS">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ActivationOS/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ActivationOS/family"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ActivationOS/arch"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ActivationOS/version"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//ActivationProperty">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ActivationProperty/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ActivationProperty/value"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Build">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Build/sourceDirectory"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Build/scriptSourceDirectory"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Build/testSourceDirectory"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Build/outputDirectory"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Build/testOutputDirectory"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Build/extensions"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//BuildBase">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//BuildBase/defaultGoal"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//BuildBase/resources"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//BuildBase/testResources"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//BuildBase/directory"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//BuildBase/finalName"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//BuildBase/pluginManagement"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//BuildBase/plugins"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute pom.ecore#//BuildBase/filters"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//CiManagement">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//CiManagement/system"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//CiManagement/url"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//CiManagement/notifiers"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Contributor">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Contributor/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Contributor/email"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Contributor/url"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Contributor/organization"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Contributor/organizationUrl"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Contributor/timezone"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Contributor/properties"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute pom.ecore#//Contributor/roles"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Dependency">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Dependency/groupId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Dependency/artifactId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Dependency/version"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Dependency/type"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Dependency/classifier"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Dependency/scope"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Dependency/systemPath"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Dependency/exclusions"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Dependency/optional"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//DependencyManagement">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//DependencyManagement/dependencies"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//DeploymentRepository">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//DeploymentRepository/uniqueVersion"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//DeploymentRepository/id"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//DeploymentRepository/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//DeploymentRepository/url"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//DeploymentRepository/layout"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Developer">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Developer/id"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Developer/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Developer/email"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Developer/url"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Developer/organization"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Developer/organizationUrl"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Developer/timezone"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Developer/properties"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute pom.ecore#//Developer/roles"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//DistributionManagement">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//DistributionManagement/repository"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//DistributionManagement/snapshotRepository"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//DistributionManagement/site"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//DistributionManagement/downloadUrl"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//DistributionManagement/relocation"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//DistributionManagement/status"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//DocumentRoot">
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//DocumentRoot/mixed"/>
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference pom.ecore#//DocumentRoot/xMLNSPrefixMap"/>
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference pom.ecore#//DocumentRoot/xSISchemaLocation"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//DocumentRoot/project"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Exclusion">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Exclusion/artifactId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Exclusion/groupId"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Extension">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Extension/groupId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Extension/artifactId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Extension/version"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//IssueManagement">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//IssueManagement/system"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//IssueManagement/url"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//License">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//License/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//License/url"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//License/distribution"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//License/comments"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//MailingList">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//MailingList/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//MailingList/subscribe"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//MailingList/unsubscribe"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//MailingList/post"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//MailingList/archive"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute pom.ecore#//MailingList/otherArchives"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Model">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/parent"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Model/modelVersion"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Model/groupId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Model/artifactId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Model/packaging"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Model/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Model/version"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Model/description"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Model/url"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/prerequisites"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/issueManagement"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/ciManagement"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Model/inceptionYear"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/mailingLists"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/developers"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/contributors"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/licenses"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/scm"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/organization"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/build"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/profiles"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/repositories"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/pluginRepositories"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/dependencies"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/reporting"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/dependencyManagement"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/distributionManagement"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Model/properties"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute pom.ecore#//Model/modules"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Notifier">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Notifier/type"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Notifier/sendOnError"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Notifier/sendOnFailure"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Notifier/sendOnSuccess"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Notifier/sendOnWarning"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Notifier/address"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Notifier/configuration"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Organization">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Organization/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Organization/url"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Parent">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Parent/artifactId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Parent/groupId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Parent/version"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Parent/relativePath"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Plugin">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Plugin/groupId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Plugin/artifactId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Plugin/version"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Plugin/extensions"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Plugin/executions"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Plugin/dependencies"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Plugin/inherited"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference pom.ecore#//Plugin/configuration"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//PluginExecution">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//PluginExecution/id"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//PluginExecution/phase"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//PluginExecution/inherited"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute pom.ecore#//PluginExecution/goals"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference pom.ecore#//PluginExecution/configuration"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//PluginManagement">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//PluginManagement/plugins"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Prerequisites">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Prerequisites/maven"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Profile">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Profile/id"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Profile/activation"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Profile/build"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Profile/repositories"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Profile/pluginRepositories"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Profile/dependencies"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Profile/reports"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Profile/dependencyManagement"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Profile/distributionManagement"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Profile/properties"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute pom.ecore#//Profile/modules"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference pom.ecore#//Profile/reporting"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Relocation">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Relocation/groupId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Relocation/artifactId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Relocation/version"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Relocation/message"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Reporting">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Reporting/excludeDefaults"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Reporting/outputDirectory"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Reporting/plugins"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//ReportPlugin">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ReportPlugin/groupId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ReportPlugin/artifactId"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ReportPlugin/version"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ReportPlugin/inherited"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//ReportPlugin/reportSets"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference pom.ecore#//ReportPlugin/configuration"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//ReportSet">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ReportSet/id"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//ReportSet/inherited"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute pom.ecore#//ReportSet/reports"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference pom.ecore#//ReportSet/configuration"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Repository">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Repository/releases"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference pom.ecore#//Repository/snapshots"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Repository/id"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Repository/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Repository/url"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Repository/layout"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//RepositoryPolicy">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//RepositoryPolicy/enabled"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//RepositoryPolicy/updatePolicy"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//RepositoryPolicy/checksumPolicy"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Resource">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Resource/targetPath"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Resource/filtering"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Resource/directory"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute pom.ecore#//Resource/includes"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute pom.ecore#//Resource/excludes"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Scm">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Scm/connection"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Scm/developerConnection"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Scm/tag"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Scm/url"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Site">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Site/id"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Site/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Site/url"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//PropertyElement">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//PropertyElement/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//PropertyElement/value"/>
+ </genClasses>
+ <genClasses ecoreClass="pom.ecore#//Configuration">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute pom.ecore#//Configuration/node"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.xsd b/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.xsd
new file mode 100644
index 00000000..5dc9121c
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.xsd
@@ -0,0 +1,1971 @@
+<?xml version="1.0"?>
+<xs:schema
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="http://maven.apache.org/POM"
+ xmlns="http://maven.apache.org/POM">
+ <xs:element name="project" type="Model">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The &lt;code&gt;&amp;lt;project&amp;gt;&lt;/code&gt; element is the root of the descriptor.
+ The following table lists all of the possible child elements.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="Model">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The &lt;code&gt;&amp;lt;project&amp;gt;&lt;/code&gt; element is the root of the descriptor.
+ The following table lists all of the possible child elements.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="parent" minOccurs="0" type="Parent">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The location of the parent project, if one exists. Values from the
+ parent project will be the default for this project if they are
+ left unspecified. The location is given as a group ID, artifact ID and version.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="modelVersion" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Declares to which version of project descriptor this POM conforms.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ A universally unique identifier for a project. It is normal to
+ use a fully-qualified package name to distinguish it from other projects with a similar name
+ (eg. &lt;code&gt;org.apache.maven&lt;/code&gt;).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The identifier for this artifact that is unique within the group given by the group ID.
+ An artifact is something that is either produced or used by a project. Examples of artifacts produced by
+ Maven for a project include: JARs, source and binary distributions, and WARs.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="packaging" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The type of artifact this project produces, for example &lt;code&gt;jar&lt;/code&gt;
+ &lt;code&gt;war&lt;/code&gt;
+ &lt;code&gt;ear&lt;/code&gt;
+ &lt;code&gt;pom&lt;/code&gt;.
+ Plugins can create their own packaging, and
+ therefore their own packaging types,
+ so this list does not contain all possible types.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The full name of the project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The current version of the artifact produced by this project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="description" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ A detailed description of the project, used by Maven whenever it needs to describe the project,
+ such as on the web site. While this element can be specified as CDATA to enable
+ the use of HTML tags within the description, it is discouraged to allow plain text representation.
+ If you need to modify the index page of the generated web site, you are able to specify your own instead
+ of adjusting this text.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The URL to the project&apos;s homepage.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="prerequisites" minOccurs="0" type="Prerequisites">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Describes the prerequisites in the build environment for this project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="issueManagement" minOccurs="0" type="IssueManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The project&apos;s issue management system information.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ciManagement" minOccurs="0" type="CiManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The project&apos;s continuous integration information.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="inceptionYear" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The year of the project&apos;s inception, specified with 4 digits.
+ This value is used when generating copyright notices as well as being informational.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="mailingLists" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Contains information about a project&apos;s mailing lists.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="mailingList" minOccurs="0" maxOccurs="unbounded" type="MailingList"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="developers" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Describes the committers of a project.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="developer" minOccurs="0" maxOccurs="unbounded" type="Developer"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="contributors" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Describes the contributors to a project that are not yet committers.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="contributor" minOccurs="0" maxOccurs="unbounded" type="Contributor"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="licenses" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the licenses for this project.
+ Each license is described by a &lt;code&gt;license&lt;/code&gt; element, which
+ is then described by additional elements.
+ Projects should only list the license(s) that applies to the project
+ and not the licenses that apply to dependencies.
+ If multiple licenses are listed, it is assumed that the user can select any of them, not that they
+ must accept all.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="license" minOccurs="0" maxOccurs="unbounded" type="License"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="scm" minOccurs="0" type="Scm">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specification for the SCM used by the project, such as CVS, Subversion, etc.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="organization" minOccurs="0" type="Organization">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes various attributes of the organization to
+ which the project belongs. These attributes are utilized when
+ documentation is created (for copyright notices and links).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="build" minOccurs="0" type="Build">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">Information required to build the project.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="profiles" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ A listing of project-local build profiles which will modify the build process when activated.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="profile" minOccurs="0" maxOccurs="unbounded" type="Profile"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="modules" type="Modules" minOccurs="0"/>
+ <xs:element name="repositories" type="Repositories" minOccurs="0"/>
+ <xs:element name="pluginRepositories" type="PluginRepositories" minOccurs="0"/>
+ <xs:element name="dependencies" type="Dependencies" minOccurs="0"/>
+ <xs:element name="reports" type="Reports" minOccurs="0"/>
+ <xs:element name="reporting" minOccurs="0" type="Reporting">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This element includes the specification of report plugins to use to generate the reports on the
+ Maven-generated site. These reports will be run when a user executes &lt;code&gt;mvn site&lt;/code&gt;. All of the
+ reports will be included in the navigation bar for browsing.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="dependencyManagement" minOccurs="0" type="DependencyManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Default dependency information for projects that inherit from
+ this one. The dependencies in this section are not immediately resolved.
+ Instead, when a POM derived from this one declares a dependency
+ described by a matching groupId and artifactId, the version and other values from this
+ section are used for that dependency if they were not already specified.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="distributionManagement" minOccurs="0" type="DistributionManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Distribution information for a project that enables deployment of the site
+ and artifacts to remote web servers and repositories respectively.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="properties" type="Properties" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Repositories">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The lists of the remote repositories for discovering dependencies and
+ extensions.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="repository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Reports">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ &lt;b&gt;Deprecated&lt;/b&gt;. Now ignored by Maven.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Properties">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Properties that can be used throughout the POM as a substitution, and are used as filters in resources
+ if enabled. The format is &lt;code&gt;&amp;lt;name&amp;gt;value&amp;lt;/name&amp;gt;&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="PluginRepositories">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The lists of the remote repositories for discovering plugins for builds and reports.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="pluginRepository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Modules">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The modules (sometimes called subprojects) to build as a part of this project.
+ Each module listed is a relative path to the directory containing the module.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="module" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Contributor">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Description of a person who has contributed to the project, but who does
+ not have commit privileges. Usually, these contributions come in the
+ form of patches submitted.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The full name of the contributor.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="email" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The email address of the contributor.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The URL for the homepage of the contributor.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="organization" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The organization to which the contributor belongs.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="organizationUrl" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The URL of the organization.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="roles" type="Roles" minOccurs="0"/>
+ <xs:element name="timezone" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The timezone the contributor is in. This is a number in the range -11 to 12.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="properties" type="Properties" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Roles">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The roles the contributor plays in the project. Each role is
+ described by a &lt;code&gt;role&lt;/code&gt; element, the body of which is a
+ role name. This can also be used to describe the contribution.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="role" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Profile">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Modifications to the build process which is activated based on environmental parameters or command line arguments.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="id" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The identifier of this build profile. This used both for command line activation, and identifies
+ identical profiles to merge with during inheritance.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="activation" minOccurs="0" type="Activation">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The conditional logic which will automatically
+ trigger the inclusion of this profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="build" minOccurs="0" type="BuildBase">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Information required to build the project.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="modules" type="StringModules" minOccurs="0"/>
+ <xs:element name="repositories" type="Repositories" minOccurs="0"/>
+ <xs:element name="pluginRepositories" type="PluginRepositories" minOccurs="0"/>
+ <xs:element name="dependencies" type="Dependencies" minOccurs="0"/>
+ <xs:element name="reports" type="Reports" minOccurs="0"/>
+ <xs:element name="reporting" minOccurs="0" type="Reporting">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This element includes the specification of report plugins to use to generate the reports on the
+ Maven-generated site. These reports will be run when a user executes &lt;code&gt;mvn site&lt;/code&gt;. All of the
+ reports will be included in the navigation bar for browsing.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="dependencyManagement" minOccurs="0" type="DependencyManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Default dependency information for projects that inherit from
+ this one. The dependencies in this section are not immediately resolved.
+ Instead, when a POM derived from this one declares a dependency
+ described by a matching groupId and artifactId, the version and other values from this
+ section are used for that dependency if they were not already specified.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="distributionManagement" minOccurs="0" type="DistributionManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Distribution information for a project that enables deployment of the site
+ and artifacts to remote web servers and repositories respectively.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="properties" type="Properties" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="StringModules">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The modules (sometimes called subprojects) to build as a part of this project.
+ Each module listed is a relative path to the directory containing the module.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="module" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Activation">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The conditions within the build runtime environment which will trigger
+ the automatic inclusion of the build profile.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="activeByDefault" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Flag specifying whether this profile is active by default.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="jdk" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specifies that this profile will be activated when a matching JDK is detected. For example, &lt;code&gt;1.4&lt;/code&gt;
+ only activates on JDKs versioned 1.4, while &lt;code&gt;!1.4&lt;/code&gt; matches any JDK that is not version 1.4.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="os" minOccurs="0" type="ActivationOS">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specifies that this profile will be activated when matching operating system attributes are detected.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="property" minOccurs="0" type="ActivationProperty">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specifies that this profile will be activated when this system property is specified.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="file" minOccurs="0" type="ActivationFile">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specifies that this profile will be activated based on existence of a file.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ActivationFile">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This is the file specification used to activate the profile. The missing value will be the location
+ of a file that needs to exist, and if it doesn&apos;t the profile will be activated. On the other hand exists will test
+ for the existence of the file and if it is there the profile will be activated.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="missing" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the file that must be missing to activate the profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="exists" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the file that must exist to activate the profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ActivationProperty">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This is the property specification used to activate a profile. If the value field is empty,
+ then the existence of the named property will activate the profile, otherwise it does a case-sensitive
+ match against the property value as well.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the property to be used to activate a profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="value" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The value of the property required to activate a profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ActivationOS">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This is an activator which will detect an operating system&apos;s attributes in order to activate
+ its profile.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the operating system to be used to activate the profile. This must be an exact match
+ of the &lt;code&gt;${os.name}&lt;/code&gt; Java property, such as &lt;code&gt;Windows XP&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="family" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The general family of the OS to be used to activate the profile, such as &lt;code&gt;windows&lt;/code&gt; or &lt;code&gt;unix&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="arch" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The architecture of the operating system to be used to activate the profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The version of the operating system to be used to activate the profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Dependencies">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the dependencies associated with a
+ project.
+ These dependencies are used to construct a classpath for your
+ project during the build process. They are automatically downloaded from the
+ repositories defined in this project.
+ See &lt;a href=&quot;http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html&quot;&gt;the
+ dependency mechanism&lt;/a&gt; for more information.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="dependency" minOccurs="0" maxOccurs="unbounded" type="Dependency"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="DependencyManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Section for management of default dependency information for use in a group of POMs.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="dependencies" type="Dependencies" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Dependency">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The project group that produced the dependency, e.g.
+ &lt;code&gt;org.apache.maven&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The unique id for an artifact produced by the project group, e.g.
+ &lt;code&gt;maven-artifact&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The version of the dependency, e.g. &lt;code&gt;3.2.1&lt;/code&gt;. In Maven 2, this can also be
+ specified as a range of versions.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="type" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The type of dependency. This defaults to &lt;code&gt;jar&lt;/code&gt;. While it usually represents the extension on
+ the filename of the dependency, that is not always the case. A type can be mapped to a different
+ extension and a classifier.
+ The type often correspongs to the packaging used, though this is also not always the case.
+ Some examples are &lt;code&gt;jar&lt;/code&gt;, &lt;code&gt;war&lt;/code&gt;, &lt;code&gt;ejb-client&lt;/code&gt; and &lt;code&gt;test-jar&lt;/code&gt;.
+ New types can be defined by plugins that set
+ &lt;code&gt;extensions&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;, so this is not a complete list.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="classifier" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The classifier of the dependency. This allows distinguishing two artifacts that belong to the same POM but
+ were built differently, and is appended to the filename after the version. For example,
+ &lt;code&gt;jdk14&lt;/code&gt; and &lt;code&gt;jdk15&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="scope" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The scope of the dependency - &lt;code&gt;compile&lt;/code&gt;, &lt;code&gt;runtime&lt;/code&gt;, &lt;code&gt;test&lt;/code&gt;,
+ &lt;code&gt;system&lt;/code&gt;, and &lt;code&gt;provided&lt;/code&gt;. Used to
+ calculate the various classpaths used for compilation, testing, and so on. It also assists in determining
+ which artifacts to include in a distribution of this project. For more information, see
+ &lt;a href=&quot;http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html&quot;&gt;the
+ dependency mechanism&lt;/a&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="systemPath" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ FOR SYSTEM SCOPE ONLY. Note that use of this property is &lt;b&gt;discouraged&lt;/b&gt; and may be replaced in later
+ versions. This specifies the path on the filesystem for this dependency.
+ Requires an absolute path for the value, not relative.
+ Use a property that gives the machine specific absolute path,
+ e.g. &lt;code&gt;${java.home}&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="exclusions" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Lists a set of artifacts that should be excluded from this dependency&apos;s artifact list when it comes to
+ calculating transitive dependencies.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="exclusion" minOccurs="0" maxOccurs="unbounded" type="Exclusion"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="optional" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Indicates the dependency is optional for use of this library. While the version of the dependency will be
+ taken into account for dependency calculation if the library is used elsewhere, it will not be passed on
+ transitively.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Exclusion">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The artifact ID of the project to exclude.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The group ID of the project to exclude.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Reporting">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Section for management of reports and their configuration.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="excludeDefaults" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">If true, then the default reports are not included in the site generation. This includes the
+ reports in the &quot;Project Info&quot; menu.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="outputDirectory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Where to store all of the generated reports. The default is
+ &lt;code&gt;${project.build.directory}/site&lt;/code&gt;
+ .
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="plugins" type="ReportPlugins" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ReportPlugins">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The reporting plugins to use and their configuration.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="plugin" minOccurs="0" maxOccurs="unbounded" type="ReportPlugin"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="ReportPlugin">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The group ID of the reporting plugin in the repository.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The artifact ID of the reporting plugin in the repository.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The version of the reporting plugin to be used.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="inherited" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether the configuration in this plugin should be made available to projects that
+ inherit from this one.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="configuration" type="Configuration" minOccurs="0"/>
+ <xs:element name="reportSets" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Multiple specifications of a set of reports, each having (possibly) different
+ configuration. This is the reporting parallel to an &lt;code&gt;execution&lt;/code&gt; in the build.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="reportSet" minOccurs="0" maxOccurs="unbounded" type="ReportSet"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Configuration">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The configuration (anything goes)</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="ReportSet">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Represents a set of reports and configuration to be used to generate them.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="id" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">The unique id for this report set, to be used during POM inheritance.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="configuration" type="Configuration" minOccurs="0"/>
+ <xs:element name="inherited" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Whether any configuration should be propagated to child POMs.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="reports" type="StringReports" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="StringReports">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The list of reports from this plugin which should be generated from this set.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="report" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="BuildBase">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="defaultGoal" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The default goal (or phase in Maven 2) to execute when none is specified for the project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="resources" type="Resources" minOccurs="0"/>
+ <xs:element name="testResources" type="TestResources" minOccurs="0"/>
+ <xs:element name="directory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The directory where all files generated by the build are placed.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="finalName" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The filename (excluding the extension, and with no path information) that the produced artifact
+ will be called. The default value is &lt;code&gt;${artifactId}-${version}&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="filters" type="Filters" minOccurs="0"/>
+ <xs:element name="pluginManagement" minOccurs="0" type="PluginManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Default plugin information to be made available for reference by
+ projects derived from this one. This plugin configuration will not
+ be resolved or bound to the lifecycle unless referenced. Any local
+ configuration for a given plugin will override the plugin&apos;s entire
+ definition here.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="plugins" type="Plugins" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="TestResources">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the classpath resources such as properties files associated with a
+ project&apos;s unit tests.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="testResource" minOccurs="0" maxOccurs="unbounded" type="Resource"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Resources">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the classpath resources such as properties files associated with a
+ project. These resources are often included in the final package.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="resource" minOccurs="0" maxOccurs="unbounded" type="Resource"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Plugins">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The list of plugins to use.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="plugin" minOccurs="0" maxOccurs="unbounded" type="Plugin"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Filters">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The list of filter properties files that are used when filtering is enabled.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="Plugin">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The group ID of the plugin in the repository.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The artifact ID of the plugin in the repository.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The version (or valid range of verisons) of the plugin to be used.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="extensions" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to load Maven extensions (such as packaging and type handlers) from this
+ plugin. For performance reasons, this should only be enabled when necessary.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="executions" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Multiple specifications of a set of goals to execute during the build lifecycle, each having
+ (possibly) different
+ configuration.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="execution" minOccurs="0" maxOccurs="unbounded" type="PluginExecution"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="dependencies" type="Dependencies" minOccurs="0"/>
+ <xs:element name="goals" type="Goals" minOccurs="0"/>
+ <xs:element name="inherited" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Whether any configuration should be propagated to child POMs.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="configuration" type="Configuration" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Goals">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ &lt;b&gt;Deprecated&lt;/b&gt;. Unused by Maven.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="PluginExecution">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="id" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The identifier of this execution for labelling the goals during the build, and for matching
+ exections to merge during inheritance.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="phase" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The build lifecycle phase to bind the goals in this execution to. If omitted, the goals will
+ be bound to the default specified in their metadata.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="goals" type="StringGoals" minOccurs="0"/>
+ <xs:element name="inherited" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Whether any configuration should be propagated to child POMs.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="configuration" type="Configuration" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="StringGoals">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The goals to execute with the given configuration.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="goal" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="PluginManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Section for management of default plugin information for use in a group of POMs.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="plugins" type="Plugins" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Resource">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the classpath resources associated with a project or
+ unit tests.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="targetPath" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Describe the resource target path. For example, if you want that
+ resource to appear in a specific package
+ (&lt;code&gt;org.apache.maven.messages&lt;/code&gt;), you must specify this
+ element with this value: &lt;code&gt;org/apache/maven/messages&lt;/code&gt;.
+ This is not required if you simply put the resources in that directory structure at the source, however.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="filtering" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Whether resources are filtered to replace tokens with parameterised values or not.
+ The values are taken from the &lt;code&gt;properties&lt;/code&gt; element and from the properties in the files listed
+ in the &lt;code&gt;filters&lt;/code&gt; element.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="directory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Describe the directory where the resources are stored.
+ The path is relative to the POM.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="includes" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">A list of patterns to include, e.g. &lt;code&gt;**&amp;#47;*.xml&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="include" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="excludes" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">A list of patterns to exclude, e.g. &lt;code&gt;**&amp;#47;*.xml&lt;/code&gt;</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="DistributionManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This elements describes all that pertains to distribution for a project.
+ It is primarily used for deployment of artifacts and the site
+ produced by the build.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="repository" minOccurs="0" type="DeploymentRepository">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Information needed to deploy the artifacts generated by the project to a remote repository.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="snapshotRepository" minOccurs="0" type="DeploymentRepository">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Where to deploy snapshots of artifacts to. If not given, it defaults to the &lt;code&gt;repository&lt;/code&gt; element.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="site" minOccurs="0" type="Site">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Information needed for deploying the web site of the project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="downloadUrl" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The URL of the project&apos;s download page. If not given users will be referred to the homepage given by
+ &lt;code&gt;url&lt;/code&gt;. This is given to assist in locating artifacts that are not in the repository due to
+ licensing restrictions.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="relocation" minOccurs="0" type="Relocation">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Relocation information of the artifact if it has been moved to a new group ID and/or artifact ID.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="status" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Gives the status of this artifact in the remote repository. This must not be set in your local
+ project, as it is updated by tools placing it in the reposiory. Valid values are: &lt;code&gt;none&lt;/code&gt; (default),
+ &lt;code&gt;converted&lt;/code&gt; (repository manager converted this from an Maven 1 POM), &lt;code&gt;partner&lt;/code&gt;
+ (directly synced from a partner Maven 2 repository), &lt;code&gt;deployed&lt;/code&gt; (was deployed from a Maven 2
+ instance), &lt;code&gt;verified&lt;/code&gt; (has been hand verified as correct and final).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Site">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Contains the information needed for deploying websites.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="id" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ A unique identifier for a deployment locataion. This is used to match the site to configuration in
+ the &lt;code&gt;settings.xml&lt;/code&gt; file, for example.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Human readable name of the deployment location.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The url of the location where website is deployed, in the form &lt;code&gt;protocol://hostname/path&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Relocation">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Describes where an artifact has moved to. If any of the values are omitted, it is assumed to be the
+ same as it was before.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The group ID the artifact has moved to.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The new artifact ID of the artifact.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The new version of the artifact.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="message" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">An additional message to show the user about the move, such as the reason.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="DeploymentRepository">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Repository contains the information needed for deploying to the remote repoistory.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="uniqueVersion" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to assign snapshots a unique version comprised of the timestamp and build number, or to
+ use the same version each time</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="id" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ A unique identifier for a repository. This is used to match the repository to configuration in
+ the &lt;code&gt;settings.xml&lt;/code&gt; file, for example.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Human readable name of the repository.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The url of the repository, in the form &lt;code&gt;protocol://hostname/path&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="layout" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The type of layout this repository uses for locating and storing artifacts - can be &lt;code&gt;legacy&lt;/code&gt; or
+ &lt;code&gt;default&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Repository">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ A repository contains the information needed for establishing connections with remote repoistory.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="releases" minOccurs="0" type="RepositoryPolicy">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">How to handle downloading of releases from this repository.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="snapshots" minOccurs="0" type="RepositoryPolicy">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">How to handle downloading of snapshots from this repository.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="id" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ A unique identifier for a repository. This is used to match the repository to configuration in
+ the &lt;code&gt;settings.xml&lt;/code&gt; file, for example.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Human readable name of the repository.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The url of the repository, in the form &lt;code&gt;protocol://hostname/path&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="layout" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The type of layout this repository uses for locating and storing artifacts - can be &lt;code&gt;legacy&lt;/code&gt; or
+ &lt;code&gt;default&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="RepositoryPolicy">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Download policy</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="enabled" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to use this repository for downloading this type of artifact.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="updatePolicy" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The frequency for downloading updates - can be
+ &lt;code&gt;always,&lt;/code&gt;
+ &lt;code&gt;daily&lt;/code&gt;
+ (default),
+ &lt;code&gt;interval:XXX&lt;/code&gt;
+ (in minutes) or
+ &lt;code&gt;never&lt;/code&gt;
+ (only if it doesn&apos;t exist locally).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="checksumPolicy" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ What to do when verification of an artifact checksum fails. Valid values are
+ &lt;code&gt;ignore&lt;/code&gt;
+ ,
+ &lt;code&gt;fail&lt;/code&gt;
+ or
+ &lt;code&gt;warn&lt;/code&gt;
+ (the default).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="MailingList">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the mailing lists associated with
+ a project. The auto-generated site references this information.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The name of the mailing list.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="subscribe" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The email address or link that can be used to subscribe to the mailing list.
+ If this is an email address, a
+ &lt;code&gt;mailto:&lt;/code&gt; link will automatically be created when
+ the documentation is created.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="unsubscribe" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The email address or link that can be used to unsubscribe to
+ the mailing list. If this is an email address, a
+ &lt;code&gt;mailto:&lt;/code&gt; link will automatically be created
+ when the documentation is created.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="post" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The email address or link that can be used to post to
+ the mailing list. If this is an email address, a
+ &lt;code&gt;mailto:&lt;/code&gt; link will automatically be created
+ when the documentation is created.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="archive" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The link to a URL where you can browse the mailing list archive.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="otherArchives" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The link to alternate URLs where you can browse the list archive.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="otherArchive" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Build">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="sourceDirectory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element specifies a directory containing the source
+ of the project. The generated build system will compile
+ the source in this directory when the project is built.
+ The path given is relative to the project descriptor.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="scriptSourceDirectory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This element specifies a directory containing the script sources
+ of the project. This directory is meant to be different from the
+ sourceDirectory, in that its contents will be copied to the output
+ directory in most cases (since scripts are interpreted rather than
+ compiled).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="testSourceDirectory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This element specifies a directory containing the unit test
+ source of the project. The generated build system will
+ compile these directories when the project is being tested.
+ The path given is relative to the project descriptor.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="outputDirectory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The directory where compiled application classes are placed.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="testOutputDirectory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The directory where compiled test classes are placed.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="extensions" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">A set of build extensions to use from this project.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="extension" minOccurs="0" maxOccurs="unbounded" type="Extension"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="defaultGoal" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The default goal (or phase in Maven 2) to execute when none is specified for the project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="resources" type="Resources" minOccurs="0"/>
+ <xs:element name="testResources" type="TestResources" minOccurs="0"/>
+ <xs:element name="directory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The directory where all files generated by the build are placed.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="finalName" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The filename (excluding the extension, and with no path information) that the produced artifact
+ will be called. The default value is &lt;code&gt;${artifactId}-${version}&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="filters" type="Filters" minOccurs="0"/>
+ <xs:element name="pluginManagement" minOccurs="0" type="PluginManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Default plugin information to be made available for reference by
+ projects derived from this one. This plugin configuration will not
+ be resolved or bound to the lifecycle unless referenced. Any local
+ configuration for a given plugin will override the plugin&apos;s entire
+ definition here.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="plugins" type="Plugins" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Extension">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Describes a build extension to utilise.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The group ID of the extension&apos;s artifact.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The artifact ID of the extension.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The version of the extension.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="IssueManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Information about the issue tracking (or bug tracking) system used to manage this project.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="system" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the issue management system, e.g. Bugzilla</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">URL for the issue management system used by the project.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Parent">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The artifact id of the parent project to inherit from.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The group id of the parent project to inherit from.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The version of the parent project to inherit.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="relativePath" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The relative path of the parent &lt;code&gt;pom.xml&lt;/code&gt; file within the check out.
+ The default value is &lt;code&gt;../pom.xml&lt;/code&gt;.
+ Maven looks for the parent pom first in the reactor of currently building projects, then in this location on
+ the filesystem, then the local repository, and lastly in the remote repo.
+ &lt;code&gt;relativePath&lt;/code&gt; allows you to select a different location,
+ for example when your structure is flat, or deeper without an intermediate parent pom.
+ However, the group ID, artifact ID and version are still required,
+ and must match the file in the location given or it will revert to the repository for the POM.
+ This feature is only for enhancing the development in a local checkout of that project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Prerequisites">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Describes the prerequisites a project can have.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="maven" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The minimum version of Maven required to build the project, or to use this plugin.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="CiManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="system" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The name of the continuous integration system, e.g. &lt;code&gt;continuum&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ URL for the continuous integration system used by the project if it has a web interface.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="notifiers" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Configuration for notifying developers/users when a build is
+ unsuccessful, including user information and notification mode.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="notifier" minOccurs="0" maxOccurs="unbounded" type="Notifier"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Notifier">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Configures one method for notifying users/developers when a build breaks.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="type" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The mechanism used to deliver notifications.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="sendOnError" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to send notifications on error.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="sendOnFailure" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to send notifications on failure.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="sendOnSuccess" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to send notifications on success.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="sendOnWarning" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to send notifications on warning.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="address" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ &lt;b&gt;Deprecated&lt;/b&gt;. Where to send the notification to - eg email address.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="configuration" type="Configuration" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="License">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Describes the licenses for this project. This is used to generate
+ the license page of the project&apos;s web site, as well as being taken into consideration in other reporting and
+ validation. The licenses listed for the project are that of the project itself, and not of dependencies.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The full legal name of the license.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The official url for the license text.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="distribution" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The primary method by which this project may be distributed.
+ &lt;dl&gt;
+ &lt;dt&gt;repo&lt;/dt&gt;
+ &lt;dd&gt;may be downloaded from the Maven repository&lt;/dd&gt;
+ &lt;dt&gt;manual&lt;/dt&gt;
+ &lt;dd&gt;user must manually download and install the dependency.&lt;/dd&gt;
+ &lt;/dl&gt;
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="comments" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Addendum information pertaining to this license.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Developer">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Information about one of the committers on this project.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="id" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The unique ID of the developer in the SCM.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The full name of the contributor.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="email" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The email address of the contributor.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The URL for the homepage of the contributor.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="organization" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The organization to which the contributor belongs.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="organizationUrl" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The URL of the organization.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="roles" type="Roles" minOccurs="0"/>
+ <xs:element name="timezone" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The timezone the contributor is in. This is a number in the range -11 to 12.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="properties" type="Properties" minOccurs="0"/>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Scm">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="connection" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The source control management system URL
+ that describes the repository and how to connect to the
+ repository. For more information, see the
+ &lt;a href=&quot;http://maven.apache.org/scm/scm-url-format.html&quot;&gt;URL format&lt;/a&gt;
+ and &lt;a href=&quot;http://maven.apache.org/scm/scms-overview.html&quot;&gt;list of supported SCMs&lt;/a&gt;.
+ This connection is read-only.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="developerConnection" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Just like &lt;code&gt;connection&lt;/code&gt;, but for developers, i.e. this scm connection
+ will not be read only.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="tag" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The tag of current code. By default, it&apos;s set to HEAD during development.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The URL to the project&apos;s browsable SCM repository, such as ViewVC or Fisheye.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Organization">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">Specifies the organization that produces this project.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The full name of the organization.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The URL to the organization&apos;s home page.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+</xs:schema> \ No newline at end of file
diff --git a/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.xsd2ecore b/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.xsd2ecore
new file mode 100644
index 00000000..aa4b9dbb
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/pom.xsd2ecore
@@ -0,0 +1,768 @@
+<?xml version="1.0" encoding="ASCII"?>
+<xsd2ecore:XSD2EcoreMappingRoot xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsd2ecore="http://www.eclipse.org/emf/2002/XSD2Ecore" inputs="http://maven.apache.org/maven-v4_0_0.xsd#/"
+ outputs="pom.ecore#/" topToBottom="true">
+ <nested inputs="bundleentry://714/cache/www.w3.org/2001/XMLSchema.xsd#//string;XSDSimpleTypeDefinition=7"
+ outputs="http://www.eclipse.org/emf/2003/XMLType#//String"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Parent;XSDComplexTypeDefinition=28"
+ outputs="pom.ecore#//Parent">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Parent;XSDComplexTypeDefinition=28/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Parent/artifactId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Parent;XSDComplexTypeDefinition=28/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Parent/groupId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Parent;XSDComplexTypeDefinition=28/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Parent/version"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Parent;XSDComplexTypeDefinition=28/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Parent/relativePath"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Prerequisites;XSDComplexTypeDefinition=29"
+ outputs="pom.ecore#//Prerequisites">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Prerequisites;XSDComplexTypeDefinition=29/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Prerequisites/maven"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//IssueManagement;XSDComplexTypeDefinition=27"
+ outputs="pom.ecore#//IssueManagement">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//IssueManagement;XSDComplexTypeDefinition=27/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//IssueManagement/system"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//IssueManagement;XSDComplexTypeDefinition=27/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//IssueManagement/url"/>
+ </nested>
+ <nested inputs="bundleentry://714/cache/www.w3.org/2001/XMLSchema.xsd#//boolean;XSDSimpleTypeDefinition=8"
+ outputs="http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Notifier;XSDComplexTypeDefinition=31/XSDParticle/XSDModelGroup/XSDParticle=6/configuration;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ConfigurationType4">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Notifier;XSDComplexTypeDefinition=31/XSDParticle/XSDModelGroup/XSDParticle=6/configuration;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ConfigurationType4/any"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Notifier;XSDComplexTypeDefinition=31"
+ outputs="pom.ecore#//Notifier">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Notifier;XSDComplexTypeDefinition=31/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Notifier/type"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Notifier;XSDComplexTypeDefinition=31/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Notifier/sendOnError"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Notifier;XSDComplexTypeDefinition=31/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Notifier/sendOnFailure"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Notifier;XSDComplexTypeDefinition=31/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Notifier/sendOnSuccess"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Notifier;XSDComplexTypeDefinition=31/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//Notifier/sendOnWarning"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Notifier;XSDComplexTypeDefinition=31/XSDParticle/XSDModelGroup/XSDParticle=5"
+ outputs="pom.ecore#//Notifier/address"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Notifier;XSDComplexTypeDefinition=31/XSDParticle/XSDModelGroup/XSDParticle=6"
+ outputs="pom.ecore#//Notifier/configuration"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//CiManagement;XSDComplexTypeDefinition=30/XSDParticle/XSDModelGroup/XSDParticle=2/notifiers;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//NotifiersType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//CiManagement;XSDComplexTypeDefinition=30/XSDParticle/XSDModelGroup/XSDParticle=2/notifiers;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//NotifiersType/notifier"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//CiManagement;XSDComplexTypeDefinition=30"
+ outputs="pom.ecore#//CiManagement">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//CiManagement;XSDComplexTypeDefinition=30/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//CiManagement/system"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//CiManagement;XSDComplexTypeDefinition=30/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//CiManagement/url"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//CiManagement;XSDComplexTypeDefinition=30/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//CiManagement/notifiers"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//MailingList;XSDComplexTypeDefinition=24/XSDParticle/XSDModelGroup/XSDParticle=5/otherArchives;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//OtherArchivesType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//MailingList;XSDComplexTypeDefinition=24/XSDParticle/XSDModelGroup/XSDParticle=5/otherArchives;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//OtherArchivesType/otherArchive"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//MailingList;XSDComplexTypeDefinition=24"
+ outputs="pom.ecore#//MailingList">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//MailingList;XSDComplexTypeDefinition=24/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//MailingList/name"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//MailingList;XSDComplexTypeDefinition=24/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//MailingList/subscribe"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//MailingList;XSDComplexTypeDefinition=24/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//MailingList/unsubscribe"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//MailingList;XSDComplexTypeDefinition=24/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//MailingList/post"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//MailingList;XSDComplexTypeDefinition=24/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//MailingList/archive"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//MailingList;XSDComplexTypeDefinition=24/XSDParticle/XSDModelGroup/XSDParticle=5"
+ outputs="pom.ecore#//MailingList/otherArchives"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=13/mailingLists;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//MailingListsType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=13/mailingLists;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//MailingListsType/mailingList"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33/XSDParticle/XSDModelGroup/XSDParticle=6/roles;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//RolesType1">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33/XSDParticle/XSDModelGroup/XSDParticle=6/roles;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//RolesType1/role"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33/XSDParticle/XSDModelGroup/XSDParticle=8/properties;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//PropertiesType3">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33/XSDParticle/XSDModelGroup/XSDParticle=8/properties;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//PropertiesType3/any"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33"
+ outputs="pom.ecore#//Developer">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Developer/id"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Developer/name"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Developer/email"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Developer/url"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//Developer/organization"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33/XSDParticle/XSDModelGroup/XSDParticle=5"
+ outputs="pom.ecore#//Developer/organizationUrl"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33/XSDParticle/XSDModelGroup/XSDParticle=6"
+ outputs="pom.ecore#//Developer/roles"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33/XSDParticle/XSDModelGroup/XSDParticle=7"
+ outputs="pom.ecore#//Developer/timezone"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Developer;XSDComplexTypeDefinition=33/XSDParticle/XSDModelGroup/XSDParticle=8"
+ outputs="pom.ecore#//Developer/properties"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=14/developers;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//DevelopersType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=14/developers;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//DevelopersType/developer"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Contributor;XSDComplexTypeDefinition=1/XSDParticle/XSDModelGroup/XSDParticle=5/roles;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//RolesType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Contributor;XSDComplexTypeDefinition=1/XSDParticle/XSDModelGroup/XSDParticle=5/roles;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//RolesType/role"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Contributor;XSDComplexTypeDefinition=1/XSDParticle/XSDModelGroup/XSDParticle=7/properties;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//PropertiesType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Contributor;XSDComplexTypeDefinition=1/XSDParticle/XSDModelGroup/XSDParticle=7/properties;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//PropertiesType/any"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Contributor;XSDComplexTypeDefinition=1"
+ outputs="pom.ecore#//Contributor">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Contributor;XSDComplexTypeDefinition=1/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Contributor/name"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Contributor;XSDComplexTypeDefinition=1/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Contributor/email"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Contributor;XSDComplexTypeDefinition=1/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Contributor/url"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Contributor;XSDComplexTypeDefinition=1/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Contributor/organization"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Contributor;XSDComplexTypeDefinition=1/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//Contributor/organizationUrl"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Contributor;XSDComplexTypeDefinition=1/XSDParticle/XSDModelGroup/XSDParticle=5"
+ outputs="pom.ecore#//Contributor/roles"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Contributor;XSDComplexTypeDefinition=1/XSDParticle/XSDModelGroup/XSDParticle=6"
+ outputs="pom.ecore#//Contributor/timezone"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Contributor;XSDComplexTypeDefinition=1/XSDParticle/XSDModelGroup/XSDParticle=7"
+ outputs="pom.ecore#//Contributor/properties"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=15/contributors;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ContributorsType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=15/contributors;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ContributorsType/contributor"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//License;XSDComplexTypeDefinition=32"
+ outputs="pom.ecore#//License">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//License;XSDComplexTypeDefinition=32/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//License/name"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//License;XSDComplexTypeDefinition=32/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//License/url"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//License;XSDComplexTypeDefinition=32/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//License/distribution"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//License;XSDComplexTypeDefinition=32/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//License/comments"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=16/licenses;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//LicensesType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=16/licenses;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//LicensesType/license"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Scm;XSDComplexTypeDefinition=34"
+ outputs="pom.ecore#//Scm">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Scm;XSDComplexTypeDefinition=34/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Scm/connection"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Scm;XSDComplexTypeDefinition=34/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Scm/developerConnection"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Scm;XSDComplexTypeDefinition=34/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Scm/tag"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Scm;XSDComplexTypeDefinition=34/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Scm/url"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Organization;XSDComplexTypeDefinition=35"
+ outputs="pom.ecore#//Organization">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Organization;XSDComplexTypeDefinition=35/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Organization/name"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Organization;XSDComplexTypeDefinition=35/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Organization/url"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Extension;XSDComplexTypeDefinition=26"
+ outputs="pom.ecore#//Extension">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Extension;XSDComplexTypeDefinition=26/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Extension/groupId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Extension;XSDComplexTypeDefinition=26/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Extension/artifactId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Extension;XSDComplexTypeDefinition=26/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Extension/version"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=5/extensions;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ExtensionsType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=5/extensions;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ExtensionsType/extension"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Resource;XSDComplexTypeDefinition=17/XSDParticle/XSDModelGroup/XSDParticle=3/includes;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//IncludesType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Resource;XSDComplexTypeDefinition=17/XSDParticle/XSDModelGroup/XSDParticle=3/includes;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//IncludesType/include"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Resource;XSDComplexTypeDefinition=17/XSDParticle/XSDModelGroup/XSDParticle=4/excludes;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ExcludesType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Resource;XSDComplexTypeDefinition=17/XSDParticle/XSDModelGroup/XSDParticle=4/excludes;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ExcludesType/exclude"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Resource;XSDComplexTypeDefinition=17"
+ outputs="pom.ecore#//Resource">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Resource;XSDComplexTypeDefinition=17/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Resource/targetPath"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Resource;XSDComplexTypeDefinition=17/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Resource/filtering"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Resource;XSDComplexTypeDefinition=17/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Resource/directory"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Resource;XSDComplexTypeDefinition=17/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Resource/includes"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Resource;XSDComplexTypeDefinition=17/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//Resource/excludes"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=7/resources;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ResourcesType1">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=7/resources;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ResourcesType1/resource"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=8/testResources;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//TestResourcesType1">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=8/testResources;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//TestResourcesType1/testResource"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=11/filters;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//FiltersType1">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=11/filters;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//FiltersType1/filter"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginExecution;XSDComplexTypeDefinition=15/XSDParticle/XSDModelGroup/XSDParticle=2/goals;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//GoalsType1">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginExecution;XSDComplexTypeDefinition=15/XSDParticle/XSDModelGroup/XSDParticle=2/goals;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//GoalsType1/goal"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginExecution;XSDComplexTypeDefinition=15/XSDParticle/XSDModelGroup/XSDParticle=4/configuration;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ConfigurationType3">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginExecution;XSDComplexTypeDefinition=15/XSDParticle/XSDModelGroup/XSDParticle=4/configuration;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ConfigurationType3/any"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginExecution;XSDComplexTypeDefinition=15"
+ outputs="pom.ecore#//PluginExecution">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginExecution;XSDComplexTypeDefinition=15/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//PluginExecution/id"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginExecution;XSDComplexTypeDefinition=15/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//PluginExecution/phase"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginExecution;XSDComplexTypeDefinition=15/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//PluginExecution/goals"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginExecution;XSDComplexTypeDefinition=15/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//PluginExecution/inherited"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginExecution;XSDComplexTypeDefinition=15/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//PluginExecution/configuration"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=4/executions;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ExecutionsType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=4/executions;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ExecutionsType/execution"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Exclusion;XSDComplexTypeDefinition=9"
+ outputs="pom.ecore#//Exclusion">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Exclusion;XSDComplexTypeDefinition=9/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Exclusion/artifactId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Exclusion;XSDComplexTypeDefinition=9/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Exclusion/groupId"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Dependency;XSDComplexTypeDefinition=8/XSDParticle/XSDModelGroup/XSDParticle=7/exclusions;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ExclusionsType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Dependency;XSDComplexTypeDefinition=8/XSDParticle/XSDModelGroup/XSDParticle=7/exclusions;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ExclusionsType/exclusion"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Dependency;XSDComplexTypeDefinition=8"
+ outputs="pom.ecore#//Dependency">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Dependency;XSDComplexTypeDefinition=8/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Dependency/groupId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Dependency;XSDComplexTypeDefinition=8/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Dependency/artifactId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Dependency;XSDComplexTypeDefinition=8/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Dependency/version"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Dependency;XSDComplexTypeDefinition=8/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Dependency/type"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Dependency;XSDComplexTypeDefinition=8/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//Dependency/classifier"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Dependency;XSDComplexTypeDefinition=8/XSDParticle/XSDModelGroup/XSDParticle=5"
+ outputs="pom.ecore#//Dependency/scope"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Dependency;XSDComplexTypeDefinition=8/XSDParticle/XSDModelGroup/XSDParticle=6"
+ outputs="pom.ecore#//Dependency/systemPath"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Dependency;XSDComplexTypeDefinition=8/XSDParticle/XSDModelGroup/XSDParticle=7"
+ outputs="pom.ecore#//Dependency/exclusions"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Dependency;XSDComplexTypeDefinition=8/XSDParticle/XSDModelGroup/XSDParticle=8"
+ outputs="pom.ecore#//Dependency/optional"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=5/dependencies;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//DependenciesType3">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=5/dependencies;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//DependenciesType3/dependency"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=6/goals;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//GoalsType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=6/goals;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//GoalsType/any"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=8/configuration;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ConfigurationType2">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=8/configuration;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ConfigurationType2/any"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14"
+ outputs="pom.ecore#//Plugin">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Plugin/groupId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Plugin/artifactId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Plugin/version"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Plugin/extensions"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//Plugin/executions"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=5"
+ outputs="pom.ecore#//Plugin/dependencies"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=6"
+ outputs="pom.ecore#//Plugin/goals"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=7"
+ outputs="pom.ecore#//Plugin/inherited"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Plugin;XSDComplexTypeDefinition=14/XSDParticle/XSDModelGroup/XSDParticle=8"
+ outputs="pom.ecore#//Plugin/configuration"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginManagement;XSDComplexTypeDefinition=16/XSDParticle/XSDModelGroup/XSDParticle/plugins;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//PluginsType3">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginManagement;XSDComplexTypeDefinition=16/XSDParticle/XSDModelGroup/XSDParticle/plugins;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//PluginsType3/plugin"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginManagement;XSDComplexTypeDefinition=16"
+ outputs="pom.ecore#//PluginManagement">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//PluginManagement;XSDComplexTypeDefinition=16/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//PluginManagement/plugins"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=13/plugins;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//PluginsType2">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=13/plugins;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//PluginsType2/plugin"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25"
+ outputs="pom.ecore#//Build">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Build/sourceDirectory"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Build/scriptSourceDirectory"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Build/testSourceDirectory"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Build/outputDirectory"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//Build/testOutputDirectory"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=5"
+ outputs="pom.ecore#//Build/extensions"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=6"
+ outputs="pom.ecore#//Build/defaultGoal"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=7"
+ outputs="pom.ecore#//Build/resources"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=8"
+ outputs="pom.ecore#//Build/testResources"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=9"
+ outputs="pom.ecore#//Build/directory"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=10"
+ outputs="pom.ecore#//Build/finalName"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=11"
+ outputs="pom.ecore#//Build/filters"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=12"
+ outputs="pom.ecore#//Build/pluginManagement"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Build;XSDComplexTypeDefinition=25/XSDParticle/XSDModelGroup/XSDParticle=13"
+ outputs="pom.ecore#//Build/plugins"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ActivationOS;XSDComplexTypeDefinition=6"
+ outputs="pom.ecore#//ActivationOS">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ActivationOS;XSDComplexTypeDefinition=6/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ActivationOS/name"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ActivationOS;XSDComplexTypeDefinition=6/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//ActivationOS/family"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ActivationOS;XSDComplexTypeDefinition=6/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//ActivationOS/arch"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ActivationOS;XSDComplexTypeDefinition=6/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//ActivationOS/version"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ActivationProperty;XSDComplexTypeDefinition=5"
+ outputs="pom.ecore#//ActivationProperty">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ActivationProperty;XSDComplexTypeDefinition=5/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ActivationProperty/name"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ActivationProperty;XSDComplexTypeDefinition=5/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//ActivationProperty/value"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ActivationFile;XSDComplexTypeDefinition=4"
+ outputs="pom.ecore#//ActivationFile">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ActivationFile;XSDComplexTypeDefinition=4/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ActivationFile/missing"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ActivationFile;XSDComplexTypeDefinition=4/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//ActivationFile/exists"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Activation;XSDComplexTypeDefinition=3"
+ outputs="pom.ecore#//Activation">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Activation;XSDComplexTypeDefinition=3/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Activation/activeByDefault"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Activation;XSDComplexTypeDefinition=3/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Activation/jdk"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Activation;XSDComplexTypeDefinition=3/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Activation/os"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Activation;XSDComplexTypeDefinition=3/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Activation/property"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Activation;XSDComplexTypeDefinition=3/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//Activation/file"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=1/resources;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ResourcesType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=1/resources;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ResourcesType/resource"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=2/testResources;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//TestResourcesType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=2/testResources;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//TestResourcesType/testResource"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=5/filters;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//FiltersType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=5/filters;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//FiltersType/filter"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=7/plugins;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//PluginsType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=7/plugins;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//PluginsType/plugin"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13"
+ outputs="pom.ecore#//BuildBase">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//BuildBase/defaultGoal"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//BuildBase/resources"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//BuildBase/testResources"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//BuildBase/directory"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//BuildBase/finalName"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=5"
+ outputs="pom.ecore#//BuildBase/filters"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=6"
+ outputs="pom.ecore#//BuildBase/pluginManagement"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//BuildBase;XSDComplexTypeDefinition=13/XSDParticle/XSDModelGroup/XSDParticle=7"
+ outputs="pom.ecore#//BuildBase/plugins"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=3/modules;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ModulesType1">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=3/modules;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ModulesType1/module"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//RepositoryPolicy;XSDComplexTypeDefinition=23"
+ outputs="pom.ecore#//RepositoryPolicy">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//RepositoryPolicy;XSDComplexTypeDefinition=23/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//RepositoryPolicy/enabled"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//RepositoryPolicy;XSDComplexTypeDefinition=23/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//RepositoryPolicy/updatePolicy"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//RepositoryPolicy;XSDComplexTypeDefinition=23/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//RepositoryPolicy/checksumPolicy"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Repository;XSDComplexTypeDefinition=22"
+ outputs="pom.ecore#//Repository">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Repository;XSDComplexTypeDefinition=22/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Repository/releases"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Repository;XSDComplexTypeDefinition=22/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Repository/snapshots"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Repository;XSDComplexTypeDefinition=22/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Repository/id"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Repository;XSDComplexTypeDefinition=22/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Repository/name"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Repository;XSDComplexTypeDefinition=22/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//Repository/url"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Repository;XSDComplexTypeDefinition=22/XSDParticle/XSDModelGroup/XSDParticle=5"
+ outputs="pom.ecore#//Repository/layout"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=4/repositories;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//RepositoriesType1">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=4/repositories;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//RepositoriesType1/repository"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=5/pluginRepositories;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//PluginRepositoriesType1">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=5/pluginRepositories;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//PluginRepositoriesType1/pluginRepository"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=6/dependencies;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//DependenciesType2">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=6/dependencies;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//DependenciesType2/dependency"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=7/reports;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ReportsType2">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=7/reports;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ReportsType2/any"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportPlugin;XSDComplexTypeDefinition=11/XSDParticle/XSDModelGroup/XSDParticle=4/configuration;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ConfigurationType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportPlugin;XSDComplexTypeDefinition=11/XSDParticle/XSDModelGroup/XSDParticle=4/configuration;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ConfigurationType/any"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportSet;XSDComplexTypeDefinition=12/XSDParticle/XSDModelGroup/XSDParticle=1/configuration;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ConfigurationType1">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportSet;XSDComplexTypeDefinition=12/XSDParticle/XSDModelGroup/XSDParticle=1/configuration;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ConfigurationType1/any"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportSet;XSDComplexTypeDefinition=12/XSDParticle/XSDModelGroup/XSDParticle=3/reports;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ReportsType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportSet;XSDComplexTypeDefinition=12/XSDParticle/XSDModelGroup/XSDParticle=3/reports;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ReportsType/report"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportSet;XSDComplexTypeDefinition=12"
+ outputs="pom.ecore#//ReportSet">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportSet;XSDComplexTypeDefinition=12/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ReportSet/id"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportSet;XSDComplexTypeDefinition=12/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//ReportSet/configuration"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportSet;XSDComplexTypeDefinition=12/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//ReportSet/inherited"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportSet;XSDComplexTypeDefinition=12/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//ReportSet/reports"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportPlugin;XSDComplexTypeDefinition=11/XSDParticle/XSDModelGroup/XSDParticle=5/reportSets;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ReportSetsType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportPlugin;XSDComplexTypeDefinition=11/XSDParticle/XSDModelGroup/XSDParticle=5/reportSets;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ReportSetsType/reportSet"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportPlugin;XSDComplexTypeDefinition=11"
+ outputs="pom.ecore#//ReportPlugin">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportPlugin;XSDComplexTypeDefinition=11/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ReportPlugin/groupId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportPlugin;XSDComplexTypeDefinition=11/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//ReportPlugin/artifactId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportPlugin;XSDComplexTypeDefinition=11/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//ReportPlugin/version"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportPlugin;XSDComplexTypeDefinition=11/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//ReportPlugin/inherited"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportPlugin;XSDComplexTypeDefinition=11/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//ReportPlugin/configuration"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//ReportPlugin;XSDComplexTypeDefinition=11/XSDParticle/XSDModelGroup/XSDParticle=5"
+ outputs="pom.ecore#//ReportPlugin/reportSets"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Reporting;XSDComplexTypeDefinition=10/XSDParticle/XSDModelGroup/XSDParticle=2/plugins;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//PluginsType1">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Reporting;XSDComplexTypeDefinition=10/XSDParticle/XSDModelGroup/XSDParticle=2/plugins;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//PluginsType1/plugin"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Reporting;XSDComplexTypeDefinition=10"
+ outputs="pom.ecore#//Reporting">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Reporting;XSDComplexTypeDefinition=10/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Reporting/excludeDefaults"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Reporting;XSDComplexTypeDefinition=10/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Reporting/outputDirectory"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Reporting;XSDComplexTypeDefinition=10/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Reporting/plugins"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DependencyManagement;XSDComplexTypeDefinition=7/XSDParticle/XSDModelGroup/XSDParticle/dependencies;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//DependenciesType1">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DependencyManagement;XSDComplexTypeDefinition=7/XSDParticle/XSDModelGroup/XSDParticle/dependencies;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//DependenciesType1/dependency"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DependencyManagement;XSDComplexTypeDefinition=7"
+ outputs="pom.ecore#//DependencyManagement">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DependencyManagement;XSDComplexTypeDefinition=7/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//DependencyManagement/dependencies"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DeploymentRepository;XSDComplexTypeDefinition=21"
+ outputs="pom.ecore#//DeploymentRepository">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DeploymentRepository;XSDComplexTypeDefinition=21/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//DeploymentRepository/uniqueVersion"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DeploymentRepository;XSDComplexTypeDefinition=21/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//DeploymentRepository/id"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DeploymentRepository;XSDComplexTypeDefinition=21/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//DeploymentRepository/name"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DeploymentRepository;XSDComplexTypeDefinition=21/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//DeploymentRepository/url"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DeploymentRepository;XSDComplexTypeDefinition=21/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//DeploymentRepository/layout"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Site;XSDComplexTypeDefinition=19"
+ outputs="pom.ecore#//Site">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Site;XSDComplexTypeDefinition=19/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Site/id"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Site;XSDComplexTypeDefinition=19/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Site/name"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Site;XSDComplexTypeDefinition=19/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Site/url"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Relocation;XSDComplexTypeDefinition=20"
+ outputs="pom.ecore#//Relocation">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Relocation;XSDComplexTypeDefinition=20/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Relocation/groupId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Relocation;XSDComplexTypeDefinition=20/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Relocation/artifactId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Relocation;XSDComplexTypeDefinition=20/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Relocation/version"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Relocation;XSDComplexTypeDefinition=20/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Relocation/message"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DistributionManagement;XSDComplexTypeDefinition=18"
+ outputs="pom.ecore#//DistributionManagement">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DistributionManagement;XSDComplexTypeDefinition=18/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//DistributionManagement/repository"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DistributionManagement;XSDComplexTypeDefinition=18/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//DistributionManagement/snapshotRepository"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DistributionManagement;XSDComplexTypeDefinition=18/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//DistributionManagement/site"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DistributionManagement;XSDComplexTypeDefinition=18/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//DistributionManagement/downloadUrl"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DistributionManagement;XSDComplexTypeDefinition=18/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//DistributionManagement/relocation"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//DistributionManagement;XSDComplexTypeDefinition=18/XSDParticle/XSDModelGroup/XSDParticle=5"
+ outputs="pom.ecore#//DistributionManagement/status"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=11/properties;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//PropertiesType1">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=11/properties;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//PropertiesType1/any"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2"
+ outputs="pom.ecore#//Profile">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Profile/id"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Profile/activation"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Profile/build"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Profile/modules"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//Profile/repositories"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=5"
+ outputs="pom.ecore#//Profile/pluginRepositories"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=6"
+ outputs="pom.ecore#//Profile/dependencies"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=7"
+ outputs="pom.ecore#//Profile/reports"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=8"
+ outputs="pom.ecore#//Profile/reporting"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=9"
+ outputs="pom.ecore#//Profile/dependencyManagement"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=10"
+ outputs="pom.ecore#//Profile/distributionManagement"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Profile;XSDComplexTypeDefinition=2/XSDParticle/XSDModelGroup/XSDParticle=11"
+ outputs="pom.ecore#//Profile/properties"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=20/profiles;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ProfilesType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=20/profiles;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ProfilesType/profile"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=21/modules;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ModulesType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=21/modules;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ModulesType/module"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=22/repositories;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//RepositoriesType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=22/repositories;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//RepositoriesType/repository"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=23/pluginRepositories;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//PluginRepositoriesType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=23/pluginRepositories;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//PluginRepositoriesType/pluginRepository"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=24/dependencies;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//DependenciesType">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=24/dependencies;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//DependenciesType/dependency"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=25/reports;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//ReportsType1">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=25/reports;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//ReportsType1/any"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=29/properties;XSDElementDeclaration/XSDComplexTypeDefinition"
+ outputs="pom.ecore#//PropertiesType2">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=29/properties;XSDElementDeclaration/XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//PropertiesType2/any"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition"
+ outputs="pom.ecore#//Model">
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle"
+ outputs="pom.ecore#//Model/parent"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=1"
+ outputs="pom.ecore#//Model/modelVersion"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=2"
+ outputs="pom.ecore#//Model/groupId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=3"
+ outputs="pom.ecore#//Model/artifactId"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=4"
+ outputs="pom.ecore#//Model/packaging"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=5"
+ outputs="pom.ecore#//Model/name"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=6"
+ outputs="pom.ecore#//Model/version"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=7"
+ outputs="pom.ecore#//Model/description"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=8"
+ outputs="pom.ecore#//Model/url"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=9"
+ outputs="pom.ecore#//Model/prerequisites"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=10"
+ outputs="pom.ecore#//Model/issueManagement"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=11"
+ outputs="pom.ecore#//Model/ciManagement"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=12"
+ outputs="pom.ecore#//Model/inceptionYear"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=13"
+ outputs="pom.ecore#//Model/mailingLists"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=14"
+ outputs="pom.ecore#//Model/developers"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=15"
+ outputs="pom.ecore#//Model/contributors"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=16"
+ outputs="pom.ecore#//Model/licenses"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=17"
+ outputs="pom.ecore#//Model/scm"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=18"
+ outputs="pom.ecore#//Model/organization"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=19"
+ outputs="pom.ecore#//Model/build"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=20"
+ outputs="pom.ecore#//Model/profiles"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=21"
+ outputs="pom.ecore#//Model/modules"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=22"
+ outputs="pom.ecore#//Model/repositories"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=23"
+ outputs="pom.ecore#//Model/pluginRepositories"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=24"
+ outputs="pom.ecore#//Model/dependencies"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=25"
+ outputs="pom.ecore#//Model/reports"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=26"
+ outputs="pom.ecore#//Model/reporting"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=27"
+ outputs="pom.ecore#//Model/dependencyManagement"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=28"
+ outputs="pom.ecore#//Model/distributionManagement"/>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//Model;XSDComplexTypeDefinition/XSDParticle/XSDModelGroup/XSDParticle=29"
+ outputs="pom.ecore#//Model/properties"/>
+ </nested>
+ <nested inputs="http://maven.apache.org/maven-v4_0_0.xsd#//project;XSDElementDeclaration"
+ outputs="pom.ecore#//DocumentRoot/project"/>
+</xsd2ecore:XSD2EcoreMappingRoot>
diff --git a/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/readme.txt b/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/readme.txt
new file mode 100644
index 00000000..611839eb
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/src/main/xsd/org/eclipse/m2e/model/pom/readme.txt
@@ -0,0 +1,9 @@
+
+ Changes made from the original model imported from XSD
+
+ - changed all boolean types to String to allow "uset" operation
+
+ - removed all default values
+
+ - made Build extend BuildBase
+
diff --git a/org.eclipse.m2e.model.edit/xsd/archetype-1.0.0.xsd b/org.eclipse.m2e.model.edit/xsd/archetype-1.0.0.xsd
new file mode 100644
index 00000000..de7a8947
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/xsd/archetype-1.0.0.xsd
@@ -0,0 +1,123 @@
+<?xml version="1.0"?>
+<!-- =================== DO NOT EDIT THIS FILE ==================== -->
+<!-- Generated by Modello 1.3 on 2010-04-13 23:57:44, -->
+<!-- any modifications will be overwritten. -->
+<!-- ============================================================== -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0" targetNamespace="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0">
+ <xs:element name="archetype" type="ArchetypeModel">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Describes the assembly layout and packaging.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="ArchetypeModel">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Describes the assembly layout and packaging.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="id" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The value should be the same as the artifactId in the archetype &lt;code&gt;pom.xml&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="allowPartial" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Setting this option to &lt;code&gt;true&lt;/code&gt; makes it possible to run the
+ &lt;code&gt;archetype:create&lt;/code&gt; even on existing projects.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="sources">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Files that will go into &lt;code&gt;src/main/java&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="source" minOccurs="0" maxOccurs="unbounded" type="Source"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="resources">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Files that will go into &lt;code&gt;src/main/resources&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="resource" minOccurs="0" maxOccurs="unbounded" type="Resource"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="testSources">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Files that will go into &lt;code&gt;src/test/java&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="source" minOccurs="0" maxOccurs="unbounded" type="Source"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="testResources">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Files that will go into &lt;code&gt;src/test/resources&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="resource" minOccurs="0" maxOccurs="unbounded" type="Resource"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="siteResources">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Files that will go into &lt;code&gt;src/site&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="resource" minOccurs="0" maxOccurs="unbounded" type="Resource"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Resource">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Describes a resource file.</xs:documentation>
+ </xs:annotation>
+ <xs:attribute name="encoding" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The encoding to be used when reading/writing this file.
+ Platform encoding is used by default, or ISO-8859-1 when filename ends in &lt;code&gt;.properties&lt;/code&gt;</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="filtered" type="xs:boolean" default="true">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">A resource can be filtered, which means the file will be used as Velocity template.
+ It can be non-filtered, which means the file will be copied without modification.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ <xs:complexType name="Source">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Describes a source file. Note that source files are always filtered, unlike resources that
+ can be non-filtered.</xs:documentation>
+ </xs:annotation>
+ <xs:attribute name="encoding" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The encoding to be used when reading/writing this file.
+ Platform encoding is used by default, or ISO-8859-1 when filename ends in &lt;code&gt;.properties&lt;/code&gt;</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+</xs:schema> \ No newline at end of file
diff --git a/org.eclipse.m2e.model.edit/xsd/archetype-catalog-1.0.0.xsd b/org.eclipse.m2e.model.edit/xsd/archetype-catalog-1.0.0.xsd
new file mode 100644
index 00000000..fdeec77b
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/xsd/archetype-catalog-1.0.0.xsd
@@ -0,0 +1,94 @@
+<?xml version="1.0"?>
+<!-- =================== DO NOT EDIT THIS FILE ==================== -->
+<!-- Generated by Modello 1.3 on 2010-04-13 23:57:44, -->
+<!-- any modifications will be overwritten. -->
+<!-- ============================================================== -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.0.0" targetNamespace="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.0.0">
+ <xs:element name="archetype-catalog" type="ArchetypeCatalog">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="ArchetypeCatalog">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="archetypes">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">List of Acthetypes available in this catalog.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="archetype" minOccurs="0" maxOccurs="unbounded" type="Archetype"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Archetype">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Informations to point to an Archetype referenced in the catalog.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="groupId" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">The groupId of the archetype.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="artifactId" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">The artifactId of the archetype.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="version" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">The version of the archetype. &lt;code&gt;RELEASE&lt;/code&gt; is a valid version.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="repository" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">The repository where to find the archetype.
+ When omitted, the archetype is searched for in the repository where the catalog comes from.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="description" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">The description of the archetype.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="goals">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="goal" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="properties">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ Properties that will be used during the execution of addition goals after the creation of the archetype.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+</xs:schema> \ No newline at end of file
diff --git a/org.eclipse.m2e.model.edit/xsd/archetype-descriptor-1.0.0.xsd b/org.eclipse.m2e.model.edit/xsd/archetype-descriptor-1.0.0.xsd
new file mode 100644
index 00000000..da0400a0
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/xsd/archetype-descriptor-1.0.0.xsd
@@ -0,0 +1,189 @@
+<?xml version="1.0"?>
+<!-- =================== DO NOT EDIT THIS FILE ==================== -->
+<!-- Generated by Modello 1.3 on 2010-04-13 23:57:44, -->
+<!-- any modifications will be overwritten. -->
+<!-- ============================================================== -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" targetNamespace="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0">
+ <xs:element name="archetype-descriptor" type="ArchetypeDescriptor">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="ArchetypeDescriptor">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="requiredProperties">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">List of required properties to generate a project from this archetype.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="requiredProperty" minOccurs="0" maxOccurs="unbounded" type="RequiredProperty"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="fileSets">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">File sets definition.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="fileSet" minOccurs="0" maxOccurs="unbounded" type="FileSet"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="modules">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Modules definition.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="module" minOccurs="0" maxOccurs="unbounded" type="ModuleDescriptor"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ <xs:attribute name="name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Name of the Archetype, that will be displayed to the user when choosing an archetype.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="partial" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Is this archetype representing a full Maven 2 project or only parts?</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ <xs:complexType name="FileSet">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">A fileset defines the way the project&apos;s files located in the jar file are used by the Archetype Plugin to generate a project.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="directory" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">The directory where the files will be searched for, which is also the directory where the
+ project&apos;s files will be generated.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="includes">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Inclusion definition &quot;à la&quot; Ant.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="include" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="excludes">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Exclusion definition &quot;à la&quot; Ant.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ <xs:attribute name="filtered" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Filesets can be filtered, which means the selected files will be used as Velocity templates.
+ They can be non-filtered, which means the selected files will be copied without modification.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="packaged" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Filesets can be packaged, which means the selected files will be generated/copied in a directory
+ structure that is prepended by the package property. They can be non-packaged, which means that the selected
+ files will be generated/copied without that prepend.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="encoding" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Encoding to use when filtering content.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ <xs:complexType name="RequiredProperty">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Definition of a property required when generating a project from this archetype.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="defaultValue" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Default value of the property.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ <xs:attribute name="key" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Key value of the property.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+ <xs:complexType name="ModuleDescriptor">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="fileSets">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">File sets definition.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="fileSet" minOccurs="0" maxOccurs="unbounded" type="FileSet"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="modules">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Modules definition.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="module" minOccurs="0" maxOccurs="unbounded" type="ModuleDescriptor"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ <xs:attribute name="id" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">The module&apos;s artifactId.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="dir" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">The module&apos;s directory.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">The module&apos;s name.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+</xs:schema> \ No newline at end of file
diff --git a/org.eclipse.m2e.model.edit/xsd/maven-v4_0_0.xsd b/org.eclipse.m2e.model.edit/xsd/maven-v4_0_0.xsd
new file mode 100644
index 00000000..243a0c70
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/xsd/maven-v4_0_0.xsd
@@ -0,0 +1,2217 @@
+<?xml version="1.0"?>
+<xs:schema
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="http://maven.apache.org/POM/4.0.0"
+ xmlns="http://maven.apache.org/POM/4.0.0">
+ <xs:element name="project" type="Model">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The &lt;code&gt;&amp;lt;project&amp;gt;&lt;/code&gt; element is the root of the descriptor.
+ The following table lists all of the possible child elements.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="Model">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The &lt;code&gt;&amp;lt;project&amp;gt;&lt;/code&gt; element is the root of the descriptor.
+ The following table lists all of the possible child elements.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="parent" minOccurs="0" type="Parent">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The location of the parent project, if one exists. Values from the
+ parent project will be the default for this project if they are
+ left unspecified. The location is given as a group ID, artifact ID and version.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="modelVersion" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Declares to which version of project descriptor this POM conforms.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ A universally unique identifier for a project. It is normal to
+ use a fully-qualified package name to distinguish it from other projects with a similar name
+ (eg. &lt;code&gt;org.apache.maven&lt;/code&gt;).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The identifier for this artifact that is unique within the group given by the group ID.
+ An artifact is something that is either produced or used by a project. Examples of artifacts produced by
+ Maven for a project include: JARs, source and binary distributions, and WARs.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="packaging" minOccurs="0" type="xs:string" default="jar">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The type of artifact this project produces, for example &lt;code&gt;jar&lt;/code&gt;
+ &lt;code&gt;war&lt;/code&gt;
+ &lt;code&gt;ear&lt;/code&gt;
+ &lt;code&gt;pom&lt;/code&gt;.
+ Plugins can create their own packaging, and
+ therefore their own packaging types,
+ so this list does not contain all possible types.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The full name of the project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The current version of the artifact produced by this project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="description" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ A detailed description of the project, used by Maven whenever it needs to describe the project,
+ such as on the web site. While this element can be specified as CDATA to enable
+ the use of HTML tags within the description, it is discouraged to allow plain text representation.
+ If you need to modify the index page of the generated web site, you are able to specify your own instead
+ of adjusting this text.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The URL to the project&apos;s homepage.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="prerequisites" minOccurs="0" type="Prerequisites">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Describes the prerequisites in the build environment for this project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="issueManagement" minOccurs="0" type="IssueManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The project&apos;s issue management system information.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="ciManagement" minOccurs="0" type="CiManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The project&apos;s continuous integration information.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="inceptionYear" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The year of the project&apos;s inception, specified with 4 digits.
+ This value is used when generating copyright notices as well as being informational.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="mailingLists" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Contains information about a project&apos;s mailing lists.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="mailingList" minOccurs="0" maxOccurs="unbounded" type="MailingList"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="developers" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Describes the committers of a project.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="developer" minOccurs="0" maxOccurs="unbounded" type="Developer"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="contributors" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Describes the contributors to a project that are not yet committers.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="contributor" minOccurs="0" maxOccurs="unbounded" type="Contributor"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="licenses" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the licenses for this project.
+ Each license is described by a &lt;code&gt;license&lt;/code&gt; element, which
+ is then described by additional elements.
+ Projects should only list the license(s) that applies to the project
+ and not the licenses that apply to dependencies.
+ If multiple licenses are listed, it is assumed that the user can select any of them, not that they
+ must accept all.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="license" minOccurs="0" maxOccurs="unbounded" type="License"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="scm" minOccurs="0" type="Scm">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specification for the SCM used by the project, such as CVS, Subversion, etc.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="organization" minOccurs="0" type="Organization">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes various attributes of the organization to
+ which the project belongs. These attributes are utilized when
+ documentation is created (for copyright notices and links).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="build" minOccurs="0" type="Build">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">Information required to build the project.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="profiles" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ A listing of project-local build profiles which will modify the build process when activated.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="profile" minOccurs="0" maxOccurs="unbounded" type="Profile"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="modules" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The modules (sometimes called subprojects) to build as a part of this project.
+ Each module listed is a relative path to the directory containing the module.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="module" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="repositories" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The lists of the remote repositories for discovering dependencies and
+ extensions.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="repository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="pluginRepositories" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The lists of the remote repositories for discovering plugins for builds and reports.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="pluginRepository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="dependencies" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the dependencies associated with a
+ project.
+ These dependencies are used to construct a classpath for your
+ project during the build process. They are automatically downloaded from the
+ repositories defined in this project.
+ See &lt;a href=&quot;http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html&quot;&gt;the
+ dependency mechanism&lt;/a&gt; for more information.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="dependency" minOccurs="0" maxOccurs="unbounded" type="Dependency"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="reports" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ &lt;b&gt;Deprecated&lt;/b&gt;. Now ignored by Maven.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="reporting" minOccurs="0" type="Reporting">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This element includes the specification of report plugins to use to generate the reports on the
+ Maven-generated site. These reports will be run when a user executes &lt;code&gt;mvn site&lt;/code&gt;. All of the
+ reports will be included in the navigation bar for browsing.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="dependencyManagement" minOccurs="0" type="DependencyManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Default dependency information for projects that inherit from
+ this one. The dependencies in this section are not immediately resolved.
+ Instead, when a POM derived from this one declares a dependency
+ described by a matching groupId and artifactId, the version and other values from this
+ section are used for that dependency if they were not already specified.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="distributionManagement" minOccurs="0" type="DistributionManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Distribution information for a project that enables deployment of the site
+ and artifacts to remote web servers and repositories respectively.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="properties" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Properties that can be used throughout the POM as a substitution, and are used as filters in resources
+ if enabled. The format is &lt;code&gt;&amp;lt;name&amp;gt;value&amp;lt;/name&amp;gt;&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Contributor">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Description of a person who has contributed to the project, but who does
+ not have commit privileges. Usually, these contributions come in the
+ form of patches submitted.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The full name of the contributor.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="email" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The email address of the contributor.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The URL for the homepage of the contributor.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="organization" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The organization to which the contributor belongs.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="organizationUrl" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The URL of the organization.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="roles" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The roles the contributor plays in the project. Each role is
+ described by a &lt;code&gt;role&lt;/code&gt; element, the body of which is a
+ role name. This can also be used to describe the contribution.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="role" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="timezone" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The timezone the contributor is in. This is a number in the range -11 to 12.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="properties" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Properties about the contributor, such as an instant messenger handle.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Profile">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Modifications to the build process which is activated based on environmental parameters or command line arguments.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="id" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The identifier of this build profile. This used both for command line activation, and identifies
+ identical profiles to merge with during inheritance.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="activation" minOccurs="0" type="Activation">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The conditional logic which will automatically
+ trigger the inclusion of this profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="build" minOccurs="0" type="BuildBase">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Information required to build the project.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="modules" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The modules (sometimes called subprojects) to build as a part of this project.
+ Each module listed is a relative path to the directory containing the module.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="module" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="repositories" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The lists of the remote repositories for discovering dependencies and
+ extensions.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="repository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="pluginRepositories" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The lists of the remote repositories for discovering plugins for builds and reports.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="pluginRepository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="dependencies" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the dependencies associated with a
+ project.
+ These dependencies are used to construct a classpath for your
+ project during the build process. They are automatically downloaded from the
+ repositories defined in this project.
+ See &lt;a href=&quot;http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html&quot;&gt;the
+ dependency mechanism&lt;/a&gt; for more information.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="dependency" minOccurs="0" maxOccurs="unbounded" type="Dependency"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="reports" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ &lt;b&gt;Deprecated&lt;/b&gt;. Now ignored by Maven.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="reporting" minOccurs="0" type="Reporting">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This element includes the specification of report plugins to use to generate the reports on the
+ Maven-generated site. These reports will be run when a user executes &lt;code&gt;mvn site&lt;/code&gt;. All of the
+ reports will be included in the navigation bar for browsing.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="dependencyManagement" minOccurs="0" type="DependencyManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Default dependency information for projects that inherit from
+ this one. The dependencies in this section are not immediately resolved.
+ Instead, when a POM derived from this one declares a dependency
+ described by a matching groupId and artifactId, the version and other values from this
+ section are used for that dependency if they were not already specified.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="distributionManagement" minOccurs="0" type="DistributionManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Distribution information for a project that enables deployment of the site
+ and artifacts to remote web servers and repositories respectively.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="properties" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Properties that can be used throughout the POM as a substitution, and are used as filters in resources
+ if enabled. The format is &lt;code&gt;&amp;lt;name&amp;gt;value&amp;lt;/name&amp;gt;&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Activation">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The conditions within the build runtime environment which will trigger
+ the automatic inclusion of the build profile.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="activeByDefault" minOccurs="0" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Flag specifying whether this profile is active by default.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="jdk" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specifies that this profile will be activated when a matching JDK is detected. For example, &lt;code&gt;1.4&lt;/code&gt;
+ only activates on JDKs versioned 1.4, while &lt;code&gt;!1.4&lt;/code&gt; matches any JDK that is not version 1.4.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="os" minOccurs="0" type="ActivationOS">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specifies that this profile will be activated when matching operating system attributes are detected.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="property" minOccurs="0" type="ActivationProperty">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specifies that this profile will be activated when this system property is specified.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="file" minOccurs="0" type="ActivationFile">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specifies that this profile will be activated based on existence of a file.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ActivationFile">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This is the file specification used to activate the profile. The missing value will be the location
+ of a file that needs to exist, and if it doesn&apos;t the profile will be activated. On the other hand exists will test
+ for the existence of the file and if it is there the profile will be activated.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="missing" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the file that must be missing to activate the profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="exists" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the file that must exist to activate the profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ActivationProperty">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This is the property specification used to activate a profile. If the value field is empty,
+ then the existence of the named property will activate the profile, otherwise it does a case-sensitive
+ match against the property value as well.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the property to be used to activate a profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="value" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The value of the property required to activate a profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ActivationOS">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This is an activator which will detect an operating system&apos;s attributes in order to activate
+ its profile.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the operating system to be used to activate the profile. This must be an exact match
+ of the &lt;code&gt;${os.name}&lt;/code&gt; Java property, such as &lt;code&gt;Windows XP&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="family" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The general family of the OS to be used to activate the profile, such as &lt;code&gt;windows&lt;/code&gt; or &lt;code&gt;unix&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="arch" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The architecture of the operating system to be used to activate the profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The version of the operating system to be used to activate the profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="DependencyManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Section for management of default dependency information for use in a group of POMs.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="dependencies" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The dependencies specified here are not used until they
+ are referenced in a POM within the group. This allows the
+ specification of a &quot;standard&quot; version for a particular
+ dependency.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="dependency" minOccurs="0" maxOccurs="unbounded" type="Dependency"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Dependency">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The project group that produced the dependency, e.g.
+ &lt;code&gt;org.apache.maven&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The unique id for an artifact produced by the project group, e.g.
+ &lt;code&gt;maven-artifact&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The version of the dependency, e.g. &lt;code&gt;3.2.1&lt;/code&gt;. In Maven 2, this can also be
+ specified as a range of versions.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="type" minOccurs="0" type="xs:string" default="jar">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The type of dependency. This defaults to &lt;code&gt;jar&lt;/code&gt;. While it usually represents the extension on
+ the filename of the dependency, that is not always the case. A type can be mapped to a different
+ extension and a classifier.
+ The type often correspongs to the packaging used, though this is also not always the case.
+ Some examples are &lt;code&gt;jar&lt;/code&gt;, &lt;code&gt;war&lt;/code&gt;, &lt;code&gt;ejb-client&lt;/code&gt; and &lt;code&gt;test-jar&lt;/code&gt;.
+ New types can be defined by plugins that set
+ &lt;code&gt;extensions&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;, so this is not a complete list.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="classifier" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The classifier of the dependency. This allows distinguishing two artifacts that belong to the same POM but
+ were built differently, and is appended to the filename after the version. For example,
+ &lt;code&gt;jdk14&lt;/code&gt; and &lt;code&gt;jdk15&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="scope" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The scope of the dependency - &lt;code&gt;compile&lt;/code&gt;, &lt;code&gt;runtime&lt;/code&gt;, &lt;code&gt;test&lt;/code&gt;,
+ &lt;code&gt;system&lt;/code&gt;, and &lt;code&gt;provided&lt;/code&gt;. Used to
+ calculate the various classpaths used for compilation, testing, and so on. It also assists in determining
+ which artifacts to include in a distribution of this project. For more information, see
+ &lt;a href=&quot;http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html&quot;&gt;the
+ dependency mechanism&lt;/a&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="systemPath" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ FOR SYSTEM SCOPE ONLY. Note that use of this property is &lt;b&gt;discouraged&lt;/b&gt; and may be replaced in later
+ versions. This specifies the path on the filesystem for this dependency.
+ Requires an absolute path for the value, not relative.
+ Use a property that gives the machine specific absolute path,
+ e.g. &lt;code&gt;${java.home}&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="exclusions" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Lists a set of artifacts that should be excluded from this dependency&apos;s artifact list when it comes to
+ calculating transitive dependencies.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="exclusion" minOccurs="0" maxOccurs="unbounded" type="Exclusion"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="optional" minOccurs="0" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Indicates the dependency is optional for use of this library. While the version of the dependency will be
+ taken into account for dependency calculation if the library is used elsewhere, it will not be passed on
+ transitively.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Exclusion">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The artifact ID of the project to exclude.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The group ID of the project to exclude.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Reporting">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Section for management of reports and their configuration.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="excludeDefaults" minOccurs="0" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">If true, then the default reports are not included in the site generation. This includes the
+ reports in the &quot;Project Info&quot; menu.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="outputDirectory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Where to store all of the generated reports. The default is
+ &lt;code&gt;${project.build.directory}/site&lt;/code&gt;
+ .
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="plugins" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The reporting plugins to use and their configuration.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="plugin" minOccurs="0" maxOccurs="unbounded" type="ReportPlugin"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ReportPlugin">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="groupId" minOccurs="0" type="xs:string" default="org.apache.maven.plugins">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The group ID of the reporting plugin in the repository.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The artifact ID of the reporting plugin in the repository.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The version of the reporting plugin to be used.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="inherited" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether the configuration in this plugin should be made available to projects that
+ inherit from this one.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="configuration" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The configuration of the reporting plugin.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="reportSets" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Multiple specifications of a set of reports, each having (possibly) different
+ configuration. This is the reporting parallel to an &lt;code&gt;execution&lt;/code&gt; in the build.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="reportSet" minOccurs="0" maxOccurs="unbounded" type="ReportSet"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ReportSet">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Represents a set of reports and configuration to be used to generate them.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="id" minOccurs="0" type="xs:string" default="default">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">The unique id for this report set, to be used during POM inheritance.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="configuration" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Configuration of the report to be used when generating this set.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="inherited" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Whether any configuration should be propagated to child POMs.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="reports" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The list of reports from this plugin which should be generated from this set.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="report" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="BuildBase">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="defaultGoal" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The default goal (or phase in Maven 2) to execute when none is specified for the project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="resources" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the classpath resources such as properties files associated with a
+ project. These resources are often included in the final package.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="resource" minOccurs="0" maxOccurs="unbounded" type="Resource"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="testResources" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the classpath resources such as properties files associated with a
+ project&apos;s unit tests.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="testResource" minOccurs="0" maxOccurs="unbounded" type="Resource"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="directory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The directory where all files generated by the build are placed.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="finalName" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The filename (excluding the extension, and with no path information) that the produced artifact
+ will be called. The default value is &lt;code&gt;${artifactId}-${version}&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="filters" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The list of filter properties files that are used when filtering is enabled.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="pluginManagement" minOccurs="0" type="PluginManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Default plugin information to be made available for reference by
+ projects derived from this one. This plugin configuration will not
+ be resolved or bound to the lifecycle unless referenced. Any local
+ configuration for a given plugin will override the plugin&apos;s entire
+ definition here.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="plugins" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The list of plugins to use.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="plugin" minOccurs="0" maxOccurs="unbounded" type="Plugin"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Plugin">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="groupId" minOccurs="0" type="xs:string" default="org.apache.maven.plugins">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The group ID of the plugin in the repository.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The artifact ID of the plugin in the repository.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The version (or valid range of verisons) of the plugin to be used.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="extensions" minOccurs="0" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to load Maven extensions (such as packaging and type handlers) from this
+ plugin. For performance reasons, this should only be enabled when necessary.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="executions" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Multiple specifications of a set of goals to execute during the build lifecycle, each having
+ (possibly) different
+ configuration.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="execution" minOccurs="0" maxOccurs="unbounded" type="PluginExecution"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="dependencies" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Additional dependencies that this project needs to introduce to the plugin&apos;s
+ classloader.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="dependency" minOccurs="0" maxOccurs="unbounded" type="Dependency"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="goals" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ &lt;b&gt;Deprecated&lt;/b&gt;. Unused by Maven.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="inherited" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Whether any configuration should be propagated to child POMs.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="configuration" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="PluginExecution">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="id" minOccurs="0" type="xs:string" default="default">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The identifier of this execution for labelling the goals during the build, and for matching
+ exections to merge during inheritance.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="phase" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The build lifecycle phase to bind the goals in this execution to. If omitted, the goals will
+ be bound to the default specified in their metadata.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="goals" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The goals to execute with the given configuration.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="goal" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="inherited" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Whether any configuration should be propagated to child POMs.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="configuration" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="PluginManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Section for management of default plugin information for use in a group of POMs.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="plugins" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The list of plugins to use.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="plugin" minOccurs="0" maxOccurs="unbounded" type="Plugin"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Resource">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the classpath resources associated with a project or
+ unit tests.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="targetPath" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Describe the resource target path. For example, if you want that
+ resource to appear in a specific package
+ (&lt;code&gt;org.apache.maven.messages&lt;/code&gt;), you must specify this
+ element with this value: &lt;code&gt;org/apache/maven/messages&lt;/code&gt;.
+ This is not required if you simply put the resources in that directory structure at the source, however.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="filtering" minOccurs="0" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Whether resources are filtered to replace tokens with parameterised values or not.
+ The values are taken from the &lt;code&gt;properties&lt;/code&gt; element and from the properties in the files listed
+ in the &lt;code&gt;filters&lt;/code&gt; element.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="directory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Describe the directory where the resources are stored.
+ The path is relative to the POM.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="includes" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">A list of patterns to include, e.g. &lt;code&gt;**&amp;#47;*.xml&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="include" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="excludes" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">A list of patterns to exclude, e.g. &lt;code&gt;**&amp;#47;*.xml&lt;/code&gt;</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="DistributionManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This elements describes all that pertains to distribution for a project.
+ It is primarily used for deployment of artifacts and the site
+ produced by the build.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="repository" minOccurs="0" type="DeploymentRepository">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Information needed to deploy the artifacts generated by the project to a remote repository.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="snapshotRepository" minOccurs="0" type="DeploymentRepository">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Where to deploy snapshots of artifacts to. If not given, it defaults to the &lt;code&gt;repository&lt;/code&gt; element.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="site" minOccurs="0" type="Site">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Information needed for deploying the web site of the project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="downloadUrl" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The URL of the project&apos;s download page. If not given users will be referred to the homepage given by
+ &lt;code&gt;url&lt;/code&gt;. This is given to assist in locating artifacts that are not in the repository due to
+ licensing restrictions.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="relocation" minOccurs="0" type="Relocation">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Relocation information of the artifact if it has been moved to a new group ID and/or artifact ID.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="status" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Gives the status of this artifact in the remote repository. This must not be set in your local
+ project, as it is updated by tools placing it in the reposiory. Valid values are: &lt;code&gt;none&lt;/code&gt; (default),
+ &lt;code&gt;converted&lt;/code&gt; (repository manager converted this from an Maven 1 POM), &lt;code&gt;partner&lt;/code&gt;
+ (directly synced from a partner Maven 2 repository), &lt;code&gt;deployed&lt;/code&gt; (was deployed from a Maven 2
+ instance), &lt;code&gt;verified&lt;/code&gt; (has been hand verified as correct and final).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Site">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Contains the information needed for deploying websites.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="id" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ A unique identifier for a deployment locataion. This is used to match the site to configuration in
+ the &lt;code&gt;settings.xml&lt;/code&gt; file, for example.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Human readable name of the deployment location.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The url of the location where website is deployed, in the form &lt;code&gt;protocol://hostname/path&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Relocation">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Describes where an artifact has moved to. If any of the values are omitted, it is assumed to be the
+ same as it was before.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The group ID the artifact has moved to.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The new artifact ID of the artifact.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The new version of the artifact.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="message" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">An additional message to show the user about the move, such as the reason.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="DeploymentRepository">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Repository contains the information needed for deploying to the remote repoistory.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="uniqueVersion" minOccurs="0" type="xs:boolean" default="true">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to assign snapshots a unique version comprised of the timestamp and build number, or to
+ use the same version each time</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="id" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ A unique identifier for a repository. This is used to match the repository to configuration in
+ the &lt;code&gt;settings.xml&lt;/code&gt; file, for example.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Human readable name of the repository.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The url of the repository, in the form &lt;code&gt;protocol://hostname/path&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="layout" minOccurs="0" type="xs:string" default="default">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The type of layout this repository uses for locating and storing artifacts - can be &lt;code&gt;legacy&lt;/code&gt; or
+ &lt;code&gt;default&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Repository">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ A repository contains the information needed for establishing connections with remote repoistory.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="releases" minOccurs="0" type="RepositoryPolicy">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">How to handle downloading of releases from this repository.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="snapshots" minOccurs="0" type="RepositoryPolicy">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">How to handle downloading of snapshots from this repository.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="id" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ A unique identifier for a repository. This is used to match the repository to configuration in
+ the &lt;code&gt;settings.xml&lt;/code&gt; file, for example.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Human readable name of the repository.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The url of the repository, in the form &lt;code&gt;protocol://hostname/path&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="layout" minOccurs="0" type="xs:string" default="default">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The type of layout this repository uses for locating and storing artifacts - can be &lt;code&gt;legacy&lt;/code&gt; or
+ &lt;code&gt;default&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="RepositoryPolicy">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Download policy</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="enabled" minOccurs="0" type="xs:boolean" default="true">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to use this repository for downloading this type of artifact.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="updatePolicy" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The frequency for downloading updates - can be
+ &lt;code&gt;always,&lt;/code&gt;
+ &lt;code&gt;daily&lt;/code&gt;
+ (default),
+ &lt;code&gt;interval:XXX&lt;/code&gt;
+ (in minutes) or
+ &lt;code&gt;never&lt;/code&gt;
+ (only if it doesn&apos;t exist locally).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="checksumPolicy" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ What to do when verification of an artifact checksum fails. Valid values are
+ &lt;code&gt;ignore&lt;/code&gt;
+ ,
+ &lt;code&gt;fail&lt;/code&gt;
+ or
+ &lt;code&gt;warn&lt;/code&gt;
+ (the default).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="MailingList">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the mailing lists associated with
+ a project. The auto-generated site references this information.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The name of the mailing list.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="subscribe" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The email address or link that can be used to subscribe to the mailing list.
+ If this is an email address, a
+ &lt;code&gt;mailto:&lt;/code&gt; link will automatically be created when
+ the documentation is created.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="unsubscribe" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The email address or link that can be used to unsubscribe to
+ the mailing list. If this is an email address, a
+ &lt;code&gt;mailto:&lt;/code&gt; link will automatically be created
+ when the documentation is created.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="post" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The email address or link that can be used to post to
+ the mailing list. If this is an email address, a
+ &lt;code&gt;mailto:&lt;/code&gt; link will automatically be created
+ when the documentation is created.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="archive" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The link to a URL where you can browse the mailing list archive.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="otherArchives" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The link to alternate URLs where you can browse the list archive.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="otherArchive" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Build">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="sourceDirectory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element specifies a directory containing the source
+ of the project. The generated build system will compile
+ the source in this directory when the project is built.
+ The path given is relative to the project descriptor.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="scriptSourceDirectory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This element specifies a directory containing the script sources
+ of the project. This directory is meant to be different from the
+ sourceDirectory, in that its contents will be copied to the output
+ directory in most cases (since scripts are interpreted rather than
+ compiled).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="testSourceDirectory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This element specifies a directory containing the unit test
+ source of the project. The generated build system will
+ compile these directories when the project is being tested.
+ The path given is relative to the project descriptor.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="outputDirectory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The directory where compiled application classes are placed.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="testOutputDirectory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The directory where compiled test classes are placed.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="extensions" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">A set of build extensions to use from this project.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="extension" minOccurs="0" maxOccurs="unbounded" type="Extension"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="defaultGoal" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The default goal (or phase in Maven 2) to execute when none is specified for the project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="resources" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the classpath resources such as properties files associated with a
+ project. These resources are often included in the final package.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="resource" minOccurs="0" maxOccurs="unbounded" type="Resource"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="testResources" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This element describes all of the classpath resources such as properties files associated with a
+ project&apos;s unit tests.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="testResource" minOccurs="0" maxOccurs="unbounded" type="Resource"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="directory" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The directory where all files generated by the build are placed.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="finalName" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The filename (excluding the extension, and with no path information) that the produced artifact
+ will be called. The default value is &lt;code&gt;${artifactId}-${version}&lt;/code&gt;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="filters" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The list of filter properties files that are used when filtering is enabled.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="pluginManagement" minOccurs="0" type="PluginManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Default plugin information to be made available for reference by
+ projects derived from this one. This plugin configuration will not
+ be resolved or bound to the lifecycle unless referenced. Any local
+ configuration for a given plugin will override the plugin&apos;s entire
+ definition here.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="plugins" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The list of plugins to use.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="plugin" minOccurs="0" maxOccurs="unbounded" type="Plugin"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Extension">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Describes a build extension to utilise.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The group ID of the extension&apos;s artifact.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The artifact ID of the extension.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The version of the extension.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="IssueManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Information about the issue tracking (or bug tracking) system used to manage this project.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="system" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the issue management system, e.g. Bugzilla</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">URL for the issue management system used by the project.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Parent">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="artifactId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The artifact id of the parent project to inherit from.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="groupId" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The group id of the parent project to inherit from.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="version" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The version of the parent project to inherit.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="relativePath" minOccurs="0" type="xs:string" default="../pom.xml">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The relative path of the parent &lt;code&gt;pom.xml&lt;/code&gt; file within the check out.
+ The default value is &lt;code&gt;../pom.xml&lt;/code&gt;.
+ Maven looks for the parent pom first in the reactor of currently building projects, then in this location on
+ the filesystem, then the local repository, and lastly in the remote repo.
+ &lt;code&gt;relativePath&lt;/code&gt; allows you to select a different location,
+ for example when your structure is flat, or deeper without an intermediate parent pom.
+ However, the group ID, artifact ID and version are still required,
+ and must match the file in the location given or it will revert to the repository for the POM.
+ This feature is only for enhancing the development in a local checkout of that project.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Prerequisites">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Describes the prerequisites a project can have.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="maven" minOccurs="0" type="xs:string" default="2.0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The minimum version of Maven required to build the project, or to use this plugin.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="CiManagement">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="system" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The name of the continuous integration system, e.g. &lt;code&gt;continuum&lt;/code&gt;.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ URL for the continuous integration system used by the project if it has a web interface.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="notifiers" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Configuration for notifying developers/users when a build is
+ unsuccessful, including user information and notification mode.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="notifier" minOccurs="0" maxOccurs="unbounded" type="Notifier"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Notifier">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Configures one method for notifying users/developers when a build breaks.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="type" minOccurs="0" type="xs:string" default="mail">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">The mechanism used to deliver notifications.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="sendOnError" minOccurs="0" type="xs:boolean" default="true">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to send notifications on error.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="sendOnFailure" minOccurs="0" type="xs:boolean" default="true">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to send notifications on failure.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="sendOnSuccess" minOccurs="0" type="xs:boolean" default="true">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to send notifications on success.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="sendOnWarning" minOccurs="0" type="xs:boolean" default="true">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to send notifications on warning.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="address" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ &lt;b&gt;Deprecated&lt;/b&gt;. Where to send the notification to - eg email address.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="configuration" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Extended configuration specific to this notifier goes here.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="License">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Describes the licenses for this project. This is used to generate
+ the license page of the project&apos;s web site, as well as being taken into consideration in other reporting and
+ validation. The licenses listed for the project are that of the project itself, and not of dependencies.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The full legal name of the license.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The official url for the license text.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="distribution" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The primary method by which this project may be distributed.
+ &lt;dl&gt;
+ &lt;dt&gt;repo&lt;/dt&gt;
+ &lt;dd&gt;may be downloaded from the Maven repository&lt;/dd&gt;
+ &lt;dt&gt;manual&lt;/dt&gt;
+ &lt;dd&gt;user must manually download and install the dependency.&lt;/dd&gt;
+ &lt;/dl&gt;
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="comments" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Addendum information pertaining to this license.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Developer">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Information about one of the committers on this project.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="id" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The unique ID of the developer in the SCM.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The full name of the contributor.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="email" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The email address of the contributor.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The URL for the homepage of the contributor.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="organization" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The organization to which the contributor belongs.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="organizationUrl" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The URL of the organization.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="roles" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The roles the contributor plays in the project. Each role is
+ described by a &lt;code&gt;role&lt;/code&gt; element, the body of which is a
+ role name. This can also be used to describe the contribution.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="role" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="timezone" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ The timezone the contributor is in. This is a number in the range -11 to 12.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="properties" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Properties about the contributor, such as an instant messenger handle.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Scm">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="connection" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The source control management system URL
+ that describes the repository and how to connect to the
+ repository. For more information, see the
+ &lt;a href=&quot;http://maven.apache.org/scm/scm-url-format.html&quot;&gt;URL format&lt;/a&gt;
+ and &lt;a href=&quot;http://maven.apache.org/scm/scms-overview.html&quot;&gt;list of supported SCMs&lt;/a&gt;.
+ This connection is read-only.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="developerConnection" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Just like &lt;code&gt;connection&lt;/code&gt;, but for developers, i.e. this scm connection
+ will not be read only.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="tag" minOccurs="0" type="xs:string" default="HEAD">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The tag of current code. By default, it&apos;s set to HEAD during development.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">4.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The URL to the project&apos;s browsable SCM repository, such as ViewVC or Fisheye.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Organization">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">Specifies the organization that produces this project.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element name="name" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The full name of the organization.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="url" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">3.0.0+</xs:documentation>
+ <xs:documentation source="description">The URL to the organization&apos;s home page.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+</xs:schema> \ No newline at end of file
diff --git a/org.eclipse.m2e.model.edit/xsd/profiles-v1_0_0.xsd b/org.eclipse.m2e.model.edit/xsd/profiles-v1_0_0.xsd
new file mode 100644
index 00000000..950b10ea
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/xsd/profiles-v1_0_0.xsd
@@ -0,0 +1,322 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns="http://maven.apache.org/PROFILES/1.0.0" targetNamespace="http://maven.apache.org/PROFILES/1.0.0">
+ <xs:element name="profilesXml" type="ProfilesRoot">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Root element of the profiles.xml file.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="ProfilesRoot">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Root element of the profiles.xml file.</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="profiles">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Configuration of build profiles for adjusting the build
+ according to environmental parameters
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="profile" minOccurs="0" maxOccurs="unbounded" type="Profile"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="activeProfiles">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ List of manually-activated build profiles, specified in the order in which
+ they should be applied.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="activeProfile" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Profile">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Modifications to the build process which is keyed on some
+ sort of environmental parameter.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="id" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The ID of this build profile, for activation
+ purposes.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="activation" type="Activation">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The conditional logic which will automatically
+ trigger the inclusion of this profile.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="properties">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">Extended configuration specific to this profile goes
+ here.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="repositories">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The lists of the remote repositories
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="repository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="pluginRepositories">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The lists of the remote repositories for discovering plugins
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="pluginRepository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Activation">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The conditions within the build runtime environment which will trigger
+ the automatic inclusion of the parent build profile.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="activeByDefault" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Flag specifying whether this profile is active as a default.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="jdk" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specifies that this profile will be activated when a matching JDK is detected.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="os" type="ActivationOS">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specifies that this profile will be activated when matching OS attributes are detected.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="property" type="ActivationProperty">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specifies that this profile will be activated when this System property is specified.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="file" type="ActivationFile">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Specifies that this profile will be activated based on existence of a file.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ActivationFile">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This is the file specification used to activate a profile. The missing value will be a the location
+ of a file that needs to exist, and if it doesn&apos;t the profile must run. On the other hand exists will test
+ for the existence of the file and if it is there will run the profile.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="missing" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the file that should be missing to activate a profile</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="exists" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the file that should exist to activate a profile</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ActivationOS">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This is an activator which will detect an operating system&apos;s attributes in order to activate
+ its profile.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the OS to be used to activate a profile</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="family" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The general family of the OS to be used to activate a profile (e.g. &apos;windows&apos;)</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="arch" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The architecture of the OS to be used to activate a profile</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="version" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The version of the OS to be used to activate a profile</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ActivationProperty">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ This is the property specification used to activate a profile. If the value field is empty,
+ then the existence of the named property will activate the profile, otherwise it does a case-sensitive
+ match against the property value as well.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The name of the property to be used to activate a profile</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="value" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The value of the property to be used to activate a profile</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Repository">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Repository contains the information needed for establishing connections with remote repoistory
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="releases" type="RepositoryPolicy">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">How to handle downloading of releases from this repository</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="snapshots" type="RepositoryPolicy">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">How to handle downloading of snapshots from this repository</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="id" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ A unique identifier for a repository.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Human readable name of the repository
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="url" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The url of the repository
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="layout" type="xs:string" default="default">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The type of layout this repository uses for locating and storing artifacts - can be &quot;legacy&quot; or
+ &quot;default&quot;.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="RepositoryPolicy">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Download policy</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="enabled" type="xs:boolean" default="true">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Whether to use this repository for downloading this type of artifact</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="updatePolicy" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The frequency for downloading updates - can be &quot;always&quot;, &quot;daily&quot; (default), &quot;interval:XXX&quot; (in minutes) or
+ &quot;never&quot; (only if it doesn&apos;t exist locally).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="checksumPolicy" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">What to do when verification of an artifact checksum fails - warn, fail, etc. Valid values are
+ &quot;fail&quot; or &quot;warn&quot;</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+</xs:schema> \ No newline at end of file
diff --git a/org.eclipse.m2e.model.edit/xsd/settings-v1_0_0.xsd b/org.eclipse.m2e.model.edit/xsd/settings-v1_0_0.xsd
new file mode 100644
index 00000000..57dd7dea
--- /dev/null
+++ b/org.eclipse.m2e.model.edit/xsd/settings-v1_0_0.xsd
@@ -0,0 +1,715 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns="http://maven.apache.org/SETTINGS/1.0.0" targetNamespace="http://maven.apache.org/SETTINGS/1.0.0">
+ <xs:element name="settings" type="Settings">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Root element of the user configuration file.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="Settings">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Root element of the user configuration file.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="localRepository" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The local repository.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="interactiveMode" type="xs:boolean" default="true">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ Whether Maven should attempt to interact with the user for input.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="usePluginRegistry" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ Whether Maven should use the plugin-registry.xml file to manage plugin versions.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="offline" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ Indicate whether maven should operate in offline mode full-time.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="proxies">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ Configuration for different proxy profiles. Multiple proxy profiles
+ might come in handy for anyone working from a notebook or other
+ mobile platform, to enable easy switching of entire proxy
+ configurations by simply specifying the profile id, again either from
+ the command line or from the defaults section below.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="proxy" minOccurs="0" maxOccurs="unbounded" type="Proxy"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="servers">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ Configuration of server-specific settings, mainly authentication
+ method. This allows configuration of authentication on a per-server
+ basis.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="server" minOccurs="0" maxOccurs="unbounded" type="Server"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="mirrors">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Configuration of download mirrors for repositories.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="mirror" minOccurs="0" maxOccurs="unbounded" type="Mirror"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="profiles">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ Configuration of build profiles for adjusting the build
+ according to environmental parameters.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="profile" minOccurs="0" maxOccurs="unbounded" type="Profile"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="activeProfiles">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ List of manually-activated build profiles, specified in the order in which
+ they should be applied.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="activeProfile" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="pluginGroups">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ List of groupIds to search for a plugin when that plugin
+ groupId is not explicitly provided.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="pluginGroup" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Mirror">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ A download mirror for a given repository.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="mirrorOf" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The server ID of the repository being mirrored, eg
+ &quot;central&quot;. This MUST NOT match the mirror id.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The optional name that describes the mirror.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="url" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">The URL of the mirror repository.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="id" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Proxy">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The &lt;code&gt;&amp;lt;proxy&amp;gt;&lt;/code&gt; element contains informations required to a proxy settings.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="active" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ Whether this proxy configuration is the active one.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="protocol" type="xs:string" default="http">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The proxy protocol.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="username" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The proxy user.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="password" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The proxy password.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="port" type="xs:int" default="8080">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The proxy port.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="host" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The proxy host.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="nonProxyHosts" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The list of non-proxied hosts (delimited by |).
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="id" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Server">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The &lt;code&gt;&amp;lt;server&amp;gt;&lt;/code&gt; element contains informations required to a server settings.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="username" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The username used to authenticate.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="password" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The password used in conjunction with the username to authenticate.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="privateKey" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The private key location used to authenticate.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="passphrase" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The passphrase used in conjunction with the privateKey to authenticate.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="filePermissions" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The permissions for files when they are created.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="directoryPermissions" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The permissions for directories when they are created.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="configuration">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ Extra configuration for the transport layer.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="id" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Profile">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ Modifications to the build process which is keyed on some
+ sort of environmental parameter.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="activation" type="Activation">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The conditional logic which will automatically
+ trigger the inclusion of this profile.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="properties">
+ <xs:annotation>
+ <xs:documentation source="version">0.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Extended configuration specific to this profile goes here.
+ Contents take the form of
+ &lt;property.name&gt;property.value&lt;/property.name&gt;
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="repositories">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The lists of the remote repositories.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="repository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="pluginRepositories">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The lists of the remote repositories for discovering plugins.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="pluginRepository" minOccurs="0" maxOccurs="unbounded" type="Repository"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="id" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Repository">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Repository contains the information needed for establishing
+ connections with remote repoistory
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="releases" type="RepositoryPolicy">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ How to handle downloading of releases from this repository
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="snapshots" type="RepositoryPolicy">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ How to handle downloading of snapshots from this repository
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="id" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ A unique identifier for a repository.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ Human readable name of the repository.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="url" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The url of the repository.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="layout" type="xs:string" default="default">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The type of layout this repository uses for locating and
+ storing artifacts - can be &quot;legacy&quot; or &quot;default&quot;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="RepositoryPolicy">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">Download policy</xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="enabled" type="xs:boolean" default="true">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Whether to use this repository for downloading this type of
+ artifact.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="updatePolicy" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The frequency for downloading updates - can be &quot;always&quot;,
+ &quot;daily&quot; (default), &quot;interval:XXX&quot; (in minutes) or &quot;never&quot;
+ (only if it doesn&apos;t exist locally).
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="checksumPolicy" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ What to do when verification of an artifact checksum fails -
+ warn, fail, etc. Valid values are &quot;fail&quot; or &quot;warn&quot;.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Activation">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ The conditions within the build runtime environment which will trigger
+ the automatic inclusion of the parent build profile.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="activeByDefault" type="xs:boolean" default="false">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ Flag specifying whether this profile is active as a default.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="jdk" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ Specifies that this profile will be activated when a matching JDK is detected.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="os" type="ActivationOS">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ Specifies that this profile will be activated when matching OS attributes are detected.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="property" type="ActivationProperty">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ Specifies that this profile will be activated when this System property is specified.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="file" type="ActivationFile">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ Specifies that this profile will be activated based on existence of a file.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ActivationFile">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ This is the file specification used to activate a profile. The missing value will be a the location
+ of a file that needs to exist, and if it doesn&apos;t the profile must run. On the other hand exists will test
+ for the existence of the file and if it is there will run the profile.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="missing" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The name of the file that should be missing to activate a
+ profile.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="exists" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The name of the file that should exist to activate a profile.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ActivationOS">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ This is an activator which will detect an operating system&apos;s attributes in order to activate
+ its profile.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The name of the OS to be used to activate a profile.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="family" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The general family of the OS to be used to activate a
+ profile (e.g. &apos;windows&apos;)
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="arch" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The architecture of the OS to be used to activate a profile.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="version" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The version of the OS to be used to activate a profile.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="ActivationProperty">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+
+ This is the property specification used to activate a profile. If the value field is empty,
+ then the existence of the named property will activate the profile, otherwise it does a case-sensitive
+ match against the property value as well.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The name of the property to be used to activate a profile.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="value" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0</xs:documentation>
+ <xs:documentation source="description">
+ The value of the property to be used to activate a profile.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+</xs:schema> \ No newline at end of file
diff --git a/org.eclipse.m2e.parent/.classpath b/org.eclipse.m2e.parent/.classpath
new file mode 100644
index 00000000..f5705aef
--- /dev/null
+++ b/org.eclipse.m2e.parent/.classpath
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="target-eclipse/classes"/>
+</classpath>
diff --git a/org.eclipse.m2e.parent/.gitignore b/org.eclipse.m2e.parent/.gitignore
new file mode 100644
index 00000000..a74771f1
--- /dev/null
+++ b/org.eclipse.m2e.parent/.gitignore
@@ -0,0 +1 @@
+/target-eclipse
diff --git a/org.eclipse.m2e.parent/.project b/org.eclipse.m2e.parent/.project
new file mode 100644
index 00000000..012173d9
--- /dev/null
+++ b/org.eclipse.m2e.parent/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.parent</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.parent/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.parent/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..39d2fb04
--- /dev/null
+++ b/org.eclipse.m2e.parent/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,262 @@
+#Wed Jul 02 11:05:28 EDT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=ignore
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=2
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=1
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=2
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
diff --git a/org.eclipse.m2e.parent/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.m2e.parent/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 00000000..81314939
--- /dev/null
+++ b/org.eclipse.m2e.parent/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Thu Aug 28 19:43:26 EDT 2008
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
diff --git a/org.eclipse.m2e.parent/.settings/org.eclipse.mylyn.team.ui.prefs b/org.eclipse.m2e.parent/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 00000000..9137528a
--- /dev/null
+++ b/org.eclipse.m2e.parent/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Thu Aug 28 19:43:26 EDT 2008
+commit.comment.template=${task.key}\: ${task.description}
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.parent/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.parent/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..16e49fb8
--- /dev/null
+++ b/org.eclipse.m2e.parent/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:08 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.parent/pom.xml b/org.eclipse.m2e.parent/pom.xml
new file mode 100644
index 00000000..24bfd95c
--- /dev/null
+++ b/org.eclipse.m2e.parent/pom.xml
@@ -0,0 +1,454 @@
+<?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>
+
+ <prerequisites>
+ <maven>3.0</maven>
+ </prerequisites>
+
+ <parent>
+ <groupId>org.sonatype.forge</groupId>
+ <artifactId>forge-parent</artifactId>
+ <version>5</version>
+ </parent>
+
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>Maven Integration for Eclipse (parent)</name>
+ <description>Maven Integration for Eclipse provides tight integration
+ for Maven into the IDE</description>
+ <url>http://eclipse.org/m2e</url>
+ <inceptionYear>2005</inceptionYear>
+
+ <properties>
+ <maven.version>3.0</maven.version>
+
+ <archetype_common.version>2.0.2.200911171109</archetype_common.version>
+ <archetype.version>2.0-alpha-4</archetype.version>
+
+ <maven_model_edit.version>1.0.0-SNAPSHOT</maven_model_edit.version>
+ <maven_pom.version>1.0.0-SNAPSHOT</maven_pom.version>
+
+ <nexus_indexer.version>2.0.5-SNAPSHOT</nexus_indexer.version>
+
+ <maven_scm.version>1.0.0.20080602-2350</maven_scm.version>
+
+ <m2e.site-compressed>http://repository.sonatype.org/service/local/repositories/forge-sites/content-compressed/</m2e.site-compressed>
+
+ <tycho-version>0.10.0</tycho-version>
+ </properties>
+
+ <organization>
+ <name>Sonatype, Inc.</name>
+ <url>http://www.sonatype.com</url>
+ </organization>
+
+ <licenses>
+ <license>
+ <name>Eclipse Public License - v 1.0</name>
+ <url>http://www.eclipse.org/legal/epl-v10.html</url>
+ </license>
+ </licenses>
+
+ <issueManagement>
+ <url>https://bugs.eclipse.org/bugs/enter_bug.cgi?product=m2e</url>
+ <system>Bugzilla</system>
+ </issueManagement>
+
+ <scm>
+ <connection>scm:svn:http://svn.sonatype.org/m2eclipse/trunk/org.eclipse.m2e.parent</connection>
+ <developerConnection>scm:svn:https://svn.sonatype.org/m2eclipse/trunk/org.eclipse.m2e.parent</developerConnection>
+ </scm>
+
+ <ciManagement>
+ <system>Hudson</system>
+ <url>https://ci.sonatype.org/job/m2eclipse-with-e33/</url>
+ </ciManagement>
+
+ <modules>
+ <module>../org.eclipse.m2e.maven.runtime</module>
+ <module>../org.eclipse.m2e.archetype.common</module>
+ <module>../org.eclipse.m2e.maven.indexer</module>
+ <module>../org.eclipse.m2e.model.edit</module>
+
+ <!-- <module>../org.eclipse.m2e.cliresolver</module> -->
+
+ <module>../org.eclipse.m2e.core</module>
+ <module>../org.eclipse.m2e.launching</module>
+ <module>../org.eclipse.m2e.jdt</module>
+ <module>../org.eclipse.m2e.refactoring</module>
+ <module>../org.eclipse.m2e.editor.xml</module>
+ <module>../org.eclipse.m2e.editor</module>
+
+ <!-- common test helpers
+ <module>../org.eclipse.m2e.tests.common</module>
+ <module>../org.eclipse.m2e.integration.tests.common</module> -->
+
+ <!-- features -->
+ <module>../org.eclipse.m2e.feature</module>
+ <module>../org.eclipse.m2e.sdk.feature</module>
+
+ <module>../org.eclipse.m2e.site</module>
+
+ <module>../target-platform</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- m2eclipse -->
+ <dependency>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e</artifactId>
+ <version>${m2eclipse.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.mylyn</artifactId>
+ <version>${m2eclipse.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.mylyn3</artifactId>
+ <version>${m2eclipse.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.cliresolver</artifactId>
+ <version>${m2eclipse.version}</version>
+ </dependency>
+
+ <!-- components -->
+ <dependency>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.maven.runtime</artifactId>
+ <version>${maven_embedder.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.maven_scm</artifactId>
+ <version>${maven_scm.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.archetype_common</artifactId>
+ <version>${archetype_common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.maven.indexer</artifactId>
+ <version>${nexus_indexer.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.pom</artifactId>
+ <version>${maven_pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.maven_model_edit</artifactId>
+ <version>${maven_model_edit.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>1.5.15</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-embedder</artifactId>
+ <version>${maven.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-common</artifactId>
+ <version>${archetype.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ <exclusion>
+ <artifactId>xml-apis</artifactId>
+ <groupId>xml-apis</groupId>
+ </exclusion>
+ <exclusion>
+ <groupId>velocity</groupId>
+ <artifactId>velocity-dep</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <extensions>true</extensions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.0</version>
+ <configuration>
+ <tagBase>https://svn.sonatype.org/m2eclipse/tags</tagBase>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <resolver>p2</resolver>
+ <target>
+ <artifact>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>target-platform</artifactId>
+ <version>${project.version}</version>
+ <classifier>${target.platform}</classifier>
+ </artifact>
+ </target>
+ <ignoreTychoRepositories>true</ignoreTychoRepositories>
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-lifecycle-plugin</artifactId>
+ <version>${tycho-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-packaging-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <!-- workaround for TYCHO-349 or TYCHO-313 -->
+ <strictVersions>false</strictVersions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-test-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <useUIHarness>true</useUIHarness>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ <argLine>${tycho.test.jvmArgs}</argLine>
+ <!-- kill test JVM it tests take more than 10 minutes (600 seconds) to finish -->
+ <forkedProcessTimeoutInSeconds>7200</forkedProcessTimeoutInSeconds>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-compiler-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ <version>${tycho-version}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>sonatype-public</id>
+ <url>http://repository.sonatype.org/content/groups/sonatype-public-grid</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <profiles>
+ <profile>
+ <id>sun-jvm</id>
+ <activation>
+ <property>
+ <name>java.vendor.url</name>
+ <value>http://java.sun.com/</value>
+ </property>
+ </activation>
+ <properties>
+ <target.platform>m2e-e35</target.platform>
+ <tycho.test.jvmArgs>-Xmx800m -XX:MaxPermSize=256m</tycho.test.jvmArgs>
+ </properties>
+ </profile>
+ <profile>
+ <id>osx</id>
+ <activation>
+ <property>
+ <name>java.vendor.url</name>
+ <value>http://www.apple.com/</value>
+ </property>
+ </activation>
+ <properties>
+ <target.platform>m2e-e35</target.platform>
+ <tycho.test.jvmArgs>-Xmx800m -XX:MaxPermSize=256m -Dosgi.ws=cocoa -XstartOnFirstThread</tycho.test.jvmArgs>
+ <osgi.ws>cocoa</osgi.ws>
+ </properties>
+ </profile>
+
+ <!-- <profile>
+ <id>uts</id>
+ <modules>
+ <module>../org.eclipse.m2e.tests</module>
+ </modules>
+ </profile>
+
+ <profile>
+ <id>its</id>
+ <modules>
+ <module>../org.eclipse.m2e.integration.tests</module>
+ <module>../org.eclipse.m2e.editor.tests</module>
+ <module>../org.eclipse.m2e.editor.xml.tests</module>
+ </modules>
+ </profile> -->
+
+ <!-- <profile>
+ <id>sign</id>
+ <activation>
+ <property>
+ <name>jarsigner.alias</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jarsigner-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <id>sign</id>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile> -->
+ </profiles>
+
+ <developers>
+ <developer>
+ <id>eu</id>
+ <name>Eugene Kuleshov</name>
+ <organization>Sonatype Inc.</organization>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <id>jvanzyl</id>
+ <name>Jason van Zyl</name>
+ <organization>Sonatype Inc.</organization>
+ <timezone>-8</timezone>
+ </developer>
+ <developer>
+ <id>vsiveton</id>
+ <name>Vincent Siveton</name>
+ <email>vsiveton@apache.org</email>
+ <organization>ASF</organization>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <id>ifedorenko</id>
+ <name>Igor Fedorenko</name>
+ <organization>Sonatype Inc.</organization>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <id>akraev</id>
+ <name>Anton Kraev</name>
+ <timezone>-5</timezone>
+ </developer>
+ <developer>
+ <id>hboutemy</id>
+ <name>Hervé Boutemy</name>
+ </developer>
+ <developer>
+ <id>krel</id>
+ <name>Lukáš Křečan</name>
+ </developer>
+ <developer>
+ <id>bentmann</id>
+ <name>Benjamin Bentmann</name>
+ <organization>Sonatype Inc.</organization>
+ </developer>
+ <developer>
+ <id>dip</id>
+ <name>Dmitry Platonoff</name>
+ <organization>Sonatype Inc.</organization>
+ </developer>
+ <developer>
+ <id>rseddon</id>
+ <name>Rich Seddon</name>
+ <organization>Sonatype Inc.</organization>
+ </developer>
+ <developer>
+ <id>mkleint</id>
+ <name>Milos Kleint</name>
+ <organization>Sonatype Inc.</organization>
+ </developer>
+ </developers>
+
+ <mailingLists>
+ <mailingList>
+ <name>Users List</name>
+ <subscribe>m2e-users@eclipse.org</subscribe>
+ <unsubscribe>https://dev.eclipse.org/mailman/listinfo/m2e-users</unsubscribe>
+ <post>m2e-users@eclipse.org</post>
+ <archive>http://dev.eclipse.org/mhonarc/lists/m2e-users</archive>
+ </mailingList>
+ <mailingList>
+ <name>Developer List</name>
+ <subscribe>m2e-dev@eclipse.org</subscribe>
+ <unsubscribe>https://dev.eclipse.org/mailman/listinfo/m2e-dev</unsubscribe>
+ <post>m2e-dev@eclipse.org</post>
+ <archive>http://dev.eclipse.org/mhonarc/lists/m2e-dev</archive>
+ </mailingList>
+ </mailingLists>
+
+</project>
diff --git a/org.eclipse.m2e.parent/run.sh b/org.eclipse.m2e.parent/run.sh
new file mode 100644
index 00000000..8ecfea29
--- /dev/null
+++ b/org.eclipse.m2e.parent/run.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+$HOME/tycho/bin/mvn clean install -B -e -Dtycho.targetPlatform=/home/j2ee-hudson/eclipse-tp-e33/eclipse
+
+
diff --git a/org.eclipse.m2e.refactoring/.classpath b/org.eclipse.m2e.refactoring/.classpath
new file mode 100644
index 00000000..798048dd
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/.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>
diff --git a/org.eclipse.m2e.refactoring/.gitignore b/org.eclipse.m2e.refactoring/.gitignore
new file mode 100644
index 00000000..ea8c4bf7
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/org.eclipse.m2e.refactoring/.project b/org.eclipse.m2e.refactoring/.project
new file mode 100644
index 00000000..22a15fdc
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.refactoring</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.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.refactoring/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.refactoring/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..dc1b9ff9
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,337 @@
+#Thu Feb 04 10:56:11 EST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=2
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=1
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=2
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.indentation.size=2
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
diff --git a/org.eclipse.m2e.refactoring/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.m2e.refactoring/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 00000000..38bcb77e
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,10 @@
+#Tue Nov 30 18:53:05 EST 2010
+eclipse.preferences.version=1
+formatter_profile=_m2 plugin
+formatter_settings_version=11
+org.eclipse.jdt.ui.exception.name=ex
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.overrideannotation=false
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\n * Copyright (c) 2010 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 *******************************************************************************/</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\nMavenLogger.log(${exception_var});</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
diff --git a/org.eclipse.m2e.refactoring/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.m2e.refactoring/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 00000000..603bc717
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Fri Oct 17 19:35:20 EDT 2008
+eclipse.preferences.version=1
+project.repository.kind=jira
+project.repository.url=http\://jira.codehaus.org
diff --git a/org.eclipse.m2e.refactoring/.settings/org.eclipse.mylyn.team.ui.prefs b/org.eclipse.m2e.refactoring/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 00000000..65ae7e54
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Fri Oct 17 19:35:20 EDT 2008
+commit.comment.template=${task.key}\: ${task.description}
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.refactoring/.settings/org.eclipse.pde.prefs b/org.eclipse.m2e.refactoring/.settings/org.eclipse.pde.prefs
new file mode 100644
index 00000000..e417fde2
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,22 @@
+#Fri Oct 17 19:32:52 EDT 2008
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.deprecated=2
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=2
+compilers.p.no-required-att=1
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=1
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/org.eclipse.m2e.refactoring/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.refactoring/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..0029eebb
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:19 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.refactoring/META-INF/MANIFEST.MF b/org.eclipse.m2e.refactoring/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..9478f9ea
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/META-INF/MANIFEST.MF
@@ -0,0 +1,26 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-Vendor: %Bundle-Vendor
+Bundle-SymbolicName: org.eclipse.m2e.refactoring;singleton:=true
+Bundle-Version: 0.13.0.qualifier
+Bundle-Activator: org.eclipse.m2e.refactoring.internal.Activator
+Require-Bundle: org.eclipse.m2e.core;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.model.edit;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.m2e.maven.runtime;bundle-version="[0.13.0,0.14.0)",
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.core.filebuffers,
+ org.eclipse.ui.workbench,
+ org.eclipse.jface,
+ org.eclipse.jface.text,
+ org.eclipse.jdt.ui,
+ org.eclipse.compare,
+ org.eclipse.jdt.core,
+ org.eclipse.ui.ide,
+ org.eclipse.ltk.core.refactoring,
+ org.eclipse.ltk.ui.refactoring;visibility:=reexport
+Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6
+Export-Package: org.eclipse.m2e.refactoring.exclude
diff --git a/org.eclipse.m2e.refactoring/OSGI-INF/l10n/bundle.properties b/org.eclipse.m2e.refactoring/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000..7ef07972
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,8 @@
+#Properties file for org.eclipse.m2e.refactoring
+Bundle-Vendor = Eclipse m2e
+Bundle-Name = Maven Integration for Eclipse Refactoring
+action.rename1.label = Rename Maven Artifact...
+action.rename2.label = Rename Maven Artifact...
+action.exclude1.label = Exclude Maven Artifact...
+action.exclude2.label = Exclude Maven Artifact...
+action.exclude3.label = Exclude Maven Artifact... \ No newline at end of file
diff --git a/org.eclipse.m2e.refactoring/about.html b/org.eclipse.m2e.refactoring/about.html
new file mode 100644
index 00000000..70e4b67c
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>October 29, 2010</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/org.eclipse.m2e.refactoring/build.properties b/org.eclipse.m2e.refactoring/build.properties
new file mode 100644
index 00000000..2cf906a0
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/build.properties
@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2008-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
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
+source.. = src/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ about.html,\
+ OSGI-INF/l10n/bundle.properties
diff --git a/org.eclipse.m2e.refactoring/icons/exclude.gif b/org.eclipse.m2e.refactoring/icons/exclude.gif
new file mode 100644
index 00000000..1b9b737f
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/icons/exclude.gif
Binary files differ
diff --git a/org.eclipse.m2e.refactoring/icons/m2.gif b/org.eclipse.m2e.refactoring/icons/m2.gif
new file mode 100644
index 00000000..4b0c0589
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/icons/m2.gif
Binary files differ
diff --git a/org.eclipse.m2e.refactoring/plugin.xml b/org.eclipse.m2e.refactoring/plugin.xml
new file mode 100644
index 00000000..ceb05024
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/plugin.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2007, 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
+-->
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ id="org.eclipse.m2e.refactoring.rename.pomContributor"
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="pom.xml" adaptable="true">
+ <action id="org.eclipse.m2e.editor.RenamePomAction"
+ class="org.eclipse.m2e.refactoring.rename.RenameArtifactAction"
+ enablesFor="1"
+ label="%action.rename1.label"
+ menubarPath="org.eclipse.jdt.ui.refactoring.menu/MavenRefactoring"/>
+ <!-- add visibility condition for managed poms -->
+ </objectContribution>
+ <objectContribution id="org.eclipse.m2e.refactoring.rename.projectContributor"
+ objectClass="org.eclipse.core.resources.IProject"
+ adaptable="true">
+ <action id="org.eclipse.m2e.editor.RenameProjectAction"
+ class="org.eclipse.m2e.refactoring.rename.RenameArtifactAction"
+ enablesFor="1"
+ label="%action.rename2.label"
+ menubarPath="org.eclipse.jdt.ui.refactoring.menu/MavenRefactoring"/>
+ <visibility>
+ <and>
+ <objectState name="open" value="true"/>
+ <objectState name="nature" value="org.eclipse.m2e.core.maven2Nature"/>
+ </and>
+ </visibility>
+ </objectContribution>
+
+ <!-- actions in pom editor -->
+ <objectContribution
+ id="org.eclipse.m2e.refactoring.exclude.artifactContributor"
+ objectClass="org.apache.maven.artifact.Artifact"
+ adaptable="true">
+ <action id="org.eclipse.m2e.projectMenu.action"
+ class="org.eclipse.m2e.refactoring.exclude.DependencyExcludeAction"
+ enablesFor="1"
+ icon="icons/exclude.gif"
+ label="%action.exclude1.label"
+ menubarPath="additions"/>
+ </objectContribution>
+ <objectContribution
+ id="org.eclipse.m2e.refactoring.exclude.dependencyContributor"
+ objectClass="org.apache.maven.shared.dependency.tree.DependencyNode"
+ adaptable="true">
+ <action id="org.eclipse.m2e.projectMenu.action"
+ class="org.eclipse.m2e.refactoring.exclude.DependencyExcludeAction"
+ enablesFor="1"
+ icon="icons/exclude.gif"
+ label="%action.exclude2.label"
+ menubarPath="additions"/>
+ </objectContribution>
+ <objectContribution
+ id="org.eclipse.m2e.refactoring.exclude.dependencyContributorAether"
+ objectClass="org.sonatype.aether.graph.DependencyNode"
+ adaptable="true">
+ <action id="org.eclipse.m2e.projectMenu.action"
+ class="org.eclipse.m2e.refactoring.exclude.DependencyExcludeAction"
+ enablesFor="1"
+ icon="icons/exclude.gif"
+ label="%action.exclude3.label"
+ menubarPath="additions"/>
+ </objectContribution>
+ </extension>
+
+ <extension point="org.eclipse.m2e.core.m2menu">
+ <factory class="org.eclipse.m2e.refactoring.internal.RefactoringMavenMenuCreator"/>
+ </extension>
+
+</plugin>
diff --git a/org.eclipse.m2e.refactoring/pom.xml b/org.eclipse.m2e.refactoring/pom.xml
new file mode 100644
index 00000000..9a1dd831
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/pom.xml
@@ -0,0 +1,24 @@
+<?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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.refactoring</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <name>Maven POM Refactoring</name>
+
+</project>
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
new file mode 100644
index 00000000..12882164
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/AbstractPomRefactoring.java
@@ -0,0 +1,321 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.project.MavenProject;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RenameJavaProjectProcessor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.embedder.IMaven;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+import org.eclipse.m2e.refactoring.RefactoringModelResources.PropertyInfo;
+import org.eclipse.m2e.refactoring.internal.Activator;
+import org.eclipse.osgi.util.NLS;
+
+
+/**
+ * Base class for all pom.xml refactorings in workspace
+ *
+ * @author Anton Kraev
+ */
+@SuppressWarnings("restriction")
+public abstract class AbstractPomRefactoring extends Refactoring {
+
+ protected static final String PROBLEMS_DURING_REFACTORING = Messages.AbstractPomRefactoring_error;
+
+ // main file that is being refactored
+ protected IFile file;
+
+ // maven plugin
+ protected MavenPlugin mavenPlugin;
+
+ // editing domain
+ protected AdapterFactoryEditingDomain editingDomain;
+
+ private HashMap<String, RefactoringModelResources> models;
+
+ public AbstractPomRefactoring(IFile file) {
+ this.file = file;
+
+ this.mavenPlugin = MavenPlugin.getDefault();
+
+ List<AdapterFactoryImpl> factories = new ArrayList<AdapterFactoryImpl>();
+ factories.add(new ResourceItemProviderAdapterFactory());
+ factories.add(new ReflectiveItemProviderAdapterFactory());
+
+ ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(factories);
+ BasicCommandStack commandStack = new BasicCommandStack();
+ this.editingDomain = new AdapterFactoryEditingDomain(adapterFactory, //
+ commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ // this gets actual refactoring visitor
+ public abstract PomVisitor getVisitor();
+
+ @Override
+ public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ return new RefactoringStatus();
+ }
+
+ @Override
+ public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ CompositeChange res = new CompositeChange(getTitle());
+ IMavenProjectFacade[] projects = mavenPlugin.getMavenProjectManager().getProjects();
+ pm.beginTask(Messages.AbstractPomRefactoring_task, projects.length);
+
+ models = new HashMap<String, RefactoringModelResources>();
+
+ try {
+ // load all models
+ // XXX: assumption: artifactId is unique within workspace
+ for(IMavenProjectFacade projectFacade : projects) {
+ // skip "other" projects if not requested
+ if(!scanAllArtifacts() && !projectFacade.getPom().equals(file)) {
+ continue;
+ }
+
+ // skip closed projects
+ if(!projectFacade.getProject().isAccessible() || !projectFacade.getPom().isAccessible()) {
+ continue;
+ }
+
+ loadModel(projectFacade, pm);
+ }
+
+ // construct properties for all models
+ for(IMavenProjectFacade projectFacade : projects) {
+ RefactoringModelResources model = models.get(projectFacade.getArtifactKey().getArtifactId());
+ if(model == null) {
+ continue;
+ }
+
+ Map<String, PropertyInfo> properties = new HashMap<String, PropertyInfo>();
+
+ // find all workspace parents
+ List<RefactoringModelResources> workspaceParents = new ArrayList<RefactoringModelResources>();
+ MavenProject current = model.getProject();
+ // add itself
+ workspaceParents.add(model);
+ for(MavenProject parentProject = getParentProject(projectFacade, current, pm); parentProject != null;) {
+ String id = parentProject.getArtifactId();
+ RefactoringModelResources parent = models.get(id);
+ if(parent != null) {
+ workspaceParents.add(parent);
+ } else {
+ break;
+ }
+ parentProject = getParentProject(projectFacade, parentProject, pm);
+ }
+
+ //fill properties (from the root)
+ for(int i = workspaceParents.size() - 1; i >= 0; i-- ) {
+ RefactoringModelResources resource = workspaceParents.get(i);
+ EList<PropertyElement> props = resource.getTmpModel().getProperties();
+ if(props == null)
+ continue;
+ Iterator<?> it = props.iterator();
+ while(it.hasNext()) {
+ PropertyElement pair = (PropertyElement) it.next();
+ String pName = pair.getName();
+ PropertyInfo info = properties.get(pName);
+ if(info == null) {
+ info = new PropertyInfo();
+ properties.put(pName, info);
+ }
+ info.setPair(pair);
+ info.setResource(resource);
+ }
+ }
+
+ model.setProperties(properties);
+ }
+
+ // calculate the list of affected models
+ for(String artifact : models.keySet()) {
+ RefactoringModelResources model = models.get(artifact);
+ model.setCommand(getVisitor().applyChanges(model, pm));
+ }
+
+ // process all refactored properties, creating more commands
+ for(String artifact : models.keySet()) {
+ RefactoringModelResources model = models.get(artifact);
+
+ if(model.getProperties() == null) {
+ continue;
+ }
+
+ for(String pName : model.getProperties().keySet()) {
+ PropertyInfo info = model.getProperties().get(pName);
+ if(info.getNewValue() != null) {
+ CompoundCommand command = info.getResource().getCommand();
+ if(command == null) {
+ command = new CompoundCommand();
+ info.getResource().setCommand(command);
+ }
+ command.append(info.getNewValue());
+ }
+ }
+ }
+
+ // process the file itself first
+ for(String artifact : models.keySet()) {
+ RefactoringModelResources model = models.get(artifact);
+ if(model.getPomFile().equals(file)) {
+ processCommand(model, res);
+ model.releaseAllResources();
+ models.remove(artifact);
+ break;
+ }
+ }
+
+ // process others
+ for(String artifact : models.keySet()) {
+ processCommand(models.get(artifact), res);
+ }
+
+ // rename project if required
+ // TODO probably should copy relevant classes from internal packages
+ String newName = getNewProjectName();
+ if(newName != null) {
+ RenameJavaProjectProcessor processor = new RenameJavaProjectProcessor(JavaCore.create(file.getProject()));
+ RenameRefactoring refactoring = new RenameRefactoring(processor);
+ processor.setNewElementName(newName);
+ RefactoringStatus tmp = new RefactoringStatus();
+ tmp.merge(refactoring.checkInitialConditions(pm));
+ if(!tmp.hasFatalError()) {
+ tmp.merge(refactoring.checkFinalConditions(pm));
+ if(!tmp.hasFatalError()) {
+ res.add(refactoring.createChange(pm));
+ }
+ }
+ }
+ } catch(final PomRefactoringException ex) {
+ return new Change() {
+ public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ return RefactoringStatus.createFatalErrorStatus(ex.getStatus().getMessage());
+ }
+ public Object getModifiedElement() {
+ return null;
+ }
+ public String getName() {
+ return ex.getStatus().getMessage();
+ }
+ public void initializeValidationData(IProgressMonitor pm) {
+ }
+ public Change perform(IProgressMonitor pm) throws CoreException {
+ return null;
+ }
+ public boolean isEnabled() {
+ return false;
+ }
+ };
+ } catch(Exception ex) {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, PROBLEMS_DURING_REFACTORING, ex));
+ } finally {
+ for(String artifact : models.keySet()) {
+ models.get(artifact).releaseAllResources();
+ }
+ RefactoringModelResources.cleanupTmpProject();
+ }
+
+ return res;
+ }
+
+ protected MavenProject getParentProject(IMavenProjectFacade project, MavenProject current, IProgressMonitor monitor)
+ throws CoreException {
+ IMaven maven = mavenPlugin.getMaven();
+ MavenProjectManager projectManager = mavenPlugin.getMavenProjectManager();
+
+ MavenExecutionRequest request = projectManager.createExecutionRequest(project.getPom(),
+ project.getResolverConfiguration(), monitor);
+
+ return maven.resolveParentProject(request, current, monitor);
+ }
+
+ // title for a composite change
+ public abstract String getTitle();
+
+ protected RefactoringModelResources loadModel(IMavenProjectFacade projectFacade, IProgressMonitor pm)
+ throws CoreException, IOException {
+ pm.setTaskName(NLS.bind(Messages.AbstractPomRefactoring_loading, projectFacade.getProject().getName()));
+ RefactoringModelResources current = new RefactoringModelResources(projectFacade);
+ models.put(current.effective.getArtifactId(), current);
+ pm.worked(1);
+ return current;
+ }
+
+ // this method determines whether all artifacts will be sent to visitor or only main one
+ public abstract boolean scanAllArtifacts();
+
+ protected void processCommand(RefactoringModelResources model, CompositeChange res) throws Exception {
+ CompoundCommand command = model.getCommand();
+ if(command == null) {
+ return;
+ }
+ if(command.canExecute()) {
+ // apply changes to temp file
+ editingDomain.getCommandStack().execute(command);
+ // create text change comparing temp file and real file
+ TextFileChange change = new ChangeCreator(model.getPomFile(), model.getPomBuffer().getDocument(), model
+ .getTmpBuffer().getDocument(), file.getParent().getName()).createChange();
+ res.add(change);
+ }
+ }
+
+ // returns new eclipse project name or null if no change
+ public String getNewProjectName() {
+ return null;
+ }
+
+ public Model createModel() {
+ try {
+ Resource resource = MavenPlugin.getDefault().getMavenModelManager().loadResource(file);
+ return (Model) resource.getContents().get(0);
+ } catch(CoreException ex) {
+ MavenLogger.log(PROBLEMS_DURING_REFACTORING, ex);
+ return null;
+ }
+ }
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/ChangeCreator.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/ChangeCreator.java
new file mode 100644
index 00000000..5a49dc99
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/ChangeCreator.java
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.eclipse.compare.rangedifferencer.IRangeComparator;
+import org.eclipse.compare.rangedifferencer.RangeDifference;
+import org.eclipse.compare.rangedifferencer.RangeDifferencer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.text.edits.DeleteEdit;
+import org.eclipse.text.edits.InsertEdit;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.text.edits.TextEditGroup;
+
+
+/**
+ * This class creates an org.eclipse.ltk.core.refactoring.DocumentChange instance based on old and new text values
+ *
+ * @author Anton Kraev
+ */
+public class ChangeCreator {
+ private String label;
+
+ private IDocument oldDocument;
+
+ private IDocument newDocument;
+
+ private IFile oldFile;
+
+ public ChangeCreator(IFile oldFile, IDocument oldDocument, IDocument newDocument, String label) {
+ this.newDocument = newDocument;
+ this.oldDocument = oldDocument;
+ this.oldFile = oldFile;
+ this.label = label;
+ }
+
+ public TextFileChange createChange() throws Exception {
+ TextFileChange change = new TextFileChange(label, oldFile);
+ // change.setSaveMode(TextFileChange.FORCE_SAVE);
+ change.setEdit(new MultiTextEdit());
+ Object leftSide = new LineComparator(oldDocument);
+ Object rightSide = new LineComparator(newDocument);
+
+ RangeDifference[] differences = RangeDifferencer.findDifferences((IRangeComparator) leftSide, (IRangeComparator) rightSide);
+ int insertOffset = 0;
+ for(int i = 0; i < differences.length; i++ ) {
+ RangeDifference curr = differences[i];
+ int startLine = 0;
+ // when comparing 2 files, only RangeDifference.CHANGE is possible, no need to test
+ if (curr.rightLength() == curr.leftLength()) {
+ // replace
+ startLine = curr.rightStart();
+ int endLine = curr.rightEnd() - 1;
+ for(int j = startLine; j <= endLine; j++ ) {
+ int newPos = curr.leftStart() - startLine + j;
+ String newText = newDocument.get(newDocument.getLineOffset(newPos), newDocument.getLineLength(newPos));
+ addEdit(change, startLine, new ReplaceEdit(oldDocument.getLineOffset(j), oldDocument.getLineLength(j), newText));
+ }
+ } else if (curr.rightLength() > 0 && curr.leftLength() == 0) {
+ // insert
+ startLine = curr.rightStart();
+ int endLine = curr.rightEnd() - 1;
+ int posInsert = oldDocument.getLineOffset(curr.leftStart());
+ String newText = ""; //$NON-NLS-1$
+ for(int j = startLine; j <= endLine; j++ ) {
+ int newPos = curr.leftStart() - startLine + j + insertOffset;
+ newText += newDocument.get(newDocument.getLineOffset(newPos), newDocument.getLineLength(newPos));
+ }
+ if(newText.length() > 0){
+ addEdit(change, startLine, new InsertEdit(posInsert, newText));
+ }
+ insertOffset += curr.rightEnd() - curr.rightStart();
+ } else if (curr.leftLength() > 0 && curr.rightLength() == 0) {
+ // delete
+ startLine = curr.leftStart();
+ int endLine = curr.leftEnd() - 1;
+ int startOffset = oldDocument.getLineOffset(startLine);
+ int endOffset = 0;
+ for(int j = startLine; j <= endLine; j++ ) {
+ endOffset += oldDocument.getLineLength(j);
+ }
+ addEdit(change, startLine, new DeleteEdit(startOffset, endOffset));
+ insertOffset -= (curr.leftEnd() - curr.leftStart());
+ } else {
+ // unhandled
+ }
+ }
+ return change;
+ }
+
+ private void addEdit(TextFileChange change, int startLine, TextEdit edit) {
+ change.addTextEditGroup(new TextEditGroup("Line " + (startLine + 1), edit));
+ change.addEdit(edit);
+ }
+
+ public static class LineComparator implements IRangeComparator {
+ private final IDocument document;
+ private final ArrayList<Integer> hashes;
+
+ /**
+ * Create a line comparator for the given document.
+ *
+ * @param document
+ */
+ public LineComparator(IDocument document) {
+ this.document = document;
+ this.hashes = new ArrayList<Integer>(Arrays.asList(new Integer[document.getNumberOfLines()]));
+ }
+
+ /*
+ * @see org.eclipse.compare.rangedifferencer.IRangeComparator#getRangeCount()
+ */
+ public int getRangeCount() {
+ return document.getNumberOfLines();
+ }
+
+ /*
+ * @see org.eclipse.compare.rangedifferencer.IRangeComparator#rangesEqual(int, org.eclipse.compare.rangedifferencer.IRangeComparator, int)
+ */
+ public boolean rangesEqual(int thisIndex, IRangeComparator other, int otherIndex) {
+ try {
+ return getHash(thisIndex).equals(((LineComparator) other).getHash(otherIndex));
+ } catch (BadLocationException e) {
+ MavenLogger.log("Problem comparing", e);
+ return false;
+ }
+ }
+
+ /*
+ * @see org.eclipse.compare.rangedifferencer.IRangeComparator#skipRangeComparison(int, int, org.eclipse.compare.rangedifferencer.IRangeComparator)
+ */
+ public boolean skipRangeComparison(int length, int maxLength, IRangeComparator other) {
+ return false;
+ }
+
+ /**
+ * @param line the number of the line in the document to get the hash for
+ * @return the hash of the line
+ * @throws BadLocationException if the line number is invalid
+ */
+ private Integer getHash(int line) throws BadLocationException {
+ Integer hash = hashes.get(line);
+ if (hash == null) {
+ IRegion lineRegion;
+ lineRegion = document.getLineInformation(line);
+ String lineContents= document.get(lineRegion.getOffset(), lineRegion.getLength());
+ hash = new Integer(computeDJBHash(lineContents));
+ hashes.set(line, hash);
+ }
+ return hash;
+ }
+
+ /**
+ * Compute a hash using the DJB hash algorithm
+ *
+ * @param string the string for which to compute a hash
+ * @return the DJB hash value of the string
+ */
+ private int computeDJBHash(String string) {
+ int hash = 5381;
+ int len = string.length();
+ for (int i = 0; i < len; i++) {
+ hash = (hash << 5) + hash + string.charAt(i);
+ }
+ return hash;
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/Messages.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/Messages.java
new file mode 100644
index 00000000..6dfe7d59
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/Messages.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring;
+
+import org.eclipse.osgi.util.NLS;
+
+
+/**
+ * @author mkleint
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.m2e.refactoring.messages"; //$NON-NLS-1$
+
+ public static String AbstractPomRefactoring_error;
+
+ public static String AbstractPomRefactoring_loading;
+
+ public static String AbstractPomRefactoring_task;
+ public static String ExcludeRefactoring_error_parent;
+
+ public static String ExcludeRefactoring_name;
+
+ public static String ExcludeRefactoring_task_loading;
+
+ public static String ExcludeRefactoring_title;
+
+ public static String MavenRenameWizardPage_cbRenameWorkspace;
+
+ public static String MavenRenameWizardPage_desc;
+
+ public static String MavenRenameWizardPage_lblArtifactId;
+
+ public static String MavenRenameWizardPage_lblGroupId;
+
+ public static String MavenRenameWizardPage_lblVersion;
+
+ public static String MavenRenameWizardPage_title;
+
+ public static String RefactoringMavenMenuCreator_action_exclude;
+
+ public static String RenameRefactoring_1;
+
+ public static String RenameRefactoring_name;
+
+ public static String RenameRefactoring_title;
+
+ public static String SaveDirtyFilesDialog_message_not_saved;
+ public static String SaveDirtyFilesDialog_title;
+
+ public static String SaveDirtyFilesDialog_title_error;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/PomRefactoringException.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/PomRefactoringException.java
new file mode 100644
index 00000000..75385c31
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/PomRefactoringException.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+
+
+/**
+ * A POM refactoring exception, to pass error from refactoring implementations into the wizard.
+ */
+public class PomRefactoringException extends CoreException {
+ private static final long serialVersionUID = 994564746763321105L;
+
+ public PomRefactoringException(IStatus status) {
+ super(status);
+ }
+
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/PomVisitor.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/PomVisitor.java
new file mode 100644
index 00000000..7d01169e
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/PomVisitor.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.command.CompoundCommand;
+
+
+/**
+ * This interface defines refactoring visitor
+ *
+ * @author Anton Kraev
+ */
+public interface PomVisitor {
+ /**
+ * Applies refactoring changes through undoable command
+ *
+ * @param model - current model being visited
+ * @param pm - progress monitor
+ * @return command that executes changes (if any)
+ * @throws Exception
+ */
+ public CompoundCommand applyChanges(RefactoringModelResources model, IProgressMonitor pm) throws Exception;
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/RefactoringModelResources.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/RefactoringModelResources.java
new file mode 100644
index 00000000..c47bd0d8
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/RefactoringModelResources.java
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+
+import org.apache.maven.project.MavenProject;
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.filebuffers.ITextFileBuffer;
+import org.eclipse.core.filebuffers.ITextFileBufferManager;
+import org.eclipse.core.filebuffers.LocationKind;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.core.project.IMavenProjectFacade;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.PropertyElement;
+
+/**
+ * This class manages all refactoring-related resources for a particular maven project
+ *
+ * @author Anton Kraev
+ */
+public class RefactoringModelResources {
+ private static final String TMP_PROJECT_NAME = ".m2eclipse_refactoring"; //$NON-NLS-1$
+ protected IFile pomFile;
+ protected IFile tmpFile;
+ protected ITextFileBuffer pomBuffer;
+ protected ITextFileBuffer tmpBuffer;
+ protected Model tmpModel;
+ protected org.apache.maven.model.Model effective;
+ protected ITextFileBufferManager textFileBufferManager;
+ protected Map<String, PropertyInfo> properties;
+ protected MavenProject project;
+ protected CompoundCommand command;
+ protected static IProject tmpProject;
+
+ protected IProject getTmpProject() {
+ if (tmpProject == null) {
+ tmpProject = ResourcesPlugin.getWorkspace().getRoot().getProject(TMP_PROJECT_NAME);
+ }
+ if (!tmpProject.exists()) {
+ try {
+ tmpProject.create(null);
+ tmpProject.open(null);
+ } catch(CoreException ex) {
+ MavenLogger.log(ex);
+ }
+ }
+ return tmpProject;
+ }
+
+ public RefactoringModelResources(IMavenProjectFacade projectFacade) throws CoreException, IOException {
+ textFileBufferManager = FileBuffers.getTextFileBufferManager();
+ project = projectFacade.getMavenProject(null);
+ effective = project.getModel();
+ pomFile = projectFacade.getPom();
+ pomBuffer = getBuffer(pomFile);
+
+ //create temp file
+ IProject project = getTmpProject();
+ File f = File.createTempFile("pom", ".xml", project.getLocation().toFile()); //$NON-NLS-1$ //$NON-NLS-2$
+ f.delete();
+ tmpFile = project.getFile(f.getName());
+ pomFile.copy(tmpFile.getFullPath(), true, null);
+
+ Resource resource = MavenPlugin.getDefault().getMavenModelManager().loadResource(tmpFile);
+ tmpModel = (Model)resource.getContents().get(0);
+ tmpBuffer = getBuffer(tmpFile);
+ }
+
+ public CompoundCommand getCommand() {
+ return command;
+ }
+
+ public void setCommand(CompoundCommand command) {
+ this.command = command;
+ }
+
+ public IFile getPomFile() {
+ return pomFile;
+ }
+
+ public IFile getTmpFile() {
+ return tmpFile;
+ }
+
+ public ITextFileBuffer getPomBuffer() {
+ return pomBuffer;
+ }
+
+ public ITextFileBuffer getTmpBuffer() {
+ return tmpBuffer;
+ }
+
+ public Model getTmpModel() {
+ return tmpModel;
+ }
+
+ public org.apache.maven.model.Model getEffective() {
+ return effective;
+ }
+
+ public MavenProject getProject() {
+ return project;
+ }
+
+ public Map<String, PropertyInfo> getProperties() {
+ return properties;
+ }
+
+ public void setProperties(Map<String, PropertyInfo> properties) {
+ this.properties = properties;
+ }
+
+ public void releaseAllResources() throws CoreException {
+ releaseBuffer(pomBuffer, pomFile);
+ if (tmpFile != null && tmpFile.exists()) {
+ releaseBuffer(tmpBuffer, tmpFile);
+ }
+ if (tmpModel != null) {
+ tmpModel.eResource().unload();
+ }
+ }
+
+ public static void cleanupTmpProject() throws CoreException {
+ if (tmpProject.exists()) {
+ tmpProject.delete(true, true, null);
+ }
+ }
+
+
+ protected ITextFileBuffer getBuffer(IFile file) throws CoreException {
+ textFileBufferManager.connect(file.getLocation(), LocationKind.NORMALIZE, null);
+ return textFileBufferManager.getTextFileBuffer(file.getLocation(), LocationKind.NORMALIZE);
+ }
+
+ protected void releaseBuffer(ITextFileBuffer buffer, IFile file) throws CoreException {
+ buffer.revert(null);
+ textFileBufferManager.disconnect(file.getLocation(), LocationKind.NORMALIZE, null);
+ }
+
+ public String getName() {
+ return pomFile.getProject().getName();
+ }
+
+ public static class PropertyInfo {
+ protected PropertyElement pair;
+ protected RefactoringModelResources resource;
+ protected Command newValue;
+
+ public Command getNewValue() {
+ return newValue;
+ }
+
+ public void setNewValue(Command newValue) {
+ this.newValue = newValue;
+ }
+
+ public PropertyElement getPair() {
+ return pair;
+ }
+
+ public void setPair(PropertyElement pair) {
+ this.pair = pair;
+ }
+
+ public RefactoringModelResources getResource() {
+ return resource;
+ }
+
+ public void setResource(RefactoringModelResources resource) {
+ this.resource = resource;
+ }
+ }
+
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/DependencyExcludeAction.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/DependencyExcludeAction.java
new file mode 100644
index 00000000..54eaf0e9
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/DependencyExcludeAction.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring.exclude;
+
+import org.apache.maven.artifact.Artifact;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.internal.ui.packageview.ClassPathContainer.RequiredProjectWrapper;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * This action is intended to be used in popup menus
+ *
+ * @author Anton Kraev
+ */
+@SuppressWarnings("restriction")
+public class DependencyExcludeAction implements IActionDelegate {
+
+ public static final String ID = "org.eclipse.m2e.refactoring.DependencyExclude"; //$NON-NLS-1$
+
+ private IFile file;
+ private ArtifactKey artifactKey;
+
+ public void run(IAction action) {
+ if (artifactKey != null && file != null) {
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ MavenExcludeWizard wizard = new MavenExcludeWizard(file, //
+ artifactKey.getGroupId(), artifactKey.getArtifactId());
+ try {
+ String titleForFailedChecks = ""; //$NON-NLS-1$
+ RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
+ op.run(shell, titleForFailedChecks);
+ } catch(InterruptedException e) {
+ // XXX
+ }
+ }
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ file = null;
+ artifactKey = null;
+
+ // TODO move logic into adapters
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ if(structuredSelection.size()==1) {
+ Object selected = structuredSelection.getFirstElement();
+ if (selected instanceof Artifact) {
+ file = getFileFromEditor();
+ artifactKey = new ArtifactKey((Artifact) selected);
+
+ } else if (selected instanceof org.sonatype.aether.graph.DependencyNode) {
+ file = getFileFromEditor();
+ artifactKey = new ArtifactKey(((org.sonatype.aether.graph.DependencyNode) selected).getDependency().getArtifact());
+
+ } else if (selected instanceof RequiredProjectWrapper) {
+ RequiredProjectWrapper w = (RequiredProjectWrapper) selected;
+ file = getFileFromProject(w.getParentClassPathContainer().getJavaProject());
+ artifactKey = SelectionUtil.getType(selected, ArtifactKey.class);
+
+ } else {
+ artifactKey = SelectionUtil.getType(selected, ArtifactKey.class);
+ if (selected instanceof IJavaElement) {
+ IJavaElement el = (IJavaElement) selected;
+ file = getFileFromProject(el.getParent().getJavaProject());
+ }
+
+ }
+ }
+ }
+
+ if (artifactKey != null && file != null) {
+ action.setEnabled(true);
+ } else {
+ action.setEnabled(false);
+ }
+ }
+
+ private IFile getFileFromProject(IJavaProject javaProject) {
+ return javaProject.getProject().getFile("pom.xml"); //$NON-NLS-1$
+ }
+
+ private IFile getFileFromEditor() {
+ IEditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if (part != null && part.getEditorInput() instanceof IFileEditorInput) {
+ IFileEditorInput input = (IFileEditorInput) part.getEditorInput();
+ return input.getFile();
+ }
+ return null;
+ }
+
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeRefactoring.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeRefactoring.java
new file mode 100644
index 00000000..a0524178
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/ExcludeRefactoring.java
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring.exclude;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.core.core.IMavenConstants;
+import org.eclipse.m2e.core.embedder.MavenModelManager;
+import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.Exclusion;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.impl.PomFactoryImpl;
+import org.eclipse.m2e.refactoring.AbstractPomRefactoring;
+import org.eclipse.m2e.refactoring.Messages;
+import org.eclipse.m2e.refactoring.PomRefactoringException;
+import org.eclipse.m2e.refactoring.PomVisitor;
+import org.eclipse.m2e.refactoring.RefactoringModelResources;
+import org.eclipse.osgi.util.NLS;
+import org.sonatype.aether.artifact.Artifact;
+import org.sonatype.aether.graph.DependencyNode;
+import org.sonatype.aether.graph.DependencyVisitor;
+import org.sonatype.aether.util.artifact.JavaScopes;
+
+
+/**
+ * Exclude artifact refactoring implementation
+ *
+ * @author Anton Kraev
+ */
+public class ExcludeRefactoring extends AbstractPomRefactoring {
+
+ private String excludedArtifactId;
+
+ private String excludedGroupId;
+
+ /**
+ * @param file
+ */
+ public ExcludeRefactoring(IFile file, String excludedGroupId, String excludedArtifactId) {
+ super(file);
+ this.excludedGroupId = excludedGroupId;
+ this.excludedArtifactId = excludedArtifactId;
+ }
+
+ public PomVisitor getVisitor() {
+ return new PomVisitor() {
+
+ public CompoundCommand applyChanges(RefactoringModelResources resources, IProgressMonitor pm)
+ throws CoreException, IOException {
+ final CompoundCommand command = new CompoundCommand();
+
+ final List<Dependency> toRemove = new ArrayList<Dependency>();
+
+ Model model = resources.getTmpModel();
+
+ final List<Dependency> deps = model.getDependencies();
+
+ final IStatus[] status = new IStatus[] {null};
+
+ pm.beginTask(Messages.ExcludeRefactoring_task_loading, 1);
+ MavenModelManager modelManager = MavenPlugin.getDefault().getMavenModelManager();
+ DependencyNode root = modelManager.readDependencyTree(resources.getPomFile(), JavaScopes.TEST, pm);
+ pm.worked(1);
+ root.accept(new DependencyVisitor() {
+
+ private Dependency findDependency(String groupId, String artifactId) {
+ for(Dependency d : deps) {
+ if(d.getGroupId().equals(groupId) && d.getArtifactId().equals(artifactId)) {
+ return d;
+ }
+ }
+ return null;
+ }
+
+ private Dependency findDependency(DependencyNode node) {
+ Artifact artifact;
+ if(node.getRelocations().isEmpty()) {
+ artifact = node.getDependency().getArtifact();
+ } else {
+ artifact = node.getRelocations().get(0);
+ }
+ return findDependency(artifact.getGroupId(), artifact.getArtifactId());
+ }
+
+ private int depth;
+
+ private DependencyNode topLevel;
+
+ private Set<Dependency> excluded = new HashSet<Dependency>();
+
+ public boolean visitLeave(DependencyNode node) {
+ depth-- ;
+ return status[0] == null;
+ }
+
+ public boolean visitEnter(DependencyNode node) {
+ if(depth == 1) {
+ topLevel = node;
+ }
+ depth++ ;
+
+ if(node.getDependency() != null) {
+ Artifact a = node.getDependency().getArtifact();
+ if(a.getGroupId().equals(excludedGroupId) && a.getArtifactId().equals(excludedArtifactId)) {
+ if(topLevel == null) {
+ // do not touch itself
+ } else if(node == topLevel) {
+ // need to remove top-level dependency
+ toRemove.add(findDependency(topLevel));
+ } else {
+ // need to add exclusion to top-level dependency
+ Dependency dependency = findDependency(topLevel);
+ if(dependency == null) {
+ status[0] = new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, NLS.bind(Messages.ExcludeRefactoring_error_parent,
+ topLevel.getDependency().getArtifact().getGroupId(),
+ topLevel.getDependency().getArtifact().getArtifactId()));
+ }
+ if(excluded.add(dependency)) {
+ addExclusion(command, dependency);
+ }
+ }
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ });
+
+ if(status[0] != null) {
+ throw new PomRefactoringException(status[0]);
+ }
+
+ for(Iterator<Dependency> rem = toRemove.iterator(); rem.hasNext();) {
+ command.append(new RemoveCommand(editingDomain, model.getDependencies(), rem.next()));
+ }
+
+ // XXX scan management as well
+
+ return command;
+ }
+
+ private void addExclusion(CompoundCommand command, Dependency dep) {
+ Exclusion exclusion = PomFactoryImpl.eINSTANCE.createExclusion();
+ exclusion.setArtifactId(excludedArtifactId);
+ exclusion.setGroupId(excludedGroupId);
+ command.append(new AddCommand(editingDomain, dep.getExclusions(), exclusion));
+ }
+ };
+ }
+
+ public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ return new RefactoringStatus();
+ }
+
+ public String getName() {
+ return Messages.ExcludeRefactoring_name;
+ }
+
+ public String getTitle() {
+ return NLS.bind(Messages.ExcludeRefactoring_title, new Object[] {excludedGroupId, excludedArtifactId, file.getParent().getName()});
+ }
+
+ public boolean scanAllArtifacts() {
+ //do not scan other artifacts
+ return false;
+ }
+
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/MavenExcludeWizard.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/MavenExcludeWizard.java
new file mode 100644
index 00000000..8bfd857a
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/exclude/MavenExcludeWizard.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring.exclude;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+
+
+/**
+ * @author Anton Kraev
+ */
+public class MavenExcludeWizard extends RefactoringWizard {
+
+ public MavenExcludeWizard(IFile file, String excludedGroupId, String excludedArtifactId) {
+ super(new ExcludeRefactoring(file, excludedGroupId, excludedArtifactId), DIALOG_BASED_USER_INTERFACE);
+ }
+
+ @Override
+ protected void addUserInputPages() {
+ setDefaultPageTitle(getRefactoring().getName());
+ }
+
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/Activator.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/Activator.java
new file mode 100644
index 00000000..060a6f99
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/Activator.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring.internal;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ *
+ * @author Anton Kraev
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.m2e.refactoring"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (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 Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringImages.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringImages.java
new file mode 100644
index 00000000..949c5ef8
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringImages.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring.internal;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class RefactoringImages {
+
+ // images
+
+ // public static final Image IMG_CLEAR = createImage("clear.gif");
+
+ // image descriptors
+
+ public static final ImageDescriptor EXCLUDE = create("exclude.gif"); //$NON-NLS-1$
+
+
+ private static ImageDescriptor create(String key) {
+ try {
+ ImageDescriptor imageDescriptor = createDescriptor(key);
+ ImageRegistry imageRegistry = getImageRegistry();
+ if(imageRegistry!=null) {
+ imageRegistry.put(key, imageDescriptor);
+ }
+ return imageDescriptor;
+ } catch (Exception ex) {
+ MavenLogger.log(key, ex);
+ return null;
+ }
+ }
+
+// private static Image createImage(String key) {
+// create(key);
+// ImageRegistry imageRegistry = getImageRegistry();
+// return imageRegistry==null ? null : imageRegistry.get(key);
+// }
+
+ private static ImageRegistry getImageRegistry() {
+ Activator plugin = Activator.getDefault();
+ return plugin==null ? null : plugin.getImageRegistry();
+ }
+
+ private static ImageDescriptor createDescriptor(String image) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/" + image); //$NON-NLS-1$
+ }
+
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringMavenMenuCreator.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringMavenMenuCreator.java
new file mode 100644
index 00000000..781599cd
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringMavenMenuCreator.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring.internal;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.m2e.core.actions.AbstractMavenMenuCreator;
+import org.eclipse.m2e.core.actions.SelectionUtil;
+import org.eclipse.m2e.refactoring.Messages;
+import org.eclipse.m2e.refactoring.exclude.DependencyExcludeAction;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class RefactoringMavenMenuCreator extends AbstractMavenMenuCreator {
+
+ public void createMenu(IMenuManager mgr) {
+ int selectionType = SelectionUtil.getSelectionType(selection);
+ if(selectionType == SelectionUtil.JAR_FILE) {
+ mgr.appendToGroup(OPEN, getAction(new DependencyExcludeAction(), //
+ DependencyExcludeAction.ID, //
+ Messages.RefactoringMavenMenuCreator_action_exclude, //
+ RefactoringImages.EXCLUDE));
+ }
+ }
+
+}
+
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/SaveDirtyFilesDialog.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/SaveDirtyFilesDialog.java
new file mode 100644
index 00000000..ec01227e
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/SaveDirtyFilesDialog.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring.internal;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.m2e.refactoring.Messages;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ListDialog;
+
+/**
+ * Taken from org.eclipse.wst.common.ui.internal.dialogs
+ *
+ * A generic save files dialog. The bulk of the code for this dialog was taken
+ * from the JDT refactoring support in
+ * org.eclipse.jdt.internal.ui.refactoring.RefactoringSaveHelper. This class is
+ * a good candidate for reuse amoung components.
+ */
+public class SaveDirtyFilesDialog extends ListDialog {
+ public static final String ALL_MODIFIED_RESOURCES_MUST_BE_SAVED_BEFORE_THIS_OPERATION = Messages.SaveDirtyFilesDialog_message_not_saved;
+
+ public static boolean saveDirtyFiles(String mask)
+ {
+ boolean result = true;
+ // TODO (cs) add support for save automatically
+ Shell shell = Display.getCurrent().getActiveShell();
+ IEditorPart[] dirtyEditors = getDirtyEditors(mask);
+ if (dirtyEditors.length > 0)
+ {
+ result = false;
+ SaveDirtyFilesDialog saveDirtyFilesDialog = new SaveDirtyFilesDialog(shell);
+ saveDirtyFilesDialog.setInput(Arrays.asList(dirtyEditors));
+ // Save all open editors.
+ if (saveDirtyFilesDialog.open() == Window.OK)
+ {
+ result = true;
+ int numDirtyEditors = dirtyEditors.length;
+ for (int i = 0; i < numDirtyEditors; i++)
+ {
+ dirtyEditors[i].doSave(null);
+ }
+ }
+ else
+ {
+ MessageDialog dlg = new MessageDialog(shell, Messages.SaveDirtyFilesDialog_title_error, null,
+ ALL_MODIFIED_RESOURCES_MUST_BE_SAVED_BEFORE_THIS_OPERATION,
+ MessageDialog.ERROR, new String[] {IDialogConstants.OK_LABEL}, 0);
+ dlg.open();
+ }
+ }
+ return result;
+ }
+
+ private static IEditorPart[] getDirtyEditors(String mask)
+ {
+ List<IEditorPart> result = new ArrayList<IEditorPart>(0);
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
+ for (int i = 0; i < windows.length; i++) {
+ IWorkbenchPage[] pages = windows[i].getPages();
+ for (int x = 0; x < pages.length; x++) {
+ IEditorPart[] editors = pages[x].getDirtyEditors();
+ for (int z = 0; z < editors.length; z++) {
+ IEditorPart ep = editors[z];
+ if (ep.getTitle().indexOf(mask) > 0) {
+ result.add(ep);
+ }
+ }
+ }
+ }
+ return result.toArray(new IEditorPart[result.size()]);
+ }
+
+ public SaveDirtyFilesDialog(Shell parent)
+ {
+ super(parent);
+ setTitle(Messages.SaveDirtyFilesDialog_title);
+ setAddCancelButton(true);
+ setLabelProvider(createDialogLabelProvider());
+ setMessage(ALL_MODIFIED_RESOURCES_MUST_BE_SAVED_BEFORE_THIS_OPERATION);
+ setContentProvider(new ListContentProvider());
+ }
+
+ protected Control createDialogArea(Composite container)
+ {
+ Composite result = (Composite) super.createDialogArea(container);
+ // TODO... provide preference that supports 'always save'
+ return result;
+ }
+
+
+ private ILabelProvider createDialogLabelProvider()
+ {
+ return new LabelProvider()
+ {
+ public Image getImage(Object element)
+ {
+ return ((IEditorPart) element).getTitleImage();
+ }
+
+ public String getText(Object element)
+ {
+ return ((IEditorPart) element).getTitle();
+ }
+ };
+ }
+
+ /**
+ * A specialized content provider to show a list of editor parts.
+ * This class has been copied from org.eclipse.jdt.internal.ui.viewsupport.ListContentProvider
+ * This class should be removed once a generic solution is made available.
+ */
+ @SuppressWarnings("unchecked")
+ static class ListContentProvider implements IStructuredContentProvider {
+ List fContents;
+
+ public Object[] getElements(Object input) {
+ if(fContents != null && fContents == input)
+ return fContents.toArray();
+ return new Object[0];
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ if(newInput instanceof List) {
+ fContents = (List) newInput;
+ } else {
+ fContents = null;
+ // we use a fixed set.
+ }
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isDeleted(Object o) {
+ return fContents != null && !fContents.contains(o);
+ }
+ }
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/messages.properties b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/messages.properties
new file mode 100644
index 00000000..6c4053d5
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/messages.properties
@@ -0,0 +1,20 @@
+AbstractPomRefactoring_error=Problems during refactoring
+AbstractPomRefactoring_loading=Loading {0}
+AbstractPomRefactoring_task=Refactoring
+ExcludeRefactoring_error_parent=Parent dependency not found for {0}:{1}
+ExcludeRefactoring_name=Exclude Maven Artifact
+ExcludeRefactoring_task_loading=Loading dependency tree
+ExcludeRefactoring_title=Excluding {0}:{1} from {2}
+MavenRenameWizardPage_cbRenameWorkspace=&Rename Eclipse project in Workspace
+MavenRenameWizardPage_desc=Specify new group Id, artifact Id or version
+MavenRenameWizardPage_lblArtifactId=&Artifact Id:
+MavenRenameWizardPage_lblGroupId=&Group Id:
+MavenRenameWizardPage_lblVersion=&Version:
+MavenRenameWizardPage_title=Rename Maven Artifact
+RefactoringMavenMenuCreator_action_exclude=Exclude Maven artifact...
+RenameRefactoring_1=getVersion
+RenameRefactoring_name=Rename Maven Artifact
+RenameRefactoring_title=Renaming {0}
+SaveDirtyFilesDialog_message_not_saved=All modified resources must be saved before this operation.
+SaveDirtyFilesDialog_title=Save All Modified Resources
+SaveDirtyFilesDialog_title_error=Error
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/MavenRenameWizard.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/MavenRenameWizard.java
new file mode 100644
index 00000000..401ce95b
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/MavenRenameWizard.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring.rename;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.refactoring.AbstractPomRefactoring;
+
+
+/**
+ * @author Anton Kraev
+ */
+public class MavenRenameWizard extends RefactoringWizard {
+
+ private static MavenRenameWizardPage page1 = new MavenRenameWizardPage();
+
+ public MavenRenameWizard(IFile file) {
+ super(new RenameRefactoring(file, page1), DIALOG_BASED_USER_INTERFACE);
+ }
+
+ @Override
+ protected void addUserInputPages() {
+ setDefaultPageTitle(getRefactoring().getName());
+ addPage(page1);
+ Model model = ((AbstractPomRefactoring) getRefactoring()).createModel();
+ page1.initialize(model.getGroupId(), model.getArtifactId(), model.getVersion());
+ model.eResource().unload();
+ }
+
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/MavenRenameWizardPage.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/MavenRenameWizardPage.java
new file mode 100644
index 00000000..19d47b00
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/MavenRenameWizardPage.java
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring.rename;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
+import org.eclipse.m2e.refactoring.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+
+/**
+ * @author Anton Kraev
+ */
+public class MavenRenameWizardPage extends UserInputWizardPage {
+ private Text groupIdText;
+ private Text artifactIdText;
+ private Text versionText;
+ private Button renameCheckbox;
+
+ private String groupId;
+ private String artifactId;
+ private String version;
+ private String newGroupId = ""; //$NON-NLS-1$
+ private String newArtifactId = ""; //$NON-NLS-1$
+ private String newVersion = ""; //$NON-NLS-1$
+ private boolean renamed;
+
+ protected MavenRenameWizardPage() {
+ super("MavenRenameWizardPage"); //$NON-NLS-1$
+ setDescription(Messages.MavenRenameWizardPage_desc);
+ setTitle(Messages.MavenRenameWizardPage_title);
+ }
+
+ public void initialize(String groupId, String artifactID, String version) {
+ this.groupId = newGroupId = nvl(groupId);
+ this.artifactId = newArtifactId = nvl(artifactID);
+ this.version = newVersion = nvl(version);
+ }
+
+ public String getNewGroupId() {
+ return newGroupId;
+ }
+
+ public String getNewArtifactId() {
+ return newArtifactId;
+ }
+
+ public String getNewVersion() {
+ return newVersion;
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ boolean renamedArtifact = !newArtifactId.equals(artifactId);
+ renameCheckbox.setEnabled(renamedArtifact);
+ if (!renamedArtifact) {
+ renameCheckbox.setSelection(false);
+ renamed = false;
+ }
+ return !newGroupId.equals(groupId) //
+ || renamedArtifact //
+ || !newVersion.equals(version) //
+ || !isCurrentPage();
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2, false);
+ gridLayout.marginWidth = 10;
+ gridLayout.marginHeight = 10;
+ composite.setLayout(gridLayout);
+ initializeDialogUnits(composite);
+ Dialog.applyDialogFont(composite);
+ setControl(composite);
+
+ Label groupIdLabel = new Label(composite, SWT.NONE);
+ groupIdLabel.setLayoutData(new GridData());
+ groupIdLabel.setText(Messages.MavenRenameWizardPage_lblGroupId);
+
+ groupIdText = new Text(composite, SWT.BORDER);
+ groupIdText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ groupIdText.setData("name", "groupId"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Label artifactIdLabel = new Label(composite, SWT.NONE);
+ artifactIdLabel.setLayoutData(new GridData());
+ artifactIdLabel.setText(Messages.MavenRenameWizardPage_lblArtifactId);
+
+ artifactIdText = new Text(composite, SWT.BORDER);
+ artifactIdText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ artifactIdText.setData("name", "artifactId"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Label versionLabel = new Label(composite, SWT.NONE);
+ versionLabel.setLayoutData(new GridData());
+ versionLabel.setText(Messages.MavenRenameWizardPage_lblVersion);
+
+ versionText = new Text(composite, SWT.BORDER);
+ versionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ versionText.setData("name", "version"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ new Label(composite, SWT.NONE);
+
+ renameCheckbox = new Button(composite, SWT.CHECK);
+ renameCheckbox.setText(Messages.MavenRenameWizardPage_cbRenameWorkspace);
+ renameCheckbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ renameCheckbox.setData("name", "rename"); //$NON-NLS-1$ //$NON-NLS-2$
+ renameCheckbox.setEnabled(false);
+ renameCheckbox.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ renamed = renameCheckbox.getSelection();
+ getWizard().getContainer().updateButtons();
+ }
+ });
+
+ ModifyListener listener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ newGroupId = groupIdText.getText();
+ newArtifactId = artifactIdText.getText();
+ newVersion = versionText.getText();
+ getWizard().getContainer().updateButtons();
+ }
+ };
+
+ groupIdText.setText(groupId);
+ artifactIdText.setText(artifactId);
+ versionText.setText(version);
+
+ groupIdText.addModifyListener(listener);
+ artifactIdText.addModifyListener(listener);
+ versionText.addModifyListener(listener);
+ }
+
+ private String nvl(String str) {
+ return str == null ? "" : str; //$NON-NLS-1$
+ }
+
+ public boolean getRenameEclipseProject() {
+ return renamed;
+ }
+
+}
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactAction.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactAction.java
new file mode 100644
index 00000000..0556df63
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameArtifactAction.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring.rename;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.m2e.core.core.MavenLogger;
+import org.eclipse.m2e.refactoring.internal.SaveDirtyFilesDialog;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionDelegate;
+import org.eclipse.ui.internal.ObjectPluginAction;
+
+
+/**
+ * @author Anton Kraev
+ */
+@SuppressWarnings("restriction")
+public class RenameArtifactAction extends ActionDelegate {
+
+ @Override
+ public void init(IAction action) {
+ super.init(action);
+ }
+
+ @Override
+ public void run(IAction action) {
+ doRun(action);
+ }
+
+ @Override
+ public void runWithEvent(IAction action, Event event) {
+ doRun(action);
+ }
+
+ public void doRun(IAction action) {
+ Object element = ((IStructuredSelection) ((ObjectPluginAction) action).getSelection()).getFirstElement();
+ if(element instanceof IFile) {
+ rename((IFile) element);
+ } else if (element instanceof IProject) {
+ IProject project = (IProject) element;
+ IFile file = project.getFile("pom.xml"); //$NON-NLS-1$
+ if(file!=null) {
+ rename(file);
+ }
+ }
+ }
+
+ private void rename(IFile file) {
+ try {
+ // get the model from existing file
+ Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ boolean rc = SaveDirtyFilesDialog.saveDirtyFiles("pom.xml"); //$NON-NLS-1$
+ if (!rc)
+ return;
+ MavenRenameWizard wizard = new MavenRenameWizard(file);
+ RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
+ String titleForFailedChecks = ""; //$NON-NLS-1$
+ op.run(shell, titleForFailedChecks);
+ } catch(Exception e) {
+ MavenLogger.log("Unable to rename " + file, e);
+ }
+ }
+
+}
+
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameRefactoring.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameRefactoring.java
new file mode 100644
index 00000000..a0e495d5
--- /dev/null
+++ b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/rename/RenameRefactoring.java
@@ -0,0 +1,332 @@
+/*******************************************************************************
+ * Copyright (c) 2008-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
+ *
+ * Contributors:
+ * Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.m2e.refactoring.rename;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.m2e.core.MavenPlugin;
+import org.eclipse.m2e.model.edit.pom.Model;
+import org.eclipse.m2e.model.edit.pom.util.PomResourceImpl;
+import org.eclipse.m2e.refactoring.AbstractPomRefactoring;
+import org.eclipse.m2e.refactoring.Messages;
+import org.eclipse.m2e.refactoring.PomVisitor;
+import org.eclipse.m2e.refactoring.RefactoringModelResources;
+import org.eclipse.m2e.refactoring.RefactoringModelResources.PropertyInfo;
+import org.eclipse.osgi.util.NLS;
+
+
+/**
+ * Rename artifact refactoring implementation
+ *
+ * @author Anton Kraev
+ */
+@SuppressWarnings("unchecked")
+public class RenameRefactoring extends AbstractPomRefactoring {
+ private static final Object[] EMPTY_OBJECT_ARRAY = new Object[] {};
+ private static final String VERSION = "version"; //$NON-NLS-1$
+ private static final String GETVERSION = Messages.RenameRefactoring_1;
+ private static final String ARTIFACT_ID = "artifactId"; //$NON-NLS-1$
+ private static final String GETARTIFACT_ID = "getArtifactId"; //$NON-NLS-1$
+ private static final String GROUP_ID = "groupId"; //$NON-NLS-1$
+ private static final String GETGROUP_ID = "getGroupId"; //$NON-NLS-1$
+
+ // this page contains new values
+ MavenRenameWizardPage page;
+
+ // old values
+ String oldGroupId;
+ String oldArtifactId;
+ String oldVersion;
+
+ public RenameRefactoring(IFile file, MavenRenameWizardPage page) {
+ super(file);
+ this.page = page;
+ }
+
+ // gets element from effective model based on path
+ private Object getElement(Object root, Path path) {
+ if (path == null || path.path.size() == 0) {
+ return root;
+ }
+
+ PathElement current = path.path.remove(0);
+ String getterName = "get" + current.element; //$NON-NLS-1$
+
+ try {
+ Method getter = root.getClass().getMethod(getterName, new Class[] {});
+ root = getElement(getter.invoke(root, EMPTY_OBJECT_ARRAY), path);
+ if (root instanceof List) {
+ List children = (List) root;
+ for (int i=0; i<children.size(); i++) {
+ Object child = children.get(i);
+ Method artifact = child.getClass().getMethod(GETARTIFACT_ID, new Class[] {});
+ String artifactId = (String) artifact.invoke(child, EMPTY_OBJECT_ARRAY);
+ if (current.artifactId != null && !current.artifactId.equals(artifactId))
+ continue;
+
+ //found, names are correct
+ return getElement(child, path);
+ }
+ } else {
+ return getElement(root, path);
+ }
+ return null;
+ } catch(Exception ex) {
+ return null;
+ }
+ }
+
+ /**
+ * Finds all potential matched objects in model
+ */
+ private List<EObjectWithPath> scanModel(Model model, String groupId, String artifactId, String version, boolean processRoot) {
+ List<EObjectWithPath> res = new ArrayList<EObjectWithPath>();
+ Path path = new Path();
+ if(processRoot) {
+ scanObject(path, model, groupId, artifactId, version, res);
+ } else {
+ scanChildren(path, model, groupId, artifactId, version, res);
+ }
+ return res;
+ }
+
+ // add candidate objects with same artifactId
+ private List<EObjectWithPath> scanObject(Path current, EObject obj, String groupId, String artifactId, String version, List<EObjectWithPath> res) {
+ if (scanFeature(obj, ARTIFACT_ID, artifactId)) {
+ // System.out.println("found object " + obj + " : " + current);
+ res.add(new EObjectWithPath(obj, current));
+ }
+ scanChildren(current, obj, groupId, artifactId, version, res);
+ return res;
+ }
+
+ private List<EObjectWithPath> scanChildren(Path current, EObject obj, String groupId, String artifactId, String version, List<EObjectWithPath> res) {
+ Iterator<EObject> it = obj.eContents().iterator();
+ while(it.hasNext()) {
+ obj = it.next();
+ Path child = current.clone();
+ String element = obj.eContainingFeature().getName();
+ element = element.substring(0, 1).toUpperCase() + element.substring(1);
+ child.addElement(element, artifactId);
+ scanObject(child, obj, groupId, artifactId, version, res);
+ }
+ return res;
+ }
+
+ private boolean scanFeature(EObject obj, String featureName, String value) {
+ //not searching on this
+ if(value == null) {
+ return false;
+ }
+ EStructuralFeature feature = obj.eClass().getEStructuralFeature(featureName);
+ if(feature == null) {
+ return false;
+ }
+ String val = obj.eGet(feature) == null ? null : obj.eGet(feature).toString();
+ if(value.equals(val)) {
+ return true;
+ }
+ return false;
+ }
+
+ private String getValue(EObject obj, String featureName) {
+ EStructuralFeature feature = obj.eClass().getEStructuralFeature(featureName);
+ if(feature == null) {
+ return null;
+ }
+ return obj.eGet(feature) == null ? null : obj.eGet(feature).toString();
+ }
+
+ public String getNewProjectName() {
+ return page.getRenameEclipseProject()? page.getNewArtifactId(): null;
+ }
+
+ /**
+ * Applies new values in model
+ * @param editingDomain
+ * @param renameProject
+ * @throws NoSuchMethodException
+ * @throws Exception
+ */
+ public CompoundCommand applyModel(RefactoringModelResources model,
+ String newGroupId, String newArtifactId, String newVersion, boolean processRoot) throws Exception {
+ // find all affected objects in EMF model
+ List<EObjectWithPath> affected = scanModel(model.getTmpModel(), this.oldGroupId, this.oldArtifactId, this.oldVersion, processRoot);
+
+ // go through all affected objects, check in effective model
+ Iterator<EObjectWithPath> i = affected.iterator();
+ CompoundCommand command = new CompoundCommand();
+ while (i.hasNext()) {
+ EObjectWithPath obj = i.next();
+ Object effectiveObj = getElement(model.getEffective(), obj.path.clone());
+ if (effectiveObj == null) {
+ // System.out.println("cannot find effective for: " + obj.object);
+ continue;
+ }
+ Method method = effectiveObj.getClass().getMethod(GETVERSION, new Class[] {});
+ String effectiveVersion = (String) method.invoke(effectiveObj, EMPTY_OBJECT_ARRAY);
+ method = effectiveObj.getClass().getMethod(GETGROUP_ID, new Class[] {});
+ String effectiveGroupId = (String) method.invoke(effectiveObj, EMPTY_OBJECT_ARRAY);
+ // if version from effective POM is different from old version, skip it
+ if (this.oldVersion != null && !this.oldVersion.equals(effectiveVersion)) {
+ continue;
+ }
+
+ // only set groupId if effective group id is the same as old group id
+ if (oldGroupId != null && oldGroupId.equals(effectiveGroupId))
+ applyFeature(editingDomain, model, GROUP_ID, newGroupId, command, obj);
+ // set artifact id unconditionally
+ applyFeature(editingDomain, model, ARTIFACT_ID, newArtifactId, command, obj);
+ // only set version if effective version is the same (already checked by the above)
+ // and new version is not empty
+ if (!"".equals(newVersion)) { //$NON-NLS-1$
+ applyFeature(editingDomain, model, VERSION, newVersion, command, obj);
+ }
+ }
+
+ return command.isEmpty()? null: command;
+ }
+
+ // apply the value, considering properties
+ private void applyFeature(AdapterFactoryEditingDomain editingDomain, RefactoringModelResources model,
+ String feature, String newValue, CompoundCommand command, EObjectWithPath obj) {
+ PropertyInfo info = null;
+ String old = getValue(obj.object, feature);
+ if (old != null && old.startsWith("${")) { //$NON-NLS-1$
+ // this is a property, go find it
+ String pName = old.substring(2);
+ pName = pName.substring(0, pName.length() - 1).trim();
+ info = model.getProperties().get(pName);
+ }
+ if (info != null)
+ info.setNewValue(new SetCommand(editingDomain, info.getPair(), info.getPair().eClass().getEStructuralFeature("value"), newValue)); //$NON-NLS-1$
+ else
+ applyObject(editingDomain, command, obj.object, feature, newValue);
+ }
+
+ private void applyObject(AdapterFactoryEditingDomain editingDomain, CompoundCommand command, EObject obj,
+ String featureName, String value) {
+ EStructuralFeature feature = obj.eClass().getEStructuralFeature(featureName);
+ if(feature == null) {
+ return;
+ }
+ Object old = obj.eGet(feature);
+ if(old == null || old.equals(value)) {
+ return;
+ }
+ command.append(new SetCommand(editingDomain, obj, feature, value));
+ }
+
+ @Override
+ public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {
+ PomResourceImpl resource = MavenPlugin.getDefault().getMavenModelManager().loadResource(file);
+ try {
+ Model model = (Model)resource.getContents().get(0);
+ this.oldArtifactId = model.getArtifactId();
+ this.oldGroupId = model.getGroupId();
+ this.oldVersion = model.getVersion();
+ } finally {
+ resource.unload();
+ }
+ RefactoringStatus res = new RefactoringStatus();
+ return res;
+ }
+
+ @Override
+ public String getName() {
+ return Messages.RenameRefactoring_name;
+ }
+
+ @Override
+ public PomVisitor getVisitor() {
+ return new PomVisitor() {
+
+ public CompoundCommand applyChanges(RefactoringModelResources current, IProgressMonitor pm) throws Exception {
+ //process <project> element only for the refactored file itself
+ boolean processRoot = current.getPomFile().equals(file);
+ return RenameRefactoring.this.applyModel(current, page.getNewGroupId(),
+ page.getNewArtifactId(), page.getNewVersion(), processRoot);
+ }
+ };
+ }
+
+ static class Path {
+ List<PathElement> path = new ArrayList<PathElement>();
+
+ public void addElement(String element, String artifactId) {
+ path.add(new PathElement(element, artifactId));
+ }
+
+ public String toString() {
+ return path.toString();
+ }
+
+ public Path clone() {
+ Path res = new Path();
+ res.path = new ArrayList<PathElement>(this.path);
+ return res;
+ }
+ }
+
+ // path (built during traversal of EMF model, used to find in effective model)
+ static class PathElement {
+ String element;
+ String artifactId;
+
+ public PathElement(String element, String artifactId) {
+ this.element = element;
+ this.artifactId = artifactId;
+ }
+
+ public String toString() {
+ return "/" + element + "[artifactId=" + artifactId + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ }
+
+ static class EObjectWithPath {
+ public EObject object;
+ public Path path;
+
+ public EObjectWithPath(EObject object, Path path) {
+ this.object = object;
+ this.path = path;
+ }
+ }
+
+ // XXX move stuff UP after implementing another refactoring
+ // after moving up, use this
+ interface ScanVisitor {
+ public boolean interested(EObject obj);
+ }
+
+ public boolean scanAllArtifacts() {
+ return true;
+ }
+
+ public String getTitle() {
+ return NLS.bind(Messages.RenameRefactoring_title, file.getParent().getName());
+ }
+
+}
diff --git a/org.eclipse.m2e.sdk.feature/.gitignore b/org.eclipse.m2e.sdk.feature/.gitignore
new file mode 100644
index 00000000..ea8c4bf7
--- /dev/null
+++ b/org.eclipse.m2e.sdk.feature/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/org.eclipse.m2e.sdk.feature/.project b/org.eclipse.m2e.sdk.feature/.project
new file mode 100644
index 00000000..abeb9601
--- /dev/null
+++ b/org.eclipse.m2e.sdk.feature/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.sdk.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.sdk.feature/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.sdk.feature/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..6eb70a5d
--- /dev/null
+++ b/org.eclipse.m2e.sdk.feature/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:21 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.sdk.feature/build.properties b/org.eclipse.m2e.sdk.feature/build.properties
new file mode 100644
index 00000000..605b30c9
--- /dev/null
+++ b/org.eclipse.m2e.sdk.feature/build.properties
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2008-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
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
+bin.includes = feature.xml,\
+ epl-v10.html,\
+ feature.properties,\
+ license.html
diff --git a/org.eclipse.m2e.sdk.feature/epl-v10.html b/org.eclipse.m2e.sdk.feature/epl-v10.html
new file mode 100644
index 00000000..ed4b1966
--- /dev/null
+++ b/org.eclipse.m2e.sdk.feature/epl-v10.html
@@ -0,0 +1,328 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 9">
+<meta name=Originator content="Microsoft Word 9">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor (&quot;Commercial
+Contributor&quot;) hereby agrees to defend and indemnify every other
+Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
+costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
+
+</div>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/org.eclipse.m2e.sdk.feature/feature.properties b/org.eclipse.m2e.sdk.feature/feature.properties
new file mode 100644
index 00000000..babd9bbc
--- /dev/null
+++ b/org.eclipse.m2e.sdk.feature/feature.properties
@@ -0,0 +1,170 @@
+###############################################################################
+# Copyright (c) 2008, 2010 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=M2Eclipse Extensions Development Support (Optional)
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse m2e
+
+# "updateSiteName" property - label for the update site
+#updateSiteName=The Eclipse Project Updates
+
+# "description" property - description of the feature
+description=M2Eclipse Extensions Development Support (Optional)
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=\
+Copyright (c) 2008-2010 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
+################ 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=license.html
+
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=\
+Eclipse Foundation Software User Agreement\n\
+April 14, 2010\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+ 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+ the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+ extending or updating the functionality of an Eclipse-based product.\n\
+ 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+ Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+ 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+ govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+ Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+ with the Specification. Such Installable Software Agreement must inform the user of the\n\
+ terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+ the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+ indication of agreement by the user, the provisioning Technology will complete installation\n\
+ of the Installable Software.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
+########### end of license property ########################################## \ No newline at end of file
diff --git a/org.eclipse.m2e.sdk.feature/feature.xml b/org.eclipse.m2e.sdk.feature/feature.xml
new file mode 100644
index 00000000..0b3f111d
--- /dev/null
+++ b/org.eclipse.m2e.sdk.feature/feature.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.m2e.sdk.feature"
+ label="%featureName"
+ version="0.13.0.qualifier"
+ provider-name="%providerName">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <plugin
+ id="org.eclipse.m2e.tests.common"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.m2e.integration.tests.common"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/org.eclipse.m2e.sdk.feature/license.html b/org.eclipse.m2e.sdk.feature/license.html
new file mode 100644
index 00000000..61d632d9
--- /dev/null
+++ b/org.eclipse.m2e.sdk.feature/license.html
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.m2e.sdk.feature/pom.xml b/org.eclipse.m2e.sdk.feature/pom.xml
new file mode 100644
index 00000000..84f21d59
--- /dev/null
+++ b/org.eclipse.m2e.sdk.feature/pom.xml
@@ -0,0 +1,24 @@
+<?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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.sdk.feature</artifactId>
+ <packaging>eclipse-feature</packaging>
+
+ <name>m2e extensions development support (Optional)</name>
+
+</project>
diff --git a/org.eclipse.m2e.site/.gitignore b/org.eclipse.m2e.site/.gitignore
new file mode 100644
index 00000000..ea8c4bf7
--- /dev/null
+++ b/org.eclipse.m2e.site/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/org.eclipse.m2e.site/.project b/org.eclipse.m2e.site/.project
new file mode 100644
index 00000000..7655b272
--- /dev/null
+++ b/org.eclipse.m2e.site/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.site</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.UpdateSiteBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.UpdateSiteNature</nature>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.site/.settings/org.maven.ide.eclipse.prefs b/org.eclipse.m2e.site/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..6eb70a5d
--- /dev/null
+++ b/org.eclipse.m2e.site/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:21 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/org.eclipse.m2e.site/build.properties b/org.eclipse.m2e.site/build.properties
new file mode 100644
index 00000000..142664f3
--- /dev/null
+++ b/org.eclipse.m2e.site/build.properties
@@ -0,0 +1,11 @@
+#
+# Copyright (c) 2008-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
+#
+# Contributors:
+# Sonatype, Inc. - initial API and implementation
+#
+
diff --git a/org.eclipse.m2e.site/category.xml b/org.eclipse.m2e.site/category.xml
new file mode 100644
index 00000000..f99c6c04
--- /dev/null
+++ b/org.eclipse.m2e.site/category.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <description url="http://m2eclipse.sonatype.org/site">
+ Maven Integration for Eclipse
+ </description>
+ <feature url="features/org.eclipse.m2e.feature_0.0.0.jar" id="org.eclipse.m2e.feature" version="0.0.0">
+ <category name="m2e"/>
+ </feature>
+ <category-def name="m2e" label="Maven Integration for Eclipse"/>
+</site>
diff --git a/org.eclipse.m2e.site/feature.xml b/org.eclipse.m2e.site/feature.xml
new file mode 100644
index 00000000..16213d3b
--- /dev/null
+++ b/org.eclipse.m2e.site/feature.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.m2e.site"
+ label="Maven Integration for Eclipse Update Site"
+ version="0.13.0.qualifier"
+ provider-name="Eclipse.org">
+
+ <includes
+ id="org.eclipse.m2e.feature"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.m2e.sdk.feature"
+ version="0.0.0"/>
+
+</feature>
diff --git a/org.eclipse.m2e.site/pom.xml b/org.eclipse.m2e.site/pom.xml
new file mode 100644
index 00000000..32a42614
--- /dev/null
+++ b/org.eclipse.m2e.site/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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.site</artifactId>
+ <packaging>eclipse-feature</packaging>
+
+ <name>Maven Integration for Eclipse Update Site</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>maven-osgi-packaging-plugin</artifactId>
+ <configuration>
+ <deployableFeature>true</deployableFeature>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>categorization</id>
+ <phase>package</phase>
+ <goals>
+ <goal>category-p2-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <metadataRepositoryName>Maven Integration for Eclipse</metadataRepositoryName>
+ <artifactRepositoryName>Maven Integration for Eclipse</artifactRepositoryName>
+ <compressRepository>false</compressRepository>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-4</version>
+ <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>m2e/${unqualifiedVersion}/N/${unqualifiedVersion}.${buildQualifier}</repositoryPath>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
+
diff --git a/org.eclipse.m2e.site/src/main/assembly/assembly.xml b/org.eclipse.m2e.site/src/main/assembly/assembly.xml
new file mode 100644
index 00000000..8c7848d4
--- /dev/null
+++ b/org.eclipse.m2e.site/src/main/assembly/assembly.xml
@@ -0,0 +1,15 @@
+<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>
+
diff --git a/target-platform/.project b/target-platform/.project
new file mode 100644
index 00000000..4ab2d523
--- /dev/null
+++ b/target-platform/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>target-platform</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.m2e.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ </natures>
+</projectDescription>
diff --git a/target-platform/.settings/org.maven.ide.eclipse.prefs b/target-platform/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 00000000..6eb70a5d
--- /dev/null
+++ b/target-platform/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Tue Nov 16 11:32:21 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/target-platform/m2e-e34.target b/target-platform/m2e-e34.target
new file mode 100644
index 00000000..7adfb243
--- /dev/null
+++ b/target-platform/m2e-e34.target
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.5"?>
+
+<target name="m2e-e34">
+<locations>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.jst.feature.group" version="3.0.4.v200811190840-7U1959LJIHM6ogLbhvbrAnWtxuyM"/>
+<unit id="org.eclipse.wst.feature.group" version="3.0.4.v200811190840-7A-8l8Qqcz0HyVgjXUE-iuOYZ9ai"/>
+<repository location="http://download.eclipse.org/releases/ganymede"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.sdk.ide" version="3.4.2.M20090211-1700"/>
+<repository location="http://download.eclipse.org/eclipse/updates/3.4"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.ajdt.feature.group" version="2.0.1.e34x-20090930-1200"/>
+<repository location="http://download.eclipse.org/tools/ajdt/34/update"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.gef.sdk.feature.group" version="3.4.2.v20090218-1145-7B7E597OKBd7QHgEHNHn9JKTFJJR"/>
+<repository location="http://download.eclipse.org/releases/ganymede"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.mylyn_feature.feature.group" version="3.0.5.v20090218-1800-e3x"/>
+<repository location="http://download.eclipse.org/releases/ganymede"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.swtbot.feature.group" version="2.0.0.512-dev-e34"/>
+<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.0.512-dev-e34"/>
+<repository location="http://download.eclipse.org/technology/swtbot/ganymede/dev-build/update-site"/>
+</location>
+</locations>
+</target>
diff --git a/target-platform/m2e-e35.target b/target-platform/m2e-e35.target
new file mode 100644
index 00000000..de4bb0f3
--- /dev/null
+++ b/target-platform/m2e-e35.target
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.6"?>
+
+<target name="m2e-e35">
+<locations>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.sdk.ide" version="3.5.2.M20100211-1343"/>
+<repository location="http://download.eclipse.org/eclipse/updates/3.5"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.gef.sdk.feature.group" version="3.5.2.v20100111-1352-7G7O5A5WNXWQF_OVSWjaZLTWkNKY"/>
+<repository location="http://download.eclipse.org/releases/galileo"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.jst.enterprise_ui.feature.feature.group" version="3.1.1.v200908101600-7_7EGrjFQRwRb4P511ebObS5XZhq"/>
+<unit id="org.eclipse.wst.web_ui.feature.feature.group" version="3.1.1.v200908120400-7R77FStEVw2z07WtDz-OZrhL5C-3"/>
+<unit id="org.eclipse.wst.web_core.feature.feature.group" version="3.1.1.v200908120400-7H77FDCAT7oGlivgHN1M2RkCBHz0"/>
+<unit id="org.eclipse.jst.web_ui.feature.feature.group" version="3.1.1.v200908121609-7E77FBiDlwYcICNdz-5z-9PGqZCy"/>
+<unit id="org.eclipse.jst.server_ui.feature.feature.group" version="3.1.1.v20090817-7A2FBb9xFaHovXGLUCTMQ2355"/>
+<unit id="org.eclipse.jst.enterprise_core.feature.feature.group" version="3.1.1.v200908101600-52FGEAkF7AG7CDLCFIE"/>
+<unit id="org.eclipse.jst.server_adapters.feature.feature.group" version="3.1.0.v20090311c-20-7w311A1422c"/>
+<unit id="org.eclipse.jst.server_adapters.ext.feature.feature.group" version="3.1.1.v20090813-777HFDPCcNBBz0BjJU4BA8"/>
+<repository location="http://download.eclipse.org/releases/galileo"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e35"/>
+<unit id="org.eclipse.swtbot.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e35"/>
+<repository location="http://download.eclipse.org/technology/swtbot/galileo/dev-build/update-site/"/>
+</location>
+</locations>
+</target>
diff --git a/target-platform/m2e-e36.target b/target-platform/m2e-e36.target
new file mode 100644
index 00000000..a3ddf65b
--- /dev/null
+++ b/target-platform/m2e-e36.target
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.6"?>
+
+<target name="m2e-e36">
+<locations>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.sdk.ide" version="3.6.1.M20100909-0800"/>
+<unit id="org.eclipse.emf.common.feature.group" version="2.6.0.v20100914-1218"/>
+<unit id="org.eclipse.wst.common.emf" version="1.2.1.v201008260500"/>
+<unit id="org.eclipse.wst.sse.core" version="1.1.502.v201008311901"/>
+<unit id="org.eclipse.wst.xml.core" version="1.1.502.v201009010342"/>
+<unit id="org.eclipse.wst.sse.ui" version="1.2.2.v201008232126"/>
+<unit id="org.eclipse.emf.ecore.edit.feature.group" version="2.6.0.v20100914-1218"/>
+<unit id="org.eclipse.emf.edit.ui.feature.group" version="2.6.0.v20100914-1218"/>
+<unit id="org.eclipse.wst.xsd.core" version="1.1.502.v201008201521"/>
+<unit id="org.eclipse.wst.web_ui.feature.feature.group" version="3.2.2.v201008100100-7O7CFbKEMf84nUlEJyX7-SPQjhYZ"/>
+<repository location="http://download.eclipse.org/releases/helios"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e36"/>
+<unit id="org.eclipse.swtbot.eclipse.gef.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e36"/>
+<unit id="org.eclipse.swtbot.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e36"/>
+<unit id="org.eclipse.swtbot.ide.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e36"/>
+<unit id="org.eclipse.swtbot.eclipse.test.junit3.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e36"/>
+<unit id="org.eclipse.swtbot.eclipse.test.junit4.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e36"/>
+<repository location="http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site/"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.6.0.v20100503-9I7VGAeG8tz-BY6jz0w2HLRYr"/>
+<repository location="http://download.eclipse.org/releases/helios"/>
+</location>
+</locations>
+</target>
diff --git a/target-platform/m2e-e37.target b/target-platform/m2e-e37.target
new file mode 100644
index 00000000..68387d89
--- /dev/null
+++ b/target-platform/m2e-e37.target
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.6"?>
+
+<target name="m2e-e37">
+<locations>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.emf.common.feature.group" version="2.6.0.v20101108-0959"/>
+<unit id="org.eclipse.wst.common.emf" version="1.2.100.v201009212000"/>
+<unit id="org.eclipse.wst.sse.core" version="1.1.600.v201011021846"/>
+<unit id="org.eclipse.wst.xml.core" version="1.1.600.v201010292144"/>
+<unit id="org.eclipse.wst.sse.ui" version="1.2.100.v201010292144"/>
+<unit id="org.eclipse.emf.ecore.edit.feature.group" version="2.6.0.v20101108-0959"/>
+<unit id="org.eclipse.emf.edit.ui.feature.group" version="2.6.0.v20101108-0959"/>
+<unit id="org.eclipse.wst.xsd.core" version="1.1.600.v201008201550"/>
+<unit id="org.eclipse.wst.web_ui.feature.feature.group" version="3.3.0.v201010270400-7O7IFhJEMi9Cr0IHMtlf80Lq9nfr"/>
+<repository location="http://download.eclipse.org/releases/indigo"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e36"/>
+<unit id="org.eclipse.swtbot.eclipse.gef.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e36"/>
+<unit id="org.eclipse.swtbot.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e36"/>
+<unit id="org.eclipse.swtbot.ide.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e36"/>
+<unit id="org.eclipse.swtbot.eclipse.test.junit3.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e36"/>
+<unit id="org.eclipse.swtbot.eclipse.test.junit4.feature.group" version="2.0.1.20101106_1831-73ca7af-dev-e36"/>
+<repository location="http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site/"/>
+</location>
+<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+<unit id="org.eclipse.sdk.ide" version="3.7.0.I20101028-1441"/>
+<unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.7.0.v20100927-1600-9I7eHGRGJYaz0m-JiQOAeQ2D1395"/>
+<repository location="http://download.eclipse.org/eclipse/updates/3.7milestones"/>
+</location>
+</locations>
+</target>
diff --git a/target-platform/pom.xml b/target-platform/pom.xml
new file mode 100644
index 00000000..db1484ec
--- /dev/null
+++ b/target-platform/pom.xml
@@ -0,0 +1,55 @@
+<?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</groupId>
+ <artifactId>org.eclipse.m2e.parent</artifactId>
+ <version>0.13.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.m2e.parent</relativePath>
+ </parent>
+
+ <artifactId>target-platform</artifactId>
+ <packaging>pom</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.3</version>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>m2e-e34.target</file>
+ <type>target</type>
+ <classifier>m2e-e34</classifier>
+ </artifact>
+ <artifact>
+ <file>m2e-e35.target</file>
+ <type>target</type>
+ <classifier>m2e-e35</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>

Back to the top