Open niiiksh opened 6 years ago
same problem, does it fixed?
My problem was that the promt showed build failed but if i click on proceed it work just fine. to remove the annoying promt all i did was: Go to java extension pack-> click on any extension settings icon -> click extension settings -> uncheck (Java › Debug › Settings: Force Build Before Launch)
I hope this answer helps
Same problem , couldn't fix it
Damn, this issue is now over 3 years old, still getting notifications on this
I am getting a buildpath incomplete error on a multi-project build on Quartz. Short version:
Same error posted above.. Has anyone found a way to debug or printout what the compiler is doing?
@n614cd could you, please, attach a project example?
@snjeza
Unfortunately this is private code I am working with. I have tried to strip the project down multiple ways (such as removing the java source files). Once I strip the code from the project (I have tried to remove test code, all code, core libraries...). I am no longer getting the error. Which leads me to believe that the problem is less likely with the build itself, and more likely with some hidden error. Hence why I am trying to work it now before it somehow raises an issue in production.
Tim
If a maven module uses Lombok, it will build failed.
I had the same issue but when i deleted the java file containing error in that same folder where current java file is, then warning disappeared. you can also try to delete the file or correct the code in the folder your are working in they error should disappear.
This solve my problem. In my case, I'm using Vscode for developing in Java. For previous configurations (when I was studing Python) VSCode did create a .history folder containing versions of the code. Deleting that folder I could solve the problem.
Thanks!
@DoganM95
I guess you are trying to compile a .java file in a folder hierarchy where other .java files exist and have errors. check your "problems" tab and see if there are any. if so, the project will probably show the error message until all problems are resolved. After that you should stop getting the "Build failed..." Message.
@snjeza I manage to provide a sample project (like @n614cd) which showcases the issue. Please have a look at https://github.com/a-st/vscode-java-issue-495
After opening the project, vscode shows following problems
@a-st This is an upstream buildship issue - https://github.com/eclipse/buildship/issues/1131 You can try the following patch:
diff --git a/app_a/build.gradle b/app_a/build.gradle
index def2540..2305e10 100644
--- a/app_a/build.gradle
+++ b/app_a/build.gradle
@@ -1,6 +1,7 @@
plugins {
id 'java'
id "org.springframework.boot"
+ id "eclipse"
}
dependencies {
@@ -9,4 +10,19 @@ dependencies {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter', version: '2.7.5'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.7.5'
-}
\ No newline at end of file
+}
+
+eclipse {
+ classpath {
+ containsTestFixtures = true
+ file {
+ whenMerged {
+ cp -> cp.getEntries().forEach{
+ cpEntry -> if(cpEntry.kind=='src') {
+ cpEntry.output = cpEntry.output.replace('bin/', 'build/classes/java/')
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/module_a/build.gradle b/module_a/build.gradle
index aeb004d..92d39bc 100644
--- a/module_a/build.gradle
+++ b/module_a/build.gradle
@@ -1,6 +1,22 @@
apply plugin: 'java-library'
+apply plugin: 'eclipse'
dependencies {
testImplementation project (':module_b').sourceSets.test.output
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.7.5'
+}
+
+eclipse {
+ classpath {
+ containsTestFixtures = true
+ file {
+ whenMerged {
+ cp -> cp.getEntries().forEach{
+ cpEntry -> if(cpEntry.kind=='src') {
+ cpEntry.output = cpEntry.output.replace('bin/', 'build/classes/java/')
+ }
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/module_b/build.gradle b/module_b/build.gradle
index 20a07af..ab40b96 100644
--- a/module_b/build.gradle
+++ b/module_b/build.gradle
@@ -1,5 +1,21 @@
apply plugin: 'java-library'
+apply plugin: 'eclipse'
dependencies {
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.7.5'
+}
+
+eclipse {
+ classpath {
+ containsTestFixtures = true
+ file {
+ whenMerged {
+ cp -> cp.getEntries().forEach{
+ cpEntry -> if(cpEntry.kind=='src') {
+ cpEntry.output = cpEntry.output.replace('bin/', 'build/classes/java/')
+ }
+ }
+ }
+ }
+ }
}
\ No newline at end of file
Building Java project shows error: "Build failed, do you want to continue?" when the build is actually completed because when I click "Proceed" it will run updated version of my code and autobuild enabled when I type new code. javatest.zip
Environment
Steps To Reproduce
javatest.zip
.log
Current Result
Build error
Expected Result
No error
Additional Informations
I have another project built with this extension and it builds without any error.