mirror of https://github.com/apache/maven.git
o omit the creation of deployment specific repositories, and uniqueVersion = false isn't going to matter in 3.x. everything will be unique to match an osgi versioning scheme. the dichotomy between unique sometimes, and no versions locally is a mess.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@747652 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2862516673
commit
54da5ce53e
|
@ -2395,7 +2395,7 @@
|
||||||
|
|
||||||
<class>
|
<class>
|
||||||
<name>DeploymentRepository</name>
|
<name>DeploymentRepository</name>
|
||||||
<superClass>RepositoryBase</superClass>
|
<superClass>Repository</superClass>
|
||||||
<version>4.0.0</version>
|
<version>4.0.0</version>
|
||||||
<description>Repository contains the information needed for deploying to the remote
|
<description>Repository contains the information needed for deploying to the remote
|
||||||
repository.</description>
|
repository.</description>
|
||||||
|
|
|
@ -207,12 +207,12 @@ public class MavenProject
|
||||||
*
|
*
|
||||||
* @param model - may not be null
|
* @param model - may not be null
|
||||||
* @param artifactFactory - may not be null
|
* @param artifactFactory - may not be null
|
||||||
* @param mavenTools - may not be null
|
* @param repositorySystem - may not be null
|
||||||
* @param mavenProjectBuilder
|
* @param mavenProjectBuilder
|
||||||
* @param projectBuilderConfiguration
|
* @param projectBuilderConfiguration
|
||||||
* @throws InvalidRepositoryException
|
* @throws InvalidRepositoryException
|
||||||
*/
|
*/
|
||||||
public MavenProject( Model model, MavenRepositorySystem mavenTools, MavenProjectBuilder mavenProjectBuilder, ProjectBuilderConfiguration projectBuilderConfiguration )
|
public MavenProject( Model model, MavenRepositorySystem repositorySystem, MavenProjectBuilder mavenProjectBuilder, ProjectBuilderConfiguration projectBuilderConfiguration )
|
||||||
throws InvalidRepositoryException
|
throws InvalidRepositoryException
|
||||||
{
|
{
|
||||||
if(model == null)
|
if(model == null)
|
||||||
|
@ -220,7 +220,7 @@ public class MavenProject
|
||||||
throw new IllegalArgumentException("model: null");
|
throw new IllegalArgumentException("model: null");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mavenTools == null)
|
if(repositorySystem == null)
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("mavenTools: null");
|
throw new IllegalArgumentException("mavenTools: null");
|
||||||
}
|
}
|
||||||
|
@ -228,18 +228,18 @@ public class MavenProject
|
||||||
setModel( model );
|
setModel( model );
|
||||||
this.mavenProjectBuilder = mavenProjectBuilder;
|
this.mavenProjectBuilder = mavenProjectBuilder;
|
||||||
this.projectBuilderConfiguration = projectBuilderConfiguration;
|
this.projectBuilderConfiguration = projectBuilderConfiguration;
|
||||||
this.repositorySystem = mavenTools;
|
this.repositorySystem = repositorySystem;
|
||||||
originalModel = model;
|
originalModel = model;
|
||||||
DistributionManagement dm = model.getDistributionManagement();
|
DistributionManagement dm = model.getDistributionManagement();
|
||||||
|
|
||||||
if ( dm != null )
|
if ( dm != null )
|
||||||
{
|
{
|
||||||
ArtifactRepository repo = mavenTools.buildDeploymentArtifactRepository( dm.getRepository() );
|
ArtifactRepository repo = repositorySystem.buildArtifactRepository( dm.getRepository() );
|
||||||
setReleaseArtifactRepository( repo );
|
setReleaseArtifactRepository( repo );
|
||||||
|
|
||||||
if ( dm.getSnapshotRepository() != null )
|
if ( dm.getSnapshotRepository() != null )
|
||||||
{
|
{
|
||||||
repo = mavenTools.buildDeploymentArtifactRepository( dm.getSnapshotRepository() );
|
repo = repositorySystem.buildArtifactRepository( dm.getSnapshotRepository() );
|
||||||
setSnapshotArtifactRepository( repo );
|
setSnapshotArtifactRepository( repo );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ public class MavenProject
|
||||||
repoSet.addAll( model.getPluginRepositories() );
|
repoSet.addAll( model.getPluginRepositories() );
|
||||||
}
|
}
|
||||||
|
|
||||||
setRemoteArtifactRepositories( mavenTools.buildArtifactRepositories( new ArrayList<Repository>( repoSet ) ) );
|
setRemoteArtifactRepositories( repositorySystem.buildArtifactRepositories( new ArrayList<Repository>( repoSet ) ) );
|
||||||
}
|
}
|
||||||
catch ( Exception e )
|
catch ( Exception e )
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,8 +53,6 @@ import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
|
||||||
import org.apache.maven.artifact.versioning.ArtifactVersion;
|
import org.apache.maven.artifact.versioning.ArtifactVersion;
|
||||||
import org.apache.maven.artifact.versioning.VersionRange;
|
import org.apache.maven.artifact.versioning.VersionRange;
|
||||||
import org.apache.maven.model.Dependency;
|
import org.apache.maven.model.Dependency;
|
||||||
import org.apache.maven.model.DeploymentRepository;
|
|
||||||
import org.apache.maven.model.Model;
|
|
||||||
import org.apache.maven.model.Repository;
|
import org.apache.maven.model.Repository;
|
||||||
import org.apache.maven.model.RepositoryPolicy;
|
import org.apache.maven.model.RepositoryPolicy;
|
||||||
import org.apache.maven.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
|
@ -203,22 +201,6 @@ public class LegacyMavenRepositorySystem
|
||||||
return repos;
|
return repos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactRepository buildDeploymentArtifactRepository( DeploymentRepository repo )
|
|
||||||
throws InvalidRepositoryException
|
|
||||||
{
|
|
||||||
if ( repo != null )
|
|
||||||
{
|
|
||||||
String id = repo.getId();
|
|
||||||
String url = repo.getUrl();
|
|
||||||
|
|
||||||
return artifactRepositoryFactory.createDeploymentArtifactRepository( id, url, repo.getLayout(), repo.isUniqueVersion() );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArtifactRepository buildArtifactRepository( Repository repo )
|
public ArtifactRepository buildArtifactRepository( Repository repo )
|
||||||
throws InvalidRepositoryException
|
throws InvalidRepositoryException
|
||||||
{
|
{
|
||||||
|
|
|
@ -79,10 +79,6 @@ public interface MavenRepositorySystem
|
||||||
List<ArtifactRepository> buildArtifactRepositories( List<Repository> repositories )
|
List<ArtifactRepository> buildArtifactRepositories( List<Repository> repositories )
|
||||||
throws InvalidRepositoryException;
|
throws InvalidRepositoryException;
|
||||||
|
|
||||||
// maven model
|
|
||||||
ArtifactRepository buildDeploymentArtifactRepository( DeploymentRepository repository )
|
|
||||||
throws InvalidRepositoryException;
|
|
||||||
|
|
||||||
// maven model
|
// maven model
|
||||||
ArtifactRepository buildArtifactRepository( Repository repository )
|
ArtifactRepository buildArtifactRepository( Repository repository )
|
||||||
throws InvalidRepositoryException;
|
throws InvalidRepositoryException;
|
||||||
|
|
Loading…
Reference in New Issue