add attributes to manifest.mf file in jar

I am building a java applet using ant and a build.xml file. The part of the build file that builds the
jar file is:
<target name="applet-jar" description="Build Applet Jar" depends="compile">
      <genjar jarfile="${intranet-dir}\Code\ClientApplet.jar">
            <class name="TelAc.JessClient.ClientApplet" />
            <library jar="${intranet-dir}\Code\JavaLib\xml_parser.jar" />
            <classpath refid="jess-classpath" />
      </genjar>
</target>

the manifest.mf file is created automatically for the jar.  I need to add a couple attributes to the
manifest, such as Permissions and CodeBase, but don't know how to do this.  I running apache-ant-1.6.3.
dhenderson12Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
You might find you need to sign that jar, even though it's on your own network.

Anyway, you will find the manifest can be more comprehensively handled using the Ant Manifest task
Jim CakalicSenior Developer/ArchitectCommented:
Maybe the Ant Manifest Task will help?

Jim

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CEHJCommented:
btw you can make your life simpler by using forward slashes throughout. They will never be wrong
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

dhenderson12Author Commented:
thanks for answers!  where will I place this section and how would I call it?
CEHJCommented:
Firstly, where did you get 'genjar' from? That's not a standard task
dhenderson12Author Commented:
i tried the manifest task and got this error:
Class org.apache.tools.ant.taskdefs.optional.genjar.Mft doesn't support the "file" attribute.
CEHJCommented:
You're still using non-standard tasks by the looks
dhenderson12Author Commented:
sorry, but I don't understand.  building the jar file works just fine with the xml I provided in the question.  how would I upgrade this to support the file attribute?  I have already installed ant 1.9.3, but I need some guidance here.
dhenderson12Author Commented:
btw, here is my modified task to build the jar file:
<!-- Target: applet-jar -->
      <target name="applet-jar" description="Build Applet Jar" depends="compile">
            <genjar jarfile="${intranet-dir}\Code\ClientApplet.jar">
                  <manifest file="MANIFEST.MF">
                                        <attribute name="Built-By" value="${user.name}"/>
                                        <section name="common">
                                                <attribute name="Specification-Title" value="Example"/>
                                              </section>
                        </manifest>
                  <class name="TelAc.JessClient.ClientApplet" />
                  <library jar="${intranet-dir}\Code\JavaLib\xml_parser.jar" />
                  <classpath refid="jess-classpath" />
            </genjar>
      </target>
CEHJCommented:
sorry, but I don't understand.
'Non-standard' == not standard

Show me the documentation, please for the task 'genjar'. If for some reasons you can't, then you have problems.
dhenderson12Author Commented:
I KNOW what non-standard means, I was referring to task I posted.  This existed long before I had to deal with it (the whole ant build.xml file).  I'm not an apache guru and I'm looking for some guidance here.  This was built for ant 1.6.3, so my assumption was that these were standard tasks.  guess I'll just have to keep digging.
CEHJCommented:
I would strongly advise you to turn non-standard tasks into standard ones if the former are not well-documented to you.
dhenderson12Author Commented:
ok, I figured it out ... I was over-complicating all of this.  all I needed to do was add the <manifest></manifest> tags inside the build jar task and add the attributes.  works like a charm.  thanks to everyone for their time.
CEHJCommented:
all I needed to do was add the <manifest></manifest> tags inside the build jar task

So you DID use the standard task then

I wonder why you marked as the accepted answer, one that repeated mine..?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.