To use the Web project to MyBatis, you need to use MyBatis's auto-generated code plug-in, and the configuration build section is as follows:
1 <Build>2 <pluginmanagement></pluginmanagement>3 <Plugins>4 <plugin>5 <Artifactid>Maven-war-plugin</Artifactid>6 </plugin>7 <plugin>8 <Artifactid>Maven-compiler-plugin</Artifactid>9 <Configuration>Ten <Source>1.6</Source> One <Target>1.6</Target> A </Configuration> - </plugin> - <plugin> the <groupId>Org.mybatis.generator</groupId> - <Artifactid>Mybatis-generator-maven-plugin</Artifactid> - <version>1.3.2</version> - <executions> + <Execution> - <ID>Mapper-generate</ID> + <Phase>Generate-resources</Phase> A <Goals> at <goal>Generate</goal> - </Goals> - </Execution> - </executions> - <Dependencies> - <Dependency> in <groupId>Org.mybatis.generator</groupId> - <Artifactid>Mybatis-generator-core</Artifactid> to <version>1.3.2</version> + </Dependency> - </Dependencies> the <Configuration> * <verbose>True</verbose> $ <Overwrite>True</Overwrite>Panax Notoginseng <ConfigurationFile>Src\main\resources\generatorconfig.xml</ConfigurationFile> - </Configuration> the </plugin> + </Plugins> A </Build>
Execution the error in the label at the following details:
Error content:
Plugin execution not covered by lifecycle configuration:org.mybatis.generator:mybatis-generator-maven-
Plugin:1.3.2:generate (Execution:mapper-generate, phase:generate-resources)
Workaround:
<plugins> label outside and set a <pluginManagement> label solution
MyEclipse Import Maven Project error Plugin execution not covered by lifecycle configuration: