Tim Cooke wrote:When you run a "mvn clean install" you are asking Maven to create a jar file that contains all your project code, files, and dependencies. So you would deliver the jar to the client which comes with everything already packaged in it.
I believe that is incorrect. Unless I'm mistaken, "mvn install" constructs the product and installs the product (jar, war, ear, or whatever) along with supporting pom dependency information into the local Maven repository. But does not copy any source code or other files from outside the project's "target" directory.
I know that a lot of public projects
do include source code, since I've used the Maven source pull option. But there may be some other target that handles that. I'd have to RTFM. I've only used that feature to make source available for debugger use (where the source archive remains unzipped in the Maven repo). I've never used it to actually build.
Normally when I deliver a maven project to a client, I just do a "mvn clean" followed by a zip-and-ship of the cleaned project directory. If my project is self-contained (and ideally it is), that's all the recipient needs. All the source code is in the ZIPped project and a maven build will reconstruct the cleaned-out files, giving an environment identical to the one I work with.
I've done that many times.