aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Generate Dynamic web.xml with custom archetype Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Generate Dynamic web.xml with custom archetype" Watch "Generate Dynamic web.xml with custom archetype" New topic
Author

Generate Dynamic web.xml with custom archetype

Chandra Sekar
Ranch Hand

Joined: Apr 12, 2006
Posts: 94
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?


Chandru
Chandra Sekar
Ranch Hand

Joined: Apr 12, 2006
Posts: 94
Oh my bad!

I found the solution myself.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

You could find forgiveness for your sins if you would post the solution...


JBoss In Action
Chandra Sekar
Ranch Hand

Joined: Apr 12, 2006
Posts: 94
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.
 
wood burning stoves
 
subject: Generate Dynamic web.xml with custom archetype