What I call dependency means that when you write code, you can't find a package, or you don't import it into the project's library. For example, the following conditions:
When I was doing testng study, I used the testng jar package, and the script in Build is as follows:
Apply plugin: ' java '
apply plugin: ' eclipse '
sourcecompatibility = 1.7
Version = ' 1.0 '
jar {
manifest {
attributes ' implementation-title ': ' Gradle Quickstart ', ' implementation-version ': Version
}
}
repositories {
mavencentral ()
}
dependencies {
compile group: ' Commons-collections ', name: ' Commons-collections ', Version: ' 3.2 '
compile ' org.testng:testng:6.8.17 '
testcompile group: ' JUnit ', name: ' JUnit ', version: ' 4.+ '
}
Test {
systemproperties ' property ': ' Value '
}
uploadarchives {
Repositories {
Flatdir {
dirs ' repos '}}
}
How do you put the jar package in a reference library similar to the following? This allows the jar package to be imported.
Solution 1
Some people say that you can use the following Script task:
Task Copyjars (type:copy) {from
configurations.runtime to
' Libs '
}
After performing this task, a Libs directory is added and our jar packages are placed in this directory:
But that's not going to solve the problem.
2.gradle Eclipse Command
In fact, the above directly knocked Gradle eclipse can be solved
D:\eclipse\workspare\testng_gradl>gradle Eclipse
: Eclipseclasspath
: Eclipsejdt
: Eclipseproject
: Eclipse
BUILD successful total
time:4.103 secs
Back to eclipse, you can see that the following changes have occurred
One more referenced Libraries, and then the mistake was gone. It is my small white, alas, ashamed AH