Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of adding scm information to a maven pom?

Tags:

svn

maven

I understand why you would want to add archive information to a pom. But why SCM info? Is it possible to materialize a project completely from a pom?

The way I've always stored maven projects in svn, is I add everything (including the eclipse project, maven pom), to a repository. Any time I make a change to anything (including the pom), I do a SVN commit.

Is there a way to perform SVN operations directly through maven? Is this a best practice?

like image 290
Sam Levin Avatar asked Nov 14 '11 15:11

Sam Levin


People also ask

What is the use of SCM in Maven?

Maven SCM supports Maven plugins (for example maven-release-plugin) and other tools by providing them with a common API for source code management operations. You can look at the list of SCMs for more information on using Maven SCM with your favorite SCM tool.

What does SCM stand for in Maven?

SCM stands for Source Code Management and the plugin provides integrations for different SCM systems like git or subversion.

What is SCM connection in POM XML?

As mentioned in POM Reference: SCM The connection requires read access for Maven to be able to find the source code (for example, an update), developerConnection requires a connection that will give write access .

What is the purpose of execution tag in POM XML?

The <execution> block is required to bind plugin execution to one of Maven's lifecycles. For surefire this is not necessary, since it is bound to the test phase by default. Note that the <execution> block can also contain a <configuration> block, so you can have multiple executions with different configurations.


Video Answer


2 Answers

Another thing is important to know about Maven in this relationship, because if you are doing releases via the maven-release-plugin for which you need the SCM information, maven will automatically create SCM Tags for you etc.

Furthermore it's interesting to know where a project comes from if you are using an artifact in particularly in a commercial environment. (It's good to produce maven sites for that case).

It's also possible to do operations via the maven-release-plugin (create a branch) via Maven not via SVN directly.

like image 114
khmarbaise Avatar answered Oct 11 '22 02:10

khmarbaise


The SCM plugin among other features such as site generation use the SCM configuration in the POM. The M2Eclipse plugin will materialize your Maven project from SCM using the configuration found in the POM.

like image 20
Sri Sankaran Avatar answered Oct 11 '22 02:10

Sri Sankaran