Example usage for org.apache.maven.project.artifact AttachedArtifact AttachedArtifact

List of usage examples for org.apache.maven.project.artifact AttachedArtifact AttachedArtifact

Introduction

In this page you can find the example usage for org.apache.maven.project.artifact AttachedArtifact AttachedArtifact.

Prototype

public AttachedArtifact(Artifact parent, String type, ArtifactHandler artifactHandler) 

Source Link

Usage

From source file:org.deegree.maven.WorkspaceMojo.java

License:Open Source License

private void attachArtifact(Log log, File workspaceFile) {
    log.info("Attaching " + workspaceFile);
    Artifact artifact = project.getArtifact();
    if (artifact.getType() == null || !artifact.getType().equals("deegree-workspace")) {
        DefaultArtifactHandler defHandler = new DefaultArtifactHandler("deegree-workspace");
        artifact = new AttachedArtifact(project.getArtifact(), "deegree-workspace", defHandler);
    }/*from w  w w .j a  v  a 2s  .  c o  m*/

    artifact.setFile(workspaceFile);
    artifact.setResolved(true);
    if (project.getArtifact().getType() == null
            || !project.getArtifact().getType().equals("deegree-workspace")) {
        project.addAttachedArtifact(artifact);
    }
}