Class ListClassesMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.dependency.ListClassesMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="list-classes", requiresProject=false, threadSafe=true) public class ListClassesMojo extends org.apache.maven.plugin.AbstractMojo
Retrieves and lists all classes contained in the specified artifact from the specified remote repositories.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final Pattern
     
    private String
    A string of the form groupId:artifactId:version[:packaging[:classifier]].
    private org.apache.maven.artifact.handler.manager.ArtifactHandlerManager
     
    private String
    The artifact ID of the artifact to download.
    private org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver
     
    private String
    The classifier of the artifact to download.
    private org.apache.maven.shared.transfer.dependencies.DefaultDependableCoordinate
     
    private org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolver
     
    private String
    The group ID of the artifact to download.
    private String
    The packaging of the artifact to download.
    private List<org.apache.maven.artifact.repository.ArtifactRepository>
     
    private String
    Repositories in the format id::[layout]::url or just URLs, separated by comma.
    private Map<String,org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout>
    Map that contains the layouts.
    private org.apache.maven.repository.RepositorySystem
    The repository system.
    private org.apache.maven.execution.MavenSession
     
    private boolean
    Skip plugin execution completely.
    private boolean
    Download transitively, retrieving the specified artifact and all of its dependencies.
    private String
    The version of the artifact to download.

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    private org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout
     
    (package private) boolean
     
    private org.apache.maven.project.ProjectBuildingRequest
     
    protected org.apache.maven.artifact.repository.ArtifactRepository
    parseRepository(String repo, org.apache.maven.artifact.repository.ArtifactRepositoryPolicy policy)
     
    private void
    printClassesFromArtifactResult(org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult result)
     
    private org.apache.maven.shared.transfer.artifact.ArtifactCoordinate
    toArtifactCoordinate(org.apache.maven.shared.transfer.dependencies.DependableCoordinate dependableCoordinate)
     

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

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

    • ALT_REPO_SYNTAX_PATTERN

      private static final Pattern ALT_REPO_SYNTAX_PATTERN
    • session

      @Parameter(defaultValue="${session}", required=true, readonly=true) private org.apache.maven.execution.MavenSession session
    • artifactResolver

      @Component private org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver artifactResolver
    • dependencyResolver

      @Component private org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolver dependencyResolver
    • artifactHandlerManager

      @Component private org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager
    • repositoryLayouts

      @Component(role=org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout.class) private Map<String,org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout> repositoryLayouts
      Map that contains the layouts.
    • repositorySystem

      @Component private org.apache.maven.repository.RepositorySystem repositorySystem
      The repository system.
    • coordinate

      private org.apache.maven.shared.transfer.dependencies.DefaultDependableCoordinate coordinate
    • groupId

      @Parameter(property="groupId") private String groupId
      The group ID of the artifact to download. Ignored if artifact is used.
    • artifactId

      @Parameter(property="artifactId") private String artifactId
      The artifact ID of the artifact to download. Ignored if artifact is used.
    • version

      @Parameter(property="version") private String version
      The version of the artifact to download. Ignored if artifact is used.
    • classifier

      @Parameter(property="classifier") private String classifier
      The classifier of the artifact to download. Ignored if artifact is used.
      Since:
      2.3
    • packaging

      @Parameter(property="packaging", defaultValue="jar") private String packaging
      The packaging of the artifact to download. Ignored if artifact is used.
    • remoteRepositories

      @Parameter(property="remoteRepositories") private String remoteRepositories
      Repositories in the format id::[layout]::url or just URLs, separated by comma. That is, central::default::https://repo.maven.apache.org/maven2,myrepo::::https://repo.acme.com,https://repo.acme2.com
    • artifact

      @Parameter(property="artifact") private String artifact
      A string of the form groupId:artifactId:version[:packaging[:classifier]].
    • pomRemoteRepositories

      @Parameter(defaultValue="${project.remoteArtifactRepositories}", readonly=true, required=true) private List<org.apache.maven.artifact.repository.ArtifactRepository> pomRemoteRepositories
    • transitive

      @Parameter(property="transitive", defaultValue="false") private boolean transitive
      Download transitively, retrieving the specified artifact and all of its dependencies.
    • skip

      @Parameter(property="mdep.skip", defaultValue="false") private boolean skip
      Skip plugin execution completely.
  • Constructor Details

    • ListClassesMojo

      public ListClassesMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • printClassesFromArtifactResult

      private void printClassesFromArtifactResult(org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult result) throws IOException
      Throws:
      IOException
    • hasGAVSpecified

      boolean hasGAVSpecified()
    • makeBuildingRequest

      private org.apache.maven.project.ProjectBuildingRequest makeBuildingRequest() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • toArtifactCoordinate

      private org.apache.maven.shared.transfer.artifact.ArtifactCoordinate toArtifactCoordinate(org.apache.maven.shared.transfer.dependencies.DependableCoordinate dependableCoordinate)
    • parseRepository

      protected org.apache.maven.artifact.repository.ArtifactRepository parseRepository(String repo, org.apache.maven.artifact.repository.ArtifactRepositoryPolicy policy) throws org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoFailureException
    • getLayout

      private org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout getLayout(String id) throws org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoFailureException