Author: jochen
Date: Fri Feb 17 17:28:00 2006
New Revision: 378674

URL: http://svn.apache.org/viewcvs?rev=378674&view=rev
Log:
- The packageName attribute wasn't honoured.
- The docs were using the element name "schema", and not "schemas".
- Adding the generated sources to the compilers input didn't happen
  if they were uptodate.

Thanks to Anthony Vito

Added:
    webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/changes/
    webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/changes/changes.xml
Modified:
    webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/pom.xml
    
webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/main/java/org/apache/ws/jaxme/maven/plugins/JaxMeGoal.java
    
webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/site/apt/properties.apt

Modified: webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/pom.xml
URL: 
http://svn.apache.org/viewcvs/webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/pom.xml?rev=378674&r1=378673&r2=378674&view=diff
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/pom.xml (original)
+++ webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/pom.xml Fri Feb 17 
17:28:00 2006
@@ -22,7 +22,7 @@
   <artifactId>maven-jaxme-plugin</artifactId>
   <packaging>maven-plugin</packaging>
   <name>Maven JaxMe Plugin</name>
-  <version>1.0.2</version>
+  <version>1.0.3</version>
   <description>
     This plugin allows running the JaxMe binding compiler on
     your XML schema files and add the generated sources to
@@ -52,7 +52,17 @@
       <id>jochen</id>
       <email>[EMAIL PROTECTED]</email>
     </developer>
-  </developers>  
+  </developers>
+  <contributors>
+    <contributor>
+      <name>Robert Eric Reeves</name>
+      <email>[EMAIL PROTECTED]</email>
+    </contributor>
+    <contributor>
+      <name>Anthony Vito</name>
+      <email>[EMAIL PROTECTED]</email>
+    </contributor>
+  </contributors>
   <licenses>
     <license>
       <name>The Apache Software License, Version 2.0</name>
@@ -145,6 +155,10 @@
   </dependencies>
   <reporting>
     <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>changes-maven-plugin</artifactId>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-javadoc-plugin</artifactId>

Added: 
webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/changes/changes.xml
URL: 
http://svn.apache.org/viewcvs/webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/changes/changes.xml?rev=378674&view=auto
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/changes/changes.xml 
(added)
+++ webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/changes/changes.xml 
Fri Feb 17 17:28:00 2006
@@ -0,0 +1,40 @@
+<document>
+  <properties>
+    <title>Maven JaxMe Plugin Changes</title>
+  </properties>
+  <body>
+    <release version="1.0.3" date="2006-02-18" desc="The Vito release">
+      <action dev="jochen" type="fix" due-to="Anthony Vito"
+          due-to-email="[EMAIL PROTECTED]">
+        Adding the generated sources to the compilers input
+        was not done, if the generated sources where already
+        uptodate.
+      </action>
+      <action dev="jochen" type="fix" due-to="Anthony Vito"
+          due-to-email="[EMAIL PROTECTED]">
+        The packageName property wasn't used.
+      </action>
+      <action dev="jochen" type="fix" due-to="Anthony Vito"
+          due-to-email="[EMAIL PROTECTED]">
+        Fixed, that the element name "schema", and not "schemas"
+        was used in the docs.
+      </action>
+    </release>
+
+    <release version="1.0.2" date="2006-01-10">
+      <action dev="jochen" type="fix" due-to="Robert Eric Reeves"
+          due-to-email="[EMAIL PROTECTED]">
+        Fixed that the inital release was compiled for Java 5.
+      </action>
+    </release>
+
+    <release version="1.0.1" date="2006-01-07">
+      <action dev="jochen" type="update">
+        Release of JaxMe 0.5.1, which is now used as a dependency.
+      </action>
+    </release>
+
+    <release version="1.0" date="2005-12-28" desc="Initial release">
+    </release>
+  </body>
+</document>

Modified: 
webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/main/java/org/apache/ws/jaxme/maven/plugins/JaxMeGoal.java
URL: 
http://svn.apache.org/viewcvs/webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/main/java/org/apache/ws/jaxme/maven/plugins/JaxMeGoal.java?rev=378674&r1=378673&r2=378674&view=diff
==============================================================================
--- 
webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/main/java/org/apache/ws/jaxme/maven/plugins/JaxMeGoal.java
 (original)
+++ 
webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/main/java/org/apache/ws/jaxme/maven/plugins/JaxMeGoal.java
 Fri Feb 17 17:28:00 2006
@@ -45,12 +45,10 @@
 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 {
@@ -496,47 +494,8 @@
                        final boolean uptodate = 
isUptodate(concat(concat(schemaFiles, dependencies), bindingFiles), 
producedFiles);
                        if (uptodate) {
                                getLog().info("Generated files are uptodate.");
-                               return;
-                       }
-       
-                       removeOldOutput(producedFiles);
-       
-                       Generator g = new GeneratorImpl();
-                       for (int i = 0;  i < bindingFiles.length;  i++) {
-                               File f = bindingFiles[i];
-                               try {
-                                       g.addBindings(new 
InputSource(f.toURL().toExternalForm()));
-                               } catch (ParserConfigurationException e) {
-                                       throw new 
MojoExecutionException("Failed to add binding file "
-                                                       + f.getPath() + ": " + 
e.getMessage(), e);
-                               } catch (SAXException e) {
-                                       throw new 
MojoExecutionException("Failed to add binding file "
-                                                       + f.getPath() + ": " + 
e.getMessage(), e);
-                               } catch (IOException e) {
-                                       throw new 
MojoExecutionException("Failed to add binding file "
-                                                       + f.getPath() + ": " + 
e.getMessage(), e);
-                               }
-                       }
-                       for (int i = 0;  i < schemaFiles.length;  i++) {
-                               final SchemaReader reader = 
getSchemaReaderInstance();
-                               g.setSchemaReader(reader);
-                               g.setForcingOverwrite(isForce());
-                               g.setSettingReadOnly(isReadOnly());
-                               g.setTargetDirectory(getSrcTargetDirectory());
-                               
g.setResourceTargetDirectory(getResourceTargetDirectory());
-                               g.setValidating(isValidating());
-                               Map props = getProperties();
-                               if (props != null) {
-                                       for (Iterator iter = 
props.entrySet().iterator();  iter.hasNext();  ) {
-                                               Map.Entry entry = (Map.Entry) 
iter.next();
-                                               g.setProperty((String) 
entry.getKey(), (String) entry.getValue());
-                                       }
-                               }
-                               try {
-                                       g.generate(schemaFiles[i]);
-                               } catch (Exception e) {
-                                       throw new 
MojoExecutionException(e.getMessage(), e);
-                               }
+                       } else {
+                               runGenerator(schemaFiles, producedFiles, 
bindingFiles);
                        }
        
                        getProject().addCompileSourceRoot(getSrcTarget());
@@ -546,6 +505,51 @@
                } finally {
                        Thread.currentThread().setContextClassLoader(oldCl);
                        LoggerAccess.setLoggerFactory(lf);
+               }
+       }
+
+       private void runGenerator(final File[] schemaFiles, final File[] 
producedFiles, final File[] bindingFiles) throws MojoExecutionException, 
MojoFailureException {
+               removeOldOutput(producedFiles);
+
+               Generator g = new GeneratorImpl();
+               for (int i = 0;  i < bindingFiles.length;  i++) {
+                       File f = bindingFiles[i];
+                       try {
+                               g.addBindings(new 
InputSource(f.toURL().toExternalForm()));
+                       } catch (ParserConfigurationException e) {
+                               throw new MojoExecutionException("Failed to add 
binding file "
+                                               + f.getPath() + ": " + 
e.getMessage(), e);
+                       } catch (SAXException e) {
+                               throw new MojoExecutionException("Failed to add 
binding file "
+                                               + f.getPath() + ": " + 
e.getMessage(), e);
+                       } catch (IOException e) {
+                               throw new MojoExecutionException("Failed to add 
binding file "
+                                               + f.getPath() + ": " + 
e.getMessage(), e);
+                       }
+               }
+               for (int i = 0;  i < schemaFiles.length;  i++) {
+                       final SchemaReader reader = getSchemaReaderInstance();
+                       g.setSchemaReader(reader);
+                       g.setForcingOverwrite(isForce());
+                       g.setSettingReadOnly(isReadOnly());
+                       g.setTargetDirectory(getSrcTargetDirectory());
+                       
g.setResourceTargetDirectory(getResourceTargetDirectory());
+                       g.setValidating(isValidating());
+                       if (getPackageName() != null) {
+                               g.setProperty("jaxme.package.name", 
getPackageName());
+                       }
+                       Map props = getProperties();
+                       if (props != null) {
+                               for (Iterator iter = 
props.entrySet().iterator();  iter.hasNext();  ) {
+                                       Map.Entry entry = (Map.Entry) 
iter.next();
+                                       g.setProperty((String) entry.getKey(), 
(String) entry.getValue());
+                               }
+                       }
+                       try {
+                               g.generate(schemaFiles[i]);
+                       } catch (Exception e) {
+                               throw new 
MojoExecutionException(e.getMessage(), e);
+                       }
                }
        }
 }

Modified: 
webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/site/apt/properties.apt
URL: 
http://svn.apache.org/viewcvs/webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/site/apt/properties.apt?rev=378674&r1=378673&r2=378674&view=diff
==============================================================================
--- 
webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/site/apt/properties.apt 
(original)
+++ 
webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/site/apt/properties.apt 
Fri Feb 17 17:28:00 2006
@@ -99,12 +99,12 @@
 |                   | But the "schemaReader" option allows you to have |       
                |
 |                   | a completely different schema reader class.      |       
                |
 
*-------------------+--------------------------------------------------+-----------------------+
-| schemas           | Specifies the set of input schemata, which are   | 
\<schema\>            |
+| schemas           | Specifies the set of input schemata, which are   | 
\<schemas\>           |
 |                   | being processed by the generator. You may have   |   
\<value\>           |
 |                   | multiple "schema" elements, each of which        |     
src/jaxme/*.xsd   |
 |                   | containing wildcard characters. The default      |   
\</value>           |
-|                   | "src/jaxme/*.xsd" is used, if you do not specify | 
\</schema\>           |
-|                   | any "schema" element.                            |       
                |
+|                   | "src/jaxme/*.xsd" is used, if you do not specify | 
\</schemas\>          |
+|                   | any "schemas" element.                           |       
                |
 
*-------------------+--------------------------------------------------+-----------------------+
 | sgFactoryChain    | An instance of SGFactoryChain is an object,      | 
\<sgFactoryChain\>    |
 |                   | which modifies the source generators behaviour.  |   
\<value\>           |



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to