[ 
https://jira.codehaus.org/browse/MJAXB-55?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=285278#comment-285278
 ] 

Lennart Jörelid commented on MJAXB-55:
--------------------------------------

So ... you would like the configuration for the plugin to be 

{code:xml}
<configuration>
  <transformSchemas>
    <transformSchema>
      <uri>http://some/namespace</uri>
      <toPrefix>some</toPrefix>
      <toFile>some_schema</toFile>
    </transformSchema>
    <transformSchema>
      <uri>http://another/namespace</uri>
      <toPrefix>another</toPrefix>
      <toFile>another_schema</toFile>
    </transformSchema>
    <transformSchema>
      <uri>http://yet/another/namespace</uri>
      <toPrefix>yetAnother</toPrefix>
      <toFile>yet_another_schema</toFile>
    </transformSchema>
  </schemas>

  ... 

</configuration>
{code}

instead of 

{code:xml}
<configuration>
  <schemas>
    <schema>
      <uri>http://some/namespace</uri>
      <prefix>some</prefix>
      <file>some_schema</file>
    </schema>
    <schema>
      <uri>http://another/namespace</uri>
      <prefix>another</prefix>
      <file>another_schema</file>
    </schema>
    <schema>
      <uri>http://yet/another/namespace</uri>
      <prefix>yetAnother</prefix>
      <file>yet_another_schema</file>
    </schema>
  </schemas>

  ... 

</configuration>
{code}

Doable, but with more typing - and I'm not certain that it becomes more user 
friendly or less misleading. 
(What is the toPrefix of a transformSchema, as opposed to the prefix of a 
Schema?) 
I have changed the code according to your suggestion - but I don't think that 
the result is better. 
If people are in doubt about how to use the plugin, the plugin documentation 
should be well-written (and conclusive) enough to scatter any doubts.

Regarding keeping the original files:

a) The plugin should be well-written and well-tested enough that we are certain 
it does not work incorrectly. ("break the files" as you write).
   If we find that the plugin is buggy, we should be swift to provide a bug fix 
and new release. I don't think we should be keeping the original 
   files on that account. If people do not want to transform the resulting 
schema, they simply do not provide a 
   <transformSchema>...</transformSchema> configuration element - and all files 
generated by SchemaGen will be kept in their original state.

b) The stale file detection could be augmented to take the new/transformed 
filenames into consideration. I will provide a fix for this.
   It would make no sense, I believe, not to redo the transformation after a 
plugin configuration change (within one of the <transformSchema>
   elements for instance).

> Provide means to set the file name of generated XML schema
> ----------------------------------------------------------
>
>                 Key: MJAXB-55
>                 URL: https://jira.codehaus.org/browse/MJAXB-55
>             Project: Maven 2.x JAXB 2.1 Plugin
>          Issue Type: New Feature
>    Affects Versions: 1.3.1
>         Environment: All
>            Reporter: Lennart Jörelid
>            Assignee: Robert Scholte
>         Attachments: diagramAdditions_1.png, fileRenamePatch_v10.txt
>
>
> AbstractSchemagenMojo sneakily hard-codes the resulting filename for the 
> generated schema file.
> This should really be configurable; provided a parameter to set the resulting 
> file name, as well as an integration test.
> For reasons of somewhat misguided backwards compatibility, I set the default 
> value of the parameter to its currently hardcoded value, "schema1.xsd".

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to