gradle を使用するプロジェクトにテスト依存関係を追加しようとしています。私が単に必要としているのは、gradle が依存関係の jar をダウンロードして、パッケージの一部をインポートできるようにすることです。必要なのは次のパッケージです。
import org.springframework.security.test.*
だから私は私のgradleファイルを含むように編集しました
dependencies {
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
runtime('org.hsqldb:hsqldb')
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile('org.springframework.security:spring-security-test') // This is what I added to try and download the new dependency
}
これを入力してからプロジェクトをビルドしてみました。残念ながら、これはうまくいきませんでした。実際にいくつかの成功を収め、次のimport org.springframework.security.test.*
ように実行できませんでした。gradlew test
Download https://repo1.maven.org/maven2/org/springframework/security/spring-security-test/4.0.3.RELEASE/spring-security-test-4.0.3.RELEASE.pom
Download https://repo1.maven.org/maven2/org/springframework/security/spring-security-test/4.0.3.RELEASE/spring-security-test-4.0.3.RELEASE.jar
どこにダウンロードされたのかわかりませんが。I ca $HOME/.gradle/caches/modules-2/files-2.1/org.springframework.security
n't see no sign of the Download package (そして Idea は外部ライブラリでそれを認識しません) に移動します。ランニングgradle build --refresh-dependencies
はうまくいかなかったようです。
どんな助けでも大歓迎です。