</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact-manager</artifactId>
+ <artifactId>maven-compat</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact-manager</artifactId>
+ <artifactId>maven-compat</artifactId>
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
private Logger log = LoggerFactory.getLogger( getClass() );
- private boolean containerAutoWiring = false;
+ private boolean containerAutoWiring = true;
- private String containerClassPathScanning = PlexusConstants.SCANNING_OFF;
+ private String containerClassPathScanning = PlexusConstants.SCANNING_ON;
private String containerComponentVisibility = PlexusConstants.REALM_VISIBILITY;
conf.setRealm( classRealm );
- conf.setClassWorld( classWorld );
+ //conf.setClassWorld( classWorld );
try
{
<artifactId>maven-model-builder</artifactId>
<version>${maven3x.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-compat</artifactId>
+ <version>${maven3x.version}</version>
+ </dependency>
<dependency>
<groupId>org.sonatype.sisu</groupId>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model-builder</artifactId>
</dependency>
- <!-- TODO: remove when dependency-tree declares it explicitly, it is currently through the excluded maven-project -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-compat</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-model</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-dependency-tree</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
- <dependencyManagement>
- <dependencies>
- <!-- TODO: this is to override the top level dependency management - we need to rationalise these -->
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-model</artifactId>
- <version>3.0.3</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
<build>
<plugins>
<plugin>
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactCollector;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ResolutionListener;
import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
import org.apache.maven.model.DependencyManagement;
import org.apache.maven.model.Exclusion;
import org.apache.maven.model.Model;
+import org.apache.maven.model.building.DefaultModelBuilderFactory;
import org.apache.maven.model.building.DefaultModelBuildingRequest;
import org.apache.maven.model.building.ModelBuilder;
import org.apache.maven.model.building.ModelBuildingException;
import org.apache.maven.model.building.ModelBuildingRequest;
import org.apache.maven.model.resolution.UnresolvableModelException;
+import org.apache.maven.repository.legacy.metadata.MetadataResolutionRequest;
import org.apache.maven.shared.dependency.tree.DependencyNode;
import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException;
import org.apache.maven.shared.dependency.tree.DependencyTreeResolutionListener;
public void initialize()
throws PlexusSisuBridgeException
{
- factory = plexusSisuBridge.lookup( ArtifactFactory.class );
- collector = plexusSisuBridge.lookup( ArtifactCollector.class );
- builder = plexusSisuBridge.lookup( ModelBuilder.class );
+ //factory = plexusSisuBridge.lookup( ArtifactFactory.class , "default" );
+ //collector = plexusSisuBridge.lookup( ArtifactCollector.class , "default" );
+
+
+ DefaultModelBuilderFactory defaultModelBuilderFactory = new DefaultModelBuilderFactory();
+ builder = defaultModelBuilderFactory.newInstance();
}
public void buildDependencyTree( List<String> repositoryIds, String groupId, String artifactId, String version,
// Note that we don't permit going to external repositories. We don't need to pass in a local and remote
// since our metadata source has control over them
- collector.collect( dependencyArtifacts, projectArtifact, managedVersions, null, null, metadataSource,
- null, Collections.singletonList( listener ) );
+ //collector.collect( dependencyArtifacts, projectArtifact, managedVersions, null, null, metadataSource,
+ // null, Collections.singletonList( listener ) );
+
+ collector.collect( dependencyArtifacts, projectArtifact, null, Collections.<ArtifactRepository>emptyList(),
+ metadataSource, null, Collections.singletonList( (ResolutionListener) listener ) );
+
+ /*
+ Set<Artifact> artifacts, Artifact originatingArtifact,
+ ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories,
+ ArtifactMetadataSource source, ArtifactFilter filter,
+ List< ResolutionListener > listeners
+ */
}
finally
{
// if the project is null, we encountered an invalid model (read: m1 POM)
// we'll just return an empty resolution group.
// or used the inherited scope (should that be passed to the buildFromRepository method above?)
- result = new ResolutionGroup( pomArtifact, Collections.emptySet(), Collections.emptyList() );
+ result = new ResolutionGroup( pomArtifact, Collections.<Artifact>emptySet(), Collections.<ArtifactRepository>emptyList() );
}
else
{
- Set artifacts = Collections.emptySet();
+ Set<Artifact> artifacts = Collections.emptySet();
if ( !artifact.getArtifactHandler().isIncludesDependencies() )
{
try
}
}
- result = new ResolutionGroup( pomArtifact, artifacts, Collections.emptyList() );
+ result = new ResolutionGroup( pomArtifact, artifacts, Collections.<ArtifactRepository>emptyList() );
}
return result;
return new ArrayList<ArtifactVersion>( versions );
}
+
+ public ResolutionGroup retrieve( MetadataResolutionRequest metadataResolutionRequest )
+ throws ArtifactMetadataRetrievalException
+ {
+ //TODO
+ return null;
+ }
+
+ public List<ArtifactVersion> retrieveAvailableVersions( MetadataResolutionRequest metadataResolutionRequest )
+ throws ArtifactMetadataRetrievalException
+ {
+ //TODO
+ return null;
+ }
+
+ public List<ArtifactVersion> retrieveAvailableVersionsFromDeploymentRepository( Artifact artifact,
+ ArtifactRepository artifactRepository,
+ ArtifactRepository artifactRepository1 )
+ throws ArtifactMetadataRetrievalException
+ {
+ // TODO
+ return null;
+ }
}
public ArtifactFactory getFactory()
* under the License.
*/
-import java.util.List;
-
-import org.apache.maven.artifact.factory.DefaultArtifactFactory;
import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException;
import org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor;
+import java.util.List;
+
/**
* Builds a tree of dependencies for a given Maven project. Customized wrapper for maven-dependency-tree to use
* maven-model-builder instead of maven-project.
* @param nodeVisitor visitor to apply to all nodes discovered
* @throws DependencyTreeBuilderException if the dependency tree cannot be resolved
*/
- public void buildDependencyTree( List<String> repositoryIds, String groupId, String artifactId, String version,
- DependencyNodeVisitor nodeVisitor )
+ void buildDependencyTree( List<String> repositoryIds, String groupId, String artifactId, String version,
+ DependencyNodeVisitor nodeVisitor )
throws DependencyTreeBuilderException;
}
import org.apache.archiva.checksum.ChecksumAlgorithm;
import org.apache.archiva.checksum.ChecksummedFile;
-import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
-import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
import org.apache.archiva.metadata.model.ArtifactMetadata;
import org.apache.archiva.metadata.model.ProjectMetadata;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.maven.model.Model;
import org.apache.maven.model.Organization;
import org.apache.maven.model.Scm;
+import org.apache.maven.model.building.DefaultModelBuilderFactory;
import org.apache.maven.model.building.DefaultModelBuildingRequest;
import org.apache.maven.model.building.ModelBuilder;
import org.apache.maven.model.building.ModelBuildingException;
private static final String METADATA_FILENAME = "maven-metadata.xml";
- @Inject
- private PlexusSisuBridge plexusSisuBridge;
@PostConstruct
public void initialize()
- throws PlexusSisuBridgeException
{
- builder = plexusSisuBridge.lookup( ModelBuilder.class, "default" );
+ DefaultModelBuilderFactory defaultModelBuilderFactory = new DefaultModelBuilderFactory();
+ builder = defaultModelBuilderFactory.newInstance();
}
public ProjectMetadata readProjectMetadata( String repoId, String namespace, String projectId )
<properties>
<struts.version>2.1.8.1</struts.version>
- <maven.version>2.0.8</maven.version>
<maven3x.version>3.0.3</maven3x.version>
<wagon.version>1.0-beta-5</wagon.version>
<redback.version>1.3-SNAPSHOT</redback.version>
<artifactId>maven-model-builder</artifactId>
<version>${maven3x.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-compat</artifactId>
+ <version>${maven3x.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ <version>${maven3x.version}</version>
+ </dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-digest</artifactId>
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact-manager</artifactId>
- <version>${maven.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-container-default</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
- <version>${maven.version}</version>
+ <version>${maven3x.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata</artifactId>
- <version>${maven.version}</version>
+ <version>${maven3x.version}</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>