diff options
Diffstat (limited to 'org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/MojoExecutionMappingConfiguration.java')
-rw-r--r-- | org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/MojoExecutionMappingConfiguration.java | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/MojoExecutionMappingConfiguration.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/MojoExecutionMappingConfiguration.java index 55c9cff9..861d5525 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/MojoExecutionMappingConfiguration.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/discovery/MojoExecutionMappingConfiguration.java @@ -1,13 +1,19 @@ /******************************************************************************* - * Copyright (c) 2008 Sonatype, Inc. + * Copyright (c) 2008-2013 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 + * Red Hat, Inc. - packaging and executionId attributes to MojoExecutionMappingRequirement *******************************************************************************/ package org.eclipse.m2e.core.internal.lifecyclemapping.discovery; +import org.eclipse.core.runtime.Assert; + import org.eclipse.m2e.core.internal.lifecyclemapping.LifecycleMappingFactory; import org.eclipse.m2e.core.internal.lifecyclemapping.model.PluginExecutionMetadata; import org.eclipse.m2e.core.lifecyclemapping.model.IPluginExecutionMetadata; @@ -24,13 +30,32 @@ public class MojoExecutionMappingConfiguration implements ILifecycleMappingEleme public static class MojoExecutionMappingRequirement implements ILifecycleMappingRequirement { private final MojoExecutionKey execution; + private String executionId; + + private String packaging; + public MojoExecutionMappingRequirement(MojoExecutionKey execution) { + Assert.isNotNull(execution); this.execution = new MojoExecutionKey(execution.getGroupId(), execution.getArtifactId(), execution.getVersion(), execution.getGoal(), null, null); + + executionId = execution.getExecutionId(); + } + + /** + * @since 1.5.0 + */ + public MojoExecutionMappingRequirement(MojoExecutionKey execution, String packaging) { + this(execution); + this.packaging = packaging; } public int hashCode() { - return execution.hashCode(); + int hash = execution.hashCode(); + if(executionId != null) { + //hash = 17 * hash + executionId.hashCode(); + } + return hash; } public boolean equals(Object obj) { @@ -45,11 +70,27 @@ public class MojoExecutionMappingConfiguration implements ILifecycleMappingEleme MojoExecutionMappingRequirement other = (MojoExecutionMappingRequirement) obj; return execution.equals(other.execution); + + } + + /** + * @since 1.5.0 + */ + public String getExecutionId() { + return executionId; } public MojoExecutionKey getExecution() { return execution; } + + /** + * @since 1.5.0 + */ + public String getPackaging() { + return packaging; + } + } public static class ProjectConfiguratorMappingRequirement implements ILifecycleMappingRequirement { |