-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The gradle wrapper validator won't work in the machine without internet access #1495
Comments
@testforstephen did you try with |
YES, enable/disable offline has the same failure. When importing project, the wrapper validator will check and send a security warn about suspicious wrapper to client. Meanwhile, the GradleProjectImporter job keeps going and falls back to the default gradle distribution (e.g. 6.3) defined by buildship to import project. It looks like whatever gradle distribution you are using, the tool always needs download the corresponding binary to gradle user home. That's why the first import fails. When clicking @Override
public void update(IProject project, boolean force, IProgressMonitor monitor) throws CoreException {
if (!applies(project)) {
return;
}
JavaLanguageServerPlugin.logInfo("Starting Gradle update for " + project.getName());
Optional<GradleBuild> build = GradleCore.getWorkspace().getBuild(project);
if (build.isPresent()) {
GradleBuild gradleBuild = build.get();
boolean isRoot = isRoot(project, gradleBuild, monitor);
if (force && isRoot) {
String projectPath = project.getLocation().toFile().getAbsolutePath();
BuildConfiguration buildConfiguration = GradleProjectImporter.getBuildConfiguration(Paths.get(projectPath));
gradleBuild = GradleCore.getWorkspace().createBuild(buildConfiguration);
}
if (isRoot) {
gradleBuild.synchronize(monitor);
}
}
} |
Buildship itself is trying and failing to read the available gradle versions online |
YES, but seems it's not a blocking failure. |
Related: eclipse/buildship#998 |
Here are the download jobs during initializing gradle projects:
|
eclipse-jdtls/eclipse.jdt.ls#1486 should help |
This is especially problematic as some organizations (like mine) publish a custom, internal-only distribution of Gradle only for use behind their firewall. Buildship and JLS need to be able to support this use-case. |
@DPUkyle See https://github.com/redhat-developer/vscode-java/wiki/Gradle-Support#suspicious-gradle-wrapper-detection- |
Thank you - very useful! |
@testforstephen with eclipse-jdtls/eclipse.jdt.ls#1486 merged, the gradle validator no longer complains about the malicious wrapper, when offline. Can you check if it's good enough to close this? |
I see, the offline checksum will mitigate the gradle wrapper validator for bad network scenario. But it doesn't completely solve the offline problem. In fact, gradle wrapper doesn't really work in OFFLINE, because buildship still needs download the gradle distribution specified by the gradle-wrapper.properties from internet. In OFFLINE mode, only the local gradle home One improvement I can think of at the moment is polishing the description about the gradle user setting. For example, JLS provides three user settings about specifying a gradle distribution, but the description is not intuitive.
If the user specifies the gradle home via Another question is about the gradle security, i got new update and will sync up with you offline. |
To reproduce it with the latest CI build:
~/tooling/gradle
, local gradle user home~/.gradle
, and leave all gradle vscode settings to the default value.springbootgradledemo.zip
Trust
to continue.Both GradleProjectImporter and update project configuration failed with exception. See log.txt for more details.
The text was updated successfully, but these errors were encountered: