[GRADLE-282] Inconsistent API for WAR resp. archive tasks Created: 24/Oct/08  Updated: 04/Jan/13  Resolved: 24/Nov/10

Status: Resolved
Project: Gradle
Affects Version/s: 0.4
Fix Version/s: 0.9-rc-1

Type: Bug
Reporter: Martin Vlcek Assignee: Tom Eyckmans
Resolution: Fixed Votes: 0


 Description   

The naming and behavior of the archive task methods is confusing:

  • to set the (basic) content of the archive: resourceCollections = [ new FileSet(...), ... ]
  • to add one resourceCollection: fileSet(dir: ...)
  • (WAR) to set the class files: classesFileSets = [ new FileSet(...), ... ]
  • (WAR) there is no analogon classesFileSet(dir: ...) to fileSet(dir: ...)
  • (WAR) there is no method to set the webAppDir, although the convention object has a webAppDirName
  • (WAR) property additionalLibFileSets but method additionalLibs instead of additionalLibFileSet

When used with the libs

{ war(...) }

of the WarPlugin for a second war file (e.g. mockup of a web service) this means that

  • do not use fileSet(dir: new File(projectDir, mockWebAppDirName)) --> you will get two web directories (this and the one from the conventions object)
  • use resourceCollections = [ new FileSet(new File(projectDir, mockWebAppDirName)) ] instead for the file sets
  • use classesFileSets = [ ... ] for the class files

Suggestions:

  • for WAR have a webAppDir = ... which overwrites default/inherited values
  • add an "alias" fileSets for resourceCollections in the archive tasks
  • for WAR add methods classesFileSet analog to fileSet of archive tasks
  • for WAR do the same webInfFileSets
  • for WAR rename additionalLibs to additionalLibFileSet
  • ,,,


 Comments   
Comment by Hans Dockter [ 15/Apr/09 ]

Tom plans to rewrite the war task for 0.7 (and implement an ear task).

Comment by Adam Murdoch [ 24/Mar/10 ]

Can we close this, given we have reworked the archive task APIs, and the war task is now consistent with the other archive tasks?

Generated at Wed Jun 30 11:26:12 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.