Maven 2.x Ant Tasks

Flattened fileset reference

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: dependencies task
  • Labels:
    None
  • Number of attachments :
    0

Description

Having the dependency fileset-reference flattened would really simplify some use of it, ie direct reference of the fileset in the lib-element of the War-task.

Activity

Hide
Jason van Zyl added a comment -

is it possible to add a flatten mapper inside the fileset with the refid, or is that an option you'd need added to the dependencies definition?

Show
Jason van Zyl added a comment - is it possible to add a flatten mapper inside the fileset with the refid, or is that an option you'd need added to the dependencies definition?
Hide
Dave Brondsema added a comment -

Use a 'build' directory to place all your files before you use the <war> task. This is good standard practice anyway, and then you can use a flatten mapper when you copy the dependencies into 'build'

Show
Dave Brondsema added a comment - Use a 'build' directory to place all your files before you use the <war> task. This is good standard practice anyway, and then you can use a flatten mapper when you copy the dependencies into 'build'
Hide
Herve Boutemy added a comment -

The fileset created by Maven Ant Tasks points to files in the local repository, which are stored with directories.
I don't see how the fileset could be directly flattened: we have to use a mapper, or something like this.
But <war><lib> doesn't support a mapper... stuck!

I looked at o.a.t.a.tasks.War class:

public void addLib(ZipFileSet fs) {
        // We just set the prefix for this fileset, and pass it up.
        fs.setPrefix("WEB-INF/lib/");
        super.addFileset(fs);
    }

instead of

// We just set the prefix for this fileset, and pass it up.
fs.setPrefix("WEB-INF/lib/");

I think

// We just set the full path for this fileset, and pass it up.
fs.setFullpath("WEB-INF/lib/");

would do what we are expecting.
The only drawback is that you can't create WEB-INF/lib subdirectories any more with <lib>: I personnally don't think it is a problem, but perhaps somebody will not be ok...

I'll look at Ant bug-tracking system to create an issue...

Show
Herve Boutemy added a comment - The fileset created by Maven Ant Tasks points to files in the local repository, which are stored with directories. I don't see how the fileset could be directly flattened: we have to use a mapper, or something like this. But <war><lib> doesn't support a mapper... stuck! I looked at o.a.t.a.tasks.War class:
public void addLib(ZipFileSet fs) {
        // We just set the prefix for this fileset, and pass it up.
        fs.setPrefix("WEB-INF/lib/");
        super.addFileset(fs);
    }
instead of
// We just set the prefix for this fileset, and pass it up.
fs.setPrefix("WEB-INF/lib/");
I think
// We just set the full path for this fileset, and pass it up.
fs.setFullpath("WEB-INF/lib/");
would do what we are expecting. The only drawback is that you can't create WEB-INF/lib subdirectories any more with <lib>: I personnally don't think it is a problem, but perhaps somebody will not be ok... I'll look at Ant bug-tracking system to create an issue...
Hide
Herve Boutemy added a comment -

found an old Bugzilla issue (10/2004) about flattening WEB-INF/lib:
http://issues.apache.org/bugzilla/show_bug.cgi?id=31947

but people did not seem to agree on the idea...
I cross-link the issues, and perhaps 2,5 years later we can talk about it once more, now that Maven is here and a Ant+Maven is a great target

Show
Herve Boutemy added a comment - found an old Bugzilla issue (10/2004) about flattening WEB-INF/lib: http://issues.apache.org/bugzilla/show_bug.cgi?id=31947 but people did not seem to agree on the idea... I cross-link the issues, and perhaps 2,5 years later we can talk about it once more, now that Maven is here and a Ant+Maven is a great target
Hide
Herve Boutemy added a comment -

this issue can't be solved by Maven: the fileset references files in the local repository, with complete directory structure.
It a problem with the Ant's war task if there is no feature to flatten the fileset when referencing it

Show
Herve Boutemy added a comment - this issue can't be solved by Maven: the fileset references files in the local repository, with complete directory structure. It a problem with the Ant's war task if there is no feature to flatten the fileset when referencing it

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: