be more specific with i18n keys

git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@412325 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2006-06-07 08:33:00 +00:00
parent 85d48bdf93
commit f1f69f4c8a
2 changed files with 18 additions and 11 deletions

View 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;
}
}

View 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.