You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Do...@gmx.de on 2008/03/03 23:34:20 UTC

Re: jspc precompile

Ok, now I wrote a complete new mail, hope this one's what you wanted me to do (or should I have left this topic for now...?!)

> Ok, one questions: is the war assembled correctly (including web.xml)?

Well I think so - building a war works, and when I deploy this war into my tomcat server, the app works as it should.

> There must be some option to alter the default path, right??
> You saw the text in jspc maven plugin doc:
> 
> >> <configuration>
> >>     <webXml>${basedir}/target/jspweb.xml</webXml>
> >>     ...
> >> </configuration>
> 
> There you can set the path

Nope, I don't think that's it. There you can only define were the jspweb.xml should be put. I would need to be able to define a custom path for the webapp folder.

However, as a test I changed the path to my webapp folder, and then it temporarily worked. However, the maven jspc plugin seeems to be VERY picky about the jsp code - I have a taglib directive like this:
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>

in my jsps - the url doesn't exist, so the jspc compiler failed.
Well, I read there was a way to fix this issue - I read you had to define 
a taglib uri in the web.xml, but I tried it for about 30 minutes and didn't get it to work, so I decided I should leave it for the moment as it's a legacy project and the main task at hand is moving to Maven 2.
So I tried the jetty jspc plugin again - on the website I even found a
listing of its parameters:

http://jetty.mortbay.org/jspc-maven-plugin/jspc-mojo.html

However, using:
<configuration>
 <webAppSourceDirectory>${basedir}/sr/war</webAppSourceDirectory> 

didn't help either. The only way I got this to work was if I created a src/webapp folder containing the web.xml.

Then it worked and compiled all JSPs as expected - without throwing the error the maven jspc plugin did.

No idea, maybe you got an idea how I could get to run one of the two...

In short, I would need:
The maven jspc or jetty jspc plugin working with a custom webapp folder,
if you recommend me to use the maven jspc plugin, I would need a way to either lower the error level, or I would need to have a way how to fix this struts tld error.

Thanks a lot, your help is really appreciated! :)

Stefanie
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jspc precompile

Posted by VUB Stefan Seidel <ss...@vub.de>.
Dooing@gmx.de wrote:
>> Is there a way to just
>> precompile the jsps to know if they'll be working / to redeploy them on tomcat
>> server, without restarting the server?
>> Yes, with "mvn jspc:compile".
> :-(
> 
> This says:
> 
> Embedded error: The -uriroot option must specify a pre-existing directory
> 
> I've read somewhere I had to change the jsp spec and servlet spec jars from runtime to compile time. Could that be it?

Sounds a bit like the settings for the plugin are not read from the 
pom.xml when you run the goal specifically from the CLI.
You can play around with the scopes, maybe there is a solution, but I 
think this is more a bug in maven, something like 
http://jira.codehaus.org/browse/MNG-472

Stefan


-- 
best regards,

Stefan Seidel
software developer
________________________
VUB Printmedia GmbH
Chopinstraße 4
D-04103 Leipzig
Germany
tel.    +49 (341) 9 60 50 07
fax.    +49 (341) 9 60 50 92
mail.   sseidel@vub.de
web.    www.vub.de

HRB Köln 24015
UStID DE 122 649 251
GF Dr. Achim Preuss Neudorf,
Dr. Christian Preuss Neudorf

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jspc precompile

Posted by Do...@gmx.de.
>Is there a way to just
> precompile the jsps to know if they'll be working / to redeploy them on tomcat
> server, without restarting the server?
> Yes, with "mvn jspc:compile".
:-(

This says:

Embedded error: The -uriroot option must specify a pre-existing directory

I've read somewhere I had to change the jsp spec and servlet spec jars from runtime to compile time. Could that be it?

Thanks,

Stefanie
-- 
Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games! 
http://games.entertainment.web.de/de/entertainment/games/free

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jspc precompile

Posted by VUB Stefan Seidel <ss...@vub.de>.
Dooing@gmx.de wrote:
> YES! Now it works! Thanks!
> 
Glad to hear it :)

> Last but not least - is there a way to run the jspc goal standalone? When working on a certain jsp, without changing any backend java classes, creating the entire war seems to be a bit of a pain. Is there a way to just precompile the jsps to know if they'll be working / to redeploy them on tomcat server, without restarting the server?
Yes, with "mvn jspc:compile".

Stefan


-- 
best regards,

Stefan Seidel
software developer
________________________
VUB Printmedia GmbH
Chopinstraße 4
D-04103 Leipzig
Germany
tel.    +49 (341) 9 60 50 07
fax.    +49 (341) 9 60 50 92
mail.   sseidel@vub.de
web.    www.vub.de

HRB Köln 24015
UStID DE 122 649 251
GF Dr. Achim Preuss Neudorf,
Dr. Christian Preuss Neudorf

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jspc precompile

Posted by Do...@gmx.de.
YES! Now it works! Thanks!

And this great "help" goal also helped me in getting the jetty jspc goal tu run. THANKS!

Last but not least - is there a way to run the jspc goal standalone? When working on a certain jsp, without changing any backend java classes, creating the entire war seems to be a bit of a pain. Is there a way to just precompile the jsps to know if they'll be working / to redeploy them on tomcat server, without restarting the server?

Thanks in advance,

Stefanie 

-- 
Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games! 
http://games.entertainment.web.de/de/entertainment/games/free

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: jspc precompile

Posted by VUB Stefan Seidel <ss...@vub.de>.

Dooing@gmx.de wrote:
> 
>> There must be some option to alter the default path, right??
>> You saw the text in jspc maven plugin doc:
>>
>>>> <configuration>
>>>>     <webXml>${basedir}/target/jspweb.xml</webXml>
>>>>     ...
>>>> </configuration>
>> There you can set the path
> 
> Nope, I don't think that's it. There you can only define were the jspweb.xml should be put. I would need to be able to define a custom path for the webapp folder.
> 

Ok, that wasn't it. I did a short test with one of my WARs and found the 
solution (I think). I renamed my webapp folder to webappx and checked 
what I needed to do in order to get it working again. Very helpful was 
the output from

mvn help:describe -Dplugin=org.codehaus.mojo:jspc-maven-plugin -Dfull

which pointed me to the options for this plugin.

So what you already should have is in the maven-war-plugin:
- <webappDirectory>: to you webapp-dir with the JSP files
- <webXml>${basedir}/target/jspweb.xml</webXml> so it would use the 
output from jspc

and for the jspc plugin:
- <warSourceDirectory>: same as webAppDirectory above
- <inputWebXml>src/war/WEB-INF/web.xml</inputWebXml> pointing to your 
source web.xml

That should work. If the jspc plugin cannot resolve URIs for TLDs, you 
will need to add the dependencies pointing to the JAR files containing 
the TLDs to the declaration of the plugin:

       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>jspc-maven-plugin</artifactId>
         <dependencies>
           <dependency>
             <groupId>org.apache.struts</groupId>
             <artifactId>struts-taglib</artifactId>
             <version>[1.0,)</version>
           </dependency>
         </dependencies>

(group and artifact id are just guessed, you'll need to find out more 
maybe).

Hope that helps,

Stefan

-- 
best regards,

Stefan Seidel
software developer
________________________
VUB Printmedia GmbH
Chopinstraße 4
D-04103 Leipzig
Germany
tel.    +49 (341) 9 60 50 07
fax.    +49 (341) 9 60 50 92
mail.   sseidel@vub.de
web.    www.vub.de

HRB Köln 24015
UStID DE 122 649 251
GF Dr. Achim Preuss Neudorf,
Dr. Christian Preuss Neudorf

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org