org.wildfly.swarm.spi.api

## Interface ArtifactLookup

-     public interface ArtifactLookup

  Manager capable of locating artifacts from the application build.
  Author:
    Bob McWhirter, Ken Finnigan

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static AtomicReference<ArtifactLookup>` | `INSTANCE`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<JavaArchive>` | `allArtifacts()` Retrieve all dependency artifacts for the user's project.
    `List<JavaArchive>` | `allArtifacts(String... groupIdExclusions)`
    `JavaArchive` | `artifact(String gav)` Retrieve an artifact that was part of the original build using a full or simplified Maven GAV specifier.
    `JavaArchive` | `artifact(String gav, String asName)` Retrieve an artifact that was part of the original build using a full or simplified Maven GAV specifier, returning an archive with a specified name.
    `static ArtifactLookup` | `get()`

- - ### Field Detail

    - #### INSTANCE

          static final AtomicReference<ArtifactLookup> INSTANCE

  - ### Method Detail

    - #### get

          static ArtifactLookup get()

    - #### artifact

          JavaArchive artifact(String gav)
                        throws Exception

      Retrieve an artifact that was part of the original build using a full or simplified Maven GAV specifier.

      The following formats of GAVs are supported:

      - groupId:artifactId
      - groupId:artifactId:version
      - groupId:artifactId:packaging:version
      - groupId:artifactId:packaging:version:classifier

      Only artifacts that were compiled with the user's project with a scope of `compile` are available through lookup.

      In the variants that include a `version` parameter, it may be replaced by a literal asterisk in order to avoid hard-coding versions into the application.

      Parameters:
        `gav` - The Maven GAV.
      Returns:
        The located artifact, as a `JavaArchive`.
      Throws:
        `Exception` - if an error occurs locating or loading the artifact.

    - #### artifact

          JavaArchive artifact(String gav,
                               String asName)
                        throws Exception

      Retrieve an artifact that was part of the original build using a full or simplified Maven GAV specifier, returning an archive with a specified name.
      Parameters:
        `gav` - The Maven GAV.
      Returns:
        The located artifact, as a `JavaArchive` with the specified name.
      Throws:
        `Exception` - if an error occurs locating or loading the artifact.
      See Also:
        `artifact(String)`

    - #### allArtifacts

          List<JavaArchive> allArtifacts()
                                  throws Exception

      Retrieve all dependency artifacts for the user's project.
      Returns:
        All dependencies, as `JavaArchive` objects.
      Throws:
        `Exception` - if an error occurs locating or loading any artifact.

    - #### allArtifacts

          List<JavaArchive> allArtifacts(String... groupIdExclusions)
                                  throws Exception

      Throws:
        `Exception`

Copyright © 2018 JBoss by Red Hat. All rights reserved.