Class 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 Detail

      • MavenBasedPackageDependency

        public MavenBasedPackageDependency()
    • Method Detail

      • 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 or null.
        Returns:
        the info.
      • getPackageDependency

        @Nullable
        public org.apache.jackrabbit.vault.packaging.Dependency getPackageDependency()
        Returns the package dependency or null if not resolved.
        Returns:
        the package dependency.
      • getLocation

        @Nullable
        public @Nullable URI getLocation()
      • mavenCoordinatesToUri

        public static URI mavenCoordinatesToUri​(@NotNull
                                                @NotNull String groupId,
                                                @NotNull
                                                @NotNull String artifactId,
                                                @NotNull
                                                @NotNull String version,
                                                String classifier)