How can we add additional parameters to manifest file using Maven to third party jars. After Java 7_25 version the Java web start requires codebase and permissions to be add in all downloading jar files. I want to insert them jar singing time.
Please let me know if you need any information. Thanks in advance.
i made a little ant script (this is an extract, in fact it also excludes some crypto file).
just set directory property value to a directory that contains jars to be updated and launch the target "give-permissions".
it should be easy to use with maven-ant:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="project">
    <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
    <property name="directory" value="WebContent/jnlpApplication" />
    <target name="give-permissions">
        <foreach target="_re-jar" param="currentFile" parallel="false">
            <path>
                <fileset dir="${directory}" casesensitive="yes">
                    <include name="**/*.jar" />
                </fileset>
            </path>
        </foreach>
        <move todir="${directory}" overwrite="true">
            <fileset dir="${directory}.tmp" casesensitive="yes">
                <include name="**/*.jar" />
            </fileset>
        </move>
        <delete dir="${directory}.tmp" />
    </target>
    <target name="_re-jar">
        <basename property="filename" file="${currentFile}" />
        <jar destfile="${directory}.tmp/${filename}">
            <zipfileset src="${currentFile}">
                <exclude name="META-INF/**.RSA" />
                <exclude name="META-INF/**.SF" />
            </zipfileset>
            <manifest>
                <attribute name="Permissions" value="all-permissions" />
                <attribute name="Codebase" value="*" />
                <attribute name="Application-Name" value="jnlpApplicationName" />
            </manifest>
        </jar>
    </target>
</project>
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With