2

我正在使用 maven sql 插件。我正在使用插件在执行集成测试之前设置我的测试数据库。这是我的项目 pom 中的插件配置。当我执行时,mvn clean install我希望插件目标能够执行。但他们没有被处决。任何帮助将不胜感激。我面临 aspectj 插件的类似问题(下面提供的配置)。

我的 SQL 插件配置:

<!-- Maven SQL Plugin for setting up test schema for integration tests -->
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>sql-maven-plugin</artifactId>
    <version>1.5</version>
    <dependencies> <!-- specify the dependent JDBC driver here -->
        <dependency>
            <groupId>${jdbc.groupId}</groupId>
            <artifactId>${jdbc.artifactId}</artifactId>
            <version>${jdbc.version}</version>
        </dependency>
    </dependencies>
    <!-- common configuration shared by all executions -->
    <configuration>
        <driver>org.hsqldb.jdbcDriver</driver>
        <url>jdbc:hsqldb:sample</url>
        <username>sa</username>
        <password></password>
    </configuration>

    <executions>
        <execution>
            <id>create_db_schema</id>
            <phase>process-test-resources</phase>
            <goals>
                <goal>execute</goal>
            </goals>
            <!-- specific configuration for this execution -->
            <configuration>
                <srcFiles>
                    <srcFile>src/test/resources/test-schema.sql</srcFile>
                </srcFiles>
            </configuration>
        </execution>
        <execution>
            <id>shutdown_db_instance</id>
            <phase>process-test-resources</phase>
            <goals>
                <goal>execute</goal>
            </goals>
            <configuration>
                <sqlCommand>SHUTDOWN IMMEDIATELY</sqlCommand>
            </configuration>
         </execution>
     </executions>
</plugin>

我的aspectj插件配置:

<!-- AspectJ Compile-time waving for spring cross-store. -->
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>aspectj-maven-plugin</artifactId>
    <version>1.4</version>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal> 
                <goal>test-compile</goal> 
            </goals>
        </execution>
    </executions>
    <configuration>
        <outxml>true</outxml>
        <showWeaveInfo>true</showWeaveInfo>
        <aspectLibraries>
            <aspectLibrary>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aspects</artifactId>
            </aspectLibrary>
            <aspectLibrary>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-mongodb-cross-store</artifactId>
            </aspectLibrary>
        </aspectLibraries>
        <source>1.6</source>
        <target>1.6</target>
    </configuration>
</plugin>
4

1 回答 1

5

确保这些插件不是在里面定义的project/build/pluginManagement/plugins,而是在 project/build/plugins. 仅执行后者,然后将使用 pluginManagement 检查这些插件以进行最终配置。

于 2013-09-01T11:12:43.117 回答