Class ResolveDependenciesMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    CollectDependenciesMojo, ListMojo, ResolveDependencySourcesMojo

    @Mojo(name="resolve",
          requiresDependencyResolution=TEST,
          defaultPhase=GENERATE_SOURCES,
          threadSafe=true)
    public class ResolveDependenciesMojo
    extends AbstractResolveMojo
    Goal that resolves the project dependencies from the repository. When using this goal while running on Java 9 the module names will be visible as well.
    Since:
    2.0
    • Field Detail

      • outputScope

        @Parameter(property="mdep.outputScope",
                   defaultValue="true")
        protected boolean outputScope
        If we should display the scope when resolving
        Since:
        2.0-alpha-2
      • sort

        @Parameter(property="sort",
                   defaultValue="false")
        boolean sort
        Sort the output list of resolved artifacts alphabetically. The default ordering matches the classpath order.
        Since:
        2.8
      • includeParents

        @Parameter(property="includeParents",
                   defaultValue="false")
        boolean includeParents
        Include parent poms in the dependency resolution list.
        Since:
        2.8
    • Constructor Detail

      • ResolveDependenciesMojo

        public ResolveDependenciesMojo()
    • Method Detail

      • doExecute

        protected void doExecute()
                          throws org.apache.maven.plugin.MojoExecutionException
        Main entry into mojo. Gets the list of dependencies and iterates through displaying the resolved version.
        Specified by:
        doExecute in class AbstractDependencyMojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException - with a message if an error occurs.
      • getMarkedArtifactFilter

        protected org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter getMarkedArtifactFilter()
        Description copied from class: AbstractDependencyFilterMojo
        Return an ArtifactsFilter indicating which artifacts must be filtered out.
        Specified by:
        getMarkedArtifactFilter in class AbstractDependencyFilterMojo
        Returns:
        an ArtifactsFilter indicating which artifacts must be filtered out.
      • getOutput

        public java.lang.String getOutput​(boolean outputAbsoluteArtifactFilename,
                                          boolean theOutputScope,
                                          boolean theSort)
        Parameters:
        outputAbsoluteArtifactFilename - absolute artfiact filename.
        theOutputScope - The output scope.
        theSort - sort yes/no.
        Returns:
        The output.
      • buildArtifactListOutput

        private java.lang.StringBuilder buildArtifactListOutput​(java.util.Set<org.apache.maven.artifact.Artifact> artifacts,
                                                                boolean outputAbsoluteArtifactFilename,
                                                                boolean theOutputScope,
                                                                boolean theSort)