Maven / Jetty / Cannot override read-only parameter: contextPath in goal
Case
My project is deployed via Maven on a Jetty 6 server. I have to upgrade the server to Jetty 7.
(BTW: notice that the plugin maven-jetty-plugin
was renamed as jetty-maven-plugi
n)
I get this error:
Error configuring: org.mortbay.jetty:jetty-maven-plugin. Reason: ERROR: Cannot override read-only parameter: contextPath in goal: jetty:run-exploded
Quick fix
Insert a tag <webAppConfig>
between <configuration>
and <contextPath>
. In other terms, replace this block:
<configuration> <contextPath>/I/love/USA</contextPath> </configuration>
with that one:
<configuration> <webAppConfig> <contextPath>/I/love/USA</contextPath> </webAppConfig> </configuration>