You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When having VS Code open on a project that has a generated code srcDir, and running gradle commands from the command-line in that same folder, lock contention issues cause corrupted artifacts #344
I'm using VS Code 1.17.2 + vscode-java 0.12.0, gradle 4.2.1 to build a Java 8 SpringBoot application om macOS 10.12.6. The build uses an xjc ant task to generate .java files from a few .xsd documents in the resources directory. I've verified that in my case, 11 ObjectFactory.java files are generated, and consequently, 11 ObjectFactory.class files are compiled correctly. I would expect all of those class files to end up in my resulting .war artifact.
Current Behavior
A random number of ObjectFactory.class files end up in the .war file. To verify this, see how to reproduce below.
Context
The issue occurs when vscode is open on a project which contains a generated code folder, specified as a srcDir entry in the build.gradle, and a terminal on the same project is used to run gradle commands. It looks like gradle from the command-line is competing with vscode-java/eclipse-jdt-ls/buildship for locks on files.
Note that it has been observed that specifying options.fork in the compileJava {..} section also works around the problem, although I suspect that only happens due to timing (i.e, think this is a race condition/lock contention of sorts).