简体   繁体   中英

How should I configure my MAVEN project(s) in SCM?

Should I commit the ENTIRE codebase, as well as the POM(s), and have users check out projects one at a time for multiple maven projects, one of which contains several modules?

Should I ONLY commit the POMs, and configure SCM information within each POM?

How do commits/check outs work when you configure the maven SCM plugin? Do you store the POM's via subversion, check them out, and then materialize the POM so maven will download the rest of the corresponding files to that project? What if you needed to add new files, but you were using SCM through maven?

I'm very confused about the difference between just storing files using svn (the standard way), vs storing the SCM information on a per-pom basis. There appears to be absolutely NOTHING for documentation on how to use Maven and load it with SCM information.

Is it best to store the SCM information directly inside of POMs, or as I said before, should I just add entire projects to SVN including their respective POMs?

Or is it better to embed the SCM information directly into maven, and have maven materialize said project? Does the Maven SCM plugin play nicely with subclipse? For example - after you "materialize" a project from a maven POM, does it import the project files from SVN, and then show them in eclipse as under version control? If I was embedding SCM information into maven POMs, would I then just create a separate SVN repo for ONLY my pom files? Or would I just put all the POM files directly in the trunk of my engineering repo?

Hopefully someone can help me clarify this. I'm very confused. Thanks!

Always commit all your source code in the SCM. Otherwise you don't have a history of your source code.

Also commit your pom in SCM, otherwise you don't have a history of how it should be built. Such a history is critical for being able to build old branches of your software, and since the build and the source code is so tightly coupled, it is a good idea to commit the pom.xml in the same repository as your source code.

To facilitate other maven tools, you might want to mention your SCM in the pom.xml. That is optional, but I would highly recommend you do it. This allows CI systems to verify that their copy of the source code is the latest, and gives them the configuration needed to checkout a new copy if necessary.

I am not aware of any tool or plugin that actually checks in code for you. If you don't check in your source code, then all the other tools will check out a simple pom.xml (because that's all that is in the SCM), and the SCM reference won't be able to tell anyone where the source code is (because it is not in the SCM).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM