私はEclipseでMavenプロジェクトを作成し、依存関係Rest-Assuredをpom.xmlファイルに追加しました。Eclipse でプロジェクトを右クリックして [Run As] > Maven テストを実行すると、次のエラーが表示されます。
エラー: パッケージ com.jayway.restassured が存在しません
これが私の pom.xml ファイルのスニペットです:
<dependency>
<groupId>com.jayway.restassured</groupId>
<artifactId>rest-assured</artifactId>
<version>2.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.restassured</groupId>
<artifactId>json-schema-validator</artifactId>
<version>2.4.0</version>
<scope>compile</scope>
</dependency>
<dependency>
また、スコープ「complile」を「test」に変更しましたが、同じエラーが発生しました。
[エラー] プロジェクト dpmatest で目標 org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) を実行できませんでした: コンパイルの失敗: コンパイルの失敗:
別のプロジェクトでは、スコープ 'test' を 'compile' に変更することで、Rest-Assured パッケージでコンパイルしても問題ありません。
誰かが私を助けることができますか?スコープ「テスト」と「コンパイル」の違いを説明します。
ありがとう。