This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generate Dynamic web.xml with custom archetype

 
Chandra Sekar
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have been creating a custom archetype for maven. I want the content of web.xml of the generated projects to vary based on the groupId of the project.

Can something like this be achieved in the archetype creation itself?
 
Chandra Sekar
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh my bad!

I found the solution myself.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could find forgiveness for your sins if you would post the solution...
 
Chandra Sekar
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Johnson wrote:You could find forgiveness for your sins if you would post the solution...

Using ${groupId}, ${artifactId}, ${version} and ${package} in the files does the trick. These get replaced by the value defined for the corresponding properties during project creation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic