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

gradlew eclipse no longer works #13638

Closed
uschindler opened this issue Aug 8, 2024 · 8 comments · Fixed by #13649
Closed

gradlew eclipse no longer works #13638

uschindler opened this issue Aug 8, 2024 · 8 comments · Fixed by #13649
Assignees
Labels

Comments

@uschindler
Copy link
Contributor

Description

Hi @dweiss,
since your last cleanup, when trying to run gradlew eclipse it complains because the task does not exist. Looks ike the reason is that the root project no longer is a Java project, so the plugin is not applied. When commenting out the plugins.withType(JavaPlugin) it breaks with an NPE.

No sure how to fix this. We need the eclipse plugin ONLY on root project because we use it to create a global project.

Version and environment details

No response

@uschindler
Copy link
Contributor Author

Looks like this is caused by #13484

@uschindler
Copy link
Contributor Author

Theres also some minor issue: Since this commit, whenever I commit something to the repo it complains about line endings of versions.toml:

warning: in the working copy of 'versions.toml', CRLF will be replaced by LF the next time Git touches it

This happens after every time I execute Gradle.

@dweiss
Copy link
Contributor

dweiss commented Aug 12, 2024

Hi Uwe. Sorry, I was away on holidays. The cr-lf warning is caused by normalization in .gitattributes:

# Ignore all differences in line endings for the lock file.
versions.lock  text eol=lf
versions.toml  text eol=lf

Which git version are you using? I ask because I don't see this message. I'm also not sure how you ended up with crlfs in that file.

I'll take a look at the eclipse issue. I don't think I've changed anything that could affect it - maybe it's something indirect.

@dweiss dweiss linked a pull request Aug 13, 2024 that will close this issue
@uschindler
Copy link
Contributor Author

I will check what's wrong with my toml file. I have crlf handling completely switched off in my git config. It should not touch any line endings.

@dweiss
Copy link
Contributor

dweiss commented Aug 13, 2024

Which git version are you using? I think tidy will "clean up" those toml files by reordering them - there is a plugin for doing this. This plugin may be writing crlfs... but I don't see the warning you're getting (on Windows), which is strange!

@dweiss
Copy link
Contributor

dweiss commented Aug 14, 2024

It's the plugin that formats version catalog - versionCatalogFormatDeps task writes back the file with the default encoding/ platform line endings. I've added a post-processing step to normalize this. I'm still surprised your git version is showing a warning about it.

@dweiss
Copy link
Contributor

dweiss commented Aug 14, 2024

I compared main with 8f50976. When you list the plugins applied to the root project, it'll give you this:

class org.gradle.api.plugins.HelpTasksPlugin$Inject
class org.gradle.buildinit.plugins.BuildInitPlugin$Inject
class org.gradle.buildinit.plugins.WrapperPlugin$Inject
class org.gradle.language.base.plugins.LifecycleBasePlugin$Inject
class org.gradle.api.plugins.BasePlugin$Inject
class org.gradle.api.plugins.JvmEcosystemPlugin$Inject
class org.gradle.api.plugins.ReportingBasePlugin$Inject
class org.gradle.api.plugins.JvmToolchainsPlugin$Inject
class org.gradle.api.plugins.JavaBasePlugin$Inject
class com.palantir.gradle.versions.VersionsLockPlugin
class com.palantir.gradle.versions.VersionsPropsPlugin
class com.palantir.gradle.versions.GetVersionPlugin
class com.palantir.gradle.versions.ConsistentVersionsPlugin
class org.owasp.dependencycheck.gradle.DependencyCheckPlugin
class org.gradle.plugins.ide.eclipse.EclipsePlugin$Inject
class de.undercouch.gradle.tasks.download.DownloadTaskPlugin

whereas after removing the palantir plugins, it'll give you this:

class org.gradle.api.plugins.HelpTasksPlugin$Inject
class org.gradle.buildinit.plugins.BuildInitPlugin$Inject
class org.gradle.buildinit.plugins.WrapperPlugin$Inject
class org.gradle.language.base.plugins.LifecycleBasePlugin$Inject
class org.gradle.api.plugins.BasePlugin$Inject
class org.apache.lucene.gradle.buildinfra.BuildInfraPlugin
class com.carrotsearch.gradle.dependencychecks.DependencyChecksPlugin
class com.github.benmanes.gradle.versions.VersionsPlugin
class org.owasp.dependencycheck.gradle.DependencyCheckPlugin
class nl.littlerobots.vcu.plugin.VersionCatalogUpdatePlugin
class de.undercouch.gradle.tasks.download.DownloadTaskPlugin

I think palantir's plugin has a side-effect of applying the java conventions to the root project [1], but it's not necessary - that's why I only apply it in the eclipse task, where it is required for the jdt. I've changed java-library to java-base though, it should have a minimal surface impact.

[1] https://github.com/palantir/gradle-consistent-versions/blob/develop/src/main/java/com/palantir/gradle/versions/VersionsLockPlugin.java#L237-L239

@uschindler
Copy link
Contributor Author

I have the git version shipped with TortoiseGit (rather new one, can check later).

Basically the warning was not the most annoying thing, it was more that the file was reported as changed in the GUI, so whole repository gets red in its explorer overlay icons.

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

Successfully merging a pull request may close this issue.

2 participants