gwt-maven-plugin: how can I chnage the Jetty port?

414 views
Skip to first unread message

Tom Pijl

unread,
Feb 23, 2017, 6:19:02 AM2/23/17
to GWT Users
I am using the gwt-maven-plug of Thomas Broyer.
I would like to change the Jetty server port from (default) 8888 to e.g. 4200 when running mvn gwt:devmode.
Any pointers on how to configure that?

Thomas Broyer

unread,
Feb 23, 2017, 6:21:51 AM2/23/17
to GWT Users
You'd use devmodeArgs to pass the -port argument:
<devmodeArgs>
  <arg>-port</arg><arg>4200</arg>
</devmodeArgs>
Message has been deleted

Thad Humphries

unread,
Oct 4, 2018, 6:08:56 PM10/4/18
to GWT Users
Where does this go? Which pom.xml? Sorry, I'm looking at returning to Maven because of the lack of Gradle support and their dizzying rate of updates.

So, I've generated a modular-webapp, I tried

  <plugin>
   
<groupId>net.ltgt.gwt.maven</groupId>
   
<artifactId>gwt-maven-plugin</artifactId>
   
<version>1.0-rc-9</version>
   
<extensions>true</extensions>
   
<configuration>
     
<sourceLevel>1.8</sourceLevel>
     
<failOnError>true</failOnError>
     
<devmodeArgs>
       
<arg>-port</arg><arg>8888</arg>
     
</devmodeArgs>
   
</configuration>
 
</plugin>


in the top-level pom.xm. Port 8888 is open, but I still get 

[ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.4.8.v20171121:run (default-cli) on project web8-server: Failure: Address already in use

I've tried other places, but I'm out of ideas.

Thomas Broyer

unread,
Oct 5, 2018, 3:10:26 AM10/5/18
to GWT Users
GWT with Gradle is only a couple adhoc tasks away, so no need to change build tool because plugins are lacking.

Back to Maven, the archetype doesn't use the embedded jetty in DevMode, so you need to configure the port in the jetty plugin (there has been an issue on that exact matter a few days ago, go check it out, I had put links to the jetty-maven-plugin docs and a configuration snippet).
You would use codeserverArgs on the root POM to configure the CodeServer port if you'd want to change it.
devmodeArgs is for "mvn gwt:devmode" which you won't use here.

…but as I said above, I'd stay with Gradle and replace the plugin with two adhoc JavaExec tasks for compilation and CodeServer/DevMode, and possibly Gretty for launching a servlet container.

Pavlo Iatsiuk

unread,
Oct 5, 2018, 10:27:42 AM10/5/18
to GWT Users
GWT uses jetty, so try simple to all this property to command line invocation "-Djetty.port=4200"
So your command should look like
mvn gwt:run -Djetty.port=4200

четвер, 23 лютого 2017 р. 12:19:02 UTC+1 користувач Tom Pijl написав:
Reply all
Reply to author
Forward
0 new messages