Summary: | jspc tag broken with new version of jasper | ||
---|---|---|---|
Product: | Ant | Reporter: | John Swapceinski <jswap> |
Component: | Optional Tasks | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | josevnz, notifications, rickkw, serg_main, shankarunni |
Priority: | P3 | ||
Version: | 1.5.4 | ||
Target Milestone: | 1.6.2 | ||
Hardware: | Other | ||
OS: | other |
Description
John Swapceinski
2003-12-08 23:18:18 UTC
I got the same problem when using it with Sun jwsdp-1.3, Sun Java (build 1.4.2-b28 and ant 1.5: validate-xml: [xmlvalidate] 1 file(s) have been successfully validated. compile-jsp: [jspc] Compiling 2 source files/home/josevnz/sourceforge/cvebrowser/test/jsp [jasperc] error:org.apache.jasper.JasperException: Unrecognized option: -v0. Use -help for help. [jasperc] at org.apache.jasper.JspC.setArgs(JspC.java:306) [jasperc] at org.apache.jasper.JspC.main(JspC.java:230) My jspc task: <target name="compile-jsp" description="Precompiles the JSP pages in order to catch errors early, before deploying the XXXX web app." depends="validate-xml"> <jspc srcdir="${web}" destdir="${test}/jsp" classpath="${path.classpath}" compiler="jasper41"> <exclude name="**/CVS"/> <include name="**/*.jsp" /> </jspc> </target> Filed a bugrep w/ tomcat pointing out the regression, we can fix this in ant1.6.1 but can do nothing for versions out there already (for obvious reasons). A fix in Japser would be preferable. When you guys plan to make the patch available? replacing ant with an improved version is not that bad anyways :). Well, I filed a bugrep w/ tomcat and they said, roughly, 'stop it'. Tomcat 5.x apparently comes with its own <jspc> task, that is tightly coupled to tomcat, supported, may do better dependency checking, etc. etc. This is good as trying to track changes in tomcat in the Jspc task was very painful. So if you want to use the 5.x codebase, I would try using the jspc task that comes with it. I havent had a play with it myself, but will now. 1.6.1 will be coming out shortly, btw The Tomcat team have added back the -v setter, so future versions may work. I say may as there are other changes that can break things. Therefore I intend to document that the Ant-supplied version of <jspc> is only for the 4.x version of tomcat; for later versions you should use Tomcat's own task. This will make life a lot simpler. > for later versions you should use Tomcat's own task.
Except that the Tomcat 5 JspC, when invoked as an Ant task, does not support
filesets for an explicit list of files to compile. It only supports compiling an
entire directory.
You *have* to invoke it with <java fork="true" .../> to compile files
selectively, which is a big step back..
That is something to take up with the Tomcat team; it should not be too hard to add it to their task. The problem is, there is too high a rate-of-change in the tomcat Jasperc behaviour (JSP->java file mapping, command options, error codes) and so many other side issues that it is best if the compiler task lives with that team -that ensures it is always in sync with the relevant release of the compiler. As they release point releases much more frequently than ant does, this is important. I might have a look at their task to see what can be done to take the best bits from our tasks. *** Bug 27441 has been marked as a duplicate of this bug. *** *** Bug 27923 has been marked as a duplicate of this bug. *** Here is my plan: * I'll look into detecting Tomcat 5.x and disable -v0 - if I don't find an easy way to detect 5.x, I'll resort to an attribute that will disable -v0 completely. * <jspc> for Jasper will get deprecated in favor of Tomcat's version. I've implemented a work-around. If anybody of you could please try a hand-crafted version of Ant form CVS HEAD and confirm that it works now (I don't really use the task, so I have no proper means to check it), that would be great. Alternatively you can grab http://cvs.apache.org/~bodewig/ant-nodeps.jar and use this one (please keep a backup of your own ant-nodeps.jar around) - this may introduce problems with other optional tasks, though. I won't close this report until it is confirmed as fixed. I assume that it works in 1.6.2. |