diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/contribution/src/main')
2 files changed, 9 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java b/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java index 670348ffce..58abc98d21 100644 --- a/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java +++ b/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java @@ -269,10 +269,14 @@ public class ContributionContentProcessor implements ExtendedURLArtifactProcesso if (packageName.equals(artifact.getURI().replace("/", "."))) available = true; } - if (!available) - throw new ContributionResolveException("[JCI100007] A Java package " + packageName - + " that is specified on an export " - + "element MUST be contained within the contribution containing the export element."); + if (!available) { + String message = context.getMonitor().getMessageString(ContributionContentProcessor.class.getName(), + "contribution-xml-validation-messages", + "ExportedPackageNotFound"); + message = message.replace("{0}", packageName); + + throw new ContributionResolveException(message); + } } } diff --git a/sca-java-2.x/trunk/modules/contribution/src/main/resources/contribution-xml-validation-messages.properties b/sca-java-2.x/trunk/modules/contribution/src/main/resources/contribution-xml-validation-messages.properties index 6d6c0aa428..2afbaa2230 100644 --- a/sca-java-2.x/trunk/modules/contribution/src/main/resources/contribution-xml-validation-messages.properties +++ b/sca-java-2.x/trunk/modules/contribution/src/main/resources/contribution-xml-validation-messages.properties @@ -23,3 +23,4 @@ IOException = IOException occured due to : {0} AttributeCompositeMissing = Attribute ''composite'' is missing DuplicateJavaImports = [JCI10001] The value of the @package attribute on the <import.java/> element is not unique across all other <import.java/> elements within the contribution. DuplicateJavaExports = [JCI10004] The value of the @package attribute on the <export.java/> element is not unique across all other <export.java/> elements within the contribution. +ExportedPackageNotFound = [JCI100007] A Java package {0} that is specified on an export element MUST be contained within the contribution containing the export element. |