このシナリオでは、cargo maven プラグイン (cargo-maven2-plugin) を使用したいと思います。
- ProjectAのUIテストに使用されるコア、ページオブジェクト、およびいくつかのステップを含むセレンテストフレームワーク(ProjectT)があります。このフレームワークには、その有効性を検証するためのいくつかの統合テスト (セレン スモーク テスト) が存在します。
- 目標は、カーゴを介してローカルの埋め込み式桟橋サーバーを実行し、ProjectA を使用して (ローカル リポジトリから) war を展開し、この実行中の ProjectA に対して ProjectT から統合テストを実行することです。
しかし、貨物を使用して ProjectA war を展開するのに問題があります。
ProjectT pom 内にプラグイン構成があります。
[...]
<dependencies>
<dependency>
<groupId>com.mefi</groupId>
<artifactId>project-a</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
[...]
<dependencies>
[...]
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.17</version>
<configuration>
<!-- Container definition -->
<container>
<containerId>jetty7x</containerId>
<type>embedded</type>
<dependencies>
<dependency>
<groupId>com.mefi</groupId>
<artifactId>project-a</artifactId>
<type>war</type>
</dependency>
</dependencies>
</container>
<configuration>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>com.mefi</groupId>
<artifactId>project-a</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>
<!-- Setting for container starting/stoping during phases. -->
<executions>
<execution>
<id>start-server</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-server</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
ProjectT から実行:
mvn org.codehaus.cargo: cargo-maven2-plugin:run -Dcargo.servlet.port=9000
エラーメッセージ:
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.17:run (default-cli) on project airtest-selenium: Artifact [com.mefi:project-a:war] is not a dependency of the project. -> [Help 1]
構築された戦争を含むアーティファクトが私のローカルリポジトリに存在します(以前に構築されました)。私も依存関係として追加しようとしました
私が欠けているものを教えてください。なぜ依存ではないのですか?