can confirm that ${maven.compile.debug} is 'on' in the goal and null within the 
define.

Nathan Coast wrote:
> Hi james,
> 
> thanks, this stuff now works in the one file,  I had the same results 
> last night with two files.  Unfortunately, the std maven properties all 
> seem to be null when dealing with defines.  I guess this is why javac 
> barfs.  I've attached my plugin.jelly - contains a load of debug.
> 
> James Strachan wrote:
> 
>> Hi Nathan
>>
>> I really should test pseudo code before I just write it in emails ;-). 
>> I've
>> attached a nearly-working example that is much closer; I added it to 
>> the end
>> of the Jelly maven.xml file. (So its right at the end).
>>
>> It actually evaluates the tag correctly, though for some reason the javac
>> task barfs, I'm not too sure why. The main trick to get what you had 
>> working
>> was that the <makeJar> tag needs to be in a namespace that matches the 
>> new
>> taglib ('myLib' in the example I sent). So in the attached maven.xml 
>> you'll
>> see I use <my:makeJar/>
>>
>> I think for Maven it'd make sense to have a simpler
>>
>> <tagdef name="foo">
>>     <javac>
>>         ...
>> </tagdef>
>>
>> Then later on to invoke it...
>>
>> <foo x="123" y="${pom.foo.bar()}"/>
>>
>> Then it'd be much cleaner & easier to use in maven.xml, and would mirror
>> more closely the old <taskdef> mechanism in Ant. I'll try make time 
>> today to
>> try hack this together...
>>
>> James
>> ----- Original Message -----
>> From: "Nathan Coast" <[EMAIL PROTECTED]>
>> To: "Turbine Maven Developers List" 
>> <[EMAIL PROTECTED]>
>> Sent: Tuesday, July 09, 2002 6:38 PM
>> Subject: Re: multiple goal invocations
>>
>>
>>
>>> OK, I gave this a go but I'm not sure what I'm doing wrong (defined tag
>>
>>
>> not
>>
>>> being executed).  btw if you hadn't guessed I'm no xml expert :)
>>>
>>> cheers Nathan
>>>
>>> <project
>>>   xmlns:j="jelly:core"
>>>   
>>> xmlns:maven="jelly:org.apache.maven.jelly.tags.project.MavenTagLibrary"
>>>   xmlns:define="jelly:define">
>>>
>>> <!-- define a new tag -->
>>> <define:taglib uri="myLib">
>>>     <define:tag name="makeJar">
>>>         <echo message="compiling ${includes}"/>
>>> <javac
>>>             destdir="${maven.build.dest}"
>>>             includes="${includes}"
>>>             excludes="${excludes}"
>>>             debug="${maven.compile.debug}"
>>>             deprecation="${maven.compile.deprecation}"
>>>             optimize="${maven.compile.optimize}">
>>>         <classpath>
>>>             <path refid="maven.dependency.classpath"/>
>>>             <pathelement path="${maven.build.dest}"/>
>>>         </classpath>
>>>         <!--jar
>>>             jarfile="${jarfile}"
>>>             basedir="${maven.build.dest}"
>>>         </jar-->
>>>     </javac>
>>>     </define:tag>
>>> </define:taglib>
>>>
>>>
>>>
>>>   <goal name="jws:compile"
>>>         description="Compile the project">
>>>
>>>     <attainGoal name="java:prepare-filesystem"/>
>>>
>>> <makeJar includes="**/commmon/*.java"
>>> jarfile="${maven.build.dest}/foo.jar"/>
>>>
>>> <makeJar includes="**/registry/*.java"
>>> jarfile="${maven.build.dest}/xyz.jar"/>
>>>
>>> <makeJar includes="**/server/*.java"
>>> jarfile="${maven.build.dest}/bing.jar"/>
>>>
>>> ...........
>>>
>>>
>>> -- 
>>> To unsubscribe, e-mail:
>>
>>
>> <mailto:[EMAIL PROTECTED]>
>>
>>> For additional commands, e-mail:
>>
>>
>> <mailto:[EMAIL PROTECTED]>
>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> <project default="java:jar" xmlns:j="jelly:core" 
>>> xmlns:define="jelly:define" xmlns:my="myLib">
>>>
>>>  <!-- runs the XML doclet -->   
>>>  <goal name="xml-doclet" prereqs="java:compile">
>>>    <path id="doclet.classpath">
>>>         <pathelement path="${maven.build.dest}"/>
>>>         <path refid="maven.dependency.classpath"/>
>>>      </path>
>>>     
>>>     <javadoc        sourcepath="src/java"        
>>> packagenames="org.apache.commons.jelly.tags.*"
>>>        doclet="org.apache.commons.jelly.util.XMLDoclet"
>>>        docletpathref="doclet.classpath">
>>>    </javadoc>
>>>  </goal>
>>>
>>>  <!-- runs the Tag doclet -->   
>>>  <goal name="tag-doclet" prereqs="java:compile">
>>>    <path id="doclet.classpath">
>>>      <pathelement path="target/classes"/>
>>>      <pathelement path="${maven.build.dest}"/>
>>>       <path refid="maven.dependency.classpath"/>
>>>     </path>
>>>     
>>>     <javadoc        sourcepath="src/java"        
>>> packagenames="org.apache.commons.jelly.tags.*"
>>>        doclet="org.apache.commons.jelly.util.TagXMLDoclet"
>>>        docletpathref="doclet.classpath">
>>>    </javadoc>
>>>  </goal>
>>>     
>>>  <!-- creates the XML webpage from the tag XML information -->       
>>>  <goal name="doc-tags" prereqs="tag-doclet" 
>>>     description="Generates the tag documentation">
>>>     
>>>     <mkdir dir="target/generated-xdocs"/>
>>>
>>>     <path id="test.classpath">
>>>         <pathelement path="${maven.build.dest}"/>
>>>         <pathelement path="target/classes"/>
>>>         <path refid="maven.dependency.classpath"/>
>>>     </path>
>>>          <taskdef
>>>      name="jelly"
>>>      classname="org.apache.commons.jelly.task.JellyTask">
>>>      <classpath refid="test.classpath"/>
>>>    </taskdef>         <!--   
>>>     <j:file name="target/generated-xdocs/tags.xml">
>>>       <j:include uri="src/script/makeTagDoc.jelly"/>
>>>     </j:file>
>>> -->
>>>
>>>     <jelly file="src/script/makeTagDoc.jelly" 
>>> output="target/generated-xdocs/tags.xml"/>     
>>>  </goal>
>>>
>>>  <!-- ensure that the tag documentation is generated as part of the 
>>> site -->   
>>>  <goal
>>>    name="deploy-site2" prereqs="doc-tags, deploy-site">
>>>  </goal>
>>>  
>>>  <preGoal
>>>    name="site:generate">
>>>
>>>     <attainGoal name="doc-tags"/>
>>>     
>>>  </preGoal>
>>>
>>>
>>>
>>>  <!-- experiment with some tag definitions -->
>>>
>>>  <!-- define a new tag -->
>>>  <define:taglib uri="myLib">
>>>     <define:tag name="makeJar">
>>>        <echo message="compiling ${includes}"/>
>>>         <javac
>>>           srcdir="src/java"
>>>          destdir="${maven.build.dest}"
>>>          includes="${includes}"
>>>          excludes="${excludes}"
>>>          debug="${maven.compile.debug}"
>>>          deprecation="${maven.compile.deprecation}"
>>>          optimize="${maven.compile.optimize}">
>>>         <classpath>
>>>             <path refid="maven.dependency.classpath"/>
>>>             <pathelement path="${maven.build.dest}"/>
>>>         </classpath>
>>>         <!--jar
>>>             jarfile="${jarfile}"
>>>             basedir="${maven.build.dest}"
>>>         </jar-->
>>>        </javac>
>>>      </define:tag>
>>>  </define:taglib>
>>>
>>>
>>>
>>>  <goal name="sample-goal"
>>>        description="sample goal...">
>>>
>>>    <attainGoal name="java:prepare-filesystem"/>
>>>
>>>     <my:makeJar         includes="**/*.java" excludes="" 
>>> jarfile="${maven.build.dest}/jelly-ojb.jar"/>
>>>
>>>  </goal>    
>>>          </project>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> -- 
>>> To unsubscribe, e-mail:   
>>> <mailto:[EMAIL PROTECTED]>
>>> For additional commands, e-mail: 
>>> <mailto:[EMAIL PROTECTED]>
>>
>>
> 
> 
> ------------------------------------------------------------------------
> 
> <?xml version="1.0"?>
> 
> <project 
>   xmlns:j="jelly:core"
>   xmlns:maven="jelly:org.apache.maven.jelly.tags.project.MavenTagLibrary"
>   xmlns:define="jelly:define"
>   xmlns:jwsLib="jwsLib">
> 
> <define:taglib uri="jwsLib">
>     <define:tag name="makeJar">
>         <attainGoal name="java:prepare-filesystem"/>
>       <echo message="compiling ${includes}"/>
>         <echo message="destdir= ${maven.build.dest}"/>
>     <echo message="debug=${maven.compile.debug}"/>
>     <echo message="optimize=${maven.compile.optimize}"/>
>     <property name="depcp" refid="maven.dependency.classpath"/>
>     <echo message="depcp ${depcp}"/>
>     <echo message="maven.build.dest ${maven.build.dest}"/>
> 
>       <javac
>             destdir="${maven.build.dest}"
>             includes="${includes}"
>             debug="${maven.compile.debug}"
>             deprecation="${maven.compile.deprecation}"
>             optimize="${maven.compile.optimize}">
>         <classpath>
>             <path refid="maven.dependency.classpath"/>
>             <pathelement path="${maven.build.dest}"/>
>         </classpath>
>         </javac>
>         <!--jar
>             jarfile="${jarfile}"
>             basedir="${maven.build.dest}"
>         </jar-->
> 
>     </define:tag>
> </define:taglib>
> 
>   <goal name="jws:compile"
>         description="Compile the project">
>       
>         <attainGoal name="java:prepare-filesystem"/>
> 
>    <property name="depcp" refid="maven.dependency.classpath"/>
>     <echo message="depcp ${depcp}"/>
>  
> 
>     <jwsLib:makeJar includes="**/commmon/*.java"
>       jarfile="${maven.build.dest}/foo.jar"/>
> 
>     <jwsLib:makeJar includes="**/registry/*.java"
>       jarfile="${maven.build.dest}/xyz.jar"/>
> 
>     <jwsLib:makeJar includes="**/server/*.java"
>       jarfile="${maven.build.dest}/bing.jar"/>
> 
>       <echo message="Running xrpcc for the server:"/>
>       <exec executable="${xrpcc}">
>          <arg line="-classpath ${maven.build.dest}/service-class" />
>          <arg line="-server" />
>          <arg line="-d ${build}/server" />
>          <arg line="${src}/config.xml" />
>       </exec>
> 
>   </goal>
> 
> </project>
> 
> 
> ------------------------------------------------------------------------
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to