Package dev.jeka.core.api.tooling.maven
Class JkPom
java.lang.Object
dev.jeka.core.api.tooling.maven.JkPom
Wraps a POM file (Ideally an effective POM file) and provides convenient methods to extract
information on.
-
Method Summary
Modifier and TypeMethodDescriptionThe artifactId for this POM.The dependencies declared in this POM.dev.jeka.core.api.tooling.maven.DependencyExclusionsTheDependencyExclusionsinstance provided by thedependencyManagementsection of this POM.The groupId for this POM.Returns properties declared in this POM.getRepos()Repositories declared in this POM.The version for this POM.static JkPomCreates aJkPomjump a POM file, ideally an effective POM file.static JkPomofEffectivePom(JkCoordinate coordinate, JkRepoSet repoSet) Creates an effective POM representation for the specified Maven coordinate using the provided repository set.Converts the current instance's underlying POM document into a DOMDocument.toEffectivePom(JkRepoSet repos) Converts the current POM to its effective form, resolving any inherited or external dependencies using the specified repository set.toVersionProvider(JkRepoSet repos) Converts the current POM representation into aJkVersionProvider, which manages version information for dependencies within the POM, including those defined in its dependency management section.
-
Method Details
-
of
Creates aJkPomjump a POM file, ideally an effective POM file. -
ofEffectivePom
Creates an effective POM representation for the specified Maven coordinate using the provided repository set.- Parameters:
coordinate- the Maven coordinate for which to generate the effective POMrepoSet- the set of repositories to use for resolving dependencies and inheritance- Returns:
- a
JkPominstance representing the effective POM of the specified coordinate
-
getGroupId
The groupId for this POM. -
getParentGroupId
-
getArtifactId
The artifactId for this POM. -
getVersion
The version for this POM. -
getParentVersion
-
getDependencies
The dependencies declared in this POM. -
toVersionProvider
Converts the current POM representation into aJkVersionProvider, which manages version information for dependencies within the POM, including those defined in its dependency management section. If there is no dependency management section, an empty version provider is returned. Dependencies with a type of "pom" are identified as imported BOMs and are not included in the returned provider.Important: Ensure to use this method on an effectivePom (obtained with #toEffectivePom) to get full resolution.
- Returns:
- a
JkVersionProvidercontaining the versions of dependencies defined in the dependency management section of the POM, or an empty provider if no such section exists.
-
getProperties
Returns properties declared in this POM. -
getDependencyExclusion
public dev.jeka.core.api.tooling.maven.DependencyExclusions getDependencyExclusion()TheDependencyExclusionsinstance provided by thedependencyManagementsection of this POM. -
getRepos
Repositories declared in this POM. -
toEffectivePom
Converts the current POM to its effective form, resolving any inherited or external dependencies using the specified repository set.- Parameters:
repos- the set of repositories to use for resolving dependencies and external properties- Returns:
- the effective POM representation as a
JkPominstance
-
toDocument
Converts the current instance's underlying POM document into a DOMDocument.- Returns:
- a deep-cloned
Documentrepresentation of the POM.
-