First things first, Thank you all Jaxme devs for a nice piece of
software. It has saved me worlds of time already, and I've only used
it for a week.
I use maven 2 for all my projects. After a bit of tinkering the Jaxme
maven 2 plugin worked just fine in my configuration. (just using a
plugin configuration and an unmodified schema) I found a few bugs and
fixed them, and would like to pass on the patch.
Prior to using this patch you must rename JaxMeGoal.java to
JaxMeMojo.java. I did this in compliance with maven 2 plugin
development 'suggestions'
The patch does the following things to JaxMeMojo.java
1. clean up javadoc
2. rename class to go with file rename
3. changes default source and resource targets to maven 2 'standard'
for generated sources
4. fixes a bug where if sources are up to date, the generated
directory does not get added to the maven compiler list.
5. fixes a bug that prevents the packageName property set in the
plugin configuration from doing anything. Its value needs to be keyed
"jaxme.package.name" on the generator.
To use.apt
1. fixes the documentation for the "schema" configuration. Changed it
to "schemas" because that's what the code looks for.
Feel free to apply any and/or all of these changes. The diff was
generated from the
"http://svn.apache.org/repos/asf/webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin"
directory. Thanks again for the project.
--
Anthony Vito
[EMAIL PROTECTED]
Index: src/site/apt/use.apt
===================================================================
--- src/site/apt/use.apt (revision 378649)
+++ src/site/apt/use.apt (working copy)
@@ -64,7 +64,7 @@
--------------------------------------------------------------------
<configuration>
- <schema>src/xsd/*.xsd</schema>
+ <schemas>src/xsd/*.xsd</schemas>
</configuration>
--------------------------------------------------------------------
Index: src/main/java/org/apache/ws/jaxme/maven/plugins/JaxMeMojo.java
===================================================================
--- src/main/java/org/apache/ws/jaxme/maven/plugins/JaxMeMojo.java (revision 377800)
+++ src/main/java/org/apache/ws/jaxme/maven/plugins/JaxMeMojo.java (working copy)
@@ -45,15 +45,13 @@
import org.xml.sax.SAXException;
-/** This is the "jaxme:jaxme" goal. It runs the source
- * generator.
+/**
* @goal jaxme
* @phase generate-sources
- * @description Runs the JaxMe binding compiler
- * and generates the source files.
+ * @description Runs the JaxMe binding compiler and generates the source files.
* @requiresDependencyResolution test
*/
-public class JaxMeGoal extends AbstractMojo {
+public class JaxMeMojo extends AbstractMojo {
/** This property specifies a set of external
* binding files, which are being applied.
* @parameter
@@ -162,12 +160,12 @@
private String[] sgFactoryChain;
/** The target directory for source files. Defaults to
- * @parameter expression="${project.build.directory}/jaxme/java"
+ * @parameter expression="${project.build.directory}/generated-sources/jaxme"
*/
private String srcTarget;
/** The target directory for resource files. Defaults to
- * @parameter expression="${project.build.directory}/jaxme/resources"
+ * @parameter expression="${project.build.directory}/generated-sources/jaxme"
*/
private String resourceTarget;
@@ -496,6 +494,10 @@
final boolean uptodate = isUptodate(concat(concat(schemaFiles, dependencies), bindingFiles), producedFiles);
if (uptodate) {
getLog().info("Generated files are uptodate.");
+ getProject().addCompileSourceRoot(getSrcTarget());
+ Resource resource = new Resource();
+ resource.setDirectory(getResourceTarget());
+ getProject().addResource(resource);
return;
}
@@ -520,6 +522,8 @@
for (int i = 0; i < schemaFiles.length; i++) {
final SchemaReader reader = getSchemaReaderInstance();
g.setSchemaReader(reader);
+ // set the package name property to the key the generator expects
+ g.setProperty("jaxme.package.name",packageName);
g.setForcingOverwrite(isForce());
g.setSettingReadOnly(isReadOnly());
g.setTargetDirectory(getSrcTargetDirectory());
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]