Hibernate 在maven中执行的插件中包含依赖项时出错

Hibernate 在maven中执行的插件中包含依赖项时出错,hibernate,maven,maven-3,maven-plugin,Hibernate,Maven,Maven 3,Maven Plugin,如果我直接执行mvn目标mvn hibernate3:hbm2java,我有以下pom.xml文件可以使用。现在,我想让它成为生成实体阶段执行的一部分。我在插件中包含了一些依赖项 这是正在工作的pom <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>hibernate3-maven-

如果我直接执行mvn目标mvn hibernate3:hbm2java,我有以下pom.xml文件可以使用。现在,我想让它成为
生成实体
阶段执行的一部分。我在插件中包含了一些依赖项

这是正在工作的pom

   <plugins>
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>hibernate3-maven-plugin</artifactId>
           <version>2.2</version>
             <configuration>
               <components>
                 <component>
                   <name>hbm2java</name>
                   <implementation>jdbcconfiguration</implementation>
                   <outputDirectory>src/main/java</outputDirectory>
                 </component>
               </components>
               <componentProperties>
                 <revengfile>src/main/resources/reveng.xml</revengfile>
                 <propertyfile>src/main/resources/hibernate.properties</propertyfile>
                 <packagename>com.whatever.domain</packagename>
                 <jdk7>true</jdk7>
                 <ejb3>true</ejb3>
               </componentProperties>
             </configuration>
             <dependencies>
               <dependency>
                 <groupId>cglib</groupId>
                 <artifactId>cglib-nodep</artifactId>
                 <version>2.2.2</version>
               </dependency>
               <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.22</version>
        </dependency>
             </dependencies>
           </plugin>
        </plugins>
如“”所述,
依赖项
标记仅在
插件
级别可用,而在
执行
级别不可用,如下例所示:-


某集团
一些人工制品
一些版本
...
某个依赖组
一些依赖工件
某些依赖版本
<plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>hibernate3-maven-plugin</artifactId>
                <version>2.2</version>
                <executions>
                    <execution>
                        <id>generate-entity</id>
                        <phase>generate-entity</phase>
                        <goals>
                            <goal>hbm2ddl</goal>
                        </goals>
                        <configuration>
                            <components>
                                <component>
                                    <name>hbm2hbmxml</name>
                                    <implementation>jdbcconfiguration</implementation>
                                    <outputDirectory>src/main/java</outputDirectory>
                                </component>
                                <component>
                                    <name>hbm2java</name>
                                    <implementation>jdbcconfiguration</implementation>
                                    <outputDirectory>src/main/java</outputDirectory>
                                </component>
                            </components>
                            <componentProperties>
                                <revengfile>src/main/resources/reveng.xml</revengfile>
                                <propertyfile>src/main/resources/hibernate.properties</propertyfile>
                                <packagename>com.whatever.domain</packagename>
                                <jdk7>true</jdk7>
                                <ejb3>true</ejb3>
                            </componentProperties>
                        </configuration>
                        <dependencies> --- Eclipse shows errors here
                            <dependency>
                                <groupId>cglib</groupId>
                                <artifactId>cglib-nodep</artifactId>
                                <version>2.2.2</version>
                            </dependency>
                            <dependency>
                                <groupId>mysql</groupId>
                                <artifactId>mysql-connector-java</artifactId>
                                <version>5.1.22</version>
                            </dependency>
                        </dependencies>
                    </execution>
                </executions>
            </plugin>
        </plugins>