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

Problem with libs.version.toml #300

Open
mghmay opened this issue Aug 11, 2024 · 2 comments
Open

Problem with libs.version.toml #300

mghmay opened this issue Aug 11, 2024 · 2 comments

Comments

@mghmay
Copy link

mghmay commented Aug 11, 2024

All I'm trying to do is run the sample and see it working. When I open up servlet/spring-boot/java/oauth2/login and try to run it I get an error stating:

java.lang.RuntimeException: org.gradle.api.InvalidUserDataException: Invalid TOML catalog definition:
  - Problem: In version catalog libs, parsing failed with 1 error.
    
    Reason: In file '...\IdeaProjects\spring-security-samples\servlet\spring-boot\java\oauth2\login\gradle\libs.versions.toml' at line 1, column 1: Unexpected '.', expected a-z, A-Z, 0-9, ', ", a table key, a newline, or end-of-input.

When I open up the libs.versions.toml I can clearly see the problem: ../../../../../../gradle/libs.versions.toml
This isn't formatted correctly but I have no idea what this libs.versions.toml file actually does. Please help new users by formatting this correctly.

@bkuntzelman
Copy link

I'm having the same issue. @mghmay I'm guessing you're also running on Windows as well? I imagine that file is supposed to be a Linux/UNIX soft link (ln -s) to reference the "root" configuration for all the samples.

As a work around, I've copied the gradle/libs.versions.toml into the various samples I want to run and it seems to work okay.

@fp024
Copy link

fp024 commented Oct 23, 2024

Even on Github's navigation screen, it really looks like a symbolic link icon.

image

In my opinion, it would be beneficial to specify the relative path of the toml file in the "settings.gradle" file of each sub-example project. This approach would ensure compatibility with OS environments other than Linux/UNIX, where symbolic links are not available.

Importing a catalog from a TOML file

dependencyResolutionManagement {
    versionCatalogs {
        libs {
            from(files("../../../gradle/libs.versions.toml"))
        }
    }
}

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

No branches or pull requests

3 participants