diff options
author | Joakim Erdfelt <joakime@apache.org> | 2007-03-22 21:10:28 +0000 |
---|---|---|
committer | Joakim Erdfelt <joakime@apache.org> | 2007-03-22 21:10:28 +0000 |
commit | b2332f00ba4bcdc76aebaf03d93916faf132cbd8 (patch) | |
tree | 998a8a35fd8a1d0c686a3d7a31fa04f0abbc3dc3 /archiva-repository-layer | |
parent | 8be908c993e6ec8f3427c2cfe5b293cba9b6b764 (diff) | |
download | archiva-b2332f00ba4bcdc76aebaf03d93916faf132cbd8.tar.gz archiva-b2332f00ba4bcdc76aebaf03d93916faf132cbd8.zip |
More directory moves
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@521470 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-repository-layer')
109 files changed, 0 insertions, 4405 deletions
diff --git a/archiva-repository-layer/pom.xml b/archiva-repository-layer/pom.xml deleted file mode 100644 index 210563124..000000000 --- a/archiva-repository-layer/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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> - <artifactId>archiva</artifactId> - <groupId>org.apache.maven.archiva</groupId> - <version>1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.archiva</groupId> - <artifactId>archiva-repository-layer</artifactId> - <name>Archiva Repository Interface Layer</name> - <dependencies> - <dependency> - <groupId>org.apache.maven.archiva</groupId> - <artifactId>archiva-common</artifactId> - </dependency> - <dependency> - <groupId>org.apache.maven.archiva</groupId> - <artifactId>archiva-model</artifactId> - <version>1.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - </dependency> - <dependency> - <groupId>org.codehaus.plexus.cache</groupId> - <artifactId>plexus-cache-api</artifactId> - <version>1.0-alpha-2-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.codehaus.plexus.cache</groupId> - <artifactId>plexus-cache-ehcache</artifactId> - <version>1.0-alpha-2-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-artifact</artifactId> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-artifact-manager</artifactId> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-repository-metadata</artifactId> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - </dependency> - </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-maven-plugin</artifactId> - <executions> - <execution> - <id>merge</id> - <goals> - <goal>merge-descriptors</goal> - </goals> - <configuration> - <descriptors> - <descriptor>${basedir}/src/main/resources/META-INF/plexus/components.xml</descriptor> - <descriptor>${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml</descriptor> - </descriptors> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java deleted file mode 100644 index 2f7f35fe9..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayer.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.apache.maven.archiva.layer; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.codehaus.plexus.cache.Cache; -import org.codehaus.plexus.cache.CacheException; -import org.codehaus.plexus.cache.CacheHints; -import org.codehaus.plexus.cache.factory.CacheFactory; - -import java.util.List; - -/** - * CachedRepositoryQueryLayer - simple wrapper around another non-cached Repository Query Layer. - * - * @version $Id$ - */ -public class CachedRepositoryQueryLayer - implements RepositoryQueryLayer -{ - private Cache cache; - - private RepositoryQueryLayer layer; - - public CachedRepositoryQueryLayer( RepositoryQueryLayer layer ) - throws RepositoryQueryLayerException - { - this.layer = layer; - String repoId = layer.getRepository().getId(); - - CacheHints hints = new CacheHints(); - hints.setName( repoId ); - hints.setOverflowToDisk( false ); - try - { - this.cache = CacheFactory.getInstance().getCache( repoId, hints ); - } - catch ( CacheException e ) - { - throw new RepositoryQueryLayerException( "Unable to initialize cache: " + e.getMessage(), e ); - } - } - - public boolean containsArtifact( Artifact artifact ) - { - boolean artifactFound = true; - - String artifactPath = layer.getRepository().pathOf( artifact ); - - if ( cache.get( artifactPath ) == null ) - { - artifactFound = layer.containsArtifact( artifact ); - if ( artifactFound ) - { - cache.put( artifactPath, artifactPath ); - } - } - - return artifactFound; - } - - public List getVersions( Artifact artifact ) - throws RepositoryQueryLayerException - { - List list = (List) cache.get( artifact.getId() ); - - if ( list == null ) - { - list = layer.getVersions( artifact ); - cache.put( artifact.getId(), list ); - } - - return list; - } - - public ArtifactRepository getRepository() - { - return layer.getRepository(); - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayer.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayer.java deleted file mode 100644 index d664dad1b..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayer.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.apache.maven.archiva.layer; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.metadata.ArtifactRepositoryMetadata; -import org.apache.maven.artifact.repository.metadata.Metadata; -import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.util.List; - -/** - * DefaultRepositoryQueryLayer - * - * @version $Id$ - * @plexus.component role="org.apache.maven.archiva.layer.RepositoryQueryLayer" role-hint="default" - */ -public class DefaultRepositoryQueryLayer - implements RepositoryQueryLayer -{ - protected ArtifactRepository repository; - - public DefaultRepositoryQueryLayer( ArtifactRepository repository ) - { - this.repository = repository; - } - - public boolean containsArtifact( Artifact artifact ) - { - File f = new File( repository.getBasedir(), repository.pathOf( artifact ) ); - return f.exists(); - } - - public List getVersions( Artifact artifact ) - throws RepositoryQueryLayerException - { - Metadata metadata = getMetadata( artifact ); - - return metadata.getVersioning().getVersions(); - } - - public ArtifactRepository getRepository() - { - return repository; - } - - private Metadata getMetadata( Artifact artifact ) - throws RepositoryQueryLayerException - { - Metadata metadata; - - ArtifactRepositoryMetadata repositoryMetadata = new ArtifactRepositoryMetadata( artifact ); - String path = repository.pathOfRemoteRepositoryMetadata( repositoryMetadata ); - File metadataFile = new File( repository.getBasedir(), path ); - if ( metadataFile.exists() ) - { - MetadataXpp3Reader reader = new MetadataXpp3Reader(); - try - { - metadata = reader.read( new FileReader( metadataFile ) ); - } - catch ( FileNotFoundException e ) - { - throw new RepositoryQueryLayerException( "Error occurred while attempting to read metadata file", e ); - } - catch ( IOException e ) - { - throw new RepositoryQueryLayerException( "Error occurred while attempting to read metadata file", e ); - } - catch ( XmlPullParserException e ) - { - throw new RepositoryQueryLayerException( "Error occurred while attempting to read metadata file", e ); - } - } - else - { - throw new RepositoryQueryLayerException( "Metadata not found: " + metadataFile.getAbsolutePath() ); - } - - return metadata; - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayerFactory.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayerFactory.java deleted file mode 100644 index a7e794b19..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayerFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.apache.maven.archiva.layer; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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; - -/** - * Gets the default implementation of a repository query layer for the given repository. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - * @version $Id:DefaultRepositoryQueryLayerFactory.java 437105 2006-08-26 17:22:22 +1000 (Sat, 26 Aug 2006) brett $ - * @plexus.component role="org.apache.maven.archiva.layer.RepositoryQueryLayerFactory" - */ -public class DefaultRepositoryQueryLayerFactory - implements RepositoryQueryLayerFactory -{ - public RepositoryQueryLayer createRepositoryQueryLayer( ArtifactRepository repository ) - { - return new DefaultRepositoryQueryLayer( repository ); - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayer.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayer.java deleted file mode 100644 index 16ee0b378..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayer.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.apache.maven.archiva.layer; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 java.util.List; - -/** - * The transitive and metadata validation reports will need to query the repository for artifacts. - */ -public interface RepositoryQueryLayer -{ - String ROLE = RepositoryQueryLayer.class.getName(); - - boolean containsArtifact( Artifact artifact ); - - List getVersions( Artifact artifact ) - throws RepositoryQueryLayerException; - - ArtifactRepository getRepository(); -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayerException.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayerException.java deleted file mode 100644 index 08ef9d932..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayerException.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.apache.maven.archiva.layer; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -/** - * - */ -public class RepositoryQueryLayerException - extends Exception -{ - public RepositoryQueryLayerException( String message, Throwable cause ) - { - super( message, cause ); - } - - public RepositoryQueryLayerException( String message ) - { - super( message ); - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayerFactory.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayerFactory.java deleted file mode 100644 index 2aad42224..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/layer/RepositoryQueryLayerFactory.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.apache.maven.archiva.layer; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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; - -/** - * Gets the preferred implementation of a repository query layer for the given repository. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - * @version $Id:RepositoryQueryLayerFactory.java 437105 2006-08-26 17:22:22 +1000 (Sat, 26 Aug 2006) brett $ - */ -public interface RepositoryQueryLayerFactory -{ - String ROLE = RepositoryQueryLayerFactory.class.getName(); - - /** - * Create or obtain a query interface. - * - * @param repository the repository to query - * @return the obtained query layer - */ - RepositoryQueryLayer createRepositoryQueryLayer( ArtifactRepository repository ); -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ArchivaArtifact.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ArchivaArtifact.java deleted file mode 100644 index 2456f29f3..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ArchivaArtifact.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.apache.maven.archiva.repository; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.model.ArchivaArtifactModel; -import org.apache.maven.archiva.model.RepositoryContent; -import org.apache.maven.archiva.repository.version.VersionUtil; -import org.codehaus.plexus.util.StringUtils; - -/** - * ArchivaArtifact - Mutable artifact object. - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class ArchivaArtifact -{ - private ArchivaArtifactModel model; - - private String baseVersion; - - private boolean snapshot = false; - - public ArchivaArtifact( String groupId, String artifactId, String version, String classifier, String type ) - { - this( null, groupId, artifactId, version, classifier, type ); - } - - public ArchivaArtifact( ArchivaRepository repository, String groupId, String artifactId, String version, - String classifier, String type ) - { - if ( empty( groupId ) ) - { - throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty groupId." ); - } - - if ( empty( artifactId ) ) - { - throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty artifactId." ); - } - - if ( empty( version ) ) - { - throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty version." ); - } - - if ( empty( type ) ) - { - throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty type." ); - } - - model = new ArchivaArtifactModel(); - - if( repository == null ) - { - model.setContentKey( new RepositoryContent( groupId, artifactId, version ) ); - } - else - { - model.setContentKey( new RepositoryContent( repository.getModel(), groupId, artifactId, version ) ); - } - model.setClassifier( StringUtils.defaultString( classifier ) ); - model.setType( type ); - - this.snapshot = VersionUtil.isSnapshot( version ); - this.baseVersion = VersionUtil.getBaseVersion( version ); - } - - public String getGroupId() - { - return model.getContentKey().getGroupId(); - } - - public String getArtifactId() - { - return model.getContentKey().getArtifactId(); - } - - public String getVersion() - { - return model.getContentKey().getVersion(); - } - - public String getBaseVersion() - { - return baseVersion; - } - - public boolean isSnapshot() - { - return snapshot; - } - - public String getClassifier() - { - return model.getClassifier(); - } - - public String getType() - { - return model.getType(); - } - - public boolean hasClassifier() - { - return StringUtils.isNotEmpty( model.getClassifier() ); - } - - public String toString() - { - StringBuffer sb = new StringBuffer(); - if ( model.getContentKey().getGroupId() != null ) - { - sb.append( model.getContentKey().getGroupId() ); - sb.append( ":" ); - } - appendArtifactTypeClassifierString( sb ); - sb.append( ":" ); - if ( model.getContentKey().getVersion() != null ) - { - sb.append( model.getContentKey().getVersion() ); - } - - return sb.toString(); - } - - private void appendArtifactTypeClassifierString( StringBuffer sb ) - { - sb.append( model.getContentKey().getArtifactId() ); - sb.append( ":" ); - sb.append( getType() ); - if ( hasClassifier() ) - { - sb.append( ":" ); - sb.append( getClassifier() ); - } - } - - private boolean empty( String value ) - { - return value == null || value.trim().length() < 1; - } - -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ArchivaRepository.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ArchivaRepository.java deleted file mode 100644 index c1fb4f0fe..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ArchivaRepository.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.apache.maven.archiva.repository; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.model.ArchivaRepositoryModel; -import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; - -/** - * ArchivaRepository - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class ArchivaRepository -{ - protected ArtifactRepositoryPolicy releases; - - protected ArtifactRepositoryPolicy snapshots; - - private ArchivaRepositoryModel model; - - private RepositoryURL url; - - protected boolean blacklisted; - - /** - * Construct a Repository. - * - * @param id the unique identifier for this repository. - * @param name the name for this repository. - * @param url the base URL for this repository (this should point to the top level URL for the entire repository) - * @param layout the layout technique for this repository. - */ - public ArchivaRepository( String id, String name, String url ) - { - model = new ArchivaRepositoryModel(); - - model.setId( id ); - model.setName( name ); - setUrl( new RepositoryURL( url ) ); - } - - /** - * Construct a Repository. - * - * @param id the unique identifier for this repository. - * @param name the name for this repository. - * @param url the base URL for this repository (this should point to the top level URL for the entire repository) - * @param layout the layout technique for this repository. - */ - public ArchivaRepository( ArchivaRepositoryModel model ) - { - this.model = model; - - this.url = new RepositoryURL( model.getUrl() ); - } - - public String getId() - { - return model.getId(); - } - - public void setUrl( RepositoryURL url ) - { - this.url = url; - model.setUrl( url.getUrl() ); - } - - public RepositoryURL getUrl() - { - return this.url; - } - - public ArchivaRepositoryModel getModel() - { - return this.model; - } - - public boolean isBlacklisted() - { - return blacklisted; - } - - public void setBlacklisted( boolean blacklisted ) - { - this.blacklisted = blacklisted; - } - - public ArtifactRepositoryPolicy getReleases() - { - return releases; - } - - public void setReleases( ArtifactRepositoryPolicy releases ) - { - this.releases = releases; - } - - public ArtifactRepositoryPolicy getSnapshots() - { - return snapshots; - } - - public void setSnapshots( ArtifactRepositoryPolicy snapshots ) - { - this.snapshots = snapshots; - } - - public boolean isRemote() - { - return this.url.getProtocol().equals( "file" ); - } - - public boolean isManaged() - { - return this.url.getProtocol().equals( "file" ); - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryException.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryException.java deleted file mode 100644 index 0cafdc92d..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryException.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.apache.maven.archiva.repository; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -/** - * RepositoryException - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class RepositoryException - extends Exception -{ - - public RepositoryException() - { - super(); - } - - public RepositoryException( String message, Throwable cause ) - { - super( message, cause ); - } - - public RepositoryException( String message ) - { - super( message ); - } - - public RepositoryException( Throwable cause ) - { - super( cause ); - } - -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryURL.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryURL.java deleted file mode 100644 index 13ed57fc9..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryURL.java +++ /dev/null @@ -1,156 +0,0 @@ -package org.apache.maven.archiva.repository; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - - -/** - * RepositoryURL - Mutable (and protocol forgiving) URL object. - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class RepositoryURL -{ - private String url; - - private String protocol; - - private String host; - - private String port; - - private String username; - - private String password; - - private String path; - - public RepositoryURL( String url ) - { - this.url = url; - - // .\ Parse the URL \.____________________________________________ - - int pos; - - pos = url.indexOf( "://" ); - if ( pos == ( -1 ) ) - { - throw new IllegalArgumentException( "Invalid URL, unable to parse protocol:// from " + url ); - } - - protocol = url.substring( 0, pos ); - - // attempt to find the start of the 'path' - pos = url.indexOf( "/", protocol.length() + 3 ); - - // no path specified - ex "http://localhost" - if ( pos == ( -1 ) ) - { - // set pos to end of string. (needed for 'middle section') - pos = url.length(); - // default path - path = "/"; - } - else - { - // get actual path. - path = url.substring( pos ); - } - - // get the middle section ( username : password @ hostname : port ) - String middle = url.substring( protocol.length() + 3, pos ); - - pos = middle.indexOf( '@' ); - - // we have an authentication section. - if ( pos > 0 ) - { - String authentication = middle.substring( 0, pos ); - middle = middle.substring( pos + 1 ); // lop off authentication for host:port search - - pos = authentication.indexOf( ':' ); - - // we have a password. - if ( pos > 0 ) - { - username = authentication.substring( 0, pos ); - password = authentication.substring( pos + 1 ); - } - else - { - username = authentication; - } - } - - pos = middle.indexOf( ':' ); - - // we have a defined port - if ( pos > 0 ) - { - host = middle.substring( 0, pos ); - port = middle.substring( pos + 1 ); - } - else - { - host = middle; - } - } - - public String toString() - { - return url; - } - - public String getUsername() - { - return username; - } - - public String getPassword() - { - return password; - } - - public String getHost() - { - return host; - } - - public String getPath() - { - return path; - } - - public String getPort() - { - return port; - } - - public String getProtocol() - { - return protocol; - } - - public String getUrl() - { - return url; - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/connector/RepositoryConnector.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/connector/RepositoryConnector.java deleted file mode 100644 index f7adfedac..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/connector/RepositoryConnector.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.apache.maven.archiva.repository.connector; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.repository.ArchivaRepository; - -import java.util.List; - -/** - * RepositoryConnector - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public interface RepositoryConnector -{ - public ArchivaRepository getSourceRepository(); - - public ArchivaRepository getTargetRepository(); - - public List getBlacklist(); - - public List getWhitelist(); -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/consumer/Consumer.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/consumer/Consumer.java deleted file mode 100644 index 66b35a232..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/consumer/Consumer.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.apache.maven.archiva.repository.consumer; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.common.utils.BaseFile; -import org.apache.maven.archiva.repository.ArchivaRepository; -import org.apache.maven.artifact.repository.ArtifactRepository; - -import java.util.List; - -/** - * DiscovererConsumer - * - * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a> - * @version $Id$ - */ -public interface Consumer -{ - public static final String ROLE = Consumer.class.getName(); - - /** - * This is the human readable name for the discoverer. - * - * @return the human readable discoverer name. - */ - public String getName(); - - /** - * This is used to initialize any internals in the consumer before it is used. - * - * This method is called by the internals of archiva and is not meant to be used by other developers. - * This method is called once per repository. - * - * @param repository the repository to initialize the consumer against. - * @return true if the repository is valid for this consumer. false will result in consumer being disabled - * for the provided repository. - */ - public boolean init( ArchivaRepository repository ); - - /** - * Get the List of excluded file patterns for this consumer. - * - * @return the list of excluded file patterns for this consumer. - */ - public List getExcludePatterns(); - - /** - * Get the List of included file patterns for this consumer. - * - * @return the list of included file patterns for this consumer. - */ - public List getIncludePatterns(); - - /** - * Called by archiva framework to indicate that there is a file suitable for consuming, - * This method will only be called if the {@link #init(ArtifactRepository)} and {@link #getExcludePatterns()} - * and {@link #getIncludePatterns()} all pass for this consumer. - * - * @param file the file to process. - * @throws ConsumerException if there was a problem processing this file. - */ - public void processFile( BaseFile file ) throws ConsumerException; - - /** - * Called by archiva framework to indicate that there has been a problem detected - * on a specific file. - * - * NOTE: It is very possible for 1 file to have more than 1 problem associated with it. - * - * @param file the file to process. - * @param message the message describing the problem. - */ - public void processFileProblem( BaseFile file, String message ); -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/consumer/ConsumerException.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/consumer/ConsumerException.java deleted file mode 100644 index 709be8e6d..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/consumer/ConsumerException.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.apache.maven.archiva.repository.consumer; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.common.ArchivaException; -import org.apache.maven.archiva.common.utils.BaseFile; - -/** - * ConsumerException - details about the failure of a consumer. - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class ConsumerException - extends ArchivaException -{ - private BaseFile file; - - public ConsumerException( BaseFile file, String message, Throwable cause ) - { - super( message, cause ); - this.file = file; - } - - public ConsumerException( BaseFile file, String message ) - { - super( message ); - this.file = file; - } - - public BaseFile getFile() - { - return file; - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/consumer/ConsumerFactory.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/consumer/ConsumerFactory.java deleted file mode 100644 index 00c88064d..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/consumer/ConsumerFactory.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.apache.maven.archiva.repository.consumer; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.codehaus.plexus.PlexusConstants; -import org.codehaus.plexus.PlexusContainer; -import org.codehaus.plexus.context.Context; -import org.codehaus.plexus.context.ContextException; -import org.codehaus.plexus.logging.AbstractLogEnabled; -import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable; - -/** - * DiscovererConsumerFactory - factory for consumers. - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - * @plexus.component role="org.apache.maven.archiva.common.consumers.ConsumerFactory" - */ -public class ConsumerFactory - extends AbstractLogEnabled - implements Contextualizable -{ - public static final String ROLE = ConsumerFactory.class.getName(); - - private PlexusContainer container; - - public Consumer createConsumer( String name ) - throws ConsumerException - { - getLogger().info( "Attempting to create consumer [" + name + "]" ); - - Consumer consumer; - try - { - consumer = (Consumer) container.lookup( Consumer.ROLE, name, container.getLookupRealm() ); - } - catch ( Throwable t ) - { - String emsg = "Unable to create consumer [" + name + "]: " + t.getMessage(); - getLogger().warn( t.getMessage(), t ); - throw new ConsumerException( null, emsg, t ); - } - - getLogger().info( "Created consumer [" + name + "|" + consumer.getName() + "]" ); - return consumer; - } - - public void contextualize( Context context ) - throws ContextException - { - container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY ); - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractArtifactExtensionMapping.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractArtifactExtensionMapping.java deleted file mode 100644 index 3b1ab31c1..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractArtifactExtensionMapping.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.apache.maven.archiva.repository.content; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.repository.ArchivaArtifact; - -import java.util.HashMap; -import java.util.Map; - -/** - * AbstractArtifactExtensionMapping - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public abstract class AbstractArtifactExtensionMapping implements ArtifactExtensionMapping -{ - protected final Map typeToExtensionMap; - - public AbstractArtifactExtensionMapping() - { - typeToExtensionMap = new HashMap(); - typeToExtensionMap.put( "ejb-client", "jar" ); - typeToExtensionMap.put( "ejb", "jar" ); - typeToExtensionMap.put( "distribution-tgz", "tar.gz" ); - typeToExtensionMap.put( "distribution-zip", "zip" ); - typeToExtensionMap.put( "java-source", "jar" ); - typeToExtensionMap.put( "aspect", "jar" ); - typeToExtensionMap.put( "uberjar", "jar" ); - } - - public String getExtension( ArchivaArtifact artifact ) - { - // Try specialized types first. - if ( typeToExtensionMap.containsKey( artifact.getType() ) ) - { - return (String) typeToExtensionMap.get( artifact.getType() ); - } - - // Return type - return artifact.getType(); - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java deleted file mode 100644 index 0f6c990e7..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.apache.maven.archiva.repository.content; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.repository.ArchivaArtifact; - -/** - * ArtifactExtensionMapping - Utility to provide the mapping between an Artifact's extension and it's type and - * vice versa. - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public interface ArtifactExtensionMapping -{ - public String getExtension( ArchivaArtifact artifact ); - - public String getType( String filename ); -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultArtifactExtensionMapping.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultArtifactExtensionMapping.java deleted file mode 100644 index 70f036259..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultArtifactExtensionMapping.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.apache.maven.archiva.repository.content; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.commons.lang.StringUtils; - -/** - * DefaultArtifactExtensionMapping - extension mapping for Maven 2.x projects. - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - * - * @plexus.component role="org.apache.maven.archiva.repository.content.ArtifactExtensionMapping" - * role-hint="default" - */ -public class DefaultArtifactExtensionMapping extends AbstractArtifactExtensionMapping - implements ArtifactExtensionMapping -{ - public DefaultArtifactExtensionMapping() - { - super(); - } - - public String getType( String filename ) - { - if ( StringUtils.isBlank( filename ) ) - { - return null; - } - - String normalizedName = filename.toLowerCase().trim(); - - if ( normalizedName.endsWith( ".tar.gz" ) ) - { - return "distribution-tgz"; - } - else if ( normalizedName.endsWith( ".zip" ) ) - { - return "distribution-zip"; - } - else if ( normalizedName.endsWith( "-sources.jar" ) ) - { - return "java-source"; - } - // TODO: handle type for -javadoc.jar ? - else - { - int index = normalizedName.lastIndexOf( '.' ); - if ( index >= 0 ) - { - return normalizedName.substring( index + 1 ); - } - else - { - throw new IllegalArgumentException( "Filename " + filename + " does not have an extension." ); - } - } - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyArtifactExtensionMapping.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyArtifactExtensionMapping.java deleted file mode 100644 index 10fd815c8..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyArtifactExtensionMapping.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.apache.maven.archiva.repository.content; - -import org.apache.commons.lang.StringUtils; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -/** - * LegacyArtifactExtensionMapping - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - * - * @plexus.component role="org.apache.maven.archiva.repository.content.ArtifactExtensionMapping" - * role-hint="legacy" - */ -public class LegacyArtifactExtensionMapping extends AbstractArtifactExtensionMapping - implements ArtifactExtensionMapping -{ - public LegacyArtifactExtensionMapping() - { - super(); - } - - public String getType( String filename ) - { - if ( StringUtils.isBlank( filename ) ) - { - return null; - } - - String normalizedName = filename.toLowerCase().trim(); - - if ( normalizedName.endsWith( ".tar.gz" ) ) - { - return "distribution-tgz"; - } - else if ( normalizedName.endsWith( ".zip" ) ) - { - return "distribution-zip"; - } - else if ( normalizedName.endsWith( "-sources.jar" ) ) - { - return "java-source"; - } - // TODO: handle type for -javadoc.jar ? - else - { - int index = normalizedName.lastIndexOf( '.' ); - if ( index >= 0 ) - { - return normalizedName.substring( index + 1 ); - } - else - { - throw new IllegalArgumentException( "Filename " + filename + " does not have an extension." ); - } - } - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/BidirectionalRepositoryLayout.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/BidirectionalRepositoryLayout.java deleted file mode 100644 index 29770dffc..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/BidirectionalRepositoryLayout.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.apache.maven.archiva.repository.layout; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.repository.ArchivaArtifact; - -/** - * BidirectionalRepositoryLayout - Similar in scope to ArtifactRepositoryLayout, but does - * the both the Path to Artifact, and Artifact to Path conversions. - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public interface BidirectionalRepositoryLayout -{ - /** - * Get the identifier for this layout. - * - * @return the identifier for this layout. - */ - public String getId(); - - /** - * Given an ArchivaArtifact, return the relative path to the artifact. - * - * @param artifact the artifact to compute the path of. - * @return the relative path to the artifact. - */ - public String pathOf( ArchivaArtifact artifact ); - - /** - * Given a repository relative path to a filename, return the ArchivaArtifact object suitable for the path. - * - * @param path the path relative to the repository base dir for the artifact. - * @return the ArchivaArtifact representing the path. (or null if path cannot be converted to an ArchivaArtifact) - * @throws LayoutException if there was a problem converting the path to an artifact. - */ - public ArchivaArtifact toArtifact( String path ) throws LayoutException; -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/DefaultBidirectionalRepositoryLayout.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/DefaultBidirectionalRepositoryLayout.java deleted file mode 100644 index 35406aa07..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/DefaultBidirectionalRepositoryLayout.java +++ /dev/null @@ -1,129 +0,0 @@ -package org.apache.maven.archiva.repository.layout; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.commons.lang.StringUtils; -import org.apache.maven.archiva.repository.ArchivaArtifact; -import org.apache.maven.archiva.repository.content.ArtifactExtensionMapping; -import org.apache.maven.archiva.repository.content.DefaultArtifactExtensionMapping; - -/** - * DefaultBidirectionalRepositoryLayout - the layout mechanism for use by Maven 2.x repositories. - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - * - * @plexus.component role-hint="default" - */ -public class DefaultBidirectionalRepositoryLayout - implements BidirectionalRepositoryLayout -{ - private static final char PATH_SEPARATOR = '/'; - - private static final char GROUP_SEPARATOR = '.'; - - private static final char ARTIFACT_SEPARATOR = '-'; - - private ArtifactExtensionMapping extensionMapper = new DefaultArtifactExtensionMapping(); - - public String getId() - { - return "default"; - } - - public String pathOf( ArchivaArtifact artifact ) - { - StringBuffer path = new StringBuffer(); - - path.append( formatAsDirectory( artifact.getGroupId() ) ).append( PATH_SEPARATOR ); - path.append( artifact.getArtifactId() ).append( PATH_SEPARATOR ); - path.append( artifact.getBaseVersion() ).append( PATH_SEPARATOR ); - path.append( artifact.getArtifactId() ).append( ARTIFACT_SEPARATOR ).append( artifact.getVersion() ); - - if ( artifact.hasClassifier() ) - { - path.append( ARTIFACT_SEPARATOR ).append( artifact.getClassifier() ); - } - - path.append( GROUP_SEPARATOR ).append( extensionMapper.getExtension( artifact ) ); - - return path.toString(); - } - - private String formatAsDirectory( String directory ) - { - return directory.replace( GROUP_SEPARATOR, PATH_SEPARATOR ); - } - - public ArchivaArtifact toArtifact( String path ) throws LayoutException - { - String normalizedPath = StringUtils.replace( path, "\\", "/" ); - - String pathParts[] = StringUtils.split( normalizedPath, '/' ); - - /* Minimum parts. - * - * path = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar" - * path[0] = "commons-lang"; // The Group ID - * path[1] = "commons-lang"; // The Artifact ID - * path[2] = "2.1"; // The Version - * path[3] = "commons-lang-2.1.jar" // The filename. - */ - - if ( pathParts.length < 4 ) - { - // Illegal Path Parts Length. - throw new LayoutException( "Not enough parts to the path [" + path - + "] to construct an ArchivaArtifact from. (Requires at least 4 parts)" ); - } - - // Maven 2.x path. - int partCount = pathParts.length; - - // Last part is the filename - String filename = pathParts[partCount - 1]; - - // Second to last is the baseVersion (the directory version) - // (Don't need it) String baseVersion = pathParts[partCount - 2]; - - // Third to last is the artifact Id. - String artifactId = pathParts[partCount - 3]; - - // Remaining pieces are the groupId. - String groupId = ""; - for ( int i = 0; i <= partCount - 4; i++ ) - { - if ( groupId.length() > 0 ) - { - groupId += "."; - } - groupId += pathParts[i]; - } - - // Now we need to parse the filename to get the artifact version Id. - String fileParts[] = RepositoryLayoutUtils.splitFilename( filename, artifactId ); - String version = fileParts[1]; - String classifier = fileParts[2]; - - String type = extensionMapper.getType( filename ); - - return new ArchivaArtifact( groupId, artifactId, version, classifier, type ); - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LayoutException.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LayoutException.java deleted file mode 100644 index 0fc833689..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LayoutException.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.apache.maven.archiva.repository.layout; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.common.ArchivaException; - -/** - * LayoutException - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class LayoutException extends ArchivaException -{ - public LayoutException( String message, Throwable cause ) - { - super( message, cause ); - } - - public LayoutException( String message ) - { - super( message ); - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LegacyBidirectionalRepositoryLayout.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LegacyBidirectionalRepositoryLayout.java deleted file mode 100644 index 0344a5245..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LegacyBidirectionalRepositoryLayout.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.apache.maven.archiva.repository.layout; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.commons.lang.StringUtils; -import org.apache.maven.archiva.repository.ArchivaArtifact; -import org.apache.maven.archiva.repository.content.ArtifactExtensionMapping; -import org.apache.maven.archiva.repository.content.LegacyArtifactExtensionMapping; - -import java.util.HashMap; -import java.util.Map; - -/** - * LegacyBidirectionalRepositoryLayout - the layout mechanism for use by Maven 1.x repositories. - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - * - * @plexus.component role-hint="legacy" - */ -public class LegacyBidirectionalRepositoryLayout implements BidirectionalRepositoryLayout -{ - private static final String PATH_SEPARATOR = "/"; - - private ArtifactExtensionMapping extensionMapper = new LegacyArtifactExtensionMapping(); - - private Map typeToDirectoryMap; - - public LegacyBidirectionalRepositoryLayout() - { - typeToDirectoryMap = new HashMap(); - typeToDirectoryMap.put( "ejb-client", "ejb" ); - typeToDirectoryMap.put( "distribution-tgz", "distribution" ); - typeToDirectoryMap.put( "distribution-zip", "distribution" ); - } - - public String getId() - { - return "legacy"; - } - - public String pathOf( ArchivaArtifact artifact ) - { - StringBuffer path = new StringBuffer(); - - path.append( artifact.getGroupId() ).append( PATH_SEPARATOR ); - path.append( getDirectory( artifact ) ).append( PATH_SEPARATOR ); - path.append( artifact.getArtifactId() ).append( '-' ).append( artifact.getVersion() ); - - if ( artifact.hasClassifier() ) - { - path.append( '-' ).append( artifact.getClassifier() ); - } - - path.append( '.' ).append( extensionMapper.getExtension( artifact ) ); - - return path.toString(); - } - - private String getDirectory( ArchivaArtifact artifact ) - { - // Special Cases involving classifiers and type. - if ( "jar".equals( artifact.getType() ) && "sources".equals( artifact.getClassifier() ) ) - { - return "javadoc.jars"; - } - - // Special Cases involving only type. - String dirname = (String) typeToDirectoryMap.get( artifact.getType() ); - - if ( dirname != null ) - { - return dirname + "s"; - } - - // Default process. - return artifact.getType() + "s"; - } - - public ArchivaArtifact toArtifact( String path ) throws LayoutException - { - String normalizedPath = StringUtils.replace( path, "\\", "/" ); - - String pathParts[] = StringUtils.split( normalizedPath, '/' ); - - /* Always 3 parts. (Never more or less) - * - * path = "commons-lang/jars/commons-lang-2.1.jar" - * path[0] = "commons-lang"; // The Group ID - * path[1] = "jars"; // The Directory Type - * path[2] = "commons-lang-2.1.jar"; // The Filename. - */ - - if ( pathParts.length != 3 ) - { - // Illegal Path Parts Length. - throw new LayoutException( "Invalid number of parts to the path [" + path - + "] to construct an ArchivaArtifact from. (Required to be 3 parts)" ); - } - - // The Group ID. - String groupId = pathParts[0]; - - // The Filename. - String filename = pathParts[2]; - - String fileParts[] = RepositoryLayoutUtils.splitFilename( filename, null ); - - String artifactId = fileParts[0]; - String version = fileParts[1]; - String classifier = fileParts[2]; - - String type = extensionMapper.getType( filename ); - - return new ArchivaArtifact( groupId, artifactId, version, classifier, type ); - } - -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/RepositoryLayoutUtils.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/RepositoryLayoutUtils.java deleted file mode 100644 index 8e2c144c9..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/RepositoryLayoutUtils.java +++ /dev/null @@ -1,219 +0,0 @@ -package org.apache.maven.archiva.repository.layout; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.commons.lang.StringUtils; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * RepositoryLayoutUtils - utility methods common for most BidirectionalRepositoryLayout implementation. - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class RepositoryLayoutUtils -{ - /** - * Complex 2+ part extensions. - * Do not include initial "." character in extension names here. - */ - private static final String ComplexExtensions[] = new String[] { "tar.gz", "tar.bz2" }; - - /** - * These are the version patterns found in the filenames of the various artifact's versions IDs. - * These patterns are all tackling lowercase version IDs. - */ - private static final String VersionPatterns[] = - new String[] { "(snapshot)", "([0-9][_.0-9a-z]*)", "(g?[_.0-9ab]*(pre|rc|g|m)[_.0-9]*)", "(dev[_.0-9]*)", - "(alpha[_.0-9]*)", "(beta[_.0-9]*)", "(rc[_.0-9]*)", "(test[_.0-9]*)", "(debug[_.0-9]*)", - "(unofficial[_.0-9]*)", "(current)", "(latest)", "(fcs)", "(release[_.0-9]*)", "(nightly)", "(final)", - "(incubating)", "(incubator)", "([ab][_.0-9]*)" }; - - private static final String VersionMegaPattern = StringUtils.join( VersionPatterns, '|' ); - - /** - * Filename Parsing Mode - Artifact Id. - */ - private static final int ARTIFACTID = 1; - - /** - * Filename Parsing Mode - Version. - */ - private static final int VERSION = 2; - - /** - * Filename Parsing Mode - Classifier. - */ - private static final int CLASSIFIER = 3; - - /** - * Split the provided filename into 4 String parts. - * - * <pre> - * String part[] = splitFilename( filename ); - * artifactId = part[0]; - * version = part[1]; - * classifier = part[2]; - * extension = part[3]; - * </pre> - * - * @param filename the filename to split. - * @param possibleArtifactId the optional artifactId to aide in splitting the filename. - * (null to allow algorithm to calculate one) - * @return the parts of the filename. - * @throws LayoutException - */ - public static String[] splitFilename( String filename, String possibleArtifactId ) throws LayoutException - { - if ( StringUtils.isBlank( filename ) ) - { - throw new IllegalArgumentException( "Unable to split blank filename." ); - } - - String filestring = filename.trim(); - - String artifactId = ""; - String version = ""; - String classifier = ""; - String extension = ""; - - // I like working backwards. - - // Find the extension. - - // Work on multipart extensions first. - boolean found = false; - - String lowercaseFilename = filestring.toLowerCase(); - for ( int i = 0; i < ComplexExtensions.length && !found; i++ ) - { - if ( lowercaseFilename.endsWith( "." + ComplexExtensions[i] ) ) - { - extension = ComplexExtensions[i]; - filestring = filestring.substring( 0, filestring.length() - ComplexExtensions[i].length() - 1 ); - found = true; - } - } - - if ( !found ) - { - // Default to 1 part extension. - - int index = filestring.lastIndexOf( '.' ); - if ( index <= 0 ) - { - // Bad Filename - No Extension - throw new LayoutException( "Unable to determine extension from filename " + filename ); - } - extension = filestring.substring( index + 1 ); - filestring = filestring.substring( 0, index ); - } - - // Work on version string. - - if ( ( possibleArtifactId != null ) && filename.startsWith( possibleArtifactId ) ) - { - artifactId = possibleArtifactId; - filestring = filestring.substring( possibleArtifactId.length() + 1 ); - } - - String fileParts[] = StringUtils.split( filestring, '-' ); - - int versionStart = -1; - int versionEnd = -1; - - Pattern pat = Pattern.compile( VersionMegaPattern, Pattern.CASE_INSENSITIVE ); - Matcher mat; - - for ( int i = 0; i < fileParts.length; i++ ) - { - String part = fileParts[i]; - mat = pat.matcher( part ); - - if ( mat.matches() ) - { - // It is a potential verion part. - if ( versionStart < 0 ) - { - versionStart = i; - } - - versionEnd = i; - } - } - - if ( versionStart < 0 ) - { - throw new LayoutException( "Unable to determine version from filename " + filename ); - } - - // Gather up the ArtifactID - Version - Classifier pieces found. - - int mode = ARTIFACTID; - for ( int i = 0; i < fileParts.length; i++ ) - { - String part = fileParts[i]; - - if ( ( mode == ARTIFACTID ) && ( i >= versionStart ) ) - { - if ( StringUtils.isBlank( artifactId ) ) - { - throw new LayoutException( "No Artifact Id detected." ); - } - mode = VERSION; - } - - switch ( mode ) - { - case ARTIFACTID: - if ( artifactId.length() > 0 ) - { - artifactId += "-"; - } - artifactId += part; - break; - case VERSION: - if ( version.length() > 0 ) - { - version += "-"; - } - version += part; - break; - case CLASSIFIER: - if ( classifier.length() > 0 ) - { - classifier += "-"; - } - classifier += part; - break; - } - - if ( i >= versionEnd ) - { - mode = CLASSIFIER; - } - } - - return new String[] { artifactId, version, classifier, extension }; - } - -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanner.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanner.java deleted file mode 100644 index 568c07c9c..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanner.java +++ /dev/null @@ -1,197 +0,0 @@ -package org.apache.maven.archiva.repository.scanner; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.model.RepositoryContentStatistics; -import org.apache.maven.archiva.repository.ArchivaRepository; -import org.apache.maven.archiva.repository.RepositoryException; -import org.apache.maven.archiva.repository.consumer.Consumer; -import org.codehaus.plexus.util.DirectoryWalker; -import org.codehaus.plexus.util.FileUtils; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -/** - * RepositoryScanner - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class RepositoryScanner -{ - /** - * Standard patterns to exclude from discovery as they are usually noise. - */ - private static final String[] STANDARD_SCANNER_EXCLUDES = { - "bin/**", - "reports/**", - ".index", - ".reports/**", - ".maven/**", - "**/*snapshot-version", - "*/website/**", - "*/licences/**", - "**/.htaccess", - "**/*.html", - "**/*.txt", - "**/README*", - "**/CHANGELOG*", - "**/KEYS*" }; - - /** - * Walk the repository, and report to the consumers the files found. - * - * Report changes to the appropriate Consumer. - * - * This is just a convenience method to {@link #scan(ArtifactRepository, List, boolean, long, List, List)} - * equivalent to calling <code>scan( repository, consumers, includeSnapshots, 0, null, null );</code> - * - * @param repository the repository to change. - * @param consumers use the provided list of consumers. - * @param includeSnapshots true to include snapshots in the walking of this repository. - * @return the statistics for this scan. - * @throws RepositoryException if there was a fundamental problem with getting the discoverer started. - */ - public RepositoryContentStatistics scan( ArchivaRepository repository, List consumers, boolean includeSnapshots ) - throws RepositoryException - { - return scan( repository, consumers, includeSnapshots, 0, null, null ); - } - - /** - * Walk the repository, and report to the consumers the files found. - * - * Report changes to the appropriate Consumer. - * - * @param repository the repository to change. - * @param consumers use the provided list of consumers. - * @param includeSnapshots true to include snapshots in the scanning of this repository. - * @param onlyModifiedAfterTimestamp Only report to the consumers, files that have a {@link File#lastModified()}) - * after the provided timestamp. - * @param extraFileExclusions an optional list of file exclusions on the walk. - * @param extraFileInclusions an optional list of file inclusions on the walk. - * @return the statistics for this scan. - * @throws RepositoryException if there was a fundamental problem with getting the discoverer started. - */ - public RepositoryContentStatistics scan( ArchivaRepository repository, List consumers, boolean includeSnapshots, - long onlyModifiedAfterTimestamp, List extraFileExclusions, List extraFileInclusions ) - throws RepositoryException - { - if ( repository == null ) - { - throw new IllegalArgumentException( "Unable to operate on a null repository." ); - } - - if ( !"file".equals( repository.getUrl().getProtocol() ) ) - { - throw new UnsupportedOperationException( "Only filesystem repositories are supported." ); - } - - File repositoryBase = new File( repository.getUrl().getPath() ); - - if ( !repositoryBase.exists() ) - { - throw new UnsupportedOperationException( "Unable to scan a repository, directory " - + repositoryBase.getAbsolutePath() + " does not exist." ); - } - - if ( !repositoryBase.isDirectory() ) - { - throw new UnsupportedOperationException( "Unable to scan a repository, path " - + repositoryBase.getAbsolutePath() + " is not a directory." ); - } - - // Setup Includes / Excludes. - - List allExcludes = new ArrayList(); - List allIncludes = new ArrayList(); - - // Exclude all of the SCM patterns. - allExcludes.addAll( FileUtils.getDefaultExcludesAsList() ); - - // Exclude all of the archiva noise patterns. - allExcludes.addAll( Arrays.asList( STANDARD_SCANNER_EXCLUDES ) ); - - if ( !includeSnapshots ) - { - allExcludes.add( "**/*-SNAPSHOT*" ); - } - - if ( extraFileExclusions != null ) - { - allExcludes.addAll( extraFileExclusions ); - } - - Iterator it = consumers.iterator(); - while ( it.hasNext() ) - { - Consumer consumer = (Consumer) it.next(); - - /* NOTE: Do not insert the consumer exclusion patterns here. - * Exclusion patterns are handled by RepositoryScanner.wantsFile(Consumer, String) - * - * addUniqueElements( consumer.getExcludePatterns(), allExcludes ); - */ - addUniqueElements( consumer.getIncludePatterns(), allIncludes ); - } - - if ( extraFileInclusions != null ) - { - allIncludes.addAll( extraFileInclusions ); - } - - // Setup Directory Walker - - DirectoryWalker dirWalker = new DirectoryWalker(); - - dirWalker.setBaseDir( repositoryBase ); - - dirWalker.setIncludes( allIncludes ); - dirWalker.setExcludes( allExcludes ); - - // Setup the Scan Instance - RepositoryScannerInstance scannerInstance = new RepositoryScannerInstance( repository, consumers ); - scannerInstance.setOnlyModifiedAfterTimestamp( onlyModifiedAfterTimestamp ); - - dirWalker.addDirectoryWalkListener( scannerInstance ); - - // Execute scan. - dirWalker.scan(); - - return scannerInstance.getStatistics(); - } - - private void addUniqueElements( List fromList, List toList ) - { - Iterator itFrom = fromList.iterator(); - while ( itFrom.hasNext() ) - { - Object o = itFrom.next(); - if ( !toList.contains( o ) ) - { - toList.add( o ); - } - } - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerInstance.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerInstance.java deleted file mode 100644 index 349618273..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerInstance.java +++ /dev/null @@ -1,199 +0,0 @@ -package org.apache.maven.archiva.repository.scanner; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.commons.lang.SystemUtils; -import org.apache.maven.archiva.common.utils.BaseFile; -import org.apache.maven.archiva.model.RepositoryContentStatistics; -import org.apache.maven.archiva.repository.ArchivaRepository; -import org.apache.maven.archiva.repository.consumer.Consumer; -import org.codehaus.plexus.util.DirectoryWalkListener; -import org.codehaus.plexus.util.SelectorUtils; -import org.codehaus.plexus.util.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.Iterator; -import java.util.List; - -/** - * RepositoryScannerInstance - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class RepositoryScannerInstance implements DirectoryWalkListener -{ - private static Logger log = LoggerFactory.getLogger( RepositoryScannerInstance.class ); - - private List consumers; - - private ArchivaRepository repository; - - private boolean isCaseSensitive = true; - - private RepositoryContentStatistics stats; - - private long onlyModifiedAfterTimestamp = 0; - - public RepositoryScannerInstance( ArchivaRepository repository, List consumerList ) - { - this.repository = repository; - this.consumers = consumerList; - stats = new RepositoryContentStatistics(); - stats.setRepositoryId( repository.getId() ); - - - Iterator it = this.consumers.iterator(); - while ( it.hasNext() ) - { - Consumer consumer = (Consumer) it.next(); - - if ( !consumer.init( this.repository ) ) - { - throw new IllegalStateException( "Consumer [" + consumer.getName() + - "] is reporting that it is incompatible with the [" + repository.getId() + "] repository." ); - } - } - - if ( SystemUtils.IS_OS_WINDOWS ) - { - isCaseSensitive = false; - } - } - - public RepositoryContentStatistics getStatistics() - { - return stats; - } - - public void directoryWalkStarting( File basedir ) - { - log.info( "Walk Started: [" + this.repository.getId() + "] " + this.repository.getUrl() ); - stats.triggerStart(); - } - - public void directoryWalkStep( int percentage, File file ) - { - log.debug( "Walk Step: " + percentage + ", " + file ); - - stats.increaseFileCount(); - - // Timestamp finished points to the last successful scan, not this current one. - if ( file.lastModified() < onlyModifiedAfterTimestamp ) - { - // Skip file as no change has occured. - log.debug( "Skipping, No Change: " + file.getAbsolutePath() ); - return; - } - - synchronized ( consumers ) - { - stats.increaseNewFileCount(); - - BaseFile basefile = new BaseFile( repository.getUrl().getPath(), file ); - - Iterator itConsumers = this.consumers.iterator(); - while ( itConsumers.hasNext() ) - { - Consumer consumer = (Consumer) itConsumers.next(); - - if ( wantsFile( consumer, StringUtils.replace( basefile.getRelativePath(), "\\", "/" ) ) ) - { - try - { - log.debug( "Sending to consumer: " + consumer.getName() ); - consumer.processFile( basefile ); - } - catch ( Exception e ) - { - /* Intentionally Catch all exceptions. - * So that the discoverer processing can continue. - */ - log.error( "Consumer [" + consumer.getName() + "] had an error when processing file [" + - basefile.getAbsolutePath() + "]: " + e.getMessage(), e ); - } - } - else - { - log.debug( - "Skipping consumer " + consumer.getName() + " for file " + basefile.getRelativePath() ); - } - } - } - } - - public void directoryWalkFinished() - { - log.info( "Walk Finished: [" + this.repository.getId() + "] " + this.repository.getUrl() ); - stats.triggerFinished(); - } - - private boolean wantsFile( Consumer consumer, String relativePath ) - { - Iterator it; - - // Test excludes first. - it = consumer.getExcludePatterns().iterator(); - while ( it.hasNext() ) - { - String pattern = (String) it.next(); - if ( SelectorUtils.matchPath( pattern, relativePath, isCaseSensitive ) ) - { - // Definately does NOT WANT FILE. - return false; - } - } - - // Now test includes. - it = consumer.getIncludePatterns().iterator(); - while ( it.hasNext() ) - { - String pattern = (String) it.next(); - if ( SelectorUtils.matchPath( pattern, relativePath, isCaseSensitive ) ) - { - // Specifically WANTS FILE. - return true; - } - } - - // Not included, and Not excluded? Default to EXCLUDE. - return false; - } - - public long getOnlyModifiedAfterTimestamp() - { - return onlyModifiedAfterTimestamp; - } - - public void setOnlyModifiedAfterTimestamp( long onlyModifiedAfterTimestamp ) - { - this.onlyModifiedAfterTimestamp = onlyModifiedAfterTimestamp; - } - - /** - * Debug method from DirectoryWalker. - */ - public void debug( String message ) - { - log.debug( "Repository Scanner: " + message ); - } -} diff --git a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/version/VersionUtil.java b/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/version/VersionUtil.java deleted file mode 100644 index c8ce3716f..000000000 --- a/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/version/VersionUtil.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.apache.maven.archiva.repository.version; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * VersionConstants - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class VersionUtil -{ - public static final String SNAPSHOT = "SNAPSHOT"; - - public static final Pattern UNIQUE_SNAPSHOT_PATTERN = Pattern.compile( "^(.*)-([0-9]{8}\\.[0-9]{6})-([0-9]+)$" ); - - public static boolean isSnapshot( String version ) - { - Matcher m = UNIQUE_SNAPSHOT_PATTERN.matcher( version ); - if ( m.matches() ) - { - return true; - } - else - { - return version.endsWith( SNAPSHOT ); - } - } - - public static String getBaseVersion( String version ) - { - Matcher m = UNIQUE_SNAPSHOT_PATTERN.matcher( version ); - if ( m.matches() ) - { - return m.group( 1 ) + "-" + SNAPSHOT; - } - else - { - return version; - } - } -} diff --git a/archiva-repository-layer/src/main/resources/META-INF/plexus/components.xml b/archiva-repository-layer/src/main/resources/META-INF/plexus/components.xml deleted file mode 100644 index c2ee003f5..000000000 --- a/archiva-repository-layer/src/main/resources/META-INF/plexus/components.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" ?> - -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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. - --> - -<component-set> - <components> - <component> - <role>org.codehaus.plexus.cache.Cache</role> - <role-hint>repository-query</role-hint> - <implementation>org.codehaus.plexus.cache.ehcache.EhcacheCache</implementation> - <description>EhcacheCache</description> - <configuration> - <disk-expiry-thread-interval-seconds>600</disk-expiry-thread-interval-seconds> - <disk-persistent>true</disk-persistent> - <disk-store-path>${java.io.tmpdir}/ehcache/repo-query</disk-store-path> - <eternal>false</eternal> - <max-elements-in-memory>1000</max-elements-in-memory> - <memory-eviction-policy>LRU</memory-eviction-policy> - <name>repository-query</name> - <overflow-to-disk>false</overflow-to-disk> - <time-to-idle-seconds>600</time-to-idle-seconds> - <time-to-live-seconds>300</time-to-live-seconds> - </configuration> - </component> - </components> -</component-set> diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/AllTests.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/AllTests.java deleted file mode 100644 index e23eb09f7..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/AllTests.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.apache.maven.archiva; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 junit.framework.Test; -import junit.framework.TestSuite; - -/** - * AllTests - conveinence test suite for IDE users. - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class AllTests -{ - - public static Test suite() - { - TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva" ); - //$JUnit-BEGIN$ - suite.addTest( org.apache.maven.archiva.repository.AllTests.suite() ); - suite.addTest( org.apache.maven.archiva.layer.AllTests.suite() ); - //$JUnit-END$ - return suite; - } - -} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AbstractRepositoryQueryLayerTestCase.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AbstractRepositoryQueryLayerTestCase.java deleted file mode 100644 index 55f509457..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AbstractRepositoryQueryLayerTestCase.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.apache.maven.archiva.layer; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.factory.ArtifactFactory; -import org.apache.maven.artifact.repository.ArtifactRepository; -import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; -import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; -import org.codehaus.plexus.PlexusTestCase; - -import java.io.File; -import java.util.List; - -/** - * - */ -public abstract class AbstractRepositoryQueryLayerTestCase - extends PlexusTestCase -{ - private ArtifactFactory artifactFactory; - - protected ArtifactRepository repository; - - protected RepositoryQueryLayer queryLayer; - - protected void setUp() - throws Exception - { - super.setUp(); - File repositoryDirectory = getTestFile( "src/test/repositories/simple-repository" ); - - artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE ); - ArtifactRepositoryFactory factory = (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE ); - ArtifactRepositoryLayout layout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default" ); - - repository = - factory.createArtifactRepository( "test", repositoryDirectory.toURL().toString(), layout, null, null ); - } - - public void testContainsArtifactTrue() - { - Artifact artifact = getArtifact( "groupId", "artifactId", "1.0-alpha-1" ); - - assertTrue( "check artifact", queryLayer.containsArtifact( artifact ) ); - } - - public void testContainsArtifactFalse() - { - Artifact artifact = getArtifact( "groupId", "artifactId", "1.0-beta-1" ); - - assertFalse( "check non-existent artifact", queryLayer.containsArtifact( artifact ) ); - } - - public void testContainsSnapshotArtifactTrue() - { - Artifact artifact = getArtifact( "groupId", "snapshot-artifact", "1.0-alpha-1-20050611.202024-1" ); - assertTrue( "check for snapshot artifact", queryLayer.containsArtifact( artifact ) ); - } - - public void testContainsSnapshotArtifactFalse() - { - Artifact artifact = getArtifact( "groupId", "snapshot-artifact", "1.0-alpha-1-20050611.202024-2" ); - assertFalse( "check for non-existent snapshot artifact", queryLayer.containsArtifact( artifact ) ); - } - - public void testArtifactVersions() - throws Exception - { - Artifact artifact = getArtifact( "groupId", "artifactId", "ignored" ); - - List versions = queryLayer.getVersions( artifact ); - - assertTrue( "check version 1.0-alpha-1", versions.contains( "1.0-alpha-1" ) ); - assertFalse( "check version 1.0-alpha-2", versions.contains( "1.0-alpha-2" ) ); - } - - public void testArtifactVersionsError() - { - Artifact artifact = getArtifact( "groupId", "none", "ignored" ); - - try - { - queryLayer.getVersions( artifact ); - fail( "expected error not thrown" ); - } - catch ( RepositoryQueryLayerException e ) - { - //expected - } - } - - private Artifact getArtifact( String groupId, String artifactId, String version ) - { - Artifact projectArtifact = artifactFactory.createProjectArtifact( groupId, artifactId, version ); - projectArtifact.isSnapshot(); - return projectArtifact; - } -} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AllTests.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AllTests.java deleted file mode 100644 index c87f2710e..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/AllTests.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.apache.maven.archiva.layer; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 junit.framework.Test; -import junit.framework.TestSuite; - -/** - * AllTests - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class AllTests -{ - - public static Test suite() - { - TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.layer" ); - //$JUnit-BEGIN$ - suite.addTestSuite( CachedRepositoryQueryLayerTest.class ); - suite.addTestSuite( DefaultRepositoryQueryLayerTest.class ); - //$JUnit-END$ - return suite; - } - -} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.java deleted file mode 100644 index 1451e380c..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/CachedRepositoryQueryLayerTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.apache.maven.archiva.layer; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -/** - * CachedRepositoryQueryLayerTest - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class CachedRepositoryQueryLayerTest - extends AbstractRepositoryQueryLayerTestCase -{ - protected void setUp() - throws Exception - { - super.setUp(); - - RepositoryQueryLayer defaultLayer = new DefaultRepositoryQueryLayer( repository ); - - queryLayer = new CachedRepositoryQueryLayer( defaultLayer ); - } - - public void testUseFileCache() - { - testContainsArtifactTrue(); - } - - public void testUseMetadataCache() - throws Exception - { - testArtifactVersions(); - } - - public void testUseFileCacheOnSnapshot() - { - testContainsSnapshotArtifactTrue(); - } -} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayerTest.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayerTest.java deleted file mode 100644 index 4a50f8c66..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/layer/DefaultRepositoryQueryLayerTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.apache.maven.archiva.layer; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - */ - -public class DefaultRepositoryQueryLayerTest - extends AbstractRepositoryQueryLayerTestCase -{ - protected void setUp() - throws Exception - { - super.setUp(); - - queryLayer = new DefaultRepositoryQueryLayer( repository ); - } -} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AllTests.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AllTests.java deleted file mode 100644 index e25a55e80..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AllTests.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.apache.maven.archiva.repository; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 junit.framework.Test; -import junit.framework.TestSuite; - -/** - * AllTests - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class AllTests -{ - - public static Test suite() - { - TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.repository" ); - //$JUnit-BEGIN$ - suite.addTestSuite( RepositoryURLTest.class ); - //$JUnit-END$ - return suite; - } - -} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/RepositoryURLTest.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/RepositoryURLTest.java deleted file mode 100644 index c91eef8c8..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/RepositoryURLTest.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.apache.maven.archiva.repository; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 java.net.MalformedURLException; - -import junit.framework.TestCase; - -/** - * RepositoryURLTest - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class RepositoryURLTest - extends TestCase -{ - private void assertURL( String actualURL, String protocol, String username, String password, String hostname, - String port, String path ) - { - RepositoryURL url = new RepositoryURL( actualURL ); - - assertEquals( protocol, url.getProtocol() ); - assertEquals( username, url.getUsername() ); - assertEquals( password, url.getPassword() ); - assertEquals( hostname, url.getHost() ); - assertEquals( port, url.getPort() ); - assertEquals( path, url.getPath() ); - } - - public void testProtocolHttp() - throws MalformedURLException - { - assertURL( "http://localhost/path/to/resource.txt", "http", null, null, "localhost", null, - "/path/to/resource.txt" ); - } - - public void testProtocolWagonWebdav() - throws MalformedURLException - { - assertURL( "dav:http://localhost/path/to/resource.txt", "dav:http", null, null, "localhost", null, - "/path/to/resource.txt" ); - } - - public void testProtocolHttpWithPort() - throws MalformedURLException - { - assertURL( "http://localhost:9090/path/to/resource.txt", "http", null, null, "localhost", "9090", - "/path/to/resource.txt" ); - } - - public void testProtocolHttpWithUsername() - throws MalformedURLException - { - assertURL( "http://user@localhost/path/to/resource.txt", "http", "user", null, "localhost", null, - "/path/to/resource.txt" ); - } - - public void testProtocolHttpWithUsernamePassword() - throws MalformedURLException - { - assertURL( "http://user:pass@localhost/path/to/resource.txt", "http", "user", "pass", "localhost", null, - "/path/to/resource.txt" ); - } - - public void testProtocolHttpWithUsernamePasswordPort() - throws MalformedURLException - { - assertURL( "http://user:pass@localhost:9090/path/to/resource.txt", "http", "user", "pass", "localhost", "9090", - "/path/to/resource.txt" ); - } -} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/AbstractBidirectionalRepositoryLayoutTestCase.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/AbstractBidirectionalRepositoryLayoutTestCase.java deleted file mode 100644 index b15685a3b..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/AbstractBidirectionalRepositoryLayoutTestCase.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.apache.maven.archiva.repository.layout; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.commons.lang.StringUtils; -import org.apache.maven.archiva.repository.ArchivaArtifact; -import org.apache.maven.archiva.repository.ArchivaRepository; -import org.codehaus.plexus.PlexusTestCase; - -import java.io.File; - -/** - * AbstractBidirectionalRepositoryLayoutTestCase - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class AbstractBidirectionalRepositoryLayoutTestCase extends PlexusTestCase -{ - protected ArchivaRepository repository; - - protected void setUp() throws Exception - { - super.setUp(); - - repository = createTestRepository(); - } - - protected ArchivaRepository createTestRepository() - { - File targetDir = new File( getBasedir(), "target" ); - File testRepo = new File( targetDir, "test-repo" ); - - if ( !testRepo.exists() ) - { - testRepo.mkdirs(); - } - - String repoUri = "file://" + StringUtils.replace( testRepo.getAbsolutePath(), "\\", "/" ); - - ArchivaRepository repo = new ArchivaRepository( "testRepo", "Test Repository", repoUri ); - - return repo; - } - - protected ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String classifier, - String type ) - { - ArchivaArtifact artifact = new ArchivaArtifact( repository, groupId, artifactId, version, classifier, type ); - assertNotNull( artifact ); - return artifact; - } - - protected void assertArtifact( ArchivaArtifact actualArtifact, String groupId, String artifactId, String version, - String classifier, String type ) - { - String expectedId = groupId + ":" + artifactId + ":" + version + ":" + classifier + ":" + type; - - assertNotNull( expectedId + " - Should not be null.", actualArtifact ); - - assertEquals( expectedId + " - Group ID", actualArtifact.getGroupId(), groupId ); - assertEquals( expectedId + " - Artifact ID", actualArtifact.getArtifactId(), artifactId ); - assertEquals( expectedId + " - Version ID", actualArtifact.getVersion(), version ); - assertEquals( expectedId + " - Classifier", actualArtifact.getClassifier(), classifier ); - assertEquals( expectedId + " - Type", actualArtifact.getType(), type ); - } - - protected void assertSnapshotArtifact( ArchivaArtifact actualArtifact, String groupId, String artifactId, - String version, String classifier, String type ) - { - String expectedId = groupId + ":" + artifactId + ":" + version + ":" + classifier + ":" + type; - - assertNotNull( expectedId + " - Should not be null.", actualArtifact ); - - assertEquals( expectedId + " - Group ID", actualArtifact.getGroupId(), groupId ); - assertEquals( expectedId + " - Artifact ID", actualArtifact.getArtifactId(), artifactId ); - assertEquals( expectedId + " - Version ID", actualArtifact.getVersion(), version ); - assertEquals( expectedId + " - Classifier", actualArtifact.getClassifier(), classifier ); - assertEquals( expectedId + " - Type", actualArtifact.getType(), type ); - assertTrue( expectedId + " - Snapshot", actualArtifact.isSnapshot() ); - } - -} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/DefaultBidirectionalRepositoryLayoutTest.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/DefaultBidirectionalRepositoryLayoutTest.java deleted file mode 100644 index 249104a7f..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/DefaultBidirectionalRepositoryLayoutTest.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.apache.maven.archiva.repository.layout; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.repository.ArchivaArtifact; -import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout; -import org.apache.maven.archiva.repository.layout.LayoutException; - -/** - * DefaultBidirectionalRepositoryLayoutTest - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class DefaultBidirectionalRepositoryLayoutTest extends AbstractBidirectionalRepositoryLayoutTestCase -{ - private BidirectionalRepositoryLayout layout; - - protected void setUp() throws Exception - { - super.setUp(); - - layout = (BidirectionalRepositoryLayout) lookup( BidirectionalRepositoryLayout.class.getName(), "default" ); - } - - public void testToPathBasic() - { - ArchivaArtifact artifact = createArtifact( "com.foo", "foo-tool", "1.0", "", "jar" ); - - assertEquals( "com/foo/foo-tool/1.0/foo-tool-1.0.jar", layout.pathOf( artifact ) ); - } - - public void testToPathEjbClient() - { - ArchivaArtifact artifact = createArtifact( "com.foo", "foo-client", "1.0", "", "ejb-client" ); - - assertEquals( "com/foo/foo-client/1.0/foo-client-1.0.jar", layout.pathOf( artifact ) ); - } - - public void testToPathWithClassifier() - { - ArchivaArtifact artifact = createArtifact( "com.foo.lib", "foo-lib", "2.1-alpha-1", "sources", "java-source" ); - - assertEquals( "com/foo/lib/foo-lib/2.1-alpha-1/foo-lib-2.1-alpha-1-sources.jar", layout.pathOf( artifact ) ); - } - - public void testToPathUsingUniqueSnapshot() - { - ArchivaArtifact artifact = createArtifact( "com.foo", "foo-connector", "2.1-20060822.123456-35", "", "jar" ); - - assertEquals( "com/foo/foo-connector/2.1-SNAPSHOT/foo-connector-2.1-20060822.123456-35.jar", - layout.pathOf( artifact ) ); - } - - public void testToArtifactBasicSimpleGroupId() throws LayoutException - { - ArchivaArtifact artifact = layout.toArtifact( "commons-lang/commons-lang/2.1/commons-lang-2.1.jar" ); - assertArtifact( artifact, "commons-lang", "commons-lang", "2.1", "", "jar" ); - } - - public void testToArtifactBasicLongGroupId() throws LayoutException - { - ArchivaArtifact artifact = layout.toArtifact( "com/foo/foo-tool/1.0/foo-tool-1.0.jar" ); - assertArtifact( artifact, "com.foo", "foo-tool", "1.0", "", "jar" ); - } - - public void testToArtifactEjbClient() throws LayoutException - { - ArchivaArtifact artifact = layout.toArtifact( "com/foo/foo-client/1.0/foo-client-1.0.jar" ); - // The type is correct. as we cannot possibly know this is an ejb client without parsing the pom - assertArtifact( artifact, "com.foo", "foo-client", "1.0", "", "jar" ); - } - - public void testToArtifactWithClassifier() throws LayoutException - { - ArchivaArtifact artifact = - layout.toArtifact( "com/foo/lib/foo-lib/2.1-alpha-1/foo-lib-2.1-alpha-1-sources.jar" ); - // The 'java-source' type is correct. You might be thinking of extension, which we are not testing here. - assertArtifact( artifact, "com.foo.lib", "foo-lib", "2.1-alpha-1", "sources", "java-source" ); - } - - public void testToArtifactUsingUniqueSnapshot() throws LayoutException - { - ArchivaArtifact artifact = - layout.toArtifact( "com/foo/foo-connector/2.1-SNAPSHOT/foo-connector-2.1-20060822.123456-35.jar" ); - assertSnapshotArtifact( artifact, "com.foo", "foo-connector", "2.1-20060822.123456-35", "", "jar" ); - } -} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/LegacyBidirectionalRepositoryLayoutTest.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/LegacyBidirectionalRepositoryLayoutTest.java deleted file mode 100644 index c90f3b56f..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/LegacyBidirectionalRepositoryLayoutTest.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.apache.maven.archiva.repository.layout; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.repository.ArchivaArtifact; -import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout; - -/** - * LegacyBidirectionalRepositoryLayoutTest - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class LegacyBidirectionalRepositoryLayoutTest extends AbstractBidirectionalRepositoryLayoutTestCase -{ - private BidirectionalRepositoryLayout layout; - - protected void setUp() throws Exception - { - super.setUp(); - - layout = (BidirectionalRepositoryLayout) lookup( BidirectionalRepositoryLayout.class.getName(), "legacy" ); - } - - public void testToPathBasic() - { - ArchivaArtifact artifact = createArtifact( "com.foo", "foo-tool", "1.0", "", "jar" ); - - assertEquals( "com.foo/jars/foo-tool-1.0.jar", layout.pathOf( artifact ) ); - } - - public void testToPathEjbClient() - { - ArchivaArtifact artifact = createArtifact( "com.foo", "foo-client", "1.0", "", "ejb-client" ); - - assertEquals( "com.foo/ejbs/foo-client-1.0.jar", layout.pathOf( artifact ) ); - } - - public void testToPathWithClassifier() - { - ArchivaArtifact artifact = createArtifact( "com.foo.lib", "foo-lib", "2.1-alpha-1", "sources", "jar" ); - - assertEquals( "com.foo.lib/javadoc.jars/foo-lib-2.1-alpha-1-sources.jar", layout.pathOf( artifact ) ); - } - - public void testToPathUsingUniqueSnapshot() - { - ArchivaArtifact artifact = createArtifact( "com.foo", "foo-connector", "2.1-20060822.123456-35", "", "jar" ); - - assertEquals( "com.foo/jars/foo-connector-2.1-20060822.123456-35.jar", layout.pathOf( artifact ) ); - } - - public void testToArtifactBasicSimpleGroupId() throws LayoutException - { - ArchivaArtifact artifact = layout.toArtifact( "commons-lang/jars/commons-lang-2.1.jar" ); - assertArtifact( artifact, "commons-lang", "commons-lang", "2.1", "", "jar" ); - } - - public void testToArtifactBasicLongGroupId() throws LayoutException - { - ArchivaArtifact artifact = layout.toArtifact( "org.apache.derby/jars/derby-10.2.2.0.jar" ); - assertArtifact( artifact, "org.apache.derby", "derby", "10.2.2.0", "", "jar" ); - } - - public void testToArtifactLongGroupId() throws LayoutException - { - ArchivaArtifact artifact = layout.toArtifact( "org.apache.geronimo.specs/jars/geronimo-ejb_2.1_spec-1.0.1.jar" ); - assertArtifact( artifact, "org.apache.geronimo.specs", "geronimo-ejb_2.1_spec", "1.0.1", "", "jar" ); - } - - public void testToArtifactEjbClient() throws LayoutException - { - ArchivaArtifact artifact = layout.toArtifact( "org.apache.beehive/jars/beehive-ejb-control-1.0.1.jar" ); - // The type is correct. as we cannot possibly know this is an ejb client without parsing the pom - assertArtifact( artifact, "org.apache.beehive", "beehive-ejb-control", "1.0.1", "", "jar" ); - } - - public void testToArtifactWithClassifier() throws LayoutException - { - ArchivaArtifact artifact = layout.toArtifact( "commons-lang/jars/commons-lang-2.3-sources.jar" ); - // The 'java-source' type is correct. You might be thinking of extension, which we are not testing here. - assertArtifact( artifact, "commons-lang", "commons-lang", "2.3", "sources", "java-source" ); - } - - public void testToArtifactSnapshot() throws LayoutException - { - ArchivaArtifact artifact = layout.toArtifact( "directory-clients/poms/ldap-clients-0.9.1-SNAPSHOT.pom" ); - assertSnapshotArtifact( artifact, "directory-clients", "ldap-clients", "0.9.1-SNAPSHOT", "", "pom" ); - } -} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/RepositoryLayoutUtilsTest.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/RepositoryLayoutUtilsTest.java deleted file mode 100644 index 5a4e7049e..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/RepositoryLayoutUtilsTest.java +++ /dev/null @@ -1,206 +0,0 @@ -package org.apache.maven.archiva.repository.layout; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 junit.framework.TestCase; - -/** - * RepositoryLayoutUtilsTest - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class RepositoryLayoutUtilsTest extends TestCase -{ - public void testSplitFilenameBasic() throws LayoutException - { - assertSplit( RepositoryLayoutUtils.splitFilename( "commons-lang-2.1.jar", "commons-lang" ), "commons-lang", - "2.1", "", "jar" ); - } - - public void testSplitFilenameAlphaVersion() throws LayoutException - { - assertSplit( RepositoryLayoutUtils.splitFilename( "commons-lang-2.0-alpha-1.jar", "commons-lang" ), - "commons-lang", "2.0-alpha-1", "", "jar" ); - } - - public void testSplitFilenameSnapshot() throws LayoutException - { - assertSplit( RepositoryLayoutUtils.splitFilename( "foo-2.0-SNAPSHOT.jar", "foo" ), "foo", "2.0-SNAPSHOT", "", - "jar" ); - } - - public void testSplitFilenameUniqueSnapshot() throws LayoutException - { - assertSplit( RepositoryLayoutUtils.splitFilename( "fletch-2.0-20060822-123456-35.tar.gz", "fletch" ), "fletch", - "2.0-20060822-123456-35", "", "tar.gz" ); - } - - public void testSplitFilenameBasicClassifier() throws LayoutException - { - assertSplit( RepositoryLayoutUtils.splitFilename( "commons-lang-2.1-sources.jar", "commons-lang" ), - "commons-lang", "2.1", "sources", "jar" ); - assertSplit( RepositoryLayoutUtils.splitFilename( "commons-lang-2.1-javadoc.jar", "commons-lang" ), - "commons-lang", "2.1", "javadoc", "jar" ); - } - - public void testSplitFilenameAlphaClassifier() throws LayoutException - { - assertSplit( RepositoryLayoutUtils.splitFilename( "commons-lang-2.0-alpha-1-sources.jar", "commons-lang" ), - "commons-lang", "2.0-alpha-1", "sources", "jar" ); - assertSplit( RepositoryLayoutUtils.splitFilename( "commons-lang-2.0-alpha-1-javadoc.jar", "commons-lang" ), - "commons-lang", "2.0-alpha-1", "javadoc", "jar" ); - } - - public void testSplitFilenameSnapshotClassifier() throws LayoutException - { - assertSplit( RepositoryLayoutUtils.splitFilename( "commons-lang-3.1-SNAPSHOT-sources.jar", "commons-lang" ), - "commons-lang", "3.1-SNAPSHOT", "sources", "jar" ); - assertSplit( RepositoryLayoutUtils.splitFilename( "commons-lang-3.1-SNAPSHOT-javadoc.jar", "commons-lang" ), - "commons-lang", "3.1-SNAPSHOT", "javadoc", "jar" ); - } - - public void testSplitFilenameUniqueSnapshotClassifier() throws LayoutException - { - assertSplit( RepositoryLayoutUtils.splitFilename( "commons-lang-3.1-SNAPSHOT-sources.jar", "commons-lang" ), - "commons-lang", "3.1-SNAPSHOT", "sources", "jar" ); - assertSplit( RepositoryLayoutUtils.splitFilename( "commons-lang-3.1-SNAPSHOT-javadoc.jar", "commons-lang" ), - "commons-lang", "3.1-SNAPSHOT", "javadoc", "jar" ); - } - - public void testSplitFilenameApacheIncubator() throws LayoutException - { - assertSplit( RepositoryLayoutUtils.splitFilename( "cxf-common-2.0-incubator-M1.pom", null ), "cxf-common", - "2.0-incubator-M1", "", "pom" ); - assertSplit( RepositoryLayoutUtils.splitFilename( "commonj-api_r1.1-1.0-incubator-M2.jar", null ), - "commonj-api_r1.1", "1.0-incubator-M2", "", "jar" ); - } - - public void testSplitFilenameBlankInputs() - { - try - { - RepositoryLayoutUtils.splitFilename( null, null ); - fail( "Should have thrown an IllegalArgumentException." ); - } - catch ( IllegalArgumentException e ) - { - /* expected path */ - } - catch ( LayoutException e ) - { - fail( "Should have thrown an IllegalArgumentException." ); - } - - try - { - RepositoryLayoutUtils.splitFilename( "", null ); - fail( "Should have thrown an IllegalArgumentException." ); - } - catch ( IllegalArgumentException e ) - { - /* expected path */ - } - catch ( LayoutException e ) - { - fail( "Should have thrown an IllegalArgumentException." ); - } - - try - { - RepositoryLayoutUtils.splitFilename( " ", null ); - fail( "Should have thrown an IllegalArgumentException." ); - } - catch ( IllegalArgumentException e ) - { - /* expected path */ - } - catch ( LayoutException e ) - { - fail( "Should have thrown an IllegalArgumentException." ); - } - - try - { - RepositoryLayoutUtils.splitFilename( " \t \n ", null ); - fail( "Should have thrown an IllegalArgumentException." ); - } - catch ( IllegalArgumentException e ) - { - /* expected path */ - } - catch ( LayoutException e ) - { - fail( "Should have thrown an IllegalArgumentException." ); - } - } - - public void testSplitFilenameBadInputs() - { - try - { - RepositoryLayoutUtils.splitFilename( "commons-lang.jar", null ); - fail( "Should have thrown a LayoutException (No Version)." ); - } - catch ( LayoutException e ) - { - /* Expected Path */ - } - - try - { - RepositoryLayoutUtils.splitFilename( "geronimo-store", null ); - fail( "Should have thrown a LayoutException (No Extension)." ); - } - catch ( LayoutException e ) - { - /* Expected Path */ - } - - try - { - RepositoryLayoutUtils.splitFilename( "The Sixth Sick Sheiks Sixth Sheep is Sick.", null ); - fail( "Should have thrown a LayoutException (No Extension)." ); - } - catch ( LayoutException e ) - { - /* Expected Path */ - } - - try - { - RepositoryLayoutUtils.splitFilename( "1.0.jar", null ); - fail( "Should have thrown a LayoutException (No Artifact ID)." ); - } - catch ( LayoutException e ) - { - /* Expected Path */ - } - } - - private void assertSplit( String[] actualSplit, String artifactId, String version, String classifier, - String extension ) - { - assertEquals( "Split - artifactId", artifactId, actualSplit[0] ); - assertEquals( "Split - version", version, actualSplit[1] ); - assertEquals( "Split - classifier", classifier, actualSplit[2] ); - assertEquals( "Split - extension", extension, actualSplit[3] ); - } -} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/CentralScannerTiming.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/CentralScannerTiming.java deleted file mode 100644 index 3c2c3a2aa..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/CentralScannerTiming.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.apache.maven.archiva.repository.scanner; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.common.utils.BaseFile; -import org.apache.maven.archiva.common.utils.DateUtil; -import org.apache.maven.archiva.model.RepositoryContentStatistics; -import org.apache.maven.archiva.repository.ArchivaRepository; -import org.apache.maven.archiva.repository.RepositoryException; -import org.apache.maven.archiva.repository.consumer.Consumer; -import org.apache.maven.archiva.repository.consumer.ConsumerException; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * CentralScannerTiming - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class CentralScannerTiming -{ - public static void main( String[] args ) - { - String pathToCentral = "/home/repo1/ibiblio"; - - ( new CentralScannerTiming() ).scanIt( pathToCentral ); - } - - public void scanIt( String path ) - { - ArchivaRepository centralRepo = new ArchivaRepository( "central", "Central Mirror", "file://" + path ); - - RepositoryScanner scanner = new RepositoryScanner(); - - List consumerList = new ArrayList(); - BasicConsumer consumer = new BasicConsumer(); - consumerList.add( consumer ); - - try - { - RepositoryContentStatistics stats = scanner.scan( centralRepo, consumerList, true ); - - SimpleDateFormat df = new SimpleDateFormat(); - System.out.println( "-------" ); - System.out.println( " Repository ID : " + stats.getRepositoryId() ); - System.out.println( " Duration : " + DateUtil.getDuration( stats.getDuration() ) ); - System.out.println( " When Gathered : " + df.format( stats.getWhenGathered() ) ); - System.out.println( " Total File Count: " + stats.getTotalFileCount() ); - System.out.println( " New File Count : " + stats.getNewFileCount() ); - } - catch ( RepositoryException e ) - { - e.printStackTrace( System.err ); - } - } - - class BasicConsumer implements Consumer - { - int count = 0; - - public List getExcludePatterns() - { - return Collections.EMPTY_LIST; - } - - public List getIncludePatterns() - { - List includes = new ArrayList(); - includes.add( "**/*.pom" ); - includes.add( "**/*.jar" ); - includes.add( "**/*.war" ); - includes.add( "**/*.ear" ); - includes.add( "**/*.sar" ); - includes.add( "**/*.car" ); - includes.add( "**/*.mar" ); -// includes.add( "**/*.sha1" ); -// includes.add( "**/*.md5" ); -// includes.add( "**/*.asc" ); - includes.add( "**/*.dtd" ); - includes.add( "**/*.tld" ); - includes.add( "**/*.gz" ); - includes.add( "**/*.bz2" ); - includes.add( "**/*.zip" ); - return includes; - } - - public String getName() - { - return "Basic No-op Consumer"; - } - - public boolean init( ArchivaRepository repository ) - { - return true; - } - - public void processFile( BaseFile file ) throws ConsumerException - { - count++; - if ( ( count % 1000 ) == 0 ) - { - System.out.println( "Files Processed: " + count ); - } - } - - public void processFileProblem( BaseFile file, String message ) - { - /* no-op */ - } - } -} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerTest.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerTest.java deleted file mode 100644 index 4907819f0..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.apache.maven.archiva.repository.scanner; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.commons.lang.StringUtils; -import org.apache.maven.archiva.model.RepositoryContentStatistics; -import org.apache.maven.archiva.repository.ArchivaRepository; -import org.apache.maven.archiva.repository.RepositoryException; -import org.codehaus.plexus.PlexusTestCase; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -/** - * RepositoryScannerTest - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class RepositoryScannerTest extends PlexusTestCase -{ - private ArchivaRepository createDefaultRepository() - { - File repoDir = new File( getBasedir(), "src/test/repositories/default-repository" ); - - assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() ); - - String repoUri = "file://" + StringUtils.replace( repoDir.getAbsolutePath(), "\\", "/" ); - - ArchivaRepository repo = new ArchivaRepository( "testDefaultRepo", "Test Default Repository", repoUri ); - - return repo; - } - - public void testDefaultRepositoryScanner() throws RepositoryException - { - ArchivaRepository repository = createDefaultRepository(); - - List consumers = new ArrayList(); - ScanConsumer consumer = new ScanConsumer(); - consumers.add( consumer ); - - RepositoryScanner scanner = new RepositoryScanner(); - boolean includeSnapshots = true; - RepositoryContentStatistics stats = scanner.scan( repository, consumers, includeSnapshots ); - - assertNotNull( "Stats should not be null.", stats ); - assertEquals( "Stats.totalFileCount", 17, stats.getTotalFileCount() ); - assertEquals( "Processed Count", 17, consumer.getProcessCount() ); - } - -} diff --git a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/ScanConsumer.java b/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/ScanConsumer.java deleted file mode 100644 index d1c8e0a10..000000000 --- a/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/ScanConsumer.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.apache.maven.archiva.repository.scanner; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.archiva.common.utils.BaseFile; -import org.apache.maven.archiva.repository.ArchivaRepository; -import org.apache.maven.archiva.repository.consumer.Consumer; -import org.apache.maven.archiva.repository.consumer.ConsumerException; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * ScanConsumer - * - * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> - * @version $Id$ - */ -public class ScanConsumer implements Consumer -{ - private int processCount = 0; - - public List getExcludePatterns() - { - return Collections.EMPTY_LIST; - } - - public List getIncludePatterns() - { - List includes = new ArrayList(); - includes.add( "**/*.jar" ); - return includes; - } - - public String getName() - { - return "Scan Consumer"; - } - - public boolean init( ArchivaRepository repository ) - { - return true; - } - - public void processFile( BaseFile file ) throws ConsumerException - { - this.processCount++; - } - - public void processFileProblem( BaseFile file, String message ) - { - /* do nothing */ - } - - public int getProcessCount() - { - return processCount; - } - - public void setProcessCount( int processCount ) - { - this.processCount = processCount; - } -} diff --git a/archiva-repository-layer/src/test/repositories/default-repository/CVS/Root b/archiva-repository-layer/src/test/repositories/default-repository/CVS/Root deleted file mode 100644 index 2e65f24a6..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -not a real CVS root - for testing exclusions diff --git a/archiva-repository-layer/src/test/repositories/default-repository/KEYS b/archiva-repository-layer/src/test/repositories/default-repository/KEYS deleted file mode 100644 index d3b34d5ad..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/KEYS +++ /dev/null @@ -1 +0,0 @@ -test KEYS file
\ No newline at end of file diff --git a/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid-1.0.jar b/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid-1.0.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid-1.0.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar b/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar b/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0/invalid-1.0b.jar b/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0/invalid-1.0b.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0/invalid-1.0b.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0/invalid-2.0.jar b/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0/invalid-2.0.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0/invalid-2.0.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1/invalid-1 b/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1/invalid-1 deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1/invalid-1 +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/javax/maven-metadata.xml b/archiva-repository-layer/src/test/repositories/default-repository/javax/maven-metadata.xml deleted file mode 100644 index b3baf545d..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/javax/maven-metadata.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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. - --> - -<!-- This metdata is intentionally wrong. --> -<metadata> - <groupId>javax.sql</groupId> - <artifactId>jdbc</artifactId> - <version>2.0</version> -</metadata> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/2.0/jdbc-2.0.jar b/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/2.0/jdbc-2.0.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/2.0/jdbc-2.0.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/2.0/maven-metadata-repository.xml b/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/2.0/maven-metadata-repository.xml deleted file mode 100644 index caf5b6697..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/2.0/maven-metadata-repository.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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. - --> - -<metadata> - <groupId>javax.sql</groupId> - <artifactId>jdbc</artifactId> - <version>2.0</version> -</metadata> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/maven-metadata-repository.xml b/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/maven-metadata-repository.xml deleted file mode 100644 index bb7570891..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/maven-metadata-repository.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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. - --> - -<metadata> - <groupId>javax.sql</groupId> - <artifactId>jdbc</artifactId> - <version>2.0</version> - <versioning> - <versions> - <version>2.0</version> - </versions> - </versioning> -</metadata> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/maven-metadata-repository.xml b/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/maven-metadata-repository.xml deleted file mode 100644 index caf5b6697..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/maven-metadata-repository.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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. - --> - -<metadata> - <groupId>javax.sql</groupId> - <artifactId>jdbc</artifactId> - <version>2.0</version> -</metadata> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom deleted file mode 100644 index 202a0a448..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom +++ /dev/null @@ -1,28 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven</groupId> - <artifactId>A</artifactId> - <version>1.0</version> - <name>Maven Test Repository Artifact Discovery</name> - <packaging>war</packaging> -</project> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war deleted file mode 100644 index 54d190b23..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war +++ /dev/null @@ -1 +0,0 @@ -dummy content. sample file only.
diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom deleted file mode 100644 index fa5f8f6c8..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom +++ /dev/null @@ -1,28 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven</groupId> - <artifactId>B</artifactId> - <version>1.0</version> - <name>Maven Test Repository Artifact Discovery</name> - <packaging>pom</packaging> -</project> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom deleted file mode 100644 index c3034e820..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom +++ /dev/null @@ -1,28 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven</groupId> - <artifactId>B</artifactId> - <version>2.0</version> - <name>Maven Test Repository Artifact Discovery</name> - <packaging>pom</packaging> -</project> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom deleted file mode 100644 index ae14cd7eb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom +++ /dev/null @@ -1,28 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven</groupId> - <artifactId>C</artifactId> - <version>1.0</version> - <name>Maven Test Repository Artifact Discovery</name> - <packaging>war</packaging> -</project> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war deleted file mode 100644 index 54d190b23..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war +++ /dev/null @@ -1 +0,0 @@ -dummy content. sample file only.
diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/discovery/1.0/discovery-1.0.pom b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/discovery/1.0/discovery-1.0.pom deleted file mode 100644 index 5a29f6117..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/discovery/1.0/discovery-1.0.pom +++ /dev/null @@ -1,28 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven</groupId> - <artifactId>discovery</artifactId> - <version>1.0</version> - <name>Maven Test Repository Artifact Discovery</name> - <packaging>pom</packaging> -</project> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-metadata.xml b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-metadata.xml deleted file mode 100644 index 8ce7fc7bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-metadata.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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. - --> - -<metadata> - <groupId>org.apache.maven</groupId> -</metadata>
\ No newline at end of file diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/1.0/samplejar-1.0.jar b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/1.0/samplejar-1.0.jar deleted file mode 100644 index 54d190b23..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/1.0/samplejar-1.0.jar +++ /dev/null @@ -1 +0,0 @@ -dummy content. sample file only.
diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/1.0/samplejar-1.0.pom b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/1.0/samplejar-1.0.pom deleted file mode 100644 index 6ab57d162..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/1.0/samplejar-1.0.pom +++ /dev/null @@ -1,29 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven</groupId> - <artifactId>C</artifactId> - <version>1.0</version> - <name>Maven Test Repository Artifact Discovery</name> - <!-- default packaging is jar --> - <!--packaging>jar</packaging--> -</project> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/2.0/samplejar-2.0.jar b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/2.0/samplejar-2.0.jar deleted file mode 100644 index 54d190b23..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/2.0/samplejar-2.0.jar +++ /dev/null @@ -1 +0,0 @@ -dummy content. sample file only.
diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/2.0/samplejar-2.0.pom b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/2.0/samplejar-2.0.pom deleted file mode 100644 index a959980df..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/2.0/samplejar-2.0.pom +++ /dev/null @@ -1,29 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven</groupId> - <artifactId>C</artifactId> - <version>1.0</version> - <name>Maven Test Repository Artifact Discovery</name> - <!-- specified packaging --> - <packaging>jar</packaging> -</project> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/some-ejb/1.0/maven-metadata.xml b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/some-ejb/1.0/maven-metadata.xml deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/some-ejb/1.0/maven-metadata.xml +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/some-ejb/1.0/some-ejb-1.0-client.jar b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/some-ejb/1.0/some-ejb-1.0-client.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/some-ejb/1.0/some-ejb-1.0-client.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1-javadoc.jar b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1-javadoc.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1-javadoc.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1.jar b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/wrong-artifactId-1.0-20050611.112233-1.jar b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/wrong-artifactId-1.0-20050611.112233-1.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/wrong-artifactId-1.0-20050611.112233-1.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0-sources.jar b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0-sources.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0-sources.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.jar b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.tar.gz b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.tar.gz deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.tar.gz +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.zip b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.zip deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.zip +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.jar b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.jar deleted file mode 100644 index 54d190b23..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.jar +++ /dev/null @@ -1 +0,0 @@ -dummy content. sample file only.
diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.pom b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.pom deleted file mode 100644 index 452727f28..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.pom +++ /dev/null @@ -1,29 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.update</groupId> - <artifactId>test-not-updated</artifactId> - <version>1.0</version> - <name>Maven Test Repository Artifact Discovery</name> - <!-- default packaging is jar --> - <!--packaging>jar</packaging--> -</project> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/maven-metadata.xml b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/maven-metadata.xml deleted file mode 100644 index bd56a21c1..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/maven-metadata.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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. - --> - -<metadata> - <groupId>org.apache.maven.update</groupId> - <artifactId>test-not-updated</artifactId> -</metadata>
\ No newline at end of file diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.jar b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.jar deleted file mode 100644 index 54d190b23..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.jar +++ /dev/null @@ -1 +0,0 @@ -dummy content. sample file only.
diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.pom b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.pom deleted file mode 100644 index edd7b6479..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.pom +++ /dev/null @@ -1,29 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.maven.update</groupId> - <artifactId>test-updated</artifactId> - <version>1.0</version> - <name>Maven Test Repository Artifact Discovery</name> - <!-- default packaging is jar --> - <!--packaging>jar</packaging--> -</project> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/maven-metadata.xml b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/maven-metadata.xml deleted file mode 100644 index 86e063ca8..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/maven-metadata.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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. - --> - -<metadata> - <groupId>org.apache.maven.update</groupId> - <artifactId>test-updated</artifactId> -</metadata>
\ No newline at end of file diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom deleted file mode 100644 index 12538e81a..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom +++ /dev/null @@ -1,28 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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"> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.testgroup</groupId> - <artifactId>discovery</artifactId> - <version>1.0</version> - <name>Maven Test Repository Artifact Discovery</name> - <packaging>pom</packaging> -</project> diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/maven-metadata.xml b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/maven-metadata.xml deleted file mode 100644 index 8ee18048c..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/maven-metadata.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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. - --> - -<metadata> - <groupId>org.apache.testgroup</groupId> - <artifactId>discovery</artifactId> - <version>1.0</version> -</metadata>
\ No newline at end of file diff --git a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/maven-metadata.xml b/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/maven-metadata.xml deleted file mode 100644 index b024ef7ef..000000000 --- a/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/maven-metadata.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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. - --> - -<metadata> - <groupId>org.apache.testgroup</groupId> - <artifactId>discovery</artifactId> -</metadata>
\ No newline at end of file diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/CVS/Root b/archiva-repository-layer/src/test/repositories/legacy-repository/CVS/Root deleted file mode 100644 index 2e65f24a6..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -not a real CVS root - for testing exclusions diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/KEYS b/archiva-repository-layer/src/test/repositories/legacy-repository/KEYS deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/KEYS +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/foo/invalid-1.0.foo b/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/foo/invalid-1.0.foo deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/foo/invalid-1.0.foo +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/invalid-1.0.jar b/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/invalid-1.0.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/invalid-1.0.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/1.0/invalid-1.0.jar b/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/1.0/invalid-1.0.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/1.0/invalid-1.0.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/invalid-1.0.rar b/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/invalid-1.0.rar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/invalid-1.0.rar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/invalid.jar b/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/invalid.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/invalid.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/no-extension b/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/no-extension deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/no-extension +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/javax.sql/jars/jdbc-2.0.jar b/archiva-repository-layer/src/test/repositories/legacy-repository/javax.sql/jars/jdbc-2.0.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/javax.sql/jars/jdbc-2.0.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven.update/jars/test-not-updated-1.0.jar b/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven.update/jars/test-not-updated-1.0.jar deleted file mode 100644 index 54d190b23..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven.update/jars/test-not-updated-1.0.jar +++ /dev/null @@ -1 +0,0 @@ -dummy content. sample file only.
diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven.update/jars/test-updated-1.0.jar b/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven.update/jars/test-updated-1.0.jar deleted file mode 100644 index 54d190b23..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven.update/jars/test-updated-1.0.jar +++ /dev/null @@ -1 +0,0 @@ -dummy content. sample file only.
diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/some-ejb-1.0-client.jar b/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/some-ejb-1.0-client.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/some-ejb-1.0-client.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0-20050611.112233-1.jar b/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0-20050611.112233-1.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0-20050611.112233-1.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0-sources.jar b/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0-sources.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0-sources.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.jar b/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.tar.gz b/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.tar.gz deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.tar.gz +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.zip b/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.zip deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.zip +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-UNKNOWN.jar b/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-UNKNOWN.jar deleted file mode 100644 index e69de29bb..000000000 --- a/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-UNKNOWN.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.jar b/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.jar Binary files differdeleted file mode 100644 index c2ea777c1..000000000 --- a/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.jar +++ /dev/null diff --git a/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.pom b/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.pom deleted file mode 100644 index a987f03ec..000000000 --- a/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.pom +++ /dev/null @@ -1,25 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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> - <modelVersion>4.0.0</modelVersion> - <groupId>groupId</groupId> - <artifactId>artifactId</artifactId> - <version>1.0-alpha-1</version> -</project> diff --git a/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/maven-metadata.xml b/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/maven-metadata.xml deleted file mode 100644 index 526cc825a..000000000 --- a/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/maven-metadata.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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. - --> - -<metadata> - <groupId>groupId</groupId> - <artifactId>artifactId</artifactId> - <version>1.0-alpha-1</version> - <versioning> - <versions> - <version>1.0-alpha-1</version> - </versions> - </versioning> -</metadata> diff --git a/archiva-repository-layer/src/test/repositories/simple-repository/groupId/snapshot-artifact/1.0-alpha-1-SNAPSHOT/snapshot-artifact-1.0-alpha-1-20050611.202024-1.pom b/archiva-repository-layer/src/test/repositories/simple-repository/groupId/snapshot-artifact/1.0-alpha-1-SNAPSHOT/snapshot-artifact-1.0-alpha-1-20050611.202024-1.pom deleted file mode 100644 index cf613e847..000000000 --- a/archiva-repository-layer/src/test/repositories/simple-repository/groupId/snapshot-artifact/1.0-alpha-1-SNAPSHOT/snapshot-artifact-1.0-alpha-1-20050611.202024-1.pom +++ /dev/null @@ -1,19 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you 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. - --> - diff --git a/archiva-repository-layer/src/test/resources/log4j.xml b/archiva-repository-layer/src/test/resources/log4j.xml deleted file mode 100644 index 23d4d08d6..000000000 --- a/archiva-repository-layer/src/test/resources/log4j.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> - -<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> - - <appender name="console" class="org.apache.log4j.ConsoleAppender"> - <param name="Target" value="System.out"/> - <layout class="org.apache.log4j.PatternLayout"> - <param name="ConversionPattern" value="%d [%t] %-5p %-30c{1} - %m%n"/> - </layout> - </appender> - - <!-- Help identify bugs during testing --> - <logger name="org.apache.maven"> - <level value="info"/> - </logger> - - <logger name="org.codehaus.plexus.security"> - <level value="info"/> - </logger> - - <!-- squelch noisy objects (for now) --> - <logger name="org.codehaus.plexus.mailsender.MailSender"> - <level value="info"/> - </logger> - - <logger name="org.codehaus.plexus.PlexusContainer"> - <level value="info"/> - </logger> - - <logger name="org.codehaus.plexus.component.manager.ClassicSingletonComponentManager"> - <level value="error"/> - </logger> - - <root> - <priority value ="warn" /> - <appender-ref ref="console" /> - </root> - -</log4j:configuration> |