Existe-t-il un plugin permettant une precompilation de Jsp ?
Existe-t-il un plugin permettant une precompilation de Jsp ?
Ok, j'ai trouver un petit plugin utilisant un compilateur d'Oracle
Il ne me reste plus qu'a le tester
le plugin à utiliser est le JSP Compiler : http://mojo.codehaus.org/jspc-maven-plugin/
Exemple de conf:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jspc-maven-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>compile</goal> </goals> </execution> </executions> <configuration> <warSourceDirectory>${project.build.directory}/${project.build.finalName}/</warSourceDirectory> <injectString><![CDATA[<!-- [jspc-maven-plugin:post-compiled-jsps-as-servlets] -->]]></injectString> <!-- Uncomment outputWebXml if you want the generated web.xml to be placed in the working directory that the war:war mojo uses. --> <!-- <outputWebXml>${project.build.directory}/${project.build.finalName}/WEB-INF/web.xml</outputWebXml> --> </configuration> </plugin>
Je viens effectivement d'utiliser ce plugin qui me semblait moins compliquer a mettre en oeuvre que celui que j'ai trouve.
Maintenant en utilisant ta conf j'ai cette erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41 [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] JSPC Error Embedded error: The -uriroot option must specify a pre-existing directory [INFO] ------------------------------------------------------------------------ [DEBUG] Trace org.apache.maven.lifecycle.LifecycleExecutionException: JSPC Error at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123) at org.apache.maven.cli.MavenCli.main(MavenCli.java:272) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.MojoExecutionException: JSPC Error at org.codehaus.mojo.jspc.AbstractJspcMojo.execute(AbstractJspcMojo.java:265) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:420) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539) ... 16 more Caused by: org.apache.jasper.JasperException: The -uriroot option must specify a pre-existing directory at org.apache.jasper.JspC.execute(JspC.java:1107) at org.codehaus.mojo.jspc.AbstractJspcMojo.execute(AbstractJspcMojo.java:248) ... 18 more [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5 seconds [INFO] Finished at: Fri Apr 06 12:40:17 CEST 2007 [INFO] Final Memory: 5M/508M [INFO] ------------------------------------------------------------------------
J'utilise la version 1.4.6 qui fonctionne correctement pour moi. Il me semble que ce n'est pas cette version que tu utilises.
Lances maven en mode debug pour voir les arguments passés a jspc.
Dans mon cas, je redefini le warSourceDirectory au lieu d'utiliser la valeur par défaut src/main/webapp car je fais quelques actions sur la webapp avant de faire la compil, peut-être que dans ton cas, tu peux utiliser le répertoire par défaut.
Partager