public class POM extends XML implements Comparable<POM>, Versioned
Constructor and Description |
---|
POM(File file)
Parses a POM from the given file.
|
POM(InputStream in)
Parses a POM from the given input stream.
|
POM(String s)
Parses a POM from the given string.
|
POM(URL url)
Parses a POM from the given URL.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(POM pom) |
static int |
compareVersions(String v1,
String v2)
Compares two version strings.
|
static List<POM> |
getAllPOMs()
Gets all available Maven POMs on the class path.
|
String |
getArtifactId()
Gets the POM's artifactId.
|
String |
getCIManagementSystem()
Gets the CI management system.
|
String |
getCIManagementURL()
Gets the CI management URL.
|
String |
getGroupId()
Gets the POM's groupId.
|
String |
getIssueManagementSystem()
Gets the issue management system.
|
String |
getIssueManagementURL()
Gets the issue management URL.
|
String |
getOrganizationName()
Gets the organization name.
|
String |
getOrganizationURL()
Gets the organization URL.
|
String |
getParentArtifactId()
Gets the POM's parent artifactId.
|
String |
getParentGroupId()
Gets the POM's parent groupId.
|
String |
getParentVersion()
Gets the POM's parent artifactId.
|
static POM |
getPOM(Class<?> c)
Gets the Maven POM associated with the given class.
|
static POM |
getPOM(Class<?> c,
String groupId,
String artifactId)
Gets the Maven POM associated with the given class.
|
String |
getProjectDescription()
Gets the project description.
|
String |
getProjectInceptionYear()
Gets the project inception year.
|
String |
getProjectName()
Gets the project name.
|
String |
getProjectURL()
Gets the project URL.
|
String |
getSCMConnection()
Gets the SCM connection string.
|
String |
getSCMDeveloperConnection()
Gets the SCM developerConnection string.
|
String |
getSCMTag()
Gets the SCM tag.
|
String |
getSCMURL()
Gets the SCM URL.
|
String |
getVersion()
Gets the POM's version.
|
public POM(File file) throws ParserConfigurationException, SAXException, IOException
public POM(URL url) throws ParserConfigurationException, SAXException, IOException
public POM(InputStream in) throws ParserConfigurationException, SAXException, IOException
public POM(String s) throws ParserConfigurationException, SAXException, IOException
public String getParentGroupId()
public String getParentArtifactId()
public String getParentVersion()
public String getGroupId()
public String getArtifactId()
public String getProjectName()
public String getProjectDescription()
public String getProjectURL()
public String getProjectInceptionYear()
public String getOrganizationName()
public String getOrganizationURL()
public String getSCMConnection()
public String getSCMDeveloperConnection()
public String getSCMTag()
public String getSCMURL()
public String getIssueManagementSystem()
public String getIssueManagementURL()
public String getCIManagementSystem()
public String getCIManagementURL()
public int compareTo(POM pom)
compareTo
in interface Comparable<POM>
public String getVersion()
getVersion
in interface Versioned
public static POM getPOM(Class<?> c)
c
- The class to use as a base when searching for a pom.xml.POM
object representing the discovered POM, or null if no
POM could be found.public static POM getPOM(Class<?> c, String groupId, String artifactId)
c
- The class to use as a base when searching for a pom.xml.groupId
- The Maven groupId of the desired POM.artifactId
- The Maven artifactId of the desired POM.POM
object representing the discovered POM, or null if no
POM could be found.public static int compareVersions(String v1, String v2)
Given the variation between versioning styles, there is no single comparison method that can possibly be correct 100% of the time. So this method works on a "best effort" basis; YMMV.
The algorithm is as follows:
-
), the version with
suffix will be considered less than the one without a suffix. The
reason for this is to accommodate the SemVer versioning scheme's usage of
"prerelease" version suffixes. For example, 2.0.0
will compare
greater than 2.0.0-beta-1
, whereas 2.0.0
will compare less
than 2.0.0.1
.Comparator.compare(Object, Object)
Copyright © 2015–2022 SciJava. All rights reserved.