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

build: Fix licence check #694

Merged
merged 3 commits into from Jul 26, 2023
Merged

build: Fix licence check #694

merged 3 commits into from Jul 26, 2023

Conversation

saig0
Copy link
Member

@saig0 saig0 commented Jul 25, 2023

Description

  • Fix the license Maven plugin configuration
  • Adjust the build pipeline to check for license headers
  • Add missing license headers

Related issues

Move the configuration of the license plugin into the plugin management section to override the parent POM.

Create two profiles: one profile for adding license headers and apply formatting, and another profile for only checking if license headers are present.

The second profile is used in the CI. The first profile is used by default for local development.
The missing license headers were generate using the licence Maven plugin.
@saig0 saig0 requested a review from korthout July 25, 2023 12:46
@saig0
Copy link
Member Author

saig0 commented Jul 25, 2023

@korthout just a small fix in the build to enable the license plugin again. Please have a look when you have time. 🍪

Copy link
Member

@korthout korthout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool stuff! ©️

LGTM 👍

Comment on lines +416 to +418
<activation>
<activeByDefault>true</activeByDefault>
</activation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 One thing to remember with activeByDefault is that it will be deactivated automatically when any other profile is activated. I always thought this was unexpected. There exist some solutions to deal with this (I personally like activeProfile best), if you wish to take that route.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know. Thank you for the hint. 👍

run: mvn -B clean verify com.mycila:license-maven-plugin:check
run: mvn -B clean -P !autoFormat,checkFormat verify
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 With activeByDefault you don't need to disable the autoFormat profile. Simply by activating the checkFormat profile, the autoFormat profile will already be disabled.

The autoFormat profile is activated by default. If the checkFormat profile is enabled, the default profile is disable.
@saig0 saig0 merged commit 5385803 into main Jul 26, 2023
4 of 5 checks passed
@saig0 saig0 deleted the licence-check branch July 26, 2023 04:31
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

Successfully merging this pull request may close these issues.

None yet

2 participants