-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the generated content of xml file will be appended at xml file #196
Comments
The Same problem |
The overwrite property is only used for generated Java files. It should not affect XML files at all. XML files should always be merged. Have you configured a comment generator with suppressAllComment=true? If so, that would be the cause of this behavior. The XML merge won't delete old elements if the comments are removed. |
@jeffgbutler see my comment here #82 |
Thanks. I asked the same question...do you have suppressAllComments=true? |
Yes,I have suppressAllComments=true. And I try removing the property,then mybatis-generator whose version is 1.3.2 and 1.3.5 is normal to regenerate xml file. Thanks. @jeffgbutler But I think I don't need the autogenerated comments because they are similar. And I don't understand that the problem is related to suppressAllComments . |
The merge works by deleting the prior version of generated code. The merger uses the comments to determine what can be deleted. If you are trying to avoid extra source control commits when things haven't really changed, then use this: <commentGenerator>
<property name="suppressDate" value="true"/>
</commentGenerator> |
In other word, if ... has not comments,it won't be deleted when I regenerate code. |
... is |
This was added in version 1.31 - six years ago. So I don't really think of it as new feature. Also, it is documented on the comment generator manual page that using it will disable code merging. http://www.mybatis.org/generator/configreference/commentGenerator.html |
The same problem. Really hate the function to merge . |
I will add a plugin to disable merging of the XML files. There seems to be a lot of confusion about this. |
When I use mybatis-generator-maven-plugin whose version is 1.3.2 or 1.3.5 to generate code more than once,the genetated content of xml file will append xml file , even if I set overwrite is true.But the action is overwrite when I use the plugin whose version is 1.3.0 more than once. I think that append content of xml file at tail of xml file is not right in the new version.
ps:
IDE is Intellj IDEA 2016.2.2
maven version is 3.3.9
Java version is 1.8.0
OS is Win10
The text was updated successfully, but these errors were encountered: