From aa438b8137717e9c812dfd79743167d898cebed6 Mon Sep 17 00:00:00 2001 From: Trygve Laugstol Date: Mon, 22 Nov 2004 12:46:55 +0000 Subject: [PATCH] o Adding a artifact handler for sources. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163235 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/artifact/handler/SourceHandler.java | 28 +++++++++++++++++++ .../resources/META-INF/plexus/components.xml | 6 ++++ 2 files changed, 34 insertions(+) create mode 100644 maven-artifact/src/main/java/org/apache/maven/artifact/handler/SourceHandler.java diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/handler/SourceHandler.java b/maven-artifact/src/main/java/org/apache/maven/artifact/handler/SourceHandler.java new file mode 100644 index 0000000000..106d3aab4d --- /dev/null +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/handler/SourceHandler.java @@ -0,0 +1,28 @@ +package org.apache.maven.artifact.handler; + +import java.io.File; + +import org.apache.maven.artifact.Artifact; + +/** + * @author Trygve Laugstøl + * @version $Id$ + */ +public class SourceHandler + extends AbstractArtifactHandler +{ + public File source( String basedir, Artifact artifact ) + { + return new File( basedir, artifact.getArtifactId() + "-" + artifact.getVersion() + "-sources." + extension() ); + } + + public String extension() + { + return "jar"; + } + + public String directory() + { + return "sources"; + } +} diff --git a/maven-artifact/src/main/resources/META-INF/plexus/components.xml b/maven-artifact/src/main/resources/META-INF/plexus/components.xml index 1eea0df6bb..d2ebfcefb0 100644 --- a/maven-artifact/src/main/resources/META-INF/plexus/components.xml +++ b/maven-artifact/src/main/resources/META-INF/plexus/components.xml @@ -107,5 +107,11 @@ org.apache.maven.artifact.handler.PomHandler + + org.apache.maven.artifact.handler.ArtifactHandler + source + org.apache.maven.artifact.handler.SourceHandler + +