clean up some artifact related code

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163406 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-02-24 05:33:18 +00:00
parent 52de04e862
commit c31bc6b7ce
4 changed files with 2 additions and 64 deletions

View File

@ -19,16 +19,15 @@ package org.apache.maven.artifact.manager;
import org.apache.maven.artifact.AbstractArtifactComponent; import org.apache.maven.artifact.AbstractArtifactComponent;
import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DefaultArtifact;
import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.wagon.ConnectionException; import org.apache.maven.wagon.ConnectionException;
import org.apache.maven.wagon.ResourceDoesNotExistException; import org.apache.maven.wagon.ResourceDoesNotExistException;
import org.apache.maven.wagon.TransferFailedException; import org.apache.maven.wagon.TransferFailedException;
import org.apache.maven.wagon.UnsupportedProtocolException; import org.apache.maven.wagon.UnsupportedProtocolException;
import org.apache.maven.wagon.Wagon; import org.apache.maven.wagon.Wagon;
import org.apache.maven.wagon.events.TransferListener;
import org.apache.maven.wagon.authentication.AuthenticationException; import org.apache.maven.wagon.authentication.AuthenticationException;
import org.apache.maven.wagon.authorization.AuthorizationException; import org.apache.maven.wagon.authorization.AuthorizationException;
import org.apache.maven.wagon.events.TransferListener;
import org.apache.maven.wagon.proxy.ProxyInfo; import org.apache.maven.wagon.proxy.ProxyInfo;
import org.codehaus.plexus.PlexusConstants; import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.PlexusContainer;
@ -55,13 +54,6 @@ public class DefaultWagonManager
private TransferListener downloadMonitor; private TransferListener downloadMonitor;
public Artifact createArtifact( String groupId, String artifactId, String version, String type )
{
Artifact artifact = new DefaultArtifact( groupId, artifactId, version, type );
return artifact;
}
public Wagon getWagon( String protocol ) public Wagon getWagon( String protocol )
throws UnsupportedProtocolException throws UnsupportedProtocolException
{ {

View File

@ -51,6 +51,4 @@ public interface WagonManager
void setProxy( String protocol, String host, int port, String username, String password, String nonProxyHosts ); void setProxy( String protocol, String host, int port, String username, String password, String nonProxyHosts );
void setDownloadMonitor( TransferListener downloadMonitor ); void setDownloadMonitor( TransferListener downloadMonitor );
Artifact createArtifact( String groupId, String artifactId, String version, String type );
} }

View File

@ -1,53 +0,0 @@
package org.apache.maven.artifact;
/* ====================================================================
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*/
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.request.ArtifactRequestTransformation;
import java.util.Map;
import java.util.Set;
public class JarOverrideRequestTransformation
implements ArtifactRequestTransformation
{
public Artifact transform( Artifact artifact,
ArtifactRepository localRepository,
Set remoteRepositories,
Map parameters )
throws Exception
{
/* TODO: need an override in the POM
MavenProject project = (MavenProject) parameters.get( "project" );
boolean mavenJarOverride = project.getBooleanProperty( "maven.jar.override" );
String mavenJarProperty = project.getProperty( "maven.jar." + project.getArtifactId() );
if ( mavenJarOverride && StringUtils.isNotEmpty( mavenJarProperty ) )
{
Artifact transformedArtifact = new DefaultArtifact( artifact.getGroupId(),
artifact.getArtifactId(),
mavenJarProperty,
artifact.getType() );
return transformedArtifact;
}
*/
return artifact;
}
}

View File

@ -113,6 +113,7 @@ public class MavenMetadataSource
public Artifact createArtifact( Dependency dependency, ArtifactRepository localRepository ) public Artifact createArtifact( Dependency dependency, ArtifactRepository localRepository )
{ {
// TODO: duplicated with the ArtifactFactory, localRepository not used (should be used here to resolve path?
Artifact artifact = new DefaultArtifact( dependency.getGroupId(), Artifact artifact = new DefaultArtifact( dependency.getGroupId(),
dependency.getArtifactId(), dependency.getArtifactId(),
dependency.getVersion(), dependency.getVersion(),