]> source.dussan.org Git - archiva.git/commitdiff
[MRM-125] only handle remote repository metadata for now
authorBrett Porter <brett@apache.org>
Mon, 24 Jul 2006 14:33:48 +0000 (14:33 +0000)
committerBrett Porter <brett@apache.org>
Mon, 24 Jul 2006 14:33:48 +0000 (14:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@425068 13f79535-47bb-0310-9956-ffa450edef68

maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/DefaultMetadataDiscoverer.java
maven-repository-discovery/src/test/java/org/apache/maven/repository/discovery/DefaultMetadataDiscovererTest.java
maven-repository-discovery/src/test/repository/javax/maven-metadata-repository.xml [deleted file]
maven-repository-discovery/src/test/repository/javax/maven-metadata.xml [new file with mode: 0644]
maven-repository-discovery/src/test/repository/org/apache/maven/some-ejb/1.0/maven-metadata-repository.xml [deleted file]
maven-repository-discovery/src/test/repository/org/apache/maven/some-ejb/1.0/maven-metadata.xml [new file with mode: 0644]

index 4d1cb3fae018349188149f84fca8876595ce2c70..7755016c68d158c3b9a3392fa1433e326185526c 100644 (file)
@@ -55,8 +55,12 @@ public class DefaultMetadataDiscoverer
 {
     /**
      * Standard patterns to include in discovery of metadata files.
+     *
+     * @todo Note that only the remote format is supported at this time: you cannot search local repository metadata due
+     * to the way it is later loaded in the searchers. Review code using pathOfRemoteMetadata. IS there any value in
+     * searching the local metadata in the first place though?
      */
-    private static final String[] STANDARD_DISCOVERY_INCLUDES = {"**/maven-metadata.xml", "**/maven-metadata-*.xml"};
+    private static final String[] STANDARD_DISCOVERY_INCLUDES = {"**/maven-metadata.xml"};
 
     public List discoverMetadata( ArtifactRepository repository, String operation, String blacklistedPatterns )
         throws DiscovererException
index 1d644096b26fec4e66e87308243ea3058d43a0c1..52471ab259f6dfb59e508f26d8a5df07edb87c89 100644 (file)
@@ -105,7 +105,7 @@ public class DefaultMetadataDiscovererTest
             String dir = dPath.getPath();
 
             String normalizedDir = dir.replace( '\\', '/' );
-            if ( "javax/maven-metadata-repository.xml".equals( normalizedDir ) )
+            if ( "javax/maven-metadata.xml".equals( normalizedDir ) )
             {
                 found = true;
                 assertEquals( "Check reason for kickout", "Unable to build a repository metadata from path",
@@ -130,7 +130,7 @@ public class DefaultMetadataDiscovererTest
             String dir = dPath.getPath();
 
             String normalizedDir = dir.replace( '\\', '/' );
-            if ( "org/apache/maven/some-ejb/1.0/maven-metadata-repository.xml".equals( normalizedDir ) )
+            if ( "org/apache/maven/some-ejb/1.0/maven-metadata.xml".equals( normalizedDir ) )
             {
                 found = true;
                 assertTrue( "Check reason for kickout", dPath.getComment().matches(
@@ -141,9 +141,11 @@ public class DefaultMetadataDiscovererTest
     }
 
     private void removeTimestampMetadata()
+        throws IOException
     {
         // remove the metadata that tracks time
         File file = new File( repository.getBasedir(), "maven-metadata.xml" );
+        System.gc(); // for Windows
         file.delete();
         assertFalse( file.exists() );
     }
diff --git a/maven-repository-discovery/src/test/repository/javax/maven-metadata-repository.xml b/maven-repository-discovery/src/test/repository/javax/maven-metadata-repository.xml
deleted file mode 100644 (file)
index 1777586..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
-  ~ Copyright 2005-2006 The Apache Software Foundation.
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~      http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<metadata>
-  <groupId>javax.sql</groupId>
-  <artifactId>jdbc</artifactId>
-  <version>2.0</version>
-</metadata>
diff --git a/maven-repository-discovery/src/test/repository/javax/maven-metadata.xml b/maven-repository-discovery/src/test/repository/javax/maven-metadata.xml
new file mode 100644 (file)
index 0000000..1777586
--- /dev/null
@@ -0,0 +1,21 @@
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<metadata>
+  <groupId>javax.sql</groupId>
+  <artifactId>jdbc</artifactId>
+  <version>2.0</version>
+</metadata>
diff --git a/maven-repository-discovery/src/test/repository/org/apache/maven/some-ejb/1.0/maven-metadata-repository.xml b/maven-repository-discovery/src/test/repository/org/apache/maven/some-ejb/1.0/maven-metadata-repository.xml
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/maven-repository-discovery/src/test/repository/org/apache/maven/some-ejb/1.0/maven-metadata.xml b/maven-repository-discovery/src/test/repository/org/apache/maven/some-ejb/1.0/maven-metadata.xml
new file mode 100644 (file)
index 0000000..e69de29