0

I am reworking a build, and notice that the ear file contains a Service archive file (sar). I'd like to build the sar file in Ant. I suspect I could probably use the ear or zip task to do this, and simply name the file as *.sar. However, I want to be sure that this will work.

What task would I use in Ant to create a SAR file?

David W.
  • 105,218
  • 39
  • 216
  • 337

2 Answers2

0

A sar file is a special kind of jar file (with certain files in WEB-INF, etc.). So you can use the jar task, e.g.:

<jar destfile="${sar.filename}">...</jar>
yotommy
  • 1,472
  • 1
  • 12
  • 17
0

It seems you should use the standard JAR task in ANT. According to the JBoss documentation, SAR files contain an extra file:

The following "hello world" example has a sample project attached:

Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • Thanks. I know the `ear`, `war`, and `jar`tasks are all based upon the `zip` task. I figured worse comes to worse, I can use the `zip` task -- if the `sar` is a zip type of archive. I just wanted to make sure. I thought the `ear` task would be the closest and I just set the `appxml` parameter to the `java-service.xml` file. However, I've found other examples that use the `jar` task, so that's what I'll use. – David W. Sep 13 '12 at 01:08