Class MavenBasedPackageDependency
- java.lang.Object
-
- org.apache.jackrabbit.filevault.maven.packaging.MavenBasedPackageDependency
-
public class MavenBasedPackageDependency extends Object
This class represents a dependency to another content package. A dependency consists of a group name, a package name and a version range.A dependency is declared as a
<dependency>
element of a list style<dependencies>
element:<dependency> <group>theGroup</group> <name>theName</name> <version>1.5</version> </dependency>
The dependency can also reference a maven project dependency, this is preferred as it yields to more robust builds.
<dependency> <groupId>theGroup</groupId> <artifactId>theName</artifactId> </dependency>
The
versionRange
may be indicated as a single version, in which case the version range has no upper bound and defines the minimal version accepted. Otherwise, the version range defines a lower and upper bound of accepted versions, where the bounds are either included using parentheses()
or excluded using brackets[]
-
-
Constructor Summary
Constructors Constructor Description MavenBasedPackageDependency()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MavenBasedPackageDependency
fromGroupNameAndVersion(String group, String name, String version)
@Nullable org.apache.jackrabbit.vault.packaging.PackageInfo
getInfo()
Returns the package info ornull
.@Nullable URI
getLocation()
org.apache.jackrabbit.vault.packaging.Dependency
getPackageDependency()
Returns the package dependency ornull
if not resolved.static URI
mavenCoordinatesToUri(@NotNull String groupId, @NotNull String artifactId, @NotNull String version, String classifier)
void
readMetaData(File file, org.apache.maven.plugin.logging.Log log)
static void
resolve(org.apache.maven.project.MavenProject project, org.apache.maven.plugin.logging.Log log, Collection<MavenBasedPackageDependency> dependencies)
Converts a list ofMavenBasedPackageDependency
instances to vault dependencies.String
toString()
-
-
-
Method Detail
-
fromGroupNameAndVersion
public static MavenBasedPackageDependency fromGroupNameAndVersion(String group, String name, String version)
-
resolve
public static void resolve(org.apache.maven.project.MavenProject project, org.apache.maven.plugin.logging.Log log, Collection<MavenBasedPackageDependency> dependencies) throws IOException
Converts a list ofMavenBasedPackageDependency
instances to vault dependencies.- Parameters:
project
- the Maven projectlog
- the Loggerdependencies
- The list ofMavenBasedPackageDependency
instances to convert.- Throws:
IOException
- in case meta information could not be read from the project dependency or the dependency is not a content package.
-
readMetaData
public void readMetaData(File file, org.apache.maven.plugin.logging.Log log) throws IOException
- Throws:
IOException
-
getInfo
@Nullable public @Nullable org.apache.jackrabbit.vault.packaging.PackageInfo getInfo()
Returns the package info ornull
.- Returns:
- the info.
-
getPackageDependency
@Nullable public org.apache.jackrabbit.vault.packaging.Dependency getPackageDependency()
Returns the package dependency ornull
if not resolved.- Returns:
- the package dependency.
-
getLocation
@Nullable public @Nullable URI getLocation()
-
-