Class DefaultSiteTool

  • All Implemented Interfaces:
    SiteTool, org.codehaus.plexus.logging.LogEnabled

    @Component(role=SiteTool.class)
    public class DefaultSiteTool
    extends org.codehaus.plexus.logging.AbstractLogEnabled
    implements SiteTool
    Default implementation of the site tool.
    Version:
    $Id: DefaultSiteTool.java 1606208 2014-06-27 20:28:05Z hboutemy $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
      The component used for creating artifact instances.
      private org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
      The component that is used to resolve additional artifacts required.
      protected org.apache.maven.doxia.site.decoration.inheritance.DecorationModelInheritanceAssembler assembler
      The component for assembling inheritance.
      protected org.codehaus.plexus.i18n.I18N i18n
      Internationalization.
      protected org.apache.maven.project.MavenProjectBuilder mavenProjectBuilder
      Project builder.
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultSiteTool()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      private void appendMenuItem​(org.apache.maven.project.MavenProject project, org.apache.maven.doxia.site.decoration.Menu menu, java.lang.String name, java.lang.String href, java.lang.String defaultHref)  
      private static java.lang.String buildRelativePath​(java.lang.String toPath, java.lang.String fromPath, char separatorChar)  
      private void checkNotNull​(java.lang.String name, java.lang.Object value)  
      java.util.Locale codeToLocale​(java.lang.String localeCode)
      Converts a locale code like "en", "en_US" or "en_US_win" to a java.util.Locale object.
      private org.apache.maven.doxia.site.decoration.MenuItem createCategoryMenu​(java.lang.String name, java.lang.String href, java.util.List<org.apache.maven.reporting.MavenReport> categoryReports, java.util.Locale locale)  
      java.util.List<java.util.Locale> getAvailableLocales​(java.lang.String locales)
      Init the localesList variable.
      org.apache.maven.doxia.site.decoration.DecorationModel getDecorationModel​(org.apache.maven.project.MavenProject project, java.util.List<org.apache.maven.project.MavenProject> reactorProjects, org.apache.maven.artifact.repository.ArtifactRepository localRepository, java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> repositories, java.lang.String siteDirectory, java.util.Locale locale)
      Get a decoration model for a project.
      private org.apache.maven.doxia.site.decoration.DecorationModel getDecorationModel​(org.apache.maven.project.MavenProject project, org.apache.maven.project.MavenProject parentProject, java.util.List<org.apache.maven.project.MavenProject> reactorProjects, org.apache.maven.artifact.repository.ArtifactRepository localRepository, java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> repositories, java.lang.String siteDirectory, java.util.Locale locale, java.util.Map<java.lang.String,​java.lang.String> origProps)  
      org.apache.maven.artifact.Artifact getDefaultSkinArtifact​(org.apache.maven.artifact.repository.ArtifactRepository localRepository, java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteArtifactRepositories)
      Get the default skin artifact for a project from one of the repositories.
      private static java.lang.String getDistMgmntSiteUrl​(org.apache.maven.model.DistributionManagement distMgmnt)  
      private static java.lang.String getDistMgmntSiteUrl​(org.apache.maven.model.Model model)
      Return distributionManagement.site.url if defined, null otherwise.
      private static java.lang.String getDistMgmntSiteUrl​(org.apache.maven.project.MavenProject project)
      Return distributionManagement.site.url if defined, null otherwise.
      java.lang.String getInterpolatedSiteDescriptorContent​(java.util.Map<java.lang.String,​java.lang.String> props, org.apache.maven.project.MavenProject aProject, java.lang.String siteDescriptorContent)
      Interpolating several expressions in the site descriptor content.
      protected static java.lang.String getNormalizedPath​(java.lang.String path)  
      org.apache.maven.project.MavenProject getParentProject​(org.apache.maven.project.MavenProject aProject, java.util.List<org.apache.maven.project.MavenProject> reactorProjects, org.apache.maven.artifact.repository.ArtifactRepository localRepository)
      Returns the parent POM with interpolated URLs.
      private static java.lang.String getRelativeFilePath​(java.lang.String oldPath, java.lang.String newPath)  
      java.lang.String getRelativePath​(java.lang.String to, java.lang.String from)
      Calculate the relative path between two URLs or between two files.
      java.io.File getSiteDescriptorFromBasedir​(java.lang.String siteDirectory, java.io.File basedir, java.util.Locale locale)
      Get a site descriptor from the project's base directory.
      java.io.File getSiteDescriptorFromRepository​(org.apache.maven.project.MavenProject project, org.apache.maven.artifact.repository.ArtifactRepository localRepository, java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> repositories, java.util.Locale locale)
      Get a site descriptor from one of the repositories.
      org.apache.maven.artifact.Artifact getSkinArtifactFromRepository​(org.apache.maven.artifact.repository.ArtifactRepository localRepository, java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteArtifactRepositories, org.apache.maven.doxia.site.decoration.DecorationModel decoration)
      Get a skin artifact from one of the repositories.
      private static boolean isEmptyList​(java.util.List<?> list)
      Convenience method.
      private static java.lang.String name​(org.apache.maven.model.Model model)  
      void populateModules​(org.apache.maven.project.MavenProject project, java.util.List<org.apache.maven.project.MavenProject> reactorProjects, org.apache.maven.artifact.repository.ArtifactRepository localRepository, org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, java.util.Locale locale, boolean keepInheritedRefs)
      void populateModulesMenu​(org.apache.maven.project.MavenProject project, java.util.List<org.apache.maven.project.MavenProject> reactorProjects, org.apache.maven.artifact.repository.ArtifactRepository localRepository, org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, java.util.Locale locale, boolean keepInheritedRefs)
      Populate the modules menu part of the decoration model.
      private void populateModulesMenuItemsFromModels​(org.apache.maven.project.MavenProject project, java.util.List<org.apache.maven.model.Model> models, org.apache.maven.doxia.site.decoration.Menu menu)  
      void populateParentMenu​(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, java.util.Locale locale, org.apache.maven.project.MavenProject project, org.apache.maven.project.MavenProject parentProject, boolean keepInheritedRefs)
      Populate the parent menu part of the decoration model.
      void populateProjectParentMenu​(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, java.util.Locale locale, org.apache.maven.project.MavenProject project, org.apache.maven.project.MavenProject parentProject, boolean keepInheritedRefs)
      void populateReportsMenu​(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel, java.util.Locale locale, java.util.Map<java.lang.String,​java.util.List<org.apache.maven.reporting.MavenReport>> categories)
      Populate the reports menu part of the decoration model.
      private org.apache.maven.doxia.site.decoration.DecorationModel readDecorationModel​(java.lang.String siteDescriptorContent)  
      private java.io.File resolveSiteDescriptor​(org.apache.maven.project.MavenProject project, org.apache.maven.artifact.repository.ArtifactRepository localRepository, java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> repositories, java.util.Locale locale)  
      private static void setDistMgmntSiteUrl​(org.apache.maven.model.Model model, java.lang.String url)  
      private static java.lang.String urlEncode​(java.lang.String url)  
      • Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled

        enableLogging, getLogger, setupLogger, setupLogger, setupLogger
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • artifactResolver

        @Requirement
        private org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
        The component that is used to resolve additional artifacts required.
      • artifactFactory

        @Requirement
        private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
        The component used for creating artifact instances.
      • i18n

        @Requirement
        protected org.codehaus.plexus.i18n.I18N i18n
        Internationalization.
      • assembler

        @Requirement
        protected org.apache.maven.doxia.site.decoration.inheritance.DecorationModelInheritanceAssembler assembler
        The component for assembling inheritance.
      • mavenProjectBuilder

        @Requirement
        protected org.apache.maven.project.MavenProjectBuilder mavenProjectBuilder
        Project builder.
    • Constructor Detail

      • DefaultSiteTool

        public DefaultSiteTool()
    • Method Detail

      • getSkinArtifactFromRepository

        public org.apache.maven.artifact.Artifact getSkinArtifactFromRepository​(org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                                                                                java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteArtifactRepositories,
                                                                                org.apache.maven.doxia.site.decoration.DecorationModel decoration)
                                                                         throws SiteToolException
        Get a skin artifact from one of the repositories.
        Specified by:
        getSkinArtifactFromRepository in interface SiteTool
        Parameters:
        localRepository - the Maven local repository, not null.
        remoteArtifactRepositories - the Maven remote repositories, not null.
        decoration - the Doxia site descriptor model, not null.
        Returns:
        the Skin artifact defined in a DecorationModel from a given project and a local repository
        Throws:
        SiteToolException - if any
      • getDefaultSkinArtifact

        public org.apache.maven.artifact.Artifact getDefaultSkinArtifact​(org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                                                                         java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteArtifactRepositories)
                                                                  throws SiteToolException
        Get the default skin artifact for a project from one of the repositories.
        Specified by:
        getDefaultSkinArtifact in interface SiteTool
        Parameters:
        localRepository - the Maven local repository, not null.
        remoteArtifactRepositories - the Maven remote repositories, not null.
        Returns:
        the default Skin artifact from a given project and a local repository
        Throws:
        SiteToolException - if any
        See Also:
        Skin.getDefaultSkin(), SiteTool.getSkinArtifactFromRepository(ArtifactRepository, List, DecorationModel)
      • getRelativePath

        public java.lang.String getRelativePath​(java.lang.String to,
                                                java.lang.String from)
        Calculate the relative path between two URLs or between two files. For example:
        to = "http://maven.apache.org" and from = "http://maven.apache.org"
        return ""
        to = "http://maven.apache.org" and from = "http://maven.apache.org/plugins/maven-site-plugin/"
        return "../.."
        to = "http://maven.apache.org/plugins/maven-site-plugin/" and from = "http://maven.apache.org"
        return "plugins/maven-site-plugin"
        to = "/myproject/myproject-module1" and from = "/myproject/myproject"
        return "../myproject-module1"
        Note: The file separator depends on the system.
        Specified by:
        getRelativePath in interface SiteTool
        Parameters:
        to - the to url of file as string
        from - the from url of file as string
        Returns:
        a relative path from from to to.
      • getRelativeFilePath

        private static java.lang.String getRelativeFilePath​(java.lang.String oldPath,
                                                            java.lang.String newPath)
      • getSiteDescriptorFromBasedir

        public java.io.File getSiteDescriptorFromBasedir​(java.lang.String siteDirectory,
                                                         java.io.File basedir,
                                                         java.util.Locale locale)
        Get a site descriptor from the project's base directory.
        Specified by:
        getSiteDescriptorFromBasedir in interface SiteTool
        Parameters:
        siteDirectory - The path to the directory containing the site.xml file, relative to the project base directory. If null, using by default "src/site".
        basedir - not null.
        locale - the locale wanted for the site descriptor. If not null, searching for site_localeLanguage.xml, otherwise searching for site.xml.
        Returns:
        the site descriptor relative file, i.e. src/site/site.xml, depending on parameter values.
      • getSiteDescriptorFromRepository

        public java.io.File getSiteDescriptorFromRepository​(org.apache.maven.project.MavenProject project,
                                                            org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                                                            java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> repositories,
                                                            java.util.Locale locale)
                                                     throws SiteToolException
        Get a site descriptor from one of the repositories.
        Specified by:
        getSiteDescriptorFromRepository in interface SiteTool
        Parameters:
        project - the Maven project, not null.
        localRepository - the Maven local repository, not null.
        repositories - the Maven remote repositories, not null.
        locale - the locale wanted for the site descriptor. If not null, searching for site_localeLanguage.xml, otherwise searching for site.xml.
        Returns:
        the site descriptor into the local repository after download of it from repositories or null if not found in repositories.
        Throws:
        SiteToolException - if any
      • getDecorationModel

        public org.apache.maven.doxia.site.decoration.DecorationModel getDecorationModel​(org.apache.maven.project.MavenProject project,
                                                                                         java.util.List<org.apache.maven.project.MavenProject> reactorProjects,
                                                                                         org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                                                                                         java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> repositories,
                                                                                         java.lang.String siteDirectory,
                                                                                         java.util.Locale locale)
                                                                                  throws SiteToolException
        Get a decoration model for a project.
        Specified by:
        getDecorationModel in interface SiteTool
        Parameters:
        project - the Maven project, not null.
        reactorProjects - the Maven reactor projects, not null.
        localRepository - the Maven local repository, not null.
        repositories - the Maven remote repositories, not null.
        siteDirectory - The path to the directory containing the site.xml file, relative to the project base directory. If null, using by default "src/site".
        locale - the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.
        Returns:
        the DecorationModel object corresponding to the site.xml file with some interpolations.
        Throws:
        SiteToolException - if any
      • populateReportsMenu

        public void populateReportsMenu​(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel,
                                        java.util.Locale locale,
                                        java.util.Map<java.lang.String,​java.util.List<org.apache.maven.reporting.MavenReport>> categories)
        Populate the reports menu part of the decoration model.
        Specified by:
        populateReportsMenu in interface SiteTool
        Parameters:
        decorationModel - the Doxia DecorationModel, not null.
        locale - the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.
        categories - a map to put on the decoration model, not null.
      • getInterpolatedSiteDescriptorContent

        public java.lang.String getInterpolatedSiteDescriptorContent​(java.util.Map<java.lang.String,​java.lang.String> props,
                                                                     org.apache.maven.project.MavenProject aProject,
                                                                     java.lang.String siteDescriptorContent)
                                                              throws SiteToolException
        Interpolating several expressions in the site descriptor content. Actually, the expressions can be in the project, the environment variables and the specific properties like encoding.

        For instance:

        ${project.name}
        The value from the POM of:

        <project>
          <name>myProjectName</name>
        </project>

        ${my.value}
        The value from the POM of:

        <properties>
          <my.value>hello</my.value>
        </properties>

        ${JAVA_HOME}
        The value of JAVA_HOME in the environment variables
        Specified by:
        getInterpolatedSiteDescriptorContent in interface SiteTool
        Parameters:
        props - a map used for interpolation, not null.
        aProject - a Maven project, not null.
        siteDescriptorContent - the site descriptor file, not null.
        Returns:
        the site descriptor content based on the site.xml file with interpolated strings.
        Throws:
        SiteToolException - if errors happened during the interpolation.
      • getParentProject

        public org.apache.maven.project.MavenProject getParentProject​(org.apache.maven.project.MavenProject aProject,
                                                                      java.util.List<org.apache.maven.project.MavenProject> reactorProjects,
                                                                      org.apache.maven.artifact.repository.ArtifactRepository localRepository)
        Returns the parent POM with interpolated URLs. Attempts to source this value from the reactorProjects parameters if available (reactor env model attributes are interpolated), or if the reactor is unavailable (-N) resorts to the project.getParent().getUrl() value which will NOT have been interpolated.

        TODO: once bug is fixed in Maven proper, remove this.

        Specified by:
        getParentProject in interface SiteTool
        Parameters:
        aProject - a Maven project, not null.
        reactorProjects - the Maven reactor projects, not null.
        localRepository - the Maven local repository, not null.
        Returns:
        the parent project with interpolated URLs.
      • populateParentMenu

        public void populateParentMenu​(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel,
                                       java.util.Locale locale,
                                       org.apache.maven.project.MavenProject project,
                                       org.apache.maven.project.MavenProject parentProject,
                                       boolean keepInheritedRefs)
        Populate the parent menu part of the decoration model.
        Specified by:
        populateParentMenu in interface SiteTool
        Parameters:
        decorationModel - the Doxia DecorationModel, not null.
        locale - the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.
        project - a Maven project, not null.
        parentProject - a Maven parent project, not null.
        keepInheritedRefs - used for inherited references.
      • populateProjectParentMenu

        public void populateProjectParentMenu​(org.apache.maven.doxia.site.decoration.DecorationModel decorationModel,
                                              java.util.Locale locale,
                                              org.apache.maven.project.MavenProject project,
                                              org.apache.maven.project.MavenProject parentProject,
                                              boolean keepInheritedRefs)
        Populate the parent menu part of the decoration model.
        Specified by:
        populateProjectParentMenu in interface SiteTool
        Parameters:
        decorationModel - the Doxia DecorationModel, not null.
        locale - the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.
        project - a Maven project, not null.
        parentProject - a Maven parent project, not null.
        keepInheritedRefs - used for inherited references.
      • populateModules

        public void populateModules​(org.apache.maven.project.MavenProject project,
                                    java.util.List<org.apache.maven.project.MavenProject> reactorProjects,
                                    org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                                    org.apache.maven.doxia.site.decoration.DecorationModel decorationModel,
                                    java.util.Locale locale,
                                    boolean keepInheritedRefs)
                             throws SiteToolException
        Populate the modules menu part of the decoration model.
        Specified by:
        populateModules in interface SiteTool
        Parameters:
        project - a Maven project, not null.
        reactorProjects - the Maven reactor projects, not null.
        localRepository - the Maven local repository, not null.
        decorationModel - the Doxia site descriptor model, not null.
        locale - the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.
        keepInheritedRefs - used for inherited references.
        Throws:
        SiteToolException - if any
      • populateModulesMenu

        public void populateModulesMenu​(org.apache.maven.project.MavenProject project,
                                        java.util.List<org.apache.maven.project.MavenProject> reactorProjects,
                                        org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                                        org.apache.maven.doxia.site.decoration.DecorationModel decorationModel,
                                        java.util.Locale locale,
                                        boolean keepInheritedRefs)
                                 throws SiteToolException
        Populate the modules menu part of the decoration model.
        Specified by:
        populateModulesMenu in interface SiteTool
        Parameters:
        project - a Maven project, not null.
        reactorProjects - the Maven reactor projects, not null.
        localRepository - the Maven local repository, not null.
        decorationModel - the Doxia site descriptor model, not null.
        locale - the locale used for the i18n in DecorationModel. If null, using the default locale in the jvm.
        keepInheritedRefs - used for inherited references.
        Throws:
        SiteToolException - if any
      • getAvailableLocales

        public java.util.List<java.util.Locale> getAvailableLocales​(java.lang.String locales)
        Init the localesList variable.

        If the locales variable is available, the first valid token will be the defaultLocale for this instance of the Java Virtual Machine.

        Specified by:
        getAvailableLocales in interface SiteTool
        Parameters:
        locales - A comma separated list of locales supported by Maven. The first valid token will be the default Locale for this instance of the Java Virtual Machine.
        Returns:
        a list of Locale
      • codeToLocale

        public java.util.Locale codeToLocale​(java.lang.String localeCode)
        Converts a locale code like "en", "en_US" or "en_US_win" to a java.util.Locale object.

        If localeCode = default, return the current value of the default locale for this instance of the Java Virtual Machine.

        Specified by:
        codeToLocale in interface SiteTool
        Parameters:
        localeCode - the locale code string.
        Returns:
        a java.util.Locale object instanced or null if errors occurred
        See Also:
        java.util.Locale#getDefault()
      • getNormalizedPath

        protected static java.lang.String getNormalizedPath​(java.lang.String path)
        Parameters:
        path - could be null.
        Returns:
        the path normalized, i.e. by eliminating "/../" and "/./" in the path.
        See Also:
        FilenameUtils.normalize(String)
      • resolveSiteDescriptor

        private java.io.File resolveSiteDescriptor​(org.apache.maven.project.MavenProject project,
                                                   org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                                                   java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> repositories,
                                                   java.util.Locale locale)
                                            throws java.io.IOException,
                                                   org.apache.maven.artifact.resolver.ArtifactResolutionException,
                                                   org.apache.maven.artifact.resolver.ArtifactNotFoundException
        Parameters:
        project - not null
        localRepository - not null
        repositories - not null
        locale - not null
        Returns:
        the resolved site descriptor
        Throws:
        java.io.IOException - if any
        org.apache.maven.artifact.resolver.ArtifactResolutionException - if any
        org.apache.maven.artifact.resolver.ArtifactNotFoundException - if any
      • getDecorationModel

        private org.apache.maven.doxia.site.decoration.DecorationModel getDecorationModel​(org.apache.maven.project.MavenProject project,
                                                                                          org.apache.maven.project.MavenProject parentProject,
                                                                                          java.util.List<org.apache.maven.project.MavenProject> reactorProjects,
                                                                                          org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                                                                                          java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> repositories,
                                                                                          java.lang.String siteDirectory,
                                                                                          java.util.Locale locale,
                                                                                          java.util.Map<java.lang.String,​java.lang.String> origProps)
                                                                                   throws SiteToolException
        Parameters:
        project - not null
        reactorProjects - not null
        localRepository - not null
        repositories - not null
        siteDirectory - not null
        locale - not null
        origProps - not null
        Returns:
        the decoration model depending the locale
        Throws:
        SiteToolException - if any
      • readDecorationModel

        private org.apache.maven.doxia.site.decoration.DecorationModel readDecorationModel​(java.lang.String siteDescriptorContent)
                                                                                    throws SiteToolException
        Parameters:
        siteDescriptorContent - not null
        Returns:
        the decoration model object
        Throws:
        SiteToolException - if any
      • buildRelativePath

        private static java.lang.String buildRelativePath​(java.lang.String toPath,
                                                          java.lang.String fromPath,
                                                          char separatorChar)
      • populateModulesMenuItemsFromModels

        private void populateModulesMenuItemsFromModels​(org.apache.maven.project.MavenProject project,
                                                        java.util.List<org.apache.maven.model.Model> models,
                                                        org.apache.maven.doxia.site.decoration.Menu menu)
        Parameters:
        project - not null
        models - not null
        menu - not null
      • name

        private static java.lang.String name​(org.apache.maven.model.Model model)
      • appendMenuItem

        private void appendMenuItem​(org.apache.maven.project.MavenProject project,
                                    org.apache.maven.doxia.site.decoration.Menu menu,
                                    java.lang.String name,
                                    java.lang.String href,
                                    java.lang.String defaultHref)
        Parameters:
        project - not null
        menu - not null
        name - not null
        href - could be null
        defaultHref - not null
      • createCategoryMenu

        private org.apache.maven.doxia.site.decoration.MenuItem createCategoryMenu​(java.lang.String name,
                                                                                   java.lang.String href,
                                                                                   java.util.List<org.apache.maven.reporting.MavenReport> categoryReports,
                                                                                   java.util.Locale locale)
        Parameters:
        name - not null
        href - not null
        categoryReports - not null
        locale - not null
        Returns:
        the menu item object
      • isEmptyList

        private static boolean isEmptyList​(java.util.List<?> list)
        Convenience method.
        Parameters:
        list - could be null
        Returns:
        true if the list is null or empty
      • getDistMgmntSiteUrl

        private static java.lang.String getDistMgmntSiteUrl​(org.apache.maven.project.MavenProject project)
        Return distributionManagement.site.url if defined, null otherwise.
        Parameters:
        project - not null
        Returns:
        could be null
      • getDistMgmntSiteUrl

        private static java.lang.String getDistMgmntSiteUrl​(org.apache.maven.model.Model model)
        Return distributionManagement.site.url if defined, null otherwise.
        Parameters:
        model - not null
        Returns:
        could be null
      • getDistMgmntSiteUrl

        private static java.lang.String getDistMgmntSiteUrl​(org.apache.maven.model.DistributionManagement distMgmnt)
      • urlEncode

        private static java.lang.String urlEncode​(java.lang.String url)
      • setDistMgmntSiteUrl

        private static void setDistMgmntSiteUrl​(org.apache.maven.model.Model model,
                                                java.lang.String url)
      • checkNotNull

        private void checkNotNull​(java.lang.String name,
                                  java.lang.Object value)