Recent Posts
Archives

PostHeaderIcon 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-plugin)

I get this error:

[java] Error configuring: org.mortbay.jetty:jetty-maven-plugin. Reason: ERROR: Cannot override read-only parameter: contextPath in goal: jetty:run-exploded[/java]

Quick fix

Insert a tag <webAppConfig> between <configuration> and <contextPath>. In other terms, replace this block:

[xml]<configuration>
<contextPath>/I/love/USA</contextPath>
</configuration>[/xml]

with that one:

[xml]<configuration>
<webAppConfig>
<contextPath>/I/love/USA</contextPath>
</webAppConfig>
</configuration>[/xml]

Leave a Reply