Change fitNesse port through Eclipse

735 Views Asked by At

Using Eclipse, I have created a Fitnesse framework. When I run the simple calculator example (Right Click - Run as java app) my console throws the error -

Starting FitNesse on port: 80 SEVERE: FitNesse cannot be started... SEVERE: Port 80 is already in use. SEVERE: Use the -p command line argument to use a different port.

I do not want to use the command line to manually change the default port. I want to change it through Eclipse? How do I do this? I am new to this so please explain plainly.

Many thanks,

3

There are 3 best solutions below

0
On BEST ANSWER

Within Eclipse, when you right click the project, to "Run as Java Application", that same dropdown has an option to "Run Configurations", choose this. In the pop up modal that will appear, we can enter -p port# as an argument. Save and Close. Now "Run as Java Application".

0
On

you need to modify file bulid.gradle

open the gradle file and find task run, set port 80

task run(type: JavaExec) {
    dependsOn classes, copyRuntimeLibs
    classpath = sourceSets.main.runtimeClasspath
    main "fitnesseMain.FitNesseMain"
    args "-p", "80", "-e", "0"
}

build fitnesse preject and run FitnesseMain

0
On

If you are using Maven rather gradle, try using antrun plugin and specify port number in the task args. Then, run start-fitnesse task

<plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.6</version>
        <executions>
          <execution>
            <id>start-fitnesse</id>
            <phase>test</phase>
            <configuration>
              <tasks>
                <echo taskname="fitnesse" message="Starting FitNesse..." />
                <java classname="fitnesseMain.FitNesseMain" classpathref="maven.runtime.classpath"
                  fork="true">
                  <arg line="-p 49231" />
                  <arg line="-v " />
                  <arg line="-d ." />
                </java>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>