This is the error I get when I try to precompile my project with the mojo JSPC
plugin by codehaus.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] JSPC Error
Embedded error: File "/META-INF/tlds/struts-html.tld" not found
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: JSPC Error
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:564)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:480)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:459)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.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(DefaultPlugi
nManager.java:447)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:539)
... 16 more
Caused by: org.apache.jasper.JasperException: File "/META-INF/tlds/struts-html.t
ld" not found
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorH
andler.java:50)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.j
ava:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.j
ava:114)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoIm
pl.java:159)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:42
3)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.
java:211)
at org.apache.jasper.compiler.ParserController.parse(ParserController.ja
va:100)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
at org.apache.jasper.JspC.processFile(JspC.java:986)
at org.apache.jasper.JspC.execute(JspC.java:1135)
at org.codehaus.mojo.jspc.AbstractJspcMojo.execute(AbstractJspcMojo.java
:248)
... 18 more
I checked and it is clearly in my maven repository, and I can
see it in the target/WEB-INF/lib directory, also. I have been
searching the internet for a few days now and fiddling with all sorts
of things in my project, but I just can't get it to work.
Can anybody help me? Please? I beg of you?
Here is what is in my base pom.xml file.
<plugin>
<dependencies>
<dependency>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
<version>1.2.8</version>
<scope>compile</scope>
</dependency>
</dependencies>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jspc-maven-plugin</artifactId>
<configuration>
<webXml>${basedir}/target/jspweb.xml</webXml>
<injectString><!-- [INSERT FRAGMENT HERE]
--></injectString>
<inputWebXml>${basedir}/src/main/webapp/WEB-INF/web.xml</inputWebXml>
<outputWebXml>${project.build.directory}/jspweb.xml</outputWebXml>
<!--
<warSourceDirectory>${basedir}/target/meeting-planner</warSourceDirectory> -->
<warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>
<webFragmentFile>${project.build.directory}/web-fragment.xml</webFragmentFile>
<workingDirectory>${project.build.directory}/jsp-source</workingDirectory>
<verbose>true</verbose>
<listErrors>true</listErrors>
</configuration>
<executions>
<execution>
<phase>compile</phase> <!-- Can't find the struts tld if
"compile" -->
<id>jspc</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
<!-- For the jspc plugin. -->
<!-- <webXml>${basedir}/target/web.xml</webXml>-->
<webXml>${basedir}/src/main/webapp/WEB-INF/jspweb.xml</webXml>
<webappDirectory>${basedir}/src/main/webapp</webappDirectory>
<webResources>
<resource>
<directory>
${basedir}/src/main/webapp
</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/images/**</exclude>
</excludes>
</resource>
<resource>
<directory>
${basedir}/src/main/webapp
</directory>
<filtering>false</filtering>
<includes>
<include>**/images/**</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
And here is my web.xml:
<servlet>
<!-- Call this servlet admin, so that Tapestry looks in the
admin sub-directory -->
<servlet-name>admin</servlet-name>
<servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Following comment used by the jspc Mojo from Codehaus -->
<!-- more info here ->
http://mojo.codehaus.org/jspc-maven-plugin/usage.html -->
<!-- [INSERT FRAGMENT HERE] -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>remoting</servlet-name>
<url-pattern>/remoting/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>admin</servlet-name>
<url-pattern>/admin</url-pattern>
</servlet-mapping>
<!-- All the required Struts taglibs -->
<!-- Use the taglibs that are embedded in the struts.jar to reduce
dependencies -->
<taglib>
<taglib-uri>http://struts.apache.org/tags-bean</taglib-uri>
<taglib-location>/META-INF/tlds/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts.apache.org/tags-html</taglib-uri>
<taglib-location>/META-INF/tlds/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts.apache.org/tags-logic</taglib-uri>
<taglib-location>/META-INF/tlds/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts.apache.org/tags-tiles</taglib-uri>
<taglib-location>/META-INF/tlds/struts-tiles.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts.apache.org/tags-nested</taglib-uri>
<taglib-location>/META-INF/tlds/struts-nested.tld</taglib-location>
</taglib>
<!-- Spring taglib -->
<taglib>
<taglib-uri>http://www.springframework.org/tags</taglib-uri>
<taglib-location>/META-INF/spring.tld</taglib-location>
</taglib>
</web-app>