buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Boisvert <>
Subject Re: generate geronimo-application.xml during EAR packaging?
Date Wed, 24 Feb 2010 18:36:04 GMT
On Wed, Feb 24, 2010 at 8:37 AM, Will Rogers <> wrote:

> Buildr's EAR packaging automatically generates an application.xml and
> includes it in the output's META-INF directory. I would like to do
> something similar to generate a geronimo-application.xml for inclusion
> in the EAR. I can handle the actual file generation part, but I'm not
> sure how/where to hook that into buildr's packaging.
> Where do I stick my code for generating and including a file in the
> EAR package so it works similar to the built-in application.xml
> generation?

Haven't looked into the code recently so this is mostly a high-level idea,

class GeronimoApplicationXml < Rake::FileTask
   def initialize(*args) #:nodoc:
      enhance do |task|
        // do you stuff, "wb") { |file| file.write content }

class Buildr::Project
  def geronimo_application_xml()
    ear = package(:ear)
    descriptor = GeronimoApplicationXml.define_task(project.path_to(:target,
...), ear)
    ear.enhance [ descriptor ]
    ear.enhance do |zip|
      zip.include descriptor, :path => "..."

so in your projects where you need to generate the descriptor, you only need
to call geronimo_application_xml.   Should be easy to turn into a plugin.

Hope this helps,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message