Skip to content
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

Configure jdtls not to automatically generate .gradle .project .settings files #3367

Open
zaiqiang-dong opened this issue Jan 23, 2025 · 1 comment

Comments

@zaiqiang-dong
Copy link

zaiqiang-dong commented Jan 23, 2025

Configure jdtls not to automatically generate .gradle .project .settings files

In my code dir, when i open a java code file, will auto generate .gradle .project .settings , how to config to diable this function and not automatically generate .gradle .project .settings files

my config

require("lspconfig").jdtls.setup({
	settings = {
		java = {
			implementationsCodeLens = { enabled = true },
			import = { -- <- this
				generatesMetadataFilesAtProjectRoot = false,
				gradle = {
					enabled = true,
					wrapper = {
						enabled = true,
					},
				},
			},
		},
	},
	init_options = {},
})

@rgrunber
Copy link
Contributor

I think I see the problem. java.import.generatesMetadataFilesAtProjectRoot is not a setting that can be passed this way. It needs to be passed in as a system property. See https://github.com/redhat-developer/vscode-java/blob/master/src/javaServerStarter.ts#L164-L167 as an example (it should be a boolean, it's a bug I think for it to imply it's a location). Is there a place in your config where you see 'java' being called ? Somewhere after that, it should be possible to add -Djava.import.generatesMetadataFilesAtProjectRoot=false .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants