Implement the AddJellyXmlDeclaration recipe to add the XML declaration to Jelly files.
AddJellyXmlDeclaration.java
Implement the AddJellyXmlDeclaration class to add the XML declaration to Jelly files.
Use PlainTextVisitor to modify the content of .jelly files.
Ensure the XML declaration <?jelly escape-by-default='true'?> is present in all .jelly files.
AddJellyXmlDeclarationTest.java
Implement the AddJellyXmlDeclarationTest class to test the AddJellyXmlDeclaration recipe.
Write tests to verify the XML declaration is added to Jelly files.
Ensure tests cover cases where the declaration is already present and where it is missing.
What's your motivation?
While working on the AnchorChain plugin, I discovered that several Jelly files were missing the required XML declaration:
<?jelly escape-by-default='true'?>
According to the Jenkins documentation, when migrating the <description> tag from pom.xml to a Jelly file, this declaration is mandatory.
While there is an existing OpenRewrite recipe that handles the file creation, it doesn't address cases where the file exists but lacks the required declaration.
Anything in particular you'd like reviewers to focus on?
Anyone you would like to review specifically?
Have you considered any alternatives or workarounds?
What's changed?
Implement the
AddJellyXmlDeclaration
recipe to add the XML declaration to Jelly files.AddJellyXmlDeclaration.java
AddJellyXmlDeclaration
class to add the XML declaration to Jelly files.PlainTextVisitor
to modify the content of.jelly
files.<?jelly escape-by-default='true'?>
is present in all.jelly
files.AddJellyXmlDeclarationTest.java
AddJellyXmlDeclarationTest
class to test theAddJellyXmlDeclaration
recipe.What's your motivation?
While working on the AnchorChain plugin, I discovered that several Jelly files were missing the required XML declaration:
<?jelly escape-by-default='true'?>
According to the Jenkins documentation, when migrating the
<description>
tag frompom.xml
to a Jelly file, this declaration is mandatory.While there is an existing OpenRewrite recipe that handles the file creation, it doesn't address cases where the file exists but lacks the required declaration.
Anything in particular you'd like reviewers to focus on?
Anyone you would like to review specifically?
Have you considered any alternatives or workarounds?
Any additional context
The discussion started on the Slack Channel.
Checklist