Java hits a third-party jar package into the main program to form a runnable jar (RPM)

Source: Internet
Author: User
Tags echo message

File page, locate the Build.xml file, open the </project> before adding the following code to save the

    <target name= "Package-for-store" depends= "jar" > <!--Change the value of the of your jar, minus the. jar extension.             It should not has spaces. <property name= "Store.jar.name" value= "Myjarname"/>---<property name= "Store.jar.name" value= "S Witchhexandchinese "/> <!--don ' t edit below this line-to <property name=" Store.dir "value=" stor E "/> <property name=" Store.jar "value=" ${store.dir}/${store.jar.name}.jar "/> <echo message=" Pack Aging ${application.title} to a single JAR at ${store.jar} "/> <delete dir=" ${store.dir} "/> <mk Dir dir= "${store.dir}"/> <jar destfile= "${store.dir}/temp_final.jar" filesetmanifest= "Skip" > &L            T;zipgroupfileset dir= "Dist" includes= "*.jar"/> <zipgroupfileset dir= "dist/lib" includes= "*.jar"/> <manifest> <attribute NAMe= "Main-class" value= "${main.class}"/> </manifest> </jar> <zip destfile= "${sto Re.jar} "> <zipfileset src=" ${store.dir}/temp_final.jar "excludes=" meta-inf/*. SF, meta-inf/*. DSA, meta-inf/*. RSA "/> </zip> <delete file=" ${store.dir}/temp_final.jar "/> </target>

Build.xml right-click to package Build Switchhexandchinese.jar

The resulting file

Java hits a third-party jar package into the main program to form a runnable jar (RPM)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.