1

I am trying to run a java file build in maven by using

/zhome/9e/b/129343/Maven/apache-maven-3.6.3/bin/mvn exec:java -Dexec.mainClass="org.matsim.contrib.ev.example.MyRunEvExample"

However, although the location of an input file is: final String ChargersCoords = "test/input/org/matsim/contrib/ev/example/RunEvExample/new_10_test_ChargersFred_Feed_Tab.csv";

I get the following error: An exception occured while executing the Java class. zhome/9e/b/129343/Downloads/new_10_test_ChargersFred_Feed_Tab.csv (No such file or directory)

It seems like it does not see the new location of the file although I have saved the file before running it. Does it need to compile first before running or that's not the issue? Thanks in advance

user3474218
  • 51
  • 1
  • 7

1 Answers1

1

Yes, you need to compile first: you are executing a plugin goal without any attached maven build lifecycle.

Possible solutions:

  1. either use mvn compile exec:java

  2. create an execution in the exec-maven-plugin and attach it to a phase, e.g. test (not recommended).

  3. Create an execution and do not attach it to a phase. Instead, run it by using the @ separator. More details in this how-to.

  4. create a profile which will attach the execution to a test.

Benjamin Marwell
  • 1,173
  • 1
  • 13
  • 36