Example usage for org.apache.maven.artifact.handler DefaultArtifactHandler setAddedToClasspath

List of usage examples for org.apache.maven.artifact.handler DefaultArtifactHandler setAddedToClasspath

Introduction

In this page you can find the example usage for org.apache.maven.artifact.handler DefaultArtifactHandler setAddedToClasspath.

Prototype

public void setAddedToClasspath(boolean addedToClasspath) 

Source Link

Usage

From source file:com.github.born2snipe.maven.plugin.idea.BaseMojoTestCase.java

License:Apache License

protected void addProjectDependency(String definition) {
    String[] parts = definition.split(":");
    File file = new File(mavenRepoDir, parts[1] + "-" + parts[2] + ".jar");
    DefaultArtifactHandler artifactHandler = new DefaultArtifactHandler();
    artifactHandler.setAddedToClasspath(true);
    DefaultArtifact artifact = new DefaultArtifact(parts[0], parts[1], parts[2], "compile", "jar", "main",
            artifactHandler);//from   w ww  .  j  ava  2  s .c  om
    artifact.setFile(file);
    writeFile(file, definition);
    mavenProject.getArtifacts().add(artifact);
}

From source file:com.rebaze.maven.support.AetherUtils.java

License:Open Source License

public static ArtifactHandler newHandler(Artifact artifact) {
    String type = artifact.getProperty(ArtifactProperties.TYPE, artifact.getExtension());
    DefaultArtifactHandler handler = new DefaultArtifactHandler(type);
    handler.setExtension(artifact.getExtension());
    handler.setLanguage(artifact.getProperty(ArtifactProperties.LANGUAGE, null));
    handler.setAddedToClasspath(
            Boolean.parseBoolean(artifact.getProperty(ArtifactProperties.CONSTITUTES_BUILD_PATH, "")));
    handler.setIncludesDependencies(/*from   w  ww .  j  ava  2 s. c  o  m*/
            Boolean.parseBoolean(artifact.getProperty(ArtifactProperties.INCLUDES_DEPENDENCIES, "")));
    return handler;
}

From source file:org.appformer.maven.integration.embedder.WiredComponentProvider.java

License:Apache License

private ArtifactHandler buildArtifactHandler(String type) {
    DefaultArtifactHandler artifactHandler = new DefaultArtifactHandler(type);
    artifactHandler.setLanguage("java");
    artifactHandler.setAddedToClasspath(true);
    return artifactHandler;
}