use of org.apache.maven.artifact.DefaultArtifact in project maven-dependency-plugin by apache.
the class DependencyProjectStub method getArtifact.
public Artifact getArtifact() {
if (artifact == null) {
ArtifactHandler ah = new DefaultArtifactHandlerStub("jar", null);
VersionRange vr = VersionRange.createFromVersion("1.0");
Artifact art = new DefaultArtifact("group", "artifact", vr, Artifact.SCOPE_COMPILE, "jar", null, ah, false);
setArtifact(art);
}
return artifact;
}
use of org.apache.maven.artifact.DefaultArtifact in project maven-dependency-plugin by apache.
the class TestDefaultMarkerFileHandler method setUp.
protected void setUp() throws Exception {
super.setUp();
ArtifactHandler ah = new DefaultArtifactHandler();
VersionRange vr = VersionRange.createFromVersion("1.1");
Artifact artifact = new DefaultArtifact("test", "1", vr, Artifact.SCOPE_COMPILE, "jar", "", ah, false);
artifacts.add(artifact);
artifact = new DefaultArtifact("test", "2", vr, Artifact.SCOPE_PROVIDED, "war", "", ah, false);
artifacts.add(artifact);
artifact = new DefaultArtifact("test", "3", vr, Artifact.SCOPE_TEST, "sources", "", ah, false);
artifacts.add(artifact);
artifact = new DefaultArtifact("test", "4", vr, Artifact.SCOPE_RUNTIME, "zip", "", ah, false);
artifacts.add(artifact);
outputFolder = new File("target/markers/");
DependencyTestUtils.removeDirectory(this.outputFolder);
assertFalse(outputFolder.exists());
}
use of org.apache.maven.artifact.DefaultArtifact in project maven-dependency-plugin by apache.
the class TestDependencyUtil method testTestJar.
public void testTestJar() {
ArtifactHandler ah = new DefaultArtifactHandlerStub("test-jar", null);
VersionRange vr = VersionRange.createFromVersion("1.1-SNAPSHOT");
Artifact artifact = new DefaultArtifact("test", "two", vr, Artifact.SCOPE_PROVIDED, "test-jar", null, ah, false);
String name = DependencyUtil.getFormattedFileName(artifact, false);
String expectedResult = "two-1.1-SNAPSHOT.jar";
assertEquals(expectedResult, name);
}
use of org.apache.maven.artifact.DefaultArtifact in project maven-dependency-plugin by apache.
the class TestDependencyUtil method setUp.
protected void setUp() throws Exception {
super.setUp();
ArtifactHandler ah = new DefaultArtifactHandlerStub("jar", null);
VersionRange vr = VersionRange.createFromVersion("1.1");
release = new DefaultArtifact("test", "one", vr, Artifact.SCOPE_COMPILE, "jar", "sources", ah, false);
artifacts.add(release);
ah = new DefaultArtifactHandlerStub("war", null);
vr = VersionRange.createFromVersion("1.1-SNAPSHOT");
snap = new DefaultArtifact("test", "two", vr, Artifact.SCOPE_PROVIDED, "war", null, ah, false);
artifacts.add(snap);
ah = new DefaultArtifactHandlerStub("war", null);
vr = VersionRange.createFromVersion("1.1-SNAPSHOT");
snapResolvedVersion = new DefaultArtifact("test", "three", vr, Artifact.SCOPE_PROVIDED, "war", null, ah, false);
snapResolvedVersion.setResolvedVersion("1.1-20121003.035531-117");
artifacts.add(snapResolvedVersion);
ah = new DefaultArtifactHandlerStub("war", null);
vr = VersionRange.createFromVersion("1.1-SNAPSHOT");
sources = new DefaultArtifact("test", "two", vr, Artifact.SCOPE_PROVIDED, "sources", "sources", ah, false);
// pick random output location
Random a = new Random();
outputFolder = new File("target/copy" + a.nextLong() + "/");
outputFolder.delete();
assertFalse(outputFolder.exists());
}
use of org.apache.maven.artifact.DefaultArtifact in project fabric8-maven-plugin by fabric8io.
the class DependencyEnricherTest method getDummyArtifacts.
private Set<Artifact> getDummyArtifacts() {
Set<Artifact> artifacts = new TreeSet<>();
Artifact artifact = new DefaultArtifact("io.fabric8.tenant.apps", "jenkins", "1.0.0-SNAPSHOT", "compile", "jar", null, new DefaultArtifactHandler("jar"));
File aFile = new File(getClass().getResource(artifactFilePath).getFile());
artifact.setFile(aFile);
artifacts.add(artifact);
return artifacts;
}
Aggregations