dev@jsftemplating.java.net

Re: JSFTemplating: Re: jsftemplate debugging advise needed

From: Rebecca Searls <Rebecca.Searls_at_Sun.COM>
Date: Mon, 25 Aug 2008 16:13:27 -0400

Ken,


> Once you get the antrun plugin working, I'd be curious to see what that
> looks like -- I'm still learning mvn.

Ken,

     Here is how I ran the apt ant task from maven2. Because I had to pass JAVA.HOME
     to ant, maven could not be run from NB61. NB alters the value of JAVA.HOME or sends
     its own. This runs correctly from a shell.

     This was not a good solution for MEP because the code I am building requires accesss
     to jars placed in the maven repository and its not convenient to keep up with the
     version strings or to maintain private copies of the nneded jars.

     As suggested I investigated using the hk2-maven-plugin. That did not work and after
     talking to Kohsuke I looked else where. I found a apt-maven-plugin at codehaus.
     It is still under development. Currently it only supports the APT -s option and
     not the -d options which is a problem. I finally took the src for this plugin
     made the changes I needed and am use it as a private plugin.


The mvn ant plugin used


<plugin>
     <artifactId>maven-antrun-plugin</artifactId>
     <executions>
         <execution>
         <phase>compile</phase>
         <configuration>
             <tasks>
                 <ant target="compile">
                     <!-- Must pass these env vars for ant task to run -->
                     <property name="ant.home" value="${env.ANT_HOME}" />
                     <property name="java.home" value="${env.JAVA_HOME}" />
                 </ant>
             </tasks>
         </configuration>
         <goals>
             <goal>run</goal>
         </goals>
         </execution>
     </executions>
</plugin>


The ant task defined in a build.xml file

     : .... build.properties
     :
     <target name="compile" depends="init">
         <mkdir dir="${build}/." />
         <echo message="using: ${execute.ant}" />
         <exec dir="." executable="${execute.ant}" failonerror="true" failifexecutionfails="false">
             <!-- We do this to add the ant-apt.jar to the lib path -->
             <arg line="-f aptbuild.xml -lib ${ant-apt.jar} compile" />
         </exec>
     </target>
     :
     :


Apt task defined in aptbuild.xml

     : .... build.properties
     :
     : <path id="dependencies">
             <pathelement location="${jsf-api.jar}" />
             :
             :
     : </path>

     <target name="compile">
         <!-- Compile the java code from ${src} into ${build} -->
         <apt srcdir="${src}"
                 fork="true"
                 destdir="${build}/."
                 debug="${compile.debug}"
                 deprecation="${compile.deprecation}"
                 optimize="${compile.optimize}">
             <classpath refid="dependencies" />
         </apt>
     </target>








On 08/18/08 20:06, Ken Paulsen wrote:
>
> I think the issue was the packaging type (war), however, I'm not 100%
> sure. Either that or the parent pom which might setup some of the
> annotation processing stuff (I think we use glassfish-parent). I'll
> look into this more when I have time and write something up about it.
>
> Once you get the antrun plugin working, I'd be curious to see what that
> looks like -- I'm still learning mvn.
>
> Thanks!
>
> Ken
>
> Rebecca Searls wrote:
>> Never mind. I'll just use maven-antrun-plugin instead.
>>
>> On 08/18/08 15:29, Rebecca Searls wrote:
>>> Ken,
>>>
>>> I reviewed the pom.xml you provided. I cut/pasted and
>>> altered the plugin from your pom.xml
>>> into mind but still have not been successful getting the
>>> Handler.map generated. I have
>>> been successful generating it with ant but we are trying to be
>>> completely maven driven
>>> so if possible I would like to get this working there. I have
>>> attached my pom.xml and
>>> the bld output log. Do you see anything that is wrong? Is
>>> ant-apt.jar required to be
>>> in some maven path?
>>>
>>>
>>>
>>>
>>