Refactoring: all jars to include in the generated JNLP are now signed in the maven.abbot.dest.jar.dir and the JNLP generation logic scans all jars in this directory for inclusion
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115971 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -131,7 +131,7 @@
|
||||
<!-- We make a jar with compiled main class -->
|
||||
<!-- TODO: create this as part of the plugin creation and not as part of
|
||||
its execution -->
|
||||
<jar destfile="${maven.abbot.dest.dir}/${maven.abbot.webstart.main.jar}"
|
||||
<jar destfile="${maven.abbot.dest.jar.dir}/${maven.abbot.webstart.main.jar}"
|
||||
basedir="${plugin.dir}" includes="**/*.class"/>
|
||||
|
||||
<!-- Iterating through dependencies, and signing them if they're not up-to-date -->
|
||||
@@ -145,35 +145,39 @@
|
||||
|
||||
<!-- Checking whether or not the dependency has to be signed -->
|
||||
<uptodate property="${varname}"
|
||||
srcfile="${plugin.getDependencyPath(dep.Id)}"
|
||||
targetfile="${maven.abbot.dest.dir}/${filename}.jar"/>
|
||||
srcfile="${plugin.getDependencyPath(dep.Id)}"
|
||||
targetfile="${maven.abbot.dest.dir}/${filename}.jar"/>
|
||||
|
||||
<!-- Keeping this debug trace a while to ensure that the up-to-date feature is working properly -->
|
||||
<echo level="debug">${dep.id} is uptodate ? ${context.getVariable(varname) == true}</echo>
|
||||
|
||||
<!-- Signing the dependancy only if it is not up-to-date or forced-->
|
||||
<!-- Signing the dependency only if it is not up-to-date or forced -->
|
||||
<j:if test="${(context.getVariable(varname) != true)}">
|
||||
|
||||
<!-- Unsigning -->
|
||||
<zip destfile="${maven.abbot.dest.dir}/${filename}.jar">
|
||||
<zip destfile="${maven.abbot.dest.jar.dir}/${filename}.jar">
|
||||
<zipfileset src="${plugin.getDependencyPath(dep.id)}"
|
||||
excludes="**/*.SF **/*.RSA **/*.DSA"/>
|
||||
</zip>
|
||||
|
||||
<!-- Signing -->
|
||||
<signjar jar="${maven.abbot.dest.dir}/${filename}.jar"
|
||||
<signjar jar="${maven.abbot.dest.jar.dir}/${filename}.jar"
|
||||
keystore="${maven.abbot.sign.keystore}"
|
||||
alias="${maven.abbot.sign.alias}"
|
||||
storepass="${maven.abbot.sign.storepass}"/>
|
||||
</j:if>
|
||||
|
||||
</j:if>
|
||||
|
||||
</j:forEach>
|
||||
|
||||
<!-- Jar containing abbot main class is signed -->
|
||||
<signjar jar="${maven.abbot.dest.dir}/${maven.abbot.webstart.main.jar}"
|
||||
<!-- TODO: Only sign it if not already done instead of everytime -->
|
||||
<signjar jar="${maven.abbot.dest.jar.dir}/${maven.abbot.webstart.main.jar}"
|
||||
keystore="${maven.abbot.sign.keystore}"
|
||||
alias="${maven.abbot.sign.alias}"
|
||||
storepass="${maven.abbot.sign.storepass}"/>
|
||||
|
||||
</j:if>
|
||||
|
||||
|
||||
@@ -299,6 +303,7 @@
|
||||
<mkdir dir="${maven.test.dest}"/>
|
||||
<mkdir dir="${maven.abbot.reports.dir}"/>
|
||||
<mkdir dir="${maven.abbot.dest.dir}"/>
|
||||
<mkdir dir="${maven.abbot.dest.jar.dir}"/>
|
||||
|
||||
</goal>
|
||||
|
||||
|
||||
@@ -33,6 +33,10 @@ maven.abbot.recurse = true
|
||||
# Location where the abbot plugin puts build files related to abbot
|
||||
maven.abbot.dest.dir = ${maven.build.dir}/abbot
|
||||
|
||||
# Location where the abbot plugin signs the jars to be added to the
|
||||
# generated JNLP file.
|
||||
maven.abbot.dest.jar.dir = ${maven.abbot.dest.dir}/jars
|
||||
|
||||
# Location where abbot junit test results will be located
|
||||
maven.abbot.reports.dir = ${maven.build.dir}/abbot-reports
|
||||
|
||||
|
||||
@@ -65,28 +65,19 @@
|
||||
<!-- Copy all the other jars references -->
|
||||
<x:copyOf select="jar[not(@main)]"/>
|
||||
|
||||
<!-- Add references to all jar in ${maven.abbot.webstart.dependencies} -->
|
||||
<j:forEach var="dep" items="${plugin.getDependencies()}">
|
||||
<j:if test="${dep.getProperty('abbot.webstart')}">
|
||||
<j:set var="filename" value="${dep.GroupId}-${dep.ArtifactId}"/>
|
||||
<j:if test="${maven.abbot.sign}">
|
||||
<x:element name="jar">
|
||||
<x:attribute name="href">file:${maven.abbot.dest.dir}/${filename}.jar</x:attribute>
|
||||
</x:element>
|
||||
<!-- Add references to all jars found in the ${maven.abbot.dest.jar.dir} dir -->
|
||||
<ant:fileScanner var="scanner">
|
||||
<ant:fileset dir="${maven.abbot.dest.jar.dir}" includes="*.jar"/>
|
||||
</ant:fileScanner>
|
||||
<j:forEach var="jar" items="${scanner.iterator()}">
|
||||
<x:element name="jar">
|
||||
<!-- Treat "main" jar differently -->
|
||||
<j:if test="${jar.name == context.getVariable('maven.abbot.webstart.main.jar')}">
|
||||
<x:attribute name="main">true</x:attribute>
|
||||
</j:if>
|
||||
<j:if test="${maven.abbot.sign == false}">
|
||||
<x:element name="jar">
|
||||
<x:attribute name="href">${dep.getDependancyPath()}</x:attribute>
|
||||
</x:element>
|
||||
</j:if>
|
||||
</j:if>
|
||||
</j:forEach>
|
||||
|
||||
<!-- Add reference to the new "main jar" -->
|
||||
<x:element name="jar">
|
||||
<x:attribute name="main">true</x:attribute>
|
||||
<x:attribute name="href">file:${maven.abbot.dest.dir}/${maven.abbot.webstart.main.jar}</x:attribute>
|
||||
</x:element>
|
||||
<x:attribute name="href">file:${jar.absolutePath}</x:attribute>
|
||||
</x:element>
|
||||
</j:forEach>
|
||||
|
||||
<!-- Copy all existing sys properties -->
|
||||
<x:copyOf select="property"/>
|
||||
|
||||
Reference in New Issue
Block a user