Skip to content

Add generated file warning headers to velocity templates #691

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

Merged
merged 1 commit into from
May 13, 2025

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Apr 25, 2025

Add comment headers to velocity templates to indicate that the generated files should not be modified directly. The headers include information about the source template and instructions to modify the template instead of the generated file.

Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

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

OK as a temporary stopgap, but in general generated files shouldn't even be in the source repo.

@gnodet gnodet added this to the 2.0.9 milestone Apr 25, 2025
@slachiewicz
Copy link
Member

OK as a temporary stopgap, but in general generated files shouldn't even be in the source repo.

but this is template that will be used to generate files - and expectation is that generated files will have this comment included.

@cstamas
Copy link
Member

cstamas commented May 2, 2025

OK as a temporary stopgap, but in general generated files shouldn't even be in the source repo.

This is a limitation of site/doxia: it cannot process generated resources, at least not in this way. Personally, I'd get rid of this, but cannot do due Doxia/Site stuff.

@michael-o
Copy link
Member

OK as a temporary stopgap, but in general generated files shouldn't even be in the source repo.

This is a limitation of site/doxia: it cannot process generated resources, at least not in this way. Personally, I'd get rid of this, but cannot do due Doxia/Site stuff.

Not correct, it can as long as it is a supported format: https://maven.apache.org/plugins/maven-site-plugin/site-mojo.html#generatedSiteDirectory

@cstamas
Copy link
Member

cstamas commented May 3, 2025

Is markdown supported? And can i enlist the generated file in site.xml as a side menu entry?

@michael-o
Copy link
Member

Is markdown supported? And can i enlist the generated file in site.xml as a side menu entry?

Yes, that that is no problem. The structure is identical to src/site.

@cstamas
Copy link
Member

cstamas commented May 3, 2025

Yes, that that is no problem. The structure is identical to src/site.

Cool! Resolver and Maven would gladly accept a PR that is fixing this 😄

@cstamas cstamas merged commit 4921c50 into master May 13, 2025
15 checks passed
@michael-o michael-o deleted the add-generated-file-headers branch May 13, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants