Last active
March 10, 2019 12:23
-
-
Save ezhov-da/4860ee981d2a80c15f2bc898b7168f3a to your computer and use it in GitHub Desktop.
java ant сборка проекта в один jar через netbeans
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://mavistechchannel.wordpress.com/2010/08/17/how-to-build-a-single-jar-file-with-external-libs/ | |
[code:]xml[:code] <target name="package-for-store"> | |
<echo message="Run create one jar"/> | |
<property name="store.jar.name" value="${application.title}"/> | |
<property name="store.dir" value="${dist.dir}"/> | |
<property name="store.jar" value="${dist.jar}"/> | |
<echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/> | |
<jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip"> | |
<zipgroupfileset dir="dist" includes="*.jar"/> | |
<zipgroupfileset dir="dist/lib" includes="*.jar"/> | |
<manifest> | |
<attribute name="Main-Class" value="${main.class}"/> | |
</manifest> | |
</jar> | |
<delete file="${dist.jar}"/> | |
<zip destfile="${store.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> | |
[/code] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment