<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://bliki.brandonburk.com/snipsnap/rdf'>
    <s:Snip rdf:about='http://bliki.brandonburk.com/snipsnap/rdf#Releasing+with+Maven'
         s:cUser='brandon'
         s:oUser=''
         s:mUser='brandon'>
        <s:name>Releasing with Maven</s:name>
        <s:content>1 Initial Setup and Configuration to Release with Ease&#xD;&#xA;&#xD;&#xA;Most organizations, especially enterprises, require encrypted connectivity to network resources such as CVS. When releasing with Maven using an SSH connection to your CVS server and your remote repository, it is ideal to perform a public key swap with the servers you will be communicating.&#xD;&#xA;&#xD;&#xA;1.1 [Notes on Performing a SSH Public Key Swap]&#xD;&#xA;&#xD;&#xA;1 Preparing your Project&#xD;&#xA;&#xD;&#xA;As part of the release process, Maven will physically deploy your application artifacts, source, and generated site to your team Maven repository. Maven must be told where the version control system and Maven repository servers are located.&#xD;&#xA;&#xD;&#xA;1.1 POM Preparation&#xD;&#xA;&#xD;&#xA;__SCM Configuration__&#xD;&#xA;&#xD;&#xA;When using the Maven release plugin to perform a release, it will first check for local modifications to the code that have not been committed to your source control repository. Additionally it will tag your project for you. To instruct Maven on how to connect to your SCM repository and where your project is stored you must include SCM information in your POM (the master POM if this is a multi-module project).&#xD;&#xA;&#xD;&#xA;SCM Example for a CVS Repository&#xD;&#xA;{code}&#xD;&#xA;&lt;scm&gt;&#xD;&#xA;  &lt;connection&gt;&#xD;&#xA;    scm:cvs:ext:foo@myserver:/usr/cvsroot:module/project&#xD;&#xA;  &lt;/connection&gt;&#xD;&#xA;&lt;/scm&gt;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;More information about the SCM element of the POM can be found at http://maven.apache.org/pom.html#SCM.&#xD;&#xA;&#xD;&#xA;__Artifact Distribution Configuration__&#xD;&#xA;&#xD;&#xA;Next the POM needs to know where and how to physically distribute your released software. This is declared in the distributionManagement element as follows:&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;&lt;distributionManagement&gt;&#xD;&#xA;  &lt;repository&gt;&#xD;&#xA;    &lt;id&gt;team-maven-repo&lt;/id&gt;&#xD;&#xA;    &lt;name&gt;my-team-maven-repo&lt;/name&gt;&#xD;&#xA;    &lt;url&gt;&#xD;&#xA;      scpexe://myserver/home/Brandon/maven/team/&lt;myteam&gt;/repository&#xD;&#xA;    &lt;/url&gt;&#xD;&#xA;  &lt;/repository&gt;&#xD;&#xA;  &lt;site&gt;&#xD;&#xA;    &lt;id&gt;team-maven-site&lt;/id&gt;&#xD;&#xA;    &lt;name&gt;my-team-maven-site&lt;/name&gt;&#xD;&#xA;    &lt;url&gt;&#xD;&#xA;      scpexe://myserver/home/Brandon/maven/team/&lt;myteam&gt;/site&#xD;&#xA;    &lt;/url&gt;&#xD;&#xA;  &lt;/site&gt;&#xD;&#xA;&lt;/distributionManagement&gt;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;The repository element declares the location that will receive the artifacts when released. The site element declares where the auto-generated HTML project web site should be sent.&#xD;&#xA;&#xD;&#xA;In the above example scpexe is used as the protocol handler. This instructs Maven to use an external SCP implementation when copying the files. This is usually necessary when releasing from a Microsoft Windows client. When doing a release from a dedicated build server, a different configuration can be implemented as in the example below.&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA; &lt;profiles&gt;&#xD;&#xA;   &lt;profile&gt;&#xD;&#xA;     &lt;id&gt;env-qual&lt;/id&gt;&#xD;&#xA;     &lt;distributionManagement&gt;&#xD;&#xA;       &lt;repository&gt;&#xD;&#xA;         &lt;id&gt;team-repo&lt;/id&gt;&#xD;&#xA;         &lt;name&gt;Team Maven Repository&lt;/name&gt;&#xD;&#xA;         &lt;url&gt;&#xD;&#xA;           file:///home/buildadm/maven/team/&lt;myteam&gt;/repository&#xD;&#xA;         &lt;/url&gt;&#xD;&#xA;       &lt;/repository&gt;&#xD;&#xA;       &lt;site&gt;&#xD;&#xA;         &lt;id&gt;team-site&lt;/id&gt;&#xD;&#xA;         &lt;name&gt;Team Maven Project Site&lt;/name&gt;&#xD;&#xA;         &lt;url&gt;                                &#xD;&#xA;           file:///home/buildadm/maven/team/&lt;myteam&gt;/site/&lt;myproject&gt;&#xD;&#xA;         &lt;/url&gt;&#xD;&#xA;       &lt;/site&gt;&#xD;&#xA;     &lt;/distributionManagement&gt;&#xD;&#xA;   &lt;/profile&gt;&#xD;&#xA; &lt;/profiles&gt;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;By specifying a separate distributionManagement configuration for a build server we can bypass the overhead of SCP copy operations. The file protocol handler simply copies the files to the specified local path. &#xD;&#xA;&#xD;&#xA;1.1 Releasing in 2 Easy Steps&#xD;&#xA;&#xD;&#xA;# When executing the Maven release plugin pass a command line parameter to override the username used in interactions with CVS.&#xD;&#xA;## {code}mvn -Dusername=jdoe release:prepare{code}&#xD;&#xA;## {code}mvn -Dusername=jdoe release:perform{code}</s:content>
        <s:mTime>2007-04-11 00:52:35.0</s:mTime>
        <s:cTime>2007-02-15 00:29:58.0</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='http://bliki.brandonburk.com/snipsnap/rdf#Real World Maven'/>
                <rdf:li rdf:resource='http://bliki.brandonburk.com/snipsnap/rdf#Notes on Performing a SSH Public Key Swap'/>
                <rdf:li rdf:resource='http://bliki.brandonburk.com/snipsnap/rdf#start/2007-02-15/1'/>
                <rdf:li rdf:resource='http://bliki.brandonburk.com/snipsnap/rdf#Presentations and Talks'/>
                <rdf:li rdf:resource='http://bliki.brandonburk.com/snipsnap/rdf#Releasing with Maven/'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>

