mavensvnmaven-scm

Maven scm and svn


I am having trouble accessing the svn revision number through Maven. The only real help I've received from the SCM usage page is the following:

<scm>
    <connection>scm:svn:http://somerepository.com/svn_repo/trunk</connection>
    <developerConnection>scm:svn:https://somerepository.com/svn_repo/trunk</developerConnection>
    <tag>HEAD</tag>
    <url>http://somerepository.com/view.cvs</url>
</scm>

This means nothing to me as I can't figure out what connection, developerConnection, and url mean. I simply plugged in the url to my repo for all 3 elements. I also don't know why Maven does not ask me for the username and password for the repository.

I am very new to Maven and might be asking a very basic question but would appreciate a full explanation as to how I am to access the svn repo.


Solution

  • First I would begin by clarifying the usage of Maven which seems to cause the confusion in your case:

    Apache Maven is a software project management tool... that can manage the project's build.

    Apache Maven has nothing to do with your revisions being pushed to your source code management system (SVN in your case).

    Typically, you'll be pushing your changes through an IDE (Eclipse, IntelliJ IDEA and alike) or through a command line to your SVN repository and you won't in any way be pushing those changes through Maven in which case you'll be breaking its usage purpose.

    Now comes the question, why you may need then those SCM related properties? The answer is simple and should be relevant since Maven is a project build tool, it must handle your project release cycle which is final piece of the project build cycle... And it won't be able to do it in coherent way without updating your remote project informations since you are using an SCM remote repository.

    Now back to those SCM related properties, and what do they mean: