diff options
author | Brett Porter <brett@apache.org> | 2006-08-26 05:05:43 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2006-08-26 05:05:43 +0000 |
commit | 72cbf8748f2f0cb7dad3b45cd5668461aa4a76b2 (patch) | |
tree | f185ad84f34e8145f398e991674b0b573981c611 | |
parent | 965e185c5d451ae6384852835cd3f67038980e2b (diff) | |
download | archiva-72cbf8748f2f0cb7dad3b45cd5668461aa4a76b2.tar.gz archiva-72cbf8748f2f0cb7dad3b45cd5668461aa4a76b2.zip |
remove - out of date. We will probably add a CLI later.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@437084 13f79535-47bb-0310-9956-ffa450edef68
3 files changed, 0 insertions, 233 deletions
diff --git a/maven-repository-application/pom.xml b/maven-repository-application/pom.xml deleted file mode 100644 index ffe8183f4..000000000 --- a/maven-repository-application/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ -<!-- - ~ Copyright 2005-2006 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. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <parent> - <groupId>org.apache.maven.repository</groupId> - <artifactId>maven-repository-manager</artifactId> - <version>1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - <artifactId>maven-repository-application</artifactId> - <name>Maven Repository Application</name> - <dependencies> - <dependency> - <groupId>org.apache.maven.repository</groupId> - <artifactId>maven-repository-indexer</artifactId> - </dependency> - <dependency> - <groupId>org.apache.maven.repository</groupId> - <artifactId>maven-repository-discovery</artifactId> - </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-container-default</artifactId> - </dependency> - </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>cobertura-maven-plugin</artifactId> - <configuration> - <instrumentation> - <!-- TODO: should this module have tests? --> - <excludes> - <exclude>**/**</exclude> - </excludes> - </instrumentation> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/IndexCli.java b/maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/IndexCli.java deleted file mode 100644 index fd3bead98..000000000 --- a/maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/IndexCli.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.apache.maven.repository.manager.cli; - -/* - * Copyright 2005-2006 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.Artifact; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; -import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; -import org.apache.maven.repository.discovery.ArtifactDiscoverer; -import org.apache.maven.repository.indexing.ArtifactRepositoryIndex; -import org.apache.maven.repository.indexing.RepositoryIndexException; -import org.apache.maven.repository.indexing.RepositoryIndexingFactory; -import org.codehaus.classworlds.ClassWorld; -import org.codehaus.plexus.PlexusContainerException; -import org.codehaus.plexus.component.repository.exception.ComponentLookupException; -import org.codehaus.plexus.embed.Embedder; - -import java.io.File; -import java.net.MalformedURLException; -import java.util.Iterator; -import java.util.List; - -/** - * Entry point for indexing CLI. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class IndexCli -{ - private IndexCli() - { - } - - public static void main( String[] args ) - throws PlexusContainerException, ComponentLookupException, RepositoryIndexException, MalformedURLException - { - Embedder embedder = new Embedder(); - embedder.start( new ClassWorld() ); - - RepositoryIndexingFactory indexFactory = - (RepositoryIndexingFactory) embedder.lookup( RepositoryIndexingFactory.ROLE ); - - ArtifactRepositoryFactory factory = - (ArtifactRepositoryFactory) embedder.lookup( ArtifactRepositoryFactory.ROLE ); - - ArtifactRepositoryLayout layout = - (ArtifactRepositoryLayout) embedder.lookup( ArtifactRepositoryLayout.ROLE, "legacy" ); - - ArtifactRepository repository = factory.createArtifactRepository( "repository", - new File( args[0] ).toURL().toString(), - layout, null, null ); - - ArtifactDiscoverer discoverer = (ArtifactDiscoverer) embedder.lookup( ArtifactDiscoverer.ROLE, "legacy" ); - - List artifacts = discoverer.discoverArtifacts( repository, null, false ); - - ArtifactRepositoryIndex index = - indexFactory.createArtifactRepositoryIndex( new File( args[0], ".index" ), repository ); - - long time = System.currentTimeMillis(); - try - { - for ( Iterator i = artifacts.iterator(); i.hasNext(); ) - { - Artifact artifact = (Artifact) i.next(); - - index.indexArtifact( artifact ); - } - index.optimize(); - } - finally - { - index.close(); - } - time = System.currentTimeMillis() - time; - - System.out.println( "Indexed " + artifacts.size() + " artifacts in " + time + "ms" ); - } - -} diff --git a/maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/IndexSearcherCli.java b/maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/IndexSearcherCli.java deleted file mode 100644 index b4b04ed69..000000000 --- a/maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/IndexSearcherCli.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.apache.maven.repository.manager.cli; - -/* - * Copyright 2005-2006 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.repository.ArtifactRepositoryFactory; -import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; -import org.apache.maven.repository.indexing.ArtifactRepositoryIndex; -import org.apache.maven.repository.indexing.RepositoryIndexException; -import org.apache.maven.repository.indexing.RepositoryIndexSearchException; -import org.apache.maven.repository.indexing.RepositoryIndexSearcher; -import org.apache.maven.repository.indexing.RepositoryIndexingFactory; -import org.apache.maven.repository.indexing.query.SinglePhraseQuery; -import org.codehaus.classworlds.ClassWorld; -import org.codehaus.plexus.PlexusContainerException; -import org.codehaus.plexus.component.repository.exception.ComponentLookupException; -import org.codehaus.plexus.embed.Embedder; - -import java.io.File; -import java.net.MalformedURLException; - -/** - * Entry point for indexing CLI. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class IndexSearcherCli -{ - private IndexSearcherCli() - { - } - - public static void main( String[] args ) - throws PlexusContainerException, ComponentLookupException, RepositoryIndexException, MalformedURLException, - RepositoryIndexSearchException - { - Embedder embedder = new Embedder(); - embedder.start( new ClassWorld() ); - - RepositoryIndexingFactory indexFactory = - (RepositoryIndexingFactory) embedder.lookup( RepositoryIndexingFactory.ROLE ); - - ArtifactRepositoryFactory factory = - (ArtifactRepositoryFactory) embedder.lookup( ArtifactRepositoryFactory.ROLE ); - - ArtifactRepositoryLayout layout = - (ArtifactRepositoryLayout) embedder.lookup( ArtifactRepositoryLayout.ROLE, "legacy" ); - - ArtifactRepository repository = factory.createArtifactRepository( "repository", - new File( args[0] ).toURL().toString(), - layout, null, null ); - - ArtifactRepositoryIndex index = - indexFactory.createArtifactRepositoryIndex( new File( args[0], ".index" ), repository ); - - RepositoryIndexSearcher searcher = (RepositoryIndexSearcher) embedder.lookup( RepositoryIndexSearcher.ROLE ); - - try - { - System.out.println( searcher.search( new SinglePhraseQuery( args[1], args[2] ), index ) ); - } - finally - { - index.close(); - } - } - -} |