1. 程式人生 > >maven package 打包時,執行 mybatis-generator-maven-plugin 外掛問題

maven package 打包時,執行 mybatis-generator-maven-plugin 外掛問題

maven package打包時,會自動執行 mybatis-generator-maven-plugin 外掛,導致mapper對映檔案被追加而出現錯誤,

實體也會被覆蓋。

在pom.xml的mybatis-generator-maven-plugin外掛中設定

<executions>
    <execution>
        <id>Generate MyBatis Artifacts</id>
        <phase>deploy</phase>
        <goals>
            <goal>
generate</goal> </goals> </execution> </executions>
設定phase為deploy