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

Spotless fails with You need to specify 'delimiter'. #2265

Open
obfischer opened this issue Sep 18, 2024 · 1 comment
Open

Spotless fails with You need to specify 'delimiter'. #2265

obfischer opened this issue Sep 18, 2024 · 1 comment

Comments

@obfischer
Copy link

Running the Spotless Maven plugin with the following configuration leads to the message:

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.43.0:apply (default-cli) on project demo: Execution default-cli of goal com.diffplug.spotless:spotless-maven-plugin:2.43.0:apply failed: You need to specify 'delimiter'. -> [Help 1]

Plugin configuration:

<plugin>
    <groupId>com.diffplug.spotless</groupId>
    <artifactId>spotless-maven-plugin</artifactId>
    <version>2.43.0</version>
    <configuration>
        <java>
            <palantirJavaFormat>
                <version>2.50.0</version>
                <style>PALANTIR</style>
                <formatJavadoc>false</formatJavadoc>
            </palantirJavaFormat>
            <formatAnnotations/>
        </java>
        <licenseHeader>
            <content>
                /* Foobar */
            </content>
        </licenseHeader>
        <json>
            <jackson>
                <version>2.14.1</version>    <!-- optional: The version of 'com.fasterxml.jackson.core:jackson-databind' to be used -->
                <features>                   <!-- optional: Customize the set of features (based on com.fasterxml.jackson.databind.SerializationFeature) -->
                    <INDENT_OUTPUT>true</INDENT_OUTPUT>                            <!-- optional: true by default -->
                    <ORDER_MAP_ENTRIES_BY_KEYS>false</ORDER_MAP_ENTRIES_BY_KEYS>   <!-- optional: false by default -->
                </features>
                <jsonFeatures>
                    <QUOTE_FIELD_NAMES>false</QUOTE_FIELD_NAMES>                   <!-- false by default -->
                </jsonFeatures>
                <!-- any JsonGenerator.Feature can be toggled on or off -->
                <spaceBeforeSeparator>false</spaceBeforeSeparator>               <!-- optional: false by default -->
            </jackson>
        </json>

    </configuration>
</plugin>

The plugin runs fine if I remove the JSON section.

Maven version: 3.9.8
Java version: 22.0.1
OS: Darwin Olivers-MBP.fritz.box 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6030 arm64

@obfischer
Copy link
Author

Ok, the field delimiter is needed for the licence head configuration. Although it is confusing for an unexperienced user of Spotless, as this field must be only set in certain configurations.

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

1 participant