Home > Enterprise >  Best way to turn in a java project: Maven vs Simple java project
Best way to turn in a java project: Maven vs Simple java project

Time:11-11

Here is my situation: I am turning in a coding challenge for an interview. We are allowed to use any programming language, I chose Java. I completed the project and it provides the correct output, but I am stuck on some technicalities of turning it in. The spec says that it will be compiled and run using the terminal on a mac or linux machine, and it says to "turn in source code only, please do not include compilation artifacts or binary dependencies". I have a couple jars as dependencies. Does this mean I can't include them with my source code? How would they compile the program then. Right now I am not using any management tool. I could use Maven and declare the dependencies in the pom.xml, but then I have to assume whoever grades my solution has Maven installed to run "mvn".

Should I stick with a basic java project and include the jars, use Maven instead, or is there another better way to do this? Sorry if I am overthinking this, I want to make it simple to run my project so my work can be assessed for its accuracy, not how I packaged it.

CodePudding user response:

Yes, you can't include any dependencies as JARs. You need to use Maven or Gradle for this.

You don't need to assume that Maven is installed, Maven Wrapper can be used instead.

CodePudding user response:

You can provide mvnw, what stands for maven wrapper. It's project-local installation of maven that is treated as source code and is used by calling ./mvnw instead of global mvn command (to make it working for the first time, use mvn -N io.takari:maven:wrapper). Reference.

  • Related