Add the possibility to choose the main jar. Thanks to Dominique Collette.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113379 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
evenisse
2003-04-24 13:06:22 +00:00
parent fb39b409c8
commit e6e44622a6
4 changed files with 58 additions and 4 deletions

View File

@@ -82,16 +82,32 @@
<j2se version="${maven.jnlp.j2se.version}"
initial-heap-size="${maven.jnlp.j2se.heapsize.initial}"
maximum-heap-size="${maven.jnlp.j2se.heapsize.max}"/>
<jar href="${maven.final.name}.jar" main="true"/>
<j:set var="mainExists" value="false"/>
<j:forEach var="lib" items="${pom.dependencies}">
<j:if test="${lib.getProperty('jnlp.jar')=='true'}">
<jar href="${lib.artifact}"/>
<j:choose>
<j:when test="${lib.getProperty('jnlp.main.jar')=='true'}">
<j:set var="mainExists" value="true"/>
<jar href="${lib.artifact}" main="true"/>
</j:when>
<j:otherwise>
<jar href="${lib.artifact}"/>
</j:otherwise>
</j:choose>
</j:if>
<j:if test="${lib.getProperty('jnlp.native.jar')=='true'}">
<nativelib href="${lib.artifact}"/>
</j:if>
</j:forEach>
<j:choose>
<j:when test="${mainExists=='false'}">
<jar href="${maven.final.name}.jar" main="true"/>
</j:when>
<j:otherwise">
<jar href="${maven.final.name}.jar"/>
</j:otherwise>
</j:choose>
<!-- This is close to what it WILL look like, but for now it is the ugly ass thing below it-->
<u:tokenize var="listOfProperties" delim=" ">${maven.jnlp.properties}</u:tokenize>

View File

@@ -5,7 +5,7 @@
<pomVersion>3</pomVersion>
<id>maven-jnlp-plugin</id>
<name>Maven JNLP Plug-in</name>
<currentVersion>1.0</currentVersion>
<currentVersion>1.1</currentVersion>
<shortDescription>JNLP Plugin for Maven</shortDescription>
<url>http://maven.apache.org/reference/plugins/jnlp/</url>
<siteDirectory>/www/maven.apache.org/reference/plugins/jnlp/</siteDirectory>

16
jnlp/xdocs/changes.xml Normal file
View File

@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<document>
<properties>
<title>Changes</title>
<author email="dion@multitask.com.au">dIon Gillard</author>
</properties>
<body>
<release version="1.1" date="in CVS">
<action dev="evenisse" type="add" due-to="Dominique Collette">
Add the possibility to choose the main jar.
</action>
</release>
</body>
</document>

View File

@@ -361,6 +361,28 @@
</properties>
</dependency>
]]></source>
</section>
</section>
<section name="How to define the main jar?">
<p>
When you define the main class of your application, you must define the jar
that contains the main class. This is achieved by specifying meta-information
in the pom, using the following syntax for jar files :
</p>
<source><![CDATA[
<dependency>
<id>jarid</id>
<version>jarversion</version>
<properties>
<jnlp.jar>true</jnlp.jar>
<jnlp.main.jar>true</jnlp.main.jar>
</properties>
</dependency>
]]></source>
<p>
If no jars contains this tag (jnlp.main.jar), it's the project jar which will be used.
</p>
</section>
</body>
</document>