slachiewicz opened a new issue, #1088:
URL: https://github.com/apache/maven-archetype/issues/1088

   Velocity Engine 2.5 deprecates the `parser.allow_hyphen_in_identifiers` 
option
   ([VELOCITY-995](https://issues.apache.org/jira/browse/VELOCITY-995)), and 
its warning says that
   hyphenated identifiers cannot be expressed in the next major version. 
Archetype turns that option
   on in two places, so it needs a decision before that version arrives.
   
   ### Where the option is set
   
   - 
[ArchetypeVelocityEngine.java:69](https://github.com/apache/maven-archetype/blob/master/archetype-common/src/main/java/org/apache/maven/archetype/ArchetypeVelocityEngine.java#L69),
     for rendering archetype templates.
   - 
[DefaultArchetypeGenerationConfigurator.java:337](https://github.com/apache/maven-archetype/blob/master/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/generation/DefaultArchetypeGenerationConfigurator.java#L337),
     for evaluating the default values of required properties.
   
   It was added on purpose. Velocity 2 stopped accepting `-` in identifiers, 
which broke archetypes
   whose required properties have hyphenated names, and #703 with #230 restored 
that behavior.
   
   ### What changes with Velocity 2.5
   
   Nothing breaks. With the Velocity pin moved from 2.4.1 to the 2.5 release 
candidate, the unit
   tests and the 22 integration tests pass. Every engine start now logs this 
warning, which
   `archetype:generate` shows as a `[WARNING]` line:
   
       the 'parser.allow_hyphen_in_identifiers' option is deprecated: 
hyphenated identifiers
       (e.g. $foo-bar) cannot be expressed in the next major version
   
   Two more warnings appear for every Velocity user on default settings (the 
deprecation switch
   itself, and lenient math). Those are not specific to this project.
   
   ### Options
   
   1. Keep the option while Archetype is on Velocity 2.x and accept the 
warning. Archetypes with
      hyphenated property names keep working; the question returns with the 
next Velocity major.
   2. Deprecate hyphenated property names in Archetype now: warn when an 
archetype declares or
      references one, document the replacement, and remove the support in a 
later major release of
      the plugin. This gives archetype authors notice before Velocity forces 
the change.
   3. Both: keep the option, and add the Archetype-side warning so that the 
Velocity warning has an
      actionable counterpart.
   
   Option 3 looks like the least disruptive path. Whether the Velocity warning 
should be silenced
   for users whose archetypes do not use hyphens is a separate question, since 
the option is set
   unconditionally today.
   
   Not checked: how common hyphenated property names are in published 
archetypes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to