org.jenkinsci.maven.plugins.hpi

## Class MavenArtifact

- java.lang.Object
- - org.jenkinsci.maven.plugins.hpi.MavenArtifact

    public class MavenArtifact
    extends java.lang.Object

`Artifact` is a bare data structure without any behavior and therefore hard to write OO programs around it. This class wraps `Artifact` and adds behaviours.

Author:
  Kohsuke Kawaguchi

### Field Summary

Fields
`org.apache.maven.artifact.Artifact` `artifact`
`org.apache.maven.project.MavenProjectBuilder` `builder`
`org.apache.maven.artifact.repository.ArtifactRepository` `localRepository`
`java.util.List<org.apache.maven.artifact.repository.ArtifactRepository>` `remoteRepositories`

### Constructor Summary

Constructors
Constructor and Description
`MavenArtifact(org.apache.maven.artifact.Artifact artifact, org.apache.maven.project.MavenProjectBuilder builder, java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories, org.apache.maven.artifact.repository.ArtifactRepository localRepository)`

### Method Summary

Methods
`java.lang.String` `getArtifactId()`
`java.lang.String` `getDefaultFinalName()` Converts the filename of an artifact to artifactId-version.type format.
`java.util.List<java.lang.String>` `getDependencyTrail()`
`java.io.File` `getFile()`
`java.lang.String` `getGroupId()`
`java.lang.String` `getId()`
`java.lang.String` `getScope()`
`java.lang.String` `getType()`
`java.lang.String` `getVersion()`
`boolean` `hasSameGAAs(org.apache.maven.project.MavenProject project)` Returns true if this artifact has the same groupId and artifactId as the given project.
`boolean` `isOptional()`
`boolean` `isPlugin()` Is this a Jenkins plugin?
`org.apache.maven.project.MavenProject` `resolvePom()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### builder

    public final org.apache.maven.project.MavenProjectBuilder builder

#### remoteRepositories

    public final java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories

#### localRepository

    public final org.apache.maven.artifact.repository.ArtifactRepository localRepository

#### artifact

    public final org.apache.maven.artifact.Artifact artifact

### Constructor Detail

#### MavenArtifact

    public MavenArtifact(org.apache.maven.artifact.Artifact artifact,
                 org.apache.maven.project.MavenProjectBuilder builder,
                 java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories,
                 org.apache.maven.artifact.repository.ArtifactRepository localRepository)

### Method Detail

#### resolvePom

    public org.apache.maven.project.MavenProject resolvePom()
                                                     throws org.apache.maven.project.ProjectBuildingException

Throws:
  `org.apache.maven.project.ProjectBuildingException`

#### isPlugin

    public boolean isPlugin()
                     throws java.io.IOException

Is this a Jenkins plugin?

Throws:
  `java.io.IOException`

#### getId

    public java.lang.String getId()

#### getDefaultFinalName

    public java.lang.String getDefaultFinalName()

Converts the filename of an artifact to artifactId-version.type format.

Returns:
  converted filename of the artifact

#### isOptional

    public boolean isOptional()

#### getType

    public java.lang.String getType()

#### getFile

    public java.io.File getFile()

#### getDependencyTrail

    public java.util.List<java.lang.String> getDependencyTrail()

#### getGroupId

    public java.lang.String getGroupId()

#### getScope

    public java.lang.String getScope()

#### getArtifactId

    public java.lang.String getArtifactId()

#### getVersion

    public java.lang.String getVersion()

#### hasSameGAAs

    public boolean hasSameGAAs(org.apache.maven.project.MavenProject project)

Returns true if this artifact has the same groupId and artifactId as the given project.