MorrisLLC/grunt-war

Specify complete web.xml file to be used

Closed this issue · 2 comments

I'm afraid I don't know enough about grunt-tasks yet to create a pull-request for this, but I'm assuming it might be quite simple? I was hoping it might be possible to specify a raw web.xml file that could be included in the WAR file. I have some relatively complex requirements for my web.xml file, which would most legibly be included in my project by putting them into a proper web.xml file, rather than by specifying all the properties in the Gruntfile.js file. Would this be possible to implement, please?

Martin - give 0.3.1 a whirl.

I added options.webxml which takes a function that returns the contents that will become the web.xml file. You can return a hard coded string, the contents of a file, etc. I added some docs to the readme.md about it.

Example:

options: {
...
webxml: function (opts) { return 'raw string that will be the contents of the web.xml'; };
...
},

Close this out if this solution works for you.

Got it working perfectly with ...

webxml: function() {
    return fs.readFileSync('resources/web.xml');
}

Thank you!