我試圖用下面的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