]> source.dussan.org Git - archiva.git/commitdiff
be more specific with i18n keys
authorBrett Porter <brett@apache.org>
Wed, 7 Jun 2006 08:33:00 +0000 (08:33 +0000)
committerBrett Porter <brett@apache.org>
Wed, 7 Jun 2006 08:33:00 +0000 (08:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@412325 13f79535-47bb-0310-9956-ffa450edef68

maven-repository-converter/src/main/java/org/apache/maven/repository/converter/DefaultRepositoryConverter.java
maven-repository-converter/src/main/resources/org/apache/maven/repository/converter/DefaultRepositoryConverter.properties

index 5f74a6504a600f7faad903981c97a7251d361255..d06f9bfdd5710cbc66456fe31d0edc83a1ad330e 100644 (file)
@@ -264,33 +264,41 @@ public class DefaultRepositoryConverter
     private boolean validateMetadata( Metadata metadata, RepositoryMetadata repositoryMetadata, Artifact artifact,
                                       ArtifactReporter reporter )
     {
-        String key = "failure.incorrect.";
-
+        String groupIdKey;
+        String artifactIdKey = null;
+        String snapshotKey = null;
+        String versionKey = null;
+        String versionsKey = null;
         if ( repositoryMetadata.storedInGroupDirectory() )
         {
-            key += "groupMetadata.";
+            groupIdKey = "failure.incorrect.groupMetadata.groupId";
         }
         else if ( repositoryMetadata.storedInArtifactVersionDirectory() )
         {
-            key += "snapshotMetadata.";
+            groupIdKey = "failure.incorrect.snapshotMetadata.groupId";
+            artifactIdKey = "failure.incorrect.snapshotMetadata.artifactId";
+            versionKey = "failure.incorrect.snapshotMetadata.version";
+            snapshotKey = "failure.incorrect.snapshotMetadata.snapshot";
         }
         else
         {
-            key += "artifactMetadata.";
+            groupIdKey = "failure.incorrect.artifactMetadata.groupId";
+            artifactIdKey = "failure.incorrect.artifactMetadata.artifactId";
+            versionsKey = "failure.incorrect.artifactMetadata.versions";
         }
 
         boolean result = true;
 
         if ( !metadata.getGroupId().equals( artifact.getGroupId() ) )
         {
-            reporter.addFailure( artifact, getI18NString( key + "groupId" ) );
+            reporter.addFailure( artifact, getI18NString( groupIdKey ) );
             result = false;
         }
         if ( !repositoryMetadata.storedInGroupDirectory() )
         {
             if ( !metadata.getArtifactId().equals( artifact.getArtifactId() ) )
             {
-                reporter.addFailure( artifact, getI18NString( key + "artifactId" ) );
+                reporter.addFailure( artifact, getI18NString( artifactIdKey ) );
                 result = false;
             }
             if ( !repositoryMetadata.storedInArtifactVersionDirectory() )
@@ -313,7 +321,7 @@ public class DefaultRepositoryConverter
 
                 if ( !foundVersion )
                 {
-                    reporter.addFailure( artifact, getI18NString( key + "versions" ) );
+                    reporter.addFailure( artifact, getI18NString( versionsKey ) );
                     result = false;
                 }
             }
@@ -322,7 +330,7 @@ public class DefaultRepositoryConverter
                 // snapshot metadata
                 if ( !artifact.getBaseVersion().equals( metadata.getVersion() ) )
                 {
-                    reporter.addFailure( artifact, getI18NString( key + "version" ) );
+                    reporter.addFailure( artifact, getI18NString( versionKey ) );
                     result = false;
                 }
 
@@ -345,7 +353,7 @@ public class DefaultRepositoryConverter
 
                         if ( !correct )
                         {
-                            reporter.addFailure( artifact, getI18NString( key + "snapshot" ) );
+                            reporter.addFailure( artifact, getI18NString( snapshotKey ) );
                             result = false;
                         }
                     }
index 88e4d1f304d8face362f3ec29a80b1008fba74df..f6089c1f5ee16f6e22851bbf7a317d16181d31e7 100644 (file)
@@ -23,7 +23,6 @@ warning.missing.pom=The artifact had no POM in the source repository.
 
 exception.repositories.match=Source and target repositories are identical.
 
-# TODO! update definitions
 failure.incorrect.groupMetadata.groupId=The group ID in the source group metadata is incorrect.
 
 failure.incorrect.artifactMetadata.artifactId=The artifact ID in the source artifact metadata is incorrect.