2

私は統合前と統合後のフェーズをmavenと連携させようとしていますが、役に立ちません。私の目標は、必要なバイナリをいくつか実行して、統合テストをセットアップおよび破棄することです。antrun-pluginとでテストしてexec-pluginいますが、どれもメッセージを出力しません。

私は走っていmvn verifyます。プラグインをcleanフェーズにバインドして実行するmvn cleanと、エコー メッセージとlsが表示されます。

どうしたの?私はmaven3を使用しています

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.12.3</version>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>verify</id>
                        <goals>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>ls</executable>
                    <arguments>
                        <argument>-la</argument>
                    </arguments>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>xxx</id>
                        <configuration>
                            <target>
                                <echo>Cleaning deployed website</echo>
                            </target>
                        </configuration>

                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
4

1 に答える 1

0

私は他の誰かが以前に正しく設定されたフェイルセーフ プラグインを取得するのを手伝いました。フェイルセーフ プラグインの実行でフェーズを明示的に指定してみてください。フェイルセーフプラグインのドキュメントでは、デフォルトで目標が正しいフェーズにバインドされているとされているため、なぜそれが必要なのかはわかりませんが、そうであるようです。

于 2012-09-13T15:39:08.673 に答える