Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法将插件目标绑定到maven生命周期阶段_Java_Maven_Aspectj_Aspectj Maven Plugin - Fatal编程技术网

Java 无法将插件目标绑定到maven生命周期阶段

Java 无法将插件目标绑定到maven生命周期阶段,java,maven,aspectj,aspectj-maven-plugin,Java,Maven,Aspectj,Aspectj Maven Plugin,我正在使用maven sql插件。在执行集成测试之前,我正在使用插件设置my test db。这是我的项目pom中的插件配置。当我执行mvn clean install时,我希望插件目标能够执行。但他们不会被处决。任何帮助都将不胜感激。对于aspectj插件(下面提供的配置),我也面临类似的问题 我的SQL插件配置: <!-- Maven SQL Plugin for setting up test schema for integration tests --> <plugi

我正在使用maven sql插件。在执行集成测试之前,我正在使用插件设置my test db。这是我的项目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 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>

org.codehaus.mojo
SQLMaven插件
1.5
${jdbc.groupId}
${jdbc.artifactId}
${jdbc.version}
org.hsqldb.jdbcDriver
jdbc:hsqldb:sample
sa
创建数据库模式
过程测试资源
执行
src/test/resources/test-schema.sql
关闭数据库实例
过程测试资源
执行
立即关闭
我的aspectj插件配置:

<!-- 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 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>

org.codehaus.mojo
aspectj maven插件
1.4
编撰
测试编译
真的
真的
org.springframework
春季方面
org.springframework.data
spring数据mongodb交叉存储
1.6
1.6

确保这些插件不是在
project/build/pluginManagement/plugins
中定义的,而是在
project/build/plugins
中定义的。
只有后者被执行,这些插件将与pluginManagement一起检查最终配置

谢谢,这真的很管用。你能解释一下两者的区别吗?你需要提高你的搜索技能;)