Referencing file inside Jar file from fileset

View: New views
2 Messages — Rating Filter:   Alert me  

Referencing file inside Jar file from fileset

by Stephen M. Kennedy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is it possible to include a file that already exists inside a JAR?

m using  a task (hibernatetool) that takes a set of XML files to generate a database schema, however some of the XML files are contained in 3rd party JAR files.  I have a fileset like this:

<fileset dir="${java.src.dir}">
      <include name="**/*.hbm.xml"/>
<exclude name="**/*Test.hbm.xml"/>
</fileset>

Which works fine for my home grown XML files in my source tree, but I'd like to be able to avoid extracting the 3rd party XML files to include them in my sources.  Is there a way to include XML file(s) from the 3rd party JAR similar to the following:

<include name="${jar.file}/path/to/File.hbm.xml" />

Thanks in advance,
Steve

Re: Referencing file inside Jar file from fileset

by Stefan Bodewig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2009-11-03, Steve Kennedy <skennedy@...> wrote:

> Is it possible to include a file that already exists inside a JAR?

Not using <fileset>, but using <zipfileset> (a JAR is a ZIP file after
all).  Another alternative would be <javaresource> but it doesn't
support wildcard matching.

> m using a task (hibernatetool) that takes a set of XML files to
> generate a database schema, however some of the XML files are
> contained in 3rd party JAR files.

Even if this task would accept a zipfileset - I don't know whether it
does - it would have to be able to deal with non-File Resources at the
same time.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...