Java 開発者向けの Eclipse IDE (Neon) とデフォルトの Gradle プラグイン (Buildship?) が使用されます。
Gradle Git プロジェクトは、Eclipse IDE を使用して作成されました。ローカル JAR はworkspace/ProjectName/lib/nameOfJAR.jar
ディレクトリ内に保存されます。次のbuild.gradle構成を使用して、依存関係としてこのプロジェクトに追加されました。
...
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
flatDir {
dirs 'lib/'
}
}
dependencies {
// The production code uses the SLF4J logging API at compile time
compile 'org.slf4j:slf4j-api:1.7.21'
compile name: 'nameOfJAR'
// Declare the dependency for your favourite test framework you want to use in your tests.
// TestNG is also supported by the Gradle Test task. Just change the
// testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
// 'test.useTestNG()' to your build script.
testCompile 'junit:junit:4.12'
}
次に、Project Explorer > Project A > Gradle > Refresh Gradle Project
を使用して Eclipse GUI を更新し、この新しいローカル依存関係を表示しましProject Explorer > Project A > Build Path > Configure Build Path > Libraries > Project and External Dependencies > [Name of JAR]
た。
ただし、このセクションを展開すると、ソース添付ファイル、Javadoc の場所、およびネイティブ ライブラリの場所が変更不可として表示されます。これらはGradle構成ファイルから設定できますか?
これらは Eclipse と Gradle でどのように設定できますか?