jar files and packaging

L

lora

Hello all,

Let me ask this question even though may not be right forum.

I have an application with jar files, text files, script files, etc. I
am using ant to build my application into jars.

Now, I'd like to package it up so that it can be used on solaris.

Are there any features in ant to package up a bunch of files (some of
them are jars), but not all of them are jars?

let me know. Thanks
 
A

Arne Vajhøj

lora said:
Let me ask this question even though may not be right forum.

I have an application with jar files, text files, script files, etc. I
am using ant to build my application into jars.

Now, I'd like to package it up so that it can be used on solaris.

Are there any features in ant to package up a bunch of files (some of
them are jars), but not all of them are jars?

zip or tar ?

(ant supports both)

Arne
 
K

Knute Johnson

lora said:
Hello all,

Let me ask this question even though may not be right forum.

I have an application with jar files, text files, script files, etc. I
am using ant to build my application into jars.

Now, I'd like to package it up so that it can be used on solaris.

Are there any features in ant to package up a bunch of files (some of
them are jars), but not all of them are jars?

let me know. Thanks

I have no experience with ant but it should be no problem to jar up all
of your applications files along with an installation program that can
write your files to the appropriate places.
 
R

Ranjith

If I understand your question completely, you could use
ANT's jar task to package everything - no matter what the contents
are:
Make sure to include everything by attribute "includes" (this is not
necessary though)
 
R

Roedy Green

Are there any features in ant to package up a bunch of files (some of
them are jars), but not all of them are jars?

The ZIP task will bundle up any kind of file. You can also put any
kind of file inside a jar, as a resource with the JAR task.

To see how to use it, see http://mindprod.com/jgloss/ant.html
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Deer hunting would be fine sport, if only the deer had guns."
~ William S. Gilbert of Gilbert and Sullivan
 
L

lora

Thank you all. Here is what I meant.

I'm using ant for compilation and generation of a single application
jar. The application also includes various text files, config files,
kshell scripts, etc.

I need the ability to generate a "package" (pkgmk) that can then be
installed in another server (solaris).

Can I use ant to generate the "package"? If so, pls point me in the
right direction?


Thank you very much!
 
L

Lew

Please do not top-post.
I'm using ant for compilation and generation of a single application
jar. The application also includes various text files, config files,
kshell scripts, etc.

I need the ability to generate a "package" (pkgmk) that can then be
installed in another server (solaris).

Others have told you how to do this.
Can I use ant to generate the "package"? If so, pls point me in the
right direction?

Others have mentioned the ant 'zip' and 'jar' tasks.


Please consider trying the helpful answers others have given you.
 
R

Roedy Green

I need the ability to generate a "package" (pkgmk) that can then be
installed in another server (solaris).

Do you require some special Solaris format archive? If so, your best
bet may be to create a multiplatform zip or jar then look for a
utility to convert it to that format.


Ant is intended for multiplatform scripts, so it is unlikely to have
something specific to Solaris.

Ant does of course let you run arbitrary executables (which is how I
run the JET native compiler.) You might run some Solaris equivalent
of ZIP. For the adventurous, you can also write your own ant tasks in
Java.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Deer hunting would be fine sport, if only the deer had guns."
~ William S. Gilbert of Gilbert and Sullivan
 
L

lora

Hello,

yes, it's to be packaged on solaris. I'm looking for the proper ant
syntax to have it generate the pkgmk, package prototype, etc. for
solaris.

Thank you!
 
J

John B. Matthews

John said:
[...]
I need the ability to generate a "package" (pkgmk) that can then
be installed in another server (solaris).
The pkgmk program is a utility available on Solaris. I'm not
aware of a port, but you might ask in forum devoted to your OS.

Or if it is being packaged *on* solaris just call it via exec task.
yes, it's to be packaged on solaris. I'm looking for the proper ant
syntax to have it generate the pkgmk, package prototype, etc. for
solaris.

You should be able to use ant's Exec task:

<http://ant.apache.org/manual/CoreTasks/exec.html>

A Filter task can be used to substitute values in input files:

<http://ant.apache.org/manual/CoreTasks/filter.html>

[Please don't top-post.]
 
A

Arne Vajhøj

lora said:
John said:
[...]
I need the ability to generate a "package" (pkgmk) that can then be
installed in another server (solaris).
The pkgmk program is a utility available on Solaris. I'm not aware of a
port, but you might ask in forum devoted to your OS.
<http://www.ibiblio.org/pub/packages/solaris/sparc/html/creating.solar...>
Or if it is being packaged *on* solaris just call it via exec task.
> yes, it's to be packaged on solaris. I'm looking for the proper ant
> syntax to have it generate the pkgmk, package prototype, etc. for
> solaris.

Just call the native Solaris command that does the job via the
exec task.

Arne
 
R

Roedy Green

yes, it's to be packaged on solaris. I'm looking for the proper ant
syntax to have it generate the pkgmk, package prototype, etc. for
solaris.

That's easy if you want to do all the work with the solaris utility.
just use the exec task.

see the example at http://mindprod.com/jgloss/ant.html

<!-- J A R C H E C K -->
<exec executable="jarcheck.exe" dir="com/mindprod/converter"
output="nul:" logError="true" failonerror="true">
<arg value="converter.jar" />
<arg value="1.1" />
<arg value="1.5" />
</exec>

In ordinary bat language that would roughly be written:

E:
cd com\mindprod\converter
jarcheck.exe converter.jar 1.1 1.5 >nul:
if errorlevel 1 exit
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Deer hunting would be fine sport, if only the deer had guns."
~ William S. Gilbert of Gilbert and Sullivan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top