CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-org-apache-maven--maven-model

Model for Maven POM (Project Object Model)

Pending
Overview
Eval results
Files

core-model.mddocs/

Core Model Classes

The main Model class and fundamental structure classes that represent the root POM elements and shared build configuration. These are the primary entry points for working with Maven project definitions.

Capabilities

Model

The root class representing a complete Maven project definition, corresponding to the <project> element in a POM file.

public class Model extends ModelBase {
    // Core project coordinates
    public String getModelVersion();
    public void setModelVersion(String modelVersion);
    public String getGroupId();
    public void setGroupId(String groupId);
    public String getArtifactId();
    public void setArtifactId(String artifactId);
    public String getVersion();
    public void setVersion(String version);
    public String getPackaging();
    public void setPackaging(String packaging);
    
    // Project information
    public String getName();
    public void setName(String name);
    public String getDescription();
    public void setDescription(String description);
    public String getUrl();
    public void setUrl(String url);
    public String getInceptionYear();
    public void setInceptionYear(String inceptionYear);
    
    // URL inheritance control for child projects
    public String getChildProjectUrlInheritAppendPath();
    public void setChildProjectUrlInheritAppendPath(String value);
    public boolean isChildProjectUrlInheritAppendPath();
    public void setChildProjectUrlInheritAppendPath(boolean value);
    
    // Parent relationship
    public Parent getParent();
    public void setParent(Parent parent);
    
    // Project structure
    public List<String> getModules();
    public void setModules(List<String> modules);
    public void addModule(String module);
    public void removeModule(String module);
    
    // Organization and people
    public Organization getOrganization();
    public void setOrganization(Organization organization);
    public List<License> getLicenses();
    public void setLicenses(List<License> licenses);
    public void addLicense(License license);
    public void removeLicense(License license);
    public List<Developer> getDevelopers();
    public void setDevelopers(List<Developer> developers);
    public void addDeveloper(Developer developer);
    public void removeDeveloper(Developer developer);
    public List<Contributor> getContributors();
    public void setContributors(List<Contributor> contributors);
    public void addContributor(Contributor contributor);
    public void removeContributor(Contributor contributor);
    public List<MailingList> getMailingLists();
    public void setMailingLists(List<MailingList> mailingLists);
    public void addMailingList(MailingList mailingList);
    public void removeMailingList(MailingList mailingList);
    
    // Management systems
    public IssueManagement getIssueManagement();
    public void setIssueManagement(IssueManagement issueManagement);
    public CiManagement getCiManagement();
    public void setCiManagement(CiManagement ciManagement);
    public Scm getScm();
    public void setScm(Scm scm);
    public Prerequisites getPrerequisites();
    public void setPrerequisites(Prerequisites prerequisites);
    
    // Profiles
    public List<Profile> getProfiles();
    public void setProfiles(List<Profile> profiles);
    public void addProfile(Profile profile);
    public void removeProfile(Profile profile);
    
    // Properties
    public Properties getProperties();
    public void setProperties(Properties properties);
    public void addProperty(String key, String value);
    
    // Utility methods
    public String getId();
    public String toString();
    public File getPomFile();
    public void setPomFile(File pomFile);
    public File getProjectDirectory();
    public void setProjectDirectory(File projectDirectory);
    public Model clone();
    public InputLocation getLocation(Object key);
    public void setLocation(Object key, InputLocation location);
}

Usage Example:

Model model = new Model();
model.setModelVersion("4.0.0");
model.setGroupId("com.example");
model.setArtifactId("my-project");
model.setVersion("1.0.0");
model.setPackaging("jar");
model.setName("My Example Project");
model.setDescription("An example Maven project");

// Add properties
model.addProperty("maven.compiler.source", "11");
model.addProperty("maven.compiler.target", "11");

// Add modules for multi-module project
model.addModule("submodule-1");
model.addModule("submodule-2");

ModelBase

Base class containing common elements shared between Model and Profile classes. Contains dependencies, repositories, build configuration, and other shared POM elements.

public class ModelBase {
    // Dependencies
    public List<Dependency> getDependencies();
    public void setDependencies(List<Dependency> dependencies);
    public void addDependency(Dependency dependency);
    public void removeDependency(Dependency dependency);
    public DependencyManagement getDependencyManagement();
    public void setDependencyManagement(DependencyManagement dependencyManagement);
    
    // Repositories
    public List<Repository> getRepositories();
    public void setRepositories(List<Repository> repositories);
    public void addRepository(Repository repository);
    public void removeRepository(Repository repository);
    public List<Repository> getPluginRepositories();
    public void setPluginRepositories(List<Repository> pluginRepositories);
    public void addPluginRepository(Repository pluginRepository);
    public void removePluginRepository(Repository pluginRepository);
    
    // Build configuration
    public Build getBuild();
    public void setBuild(Build build);
    
    // Reporting
    public Reporting getReporting();
    public void setReporting(Reporting reporting);
    
    // Distribution
    public DistributionManagement getDistributionManagement();
    public void setDistributionManagement(DistributionManagement distributionManagement);
    
    // Properties
    public Properties getProperties();
    public void setProperties(Properties properties);
    
    // Utility methods
    public ModelBase clone();
    public InputLocation getLocation(Object key);
    public void setLocation(Object key, InputLocation location);
}

Parent

Represents the parent POM reference, enabling POM inheritance for shared configuration.

public class Parent {
    public String getGroupId();
    public void setGroupId(String groupId);
    public String getArtifactId();
    public void setArtifactId(String artifactId);
    public String getVersion();
    public void setVersion(String version);
    public String getRelativePath();
    public void setRelativePath(String relativePath);
    
    // Utility methods
    public String getId();
    public String toString();
    public Parent clone();
    public InputLocation getLocation(Object key);
    public void setLocation(Object key, InputLocation location);
}

Usage Example:

Parent parent = new Parent();
parent.setGroupId("com.example");
parent.setArtifactId("parent-pom");
parent.setVersion("1.0.0");
parent.setRelativePath("../parent/pom.xml");

Model childModel = new Model();
childModel.setParent(parent);
childModel.setArtifactId("child-module");
// Version and groupId inherited from parent

Prerequisites

Defines the minimum Maven version required to build the project.

public class Prerequisites {
    public String getMaven();
    public void setMaven(String maven);
    
    // Utility methods
    public Prerequisites clone();
    public InputLocation getLocation(Object key);
    public void setLocation(Object key, InputLocation location);
}

ConfigurationContainer

Base class for elements that can contain configuration data.

public class ConfigurationContainer {
    public Object getConfiguration();
    public void setConfiguration(Object configuration);
    public boolean isInherited();
    public void setInherited(boolean inherited);
    
    // Utility methods
    public ConfigurationContainer clone();
    public InputLocation getLocation(Object key);
    public void setLocation(Object key, InputLocation location);
}

Install with Tessl CLI

npx tessl i tessl/maven-org-apache-maven--maven-model

docs

build-config.md

core-model.md

dependencies.md

index.md

model-merging.md

profiles.md

project-metadata.md

repositories.md

utility-classes.md

xml-io.md

tile.json