Search
Calendar
May 2025
S M T W T F S
« Apr    
 123
45678910
11121314151617
18192021222324
25262728293031
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:

 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>

Leave a Reply