我试图用下面的pom部分向我的maven生命周期添加一个目标。我定义了一个新的插件,并使用相位和执行信息进行配置。为什么我的Maven插件不能在构建生命周期中运行?
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>2.2.0</version>
<configuration>
<includes>**/entity/*.class</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<connectionDriverName>com.ibm.db2.jcc.DB2Driver</connectionDriverName>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
<sqlFile>${project.build.directory}/database.sql</sqlFile>
</configuration>
<executions>
<execution>
<id>sql</id>
<phase>generate-resources</phase>
<goals>
<goal>sql</goal>
</goals>
</execution>
<execution>
<id>enhancer</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
然后我用mvn:install
运行maven但是插件没有运行?
@帕 - thivent任何想法的建设 - >插件部分? – Kayser
默认情况下,sql mojo绑定到“进程类”阶段。 也许这个目标不起作用,因为你试图在构建生命周期中过早运行它? – wemu
只是在尝试获取插件时遇到一个主要的问题。它被定义了两次,第二个定义覆盖了第一个定义。 – doc