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

Newline is not default #6

Open
uyw4687 opened this issue Sep 17, 2023 · 3 comments
Open

Newline is not default #6

uyw4687 opened this issue Sep 17, 2023 · 3 comments

Comments

@uyw4687
Copy link
Contributor

uyw4687 commented Sep 17, 2023

Many java projects have one newline after the copyright statement, however, license-maven-plugin doesn't support this feature.
Simple hack is possible by adding newline to endLine but this doesn't ensure just 'one' newline is added since the plugin just adds in the position, not checking the newline.

mathieucarbou/license-maven-plugin#78

@uyw4687 uyw4687 changed the title Newline is not supported in license-gradle-plugin-git Newline is not supported default Sep 17, 2023
@uyw4687 uyw4687 changed the title Newline is not supported default Newline is not supported by default Sep 17, 2023
@uyw4687 uyw4687 changed the title Newline is not supported by default Newline is not default Sep 17, 2023
@uyw4687
Copy link
Contributor Author

uyw4687 commented Sep 17, 2023

However this problem is not fatal since we can override the setting as follows

    license {
        headerDefinitions.add(
                HeaderDefinitionBuilder.headerDefinition("slashstar_style")
                        .withFirstLine("/*")
                        .withBeforeEachLine(" * ")
                        .withEndLine(" */\n")
                        .withAfterEachLine("")
                        .withSkipLinePattern(null)
                        .withFirstLineDetectionDetectionPattern("(\\s|\\t)*/\\*.*\$")
                        .withLastLineDetectionDetectionPattern(".*\\*/(\\s|\\t)*\$")
                        .multiline()
        )
    }

and the previous false newlines are overridden by new application(when the previous statement becomes old when the new year comes.)

@uyw4687
Copy link
Contributor Author

uyw4687 commented Sep 17, 2023

cc @minwoox

@uyw4687
Copy link
Contributor Author

uyw4687 commented Sep 18, 2023

created a PR mathieucarbou/license-maven-plugin#629

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