Jeff,

First of all, thanks for the jspc-maven-plugin!

I have a WAR project that has JSPs which reference a tag library that is defined in the same WAR project. In other words the Java files for the tag library are under src/main/java and the TLD for the library is under src/main/webapp/tld. When I try to precompile the JSPs using jspc-maven-plugin, JspC finds the .tld file, but it doesn't find the associated Java class. I'm sure this is because I have attached the jspc-maven-plugin to the generate-sources phase and so the source code for the WAR project has not been compiled yet when the jspc-maven-plugin is executed. I'm not sure what to do about this except for move the tag library into another project, which I can't do. Do you have any ideas?

Also, I'm finding that if a tag library is contained in a dependency that is marked with <scope>provided</scope>, then that dependency isn't included on the classpath for JspC. I'm using Maven 2.1-SNAPSHOT. Have you ran into this problem?

One more thing. With the way that the jspc-maven-plugin is currently written, the overall build does not fail when a JSP fails to precompile, so initially you get the impression that the build completed successfully because the output says BUILD SUCCESSFUL. I found that changing the call to JspC did the trick.

I simply changed this:

           //Compile the JSPs
           JspC.main((String[]) args.toArray(new String[args.size()]));

           //Set back the old classloader
           Thread.currentThread().setContextClassLoader(parent);

to this:

           //Compile the JSPs
           try {
               JspC jspc = new JspC();
jspc.setArgs((String[]) args.toArray(new String[args.size()]));
               jspc.execute();
           } finally {
               //Set back the old classloader
               Thread.currentThread().setContextClassLoader(parent);
           }

Now I get BUILD ERROR when a JSP failed to precompile. Maybe this could be a configuration option?


Thanks,
Richard Allen

Reply via email to