Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- Source: https://dzone.com/articles/how-build-fat-jar-using
- to the build.xml file, paste the contents of the build_fat_jar.txt file before
- end tag of the main project </project>
- in line: <property name="store.jar.name" value=""/>
- in the value field, enter the name of the file you want to be generated
- WITHOUT EXTENSION and save
- then go to the Files tab, right click on
- build.xml file and select: Run Target | Other Targets | package-for-store
- ... and done
- compiled .jar package containing all linked libraries
- will be in the /store directory of the main project
- -->
- <target name="package-for-store" depends="jar">
- <!-- Change the value of this property to be the name of your JAR,
- minus the .jar extension. It should not have spaces.
- <property name="store.jar.name" value="MyJarName"/>
- -->
- <property name="store.jar.name" value="SucharOfTheDay_fat"/>
- <!-- don't edit below this line -->
- <property name="store.dir" value="store"/>
- <property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
- <echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>
- <delete dir="${store.dir}"/>
- <mkdir dir="${store.dir}"/>
- <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>
- <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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement