Open parsiya opened 4 years ago
Buildship would stop generating the .classpath
file from the build.gradle
file if there was an error. Gradle would build the jar file correctly but vscode-java could not see the dependencies and give us code completion.
In this case in Bug-Diaries I had this
sourceSets {
main {
java {
srcDir 'src'
}
resources {
srcDir 'src/resources'
}
}
}
This gives an error because src/resources
is already nested under src
. Buildship would stop. This is because the traditional Gradle project structure is:
src\main\java
src\main\resources
In the case of bug-diaries, I have everything in src
.
resources
directory under sourceSets
.sourceSets {
main {
java {
srcDir 'src'
exclude 'resources/'
}
resources {
srcDir 'src/resources'
}
}
}
Solution reference: https://bugs.eclipse.org/bugs/show_bug.cgi?id=504012
.classpath
.<classpathentry kind="lib" path="path/to/jar"/>
Write the whole journey because the next person your future self might have the same issue.
While writing down what happened, mention that doing exclude 'resources'
will not work, There will be a buildship error that says you need to do resources/
to fully exclude everything inside.