You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mattias Olofsson <ma...@xdin.com> on 2004/12/15 10:09:27 UTC
Tips on making maven / plugin scripts
Hi,
I am developing a plugin and have some trouble in debugging my plugin.jelly
script
Can any one suggest how to develop maven script in an easy way and also how
to debug them?
Example:
1. Getting the schema or dtd for the jelly and maven tags ?
2. List all the properties in the context from project.properties etc ?
3. Examples in using jelly tags, like a tutorial or samples ?
Ps.
One technique I am using is when perhaps I want to debug the part below
<ant:wtkjad autoversion="{maven.j2me.jad.autoversion}"
jadfile="${maven.build.dir}/${pom.artifactId}.jad"
jarfile="${maven.build.dir}/${pom.artifactId}.jar"
name="${suitename}"
update="update"
vendor="${vendor}"
version="${version}">
<j:forEach items="${midlets}" var="midlet">
<x:set select="$midlet.name" var="name"/>
<j:if test="${empty (name)}">
<fail message="Name attribute must be "/>
</j:if>
<x:set select="$midlet.class" var="class"/>
<j:if test="${empty (class)}">
<fail message="Class attribute must be set!"/>
</j:if>
<x:set select="$midlet.icon" var="icon"/>
< ant:midlet class="${class}" icon="${icon}" name="${name}"/>
</j:forEach>
<j:forEach items="${attributes}" var="attribute">
<x:set select="$attribute.name" var="name"/>
<j:if test="${empty (name)}">
<fail message="Name attribute must be set!"/>
</j:if>
<ant:attribute name="${attribute.name}"
value="${attribute.value}"/>
</j:forEach>
</ant:wtkjad>
You can "switch on/off" the different part of the scripts by renaming the
xmlns spaces in order to
see the results of the different jelly tag types.
Example: by renaming
xmlns:ant="jelly:ant"
to
xmlns:ant="tmp_jelly:ant"
and put the above code between <echo></echo> you can see the ant script that
is dynamically generated
by the j and x jelly tags. Example echo out:
<ant:wtkjad
autoversion="false"
jarfile="C:\java\javasoft\wtk_midp2.1\apps\example/target/example.jar"
jadfile="C:\java\javasoft\wtk_midp2.1\apps\example/target/ example.jad"
update="update">
<midlet class="com.xdin.mobilitet.Example" icon=""
name="ExamlpeDemo"></midlet>
<attribute value="http://localhost/example/example.jsp"
name="SERVERURL"></attribute>
<attribute value="my_value" name="my_key"></attribute>
</ant:wtkjad>
The same can be done wirh j and x.
Re: Tips on making maven / plugin scripts
Posted by dan tran <da...@gmail.com>.
make small change, one thing at the time. Jelly can burn you ;-)
-D
On Wed, 15 Dec 2004 10:29:11 +0100, Milos Kleint <Mi...@sun.com> wrote:
> hello,
>
> for writing jelly scripts, checking the mevenide completion support
> might be worth a try. See
> http://mevenide.codehaus.org/mevenide-netbeans-grammar/index.html for
> screenshots and description. That's for Netbeans 4.0 IDE, similar
> functionality is available for Eclipse. It works in plugin.jelly and
> maven.xml files, it should help you avoid typos and looking up names in
> docs.
>
> for debugging I have no other suggestion than adding debug messages in
> your script.
>
> Regards, hope that helps.
>
> Milos Kleint
>
> Mattias Olofsson wrote:
>
> >Hi,
> >
> >I am developing a plugin and have some trouble in debugging my plugin.jelly
> >script
> >
> >Can any one suggest how to develop maven script in an easy way and also how
> >to debug them?
> >
> >Example:
> >
> >
> >
> >1. Getting the schema or dtd for the jelly and maven tags ?
> >2. List all the properties in the context from project.properties etc ?
> >3. Examples in using jelly tags, like a tutorial or samples ?
> >
> >
> >
> >Ps.
> >
> >One technique I am using is when perhaps I want to debug the part below
> >
> >
> >
> ><ant:wtkjad autoversion="{maven.j2me.jad.autoversion}"
> >
> > jadfile="${maven.build.dir}/${pom.artifactId}.jad"
> >
> > jarfile="${maven.build.dir}/${pom.artifactId}.jar"
> >
> > name="${suitename}"
> >
> > update="update"
> >
> > vendor="${vendor}"
> >
> > version="${version}">
> >
> >
> >
> > <j:forEach items="${midlets}" var="midlet">
> >
> > <x:set select="$midlet.name" var="name"/>
> >
> > <j:if test="${empty (name)}">
> >
> > <fail message="Name attribute must be "/>
> >
> > </j:if>
> >
> >
> >
> > <x:set select="$midlet.class" var="class"/>
> >
> > <j:if test="${empty (class)}">
> >
> > <fail message="Class attribute must be set!"/>
> >
> > </j:if>
> >
> >
> >
> > <x:set select="$midlet.icon" var="icon"/>
> >
> >
> >
> > < ant:midlet class="${class}" icon="${icon}" name="${name}"/>
> >
> > </j:forEach>
> >
> >
> >
> > <j:forEach items="${attributes}" var="attribute">
> >
> > <x:set select="$attribute.name" var="name"/>
> >
> > <j:if test="${empty (name)}">
> >
> > <fail message="Name attribute must be set!"/>
> >
> > </j:if>
> >
> > <ant:attribute name="${attribute.name}"
> >value="${attribute.value}"/>
> >
> > </j:forEach>
> >
> > </ant:wtkjad>
> >
> >
> >
> >You can "switch on/off" the different part of the scripts by renaming the
> >xmlns spaces in order to
> >
> >see the results of the different jelly tag types.
> >
> >Example: by renaming
> >
> >xmlns:ant="jelly:ant"
> >
> >to
> >
> >xmlns:ant="tmp_jelly:ant"
> >
> >
> >
> >and put the above code between <echo></echo> you can see the ant script that
> >is dynamically generated
> >
> >by the j and x jelly tags. Example echo out:
> >
> >
> >
> ><ant:wtkjad
> >
> >autoversion="false"
> >
> >jarfile="C:\java\javasoft\wtk_midp2.1\apps\example/target/example.jar"
> >
> >jadfile="C:\java\javasoft\wtk_midp2.1\apps\example/target/ example.jad"
> >
> >update="update">
> >
> >
> >
> ><midlet class="com.xdin.mobilitet.Example" icon=""
> >name="ExamlpeDemo"></midlet>
> >
> >
> >
> > <attribute value="http://localhost/example/example.jsp"
> >name="SERVERURL"></attribute>
> >
> > <attribute value="my_value" name="my_key"></attribute>
> >
> >
> >
> ></ant:wtkjad>
> >
> >
> >
> >The same can be done wirh j and x.
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Tips on making maven / plugin scripts
Posted by Milos Kleint <Mi...@Sun.COM>.
hello,
for writing jelly scripts, checking the mevenide completion support
might be worth a try. See
http://mevenide.codehaus.org/mevenide-netbeans-grammar/index.html for
screenshots and description. That's for Netbeans 4.0 IDE, similar
functionality is available for Eclipse. It works in plugin.jelly and
maven.xml files, it should help you avoid typos and looking up names in
docs.
for debugging I have no other suggestion than adding debug messages in
your script.
Regards, hope that helps.
Milos Kleint
Mattias Olofsson wrote:
>Hi,
>
>I am developing a plugin and have some trouble in debugging my plugin.jelly
>script
>
>Can any one suggest how to develop maven script in an easy way and also how
>to debug them?
>
>Example:
>
>
>
>1. Getting the schema or dtd for the jelly and maven tags ?
>2. List all the properties in the context from project.properties etc ?
>3. Examples in using jelly tags, like a tutorial or samples ?
>
>
>
>Ps.
>
>One technique I am using is when perhaps I want to debug the part below
>
>
>
><ant:wtkjad autoversion="{maven.j2me.jad.autoversion}"
>
> jadfile="${maven.build.dir}/${pom.artifactId}.jad"
>
> jarfile="${maven.build.dir}/${pom.artifactId}.jar"
>
> name="${suitename}"
>
> update="update"
>
> vendor="${vendor}"
>
> version="${version}">
>
>
>
> <j:forEach items="${midlets}" var="midlet">
>
> <x:set select="$midlet.name" var="name"/>
>
> <j:if test="${empty (name)}">
>
> <fail message="Name attribute must be "/>
>
> </j:if>
>
>
>
> <x:set select="$midlet.class" var="class"/>
>
> <j:if test="${empty (class)}">
>
> <fail message="Class attribute must be set!"/>
>
> </j:if>
>
>
>
> <x:set select="$midlet.icon" var="icon"/>
>
>
>
> < ant:midlet class="${class}" icon="${icon}" name="${name}"/>
>
> </j:forEach>
>
>
>
> <j:forEach items="${attributes}" var="attribute">
>
> <x:set select="$attribute.name" var="name"/>
>
> <j:if test="${empty (name)}">
>
> <fail message="Name attribute must be set!"/>
>
> </j:if>
>
> <ant:attribute name="${attribute.name}"
>value="${attribute.value}"/>
>
> </j:forEach>
>
> </ant:wtkjad>
>
>
>
>You can "switch on/off" the different part of the scripts by renaming the
>xmlns spaces in order to
>
>see the results of the different jelly tag types.
>
>Example: by renaming
>
>xmlns:ant="jelly:ant"
>
>to
>
>xmlns:ant="tmp_jelly:ant"
>
>
>
>and put the above code between <echo></echo> you can see the ant script that
>is dynamically generated
>
>by the j and x jelly tags. Example echo out:
>
>
>
><ant:wtkjad
>
>autoversion="false"
>
>jarfile="C:\java\javasoft\wtk_midp2.1\apps\example/target/example.jar"
>
>jadfile="C:\java\javasoft\wtk_midp2.1\apps\example/target/ example.jad"
>
>update="update">
>
>
>
><midlet class="com.xdin.mobilitet.Example" icon=""
>name="ExamlpeDemo"></midlet>
>
>
>
> <attribute value="http://localhost/example/example.jsp"
>name="SERVERURL"></attribute>
>
> <attribute value="my_value" name="my_key"></attribute>
>
>
>
></ant:wtkjad>
>
>
>
>The same can be done wirh j and x.
>
>
>
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org