mcconnell 2003/08/26 03:21:49
Modified: meta/impl/src/java/org/apache/avalon/meta/info/builder
Resources.properties XMLServiceCreator.java
meta/site/xdocs/tools/maven index.xml
Log:
Improve error reporting concerning version creation for services.
Revision Changes Path
1.3 +1 -0
avalon-sandbox/meta/impl/src/java/org/apache/avalon/meta/info/builder/Resources.properties
Index: Resources.properties
===================================================================
RCS file:
/home/cvs/avalon-sandbox/meta/impl/src/java/org/apache/avalon/meta/info/builder/Resources.properties,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Resources.properties 12 Jul 2003 14:12:52 -0000 1.2
+++ Resources.properties 26 Aug 2003 10:21:48 -0000 1.3
@@ -12,3 +12,4 @@
builder.creating-service.notice=Creating a Service from class "{0}".
builder.bad-toplevel-service-element.error=Error the service "{0}" has an invalid
element at top level service descriptor. Expected: "service". Actual: "{1}"
builder.created-service.notice=Constructed Service from class {0} with {1}
attribute(s).
+builder.bad-version=Unexpected error while attempting to build a version from the
string [{0}].
1.3 +13 -4
avalon-sandbox/meta/impl/src/java/org/apache/avalon/meta/info/builder/XMLServiceCreator.java
Index: XMLServiceCreator.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/meta/impl/src/java/org/apache/avalon/meta/info/builder/XMLServiceCreator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLServiceCreator.java 11 Jul 2003 04:49:33 -0000 1.2
+++ XMLServiceCreator.java 26 Aug 2003 10:21:48 -0000 1.3
@@ -62,6 +62,7 @@
import org.apache.avalon.meta.info.Service;
import org.apache.avalon.meta.info.EntryDescriptor;
import org.apache.avalon.meta.info.ReferenceDescriptor;
+import org.apache.avalon.meta.info.builder.BuildException;
import org.apache.excalibur.configuration.ConfigurationUtil;
import org.xml.sax.InputSource;
@@ -217,9 +218,17 @@
* @param version the version string
* @return the created Version object
*/
- protected Version buildVersion( final String version )
+ protected Version buildVersion( final String version ) throws BuildException
{
- return Version.getVersion( version );
+ try
+ {
+ return Version.getVersion( version );
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ REZ.getString( "builder.bad-version", version );
+ throw new BuildException( error, e );
+ }
}
-
}
1.5 +3 -4 avalon-sandbox/meta/site/xdocs/tools/maven/index.xml
Index: index.xml
===================================================================
RCS file: /home/cvs/avalon-sandbox/meta/site/xdocs/tools/maven/index.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- index.xml 24 Jul 2003 12:12:01 -0000 1.4
+++ index.xml 26 Aug 2003 10:21:48 -0000 1.5
@@ -16,7 +16,7 @@
<table>
<tr><th>Goal</th><th>Description</th></tr>
<tr>
- <td>merlin:meta</td>
+ <td>avalon:meta</td>
<td>
<p>Generates meta info descriptors for service and component types
based on javadoc tags within the java source files. Source class files
@@ -45,12 +45,11 @@
<build>
<!-- more stuff -->
<resources>
- <!-- include the generated metainfo descriptors into you jar file -->
+ <!-- include the generated meta-info descriptors into you jar file -->
<resource>
<directory>${basedir}/target/src</directory>
<includes>
- <include>**/*.x*</include> <!-- XML meta info desriptors -->
- <include>**/*.z*</include> <!-- Serialized info descriptors -->
+ <include>**/*.x*</include> <!-- meta info desriptors -->
</includes>
</resource>
</resources>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]