lifecycle-mapping-metadata-model
LifecycleMappingMetadataSource
package
org.eclipse.m2e.core.internal.lifecyclemapping.model
LifecycleMappingMetadataSource
groupId
String
artifactId
String
version
String
lifecycleMappings
LifecycleMappingMetadata
*
pluginExecutions
PluginExecutionMetadata
*
LifecycleMappingMetadata
packagingType
String
lifecycleMappingId
String
lifecycleMappingVersionRange
String
pluginExecutions
PluginExecutionMetadata
*
PluginExecutionFilter
groupId
true
String
artifactId
true
String
versionRange
true
String
goals
true
Set
String
*
parameters
Map
String
*
goals) {
this.groupId = groupId;
this.artifactId = artifactId;
setVersionRange(versionRange);
this.goals = goals;
}
public PluginExecutionFilter(String groupId, String artifactId, String versionRange, String goals) {
this(groupId, artifactId, versionRange, new java.util.LinkedHashSet(java.util.Arrays.asList(goals.split(",")))); //$NON-NLS-1$;
}
private transient org.apache.maven.artifact.versioning.VersionRange parsedVersionRange;
public void setVersionRange(String versionRange) {
this.versionRange = versionRange;
try {
parsedVersionRange = org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec(versionRange);
} catch(org.apache.maven.artifact.versioning.InvalidVersionSpecificationException e) {
throw new IllegalArgumentException("Cannot parse version range: " + versionRange, e);
}
}
private void checkAllFieldsSet() {
if (groupId==null || artifactId==null || versionRange==null || goals==null || goals.isEmpty() ){
throw new IllegalArgumentException(
"Missing parameter for pluginExecutionFilter. " +
"groupId, artifactId, versionRange and goals must be specificed, but found: "+this);
}
}
/**
* Returns true if mojoExecution matches this key or false otherwise. This method does not consider mojo execution
* parameters.
*/
public boolean match(org.eclipse.m2e.core.project.configurator.MojoExecutionKey mojoExecution) {
checkAllFieldsSet();
if(!getGroupId().equals(mojoExecution.getGroupId()) || !getArtifactId().equals(mojoExecution.getArtifactId())) {
return false;
}
org.apache.maven.artifact.versioning.DefaultArtifactVersion version = new org.apache.maven.artifact.versioning.DefaultArtifactVersion(mojoExecution.getVersion());
if(parsedVersionRange==null) {
try {
parsedVersionRange = org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec(versionRange);
} catch(org.apache.maven.artifact.versioning.InvalidVersionSpecificationException e) {
throw new IllegalArgumentException("Cannot parse version range: " + versionRange, e);
}
}
if(!parsedVersionRange.containsVersion(version)) {
return false;
}
return getGoals().contains(mojoExecution.getGoal());
}
]]>
PluginExecutionMetadata
org.eclipse.m2e.core.lifecyclemapping.model.IPluginExecutionMetadata
filter
PluginExecutionFilter
1
actionDom
DOM
comment
String
Arbitrary comment that describes the mapping. The comment is not interpreted by m2e in any way.
@since 1.2