Search code examples
gitmavenopen-source

Is there a specific command to run a project using Git cmd?


I cloned an open-source project from GitHub. I have Git cmd and I know how to use it, but I wonder if there's a command to run the project from there. It's a maven project.

The project worked fine in Eclipse, but the frame wasn't exactly as the one in README.md. The last line of the application frame was omitted. So, I think there's a possibility to the frame to be the same as the one in that repository if I run it from the Git cmd.

Here are these three lines I found in README.md (I did step 1 and 2):

  1. clone repo: https://github.com/stalk-calvin/tetris-game.git
  2. cd tetris-game
  3. run: mvn install exec:java -Dexec.mainClass="tetris.Main"

Any idea how to do step 3 above?


Solution

  • The git cmd can rewrite %PATH% in order to include git.
    But that means maven might not be included in said PATH.

    First, you don't have to stay in a Git CMD session. You can perform the maven step in a regular CMD shell.

    Make sure you have:

    • java in your PATH (does java -version work?)
    • download maven anywhere you want
    • The user environment variable M2_HOME defined (referencing the folder where you have download maven)
    • a PATH with %M2_HOME%\bin added to it
    • mvn -version working.