updates to versions, and make sure it is valid not to have a <localRepository/> element

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@164550 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-04-25 09:38:53 +00:00
parent 44e1bed14f
commit bfd3f284e2
7 changed files with 35 additions and 16 deletions

View File

@ -28,16 +28,22 @@
<version>3.8.1</version> <version>3.8.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http-lightweight</artifactId>
<version>1.0-alpha-3-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency> <dependency>
<groupId>org.apache.maven.wagon</groupId> <groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId> <artifactId>wagon-file</artifactId>
<version>1.0-alpha-2</version> <version>1.0-alpha-3-SNAPSHOT</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven.wagon</groupId> <groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId> <artifactId>wagon-ssh</artifactId>
<version>1.0-alpha-2</version> <version>1.0-alpha-3-SNAPSHOT</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -30,18 +30,18 @@
<localRepository refid="local.repository"/> <localRepository refid="local.repository"/>
</artifact:dependencies> </artifact:dependencies>
<artifact:install file="target/maven-artifact-ant-1.0-alpha-2-SNAPSHOT.jar"> <artifact:install file="target/maven-artifact-ant-2.0-SNAPSHOT.jar">
<localRepository refid="local.repository"/> <localRepository refid="local.repository"/>
<pom refid="maven.project"/> <pom refid="maven.project"/>
</artifact:install> </artifact:install>
<artifact:deploy file="target/maven-artifact-ant-1.0-alpha-2-SNAPSHOT.jar"> <artifact:deploy file="target/maven-artifact-ant-2.0-SNAPSHOT.jar">
<localRepository refid="local.repository"/> <localRepository refid="local.repository"/>
<remoteRepository refid="deploy.repository"/> <remoteRepository refid="deploy.repository"/>
<pom refid="maven.project"/> <pom refid="maven.project"/>
</artifact:deploy> </artifact:deploy>
<artifact:deploy file="target/maven-artifact-ant-1.0-alpha-2-SNAPSHOT.jar"> <artifact:deploy file="target/maven-artifact-ant-2.0-SNAPSHOT.jar">
<localRepository refid="local.repository"/> <localRepository refid="local.repository"/>
<remoteRepository url="scp://localhost/tmp/deployment-repo"> <remoteRepository url="scp://localhost/tmp/deployment-repo">
<authentication username="brett" privateKey="${user.home}/.ssh/id_dsa"/> <authentication username="brett" privateKey="${user.home}/.ssh/id_dsa"/>

View File

@ -25,6 +25,8 @@ import org.codehaus.plexus.PlexusContainerException;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
import org.codehaus.plexus.embed.Embedder; import org.codehaus.plexus.embed.Embedder;
import java.io.File;
/** /**
* Base class for artifact tasks. * Base class for artifact tasks.
* *
@ -105,4 +107,11 @@ public abstract class AbstractArtifactTask
} }
return embedder; return embedder;
} }
protected LocalRepository getDefaultLocalRepository()
{
LocalRepository localRepository = new LocalRepository();
localRepository.setLocation( new File( System.getProperty( "user.home" ), ".m2/repository" ) );
return localRepository;
}
} }

View File

@ -55,6 +55,11 @@ public class DependenciesTask
public void execute() public void execute()
{ {
if ( localRepository == null )
{
localRepository = getDefaultLocalRepository();
}
ArtifactRepository localRepo = createArtifactRepository( localRepository ); ArtifactRepository localRepo = createArtifactRepository( localRepository );
ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE ); ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );

View File

@ -47,6 +47,11 @@ public class DeployTask
public void execute() public void execute()
{ {
if ( localRepository == null )
{
localRepository = getDefaultLocalRepository();
}
ArtifactRepository localRepo = createArtifactRepository( localRepository ); ArtifactRepository localRepo = createArtifactRepository( localRepository );
pom.initialise( (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE ), localRepo ); pom.initialise( (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE ), localRepo );

View File

@ -46,6 +46,11 @@ public class InstallTask
public void execute() public void execute()
{ {
if ( localRepository == null )
{
localRepository = getDefaultLocalRepository();
}
ArtifactRepository localRepo = createArtifactRepository( localRepository ); ArtifactRepository localRepo = createArtifactRepository( localRepository );
pom.initialise( (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE ), localRepo ); pom.initialise( (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE ), localRepo );

View File

@ -222,9 +222,6 @@
<requirement> <requirement>
<role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role> <role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
</requirement> </requirement>
<requirement>
<role>org.apache.maven.settings.MavenSettingsBuilder</role>
</requirement>
</requirements> </requirements>
</component> </component>
<!-- <!--
@ -265,14 +262,6 @@
<implementation>org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory</implementation> <implementation>org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory</implementation>
</component> </component>
<component>
<role>org.apache.maven.settings.MavenSettingsBuilder</role>
<implementation>org.apache.maven.settings.DefaultMavenSettingsBuilder</implementation>
<configuration>
<settingsPath>${user.home}/.m2/settings.xml</settingsPath>
</configuration>
</component>
<component> <component>
<role>org.apache.maven.wagon.Wagon</role> <role>org.apache.maven.wagon.Wagon</role>
<role-hint>http</role-hint> <role-hint>http</role-hint>