![JAR search and dependency download from the Maven repository](/logo.png)
org.apache.maven.model.Plugin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of maven-model Show documentation
Show all versions of maven-model Show documentation
Model for Maven POM (Project Object Model)
The newest version!
// =================== DO NOT EDIT THIS FILE ====================
// Generated by Modello Velocity from model-v3.vm
// template, any modifications will be overwritten.
// ==============================================================
package org.apache.maven.model;
import java.io.Serializable;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.maven.api.annotations.Generated;
import org.apache.maven.api.annotations.Nonnull;
import org.codehaus.plexus.util.xml.Xpp3Dom;
@Generated
public class Plugin
extends ConfigurationContainer
implements Serializable, Cloneable
{
public Plugin() {
this(org.apache.maven.api.model.Plugin.newInstance());
}
public Plugin(org.apache.maven.api.model.Plugin delegate) {
this(delegate, null);
}
public Plugin(org.apache.maven.api.model.Plugin delegate, BaseObject parent) {
super(delegate, parent);
}
public Plugin clone(){
return new Plugin(getDelegate());
}
@Override
public org.apache.maven.api.model.Plugin getDelegate() {
return (org.apache.maven.api.model.Plugin) super.getDelegate();
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || !(o instanceof Plugin)) {
return false;
}
Plugin that = (Plugin) o;
return Objects.equals(this.delegate, that.delegate);
}
@Override
public int hashCode() {
return getDelegate().hashCode();
}
public String getGroupId() {
return getDelegate().getGroupId();
}
public void setGroupId(String groupId) {
if (!Objects.equals(groupId, getGroupId())) {
update(getDelegate().withGroupId(groupId));
}
}
public String getArtifactId() {
return getDelegate().getArtifactId();
}
public void setArtifactId(String artifactId) {
if (!Objects.equals(artifactId, getArtifactId())) {
update(getDelegate().withArtifactId(artifactId));
}
}
public String getVersion() {
return getDelegate().getVersion();
}
public void setVersion(String version) {
if (!Objects.equals(version, getVersion())) {
update(getDelegate().withVersion(version));
}
}
public String getExtensions() {
return getDelegate().getExtensions();
}
public void setExtensions(String extensions) {
if (!Objects.equals(extensions, getExtensions())) {
update(getDelegate().withExtensions(extensions));
}
}
@Nonnull
public List getExecutions() {
return new WrapperList(
() -> getDelegate().getExecutions(), l -> update(getDelegate().withExecutions(l)),
d -> new PluginExecution(d, this), PluginExecution::getDelegate);
}
public void setExecutions(List executions) {
if (executions == null) {
executions = Collections.emptyList();
}
if (!Objects.equals(executions, getExecutions())) {
update(getDelegate().withExecutions(
executions.stream().map(c -> c.getDelegate()).collect(Collectors.toList())));
executions.forEach(e -> e.childrenTracking = this::replace);
}
}
public void addExecution(PluginExecution execution) {
update(getDelegate().withExecutions(
Stream.concat(getDelegate().getExecutions().stream(), Stream.of(execution.getDelegate()))
.collect(Collectors.toList())));
execution.childrenTracking = this::replace;
}
public void removeExecution(PluginExecution execution) {
update(getDelegate().withExecutions(
getDelegate().getExecutions().stream()
.filter(e -> !Objects.equals(e, execution))
.collect(Collectors.toList())));
execution.childrenTracking = null;
}
@Nonnull
public List getDependencies() {
return new WrapperList(
() -> getDelegate().getDependencies(), l -> update(getDelegate().withDependencies(l)),
d -> new Dependency(d, this), Dependency::getDelegate);
}
public void setDependencies(List dependencies) {
if (dependencies == null) {
dependencies = Collections.emptyList();
}
if (!Objects.equals(dependencies, getDependencies())) {
update(getDelegate().withDependencies(
dependencies.stream().map(c -> c.getDelegate()).collect(Collectors.toList())));
dependencies.forEach(e -> e.childrenTracking = this::replace);
}
}
public void addDependency(Dependency dependency) {
update(getDelegate().withDependencies(
Stream.concat(getDelegate().getDependencies().stream(), Stream.of(dependency.getDelegate()))
.collect(Collectors.toList())));
dependency.childrenTracking = this::replace;
}
public void removeDependency(Dependency dependency) {
update(getDelegate().withDependencies(
getDelegate().getDependencies().stream()
.filter(e -> !Objects.equals(e, dependency))
.collect(Collectors.toList())));
dependency.childrenTracking = null;
}
public InputLocation getLocation(Object key) {
org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation(key);
return loc != null ? new InputLocation(loc) : null;
}
public void setLocation(Object key, InputLocation location) {
update(org.apache.maven.api.model.Plugin.newBuilder(getDelegate(), true)
.location(key, location.toApiLocation()).build());
}
public InputLocation getImportedFrom() {
org.apache.maven.api.model.InputLocation loc = getDelegate().getImportedFrom();
return loc != null ? new InputLocation(loc) : null;
}
public void setImportedFrom(InputLocation location) {
update(org.apache.maven.api.model.Plugin.newBuilder(getDelegate(), true)
.importedFrom(location.toApiLocation()).build());
}
public Set
© 2015 - 2025 Weber Informatics LLC | Privacy Policy