asked about this in the maven mailing list and it is quite easily done:
Add the below profile to the pom, it will override the scope for the jsp-api and include the tomcat jars.
Run with: mvn -P jettyConfig clean jetty6:run
<profiles>
<profile>
<id>jettyConfig</id>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>
2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-compiler</artifactId>
<version>5.5.9</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-runtime</artifactId>
<version>5.5.9</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-compiler-jdt</artifactId>
<version>5.5.9 </version>
<scope>compile</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-compiler</artifactId>
<version>5.5.9</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-runtime</artifactId>
<version>5.5.9</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-compiler-jdt</artifactId>
<version>5.5.9 </version>
<scope>compile</scope>
</dependency>
</dependencies>
</profile>
</profiles>
On 31/03/06, Mikael Andersson <[EMAIL PROTECTED]> wrote:
Solved.
First I needed to change from provided to compile scope for the jsp-api dependency.
Then I needed to add the following dependencies to the pom, for JSP support:
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-compiler</artifactId>
<version>5.5.9</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-runtime</artifactId>
<version>5.5.9</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-compiler-jdt</artifactId>
<version>5.5.9</version>
<scope>compile</scope>
</dependency>
Does anyone have a nice maven2 trick to easily switch the sope of those dependencies, kind of a pain and easy to forget to manually change them.
- MickeOn 31/03/06, Mikael Andersson < [EMAIL PROTECTED]> wrote:Hi,
I have having some problems with the myfaces-archetype.
Not sure if I am missing something or if it is a bug, I think I used the archetype a while ago without any problems though...
When doing the following:
% mvn archetype:create -DarchetypeGroupId=org.apache.myfaces -DarchetypeArtifactId=myfaces-archetype -DarchetypeVersion=1.0-SNAPSHOT -DgroupId=demos -DartifactId=demo1
% cd demo1
% mvn jetty6:run
I get the following when jetty starts up:
:WARN: failed [EMAIL PROTECTED]/demo1,file:/home/mikael/ews/demos/demo1/src/main/webapp/}
:INFO: Started SelectChannelConnector @ 0.0.0.0:8080
:WARN: failed [EMAIL PROTECTED]
[INFO] Jetty server exiting.
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] javax/servlet/jsp/el/ELException
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NoClassDefFoundError: javax/servlet/jsp/el/ELException
at org.apache.myfaces.config.FacesConfigurator.feedStandardConfig(FacesConfigurator.java:138)
at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:115) at org.apache.myfaces.webapp.StartupServletContextListener.initFaces(StartupServletContextListener.java:63)
at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:46)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:368)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:967)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:341)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:368)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:37)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:133)
at org.mortbay.jetty.Server.doStart(Server.java:256)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:37)
at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:114)
at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:380) at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:333)
at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:149)
at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:160)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:488)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:458)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
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:585)
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)
Then I changed all provided scope to compile, then jetty starts up fine, but when viewing a web page I get this:
HTTP ERROR: 500
JSP support not configuredRequestURI=/demo1/index.jsp
Spotted this in the jetty log:
:INFO: NO JSP Support for /demo1, did not find org.apache.jasper.servlet.JspServlet
Cheers,Mikael

